text:
= apr,
   volume = 513,
      eid = {A57},
    pages = {A57},
      doi = {10.1051/0004-6361/200912976},
   adsurl = {http://adsabs.harvard.edu/abs/2010A%26A...513A..57Z},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@inbook{Chabrier2014,
   author = {{Chabrier}, G. and {Johansen}, A. and {Janson}, M. and {Rafikov}, R.},
  chapter = "{Giant Planet and Brown Dwarf Formation}",
  publisher={University of Arizona Press},
  title = {Protostars and planets VI},
    archivePrefix = "arXiv",
   eprint = {1401.7559},
   primaryClass = "astro-ph.SR",
     year = 2014,
    pages = {619-642},
      doi = {10.2458/azu_uapress_9780816531240-ch027},
   adsurl = {http://adsabs.harvard.edu/abs/2014prpl.conf..619C},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  crosref = {beuther2014_book}
}

@book{beuther2014_book,
  title={Protostars and planets VI},
  author={Beuther, Henrik and Klessen, Ralf S and Dullemond, Cornelis Petrus and Henning, Thomas K},
  year={2014},
  publisher={University of Arizona Press}
}

@ARTICLE{Burrows2001,
   author = {{Burrows}, A. and {Hubbard}, W.~B. and {Lunine}, J.~I. and {Liebert}, J.
    },
    title = "{The theory of brown dwarfs and extrasolar giant planets}",
  journal = {Reviews of Modern Physics},
   eprint = {astro-ph/0103383},
     year = 2001,
    month = jul,
   volume = 73,
    pages = {719-765},
      doi = {10.1103/RevModPhys.73.719},
   adsurl = {http://adsabs.harvard.edu/abs/2001RvMP...73..719B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@INBOOK{Bate2006,
   author = {{Bate}, M.~R.},
    title = "{The brown dwarf-planet relation}",
booktitle = {Planet Formation},
     year = 2006,
    month = may,
   editor = {{Klahr}, H. and {Brandner}, W.},
publisher = {Cambridge University Press},
    pages = {236},
   adsurl = {http://adsabs.harvard.edu/abs/2006plfo.book..236B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@INPROCEEDINGS{Torres2016,
   author = {{Flor Torres}, L.~M. and {Coziol}, R. and {Schr{\"o}eder}, K.-P. and
    {Caretta}, C.~A. and {Jack}, D.},
    title = "{Relation Between Brown Dwarfs and Exoplanets}",
 keywords = {Star, Planets, Brown Dwarf, Astrobiology},
booktitle = {19th Cambridge Workshop on Cool Stars, Stellar Systems, and the Sun (CS19)},
     year = 2016,
archivePrefix = "arXiv",
   eprint = {1607.07922},
 primaryClass = "astro-ph.EP",
    month = jul,
      eid = {94},
    pages = {94},
      doi = {10.5281/zenodo.58717},
   adsurl = {http://adsabs.harvard.edu/abs/2016csss.confE..94F},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Larson1969,
   author = {{Larson}, R.~B.},
    title = "{Numerical calculations of the dynamics of collapsing proto-star}",
  journal = {\mnras},
     year = 1969,
   volume = 145,
    pages = {271},
      doi = {10.1093/mnras/145.3.271},
   adsurl = {http://adsabs.harvard.edu/abs/1969MNRAS.145..271L},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Silk1977,
   author = {{Silk}, J.},
    title = "{On the fragmentation of cosmic gas clouds. III - The initial stellar mass function}",
  journal = {\apj},
 keywords = {Interstellar Gas, Protostars, Star Clusters, Stellar Evolution, Stellar Mass, Stellar Models, Abundance, Chemical Composition, Correlation, Fragmentation, Heavy Elements, Hydrogen Clouds, Radio Astronomy},
     year = 1977,
    month = jun,
   volume = 214,
    pages = {718-724},
      doi = {10.1086/155301},
   adsurl = {http://adsabs.harvard.edu/abs/1977ApJ...214..718S},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Boss1988,
   author = {{Boss}, A.~P.},
    title = "{Protostellar formation in rotating interstellar clouds. VII - Opacity and fragmentation}",
  journal = {\apj},
 keywords = {Binary Stars, Molecular Clouds, Opacity, Protostars, Star Formation, Stellar Rotation, Cosmic Dust, Grain Size, Infrared Radiation, Interstellar Matter},
     year = 1988,
    month = aug,
   volume = 331,
    pages = {370-376},
      doi = {10.1086/166563},
   adsurl = {http://adsabs.harvard.edu/abs/1988ApJ...331..370B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Santerne2016,
   author = {{Santerne}, A. and {Moutou}, C. and {Tsantaki}, M. and {Bouchy}, F. and
    {H{\'e}brard}, G. and {Adibekyan}, V. and {Almenara}, J.-M. and
    {Amard}, L. and {Barros}, S.~C.~C. and {Boisse}, I. and {Bonomo}, A.~S. and
    {Bruno}, G. and {Courcol}, B. and {Deleuil}, M. and {Demangeon}, O. and
    {D{\'{\i}}az}, R.~F. and {Guillot}, T. and {Havel}, M. and {Montagnier}, G. and
    {Rajpurohit}, A.~S. and {Rey}, J. and {Santos}, N.~C.},
    title = "{SOPHIE velocimetry of Kepler transit candidates. XVII. The physical properties of giant exoplanets within 400 days of period}",
  journal = {\aap},
archivePrefix = "arXiv",
   eprint = {1511.00643},
 primaryClass = "astro-ph.EP",
 keywords = {planetary systems, binaries: spectroscopic, techniques: radial velocities, techniques: spectroscopic, techniques: photometric},
     year = 2016,
    month = mar,
   volume = 587,
      eid = {A64},
    pages = {A64},
      doi = {10.1051/0004-6361/201527329},
   adsurl = {http://adsabs.harvard.edu/abs/2016A%26A...587A..64S},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Burrows1993,
   author = {{Burrows}, A. and {Liebert}, J.},
    title = "{The science of brown dwarfs}",
  journal = {Reviews of Modern Physics},
     year = 1993,
    month = apr,
   volume = 65,
    pages = {301-336},
      doi = {10.1103/RevModPhys.65.301},
   adsurl = {http://adsabs.harvard.edu/abs/1993RvMP...65..301B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@BOOK{Padmanabhan1993,
   author = {{Padmanabhan}, T.},
    title = "{Structure Formation in the Universe}",
booktitle = {Structure Formation in the Universe, by T.~Padmanabhan, pp.~499.~ISBN 0521424860.~Cambridge, UK: Cambridge University Press, June 1993.},
     year = 1993,
    month = may,
    pages = {499},
    publisher={Elsevier Current Trends},
   adsurl = {http://adsabs.harvard.edu/abs/1993sfu..book.....P},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@article{Burgasser2008,
   author = {{Burgasser}, A.~J.},
    title = "{Brown dwarfs: Failed stars, super Jupiters}",
  journal = {Physics Today},
     year = 2008,
   volume = 61,
   number = 6,
    pages = {70},
      doi = {10.1063/1.2947658},
   adsurl = {http://adsabs.harvard.edu/abs/2008PhT....61f..70B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Basri2006,
   author = {{Basri}, G. and {Brown}, M.~E.},
    title = "{Planetesimals to Brown Dwarfs: What is a Planet?}",
  journal = {Annual Review of Earth and Planetary Sciences},
   eprint = {astro-ph/0608417},
     year = 2006,
    month = may,
   volume = 34,
    pages = {193-216},
      doi = {10.1146/annurev.earth.34.031405.125058},
   adsurl = {http://adsabs.harvard.edu/abs/2006AREPS..34..193B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Sorahana2013,
   author = {{Sorahana}, S. and {Yamamura}, I. and {Murakami}, H.},
    title = "{On the Radii of Brown Dwarfs Measured with AKARI Near-infrared Spectroscopy}",
  journal = {\apj},
archivePrefix = "arXiv",
   eprint = {1304.1259},
 primaryClass = "astro-ph.SR",
 keywords = {brown dwarfs, infrared: stars, stars: late-type, stars: low-mass},
     year = 2013,
    month = apr,
   volume = 767,
      eid = {77},
    pages = {77},
      doi = {10.1088/0004-637X/767/1/77},
   adsurl = {http://adsabs.harvard.edu/abs/2013ApJ...767...77S},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Wigner1935,
   author = {{Wigner}, E. and {Huntington}, H.~B.},
    title = "{On the Possibility of a Metallic Modification of Hydrogen}",
  journal = {\jcp},
     year = 1935,
    month = dec,
   volume = 3,
    pages = {764-770},
      doi = {10.1063/1.1749590},
   adsurl = {http://adsabs.harvard.edu/abs/1935JChPh...3..764W},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Hubbard1997,
   author = {{Hubbard}, W.~B. and {Guillot}, T. and {Lunine}, J.~I. and {Burrows}, A. and
    {Saumon}, D. and {Marley}, M.~S. and {Freedman}, R.~S.},
    title = "{Liquid metallic hydrogen and the structure of brown dwarfs and giant planets}",
  journal = {Physics of Plasmas},
   eprint = {astro-ph/9703007},
     year = 1997,
    month = may,
   volume = 4,
    pages = {2011-2015},
      doi = {10.1063/1.872570},
   adsurl = {http://adsabs.harvard.edu/abs/1997PhPl....4.2011H},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Dalladay-Simpson2016,
   author = {{Dalladay-Simpson}, P. and {Howie}, R.~T. and {Gregoryanz}, E.
    },
    title = "{Evidence for a new phase of dense hydrogen above 325 gigapascals}",
  journal = {\nat},
     year = 2016,
    month = jan,
   volume = 529,
    pages = {63-67},
      doi = {10.1038/nature16164},
   adsurl = {http://adsabs.harvard.edu/abs/2016Natur.529...63D},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@misc{Gajdos2019,
   author = {{Gajdo{\v s}}, P. and {Parimucha}, {\v S}.},
    title = "{OCFit: Python package for fitting of O-C diagrams}",
 keywords = {Software },
howpublished = {Astrophysics Source Code Library, \url{https://github.com/pavolgaj/OCFit}},
     year = 2019,
    month = jan,
archivePrefix = "ascl",
   eprint = {1901.002},
   adsurl = {http://adsabs.harvard.edu/abs/2019ascl.soft01002G},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
      doi = {10.5281/zenodo.2547766}
}

@ARTICLE{Liakos2011,
   author = {{Liakos}, A. and {Zasche}, P. and {Niarchos}, P.},
    title = "{A comprehensive study of six Algol type binaries}",
  journal = {\na},
archivePrefix = "arXiv",
   eprint = {1404.2790},
 primaryClass = "astro-ph.SR",
     year = 2011,
    month = dec,
   volume = 16,
    pages = {530-538},
      doi = {10.1016/j.newast.2011.04.004},
   adsurl = {http://adsabs.harvard.edu/abs/2011NewA...16..530L},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@article{Watson2004,
   author = {{Watson}, C.~A. and {Dhillon}, V.~S.},
    title = "{The effect of star-spots on eclipse timings of binary stars}",
  journal = {\mnras},
   eprint = {astro-ph/0402670},
 keywords = {binaries: eclipsing, stars: late-type, stars: spots, white dwarfs},
     year = 2004,
    month = jun,
   volume = 351,
    pages = {110-116},
      doi = {10.1111/j.1365-2966.2004.07763.x},
   adsurl = {http://adsabs.harvard.edu/abs/2004MNRAS.351..110W},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Kalimeris2002,
   author = {{Kalimeris}, A. and {Rovithis-Livaniou}, H. and {Rovithis}, P.
	},
    title = "{Starspots and photometric noise on observed minus calculated (O-C) diagrams}",
  journal = {\aap},
 keywords = {stars: binaries: eclipsing, starspots, stars: variables: general},
     year = 2002,
    month = jun,
   volume = 387,
    pages = {969-976},
      doi = {10.1051/0004-6361:20020456},
   adsurl = {http://adsabs.harvard.edu/abs/2002A%26A...387..969K},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Prsa2005,
       author = {{Pr{\v{s}}a}, A. and {Zwitter}, T.},
        title = "{A Computational Guide to Physics of Eclipsing Binaries. I. Demonstrations and Perspectives}",
      journal = {\apj},
     keywords = {Stars: Binaries: Eclipsing, Methods: Data Analysis, Methods: Numerical, Stars: Fundamental Parameters, Astrophysics},
         year = "2005",
        month = "Jul",
       volume = {628},
        pages = {426-438},
          doi = {10.1086/430591},
archivePrefix = {arXiv},
       eprint = {astro-ph/0503361},
 primaryClass = {astro-ph},
       adsurl = {https://ui.adsabs.harvard.edu/\#abs/2005ApJ...628..426P},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Wilson1971,
       author = {{Wilson}, Robert E. and {Devinney}, Edward J.},
        title = "{Realization of Accurate Close-Binary Light Curves: Application to MR Cygni}",
      journal = {\apj},
         year = "1971",
        month = "Jun",
       volume = {166},
        pages = {605},
          doi = {10.1086/150986},
       adsurl = {https://ui.adsabs.harvard.edu/\#abs/1971ApJ...166..605W},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Barnes2004,
   author = {{Barnes}, J.~R. and {Lister}, T.~A. and {Hilditch}, R.~W. and
	{Collier Cameron}, A.},
    title = "{High-resolution Doppler images of the spotted contact binary AE Phe}",
  journal = {\mnras},
 keywords = {techniques: spectroscopic, binaries: eclipsing, binaries: spectroscopic, stars: imaging, stars: individual: AE Phe, stars: spots},
     year = 2004,
    month = mar,
   volume = 348,
    pages = {1321-1331},
      doi = {10.1111/j.1365-2966.2004.07452.x},
   adsurl = {http://adsabs.harvard.edu/abs/2004MNRAS.348.1321B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@INPROCEEDINGS{Hall1990,
   author = {{Hall}, D.~S. and {Busby}, M.~R.},
    title = "{Starspot Lifetimes}",
booktitle = {NATO Advanced Science Institutes (ASI) Series C},
     year = 1990,
   series = {NATO Advanced Science Institutes (ASI) Series C},
   volume = 319,
    pages = {377},
   adsurl = {http://adsabs.harvard.edu/abs/1990ASIC..319..377H},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@Inbook{Guinan1993,
author="Guinan, E. F. and Gim{\'e}nez, A.",
editor="Sahade, J. and McCluskey, G. E. and Kondo, Y.",
title="Magnetic Activity in Close Binaries",
bookTitle="The Realm of Interacting Binary Stars",
year="1993",
publisher="Springer Netherlands",
address="Dordrecht",
pages="51--110",
abstract="Solar-like magnetic activity indicators such as photospheric spots, chromo spheric emission, coronal X-ray and radio emission, and flare activity are commonplace in many cool stars with convective envelopes (spectral types of about F5 and later). Generally, the strength of stellar activity increases with more rapid rotation and later spectral types which corresponds to the increasing depth of the star's convective envelope. The origin of this solar-like activity is believed to be a magnetic dynamo in which magnetic fields are generated in the differentially rotating convective zones of the Sun and solar-type stars. Unfortunately, although the magnetic dynamo model is generally accepted to explain both solar and stellar activity, it is only poorly understood and inadequately tested to date (see Parker 1981; 1986).",
isbn="978-94-011-2416-4",
doi="10.1007/978-94-011-2416-4_7",
url="https://doi.org/10.1007/978-94-011-2416-4_7"
}

@ARTICLE{Berdyugina2005,
   author = {{Berdyugina}, S.~V.},
    title = "{Starspots: A Key to the Stellar Dynamo}",
  journal = {Living Reviews in Solar Physics},
 keywords = {starspots, sunspots, stellar magnetic fields, stellar cycles, dynamo, differential rotation, Doppler imaging},
     year = 2005,
    month = dec,
   volume = 2,
      eid = {8},
    pages = {8},
      doi = {10.12942/lrsp-2005-8},
   adsurl = {http://adsabs.harvard.edu/abs/2005LRSP....2....8B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Tran2013,
   author = {{Tran}, K. and {Levine}, A. and {Rappaport}, S. and {Borkovits}, T. and
	{Csizmadia}, S. and {Kalomeni}, B.},
    title = "{The Anticorrelated Nature of the Primary and Secondary Eclipse Timing Variations for the Kepler Contact Binaries}",
  journal = {\apj},
archivePrefix = "arXiv",
   eprint = {1305.4639},
 primaryClass = "astro-ph.SR",
 keywords = {binaries: eclipsing, binaries: general, stars: activity, stars: evolution, starspots, stars: rotation},
     year = 2013,
    month = sep,
   volume = 774,
      eid = {81},
    pages = {81},
      doi = {10.1088/0004-637X/774/1/81},
   adsurl = {http://adsabs.harvard.edu/abs/2013ApJ...774...81T},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Roettenbacher2011,
   author = {{Roettenbacher}, R.~M. and {Harmon}, R.~O. and {Vutisalchavakul}, N. and
	{Henry}, G.~W.},
    title = "{A Study of Differential Rotation on II Pegasi via Photometric Starspot Imaging}",
  journal = {\aj},
archivePrefix = "arXiv",
   eprint = {1009.2308},
 primaryClass = "astro-ph.SR",
 keywords = {binaries: close, stars: activity, stars: imaging, stars: individual: II Pegasi, starspots, stars: variables: general},
     year = 2011,
    month = apr,
   volume = 141,
      eid = {138},
    pages = {138},
      doi = {10.1088/0004-6256/141/4/138},
   adsurl = {http://adsabs.harvard.edu/abs/2011AJ....141..138R},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Kovari2012,
   author = {{K{\H o}v{\'a}ri}, Z. and {Korhonen}, H. and {Kriskovics}, L. and
	{Vida}, K. and {Donati}, J.-F. and {Le Coroller}, H. and {Monnier}, J.~D. and
	{Pedretti}, E. and {Petit}, P.},
    title = "{Measuring differential rotation of the K-giant {$\zeta$} Andromedae}",
  journal = {\aap},
archivePrefix = "arXiv",
   eprint = {1201.2921},
 primaryClass = "astro-ph.SR",
 keywords = {stars: activity, stars: imaging, stars: late-type, starspots, stars: individual: {$\zeta$}Andromedae},
     year = 2012,
    month = mar,
   volume = 539,
      eid = {A50},
    pages = {A50},
      doi = {10.1051/0004-6361/201118177},
   adsurl = {http://adsabs.harvard.edu/abs/2012A%26A...539A..50K},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Kozhevnikova2015,
   author = {{Kozhevnikova}, A.~V. and {Alekseev}, I.~Y.},
    title = "{Long-term spottedness variations of 16 RS CVn stars}",
  journal = {Astronomy Reports},
     year = 2015,
    month = oct,
   volume = 59,
    pages = {937-951},
      doi = {10.1134/S1063772915100030},
   adsurl = {http://adsabs.harvard.edu/abs/2015ARep...59..937K},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Rucinski98,
   author = {{Rucinski}, S.~M.},
    title = "{Contact Binaries of the Galactic Disk: Comparison of the Baade's Window and Open Cluster Samples}",
  journal = {\aj},
   eprint = {astro-ph/9806154},
 keywords = {STARS: BINARIES: ECLIPSING, STARS: BINARIES: GENERAL, STARS: STATISTICS},
     year = 1998,
    month = dec,
   volume = 116,
    pages = {2998-3017},
      doi = {10.1086/300644},
   adsurl = {http://adsabs.harvard.edu/abs/1998AJ....116.2998R},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Maceroni96,
   author = {{Maceroni}, C. and {van't Veer}, F.},
    title = "{The properties of W Ursae Majoris contact binaries: new results and old problems.}",
  journal = {\aap},
 keywords = {BINARIES: CLOSE, STARS: EVOLUTION, STARS: MASS LOSS},
     year = 1996,
    month = jul,
   volume = 311,
    pages = {523-531},
   adsurl = {http://adsabs.harvard.edu/abs/1996A%26A...311..523M},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Paczynski2006,
   author = {{Paczy{\'n}ski}, B. and {Szczygie{\l}}, D.~M. and {Pilecki}, B. and
	{Pojma{\'n}ski}, G.},
    title = "{Eclipsing binaries in the All Sky Automated Survey catalogue}",
  journal = {\mnras},
   eprint = {astro-ph/0601026},
 keywords = {binaries: eclipsing: stars: evolution, binaries: eclipsing, stars: evolution},
     year = 2006,
    month = may,
   volume = 368,
    pages = {1311-1318},
      doi = {10.1111/j.1365-2966.2006.10223.x},
   adsurl = {http://adsabs.harvard.edu/abs/2006MNRAS.368.1311P},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Lucy68,
   author = {{Lucy}, L.~B.},
    title = "{The Structure of Contact Binaries}",
  journal = {\apj},
     year = 1968,
    month = mar,
   volume = 151,
    pages = {1123},
      doi = {10.1086/149510},
   adsurl = {http://adsabs.harvard.edu/abs/1968ApJ...151.1123L},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Maceroni94,
   author = {{Maceroni}, C. and {Vilhu}, O. and {van't Veer}, F. and {van Hamme}, W.
	},
    title = "{Surface imaging of late-type contact binaries I: AE Phoenicis and YY Eridani}",
  journal = {\aap},
 keywords = {STARS: INDIVIDUAL: AE PHE, YY ERI, STARS: ACTIVITY, BINARIES: CLOSE, STARS: IMAGING, METHODS: DATA ANALYSIS},
     year = 1994,
    month = aug,
   volume = 288,
    pages = {529-537},
   adsurl = {http://adsabs.harvard.edu/abs/1994A%26A...288..529M},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Hendry2000,
   author = {{Hendry}, P.~D. and {Mochnacki}, S.~W.},
    title = "{Doppler Imaging of VW Cephei: Distribution and Evolution of Starspots on a Contact Binary}",
  journal = {\apj},
 keywords = {STARS: BINARIES: CLOSE, STARS: IMAGING, STARS: INDIVIDUAL: CONSTELLATION NAME: VW CEPHEI},
     year = 2000,
    month = mar,
   volume = 531,
    pages = {467-493},
      doi = {10.1086/308427},
   adsurl = {http://adsabs.harvard.edu/abs/2000ApJ...531..467H},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Hussain2002,
   author = {{Hussain}, G.~A.~J.},
    title = "{Starspot lifetimes}",
  journal = {Astronomische Nachrichten},
 keywords = {stars: activity, stars: spots, techniques: spectroscopic, techniques},
     year = 2002,
    month = jul,
   volume = 323,
    pages = {349-356},
      doi = {10.1002/1521-3994(200208)323:3/4<349::AID-ASNA349>3.0.CO;2-E},
   adsurl = {http://adsabs.harvard.edu/abs/2002AN....323..349H},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Rodriguez2010,
   author = {{Rodr{\'{\i}}guez}, E. and {Garc{\'{\i}}a}, J.~M. and {Costa}, V. and
	{Lampens}, P. and {van Cauteren}, P. and {Mkrtichian}, D.~E. and
	{Olson}, E.~C. and {Amado}, P.~J. and {Daszy{\'n}ska-Daszkiewicz}, J. and
	{Turcu}, V. and {Kim}, S.-L. and {Zhou}, A.~Y. and {L{\'o}pez-Gonz{\'a}lez}, M.~J. and
	{Rolland}, A. and {D{\'{\i}}az-Fraile}, D. and {Wood}, M.~A. and
	{Hintz}, E. and {Pop}, A. and {Moldovan}, D. and {Etzel}, P.~B. and
	{Casanova}, V. and {Sota}, A. and {Aceituno}, F.~J. and {Lee}, D.-J.
	},
    title = "{{$\delta$} Sct-type pulsations in eclipsing binary systems: Y Cam}",
  journal = {\mnras},
 keywords = {techniques: photometric, binaries: eclipsing, stars: individual: Y Cam, stars: oscillations, stars: variables: {$\delta$} Scuti},
     year = 2010,
    month = nov,
   volume = 408,
    pages = {2149-2162},
      doi = {10.1111/j.1365-2966.2010.17055.x},
   adsurl = {http://adsabs.harvard.edu/abs/2010MNRAS.408.2149R},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@INPROCEEDINGS{Mkrtichian2007,
   author = {{Mkrtichian}, D.~E. and {Kim}, S.-L. and {Rodr{\'{\i}}guez}, E. and
	{Olson}, E.~C. and {Nazarenko}, V. and {Gamarova}, A.~Y. and
	{Kusakin}, A.~V. and {Lehmann}, H. and {Lee}, J.~W. and {Kang}, Y.~W.
	},
    title = "{The oEA Stars}",
booktitle = {Solar and Stellar Physics Through Eclipses},
     year = 2007,
   series = {Astronomical Society of the Pacific Conference Series},
   volume = 370,
   editor = {{Demircan}, O. and {Selam}, S.~O. and {Albayrak}, B.},
    month = may,
    pages = {194},
   adsurl = {http://adsabs.harvard.edu/abs/2007ASPC..370..194M},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
@ARTICLE{Soydugan2006,
   author = {{Soydugan}, E. and {{\.I}bano{\v g}lu}, C. and {Soydugan}, F. and
	{Akan}, M.~C. and {Demircan}, O.},
    title = "{The connection between the pulsational and orbital periods for eclipsing binary systems}",
  journal = {\mnras},
 keywords = {binaries: eclipsing , stars: oscillations , {$\delta$} Scuti},
     year = 2006,
    month = mar,
   volume = 366,
    pages = {1289-1294},
      doi = {10.1111/j.1365-2966.2005.09889.x},
   adsurl = {http://adsabs.harvard.edu/abs/2006MNRAS.366.1289S},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Liakos2017,
   author = {{Liakos}, A. and {Niarchos}, P.},
    title = "{Catalogue and properties of {$\delta$} Scuti stars in binaries}",
  journal = {\mnras},
archivePrefix = "arXiv",
   eprint = {1611.00200},
 primaryClass = "astro-ph.SR",
 keywords = {binaries: close, binaries: eclipsing, stars: fundamental parameters, stars: variables: {$\delta$} Scuti},
     year = 2017,
    month = feb,
   volume = 465,
    pages = {1181-1200},
      doi = {10.1093/mnras/stw2756},
   adsurl = {http://adsabs.harvard.edu/abs/2017MNRAS.465.1181L},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Brinkworth2006,
   author = {{Brinkworth}, C.~S. and {Marsh}, T.~R. and {Dhillon}, V.~S. and
	{Knigge}, C.},
    title = "{Detection of a period decrease in NN Ser with ULTRACAM: evidence for strong magnetic braking or an unseen companion}",
  journal = {\mnras},
   eprint = {astro-ph/0510331},
 keywords = {binaries: eclipsing, stars: evolution, stars: fundamental parameters, stars: individual: NN Ser, planetary systems},
     year = 2006,
    month = jan,
   volume = 365,
    pages = {287-295},
      doi = {10.1111/j.1365-2966.2005.09718.x},
   adsurl = {http://adsabs.harvard.edu/abs/2006MNRAS.365..287B},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Applegate1992,
   author = {{Applegate}, J.~H.},
    title = "{A mechanism for orbital period modulation in close binaries}",
  journal = {\apj},
 keywords = {Eclipsing Binary Stars, Orbit Perturbation, Stellar Magnetic Fields, Stellar Orbits, Variable Stars, Angular Momentum, Gravitational Effects, Magnetic Stars, Stellar Activity, Stellar Evolution},
     year = 1992,
    month = feb,
   volume = 385,
    pages = {621-629},
      doi = {10.1086/170967},
   adsurl = {http://adsabs.harvard.edu/abs/1992ApJ...385..621A},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Watson2010,
   author = {{Watson}, C.~A. and {Marsh}, T.~R.},
    title = "{Orbital period variations of hot Jupiters caused by the Applegate effect}",
  journal = {\mnras},
archivePrefix = "arXiv",
   eprint = {1003.0340},
 primaryClass = "astro-ph.EP",
 keywords = {planet-star interactions, stars: activity, stars: fundamental properties, stars: rotation},
     year = 2010,
    month = jul,
   volume = 405,
    pages = {2037-2043},
      doi = {10.1111/j.1365-2966.2010.16602.x},
   adsurl = {http://adsabs.harvard.edu/abs/2010MNRAS.405.2037W},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Lanza1998,
   author = {{Lanza}, A.~F. and {Rodono}, M. and {Rosner}, R.},
    title = "{Orbital period modulation and magnetic cycles in close binaries}",
  journal = {\mnras},
 keywords = {STARS: ACTIVITY, BINARIES: CLOSE, STARS: INDIVIDUAL: RS CVN, STARS: MAGNETIC FIELDS, PULSARS: GENERAL, STARS: ROTATION},
     year = 1998,
    month = jun,
   volume = 296,
    pages = {893-902},
      doi = {10.1046/j.1365-8711.1998.01446.x},
   adsurl = {http://adsabs.harvard.edu/abs/1998MNRAS.296..893L},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Nanouris2011,
   author = {{Nanouris}, N. and {Kalimeris}, A. and {Antonopoulou}, E. and
	{Rovithis-Livaniou}, H.},
    title = "{Efficiency of O-C diagrams as diagnostic tools for long-term period variations. I. Wind-driven mass loss and magnetic braking}",
  journal = {\aap},
 keywords = {binaries: close, stars: late-type, stars: mass-loss, methods: miscellaneous},
     year = 2011,
    month = nov,
   volume = 535,
      eid = {A126},
    pages = {A126},
      doi = {10.1051/0004-6361/201116707},
   adsurl = {http://adsabs.harvard.edu/abs/2011A%26A...535A.126N},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}


text:
SUMMARY = "Alljoyn thin framework services."
DESCRIPTION = "Alljoyn is an Open Source framework that makes it easy for devices and apps to discover and securely communicate with each other."
AUTHOR = "Herve Jourdain <herve.jourdain@beechwoods.com>"
HOMEPAGE = "https://www.allseenalliance.org/"
SECTION = "libs"
LICENSE = "ISC"
DEPENDS = "openssl libxml2"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"

S = "${WORKDIR}/alljoyn"
SRC_URI = " \
            git://git.allseenalliance.org/gerrit/core/ajtcl.git;protocol=https;branch=RB${PV};destsuffix=alljoyn/core/ajtcl \
          "
SRCREV = "${AUTOREV}"

AJTCL_SERVICES_SAMPLES ?= "ConfigSample"
AJTCL_BINDIR ?= "/opt/ajtcl/bin"

inherit scons

PACKAGES = " \
             ${PN}-dbg \
             ${PN} \
             ${PN}-staticdev \
             ${PN}-dev \
           "

do_compile() {
# For _class-target and _class-nativesdk
    export CROSS_PREFIX="${TARGET_PREFIX}"
# Path to the cross-compiler is included in the PATH variable set by the OE environment
    export CROSS_PATH="${PATH}"
    export CROSS_CFLAGS="${TARGET_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${CFLAGS}"
    export CROSS_LINKFLAGS="${TARGET_LD_ARCH} ${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
    cd ${S}/core/ajtcl
# GTEST_DIR is required because if gtest framework is present, but GTEST_DIR is not, then it triggers a compilation error!
    scons TARG=linux WS=off GTEST_DIR=${STAGING_DIR_HOST}/${prefix}
#    cd ${S}/services/base_tcl
#    scons TARG=linux WS=off AJ_TCL_ROOT=../../core/ajtcl
    unset CROSS_PREFIX
    unset CROSS_PATH
    unset CROSS_CFLAGS
    unset CROSS_LINKFLAGS
}

do_compile_class-native() {
    cd ${S}/core/ajtcl
    scons TARG=linux WS=off
#    cd ${S}/services/base_tcl
#    scons WS=off AJ_TCL_ROOT=../../core/ajtcl
}

do_install() {
# Install service libraries from core
    install -d ${D}/${libdir} ${D}/${includedir}/ajtcl
    install ${S}/core/ajtcl/dist/lib/libajtcl_services* ${D}/${libdir}
    cp -r ${S}/core/ajtcl/dist/include/ajtcl/services ${D}/${includedir}/ajtcl
# Install service samples from core
    for i in ${AJTCL_SERVICES_SAMPLES}
    do
        if [ -f "${S}/core/ajtcl/dist/bin/services/${i}" ]; then
            install -d ${D}/${AJTCL_BINDIR}
            install ${S}/core/ajtcl/dist/bin/services/${i} ${D}/${AJTCL_BINDIR}
        fi
    done
}

FILES_${PN} = " \
                ${libdir}/libajtcl_*.so \
                ${AJTCL_BINDIR}/* \
              "

RDEPENDS_${PN} += "ajtcl"

BBCLASSEXTEND = "native nativesdk"

repository: jwinarske/meta-alljoyn

license_type: permissive

repo_name: jwinarske/meta-alljoyn

branch_name: refs/heads/master

extension: bb


text:
@online{osdev,
	title = {OSDev.org, a community about the creation of operating systems},
	url = {https://wiki.osdev.org}
}

@online{memfaultLinkerScripts,
	title = {From Zero to main(): Demystifying Firmware Linker Scripts},
	urldate = {2020-12-03},
	url = {https://interrupt.memfault.com/blog/how-to-write-linker-scripts-for-firmware}
}

@manual{hifive1RevBBootLoader,
	title = {SiFive HiFive1 Rev B Getting Started Guide},
	date = {2020-12-04},
	version = {1.1},
	publisher = {SiFive Inc},
	chapter = {9},
	pages = {24}
}

@manual{hifive1RevBBootCode,
	title = {SiFive FE310-G002 Preliminary Datasheet},
	date = {2020-12-04},
	version = {v1p0},
	publisher = {SiFive Inc},
	chapter = {5},
	pages = {11}
}

@manual{hifive1RevBConfig,
	title = {SiFive FE310-G002 Preliminary Datasheet},
	date = {2020-12-04},
	version = {v1p0},
	publisher = {SiFive Inc},
	chapter = {3},
	pages = {6-8}
}

@manual{fe310g002man,
    title = {SiFive FE310-G002 Manual},
    date = {2020-12-04},
    version = {v19p04},
    publisher = {SiFive Inc},
}

@manual{fe310g002manOverview,
	title = {SiFive FE310-G002 Manual},
	date = {2020-12-04},
	version = {v19p04},
	publisher = {SiFive Inc},
	chapter = {1},
	pages = {11-12}
}

@manual{fe310g002manBootProcess,
	title = {SiFive FE310-G002 Manual},
	date = {2020-12-04},
	version = {v19p04},
	publisher = {SiFive Inc},
	chapter = {5},
	pages = {23-24}
}

@manual{fe310g002manMMap,
	title = {SiFive FE310-G002 Manual},
	date = {2020-12-04},
	version = {v19p04},
	publisher = {SiFive Inc},
	chapter = {4},
	pages = {22}
}

@online{gnuldProgramHeaders,
	title = {ELF Program Headers},
	url = {https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_23.html},
	urldate = {2020-12-14}
}

@online{gnuldOutputSections,
    title = {Specifying Output Sections},
    url = {https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_mono/ld.html#SEC17},
    urldate = {2020-12-14}
}

@book{giometti2017gnu,
    title={GNU/Linux Rapid Embedded Programming},
    author={Giometti, R.},
    isbn={9781786463289},
    url={https://books.google.com/books?id=pLkrDwAAQBAJ},
    year={2017},
    publisher={Packt Publishing}
}

license: MIT

repository: knejadfard/rkern

repo_name: knejadfard/rkern

branch_name: refs/heads/main

gha_license_id: MIT

gha_language: TeX

extension: bib


text:
SRCREV = "abcf1e2f4dfb0431cd74497925eb3e25dfbdba70"

OUTPUT_BIN = "output_binaries_${DEVICE_GEN}_${IGPS_MACHINE}"

require npcm8xx-tip-fw.inc

repository: openbmc/openbmc

repo_name: openbmc/openbmc

gha_license_id: NOASSERTION

gha_language: Python


text:
package main

import (
	"google.golang.org/grpc"
	"log"
	"net"
)

const (
	_port = ":1234"
)

func main() {
	lis, err := net.Listen("tcp", _port)
	if err != nil {
		log.Fatal(err)
	}
	log.Println("listening on ", lis.Addr())

	s := grpc.NewServer()
	ins := new(server)
	RegisterTunServiceServer(s, ins)
	s.Serve(lis)
}

extension: go


text:
require recipes-image/images/tizen-common-core-image-minimal.bb

SUMMARY = "A Wayland image with a terminal and crosswalk"

LICENSE = "MIT"

DESCRIPTION = "A weston image with Tizen common ."

# Crosswalk
CORE_IMAGE_EXTRA_INSTALL += "packagegroup-tizen-crosswalk"

# Time zone
CORE_IMAGE_EXTRA_INSTALL += "tzdata"

repository: rzr/meta-tizen

repo_name: rzr/meta-tizen

gha_language: PHP


text:
package qimen

// DeliveryOrderBatchCreateAnswerRequest 结构体
type DeliveryOrderBatchCreateAnswerRequest struct {
	// 发货单列表
	Orders []Order `json:"orders,omitempty" xml:"orders>order,omitempty"`
	// 扩展属性
	ExtendProps *TaobaoQimenDeliveryorderBatchcreateAnswerMap `json:"extendProps,omitempty" xml:"extendProps,omitempty"`
}

repository: bububa/opentaobao

repo_name: bububa/opentaobao

gha_language: Go


text:
@article{Nagamine_2008,
 author = {Nagamine, Toshihiro and Kawasaki, Yu and Abe, Atsushi and Matsumoto, Shogo},
 title = {Nuclear Marginalization of Host Cell Chromatin Associated with Expansion of Two Discrete Virus-Induced Subnuclear Compartments during Baculovirus Infection},
 journal = {Journal of Virology},
 publisher = {American Society for Microbiology},
 year = {2008},
 month = {apr},
 number = {13},
 volume = {82},
 pages = {6409--6418},
 url = {https://doi.org/10.1128%2Fjvi.00490-08},
 doi = {10.1128/jvi.00490-08}
}


text:
# Copied from http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/python?h=jethro d462015

SUMMARY = "Python GObject bindings"
SECTION = "devel/python"
LICENSE = "LGPLv2.1"

RECIPE_NO_UPDATE_REASON = "Newer versions of python-pygobject depend on gobject-introspection which doesn't cross-compile"

LIC_FILES_CHKSUM = "file://COPYING;md5=a916467b91076e631dd8edb7424769c7"
DEPENDS = "python python-pygobject-native libffi glib-2.0"
DEPENDS_class-native = "python-native libffi-native glib-2.0-native"
RDEPENDS_class-native = ""

MAJ_VER = "${@d.getVar('PV',1).split('.')[0]}.${@d.getVar('PV',1).split('.')[1]}"

SRC_URI = "${GNOME_MIRROR}/pygobject/${MAJ_VER}/pygobject-${PV}.tar.bz2 \
           file://obsolete_automake_macros.patch \
"

# libtool-native doesn't have fixinstall.patch applied which means
# that libs get relinked at installation time. This triggers a
# relinking along the lines of:
# gcc -L/tmp/foo/media/build1/poky/build/tmp/sysroots/x86_64-linux/usr/lib -lpyglib-2.0-python -o .libs/_glib.so
# where /tmp/foo is DESTDIR and pyglib-2.0-python may be installed/reinstalled
# at the same time as the gcc command runs.
# If this happens between the handoff between gcc and ld, you can see:
# /bin/ld: cannot find -lpyglib-2.0-python
# Adding a dependency rule like  install-pyglibLTLIBRARIES: install-libLTLIBRARIES
# would be ideal but automake can't cope with that without manually
# defining the whole function. Give up and disable parallel make in native builds.
PARALLEL_MAKEINST_class-native = ""

SRC_URI[md5sum] = "aa64900b274c4661a5c32e52922977f9"
SRC_URI[sha256sum] = "7da88c169a56efccc516cebd9237da3fe518a343095a664607b368fe21df95b6"
S = "${WORKDIR}/pygobject-${PV}"

EXTRA_OECONF += "--disable-introspection"

inherit autotools distutils-base pkgconfig

# necessary to let the call for python-config succeed
export BUILD_SYS
export HOST_SYS
export STAGING_INCDIR
export STAGING_LIBDIR

PACKAGES += "${PN}-lib"

RDEPENDS_${PN} += "python-textutils"

FILES_${PN} = "${libdir}/python*"
FILES_${PN}-lib = "${libdir}/lib*.so.*"
FILES_${PN}-dev += "${bindir} ${datadir}"

BBCLASSEXTEND = "native"

repository: GENIVI/genivi-dev-platform

repo_name: GENIVI/genivi-dev-platform

gha_language: Shell


text:
require rsync.inc

PR = "r1"

SRC_URI += "\
  file://m4.patch \
  file://rsyncd.conf \
"

do_compile_prepend() {
        sed -i "s/conf_stop make_stop//" Makefile
}

SRC_URI[md5sum] = "2122d460b4119749c6e5993938a9b501"
SRC_URI[sha256sum] = "17697db5bb9de399b71f7927070f60b3554b70b0ecc0419b50455d56560ea169"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
package endpoint

import (
	"context"
	"fmt"
	"regexp"

	"github.com/pkg/errors"

	"github.com/zrepl/zrepl/zfs"
)

const (
	LastReceivedHoldTagNamePrefix = "zrepl_last_received_J_"
)

var lastReceivedHoldTagRE = regexp.MustCompile("^zrepl_last_received_J_(.+)$")

var _ HoldExtractor = LastReceivedHoldExtractor

func LastReceivedHoldExtractor(fs *zfs.DatasetPath, v zfs.FilesystemVersion, holdTag string) Abstraction {
	var err error

	if v.Type != zfs.Snapshot {
		panic("impl error")
	}

	jobID, err := ParseLastReceivedHoldTag(holdTag)
	if err == nil {
		return &holdBasedAbstraction{
			Type:              AbstractionLastReceivedHold,
			FS:                fs.ToString(),
			FilesystemVersion: v,
			Tag:               holdTag,
			JobID:             jobID,
		}
	}
	return nil
}

// err != nil always means that the bookmark is not a step bookmark
func ParseLastReceivedHoldTag(tag string) (JobID, error) {
	match := lastReceivedHoldTagRE.FindStringSubmatch(tag)
	if match == nil {
		return JobID{}, errors.Errorf("parse last-received-hold tag: does not match regex %s", lastReceivedHoldTagRE.String())
	}
	jobId, err := MakeJobID(match[1])
	if err != nil {
		return JobID{}, errors.Wrap(err, "parse last-received-hold tag: invalid job id field")
	}
	return jobId, nil
}

func LastReceivedHoldTag(jobID JobID) (string, error) {
	return lastReceivedHoldImpl(jobID.String())
}

func lastReceivedHoldImpl(jobid string) (string, error) {
	tag := fmt.Sprintf("%s%s", LastReceivedHoldTagNamePrefix, jobid)
	if err := zfs.ValidHoldTag(tag); err != nil {
		return "", err
	}
	return tag, nil
}

func CreateLastReceivedHold(ctx context.Context, fs string, to zfs.FilesystemVersion, jobID JobID) (Abstraction, error) {

	if !to.IsSnapshot() {
		return nil, errors.Errorf("last-received-hold: target must be a snapshot: %s", to.FullPath(fs))
	}

	tag, err := LastReceivedHoldTag(jobID)
	if err != nil {
		return nil, errors.Wrap(err, "last-received-hold: hold tag")
	}

	// we never want to be without a hold
	// => hold new one before releasing old hold

	err = zfs.ZFSHold(ctx, fs, to, tag)
	if err != nil {
		return nil, errors.Wrap(err, "last-received-hold: hold newly received")
	}

	return &holdBasedAbstraction{
		Type:              AbstractionLastReceivedHold,
		FS:                fs,
		FilesystemVersion: to,
		JobID:             jobID,
		Tag:               tag,
	}, nil
}

repository: zrepl/zrepl

repo_name: zrepl/zrepl


text:
@article{fengxiangJiYuErWeiMaJiZhuDeZhiZhiJiaoFuShuFuWuPingTai2013a,
 author = {冯翔 and 吴永和 and 王健 and 任友群},
 journal = {华东师范大学学报(自然科学版)},
 number = {6},
 pages = {193--201},
 title = {基于二维码技术的纸质教辅书服务平台},
 year = {2013}
}

repository: AIED-ECNU/academic-kickstart

repo_name: AIED-ECNU/academic-kickstart


text:
package driver

import (
	"io/ioutil"
	"path"
	"strings"

	"google.golang.org/grpc/codes"

	"google.golang.org/grpc/status"
)

// ReadIRODSSecrets reads secrets from secret volume mount
func ReadIRODSSecrets(secretPath string) (map[string]string, error) {
	exist, err := PathExists(secretPath)
	if err != nil {
		return nil, status.Errorf(codes.Internal, "Secret path %s does not exist - %s", secretPath, err)
	}

	if !exist {
		return nil, status.Errorf(codes.NotFound, "Secret path %s does not exist", secretPath)
	}

	secrets := make(map[string]string)

	files, err := ioutil.ReadDir(secretPath)
	if err != nil {
		return nil, err
	}

	for _, file := range files {
		if !file.IsDir() {
			k := path.Base(file.Name())
			fullPath := path.Join(secretPath, k)
			content, readErr := ioutil.ReadFile(fullPath)
			if readErr == nil {
				contentString := string(content)
				v := strings.TrimSpace(contentString)
				secrets[k] = v
			}
		}
	}
	return secrets, nil
}

repository: iychoi/irods-csi-driver

repo_name: iychoi/irods-csi-driver


text:
package backlog

type Notification struct {
	Id          int  `json:"id"`
	AlreadyRead bool `json:"alreadyRead"`
	Reason      int  `json:"reason"`
	User        User `json:"user"`
}

repository: moutend/go-backlog-old

repo_name: moutend/go-backlog-old


text:
require gnome-shell.inc
SRC_URI[archive.md5sum] = "d8b8521bad4f93f377c89240ceee3f33"
SRC_URI[archive.sha256sum] = "1972d39d1bb1ab708da3534911ac1f89acf45801b7c2cdc9ff9515f4eae17cc6"

repository: oholiab/citadel

repo_name: oholiab/citadel


text:
package archiver

import (
	"archive/tar"
	"fmt"
	"io"
	"os"
	"strings"

	"github.com/ulikunitz/xz"
)

// TarXZ is for TarXZ format
var TarXZ xzFormat

func init() {
	RegisterFormatReaderWriter("TarXZ", TarXZ)
}

type xzFormat struct{}

// Match returns whether filename matches this format.
func (xzFormat) Match(filename string) bool {
	return strings.HasSuffix(strings.ToLower(filename), ".tar.xz") ||
		strings.HasSuffix(strings.ToLower(filename), ".txz") ||
		isTarXz(filename)
}

// isTarXz checks the file has the xz compressed Tar format header by reading
// its beginning block.
func isTarXz(tarxzPath string) bool {
	f, err := os.Open(tarxzPath)
	if err != nil {
		return false
	}
	defer f.Close()

	xzr, err := xz.NewReader(f)
	if err != nil {
		return false
	}

	buf := make([]byte, tarBlockSize)
	n, err := xzr.Read(buf)
	if err != nil || n < tarBlockSize {
		return false
	}

	return hasTarHeader(buf)
}

// MarkWriter the contents of files listed in filePaths in .tar.xz format. File
// paths can be those of regular files or directories.  Regular files are
// stored at the 'root' of the archive, and directories are recursively added.
func (xzFormat) MakeWriter(out io.Writer, filePaths []string, exclusions []string) error {
	xzWriter, err := xz.NewWriter(out)
	if err != nil {
		return fmt.Errorf("error compressing: %v", err)
	}
	defer xzWriter.Close()

	tarWriter := tar.NewWriter(xzWriter)
	defer tarWriter.Close()

	return tarball(filePaths, tarWriter, exclusions)
}

// Open untars source and decompresses the contents into destination.
func (xzFormat) OpenReader(f io.Reader, destination string) error {
	xzReader, err := xz.NewReader(f)
	if err != nil {
		return fmt.Errorf("error decompressing: %v", err)
	}

	return untar(tar.NewReader(xzReader), destination)
}

repository: daemonl/archiver

repo_name: daemonl/archiver


text:
// Copyright (c) 2019 Uber Technologies, 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.

package logging

import (
	"strings"

	mesos "github.com/uber/peloton/.gen/mesos/v1"
	"github.com/uber/peloton/.gen/peloton/api/v0/task"
	"github.com/uber/peloton/.gen/peloton/private/hostmgr/hostsvc"
	"github.com/uber/peloton/pkg/common"

	"github.com/gogo/protobuf/proto"
	log "github.com/sirupsen/logrus"
)

// SecretsFormatter scrubs sensitive information from logs and formats logs into
// parsable json.
type SecretsFormatter struct {
	log.Formatter
}

const redactedStr = "REDACTED"

// redactSecrets redacts secret data in task config
func redactSecrets(taskConfig *task.TaskConfig) {
	for _, volume := range taskConfig.GetContainer().GetVolumes() {
		if volume.GetSource().GetType() == mesos.Volume_Source_SECRET &&
			volume.GetSource().GetSecret().GetValue().GetData() != nil {
			volume.GetSource().GetSecret().GetValue().Data = []byte(redactedStr)
		}
	}
}

// Format is called by logrus and returns the formatted string.
// It looks for secrets data in each entry and redacts it.
func (f *SecretsFormatter) Format(entry *log.Entry) ([]byte, error) {
	for k, v := range entry.Data {
		// look for taskConfig, secret, secret_info string
		switch v := v.(type) {
		case string:
			// filter DB statement so it doesn't contain secret_info
			if (k == common.DBStmtLogField || k == common.DBUqlLogField) &&
				strings.Contains(v, "secret_info") {
				entry.Data[k] = redactedStr
				// CQL Query is on secret_info. Check for the DBArgsLogField
				// which contains actual secret data and redact it
				if _, ok := entry.Data[common.DBArgsLogField]; ok {
					// This field will vary depending on insert or update order
					// It will be in this format:
					// {"args":["5baa5b2d-3856-4112-a35f-04a0c21ed2d6",
					// "3e3fffe1-efda-4aea-a477-d2106e13710a",
					// "/tmp/secret-path","YzI4Z2JYVmphQ0JuWVhKaVlXZGw=",
					// "2018-06-12T22:22:10.002332",0,true]...rest of the fields
					// so we will replace the entire field with redactedStr
					entry.Data[common.DBArgsLogField] = redactedStr
				}
			}
		case *hostsvc.LaunchTasksRequest:
			// The hostsvc.LaunchTasksRequest will contain populated secrets when
			// tasks are being launched from launcher. This check makes sure that
			// these secrets are not logged from jobmgr as well as hostmgr
			clonedLaunchRequest := proto.Clone(v).(*hostsvc.LaunchTasksRequest)
			for _, task := range clonedLaunchRequest.GetTasks() {
				redactSecrets(task.GetConfig())
			}
			entry.Data[k] = clonedLaunchRequest
		case *hostsvc.LaunchableTask:
			// The hostsvc.LaunchableTask will contain populated secrets when
			// tasks are being launched from launcher. This check makes sure that
			// these secrets are not logged from jobmgr as well as hostmgr
			clonedLaunchableTask := proto.Clone(v).(*hostsvc.LaunchableTask)
			redactSecrets(clonedLaunchableTask.GetConfig())
			entry.Data[k] = clonedLaunchableTask
		case []*hostsvc.LaunchableTask:
			newList := []*hostsvc.LaunchableTask{}
			for _, task := range v {
				clonedLaunchableTask := proto.Clone(task).(*hostsvc.LaunchableTask)
				redactSecrets(clonedLaunchableTask.GetConfig())
				newList = append(newList, clonedLaunchableTask)
			}
			entry.Data[k] = newList
		}
	}
	return f.Formatter.Format(entry)
}

repository: fakeNetflix/uber-repo-peloton

repo_name: fakeNetflix/uber-repo-peloton


text:
@INPROCEEDINGS{Bohanec2007,
  author = {Marko Bohanec},
  title = {{DEXiTree}: A program for pretty drawing of trees},
  pages = {7--10},
  abstract = {This paper presents DEXiTree, a computer program for drawing trees. In principle, DEXiTree is aimed at making nice drawings of attribute trees made by DEXi, a computer program for qualitative multi-attribute decision modelling. Apart from that, DEXiTree is quite a general and powerful tree-drawing program that implements four different tree-drawing algorithms (called Distribute, Align, Walker, and QP), draws trees in four different directions (top-down, left-right, bottom-up and right-left) and provides an extensive set of parameters for controlling the appearance of trees and their components. DEXiTree’s functionality includes loading a decision model from a DEXi file, interactively designing the tree layout, saving and loading the layout using an XML format, and rendering the drawing in two graphic formats: vector and raster.},
  url = {http://kt.ijs.si/MarkoBohanec/pub/IS2007_DEXiTree.pdf},
  year = {2007},
  booktitle = {IS'07: Proceedings of the International Multiconference Information Society},
  editor = {Marko Bohanec and Matja\v{z} Gams and Vladislav Rajkovi\v{c} and Tanja Urban\v{c}i\v{c} and Mojca Bernik and Dunja Mladeni\'c and Marko Grobelnik and Marjan Heri\v{c}ko and Urban Korde\v{s} and Olga Marki\v{c}},
  isbn = {9789616303941},
}

repository: vis-au/treevisnet

repo_name: vis-au/treevisnet


text:
package gcore

import (
	"context"
	"fmt"
	"net/http"
)

const (
	certificatesURL = "/sslData"
	certificateURL  = "/sslData/%d"
)

// CertService handles communication with the SSL/TLS certificate related methods
// of the G-Core CDN API.
type CertService service

// CertSSL represents G-Core's CertSSL certificate
type CertSSL struct {
	ID                  int     `json:"id"`
	Name                string  `json:"name"`
	CName               string  `json:"cname"`
	Deleted             bool    `json:"deleted"`
	CertSubjectAlt      *string `json:"cert_subject_alt"`
	HasRelatedResources bool    `json:"hasRelatedResources"`
	ValidityNotAfter    *Time   `json:"validity_not_after"`
	ValidityNotBefore   *Time   `json:"validity_not_before"`
	CertificateChain    string  `json:"sslCertificateChain"`
	CertIssuer          string  `json:"cert_issuer"`
	CertSubjectCn       string  `json:"cert_subject_cn"`
}

// AddCertBody represents SSL certificate body for add certificate.
type AddCertBody struct {
	Name        string `json:"name"`
	Certificate string `json:"sslCertificate"`
	PrivateKey  string `json:"sslPrivateKey"`
}

// List returns list of all SSL certificates.
func (s *CertService) List(ctx context.Context) ([]*CertSSL, *http.Response, error) {
	req, err := s.client.NewRequest(ctx, http.MethodGet, certificatesURL, nil)
	if err != nil {
		return nil, nil, err
	}

	certs := make([]*CertSSL, 0)

	resp, err := s.client.Do(req, &certs)
	if err != nil {
		return nil, resp, err
	}

	return certs, resp, nil
}

// Get method returns specific SSL certificate.
func (s *CertService) Get(ctx context.Context, certID int) (*CertSSL, *http.Response, error) {
	req, err := s.client.NewRequest(ctx,
		http.MethodGet,
		fmt.Sprintf(certificateURL, certID), nil)
	if err != nil {
		return nil, nil, err
	}

	cert := &CertSSL{}

	resp, err := s.client.Do(req, cert)
	if err != nil {
		return nil, resp, err
	}

	return cert, resp, nil
}

// Delete method deletes specific SSL certificate.
func (s *CertService) Delete(ctx context.Context, certID int) (*http.Response, error) {
	req, err := s.client.NewRequest(ctx, http.MethodDelete, fmt.Sprintf(certificateURL, certID), nil)
	if err != nil {
		return nil, err
	}

	resp, err := s.client.Do(req, nil)
	if err != nil {
		return resp, err
	}

	return resp, nil
}

// Add method adds SSL certificate to deliver content via HTTPS protocol.
// Paste all strings of the certificate(s) and the private key in one string parameter.
// Each certificate in chain and the private key should be divided with the "\n" symbol.
func (s *CertService) Add(ctx context.Context, body *AddCertBody) (*CertSSL, *http.Response, error) {
	req, err := s.client.NewRequest(ctx, http.MethodPost, certificatesURL, body)
	if err != nil {
		return nil, nil, err
	}

	cert := &CertSSL{}

	resp, err := s.client.Do(req, cert)
	if err != nil {
		return nil, resp, err
	}

	return cert, resp, nil
}

repository: dstdfx/go-gcore

repo_name: dstdfx/go-gcore


text:
package main

import (
	"crypto/md5"
	"crypto/sha1"
	"crypto/sha256"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"path"
	"strings"

	"github.com/Luzifer/gobuilder/builddb"
)

type noDownloadFoundError struct{}
type generalDownloadError struct {
	Message string
}

func (n noDownloadFoundError) Error() string { return "No download was found." }
func (g generalDownloadError) Error() string { return g.Message }

func downloadBuildResult(repo, version, search, target string) error {
	resp, err := http.Get(fmt.Sprintf("https://gobuilder.me/api/v1/%s/hashes/%s.json", repo, version))
	if err != nil {
		return generalDownloadError{"Was unable to communicate with GoBuilder, please try again."}
	}
	defer resp.Body.Close()

	hdb := builddb.HashDB{}
	if err := json.NewDecoder(resp.Body).Decode(&hdb); err != nil {
		return generalDownloadError{fmt.Sprintf("Unable to read hash-database: %s", err)}
	}

	downloaded := 0
	for k := range hdb {
		if strings.Contains(k, search) {
			if err := downloadAndCheck(repo, k, target, hdb[k]); err != nil {
				fmt.Printf("%s\n", err)
				continue
			}
			fmt.Printf("%s downloaded and verified successfully.\n", k)
			downloaded++
		}
	}

	if downloaded == 0 {
		return noDownloadFoundError{}
	}
	return nil
}

func downloadAndCheck(repo, filename, target string, hash builddb.Hashes) error {
	url := fmt.Sprintf("https://gobuilder.me/get/%s/%s", repo, filename)
	resp, err := http.Get(url)
	if err != nil {
		fmt.Printf("An error ocurred while downloading the package '%s': %s", filename, err)
		return err
	}
	defer resp.Body.Close()

	body, _ := ioutil.ReadAll(resp.Body)
	s5, s1, s256 := buildHashes(body)

	if s5 != hash.MD5 || s1 != hash.SHA1 || s256 != hash.SHA256 {
		return fmt.Errorf("Download of %s failed, hashes did not match.", filename)
	}

	return ioutil.WriteFile(path.Join(target, filename), body, 0644)
}

func buildHashes(fileContent []byte) (string, string, string) {
	sha1sum := fmt.Sprintf("%x", sha1.Sum(fileContent))
	sha256sum := fmt.Sprintf("%x", sha256.Sum256(fileContent))
	md5sum := fmt.Sprintf("%x", md5.Sum(fileContent))
	return md5sum, sha1sum, sha256sum
}

repository: Luzifer/gobuilder

repo_name: Luzifer/gobuilder


text:
require ${PN}.inc

SRC_URI = "http://sources.openembedded.org/opie-1.2.5-split_noncore_tools_calculator.tar.bz2;name=split_noncore_tools_calculator \
           http://sources.openembedded.org/opie-1.2.5-split_pics.tar.bz2;name=split_pics \
           http://sources.openembedded.org/opie-1.2.5-split_apps.tar.bz2;name=split_apps \
           http://sources.openembedded.org/opie-1.2.5-split_etc.tar.bz2;name=split_etc"
SRC_URI[split_noncore_tools_calculator.md5sum] = "fc16a420e33265aa21a4e8cc246d7faf"
SRC_URI[split_noncore_tools_calculator.sha256sum] = "848c73af73fa2ba48c930e2c50fb2d6db6209aed1d0d3e1df6bdcc806f5b22a8"
SRC_URI[split_pics.md5sum] = "e9b68749d67295f7080a23e39b17335e"
SRC_URI[split_pics.sha256sum] = "0a7aab6d0bce04d6a9c257d768d8a1a481d38ba527d6e6e50723973789954b4a"
SRC_URI[split_apps.md5sum] = "c765d13427e4dc8ee396e4dfed2dbe73"
SRC_URI[split_apps.sha256sum] = "0fea454d8d286f7febc7449e4a06f73e941e8b22e9bab904a32e57f35479862a"
SRC_URI[split_etc.md5sum] = "74ef523ef12e242155bbb745072434d9"
SRC_URI[split_etc.sha256sum] = "eef55ea2248b4f45f3a07beb6012e431dd71d4eefa134d39cc50b4d194c53087"


text:
@article{xu2018unpaired,
  title={Unpaired sentiment-to-sentiment translation: A cycled reinforcement learning approach},
  author={Xu, Jingjing and Sun, Xu and Zeng, Qi and Ren, Xuancheng and Zhang, Xiaodong and Wang, Houfeng and Li, Wenjie},
  journal={arXiv preprint arXiv:1805.05181},
  year={2018}
}

repository: jingjingxupku/academic-kickstart

repo_name: jingjingxupku/academic-kickstart


text:
@article{yi-yuan_all-optical_2008,
 author = {Yi-Yuan, Xie and Jian-Guo, Zhang and Wei-Qiang, Wang and Shuang-Yi, Yan and Xiao-Ping, Xie},
 date = {2008-06},
 doi = {10.1088/0256-307X/25/6/035},
 file = {/Users/sy13201/Zotero/storage/AM7IEFXC/Yi-Yuan et al_2008_All-Optical RZ to NRZ Format Conversion Using Single SOA Assisted by Optical.pdf},
 issn = {0256-307X, 1741-3540},
 journaltitle = {Chinese Physics Letters},
 number = {6},
 pages = {2051--2054},
 title = {All-Optical RZ to NRZ Format Conversion Using Single SOA Assisted by Optical Band-Pass Filter},
 url = {http://iopscience.iop.org/0256-307X/25/6/035},
 urldate = {2013-01-07},
 volume = {25}
}


text:
package main

func myAtoi(str string) int {
	const plusSign rune = '+'
	const minusSign rune = '-'
	const whitespaceSign rune = ' '
	const IntMax int64 = 1<<31 - 1
	const IntMin int64 = -(1 << 31)
	numSet := make(map[rune]int)
	numRS := []rune("0123456789")
	for n, r := range numRS {
		numSet[r] = n
	}

	var signFlag, numberFlag int
	var numbers []int
	rs := []rune(str)
	for _, r := range rs {
		if r == whitespaceSign {
			if signFlag != 0 || numberFlag != 0 {
				break
			}
			continue
		} else if r == plusSign || r == minusSign {
			if signFlag != 0 || numberFlag != 0 {
				break
			}
			if r == plusSign {
				signFlag = 1
			} else {
				signFlag = -1
			}
			continue
		} else if number, ok := numSet[r]; ok {
			numberFlag = 1
			numbers = append(numbers, number)
			continue
		} else {
			break
		}
	}
	if len(numbers) == 0 {
		return 0
	}

	var zeroOffset int
	for _, r := range numbers {
		if r == 0 {
			zeroOffset++
		} else {
			break
		}
	}
	numbers = numbers[0+zeroOffset : len(numbers)]

	if signFlag == 0 {
		signFlag = 1
	}

	if len(numbers) > 13 {
		if signFlag == 1 {
			return int(IntMax)
		} else {
			return int(IntMin)
		}
	}

	var result int64
	for i, j := 0, int64(1); i < len(numbers); i, j = i+1, j*10 {
		result += j * int64(numbers[len(numbers)-i-1])
	}
	result *= int64(signFlag)
	if result > IntMax {
		return int(IntMax)
	} else if result < IntMin {
		return int(IntMin)
	}
	return int(result)
}

repository: ldsink/LeetCode

repo_name: ldsink/LeetCode


text:
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You 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 model

import "github.com/InsZVA/incubator-rocketmq-externals/rocketmq-go/api/model"

//MessageQueues queue array
type MessageQueues []*rocketmqm.MessageQueue

//Less compare queue
func (m MessageQueues) Less(i, j int) bool {
	imq := m[i]
	jmq := m[j]

	if imq.Topic < jmq.Topic {
		return true
	} else if imq.Topic < jmq.Topic {
		return false
	}

	if imq.BrokerName < jmq.BrokerName {
		return true
	} else if imq.BrokerName < jmq.BrokerName {
		return false
	}
	return imq.QueueId < jmq.QueueId
}

//Swap swap queue
func (m MessageQueues) Swap(i, j int) {
	m[i], m[j] = m[j], m[i]
}

//Len messageQueues's length
func (m MessageQueues) Len() int {
	return len(m)
}

repository: InsZVA/incubator-rocketmq-externals

repo_name: InsZVA/incubator-rocketmq-externals


text:
SUMMARY = "ACCEL-PPP is a high performance VPN server application for linux."
HOMEPAGE = "http://sourceforge.net/apps/trac/accel-ppp/wiki"

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"

DEPENDS = "openssl libpcre"

inherit cmake

PR = "r1"
PV = "1.7.3+git"

SRCREV = "4acfa46c321a344b9a6ce4128e72d1e02828d8a0"
SRC_URI = "git://accel-ppp.git.sourceforge.net/gitroot/accel-ppp/accel-ppp;branch=1.7"

S = "${WORKDIR}/git"

EXTRA_OECMAKE = " \
                 -DBUILD_DRIVER=FALSE \
                 -DCMAKE_INSTALL_PREFIX=${prefix} \
                 -DCMAKE_BUILD_TYPE=Release \
                 -DLOG_PGSQL=FALSE \
                 -DRADIUS=FALSE \
                 -DNETSNMP=FALSE \
"
FILES_${PN}-dbg += "/usr/lib/${BPN}/.debug/*"

PACKAGES =+ "${PN}-libs"
FILES_${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so"
INSANE_SKIP_${PN}-libs = "dev-so"
RDEPENDS_${PN} += "${PN}-libs"

repository: ExorEmbedded/exor-workspace

repo_name: ExorEmbedded/exor-workspace


text:
@inproceedings{maxent10,
 author = {I. Smith and A. Ferrari},
 booktitle = {Maxent},
 title = {The Posterior distribution of the Likelihood Ratio as a
measure of evidence},
 year = {2010}
}

repository: andferrari/academic-kickstart

repo_name: andferrari/academic-kickstart


text:
// Code generated by counterfeiter. DO NOT EDIT.
package appregistryfakes

import (
	"sync"

	"github.com/operator-framework/operator-registry/pkg/appregistry"
)

type FakeImageAppender struct {
	AppendStub        func(string, string, string) error
	appendMutex       sync.RWMutex
	appendArgsForCall []struct {
		arg1 string
		arg2 string
		arg3 string
	}
	appendReturns struct {
		result1 error
	}
	appendReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeImageAppender) Append(arg1 string, arg2 string, arg3 string) error {
	fake.appendMutex.Lock()
	ret, specificReturn := fake.appendReturnsOnCall[len(fake.appendArgsForCall)]
	fake.appendArgsForCall = append(fake.appendArgsForCall, struct {
		arg1 string
		arg2 string
		arg3 string
	}{arg1, arg2, arg3})
	fake.recordInvocation("Append", []interface{}{arg1, arg2, arg3})
	fake.appendMutex.Unlock()
	if fake.AppendStub != nil {
		return fake.AppendStub(arg1, arg2, arg3)
	}
	if specificReturn {
		return ret.result1
	}
	fakeReturns := fake.appendReturns
	return fakeReturns.result1
}

func (fake *FakeImageAppender) AppendCallCount() int {
	fake.appendMutex.RLock()
	defer fake.appendMutex.RUnlock()
	return len(fake.appendArgsForCall)
}

func (fake *FakeImageAppender) AppendCalls(stub func(string, string, string) error) {
	fake.appendMutex.Lock()
	defer fake.appendMutex.Unlock()
	fake.AppendStub = stub
}

func (fake *FakeImageAppender) AppendArgsForCall(i int) (string, string, string) {
	fake.appendMutex.RLock()
	defer fake.appendMutex.RUnlock()
	argsForCall := fake.appendArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2, argsForCall.arg3
}

func (fake *FakeImageAppender) AppendReturns(result1 error) {
	fake.appendMutex.Lock()
	defer fake.appendMutex.Unlock()
	fake.AppendStub = nil
	fake.appendReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeImageAppender) AppendReturnsOnCall(i int, result1 error) {
	fake.appendMutex.Lock()
	defer fake.appendMutex.Unlock()
	fake.AppendStub = nil
	if fake.appendReturnsOnCall == nil {
		fake.appendReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.appendReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeImageAppender) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	fake.appendMutex.RLock()
	defer fake.appendMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeImageAppender) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ appregistry.ImageAppender = new(FakeImageAppender)

repository: djzager/operator-registry

repo_name: djzager/operator-registry


text:
package main

// TODO: copy/hardlink mask.

const helpFormat = `Format:
  * required
  - omit

  Variable
    // variables do not apply across files
    $ *name value

  Directory
    d *dst mode uid gid

  Symlink
    // dst is the filename in archive
    // 'l to from' = 'from -> to'

    l *dst *src uid gid

  File
    f *src dst mode uid gid
    // fr is relative

  Recursive
    // omitted dst will target archive root
    // src path is stripped from dst

    R *src *dst uid gid
    // Rr is relative

  Glob
    g *src *dst uid gid
    // gr is relative

  Create
    // all preceding ' ' and \t are stripped
    // from data and file is \n terminated
    // 'c file - - -	 foo  bar  ' = 'foo  bar  '

    c *dst mode uid gid *data
    // cl is not \n terminated

  ELF
    // elf is prefixed with rootfs when it is not omitted
    L *elf dst mode uid gid rootfs
    // gL is globbed

Masks:
  Mode
    mm *idx *regexp mode uid gid

  Ignore
    mi *idx *regexp
    // mI is reversed

  Rename
    mr *idx *regexp *dst

  Clear
    mc idx`

repository: multimfi/archivegen

repo_name: multimfi/archivegen


text:
package main

import "fmt"

//结构体嵌套

type address struct {
	province string
	city     string
}

type workPlace struct {
	province string
	city     string
}

type person struct {
	name    string
	age     int
	address //匿名嵌套结构体
	//address:address
	workPlace
}

type company struct {
	name string
	addr address
}

func main() {
	p1 := person{
		name: "cxc",
		age:  20,
		address: address{
			province: "山东",
			city:     "威海",
		},
	}
	fmt.Println(p1)
	fmt.Println(p1.name, p1.address.city)
	//先在自己结构体找这个字段，找不到就去匿名嵌套的结构体中查找该字段
	// fmt.Println(p1.name, p1.city)
	fmt.Println(p1.address.city)
	fmt.Println(p1.workPlace.city)
}

repository: iuoipx/All-Stydy-Projects

repo_name: iuoipx/All-Stydy-Projects


text:
@article{beal2019communicating,
 author = {Beal, Jacob and Nguyen, Tramy and Gorochowski, Thomas E and Goñi-Moreno, Angel and Scott-Brown, James and McLaughlin, James Alastair and Madsen, Curtis and Aleritsch, Benjamin and Bartley, Bryan and Bhakta, Shyam and others},
 journal = {ACS synthetic biology},
 number = {8},
 pages = {1818--1825},
 publisher = {ACS Publications},
 title = {Communicating structure and function in synthetic biology diagrams},
 volume = {8},
 year = {2019}
}


text:
SECTION = "libs"
SRC_URI = "http://www.cpan.org/modules/by-module/XML/XML-Parser-2.34.tar.gz"
LICENSE = "Artistic"
S = "${WORKDIR}/XML-Parser-${PV}"

inherit cpan

repository: Terentyev/familiar-linux

repo_name: Terentyev/familiar-linux


text:
package ante

import (
	"fmt"
	"runtime/debug"

	"github.com/palantir/stacktrace"

	tmlog "github.com/tendermint/tendermint/libs/log"

	sdk "github.com/cosmos/cosmos-sdk/types"
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
	"github.com/cosmos/cosmos-sdk/types/tx/signing"
	authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
	authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
	authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

	channelkeeper "github.com/cosmos/ibc-go/modules/core/04-channel/keeper"
	ibcante "github.com/cosmos/ibc-go/modules/core/ante"

	"github.com/tharsis/ethermint/crypto/ethsecp256k1"
	evmtypes "github.com/tharsis/ethermint/x/evm/types"
)

const (
	secp256k1VerifyCost uint64 = 21000
)

// NewAnteHandler returns an ante handler responsible for attempting to route an
// Ethereum or SDK transaction to an internal ante handler for performing
// transaction-level processing (e.g. fee payment, signature verification) before
// being passed onto it's respective handler.
func NewAnteHandler(
	ak evmtypes.AccountKeeper,
	bankKeeper evmtypes.BankKeeper,
	evmKeeper EVMKeeper,
	feeGrantKeeper authante.FeegrantKeeper,
	channelKeeper channelkeeper.Keeper,
	feeMarketKeeper evmtypes.FeeMarketKeeper,
	signModeHandler authsigning.SignModeHandler,
) sdk.AnteHandler {
	return func(
		ctx sdk.Context, tx sdk.Tx, sim bool,
	) (newCtx sdk.Context, err error) {
		var anteHandler sdk.AnteHandler

		defer Recover(ctx.Logger(), &err)

		txWithExtensions, ok := tx.(authante.HasExtensionOptionsTx)
		if ok {
			opts := txWithExtensions.GetExtensionOptions()
			if len(opts) > 0 {
				switch typeURL := opts[0].GetTypeUrl(); typeURL {
				case "/ethermint.evm.v1.ExtensionOptionsEthereumTx":
					// handle as *evmtypes.MsgEthereumTx

					anteHandler = sdk.ChainAnteDecorators(
						NewEthSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
						authante.NewMempoolFeeDecorator(),
						authante.NewTxTimeoutHeightDecorator(),
						authante.NewValidateMemoDecorator(ak),
						NewEthValidateBasicDecorator(),
						NewEthSigVerificationDecorator(evmKeeper),
						NewEthAccountVerificationDecorator(ak, bankKeeper, evmKeeper),
						NewEthNonceVerificationDecorator(ak),
						NewEthGasConsumeDecorator(evmKeeper),
						NewCanTransferDecorator(evmKeeper, feeMarketKeeper),
						NewEthIncrementSenderSequenceDecorator(ak), // innermost AnteDecorator.
					)

				default:
					return ctx, stacktrace.Propagate(
						sdkerrors.Wrap(sdkerrors.ErrUnknownExtensionOptions, typeURL),
						"rejecting tx with unsupported extension option",
					)
				}

				return anteHandler(ctx, tx, sim)
			}
		}

		// handle as totally normal Cosmos SDK tx

		switch tx.(type) {
		case sdk.Tx:
			anteHandler = sdk.ChainAnteDecorators(
				authante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
				authante.NewRejectExtensionOptionsDecorator(),
				authante.NewMempoolFeeDecorator(),
				authante.NewValidateBasicDecorator(),
				authante.NewTxTimeoutHeightDecorator(),
				authante.NewValidateMemoDecorator(ak),
				ibcante.NewAnteDecorator(channelKeeper),
				authante.NewConsumeGasForTxSizeDecorator(ak),
				authante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators
				authante.NewValidateSigCountDecorator(ak),
				authante.NewDeductFeeDecorator(ak, bankKeeper, feeGrantKeeper),
				authante.NewSigGasConsumeDecorator(ak, DefaultSigVerificationGasConsumer),
				authante.NewSigVerificationDecorator(ak, signModeHandler),
				authante.NewIncrementSequenceDecorator(ak), // innermost AnteDecorator
			)
		default:
			return ctx, stacktrace.Propagate(
				sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "invalid transaction type: %T", tx),
				"transaction is not an SDK tx",
			)
		}

		return anteHandler(ctx, tx, sim)
	}
}

func Recover(logger tmlog.Logger, err *error) {
	if r := recover(); r != nil {
		*err = sdkerrors.Wrapf(sdkerrors.ErrPanic, "%v", r)

		if e, ok := r.(error); ok {
			logger.Error(
				"ante handler panicked",
				"error", e,
				"stack trace", string(debug.Stack()),
			)
		} else {
			logger.Error(
				"ante handler panicked",
				"recover", fmt.Sprintf("%v", r),
			)
		}
	}
}

var _ authante.SignatureVerificationGasConsumer = DefaultSigVerificationGasConsumer

// DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas
// for signature verification based upon the public key type. The cost is fetched from the given params and is matched
// by the concrete type.
func DefaultSigVerificationGasConsumer(
	meter sdk.GasMeter, sig signing.SignatureV2, params authtypes.Params,
) error {
	// support for ethereum ECDSA secp256k1 keys
	_, ok := sig.PubKey.(*ethsecp256k1.PubKey)
	if ok {
		meter.ConsumeGas(secp256k1VerifyCost, "ante verify: eth_secp256k1")
		return nil
	}

	return authante.DefaultSigVerificationGasConsumer(meter, sig, params)
}

repository: blockchainreg/ethermint

repo_name: blockchainreg/ethermint


text:
package utils

import (
	"books-list/models"
	"encoding/json"
	"net/http"
)

func SendError(w http.ResponseWriter, status int, err models.Error) {
	w.WriteHeader(status)

	json.NewEncoder(w).Encode(err)
}

func SendSuccess(w http.ResponseWriter, data interface{}) {
	json.NewEncoder(w).Encode(data)
}

repository: duncanleung/go-learning-crud-books-list

repo_name: duncanleung/go-learning-crud-books-list


text:
package rpc

import (
	"fmt"
	"math/rand"
	"reflect"
	"runtime"
	"runtime/debug"
	"strconv"
	"sync"
	"sync/atomic"
	"time"
	"unsafe"

	"github.com/rpccloud/rpc/internal/base"
)

var (
	rpcThreadFrameCache = &sync.Pool{
		New: func() interface{} {
			return &rpcThreadFrame{
				stream:             nil,
				actionNode:         nil,
				from:               "",
				depth:              0,
				cacheArrayItemsPos: 0,
				cacheMapItemsPos:   0,
				cacheArrayEntryPos: 0,
				cacheMapEntryPos:   0,
				retStatus:          0,
				lockStatus:         0,
				parentRTWritePos:   streamPosBody,
				next:               nil,
			}
		},
	}
	zeroCacheEntry = [8]cacheEntry{}
)

type rpcThreadFrame struct {
	stream             *Stream
	actionNode         unsafe.Pointer
	from               string
	depth              uint16
	cacheArrayItemsPos uint32
	cacheMapItemsPos   uint32
	cacheArrayEntryPos uint32
	cacheMapEntryPos   uint32
	retStatus          uint32
	lockStatus         uint64
	parentRTWritePos   int
	next               *rpcThreadFrame
}

func newRPCThreadFrame() *rpcThreadFrame {
	return rpcThreadFrameCache.Get().(*rpcThreadFrame)
}

func (p *rpcThreadFrame) Reset() {
	p.stream = nil
	atomic.StorePointer(&p.actionNode, nil)
	p.from = ""
	p.cacheArrayItemsPos = 0
	p.cacheMapItemsPos = 0
	p.cacheArrayEntryPos = 0
	p.cacheMapEntryPos = 0
	p.parentRTWritePos = streamPosBody
	p.next = nil
}

func (p *rpcThreadFrame) Release() {
	p.Reset()
	rpcThreadFrameCache.Put(p)
}

type cacheEntry struct {
	arrayItems []posRecord
	mapItems   []mapItem
	mapLength  uint32
}

type rpcThread struct {
	processor       *Processor
	inputCH         chan *Stream
	closeCH         unsafe.Pointer
	closeTimeout    time.Duration
	top             *rpcThreadFrame
	rootFrame       rpcThreadFrame
	sequence        uint64
	rtStream        *Stream
	cacheEntry      [8]cacheEntry
	cacheArrayItems []posRecord
	cacheMapItems   []mapItem
	mu              sync.Mutex
}

func newRTArray(rt Runtime, size int) (ret RTArray) {
	if thread := rt.thread; thread != nil && size >= 0 {
		ret.rt = rt
		frame := thread.top

		if frame.cacheArrayEntryPos < 8 {
			ret.items = &thread.cacheEntry[frame.cacheArrayEntryPos].arrayItems
			frame.cacheArrayEntryPos++
		} else {
			ret.items = new([]posRecord)
		}

		end := int(frame.cacheArrayItemsPos) + size
		if end <= len(thread.cacheArrayItems) {
			*ret.items = thread.cacheArrayItems[frame.cacheArrayItemsPos:]
			itemsHeader := (*reflect.SliceHeader)(unsafe.Pointer(ret.items))
			itemsHeader.Len = 0
			itemsHeader.Cap = size
			frame.cacheArrayItemsPos = uint32(end)
		} else {
			*ret.items = make([]posRecord, 0, size)
		}
	}

	return
}

func newRTMap(rt Runtime, size int) (ret RTMap) {
	if thread := rt.thread; thread != nil && size >= 0 {
		ret.rt = rt
		frame := thread.top

		if frame.cacheMapEntryPos < 8 {
			ret.items = &thread.cacheEntry[frame.cacheMapEntryPos].mapItems
			ret.length = &thread.cacheEntry[frame.cacheMapEntryPos].mapLength
			*ret.length = 0
			frame.cacheMapEntryPos++
		} else {
			ret.items = new([]mapItem)
			ret.length = new(uint32)
		}

		end := int(frame.cacheMapItemsPos) + size
		if end <= len(thread.cacheMapItems) {
			*ret.items = thread.cacheMapItems[frame.cacheMapItemsPos:]
			itemsHeader := (*reflect.SliceHeader)(unsafe.Pointer(ret.items))
			itemsHeader.Len = 0
			itemsHeader.Cap = size
			frame.cacheMapItemsPos = uint32(end)
		} else {
			*ret.items = make([]mapItem, 0, size)
		}
	}

	return
}

func newThread(
	processor *Processor,
	closeTimeout time.Duration,
	bufferSize uint32,
	onEvalFinish func(*rpcThread),
) *rpcThread {
	if processor == nil || onEvalFinish == nil {
		return nil
	}

	retCH := make(chan *rpcThread)

	timeout := closeTimeout
	if timeout < time.Second {
		timeout = time.Second
	}

	inputCH := make(chan *Stream)
	closeCH := make(chan bool, 1)
	go func() {
		numOfArray := int(bufferSize) / (2 * sizeOfPosRecord)
		numOfMap := int(bufferSize) / (2 * sizeOfMapItem)

		thread := &rpcThread{
			processor:       processor,
			inputCH:         inputCH,
			closeCH:         unsafe.Pointer(&closeCH),
			closeTimeout:    timeout,
			sequence:        1<<48 + (rand.Uint64()%(1<<56)/2)*2,
			rtStream:        NewStream(),
			cacheArrayItems: make([]posRecord, numOfArray),
			cacheMapItems:   make([]mapItem, numOfMap),
		}

		thread.top = &thread.rootFrame
		thread.top.parentRTWritePos = streamPosBody
		retCH <- thread

		for stream := <-inputCH; stream != nil; stream = <-inputCH {
			thread.Eval(stream, true)
			onEvalFinish(thread)
			thread.Reset()
		}

		closeCH <- true
	}()

	return <-retCH
}

func (p *rpcThread) Reset() {
	p.rtStream.Reset()
	p.rootFrame.Reset()
	p.cacheEntry = zeroCacheEntry
}

func (p *rpcThread) Close() bool {
	p.mu.Lock()
	defer p.mu.Unlock()

	if chPtr := (*chan bool)(atomic.LoadPointer(&p.closeCH)); chPtr != nil {
		atomic.StorePointer(&p.closeCH, nil)
		close(p.inputCH)
		select {
		case <-*chPtr:
			p.rtStream.Release()
			p.rtStream = nil
			return true
		case <-time.After(p.closeTimeout):
			return false
		}
	}

	return false
}

func (p *rpcThread) lock(rtID uint64) *rpcThread {
	lockPtr := &p.top.lockStatus
	for !atomic.CompareAndSwapUint64(lockPtr, rtID, rtID+1) {
		curStatus := atomic.LoadUint64(lockPtr)

		if curStatus != rtID && curStatus != rtID+1 {
			return nil
		}

		if atomic.CompareAndSwapUint64(lockPtr, rtID, rtID+1) {
			return p
		}

		runtime.Gosched()
	}

	return p
}

func (p *rpcThread) unlock(rtID uint64) bool {
	return atomic.CompareAndSwapUint64(&p.top.lockStatus, rtID+1, rtID)
}

func (p *rpcThread) pushFrame() {
	frame := newRPCThreadFrame()
	frame.cacheArrayItemsPos = p.top.cacheArrayItemsPos
	frame.cacheMapItemsPos = p.top.cacheMapItemsPos
	frame.cacheArrayEntryPos = p.top.cacheArrayEntryPos
	frame.cacheMapEntryPos = p.top.cacheMapEntryPos
	frame.parentRTWritePos = p.rtStream.GetWritePos()
	frame.next = p.top
	p.top = frame
}

func (p *rpcThread) popFrame() {
	if frame := p.top.next; frame != nil {
		p.rtStream.SetWritePos(p.top.parentRTWritePos)
		p.top.Release()
		p.top = frame
	}
}

func (p *rpcThread) GetActionNode() *rpcActionNode {
	return (*rpcActionNode)(atomic.LoadPointer(&p.top.actionNode))
}

func (p *rpcThread) GetExecActionNodePath() string {
	if node := p.GetActionNode(); node != nil {
		return node.path
	}
	return ""
}

func (p *rpcThread) GetExecServicePath() string {
	if node := p.GetActionNode(); node != nil && node.service != nil {
		return node.service.path
	}
	return ""
}

func (p *rpcThread) GetExecActionDebug() string {
	if node := p.GetActionNode(); node != nil && node.meta != nil {
		return base.ConcatString(node.path, " ", node.meta.fileLine)
	}
	return ""
}

func (p *rpcThread) Write(value interface{}, skip uint, debug bool) Return {
	frame := p.top

	if frame.retStatus != 0 {
		value = base.ErrRuntimeReplyHasBeenCalled
	}

	stream := frame.stream
	stream.SetWritePosToBodyStart()
	writeErr := (*base.Error)(nil)

	if reason := stream.Write(value); reason == StreamWriteOK {
		stream.SetKind(StreamKindRPCResponseOK)
		frame.retStatus = 1
		return emptyReturn
	} else if err, ok := value.(*base.Error); ok {
		if err == nil {
			writeErr = base.ErrUnsupportedValue.AddDebug("value is nil")
		} else {
			writeErr = err
		}
	} else if e, ok := value.(error); ok && !base.IsNil(e) {
		writeErr = base.ErrAction.AddDebug(e.Error())
	} else if v, ok := value.(RTValue); ok && v.err != nil {
		writeErr = v.err
	} else {
		writeErr = base.ErrUnsupportedValue.AddDebug(reason)
	}

	frame.retStatus = 2
	stream.SetKind(StreamKindRPCResponseError)

	if debug {
		msg := writeErr.GetMessage()
		stream.WriteUint64(uint64(writeErr.GetCode()))
		if msg == "" {
			stream.WriteString(base.ConcatString(
				writeErr.GetMessage(),
				base.AddFileLine(p.GetExecActionNodePath(), skip+1),
			))
		} else {
			stream.WriteString(base.ConcatString(
				writeErr.GetMessage(),
				"\n",
				base.AddFileLine(p.GetExecActionNodePath(), skip+1),
			))
		}
	} else {
		stream.WriteUint64(uint64(writeErr.GetCode()))
		stream.WriteString(writeErr.GetMessage())
	}
	return emptyReturn
}

func (p *rpcThread) PutStream(stream *Stream) (ret bool) {
	if stream == nil {
		return false
	}

	defer func() {
		if v := recover(); v != nil {
			ret = false
		}
	}()

	if atomic.LoadPointer(&p.closeCH) != nil {
		p.inputCH <- stream
		return true
	}
	return false
}

func (p *rpcThread) Eval(inStream *Stream, needCallback bool) Return {
	timeStart := base.TimeNow()
	frame := p.top
	frame.stream = inStream
	p.sequence += 2
	rtID := p.sequence
	frame.lockStatus = rtID
	frame.retStatus = 0
	frame.depth = inStream.GetDepth()
	execActionNode := (*rpcActionNode)(nil)
	argErrorIndex := 0

	defer func() {
		if v := recover(); v != nil {
			// write runtime error
			p.Write(
				base.ErrActionPanic.
					AddDebug(fmt.Sprintf("runtime error: %v", v)).
					AddDebug(p.GetExecActionDebug()).
					AddDebug(string(debug.Stack())),
				0,
				false,
			)
		}

		defer func() {
			if v := recover(); v != nil {
				// kernel error
				base.PublishPanic(
					base.ErrThreadEvalFatal.AddDebug(fmt.Sprintf("%v", v)).
						AddDebug(string(debug.Stack())),
				)
			}
		}()

		for !atomic.CompareAndSwapUint64(&frame.lockStatus, rtID, rtID+2) {
			time.Sleep(10 * time.Millisecond)
		}

		if frame.retStatus == 0 {
			p.Write(
				base.ErrRuntimeExternalReturn.AddDebug(p.GetExecActionDebug()),
				0,
				false,
			)
		} else {
			// count
			if execActionNode != nil {
				execActionNode.indicator.Count(
					base.TimeNow().Sub(timeStart),
					frame.retStatus == 1,
				)
			}
		}

		// callback
		inStream.SetReadPosToBodyStart()

		if needCallback {
			p.processor.streamReceiver.OnReceiveStream(inStream)
		}
	}()

	// set exec action node
	actionPath, _, err := inStream.readUnsafeString()
	if err != nil {
		return p.Write(err, 0, false)
	} else if actionNode, ok := p.processor.actionsMap[actionPath]; !ok {
		return p.Write(
			base.ErrTargetNotExist.AddDebug(base.ConcatString(
				"rpc-call: ",
				actionPath,
				" does not exist",
			)),
			0,
			false,
		)
	} else {
		execActionNode = actionNode
		atomic.StorePointer(&frame.actionNode, unsafe.Pointer(execActionNode))
	}

	if frame.depth >= p.processor.maxCallDepth {
		return p.Write(
			base.ErrCallOverflow.
				AddDebug(base.ConcatString(
					"call ",
					actionPath,
					" level(",
					strconv.FormatUint(uint64(frame.depth), 10),
					") overflows",
				)),
			0,
			false,
		)
	} else if frame.from, _, err = inStream.readUnsafeString(); err != nil {
		return p.Write(err, 0, false)
	} else {
		// create context
		rt := Runtime{id: rtID, thread: p}

		if fnCache := execActionNode.cacheFN; fnCache != nil {
			argErrorIndex = fnCache(rt, inStream, execActionNode.meta.handler)
			if argErrorIndex == 0 {
				return emptyReturn
			}
		} else {
			args := make([]reflect.Value, 0, 8)
			args = append(args, reflect.ValueOf(rt))
			for i := 1; i < len(execActionNode.argTypes); i++ {
				var rv reflect.Value
				switch execActionNode.argTypes[i] {
				case int64Type:
					if v, err := inStream.ReadInt64(); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case uint64Type:
					if v, err := inStream.ReadUint64(); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case float64Type:
					if v, err := inStream.ReadFloat64(); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case boolType:
					if v, err := inStream.ReadBool(); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case stringType:
					if v, err := inStream.ReadString(); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case bytesType:
					if v, err := inStream.ReadBytes(); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case arrayType:
					if v, err := inStream.ReadArray(); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case rtArrayType:
					if v, err := inStream.ReadRTArray(rt); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case mapType:
					if v, err := inStream.ReadMap(); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case rtMapType:
					if v, err := inStream.ReadRTMap(rt); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				case rtValueType:
					if v, err := inStream.ReadRTValue(rt); err == nil {
						rv = reflect.ValueOf(v)
					} else {
						argErrorIndex = i
					}
				default:
					argErrorIndex = i
				}

				if argErrorIndex != 0 {
					break
				} else {
					args = append(args, rv)
				}
			}

			if argErrorIndex == 0 {
				if inStream.IsReadFinish() {
					inStream.SetWritePosToBodyStart()
					execActionNode.reflectFn.Call(args)
					return emptyReturn
				}

				argErrorIndex = -1
			}
		}

		if val, err := inStream.Read(); err != nil {
			return p.Write(err, 0, false)
		} else if argErrorIndex < 0 {
			return p.Write(base.ErrStream, 0, false)
		} else if !inStream.HasStatusBitDebug() {
			return p.Write(
				base.ErrArgumentsNotMatch.
					AddDebug(base.ConcatString(
						"rpc-call: ",
						actionPath,
						" arguments does not match",
					)),
				0,
				false,
			)
		} else {
			var typeName string
			if val == nil {
				typeName = "<nil>"
			} else {
				typeName = convertTypeToString(reflect.ValueOf(val).Type())
			}

			return p.Write(
				base.ErrArgumentsNotMatch.AddDebug(
					fmt.Sprintf(
						"rpc-call: %s %s argument does not match. "+
							"want: %s got: %s\n%s",
						actionPath,
						base.ConvertOrdinalToString(uint(argErrorIndex)),
						convertTypeToString(
							execActionNode.argTypes[argErrorIndex],
						),
						typeName,
						p.GetExecActionDebug(),
					)),
				0,
				false,
			)
		}
	}
}

repository: rpccloud/rpc

repo_name: rpccloud/rpc


text:
package main

import (
	"context"
	"fmt"
	"log"
	"net/http"
	"sync"

	"github.com/go-chassis/go-chassis/v2"
	_ "github.com/go-chassis/go-chassis/v2/bootstrap"
	"github.com/go-chassis/go-chassis/v2/client/rest"
	_ "github.com/go-chassis/go-chassis/v2/configserver"
	"github.com/go-chassis/go-chassis/v2/core"
	"github.com/go-chassis/go-chassis/v2/core/common"
	"github.com/go-chassis/go-chassis/v2/pkg/util/httputil"
	"github.com/go-chassis/openlog"
)

var wg sync.WaitGroup

// if you use go run main.go instead of binary run, plz export CHASSIS_HOME=/{path}/{to}/discovery/client/
func main() {
	//chassis operation
	if err := chassis.Init(); err != nil {
		openlog.Error("Init failed.")
		return
	}

	n := 10
	wg.Add(n)
	restInvoker := core.NewRestInvoker()
	for m := 0; m < n; m++ {
		go callRest(restInvoker)
	}
	wg.Wait()
}

func callRest(invoker *core.RestInvoker) {
	defer wg.Done()
	req, _ := rest.NewRequest("GET", "http://Server/sayhello/myidtest", nil)

	//use the invoker like http client.
	resp1, err := invoker.ContextDo(context.TODO(), req)
	if err != nil {
		openlog.Error(fmt.Sprintf("call request fail (%s) (%d) ", string(httputil.ReadBody(resp1)), resp1.StatusCode))
		return
	}
	log.Printf("Rest Server sayhello[Get] %s", string(httputil.ReadBody(resp1)))
	log.Printf("Cookie from LB %s", string(httputil.GetRespCookie(resp1, common.LBSessionID)))
	httputil.SetCookie(req, common.LBSessionID, string(httputil.GetRespCookie(resp1, common.LBSessionID)))
	req, _ = rest.NewRequest(http.MethodPost, "http://Server/sayhi", []byte(`{"name": "peter wang and me"}`))
	req.Header.Set("Content-Type", "application/json")
	httputil.SetCookie(req, common.LBSessionID, string(httputil.GetRespCookie(resp1, common.LBSessionID)))
	resp1, err = invoker.ContextDo(context.TODO(), req)
	if err != nil {
		log.Println(err)
		return
	}
	log.Printf("Rest Server sayhi[POST] %s %s", httputil.GetRespCookie(resp1, common.LBSessionID), httputil.ReadBody(resp1))

	req, _ = rest.NewRequest(http.MethodGet, "http://Server/sayerror", []byte(""))
	httputil.SetCookie(req, common.LBSessionID, string(httputil.GetRespCookie(resp1, common.LBSessionID)))
	resp1, err = invoker.ContextDo(context.TODO(), req)
	if err != nil {
		log.Printf("%s", string(httputil.GetRespCookie(resp1, common.LBSessionID)))
		log.Println(err)
		return
	}
	log.Printf("Rest Server sayerror[GET] %s ", string(httputil.GetRespCookie(resp1, common.LBSessionID)))

	defer resp1.Body.Close()
}

repository: tianxiaoliang/go-chassis

repo_name: tianxiaoliang/go-chassis


text:
/*
 * Copyright 2018-2023 Venafi, 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.
 */

package main

import (
	"fmt"
	"log"
	"os"
	"sort"
	"time"

	"github.com/urfave/cli/v2"

	"github.com/Venafi/vcert/v5"
	"github.com/Venafi/vcert/v5/pkg/util"
)

var (
	logger = log.New(os.Stderr, UtilityShortName+": ", log.LstdFlags)
	logf   = logger.Printf
	exit   = os.Exit
)

// UtilityName is the full name of the command-line utility
const UtilityName string = "Venafi Certificate Utility"

// UtilityShortName is the short name of the command-line utility
const UtilityShortName string = "vCert"

// OriginName is the full name for adding to meta information to certificate request
const OriginName = "Venafi VCert CLI"

func main() {
	defer func() {
		if r := recover(); r != nil {
			// logger.Fatalf() does immediately os.Exit(1)
			// so we use logger.Panic() and do recover() here to hide stacktrace
			// exit() is a function to decide what to do

			exit(1)  // it's os.Exit() by default, but can be overridden
			panic(r) // so that panic() bubbling continues (it's needed when we call main() from cli_test.go)

		}
	}()

	//Configure zap logger
	err := util.ConfigureLogger(false)
	if err != nil {
		l := log.New(os.Stderr, UtilityShortName+": ", log.LstdFlags)
		l.Panicf("%s", err)
	}

	app := &cli.App{
		Usage: UtilityName,
		UsageText: `vcert action [action options]
   for command help run: vcert action -h`,
		Version:  vcert.GetFormattedVersionString(), //todo: replace with plain version
		Compiled: time.Now(),                        //todo: replace with parsing vcert.versionBuildTimeStamp
		Commands: []*cli.Command{
			commandGetCred,
			commandCheckCred,
			commandVoidCred,
			commandGenCSR,
			commandEnroll,
			commandPickup,
			commandRenew,
			commandRevoke,
			commandRetire,
			commandCreatePolicy,
			commandGetPolicy,
			commandSshPickup,
			commandSshEnroll,
			commandSshGetConfig,
			commandRunPlaybook,
		},
		EnableBashCompletion: true, //todo: write BashComplete function for options
		Authors:              authors,
		Copyright: `2018-2023 Venafi, Inc.
	 Licensed under the Apache License, Version 2.0`,
	}

	sort.Sort(cli.CommandsByName(app.Commands))

	cli.AppHelpTemplate = fmt.Sprintf(`Venafi Certificate Utility
   Version: %s
   Build Timestamp: %s

USAGE:
   {{.HelpName}} {{if .VisibleFlags}}[global options]{{end}}{{if .Commands}} command [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}
   {{if len .Authors}}
AUTHOR:
   {{range .Authors}}{{ . }}
   {{end}}{{end}}{{if .Commands}}
ACTIONS:
   gencsr       To generate a certificate signing request (CSR)
   enroll       To enroll a certificate
   pickup       To retrieve a certificate
   renew        To renew a certificate
   retire       To retire a certificate
   revoke       To revoke a certificate
   run          To retrieve and install certificates using a vcert playbook file

   getpolicy    To retrieve the certificate policy of a zone
   setpolicy    To apply a certificate policy specification to a zone

   getcred      To obtain a new TPP authentication token or Firefly access token or register for a new VaaS user API key
   checkcred    To check the validity of a token and grant
   voidcred     To invalidate an authentication grant

   sshenroll    To enroll a SSH certificate
   sshpickup    To retrieve a SSH certificate
   sshgetconfig To get the SSH CA public key and default principals

OPTIONS:
   {{range .VisibleFlags}}{{.}}
   {{end}}
COPYRIGHT:
   {{.Copyright}}
   {{end}}{{if .Version}}
SUPPORT:
   opensource@venafi.com
{{end}}
`, vcert.GetFormattedVersionString(), vcert.GetFormatedBuildTimeStamp())

	cli.CommandHelpTemplate = `NAME:
   {{.HelpName}} - {{.Usage}}

USAGE:
   {{if .UsageText}}{{.UsageText}}{{else}}{{.HelpName}}{{if .VisibleFlags}} [command options]{{end}} {{if .ArgsUsage}}{{.ArgsUsage}}{{else}}[arguments...]{{end}}{{end}}{{if .Category}}

CATEGORY:
   {{.Category}}{{end}}{{if .Description}}

DESCRIPTION:
   {{.Description}}{{end}}{{if .VisibleFlags}}

OPTIONS:
   {{range .VisibleFlags}}{{.}}
   {{end}}{{end}}
`
	err = app.Run(os.Args)
	if err != nil {
		//TODO: we need to make logger a global package
		l := log.New(os.Stderr, UtilityShortName+": ", log.LstdFlags)
		l.Panicf("%s", err)
	}
}

var authors = []*cli.Author{
	{
		Name:  "Ryan Treat",
		Email: "ryan.treat@venafi.com",
	},
	{
		Name:  "Russel Vela",
		Email: "russel.vela@venafi.com",
	},
	{
		Name:  "Luis Presuel",
		Email: "luis.presuel@venafi.com",
	},
	{
		Name:  "Marcos Albornoz",
		Email: "marcos.albornoz@venafi.com",
	},
}

repository: Venafi/vcert

repo_name: Venafi/vcert


text:
package spago

import "syscall/js"

// Core ...
type Core struct {
	target js.Value
}

func (c *Core) get() *Core { return c }


text:
DESCRIPTION = "Library for parsing CORBA IDL files"
SECTION = "x11/gnome/libs"
LICENSE = "LGPL"
DEPENDS = "glib-2.0 libidl-native"
PR = "r3"

SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/libIDL/0.8/libIDL-${PV}.tar.bz2"
S = "${WORKDIR}/libIDL-${PV}"

BINCONFIG_GLOB = "*-config-2"
inherit autotools pkgconfig binconfig

# Firefox uses the libIDL-config-2 script instead of pkgconfig (for some
# strange reason - so we do some sed fu to fix the path there

do_stage() {
	autotools_stage_all
}

FILES_${PN} = "${libdir}/*.so.*"
FILES_${PN}-dev += " ${bindir}"

repository: jdegges/gumstix-pip-oe

repo_name: jdegges/gumstix-pip-oe


text:
@article{Chang-2022-Application,
    title = "Application of L-band SAR for mapping tundra shrub biomass, leaf area index, and rainfall interception",
    author = "Chang, Qianyu  and
      Zwieback, Simon  and
      DeVries, Ben  and
      Berg, Aaron",
    journal = "Remote Sensing of Environment, Volume 268",
    volume = "268",
    year = "2022",
    publisher = "Elsevier BV",
    url = "https://aclanthology.org/G22-40001",
    doi = "10.1016/j.rse.2021.112747",
    pages = "112747",
}
@article{Pradhan-2022-Review,
    title = "Review of GPM IMERG performance: A global perspective",
    author = "Pradhan, Rajani K.  and
      Markonis, Yannis  and
      Vargas Godoy, Mijael Rodrigo  and
      Villalba-Pradas, Anah{\'\i}  and
      Andreadis, Konstantinos M.  and
      Nikolopoulos, Efthymios I.  and
      Papalexiou, Simon Michael  and
      Rahim, Akif  and
      Tapiador, Francisco J.  and
      Hanel, Martin",
    journal = "Remote Sensing of Environment, Volume 268",
    volume = "268",
    year = "2022",
    publisher = "Elsevier BV",
    url = "https://aclanthology.org/G22-40002",
    doi = "10.1016/j.rse.2021.112754",
    pages = "112754",
}

repository: gwf-uwaterloo/gwf-publications

repo_name: gwf-uwaterloo/gwf-publications


text:
/*
Copyright 2020 The Skaffold Authors

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 firelog

import (
	"bytes"
	"encoding/json"
	"fmt"

	"go.opentelemetry.io/otel/attribute"
	"go.opentelemetry.io/otel/sdk/metric/metricdata"
)

type ClientInfo struct {
	ClientType string `json:"client_type"`
}

type MetricData struct {
	ClientInfo    ClientInfo `json:"client_info"`
	LogSource     string     `json:"log_source"`
	LogEvent      LogEvent   `json:"log_event"`
	RequestTimeMS int64      `json:"request_time_ms"`
}

type LogEvent struct {
	EventTimeMS                  int64  `json:"event_time_ms"`
	SourceExtensionJSONProto3Str string `json:"source_extension_json_proto3"`
}

type KeyValue struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type EventMetadata []KeyValue

type SourceExtensionJSONProto3 struct {
	ConsoleType     string     `json:"console_type"`
	ClientInstallID string     `json:"client_install_id"`
	EventName       string     `json:"event_name"`
	EventMetadata   []KeyValue `json:"event_metadata"`
}

type Key string

func (k Key) Value(v string) KeyValue {
	return KeyValue{
		Key:   string(k),
		Value: v,
	}
}

func (md MetricData) newReader() *bytes.Reader {
	data, _ := json.Marshal(md)
	return bytes.NewReader(data)
}

type DataPoint interface {
	value() string
	attributes() attribute.Set
	eventTime() int64
}

type DataPointInt64 metricdata.DataPoint[int64]

func (d DataPointInt64) attributes() attribute.Set {
	return d.Attributes
}

func (d DataPointInt64) eventTime() int64 {
	return d.StartTime.UnixMilli()
}

type DataPointFloat64 metricdata.DataPoint[float64]

func (d DataPointFloat64) attributes() attribute.Set {
	return d.Attributes
}

func (d DataPointFloat64) eventTime() int64 {
	return d.StartTime.UnixMilli()
}

type DataPointHistogram metricdata.HistogramDataPoint

func (d DataPointHistogram) attributes() attribute.Set {
	return d.Attributes
}

func (d DataPointHistogram) eventTime() int64 {
	return d.StartTime.UnixMilli()
}

func (d DataPointInt64) value() string {
	return fmt.Sprintf("%d", d.Value)
}

func (d DataPointFloat64) value() string {
	return fmt.Sprintf("%f", d.Value)
}

func (d DataPointHistogram) value() string {
	return fmt.Sprintf("%f", d.Sum)
}

repository: GoogleContainerTools/skaffold

repo_name: GoogleContainerTools/skaffold


text:
include(${CMAKE_TOOLCHAIN_FILE})
include(cpp_unit_test_helpers)
_cpp_setup_test_env("find_recipe_factory")

_cpp_add_test(
TITLE "No find module results in FindFromConfig"
"include(find_recipe/factory)"
"_cpp_Kwargs_ctor(kwargs)"
"_cpp_FindRecipe_factory(handle \${kwargs} NAME \"name\")"
"_cpp_Object_get_type(\${handle} test)"
"_cpp_assert_equal(\"\${test}\" \"FindFromConfig\")"
)

_cpp_add_test(
TITLE "Find module results in FindFromModule"
"include(find_recipe/factory)"
"_cpp_Kwargs_ctor(kwargs)"
"_cpp_FindRecipe_factory("
"   handle \${kwargs} NAME \"name\" FIND_MODULE \"a/path\""
")"
"_cpp_Object_get_type(\${handle} test)"
"_cpp_assert_equal(\"\${test}\" \"FindFromModule\")"
)

repository: keipertk/CMakePackagingProject

repo_name: keipertk/CMakePackagingProject

extension: cmake


text:
#
# Copyright © 2020 LambdAurora <aurora42lambda@gmail.com>
#
# This file is part of LambdaCMakeModules.
#
# Licensed under the MIT license. For more information,
# see the LICENSE file.
#

#.rst:
# Otterpill
# ----------------
#
# An utility for developing with the Otterpill.

include(embedded/embedded)
include(embedded/dfu)

function(add_otterpill_executable TARGET SOURCES)
    set(_SOURCES ${SOURCES} ${ARGN})

    add_embedded_executable(${TARGET} ${_SOURCES})
    target_compile_definitions(${TARGET}.elf PUBLIC STM32F0 STM32F072xB)

    add_dfu_target(${TARGET} 0 "0x08000000:leave")
endfunction()

repository: LambdAurora/lcmm

repo_name: LambdAurora/lcmm