text:
%%% -*-BibTeX-*-
%%% Do NOT edit. File created by BibTeX with style
%%% ACM-Reference-Format-Journals [18-Jan-2012].

\begin{thebibliography}{35}

%%% ====================================================================
%%% NOTE TO THE USER: you can override these defaults by providing
%%% customized versions of any of these macros before the \bibliography
%%% command.  Each of them MUST provide its own final punctuation,
%%% except for \shownote{}, \showDOI{}, and \showURL{}.  The latter two
%%% do not use final punctuation, in order to avoid confusing it with
%%% the Web address.
%%%
%%% To suppress output of a particular field, define its macro to expand
%%% to an empty string, or better, \unskip, like this:
%%%
%%% \newcommand{\showDOI}[1]{\unskip}   % LaTeX syntax
%%%
%%% \def \showDOI #1{\unskip}           % plain TeX syntax
%%%
%%% ====================================================================

\ifx \showCODEN    \undefined \def \showCODEN     #1{\unskip}     \fi
\ifx \showDOI      \undefined \def \showDOI       #1{#1}\fi
\ifx \showISBNx    \undefined \def \showISBNx     #1{\unskip}     \fi
\ifx \showISBNxiii \undefined \def \showISBNxiii  #1{\unskip}     \fi
\ifx \showISSN     \undefined \def \showISSN      #1{\unskip}     \fi
\ifx \showLCCN     \undefined \def \showLCCN      #1{\unskip}     \fi
\ifx \shownote     \undefined \def \shownote      #1{#1}          \fi
\ifx \showarticletitle \undefined \def \showarticletitle #1{#1}   \fi
\ifx \showURL      \undefined \def \showURL       {\relax}        \fi
% The following commands are used for tagged output and should be
% invisible to TeX
\providecommand\bibfield[2]{#2}
\providecommand\bibinfo[2]{#2}
\providecommand\natexlab[1]{#1}
\providecommand\showeprint[2][]{arXiv:#2}

\bibitem[\protect\citeauthoryear{Altman}{Altman}{1999}]%
        {altman99}
\bibfield{author}{\bibinfo{person}{Eitan Altman}.}
  \bibinfo{year}{1999}\natexlab{}.
\newblock \bibinfo{booktitle}{{\em Constrained Markov decision processes}}.
  Vol.~\bibinfo{volume}{7}.
\newblock \bibinfo{publisher}{CRC Press}.
\newblock

\bibitem[\protect\citeauthoryear{Arcuri and Briand}{Arcuri and Briand}{2011}]%
        {arcuri11}
\bibfield{author}{\bibinfo{person}{A. Arcuri} {and} \bibinfo{person}{L.
  Briand}.} \bibinfo{year}{2011}\natexlab{}.
\newblock \showarticletitle{A practical guide for using statistical tests to
  assess randomized algorithms in software engineering}. In
  \bibinfo{booktitle}{{\em ICSE'11}}. \bibinfo{pages}{1--10}.
\newblock

\bibitem[\protect\citeauthoryear{Baier and McIlraith}{Baier and
  McIlraith}{2009}]%
        {baier09}
\bibfield{author}{\bibinfo{person}{Shirin Sohrabi Jorge~A Baier} {and}
  \bibinfo{person}{Sheila~A McIlraith}.} \bibinfo{year}{2009}\natexlab{}.
\newblock \showarticletitle{HTN planning with preferences}. In
  \bibinfo{booktitle}{{\em 21st Int. Joint Conf. on Artificial Intelligence}}.
  \bibinfo{pages}{1790--1797}.
\newblock

\bibitem[\protect\citeauthoryear{Bansiya and Davis}{Bansiya and Davis}{2002}]%
        {Bansiya02}
\bibfield{author}{\bibinfo{person}{Jagdish Bansiya} {and}
  \bibinfo{person}{Carl~G. Davis}.} \bibinfo{year}{2002}\natexlab{}.
\newblock \showarticletitle{A Hierarchical Model for Object-Oriented Design
  Quality Assessment}.
\newblock \bibinfo{journal}{{\em IEEE Trans. Softw. Eng.\/}}
  \bibinfo{volume}{28}, \bibinfo{number}{1} (\bibinfo{date}{Jan.}
  \bibinfo{year}{2002}), \bibinfo{pages}{4--17}.
\newblock
\showISSN{0098-5589}
\showDOI{%
\url{https://doi.org/10.1109/32.979986}}

\bibitem[\protect\citeauthoryear{Cheng and Jensen}{Cheng and Jensen}{2010}]%
        {Cheng10}
\bibfield{author}{\bibinfo{person}{Betty Cheng} {and} \bibinfo{person}{Adam
  Jensen}.} \bibinfo{year}{2010}\natexlab{}.
\newblock \showarticletitle{On the Use of Genetic Programming for Automated
  Refactoring and the Introduction of Design Patterns}. In
  \bibinfo{booktitle}{{\em Proceedings of the 12th Annual Conference on Genetic
  and Evolutionary Computation}} {\em (\bibinfo{series}{GECCO '10})}.
  \bibinfo{publisher}{ACM}, \bibinfo{address}{New York, NY, USA},
  \bibinfo{pages}{1341--1348}.
\newblock
\showISBNx{978-1-4503-0072-8}
\showDOI{%
\url{https://doi.org/10.1145/1830483.1830731}}

\bibitem[\protect\citeauthoryear{Czerwonka, Das, Nagappan, Tarvo, and
  Teterev}{Czerwonka et~al\mbox{.}}{2011}]%
        {czer11}
\bibfield{author}{\bibinfo{person}{J. Czerwonka}, \bibinfo{person}{R. Das},
  \bibinfo{person}{N. Nagappan}, \bibinfo{person}{A. Tarvo}, {and}
  \bibinfo{person}{A. Teterev}.} \bibinfo{year}{2011}\natexlab{}.
\newblock \showarticletitle{CRANE: Failure Prediction, Change Analysis and Test
  Prioritization in Practice -- Experiences from Windows}. In
  \bibinfo{booktitle}{{\em Software Testing, Verification and Validation
  (ICST), 2011 IEEE Fourth International Conference on}}. \bibinfo{pages}{357
  --366}.
\newblock

\bibitem[\protect\citeauthoryear{Deb, Pratap, Agarwal, and Meyarivan}{Deb
  et~al\mbox{.}}{2002}]%
        {deb00a}
\bibfield{author}{\bibinfo{person}{Kalyanmoy Deb}, \bibinfo{person}{Amrit
  Pratap}, \bibinfo{person}{Sameer Agarwal}, {and} \bibinfo{person}{T
  Meyarivan}.} \bibinfo{year}{2002}\natexlab{}.
\newblock \showarticletitle{{A Fast Elitist Multi-Objective Genetic Algorithm:
  NSGA-II}}.
\newblock \bibinfo{journal}{{\em IEEE Transactions on Evolutionary
  Computation\/}}  \bibinfo{volume}{6} (\bibinfo{year}{2002}),
  \bibinfo{pages}{182--197}.
\newblock

\bibitem[\protect\citeauthoryear{Efron and Tibshirani}{Efron and
  Tibshirani}{1993}]%
        {efron93}
\bibfield{author}{\bibinfo{person}{Bradley Efron} {and}
  \bibinfo{person}{Robert~J Tibshirani}.} \bibinfo{year}{1993}\natexlab{}.
\newblock \bibinfo{booktitle}{{\em An introduction to the bootstrap}}.
\newblock \bibinfo{publisher}{Chapman and Hall}, \bibinfo{address}{London}.
\newblock

\bibitem[\protect\citeauthoryear{Fayyad and Irani}{Fayyad and Irani}{1993}]%
        {fi}
\bibfield{author}{\bibinfo{person}{Usama Fayyad} {and} \bibinfo{person}{Keki
  Irani}.} \bibinfo{year}{1993}\natexlab{}.
\newblock \showarticletitle{Multi-interval discretization of continuous-valued
  attributes for classification learning}.
\newblock \bibinfo{journal}{{\em NASA JPL Archives\/}} (\bibinfo{year}{1993}).
\newblock

\bibitem[\protect\citeauthoryear{Ghallab, Nau, and Traverso}{Ghallab
  et~al\mbox{.}}{2004}]%
        {ghallab04}
\bibfield{author}{\bibinfo{person}{Malik Ghallab}, \bibinfo{person}{Dana Nau},
  {and} \bibinfo{person}{Paolo Traverso}.} \bibinfo{year}{2004}\natexlab{}.
\newblock \bibinfo{booktitle}{{\em Automated Planning: theory and practice}}.
\newblock \bibinfo{publisher}{Elsevier}.
\newblock

\bibitem[\protect\citeauthoryear{Harman, Mansouri, and Zhang}{Harman
  et~al\mbox{.}}{2009}]%
        {Harman2009}
\bibfield{author}{\bibinfo{person}{Mark Harman}, \bibinfo{person}{S~Afshin
  Mansouri}, {and} \bibinfo{person}{Yuanyuan Zhang}.}
  \bibinfo{year}{2009}\natexlab{}.
\newblock \showarticletitle{Search based software engineering: A comprehensive
  analysis and review of trends techniques and applications}.
\newblock \bibinfo{journal}{{\em Dept. Comp. Sci, King's College London, Tech.
  Rep. TR-09-03\/}} (\bibinfo{year}{2009}).
\newblock

\bibitem[\protect\citeauthoryear{Henard, Papadakis, Harman, and Traon}{Henard
  et~al\mbox{.}}{2015}]%
        {henard15}
\bibfield{author}{\bibinfo{person}{C. Henard}, \bibinfo{person}{M. Papadakis},
  \bibinfo{person}{M. Harman}, {and} \bibinfo{person}{Y.~Le Traon}.}
  \bibinfo{year}{2015}\natexlab{}.
\newblock \showarticletitle{Combining Multi-Objective Search and Constraint
  Solving for Configuring Large Software Product Lines}. In
  \bibinfo{booktitle}{{\em 2015 IEEE/ACM 37th IEEE International Conference on
  Software Engineering}}, Vol.~\bibinfo{volume}{1}. \bibinfo{pages}{517--528}.
\newblock
\showISSN{0270-5257}
\showDOI{%
\url{https://doi.org/10.1109/ICSE.2015.69}}

\bibitem[\protect\citeauthoryear{Hihn and Menzies}{Hihn and Menzies}{2015}]%
        {hihn15}
\bibfield{author}{\bibinfo{person}{J. Hihn} {and} \bibinfo{person}{T.
  Menzies}.} \bibinfo{year}{2015}\natexlab{}.
\newblock \showarticletitle{Data Mining Methods and Cost Estimation Models: Why
  is it So Hard to Infuse New Ideas?}. In \bibinfo{booktitle}{{\em 2015 30th
  IEEE/ACM International Conference on Automated Software Engineering Workshop
  (ASEW)}}. \bibinfo{pages}{5--9}.
\newblock
\showDOI{%
\url{https://doi.org/10.1109/ASEW.2015.27}}

\bibitem[\protect\citeauthoryear{Kampenes, Dyb{\aa}, Hannay, and
  Sj{\o}berg}{Kampenes et~al\mbox{.}}{2007}]%
        {kampenes07}
\bibfield{author}{\bibinfo{person}{Vigdis~By Kampenes}, \bibinfo{person}{Tore
  Dyb{\aa}}, \bibinfo{person}{Jo~Erskine Hannay}, {and} \bibinfo{person}{Dag
  I.~K. Sj{\o}berg}.} \bibinfo{year}{2007}\natexlab{}.
\newblock \showarticletitle{A systematic review of effect size in software
  engineering experiments}.
\newblock \bibinfo{journal}{{\em Information {\&} Software Technology\/}}
  \bibinfo{volume}{49}, \bibinfo{number}{11-12} (\bibinfo{year}{2007}),
  \bibinfo{pages}{1073--1086}.
\newblock

\bibitem[\protect\citeauthoryear{Kocaguneli, Zimmermann, Bird, Nagappan, and
  Menzies}{Kocaguneli et~al\mbox{.}}{2013}]%
        {Kocaguneli2013:ep}
\bibfield{author}{\bibinfo{person}{Ekrem Kocaguneli}, \bibinfo{person}{Thomas
  Zimmermann}, \bibinfo{person}{Christian Bird}, \bibinfo{person}{Nachiappan
  Nagappan}, {and} \bibinfo{person}{Tim Menzies}.}
  \bibinfo{year}{2013}\natexlab{}.
\newblock \showarticletitle{{Distributed development considered harmful?}}. In
  \bibinfo{booktitle}{{\em Proceedings - International Conference on Software
  Engineering}}. \bibinfo{pages}{882--890}.
\newblock
\showISBNx{9781467330763}
\showISSN{02705257}
\showDOI{%
\url{https://doi.org/10.1109/ICSE.2013.6606637}}

\bibitem[\protect\citeauthoryear{Krishna, Menzies, and Fu}{Krishna
  et~al\mbox{.}}{2016}]%
        {krishna16}
\bibfield{author}{\bibinfo{person}{Rahul Krishna}, \bibinfo{person}{Tim
  Menzies}, {and} \bibinfo{person}{Wei Fu}.} \bibinfo{year}{2016}\natexlab{}.
\newblock \showarticletitle{{Too much automation? the bellwether effect and its
  implications for transfer learning}}. In \bibinfo{booktitle}{{\em Proceedings
  of the 31st IEEE/ACM International Conference on Automated Software
  Engineering - ASE 2016}}. \bibinfo{publisher}{ACM Press},
  \bibinfo{address}{New York, New York, USA}, \bibinfo{pages}{122--131}.
\newblock
\showISBNx{9781450338455}
\showDOI{%
\url{https://doi.org/10.1145/2970276.2970339}}

\bibitem[\protect\citeauthoryear{Krishna, Menzies, and Layman}{Krishna
  et~al\mbox{.}}{2017}]%
        {krishna17a}
\bibfield{author}{\bibinfo{person}{Rahul Krishna}, \bibinfo{person}{Tim
  Menzies}, {and} \bibinfo{person}{Lucas Layman}.}
  \bibinfo{year}{2017}\natexlab{}.
\newblock \showarticletitle{{Less is more: Minimizing code reorganization using
  XTREE}}.
\newblock \bibinfo{journal}{{\em Information and Software Technology\/}}
  (\bibinfo{date}{mar} \bibinfo{year}{2017}).
\newblock
\showISSN{09505849}
\showDOI{%
\url{https://doi.org/10.1016/j.infsof.2017.03.012}}
\showeprint[arxiv]{1609.03614}

\bibitem[\protect\citeauthoryear{{Le Goues}, Holtschulte, Smith, Brun, Devanbu,
  Forrest, and Weimer}{{Le Goues} et~al\mbox{.}}{2015}]%
        {LeGoues2015}
\bibfield{author}{\bibinfo{person}{Claire {Le Goues}}, \bibinfo{person}{Neal
  Holtschulte}, \bibinfo{person}{Edward~K Smith}, \bibinfo{person}{Yuriy Brun},
  \bibinfo{person}{Premkumar Devanbu}, \bibinfo{person}{Stephanie Forrest},
  {and} \bibinfo{person}{Westley Weimer}.} \bibinfo{year}{2015}\natexlab{}.
\newblock \showarticletitle{{The ManyBugs and IntroClass Benchmarks for
  Automated Repair of C Programs}}.
\newblock \bibinfo{journal}{{\em IEEE Transactions on Software Engineering\/}}
  \bibinfo{volume}{41}, \bibinfo{number}{12} (\bibinfo{date}{dec}
  \bibinfo{year}{2015}), \bibinfo{pages}{1236--1256}.
\newblock
\showISSN{0098-5589}
\showDOI{%
\url{https://doi.org/10.1109/TSE.2015.2454513}}

\bibitem[\protect\citeauthoryear{Menzies, Butcher, Cok, Marcus, Layman, Shull,
  Turhan, and Zimmermann}{Menzies et~al\mbox{.}}{[n. d.]}]%
        {localvsglobal}
\bibfield{author}{\bibinfo{person}{Tim Menzies}, \bibinfo{person}{Andrew
  Butcher}, \bibinfo{person}{David Cok}, \bibinfo{person}{Andrian Marcus},
  \bibinfo{person}{Lucas Layman}, \bibinfo{person}{Forrest Shull},
  \bibinfo{person}{Burak Turhan}, {and} \bibinfo{person}{Thomas Zimmermann}.}
  \bibinfo{year}{[n. d.]}\natexlab{}.
\newblock \bibinfo{journal}{{\em IEEE Transactions on Software Engineering\/}}
  (\bibinfo{year}{[n. d.]}).
\newblock
\showISBNx{9781605580791}
\showISSN{0098-5589}
\showDOI{%
\url{https://doi.org/10.1109/TSE.2012.83}}

\bibitem[\protect\citeauthoryear{Menzies, Dekhtyar, Distefano, and
  Greenwald}{Menzies et~al\mbox{.}}{2007}]%
        {Menzies2007a}
\bibfield{author}{\bibinfo{person}{Tim Menzies}, \bibinfo{person}{Alex
  Dekhtyar}, \bibinfo{person}{Justin Distefano}, {and} \bibinfo{person}{Jeremy
  Greenwald}.} \bibinfo{year}{2007}\natexlab{}.
\newblock \showarticletitle{{Problems with Precision: A Response to "Comments
  on 'Data Mining Static Code Attributes to Learn Defect Predictors'"}}.
\newblock \bibinfo{journal}{{\em IEEE Transactions on Software Engineering\/}}
  \bibinfo{volume}{33}, \bibinfo{number}{9} (\bibinfo{year}{2007}).
\newblock
\showISSN{0098-5589}
\showDOI{%
\url{https://doi.org/10.1109/TSE.2007.70721}}

\bibitem[\protect\citeauthoryear{Mittas and Angelis}{Mittas and
  Angelis}{2013}]%
        {mittas13}
\bibfield{author}{\bibinfo{person}{Nikolaos Mittas} {and}
  \bibinfo{person}{Lefteris Angelis}.} \bibinfo{year}{2013}\natexlab{}.
\newblock \showarticletitle{Ranking and Clustering Software Cost Estimation
  Models through a Multiple Comparisons Algorithm}.
\newblock \bibinfo{journal}{{\em IEEE Trans. Software Eng.\/}}
  \bibinfo{volume}{39}, \bibinfo{number}{4} (\bibinfo{year}{2013}),
  \bibinfo{pages}{537--551}.
\newblock

\bibitem[\protect\citeauthoryear{Mkaouer, Kessentini, Bechikh, Deb, and
  \'{O}~Cinn{\'e}ide}{Mkaouer et~al\mbox{.}}{2014}]%
        {Mkaouer14}
\bibfield{author}{\bibinfo{person}{Mohamed~Wiem Mkaouer},
  \bibinfo{person}{Marouane Kessentini}, \bibinfo{person}{Slim Bechikh},
  \bibinfo{person}{Kalyanmoy Deb}, {and} \bibinfo{person}{Mel
  \'{O}~Cinn{\'e}ide}.} \bibinfo{year}{2014}\natexlab{}.
\newblock \showarticletitle{Recommendation System for Software Refactoring
  Using Innovization and Interactive Dynamic Optimization}. In
  \bibinfo{booktitle}{{\em Proceedings of the 29th ACM/IEEE International
  Conference on Automated Software Engineering}} {\em (\bibinfo{series}{ASE
  '14})}. \bibinfo{publisher}{ACM}, \bibinfo{address}{New York, NY, USA},
  \bibinfo{pages}{331--336}.
\newblock
\showISBNx{978-1-4503-3013-8}
\showDOI{%
\url{https://doi.org/10.1145/2642937.2642965}}

\bibitem[\protect\citeauthoryear{Moghadam}{Moghadam}{2011}]%
        {Moghadam2011}
\bibfield{author}{\bibinfo{person}{Iman~Hemati Moghadam}.}
  \bibinfo{year}{2011}\natexlab{}.
\newblock \bibinfo{booktitle}{{\em Search Based Software Engineering: Third
  International Symposium, SSBSE 2011, Szeged, Hungary, September 10-12, 2011.
  Proceedings}}.
\newblock \bibinfo{publisher}{Springer Berlin Heidelberg},
  \bibinfo{address}{Berlin, Heidelberg}, Chapter Multi-level Automated
  Refactoring Using Design Exploration, \bibinfo{pages}{70--75}.
\newblock
\showISBNx{978-3-642-23716-4}
\showDOI{%
\url{https://doi.org/10.1007/978-3-642-23716-4_9}}

\bibitem[\protect\citeauthoryear{Nair, Menzies, and Chen}{Nair
  et~al\mbox{.}}{2016}]%
        {nair2016accidental}
\bibfield{author}{\bibinfo{person}{Vivek Nair}, \bibinfo{person}{Tim Menzies},
  {and} \bibinfo{person}{Jianfeng Chen}.} \bibinfo{year}{2016}\natexlab{}.
\newblock \showarticletitle{An (accidental) exploration of alternatives to
  evolutionary algorithms for sbse}. In \bibinfo{booktitle}{{\em International
  Symposium on Search Based Software Engineering}}. Springer,
  \bibinfo{pages}{96--111}.
\newblock

\bibitem[\protect\citeauthoryear{Nam and Kim}{Nam and Kim}{2015}]%
        {Nam15}
\bibfield{author}{\bibinfo{person}{Jaechang Nam} {and} \bibinfo{person}{Sunghun
  Kim}.} \bibinfo{year}{2015}\natexlab{}.
\newblock \showarticletitle{{Heterogeneous defect prediction}}. In
  \bibinfo{booktitle}{{\em Proc. 2015 10th Jt. Meet. Found. Softw. Eng. -
  ESEC/FSE 2015}}. \bibinfo{publisher}{ACM Press}, \bibinfo{address}{New York,
  New York, USA}, \bibinfo{pages}{508--519}.
\newblock
\showISBNx{9781450336758}
\showDOI{%
\url{https://doi.org/10.1145/2786805.2786814}}

\bibitem[\protect\citeauthoryear{O'Keeffe and Cinn{\'e}ide}{O'Keeffe and
  Cinn{\'e}ide}{2008}]%
        {OKeeffe08}
\bibfield{author}{\bibinfo{person}{Mark O'Keeffe} {and}
  \bibinfo{person}{Mel~\'{O} Cinn{\'e}ide}.} \bibinfo{year}{2008}\natexlab{}.
\newblock \showarticletitle{Search-based Refactoring: An Empirical Study}.
\newblock \bibinfo{journal}{{\em J. Softw. Maint. Evol.\/}}
  \bibinfo{volume}{20}, \bibinfo{number}{5} (\bibinfo{date}{Sept.}
  \bibinfo{year}{2008}), \bibinfo{pages}{345--364}.
\newblock
\showISSN{1532-060X}
\showDOI{%
\url{https://doi.org/10.1002/smr.v20:5}}

\bibitem[\protect\citeauthoryear{O'Keeffe and Cinneide}{O'Keeffe and
  Cinneide}{2007}]%
        {OKeeffe07}
\bibfield{author}{\bibinfo{person}{Mark~Kent O'Keeffe} {and}
  \bibinfo{person}{Mel~O. Cinneide}.} \bibinfo{year}{2007}\natexlab{}.
\newblock \showarticletitle{Getting the Most from Search-based Refactoring}. In
  \bibinfo{booktitle}{{\em Proceedings of the 9th Annual Conference on Genetic
  and Evolutionary Computation}} {\em (\bibinfo{series}{GECCO '07})}.
  \bibinfo{publisher}{ACM}, \bibinfo{address}{New York, NY, USA},
  \bibinfo{pages}{1114--1120}.
\newblock
\showISBNx{978-1-59593-697-4}
\showDOI{%
\url{https://doi.org/10.1145/1276958.1277177}}

\bibitem[\protect\citeauthoryear{Papakroni}{Papakroni}{2013}]%
        {papa13}
\bibfield{author}{\bibinfo{person}{Vasil Papakroni}.}
  \bibinfo{year}{2013}\natexlab{}.
\newblock {\em \bibinfo{title}{Data Carving: Identifying and Removing
  Irrelevancies in the Data}}.
\newblock \bibinfo{thesistype}{Master's\ thesis}. \bibinfo{school}{Lane
  Department of Computer Science and Electrical Engineering, West Virginia
  Unviersity}.
\newblock

\bibitem[\protect\citeauthoryear{Pedregosa, Varoquaux, Gramfort, Michel,
  Thirion, Grisel, Blondel, Prettenhofer, Weiss, Dubourg, Vanderplas, Passos,
  Cournapeau, Brucher, Perrot, and Duchesnay}{Pedregosa et~al\mbox{.}}{2011}]%
        {scikit-learn}
\bibfield{author}{\bibinfo{person}{F. Pedregosa}, \bibinfo{person}{G.
  Varoquaux}, \bibinfo{person}{A. Gramfort}, \bibinfo{person}{V. Michel},
  \bibinfo{person}{B. Thirion}, \bibinfo{person}{O. Grisel},
  \bibinfo{person}{M. Blondel}, \bibinfo{person}{P. Prettenhofer},
  \bibinfo{person}{R. Weiss}, \bibinfo{person}{V. Dubourg}, \bibinfo{person}{J.
  Vanderplas}, \bibinfo{person}{A. Passos}, \bibinfo{person}{D. Cournapeau},
  \bibinfo{person}{M. Brucher}, \bibinfo{person}{M. Perrot}, {and}
  \bibinfo{person}{E. Duchesnay}.} \bibinfo{year}{2011}\natexlab{}.
\newblock \showarticletitle{Scikit-learn: Machine Learning in {P}ython}.
\newblock \bibinfo{journal}{{\em Journal of Machine Learning Research\/}}
  \bibinfo{volume}{12} (\bibinfo{year}{2011}), \bibinfo{pages}{2825--2830}.
\newblock

\bibitem[\protect\citeauthoryear{Russell and Norvig}{Russell and
  Norvig}{1995}]%
        {norvig}
\bibfield{author}{\bibinfo{person}{Stuart Russell} {and} \bibinfo{person}{Peter
  Norvig}.} \bibinfo{year}{1995}\natexlab{}.
\newblock \bibinfo{booktitle}{{\em Artificial Intelligence: A Modern
  Approach}}.
\newblock \bibinfo{publisher}{Prentice-Hall, Egnlewood Cliffs}.
\newblock
\showISBNx{0-13-604259-7}

\bibitem[\protect\citeauthoryear{Sayyad, Ingram, Menzies, and Ammar}{Sayyad
  et~al\mbox{.}}{2013}]%
        {sayyad13}
\bibfield{author}{\bibinfo{person}{Abdel~Salam Sayyad}, \bibinfo{person}{Joseph
  Ingram}, \bibinfo{person}{Tim Menzies}, {and} \bibinfo{person}{Hany Ammar}.}
  \bibinfo{year}{2013}\natexlab{}.
\newblock \showarticletitle{Scalable product line configuration: A straw to
  break the camel's back}. In \bibinfo{booktitle}{{\em Automated Software
  Engineering (ASE), 2013 IEEE/ACM 28th International Conference on}}. IEEE.
\newblock

\bibitem[\protect\citeauthoryear{Shepperd and MacDonell}{Shepperd and
  MacDonell}{2012}]%
        {shepperd12a}
\bibfield{author}{\bibinfo{person}{Martin~J. Shepperd} {and}
  \bibinfo{person}{Steven~G. MacDonell}.} \bibinfo{year}{2012}\natexlab{}.
\newblock \showarticletitle{Evaluating prediction systems in software project
  estimation}.
\newblock \bibinfo{journal}{{\em Information {\&} Software Technology\/}}
  \bibinfo{volume}{54}, \bibinfo{number}{8} (\bibinfo{year}{2012}),
  \bibinfo{pages}{820--827}.
\newblock

\bibitem[\protect\citeauthoryear{Turhan, Tosun, and Bener}{Turhan
  et~al\mbox{.}}{2011}]%
        {turhan11}
\bibfield{author}{\bibinfo{person}{Burak Turhan}, \bibinfo{person}{Ay{\c{s}}e
  Tosun}, {and} \bibinfo{person}{Ay{\c{s}}e Bener}.}
  \bibinfo{year}{2011}\natexlab{}.
\newblock \showarticletitle{Empirical evaluation of mixed-project defect
  prediction models}. In \bibinfo{booktitle}{{\em Software Engineering and
  Advanced Applications (SEAA), 2011 37th EUROMICRO Conference on}}. IEEE,
  \bibinfo{pages}{396--403}.
\newblock

\bibitem[\protect\citeauthoryear{Weimer, Nguyen, {Le Goues}, and
  Forrest}{Weimer et~al\mbox{.}}{2009}]%
        {Weimer2009}
\bibfield{author}{\bibinfo{person}{Westley Weimer}, \bibinfo{person}{ThanhVu
  Nguyen}, \bibinfo{person}{Claire {Le Goues}}, {and}
  \bibinfo{person}{Stephanie Forrest}.} \bibinfo{year}{2009}\natexlab{}.
\newblock \showarticletitle{{Automatically finding patches using genetic
  programming}}. In \bibinfo{booktitle}{{\em Proceedings - International
  Conference on Software Engineering}}. \bibinfo{publisher}{IEEE},
  \bibinfo{pages}{364--374}.
\newblock
\showISBNx{9781424434527}
\showISSN{02705257}
\showDOI{%
\url{https://doi.org/10.1109/ICSE.2009.5070536}}

\bibitem[\protect\citeauthoryear{Wooldridge and Jennings}{Wooldridge and
  Jennings}{1995}]%
        {wooldridge95}
\bibfield{author}{\bibinfo{person}{Michael Wooldridge} {and}
  \bibinfo{person}{Nicholas~R Jennings}.} \bibinfo{year}{1995}\natexlab{}.
\newblock \showarticletitle{Intelligent agents: Theory and practice}.
\newblock \bibinfo{journal}{{\em The knowledge engineering review\/}}
  \bibinfo{volume}{10}, \bibinfo{number}{2} (\bibinfo{year}{1995}),
  \bibinfo{pages}{115--152}.
\newblock

\end{thebibliography}

extension: bbl


text:
SUMMARY = "QGroundControl Ground Control Station"
HOMEPAGE = "http://qgroundcontrol.org"

LICENSE = "GPLv3"
LIC_FILES_CHKSUM = "file://license.txt;md5=68761bfca0e15a36d3d53528e5239dc5"

inherit qt4x11

DEPENDS += "udev libsdl espeak"

PV = "2.03"
SRCREV = "625abc2c529500167d30d2d4622d2c906bd83e5d"
SRC_URI = "gitsm://github.com/mavlink/qgroundcontrol.git;protocol=https \
           file://0001-QGCExternalLibs.pri-don-t-search-host-directoryies-f.patch \
           file://0002-utils_external.pri-add-consoleprocess_unix.cpp-to-al.patch \
           file://qgc.desktop \
         "

S = "${WORKDIR}/git"

QMAKE_PROFILES = "qgroundcontrol.pro"

# $CXX is used to see which platform we're on, fall back to linux instead of erroring out
do_configure_prepend() {
	sed -i -e 's:error(Unsupported build type):CONFIG += LinuxBuild:' ${S}/qgroundcontrol.pro
	sed -i -e 's:(/usr/include/:(${STAGING_INCDIR}/:g' ${S}/QGCExternalLibs.pri
}

do_install_append() {
	install -d ${D}${bindir}
	install -m 0755 release/qgroundcontrol ${D}${bindir}

	install -d ${D}${datadir}/pixmaps
	install -m 0644 ${S}/files/images/icons/v2/t128.png ${D}${datadir}/pixmaps/

	install -d ${D}${datadir}/applications
	install -m 0644 ${WORKDIR}/qgc.desktop ${D}${datadir}/applications/
}

RDEPENDS_${PN} += "qt4-plugin-sqldriver-sqlite \
                   qt4-plugin-phonon-backend-gstreamer \
                   qt4-plugin-imageformat-svg \
                   qt4-plugin-imageformat-jpeg \
                   qt4-plugin-imageformat-ico \
                  "

license: MIT

repository: koenkooi/meta-uav

license_type: permissive

repo_name: koenkooi/meta-uav

branch_name: refs/heads/master

extension: bb


text:
package logic

import (
	"context"
	"strings"

	"github.com/swanky2009/goim/logic/g"
)

// OnlineTop get the top online address.
func (l *Server) OnlineTop(c context.Context, typeStr string, n int64) (addrs []string, err error) {
	var (
		sids  []string
		metas map[string]map[string]string
		binds string
		ports []string
		addr  string
	)
	if sids, err = l.dao.ServersRank(c, n); err != nil {
		g.Logger.Errorf("ServersRank error(%v)", err)
		return
	}
	//get consul metas
	if metas, err = g.GetCometServiceMetas(); err != nil {
		g.Logger.Errorf("GetCometService error(%v)", err)
		return
	}

	g.Logger.Debugf("GetCometServiceMetas (%v)", metas)

	for _, sid := range sids {
		if meta, ok := metas[sid]; ok {
			if typeStr == "tcp" {
				binds = meta["tcp"]
			} else if typeStr == "ws" {
				binds = meta["ws"]
			} else if typeStr == "wstls" {
				binds = meta["wstls"]
			}
			ports = strings.Split(binds, ",")
			for _, addr = range ports {
				if len(addr) > 0 {
					addrs = append(addrs, addr)
				}
			}
		}
	}
	return
}

// OnlineRoom get rooms online.
func (l *Server) OnlineRoom(c context.Context, rooms []string) (res map[string]int32, err error) {

	if res, err = l.dao.GetAllRoomCount(c); err != nil {
		g.Logger.Errorf("GetAllRoomCount error(%v)", err)
		return
	}
	// if len(rooms) > 0 {
	// 	res = make(map[string]int32, len(rooms))
	// 	for _, roomID := range rooms {
	// 		res[roomID] = roomCount[roomID]
	// 	}
	// } else {
	// 	res = roomCount
	// }
	return
}

extension: go


text:
package sql_exporter

import (
	"fmt"
	"sort"

	"github.com/burningalchemist/sql_exporter/config"
	"github.com/burningalchemist/sql_exporter/errors"
	"github.com/prometheus/client_golang/prometheus"
	dto "github.com/prometheus/client_model/go"
	"google.golang.org/protobuf/proto"
)

// MetricDesc is a descriptor for a family of metrics, sharing the same name, help, labes, type.
type MetricDesc interface {
	Name() string
	Help() string
	ValueType() prometheus.ValueType
	ConstLabels() []*dto.LabelPair
	Labels() []string
	LogContext() string
}

//
// MetricFamily
//

// MetricFamily implements MetricDesc for SQL metrics, with logic for populating its labels and values from sql.Rows.
type MetricFamily struct {
	config      *config.MetricConfig
	constLabels []*dto.LabelPair
	labels      []string
	logContext  string
}

// NewMetricFamily creates a new MetricFamily with the given metric config and const labels (e.g. job and instance).
func NewMetricFamily(logContext string, mc *config.MetricConfig, constLabels []*dto.LabelPair) (*MetricFamily, errors.WithContext) {
	logContext = fmt.Sprintf("%s, metric=%q", logContext, mc.Name)

	if len(mc.Values) == 0 {
		return nil, errors.New(logContext, "no value column defined")
	}
	if len(mc.Values) > 1 && mc.ValueLabel == "" {
		return nil, errors.New(logContext, "multiple values but no value label")
	}
	if len(mc.KeyLabels) > config.MaxInt32 {
		return nil, errors.New(logContext, "key_labels list is too large")
	}

	labels := make([]string, 0, len(mc.KeyLabels)+1)
	labels = append(labels, mc.KeyLabels...)
	if mc.ValueLabel != "" {
		labels = append(labels, mc.ValueLabel)
	}

	// Create a copy of original slice to avoid modifying constLabels
	sortedLabels := append(constLabels[:0:0], constLabels...)

	for k, v := range mc.StaticLabels {
		sortedLabels = append(sortedLabels, &dto.LabelPair{
			Name:  proto.String(k),
			Value: proto.String(v),
		})
	}
	sort.Sort(labelPairSorter(sortedLabels))

	return &MetricFamily{
		config:      mc,
		constLabels: sortedLabels,
		labels:      labels,
		logContext:  logContext,
	}, nil
}

// Collect is the equivalent of prometheus.Collector.Collect() but takes a Query output map to populate values from.
func (mf MetricFamily) Collect(row map[string]interface{}, ch chan<- Metric) {
	labelValues := make([]string, len(mf.labels))
	for i, label := range mf.config.KeyLabels {
		labelValues[i] = row[label].(string)
	}
	for _, v := range mf.config.Values {
		if mf.config.ValueLabel != "" {
			labelValues[len(labelValues)-1] = v
		}
		value := row[v].(float64)
		ch <- NewMetric(&mf, value, labelValues...)
	}
}

// Name implements MetricDesc.
func (mf MetricFamily) Name() string {
	return mf.config.Name
}

// Help implements MetricDesc.
func (mf MetricFamily) Help() string {
	return mf.config.Help
}

// ValueType implements MetricDesc.
func (mf MetricFamily) ValueType() prometheus.ValueType {
	return mf.config.ValueType()
}

// ConstLabels implements MetricDesc.
func (mf MetricFamily) ConstLabels() []*dto.LabelPair {
	return mf.constLabels
}

// Labels implements MetricDesc.
func (mf MetricFamily) Labels() []string {
	return mf.labels
}

// LogContext implements MetricDesc.
func (mf MetricFamily) LogContext() string {
	return mf.logContext
}

//
// automaticMetricDesc
//

// automaticMetric is a MetricDesc for automatically generated metrics (e.g. `up` and `scrape_duration`).
type automaticMetricDesc struct {
	name        string
	help        string
	valueType   prometheus.ValueType
	labels      []string
	constLabels []*dto.LabelPair
	logContext  string
}

// NewAutomaticMetricDesc creates a MetricDesc for automatically generated metrics.
func NewAutomaticMetricDesc(
	logContext, name, help string, valueType prometheus.ValueType, constLabels []*dto.LabelPair, labels ...string,
) MetricDesc {
	return &automaticMetricDesc{
		name:        name,
		help:        help,
		valueType:   valueType,
		constLabels: constLabels,
		labels:      labels,
		logContext:  logContext,
	}
}

// Name implements MetricDesc.
func (a automaticMetricDesc) Name() string {
	return a.name
}

// Help implements MetricDesc.
func (a automaticMetricDesc) Help() string {
	return a.help
}

// ValueType implements MetricDesc.
func (a automaticMetricDesc) ValueType() prometheus.ValueType {
	return a.valueType
}

// ConstLabels implements MetricDesc.
func (a automaticMetricDesc) ConstLabels() []*dto.LabelPair {
	return a.constLabels
}

// Labels implements MetricDesc.
func (a automaticMetricDesc) Labels() []string {
	return a.labels
}

// LogContext implements MetricDesc.
func (a automaticMetricDesc) LogContext() string {
	return a.logContext
}

//
// Metric
//

// A Metric models a single sample value with its meta data being exported to Prometheus.
type Metric interface {
	Desc() MetricDesc
	Write(out *dto.Metric) errors.WithContext
}

// NewMetric returns a metric with one fixed value that cannot be changed.
//
// NewMetric panics if the length of labelValues is not consistent with desc.labels().
func NewMetric(desc MetricDesc, value float64, labelValues ...string) Metric {
	if len(desc.Labels()) != len(labelValues) {
		panic(fmt.Sprintf("[%s] expected %d labels, got %d", desc.LogContext(), len(desc.Labels()), len(labelValues)))
	}
	return &constMetric{
		desc:       desc,
		val:        value,
		labelPairs: makeLabelPairs(desc, labelValues),
	}
}

// constMetric is a metric with one fixed value that cannot be changed.
type constMetric struct {
	desc       MetricDesc
	val        float64
	labelPairs []*dto.LabelPair
}

// Desc implements Metric.
func (m *constMetric) Desc() MetricDesc {
	return m.desc
}

// Write implements Metric.
func (m *constMetric) Write(out *dto.Metric) errors.WithContext {
	out.Label = m.labelPairs
	switch t := m.desc.ValueType(); t {
	case prometheus.CounterValue:
		out.Counter = &dto.Counter{Value: proto.Float64(m.val)}
	case prometheus.GaugeValue:
		out.Gauge = &dto.Gauge{Value: proto.Float64(m.val)}
	default:
		return errors.Errorf(m.desc.LogContext(), "encountered unknown type %v", t)
	}
	return nil
}

func makeLabelPairs(desc MetricDesc, labelValues []string) []*dto.LabelPair {
	labels := desc.Labels()
	constLabels := desc.ConstLabels()

	totalLen := len(labels) + len(constLabels)
	if totalLen == 0 {
		// Super fast path.
		return nil
	}
	if len(labels) == 0 {
		// Moderately fast path.
		return constLabels
	}
	labelPairs := make([]*dto.LabelPair, 0, totalLen)
	for i, label := range labels {
		labelPairs = append(labelPairs, &dto.LabelPair{
			Name:  proto.String(label),
			Value: proto.String(labelValues[i]),
		})
	}
	labelPairs = append(labelPairs, constLabels...)
	sort.Sort(labelPairSorter(labelPairs))
	return labelPairs
}

// labelPairSorter implements sort.Interface.
// It provides a sortable version of a slice of dto.LabelPair pointers.

type labelPairSorter []*dto.LabelPair

func (s labelPairSorter) Len() int {
	return len(s)
}

func (s labelPairSorter) Swap(i, j int) {
	s[i], s[j] = s[j], s[i]
}

func (s labelPairSorter) Less(i, j int) bool {
	return s[i].GetName() < s[j].GetName()
}

type invalidMetric struct {
	err errors.WithContext
}

// NewInvalidMetric returns a metric whose Write method always returns the provided error.
func NewInvalidMetric(err errors.WithContext) Metric {
	return invalidMetric{err}
}

func (m invalidMetric) Desc() MetricDesc { return nil }

func (m invalidMetric) Write(*dto.Metric) errors.WithContext { return m.err }

gha_license_id: MIT

gha_language: Go


text:
package sinks

import (
	"context"
	"io"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/credentials"
	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/aws/aws-sdk-go/service/s3/s3manager"
)

type S3Sink struct {
	bucket   string
	session  *session.Session
	uploader *s3manager.Uploader
	svc      *s3.S3
}

func NewS3Sink(ctx context.Context, cfg Configuration) (*S3Sink, error) {
	sess, err := session.NewSession(aws.NewConfig().WithCredentials(credentials.NewStaticCredentials(cfg.AccessKeyID, cfg.AccessKeySecret, "")).WithRegion(cfg.Region))
	if err != nil {
		return nil, err
	}

	uploader := s3manager.NewUploader(sess)
	svc := s3.New(sess)

	return &S3Sink{
		session:  sess,
		bucket:   cfg.Bucket,
		uploader: uploader,
		svc:      svc,
	}, nil
}

func (s *S3Sink) CreateObject(ctx context.Context, path string, input io.Reader) error {
	up := s3manager.UploadInput{
		Bucket: &s.bucket,
		Body:   input,
		Key:    &path,
	}

	_, err := s.uploader.Upload(&up)
	return err
}

func (s *S3Sink) ListObjects(ctx context.Context, prefix string) ([]BucketObject, error) {
	bucketList, err := s.svc.ListObjectsWithContext(ctx, &s3.ListObjectsInput{
		Bucket: &s.bucket,
		Prefix: &prefix,
	})
	if err != nil {
		return nil, err
	}
	result := make([]BucketObject, 0, len(bucketList.Contents))
	for _, obj := range bucketList.Contents {
		result = append(result, BucketObject{
			Name:   *obj.Key,
			Prefix: *bucketList.Prefix,
			Bucket: s.bucket,
		})
	}
	return nil, nil
}

repository: tobijdc/podcast-archiver

repo_name: tobijdc/podcast-archiver


text:
package notifications

import (
	"fmt"
	"net/http"
	"reflect"
	"strings"

	"github.com/jenkinsci/kubernetes-operator/pkg/apis/jenkins/v1alpha2"
	"github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/notifications/event"
	"github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/notifications/mailgun"
	"github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/notifications/msteams"
	"github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/notifications/slack"
	"github.com/jenkinsci/kubernetes-operator/pkg/controller/jenkins/notifications/smtp"
	k8sevent "github.com/jenkinsci/kubernetes-operator/pkg/event"
	"github.com/jenkinsci/kubernetes-operator/pkg/log"

	"github.com/pkg/errors"
	k8sclient "sigs.k8s.io/controller-runtime/pkg/client"
)

// Provider is the communication service handler
type Provider interface {
	Send(event event.Event) error
}

// Listen listens for incoming events and send it as notifications
func Listen(events chan event.Event, k8sEvent k8sevent.Recorder, k8sClient k8sclient.Client) {
	httpClient := http.Client{}
	for e := range events {
		logger := log.Log.WithValues("cr", e.Jenkins.Name)

		if !e.Reason.HasMessages() {
			logger.V(log.VWarn).Info("Reason has no messages, this should not happen")
			continue // skip empty messages
		}

		k8sEvent.Emit(&e.Jenkins,
			eventLevelToKubernetesEventType(e.Level),
			k8sevent.Reason(reflect.TypeOf(e.Reason).Name()),
			strings.Join(e.Reason.Short(), "; "),
		)

		for _, notificationConfig := range e.Jenkins.Spec.Notifications {
			var err error
			var provider Provider

			if notificationConfig.Slack != nil {
				provider = slack.New(k8sClient, notificationConfig, httpClient)
			} else if notificationConfig.Teams != nil {
				provider = msteams.New(k8sClient, notificationConfig, httpClient)
			} else if notificationConfig.Mailgun != nil {
				provider = mailgun.New(k8sClient, notificationConfig)
			} else if notificationConfig.SMTP != nil {
				provider = smtp.New(k8sClient, notificationConfig)
			} else {
				logger.V(log.VWarn).Info(fmt.Sprintf("Unknown notification service `%+v`", notificationConfig))
				continue
			}

			isInfoEvent := e.Level == v1alpha2.NotificationLevelInfo
			wantsWarning := notificationConfig.LoggingLevel == v1alpha2.NotificationLevelWarning
			if isInfoEvent && wantsWarning {
				continue // skip the event
			}

			go func(notificationConfig v1alpha2.Notification) {
				err = provider.Send(e)
				if err != nil {
					wrapped := errors.WithMessage(err,
						fmt.Sprintf("failed to send notification '%s'", notificationConfig.Name))
					if log.Debug {
						logger.Error(nil, fmt.Sprintf("%+v", wrapped))
					} else {
						logger.Error(nil, fmt.Sprintf("%s", wrapped))
					}
				}
			}(notificationConfig)
		}
	}
}

func eventLevelToKubernetesEventType(level v1alpha2.NotificationLevel) k8sevent.Type {
	switch level {
	case v1alpha2.NotificationLevelWarning:
		return k8sevent.TypeWarning
	case v1alpha2.NotificationLevelInfo:
		return k8sevent.TypeNormal
	default:
		return k8sevent.TypeNormal
	}
}

repository: pdolega/kubernetes-operator

repo_name: pdolega/kubernetes-operator


text:
package main

import (
	"math/rand"
	"time"

	"github.com/gocd-contrib/gocd-cli/cmd"
	"github.com/gocd-contrib/gocd-cli/meta"
)

// These should be set by the linker at build time
var (
	Version   = `devbuild`
	GitCommit = `unknown`
	Platform  = `devbuild`
)

func main() {
	meta.Version = Version
	meta.GitCommit = GitCommit
	meta.Platform = Platform
	cmd.RootCmd.Version = meta.VersionString()

	cmd.Execute()
}

func init() {
	rand.Seed(time.Now().UTC().UnixNano())
}

repository: gocd-contrib/gocd-cli

repo_name: gocd-contrib/gocd-cli


text:
DESCRIPTION = "LXDE Panel"
HOMEPAGE = "http://lxde.org/"
SECTION = "x11"

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=9d19a9495cc76dc96b703fb4aa157183"

RDEPENDS = "gtk+ menu-cache lxmenu-data libxmu libxpm alsa-lib"
DEPENDS = "${RDEPENDS}"

SRC_URI = "${SOURCEFORGE_MIRROR}/lxde/${PN}-${PV}.tar.gz \
           file://lxpanel-0.5.6-broken-apps.patch"
SRC_URI[md5sum] = "129fae75d1cd3983fd94542c573a70a1"
SRC_URI[sha256sum] = "6a3579d6f384c03a33a03e4d32016428c84eb0f2bc421704f724fe2cc015cddd"

inherit autotools gettext pkgconfig

EXTRA_OECONF += "--enable-alsa --with-x --with-plugins=all"

FILES_${PN}-dbg += "${libdir}/lxpanel/plugins/.debug"

repository: tworaz/oe-tworaz

repo_name: tworaz/oe-tworaz

gha_language: Shell


text:
// Autogenerated from KST: please remove this line if doing any edits by hand!

package spec

import (
	"runtime/debug"
	"os"
	"testing"
	"github.com/kaitai-io/kaitai_struct_go_runtime/kaitai"
	. "test_formats"
	"github.com/stretchr/testify/assert"
)

func TestParamsPassArrayUsertype(t *testing.T) {
	defer func() {
		if r := recover(); r != nil {
			debug.PrintStack()
			t.Fatal("unexpected panic:", r)
		}
	}()
	f, err := os.Open("../../src/position_to_end.bin")
	if err != nil {
		t.Fatal(err)
	}
	s := kaitai.NewStream(f)
	var r ParamsPassArrayUsertype
	err = r.Read(s, &r, &r)
	if err != nil {
		t.Fatal(err)
	}

	assert.EqualValues(t, 2, len(r.PassBlocks.Bar))
	assert.EqualValues(t, 1, r.PassBlocks.Bar[0].Foo)
	assert.EqualValues(t, 2, r.PassBlocks.Bar[1].Foo)
	assert.EqualValues(t, []uint8{3}, r.PassBlocks.One)
	assert.EqualValues(t, []uint8{4, 5}, r.PassBlocks.Two)
}

gha_language: Ruby


text:
@article{ekman1967head,
  title={Head and body cues in the judgment of emotion: A reformulation},
  author={Ekman, Paul and Friesen, Wallace V},
  journal={Perceptual and motor skills},
  volume={24},
  number={3  PT 1},
  pages={711--724},
  year={1967}
}

@inproceedings{mccoll2012affect,
  title={Affect detection from body language during social HRI},
  author={McColl, Derek and Nejat, Goldie},
  booktitle={RO-MAN, 2012 IEEE},
  pages={1013--1018},
  year={2012},
  organization={IEEE}
}

@article{mehrabian1969significance,
  title={Significance of posture and position in the communication of attitude and status relationships.},
  author={Mehrabian, Albert},
  journal={Psychological Bulletin},
  volume={71},
  number={5},
  pages={359},
  year={1969},
  publisher={American Psychological Association}
}
@inproceedings{kapur2005gesture,
  title={Gesture-based affective computing on motion capture data},
  author={Kapur, Asha and Kapur, Ajay and Virji-Babul, Naznin and Tzanetakis, George and Driessen, Peter F},
  booktitle={International conference on affective computing and intelligent interaction},
  pages={1--7},
  year={2005},
  organization={Springer}
}
@article{eckman2003emotions,
  title={Emotions revealed},
  author={Eckman, Paul},
  journal={St. Martin’s Griffin, New York},
  year={2003}
}
@inproceedings{cui2016emotion,
  title={Emotion detection from natural walking},
  author={Cui, Liqing and Li, Shun and Zhu, Tingshao},
  booktitle={International Conference on Human Centered Computing},
  pages={23--33},
  year={2016},
  organization={Springer}
}
@article{ekman1974detecting,
  title={Detecting deception from the body or face.},
  author={Ekman, Paul and Friesen, Wallace V},
  journal={Journal of personality and Social Psychology},
  volume={29},
  number={3},
  pages={288},
  year={1974},
  publisher={American Psychological Association}
}
@article{li2016emotion,
  title={Emotion recognition using Kinect motion capture data of human gaits},
  author={Li, Shun and Cui, Liqing and Zhu, Changye and Li, Baobin and Zhao, Nan and Zhu, Tingshao},
  journal={PeerJ},
  volume={4},
  pages={e2364},
  year={2016},
  publisher={PeerJ Inc.}
}
@article{montepare1987identification,
  title={The identification of emotions from gait information},
  author={Montepare, Joann M and Goldstein, Sabra B and Clausen, Annmarie},
  journal={Journal of Nonverbal Behavior},
  volume={11},
  number={1},
  pages={33--42},
  year={1987},
  publisher={Springer}
}
@inproceedings{du20143d,
  title={3D action recognition based on limb angle model},
  author={Du, Jing and Chen, Dongfang},
  booktitle={Information Science and Technology (ICIST), 2014 4th IEEE International Conference on},
  pages={304--307},
  year={2014},
  organization={IEEE}
}
@inproceedings{singh2015edbl,
  title={EDBL-algorithm for detection and analysis of emotion using body language},
  author={Singh, Saurabh and Sharma, Vishal and Jain, Kriti and Bhall, Ravi},
  booktitle={Next Generation Computing Technologies (NGCT), 2015 1st International Conference on},
  pages={820--823},
  year={2015},
  organization={IEEE}
}
@inproceedings{wang2011learning,
  title={Learning hierarchical poselets for human parsing},
  author={Wang, Yang and Tran, Duan and Liao, Zicheng},
  booktitle={Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on},
  pages={1705--1712},
  year={2011},
  organization={IEEE}
}
@article{serre2007robust,
  title={Robust object recognition with cortex-like mechanisms},
  author={Serre, Thomas and Wolf, Lior and Bileschi, Stanley and Riesenhuber, Maximilian and Poggio, Tomaso},
  journal={IEEE transactions on pattern analysis and machine intelligence},
  volume={29},
  number={3},
  pages={411--426},
  year={2007},
  publisher={IEEE}
}
@article{riesenhuber1999hierarchical,
  title={Hierarchical models of object recognition in cortex},
  author={Riesenhuber, Maximilian and Poggio, Tomaso},
  journal={Nature neuroscience},
  volume={2},
  number={11},
  pages={1019},
  year={1999},
  publisher={Nature Publishing Group}
}
@inproceedings{kipp2009gesture,
  title={Gesture and emotion: Can basic gestural form features discriminate emotions?},
  author={Kipp, Michael and Martin, Jean-Claude},
  booktitle={Affective Computing and Intelligent Interaction and Workshops, 2009. ACII 2009. 3rd International Conference on},
  pages={1--8},
  year={2009},
  organization={IEEE}
}
@inproceedings{cao2017realtime,
  title={Realtime multi-person 2d pose estimation using part affinity fields},
  author={Cao, Zhe and Simon, Tomas and Wei, Shih-En and Sheikh, Yaser},
  booktitle={CVPR},
  volume={1},
  number={2},
  pages={7},
  year={2017}
}

@article{triesch2001system,
  title={A system for person-independent hand posture recognition against complex backgrounds},
  author={Triesch, Jochen and Von Der Malsburg, Christoph},
  journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
  volume={23},
  number={12},
  pages={1449--1453},
  year={2001},
  publisher={IEEE}
}
@incollection{wang2007hand,
  title={Hand posture recognition using adaboost with sift for human robot interaction},
  author={Wang, Chieh-Chih and Wang, Ko-Chih},
  booktitle={Recent progress in robotics: viable robotic service to human},
  pages={317--329},
  year={2007},
  publisher={Springer}
}
@article{singhsignificance,
  title={SIGNIFICANCE OF BODILY MOVEMENT FOR DETECTION AND ANALYSIS OF EMOTIONS: A},
  author={Singh, Saurabh and Sethi, Nidhi and Sharma, Vishal}
}
@phdthesis{karg2012pattern,
  title={Pattern recognition algorithms for gait analysis with application to affective computing},
  author={Karg, Michelle},
  year={2012},
  school={Technische Universit{\"a}t M{\"u}nchen}
}
@book{darwin,
	title={The expression of the emotions in man and animals, 2nd ed.},
	author={Darwin, Charles},
	year={1980},
	address={London}
}
@book{tomkins1962,
	title={Affect, imagery, consciousness},
	author={S. S. Tomkins},
	publisher={Springer Verlag},
	year={1962}
}
@article{schindler2008recognizing,
  title={Recognizing emotions expressed by body pose: A biologically inspired neural model},
  author={Schindler, Konrad and Van Gool, Luc and de Gelder, Beatrice},
  journal={Neural networks},
  volume={21},
  number={9},
  pages={1238--1246},
  year={2008},
  publisher={Elsevier}
}
@article{kinsey2012,
	title={12 Ways to spot a liar at work},
	author={Kinsey Goman, Carol},
	journal={Forbes.com},
	year={2012}
}
@book{frijda1986emotions,
  title={The emotions},
  author={Frijda, Nico H},
  year={1986},
  publisher={Cambridge University Press}
}
@book{sorjoo,
  title={The Black Book of Lie Detection},
  author={Soorjoo, Martin},
  year={2009}
}
@article{ekman1993facial,
  title={Facial expression and emotion.},
  author={Ekman, Paul},
  journal={American psychologist},
  volume={48},
  number={4},
  pages={384},
  year={1993},
  publisher={American Psychological Association}
}
@article{ekmann1973universal,
  title={Universal facial expressions in emotion},
  author={EKMANN, P},
  journal={Studia Psychologica},
  volume={15},
  number={2},
  pages={140},
  year={1973},
  publisher={Slovenska akademia vied.}
}
@article{grezes2007perceiving,
  title={Perceiving fear in dynamic body expressions},
  author={Grezes, Julie and Pichon, Swann and De Gelder, Beatrice},
  journal={Neuroimage},
  volume={35},
  number={2},
  pages={959--967},
  year={2007},
  publisher={Elsevier}
}
@article{davis1994nonverbal,
  title={Non-verbal aspects of therapist
attunement},
  author={Davis, M. and Hadiks, D.},
  journal={Journal of Clinical Psychology},
  volume={50},
  number={3},
  pages={393---405},
  year={1994},
  publisher={Wiley}
}
@article{meeren2005rapid,
  title={Rapid perceptual integration of facial expression and emotional body language},
  author={Meeren, Hanneke KM and van Heijnsbergen, Corn{\'e} CRJ and de Gelder, Beatrice},
  journal={Proceedings of the National Academy of Sciences of the United States of America},
  volume={102},
  number={45},
  pages={16518--16523},
  year={2005},
  publisher={National Acad Sciences}
}
@article{de2006towards,
  title={Towards the neurobiology of emotional body language},
  author={De Gelder, Beatrice},
  journal={Nature Reviews Neuroscience},
  volume={7},
  number={3},
  pages={242},
  year={2006},
  publisher={Nature Publishing Group}
}
@inproceedings{kleinsmith2007recognizing,
  title={Recognizing affective dimensions from body posture},
  author={Kleinsmith, Andrea and Bianchi-Berthouze, Nadia},
  booktitle={International conference on affective computing and intelligent interaction},
  pages={48--58},
  year={2007},
  organization={Springer}
}
@inproceedings{kleinsmith2005incremental,
  title={An incremental and interactive affective posture recognition system},
  author={Kleinsmith, Andrea and Fushimi, Tsuyoshi and Bianchi-Berthouze, Nadia},
  booktitle={International Workshop on Adapting the Interaction Style to Affective Factors},
  pages={378--387},
  year={2005}
}
@article{barathi2016lie,
author = {Barathi. C, Soumya},
year = {2016},
month = {02},
pages = {},
title = {Lie Detection based on Facial Micro Expression, Body Language and Speech Analysis},
volume = {V5},
booktitle = {International Journal of Engineering Research and}
}
@inproceedings{cui1995learning,
  title={Learning-based hand sign recognition using SHOSLIF-M},
  author={Cui, Yuntao and Swets, Daniel L and Weng, John J},
  booktitle={Computer Vision, 1995. Proceedings., Fifth International Conference on},
  pages={631--636},
  year={1995},
  organization={IEEE}
}
@inproceedings{hunter1995posture,
  title={Posture estimation in reduced-model gesture input systems},
  author={Hunter, Edward},
  booktitle={Proc. Int'l Workshop on Automatic Face and Gesture Recognition},
  pages={290--295},
  year={1995}
}
@book{kohler1997technical,
  title={Technical details and ergonomical aspects of gesture recognition applied in intelligent home environments},
  author={Kohler, Markus},
  year={1997},
  publisher={Citeseer}
}
@article{min1999visual,
  title={Visual recognition of static/dynamic gesture: Gesture-driven editing system},
  author={Min, Byung-Woo and Yoon, Ho-Sub and Soh, Jung and Ohashi, Takeshi and Ejima, Toshiaki},
  journal={Journal of Visual Languages \& Computing},
  volume={10},
  number={3},
  pages={291--309},
  year={1999},
  publisher={Elsevier}
}
@article{lades1993distortion,
  title={Distortion invariant object recognition in the dynamic link architecture},
  author={Lades, Martin and Vorbruggen, Jan C and Buhmann, Joachim and Lange, J{\"o}rg and Von Der Malsburg, Christoph and Wurtz, Rolf P and Konen, Wolfgang},
  journal={IEEE Transactions on computers},
  volume={42},
  number={3},
  pages={300--311},
  year={1993},
  publisher={IEEE}
}

@book{beale2008affect,
  title={Affect and emotion in human-computer interaction},
  author={Beale, R and Peter, C},
  year={2008},
  publisher={Springer}
}
@article{janssen2008recognition,
  title={Recognition of emotions in gait patterns by means of artificial neural nets},
  author={Janssen, Daniel and Sch{\"o}llhorn, Wolfgang I and Lubienetzki, Jessica and F{\"o}lling, Karina and Kokenge, Henrike and Davids, Keith},
  journal={Journal of Nonverbal Behavior},
  volume={32},
  number={2},
  pages={79--92},
  year={2008},
  publisher={Springer}
}
@article{calvo2010affect,
  title={Affect detection: An interdisciplinary review of models, methods, and their applications},
  author={Calvo, Rafael A and D'Mello, Sidney},
  journal={IEEE Transactions on affective computing},
  volume={1},
  number={1},
  pages={18--37},
  year={2010},
  publisher={IEEE}
}
@article{wang2008recognizing,
  title={Recognizing human emotional state from audiovisual signals},
  author={Wang, Yongjin and Guan, Ling},
  journal={IEEE transactions on multimedia},
  volume={10},
  number={5},
  pages={936--946},
  year={2008},
  publisher={IEEE}
}
@article{ma2006motion,
  title={A motion capture library for the study of identity, gender, and emotion perception from biological motion},
  author={Ma, Yingliang and Paterson, Helena M and Pollick, Frank E},
  journal={Behavior research methods},
  volume={38},
  number={1},
  pages={134--141},
  year={2006},
  publisher={Springer}
}
@inproceedings{karg2009comparison,
  title={A comparison of PCA, KPCA and LDA for feature extraction to recognize affect in gait patterns},
  author={Karg, M and Jenke, R and Seiberl, W and K{\"u}hnlenz, K and Buss, M},
  booktitle={Proceedings of the 3rd International Conference on Affective Computing and Intelligent Interaction},
  year={2009}
}
@inproceedings{crane2007motion,
  title={Motion capture and emotion: Affect detection in whole body movement},
  author={Crane, Elizabeth and Gross, Melissa},
  booktitle={International Conference on Affective Computing and Intelligent Interaction},
  pages={95--101},
  year={2007},
  organization={Springer}
}
@article{pollick2001perceiving,
  title={Perceiving affect from arm movement},
  author={Pollick, Frank E and Paterson, Helena M and Bruderlin, Armin and Sanford, Anthony J},
  journal={Cognition},
  volume={82},
  number={2},
  pages={B51--B61},
  year={2001},
  publisher={Elsevier}
}
@article{roether2009critical,
  title={Critical features for the perception of emotion from gait},
  author={Roether, Claire L and Omlor, Lars and Christensen, Andrea and Giese, Martin A},
  journal={Journal of vision},
  volume={9},
  number={6},
  pages={15--15},
  year={2009},
  publisher={The Association for Research in Vision and Ophthalmology}
}

extension: bib


text:
% Encoding: UTF-8

@Misc{kaggle2021rsna,
  author       = {{Radiological Society of North America}},
  howpublished = {\url{https://www.kaggle.com/c/rsna-miccai-brain-tumor-radiogenomic-classification/overview}},
  note         = {[Online; accessed 26-July-2021]},
  title        = {{RSNA-MICCAI} {B}rain {T}umor {R}adiogenomic {C}lassification},
  year         = {2021},
}

@Article{ranjbarzadeh2021brain,
  author    = {Ranjbarzadeh, Ramin and Kasgari, Abbas Bagherian and Ghoushchi, Saeid Jafarzadeh and Anari, Shokofeh and Naseri, Maryam and Bendechache, Malika},
  journal   = {Scientific Reports},
  title     = {Brain tumor segmentation based on deep learning and an attention mechanism using {MRI} multi-modalities brain images},
  year      = {2021},
  note      = {\emph{This is the basis for my Simple Segmenter}},
  number    = {1},
  pages     = {1--17},
  volume    = {11},
  publisher = {Nature Publishing Group},
}

@Article{korfiatis2016mri,
  author    = {Korfiatis, Panagiotis and Kline, Timothy L and Coufalova, Lucie and Lachance, Daniel H and Parney, Ian F and Carter, Rickey E and Buckner, Jan C and Erickson, Bradley J},
  journal   = {Medical physics},
  title     = {MRI texture features as biomarkers to predict MGMT methylation status in glioblastomas},
  year      = {2016},
  number    = {6Part1},
  pages     = {2835--2844},
  volume    = {43},
  publisher = {Wiley Online Library},
}

@Article{valdebenito2019machine,
  author    = {Valdebenito, Jessica and Medina, Felipe},
  journal   = {Cancer Reports},
  title     = {Machine learning approaches to study glioblastoma: A review of the last decade of applications},
  year      = {2019},
  number    = {6},
  pages     = {e1226},
  volume    = {2},
  publisher = {Wiley Online Library},
}

@InCollection{booth2020machine,
  author    = {Booth, Thomas C and Akpinar, Bernice and Roman, Andrei and Shuaib, Haris and Luis, Aysha and Chelliah, Alysha and Al Busaidi, Ayisha and Mirchandani, Ayesha and Alparslan, Burcu and Mansoor, Nina and others},
  booktitle = {Machine Learning in Clinical Neuroimaging and Radiogenomics in Neuro-oncology},
  publisher = {Springer},
  title     = {Machine learning and glioblastoma: treatment response monitoring biomarkers in 2021},
  year      = {2020},
  pages     = {212--228},
}

@Article{islam2021glioblastoma,
  author    = {Islam, Mobarakol and Wijethilake, Navodini and Ren, Hongliang},
  journal   = {Computerized Medical Imaging and Graphics},
  title     = {Glioblastoma Multiforme Prognosis: MRI Missing Modality Generation, Segmentation and Radiogenomic Survival Prediction},
  year      = {2021},
  pages     = {101906},
  publisher = {Elsevier},
}

@Article{massi2021feature,
  author  = {Massi, Michela C and Ieva, Francesca and Gasperoni, Francesca and Paganoni, Anna Maria},
  journal = {arXiv preprint arXiv:2103.11678},
  title   = {Feature Selection for Imbalanced Data with Deep Sparse Autoencoders Ensemble},
  year    = {2021},
}

@InProceedings{ismail2020spatial,
  author       = {Ismail, Marwa and Correa, Ramon and Bera, Kaustav and Verma, Ruchika and Bamashmos, Anas Saeed and Beig, Niha and Antunes, Jacob and Prasanna, Prateek and Statsevych, Volodymyr and Ahluwalia, Manmeet and others},
  booktitle    = {International Conference on Medical Image Computing and Computer-Assisted Intervention},
  title        = {Spatial-And-Context Aware (SpACe)“Virtual Biopsy” Radiogenomic Maps to Target Tumor Mutational Status on Structural MRI},
  year         = {2020},
  organization = {Springer},
  pages        = {305--314},
}

@Article{xu2019correlation,
  author  = {Xu, Ziyue and Wang, Xiaosong and Shin, Hoo-Chang and Yang, Dong and Roth, Holger and Milletari, Fausto and Zhang, Ling and Xu, Daguang},
  journal = {arXiv preprint arXiv:1907.03728},
  title   = {Correlation via synthesis: end-to-end nodule image generation and radiogenomic map learning based on generative adversarial network},
  year    = {2019},
}

@Article{baid2021rsna,
  author  = {Baid, Ujjwal and Ghodasara, Satyam and Bilello, Michel and Mohan, Suyash and Calabrese, Evan and Colak, Errol and Farahani, Keyvan and Kalpathy-Cramer, Jayashree and Kitamura, Felipe C and Pati, Sarthak and others},
  journal = {arXiv preprint arXiv:2107.02314},
  title   = {The RSNA-ASNR-MICCAI BraTS 2021 Benchmark on Brain Tumor Segmentation and Radiogenomic Classification},
  year    = {2021},
}

@Article{mohammed2021tumor,
  author  = {Mohammed, Shariq and Kurtek, Sebastian and Bharath, Karthik and Rao, Arvind and Baladandayuthapani, Veerabhadran},
  journal = {arXiv preprint arXiv:2106.10941},
  title   = {Tumor Radiogenomics with Bayesian Layered Variable Selection},
  year    = {2021},
}

@Article{leelatian2020unsupervised,
  author    = {Leelatian, Nalin and Sinnaeve, Justine and Mistry, Akshitkumar M and Barone, Sierra M and Brockman, Asa A and Diggins, Kirsten E and Greenplate, Allison R and Weaver, Kyle D and Thompson, Reid C and Chambless, Lola B and others},
  journal   = {Elife},
  title     = {Unsupervised machine learning reveals risk stratifying glioblastoma tumor cells},
  year      = {2020},
  pages     = {e56879},
  volume    = {9},
  publisher = {eLife Sciences Publications Limited},
}

@Misc{roni2021getting,
  author       = {Zaharia, Roni},
  howpublished = {\url{http://dicomiseasy.blogspot.com/2013/06/getting-oriented-using-image-plane.html}},
  note         = {[Online; accessed 27-July-2021]},
  title        = {Getting Oriented using the Image Plane Module},
  year         = {2021},
}

@Misc{roni2021introduction,
  author       = {Zaharia, Roni},
  howpublished = {\url{http://dicomiseasy.blogspot.com/2011/12/chapter-4-dicom-objects-in-chapter-3.html}},
  note         = {[Online; accessed 27-July-2021]},
  title        = {Introduction to DICOM - Chapter 4 - DICOM Objects},
  year         = {2021},
}

@Article{chen2019med3d,
  author  = {Chen, Sihong and Ma, Kai and Zheng, Yefeng},
  journal = {arXiv preprint arXiv:1904.00625},
  title   = {Med3d: Transfer learning for 3d medical image analysis},
  year    = {2019},
}

@Article{eltayeb2019automated,
  author  = {Eltayeb, Engy and Salem, Nancy and Al-Atabany, Walid},
  journal = {Bio-Medical Materials and Engineering},
  title   = {Automated brain tumor segmentation from multi-slices FLAIR MRI images},
  year    = {2019},
  month   = {08},
  pages   = {1-13},
  volume  = {30},
  doi     = {10.3233/BME-191066},
}

@InProceedings{inproceedings,
  author  = {Wu, Ming-Ni and Lin, Chia-Chen and Chang, Chin-Chen},
  title   = {Brain Tumor Detection Using Color-Based K-Means Clustering Segmentation},
  year    = {2007},
  month   = {12},
  pages   = {245-250},
  volume  = {2},
  doi     = {10.1109/IIHMSP.2007.4457697},
  isbn    = {978-0-7695-2994-1},
  journal = {IEEE Comput Soc},
}

@Misc{mouzakitis2019introduction,
  author       = {Mouzakitis, Nikos},
  howpublished = {\url{https://github.com/NikosMouzakitis/Brain-tumor-detection-using-Kmeans-and-histogram/}},
  note         = {[Online; accessed 8-August-2021]},
  title        = {Brain tumor detection using Kmeans and histogram},
  year         = {2021},
}

@Comment{jabref-meta: databaseType:bibtex;}

repository: sepidhk/rsna

repo_name: sepidhk/rsna

branch_name: refs/heads/main


text:
#include "CaveItemsMutator.h"

UCaveItemsMutator::UCaveItemsMutator() {
    this->Item = NULL;
}

repository: SamsDRGMods/DRGLib

repo_name: SamsDRGMods/DRGLib

extension: cpp


text:
/*
 *  SpecularMapElement.cpp
 *  Textify3DMF
 *
 *  Created by James Walker on 3/26/2013.
 *  Copyright 2013 ScriptPerfection Enterprises, Inc. All rights reserved.
 *
 */

#include "SpecularMapElement.h"

SpecularMapElement::SpecularMapElement()
	: SimpleTypeHandler( '\360esm', "Quesa:ShininessElement" )
{
}

repository: jwwalker/Quesa

repo_name: jwwalker/Quesa


text:
package report

import "encoding/json"

// AgentReportRequest 代理商数据APIRequest
type AgentReportRequest struct {
	// AgentID 代理商ID（注：非账户快手ID），在获取accessToken时返回
	AgentID int64 `json:"agent_id,omitempty"`
	// StartDate  过滤筛选条件，格式yyyy-MM-dd 可选时间范围参见文档上方说明
	StartDate string `json:"start_date,omitempty"`
	// EndDate 过滤筛选条件，格式yyyy-MM-dd 可选时间范围参见文档上方说明
	EndDate string `json:"end_date,omitempty"`
	// Page 请求的页码，默认为 1
	Page int `json:"page,omitempty"`
	// PageSize 每页行数，默认为20，最大支持1000
	PageSize int `json:"page_size,omitempty"`
}

// Url implement PostRequest inferface
func (r AgentReportRequest) Url() string {
	return "v1/agent/report"
}

// Encode implement PostRequest interface
func (r AgentReportRequest) Encode() []byte {
	buf, _ := json.Marshal(r)
	return buf
}

repository: Nliver/kwai-marketing-api

repo_name: Nliver/kwai-marketing-api


text:
package utreexo

import (
	"fmt"
)

// IngestBlockProof populates the Pollard with all needed data to delete the
// targets in the block proof
func (p *Pollard) IngestBlockProof(bp BlockProof) error {
	var empty Hash
	// TODO so many things to change
	ok, proofMap := p.VerifyBlockProof(bp)
	if !ok {
		return fmt.Errorf("block proof mismatch")
	}
	//	fmt.Printf("targets: %v\n", bp.Targets)
	// go through each target and populate pollard
	for _, target := range bp.Targets {

		tNum, bits, branchLen := detectOffset(target, p.numLeaves)
		if branchLen == 0 {
			// if there's no branch (1-tree) nothing to prove
			continue
		}
		node := p.tops[tNum]
		h := branchLen - 1
		bits = ^bits                                 // flip bits for proof descent
		pos := upMany(target, branchLen, p.height()) // this works but...
		// we should have a way to get the top positions from just p.tops

		// fmt.Printf("ingest adding target %d to top %04x h %d brlen %d bits %04b\n",
		// target, node.data[:4], h, branchLen, bits&((2<<h)-1))

		lr := (bits >> h) & 1
		pos = (child(pos, p.height())) | lr
		// descend until we hit the bottom, populating as we go
		for {
			if node.niece[lr] == nil {
				node.niece[lr] = new(polNode)
				node.niece[lr].data = proofMap[pos]
				if node.niece[lr].data == empty {
					return fmt.Errorf("Wrote an empty hash h %d under %04x %d.niece[%d]\n",
						h, node.data[:4], pos, lr)
				}
				// fmt.Printf("h %d wrote %04x to %d\n", h, node.niece[lr].data[:4], pos)
				p.overWire++
			}

			if h == 0 {
				break
			}
			h--
			node = node.niece[lr]
			lr = (bits >> h) & 1
			pos = (child(pos, p.height()) ^ 2) | lr
		}

		// TODO do you need this at all?  If the Verify part already happend, maybe no
		// at bottom, populate target if needed
		// if we don't need this and take it out, will need to change the forget
		// pop above

		if node.niece[lr^1] == nil {
			node.niece[lr^1] = new(polNode)
			node.niece[lr^1].data = proofMap[pos^1]
			if node.niece[lr^1].data == empty {
				return fmt.Errorf("Wrote an empty hash h %d under %04x %d.niece[%d]\n",
					h, node.data[:4], pos, lr^1)
			}
			// p.overWire++ // doesn't count...? got it for free?
		}
	}
	return nil
}

// VerifyBlockProof takes a block proof and reconstructs / verifies it.
// takes a blockproof to verify, and the known correct tops to check against.
// also takes the number of leaves and forest height (those are redundant
// if we don't do weird stuff with overly-high forests, which we might)
// it returns a bool of whether the proof worked, and a map of the sparse
// forest in the blockproof
func (p *Pollard) VerifyBlockProof(
	bp BlockProof) (bool, map[uint64]Hash) {

	// if nothing to prove, it worked
	if len(bp.Targets) == 0 {
		return true, nil
	}

	height := p.height()
	tops := p.topHashesReverse()
	proofmap, err := bp.Reconstruct(p.numLeaves, height)
	if err != nil {
		fmt.Printf("VerifyBlockProof Reconstruct ERROR %s\n", err.Error())
		return false, proofmap
	}

	proofmap, err = p.matchKnownData(proofmap, bp)
	if err != nil {
		fmt.Printf("VerifyBlockProof matchKnownData ERROR %s\n", err.Error())
		return false, proofmap
	}

	//	fmt.Printf("Reconstruct complete\n")
	topposs, topheights := getTopsReverse(p.numLeaves, height)

	// partial forest is built, go through and hash everything to make sure
	// you get the right tops

	tagRow := bp.Targets
	nextRow := []uint64{}
	sortUint64s(tagRow) // probably don't need to sort

	// TODO it's ugly that I keep treating the 0-row as a special case,
	// and has led to a number of bugs.  It *is* special in a way, in that
	// the bottom row is the only thing you actually prove and add/delete,
	// but it'd be nice if it could all be treated uniformly.

	// if proofmap has a 0-root, check it
	if verbose {
		fmt.Printf("tagrow len %d\n", len(tagRow))
	}

	var left, right uint64
	// iterate through height

	for h := uint8(0); h < height; h++ {
		// iterate through tagged positions in this row

		for len(tagRow) > 0 {
			// see if the next tag is a sibling and we get both
			if len(tagRow) > 1 && tagRow[0]|1 == tagRow[1] {
				left = tagRow[0]
				right = tagRow[1]
				tagRow = tagRow[2:]
			} else { // if not only use one tagged position
				right = tagRow[0] | 1
				left = right ^ 1
				tagRow = tagRow[1:]
			}

			// check for tops
			if verbose {
				fmt.Printf("left %d toppos %d\n", left, topposs[0])
			}
			if left == topposs[0] {
				if verbose {
					fmt.Printf("one left in tagrow; should be top\n")
				}
				computedRoot, ok := proofmap[left]
				if !ok {
					fmt.Printf("ERR no proofmap for root at %d\n", left)
					return false, nil
				}
				if computedRoot != tops[0] {
					fmt.Printf("height %d top, pos %d expect %04x got %04x\n",
						h, left, tops[0][:4], computedRoot[:4])
					return false, nil
				}
				// otherwise OK and pop of the top
				tops = tops[1:]
				topposs = topposs[1:]
				topheights = topheights[1:]
				break
			}
			parpos := up1(left, height)
			if verbose {
				fmt.Printf("%d %04x %d %04x -> %d\n",
					left, proofmap[left], right, proofmap[right], parpos)
			}
			_, ok := proofmap[parpos]
			if !ok {
				// this will crash if either is 0000
				parhash := Parent(proofmap[left], proofmap[right])
				p.hashesEver++
				p.proofHashesEver++
				proofmap[parpos] = parhash
			}
			nextRow = append(nextRow, parpos)

		}

		tagRow = nextRow
		nextRow = []uint64{}
		// if done with row and there's a top left on this row, remove it
		if len(topheights) > 0 && topheights[0] == h {
			// bit ugly to do these all separately eh
			tops = tops[1:]
			topposs = topposs[1:]
			topheights = topheights[1:]
		}
	}

	return true, proofmap
}

// matchKnownData will run through all positions in the block
// proof, and follow them up. As soon as a hash is found that
// matches data in the pollard, we use the pollard from there
// onwards to fill a proofmap. Thus, this both checks if the
// proof amounts to something we already know (somewhere down
// the tree), and saves re-hashing things we already know.
func (p *Pollard) matchKnownData(
	rec map[uint64]Hash,
	bp BlockProof) (map[uint64]Hash, error) {
	proofmap := rec

	height := p.height()
	/*fmt.Printf("Targets: %v\n", bp.Targets)
	fmt.Printf("Num leaves: %d\n", p.numLeaves)
	for pos, hash := range rec {
		fmt.Printf("rec[%d] = %x\n", pos, hash[:4])
	}

	tops, _ := getTopsReverse(p.numLeaves, height)
	fmt.Printf("Tree top positions: %v, hashes: ", tops)
	tophashes := p.topHashesReverse()
	for _, th := range tophashes {
		fmt.Printf("%x ", th[:4])
	}
	fmt.Printf("\n")
	*/
	var left, right uint64

	for _, t := range bp.Targets {

		//fmt.Printf("Processing %d\n", t)
		// Fetch whatever is in the pollard on the path to
		// this leaf
		_, sibs, err := p.descendToPos(t)
		/*
			if err != nil {
				fmt.Printf("Error descendToPos: %s\n", err)
			}

			for i, s := range sibs {
				if s != nil {
					fmt.Printf("sibs[%d] = %x\n", i, s.data[:4])
				} else {
					fmt.Printf("sibs[%d] = nil\n", i)
				}
			}*/

		subH := detectSubTreeHeight(t, p.numLeaves, height)
		//fmt.Printf("Subtree height for [%d] is [%d]\n", left, subH)
		pos := up1(t, height)
		//fmt.Printf("We are at position [%d]\n", pos)
		right = t | 1
		left = right ^ 1
		leftHash, rightHash := rec[left], rec[right]

		found := false
		for h := uint8(1); h <= subH; h++ { // < or <=?  I think <
			_, ok := proofmap[pos]
			if !ok {
				if !found || sibs[h] == nil {
					//fmt.Printf("pos %d: Parent(%x, %x) -> ", pos, leftHash[:4], rightHash[:4])
					hash := Parent(leftHash, rightHash)
					//fmt.Printf("%x\n", hash[:4])
					p.hashesEver++
					p.proofHashesEver++
					if sibs[h] != nil {
						if sibs[h].data == hash {
							//fmt.Printf("Found matching hash in nodes[%d]\n", h)
							found = true
						}
					}
					proofmap[pos] = hash
				} else {
					//fmt.Printf("Using cached data after intersecting with pollard for %d\n", pos)
					proofmap[pos] = sibs[h].data
				}
			}
			if h == subH {
				break
			}

			if !found || sibs[h+1] == nil {
				hashes := map[uint64]Hash{}
				ok := false
				if pos&1 == 0 {
					//fmt.Printf("Left pos (calculated): [%d] - Right pos (from proof): [%d]\n", pos, pos^1)
					rightHash, ok = proofmap[pos^1]
					if !ok {
						rightHash, hashes, err = ResolveNode(proofmap, pos^1, height)
						for p, h := range hashes {
							proofmap[p] = h
						}
						if err != nil {
							return nil, err
						}
						p.hashesEver += uint64(len(hashes))
						p.proofHashesEver += uint64(len(hashes))
						p.proofResolveHashesEver += uint64(len(hashes))
					}
					leftHash = proofmap[pos]
				} else {
					//fmt.Printf("Left pos (from proof): [%d] - Right pos (calculated): [%d]\n", pos^1, pos)
					leftHash, ok = proofmap[pos^1]
					if !ok {
						leftHash, hashes, err = ResolveNode(proofmap, pos^1, height)
						for p, h := range hashes {
							proofmap[p] = h
						}
						if err != nil {
							return nil, err
						}
						p.hashesEver += uint64(len(hashes))
						p.proofHashesEver += uint64(len(hashes))
						p.proofResolveHashesEver += uint64(len(hashes))
					}
					rightHash = proofmap[pos]
				}
			}
			pos = up1(pos, height)
			//fmt.Printf("We are at [%d]\n", pos)
		}
	}

	return proofmap, nil
}

repository: gertjaap/utreexo

repo_name: gertjaap/utreexo


text:
package rpc

import (
	"errors"
	"testing"

	"github.com/stretchr/testify/assert"
	"google.golang.org/grpc/codes"

	"github.com/poseidon/matchbox/matchbox/server"
)

func TestGRPCError(t *testing.T) {
	cases := []struct {
		input  error
		output error
	}{
		{nil, nil},
		{server.ErrNoMatchingGroup, errNoMatchingGroup},
		{server.ErrNoMatchingProfile, errNoMatchingProfile},
		{errors.New("other error"), grpcErrorf(codes.Unknown, "other error")},
	}
	for _, c := range cases {
		err := grpcError(c.input)
		assert.Equal(t, c.output, err)
	}
}

repository: poseidon/matchbox

repo_name: poseidon/matchbox