text:
@article{baranger_1953_Relativistic-Correction-Lamb-Shift,
  title = {Relativistic Correction to the Lamb Shift},
  author = {Baranger, M. and Bethe, H. A. and Feynman, R. P.},
  year = {1953},
  month = oct,
  volume = {92},
  pages = {482--501},
  doi = {10.1103/PhysRev.92.482},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1953PhRv...92..482B},
  journal = {Physical Review},
  number = {2}
}

@incollection{bethe_1966_Highenergy-Physics,
  title = {High-Energy Physics},
  booktitle = {The World of the Atom},
  author = {Bethe, Hans A. and Schwinger, Julian and Feynman, Richard P.},
  editor = {Boorse, Henry A. and Motz, Lloyd and Motz, Lloyd},
  year = {1966},
  volume = {1},
  pages = {1524},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1966woat.book.1524B}
}

@article{brown_1952_Radiative-Corrections-Compton-Scattering,
  title = {Radiative Corrections to Compton Scattering},
  author = {Brown, L. M. and Feynman, R. P.},
  year = {1952},
  month = jan,
  volume = {85},
  pages = {231--244},
  doi = {10.1103/PhysRev.85.231},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1952PhRv...85..231B},
  journal = {Physical Review},
  number = {2}
}

@article{cohen_1957_Theory-Inelastic-Scattering-Cold-Neutrons-Liquid-Helium,
  title = {Theory of Inelastic Scattering of Cold Neutrons from Liquid Helium},
  author = {Cohen, Michael and Feynman, Richard P.},
  year = {1957},
  month = jul,
  volume = {107},
  pages = {13--24},
  doi = {10.1103/PhysRev.107.13},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1957PhRv..107...13C},
  journal = {Physical Review},
  number = {1}
}

@article{feynman_1939_Forces-Molecules,
  title = {Forces in Molecules},
  author = {Feynman, R. P.},
  year = {1939},
  month = aug,
  volume = {56},
  pages = {340--343},
  doi = {10.1103/PhysRev.56.340},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1939PhRv...56..340F},
  journal = {Physical Review},
  number = {4}
}

@phdthesis{feynman_1942_Principle-Least-Action-Quantum-Mechanics,
  title = {The Principle of Least Action in Quantum Mechanics.},
  author = {Feynman, Richard Phillips},
  year = {1942},
  month = jan,
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1942PhDT.........5F},
  keywords = {Physics: General},
  school = {PRINCETON UNIVERSITY.}
}

@article{feynman_1948_Relativistic-Cutoff-Classical-Electrodynamics,
  title = {A Relativistic Cut-off for Classical Electrodynamics},
  author = {Feynman, R. P.},
  year = {1948},
  month = oct,
  volume = {74},
  pages = {939--946},
  doi = {10.1103/PhysRev.74.939},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1948PhRv...74..939F},
  journal = {Physical Review},
  number = {8}
}

@article{feynman_1948_Relativistic-Cutoff-Quantum-Electrodynamics,
  title = {Relativistic Cut-off for Quantum Electrodynamics},
  author = {Feynman, Richard P.},
  year = {1948},
  month = nov,
  volume = {74},
  pages = {1430--1438},
  doi = {10.1103/PhysRev.74.1430},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1948PhRv...74.1430F},
  journal = {Physical Review},
  number = {10}
}

@article{feynman_1948_Spacetime-Approach-Nonrelativistic-Quantum-Mechanics,
  title = {Space-Time Approach to Non-Relativistic Quantum Mechanics},
  author = {Feynman, R. P.},
  year = {1948},
  month = apr,
  volume = {20},
  pages = {367--387},
  doi = {10.1103/RevModPhys.20.367},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1948RvMP...20..367F},
  journal = {Reviews of Modern Physics},
  number = {2}
}

@article{feynman_1949_Equations-State-Elements-Based-Generalized-Fermithomas-Theory,
  title = {Equations of State of Elements Based on the Generalized Fermi-Thomas Theory},
  author = {Feynman, R. P. and Metropolis, N. and Teller, E.},
  year = {1949},
  month = may,
  volume = {75},
  pages = {1561--1573},
  doi = {10.1103/PhysRev.75.1561},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1949PhRv...75.1561F},
  journal = {Physical Review},
  number = {10}
}

@article{feynman_1949_Spacetime-Approach-Quantum-Electrodynamics,
  title = {Space-Time Approach to Quantum Electrodynamics},
  author = {Feynman, R. P.},
  year = {1949},
  month = sep,
  volume = {76},
  pages = {769--789},
  doi = {10.1103/PhysRev.76.769},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1949PhRv...76..769F},
  journal = {Physical Review},
  number = {6}
}

@article{feynman_1949_Theory-Positrons,
  title = {The Theory of Positrons},
  author = {Feynman, R. P.},
  year = {1949},
  month = sep,
  volume = {76},
  pages = {749--759},
  doi = {10.1103/PhysRev.76.749},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1949PhRv...76..749F},
  journal = {Physical Review},
  number = {6}
}

@article{feynman_1950_Mathematical-Formulation-Quantum-Theory-Electromagnetic-Interaction,
  title = {Mathematical Formulation of the Quantum Theory of Electromagnetic Interaction},
  author = {Feynman, R. P.},
  year = {1950},
  month = nov,
  volume = {80},
  pages = {440--457},
  doi = {10.1103/PhysRev.80.440},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1950PhRv...80..440F},
  journal = {Physical Review},
  number = {3}
}

@inproceedings{feynman_1951_Concept-Probability-Quantum-Mechanics,
  title = {The Concept of Probability in Quantum Mechanics},
  booktitle = {Second Berkeley Symposium on Mathematical Statistics and Probability},
  author = {Feynman, Richard P.},
  year = {1951},
  month = jan,
  pages = {533--541},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1951bsms.conf..533F}
}

@article{feynman_1951_Operator-Calculus-Having-Applications-Quantum-Electrodynamics,
  title = {An Operator Calculus Having Applications in Quantum Electrodynamics},
  author = {Feynman, Richard P.},
  year = {1951},
  month = oct,
  volume = {84},
  pages = {108--128},
  doi = {10.1103/PhysRev.84.108},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1951PhRv...84..108F},
  journal = {Physical Review},
  number = {1}
}

@article{feynman_1953_Atomic-Theory-Liquid-Helium-Absolute-Zero,
  title = {Atomic Theory of Liquid Helium near Absolute Zero},
  author = {Feynman, R. P.},
  year = {1953},
  month = sep,
  volume = {91},
  pages = {1301--1308},
  doi = {10.1103/PhysRev.91.1301},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1953PhRv...91.1301F},
  journal = {Physical Review},
  number = {6}
}

@article{feynman_1953_Atomic-Theory-Transition-Helium,
  title = {Atomic Theory of the {$\lambda$} Transition in Helium},
  author = {Feynman, R. P.},
  year = {1953},
  month = sep,
  volume = {91},
  pages = {1291--1301},
  doi = {10.1103/PhysRev.91.1291},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1953PhRv...91.1291F},
  journal = {Physical Review},
  number = {6}
}

@article{feynman_1953_LTransition-Liquid-Helium,
  title = {The {$\lambda$}-Transition in Liquid Helium},
  author = {Feynman, R. P.},
  year = {1953},
  month = jun,
  volume = {90},
  pages = {1116--1117},
  doi = {10.1103/PhysRev.90.1116.2},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1953PhRv...90.1116F},
  journal = {Physical Review},
  number = {6}
}

@article{feynman_1954_Atomic-Theory-Twofluid-Model-Liquid-Helium,
  title = {Atomic Theory of the Two-Fluid Model of Liquid Helium},
  author = {Feynman, R. P.},
  year = {1954},
  month = apr,
  volume = {94},
  pages = {262--277},
  doi = {10.1103/PhysRev.94.262},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1954PhRv...94..262F},
  journal = {Physical Review},
  number = {2}
}

@article{feynman_1954_Protonneutron-Mass-Difference,
  title = {Proton-Neutron Mass Difference},
  author = {Feynman, R. P. and Speisman, G.},
  year = {1954},
  month = apr,
  volume = {94},
  pages = {500--500},
  doi = {10.1103/PhysRev.94.500},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1954PhRv...94..500F},
  journal = {Physical Review},
  number = {2}
}

@article{feynman_1955_Character-Roton-State-Liquid-Helium,
  title = {The Character of the Roton State in Liquid Helium},
  author = {Feynman, R. P. and Cohen, M.},
  year = {1955},
  month = sep,
  volume = {14},
  pages = {261--263},
  doi = {10.1143/PTP.14.261},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1955PThPh..14..261F},
  journal = {Progress of Theoretical Physics},
  number = {3}
}

@article{feynman_1955_Slow-Electrons-Polar-Crystal,
  title = {Slow Electrons in a Polar Crystal},
  author = {Feynman, R. P.},
  year = {1955},
  month = feb,
  volume = {97},
  pages = {660--665},
  doi = {10.1103/PhysRev.97.660},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1955PhRv...97..660F},
  journal = {Physical Review},
  number = {3}
}

@article{feynman_1956_Energy-Spectrum-Excitations-Liquid-Helium,
  title = {Energy Spectrum of the Excitations in Liquid Helium},
  author = {Feynman, R. P. and Cohen, Michael},
  year = {1956},
  month = jun,
  volume = {102},
  pages = {1189--1204},
  doi = {10.1103/PhysRev.102.1189},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1956PhRv..102.1189F},
  journal = {Physical Review},
  number = {5}
}

@article{feynman_1956_Science-Open-Channel,
  title = {Science and the Open Channel},
  author = {Feynman, R. P.},
  year = {1956},
  month = feb,
  volume = {123},
  pages = {307},
  doi = {10.1126/science.123.3191.307},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1956Sci...123..307F},
  journal = {Science},
  number = {3191}
}

@article{feynman_1957_Geometrical-Representation-Schrodinger-Equation-Solving-Master-Problems,
  title = {Geometrical Representation of the Schr\"odinger Equation for Solving Master Problems},
  author = {Feynman, Richard P. and Vernon, Frank L., Jr. and Hellwarth, Robert W.},
  year = {1957},
  month = jan,
  volume = {28},
  pages = {49--52},
  doi = {10.1063/1.1722572},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1957JAP....28...49F},
  journal = {Journal of Applied Physics},
  number = {1}
}

@article{feynman_1957_Superfluidity-Superconductivity,
  title = {Superfluidity and Superconductivity},
  author = {Feynman, R. P.},
  year = {1957},
  month = apr,
  volume = {29},
  pages = {205--212},
  doi = {10.1103/RevModPhys.29.205},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1957RvMP...29..205F},
  journal = {Reviews of Modern Physics},
  number = {2}
}

@article{feynman_1958_Excitations-Liquid-Helium,
  title = {Excitations in Liquid Helium},
  author = {Feynman, R. P.},
  year = {1958},
  month = jan,
  volume = {24},
  pages = {S18-S26},
  doi = {10.1016/S0031-8914(58)80495-4},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1958Phy....24S..18F},
  journal = {Physica}
}

@inproceedings{feynman_1958_Forbidding-P-V-Decay,
  title = {Forbidding of {$\pi$} - {$\beta$} Decay},
  booktitle = {1958 International Conference on High-Energy Physics at CERN},
  author = {Feynman, R. P.},
  editor = {Ferretti, B.},
  year = {1958},
  month = jan,
  pages = {216},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1958hep..conf..216F}
}

@article{feynman_1958_Theory-Fermi-Interaction,
  title = {Theory of the Fermi Interaction},
  author = {Feynman, R. P. and {Gell-Mann}, M.},
  year = {1958},
  month = jan,
  volume = {109},
  pages = {193--198},
  doi = {10.1103/PhysRev.109.193},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1958PhRv..109..193F},
  journal = {Physical Review},
  number = {1}
}

@inproceedings{feynman_1961_Present-Status-Quantum-Electrodynamics,
  title = {The Present Status of Quantum Electrodynamics},
  booktitle = {The Quantum Theory of Fields},
  author = {Feynman, R. P.},
  editor = {Stoops, R.},
  year = {1961},
  month = jan,
  pages = {61},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1961qtf..conf...61F}
}

@article{feynman_1962_Mobility-Slow-Electrons-Polar-Crystal,
  title = {Mobility of Slow Electrons in a Polar Crystal},
  author = {Feynman, R. P. and Hellwarth, R. W. and Iddings, C. K. and Platzman, P. M.},
  year = {1962},
  month = aug,
  volume = {127},
  pages = {1004--1017},
  doi = {10.1103/PhysRev.127.1004},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1962PhRv..127.1004F},
  journal = {Physical Review},
  number = {4}
}

@book{feynman_1962_Quantum-Electrodynamics,
  title = {Quantum Electrodynamics},
  author = {Feynman, Richard P.},
  year = {1962},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1962quel.book.....F}
}

@book{feynman_1963_Feynman-Lectures-Physics-Volume-1,
  title = {Feynman Lectures on Physics - Volume 1},
  author = {Feynman, Richard P.},
  year = {1963},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1963flp..book.....F}
}

@article{feynman_1963_Theory-General-Quantum-System-Interacting-Linear-Dissipative-System,
  title = {The Theory of a General Quantum System Interacting with a Linear Dissipative System},
  author = {Feynman, R. P. and Vernon, F. L., Jr.},
  year = {1963},
  month = oct,
  volume = {24},
  pages = {118--173},
  doi = {10.1016/0003-4916(63)90068-X},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1963AnPhy..24..118F},
  journal = {Annals of Physics}
}

@book{feynman_1964_Feynman-Lectures-Physics-Volume-2-Mainly-Electromagnetism-Matter,
  title = {Feynman Lectures on Physics. Volume 2: Mainly Electromagnetism and Matter},
  author = {Feynman, Richard P.},
  year = {1964},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1964flp..book.....F}
}

@article{feynman_1964_Group-U-6-U-6-Generated-Current-Components,
  title = {Group U(6){$\otimes$}U(6) Generated by Current Components},
  author = {Feynman, R. P. and {Gell-Mann}, M. and Zweig, G.},
  year = {1964},
  month = nov,
  volume = {13},
  pages = {678--680},
  doi = {10.1103/PhysRevLett.13.678},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1964PhRvL..13..678F},
  journal = {Physical Review Letters},
  number = {22}
}

@article{feynman_1964_Relation-Physics-Other-Sciences,
  title = {The Relation of Physics to Other Sciences},
  author = {Feynman, Richard P.},
  year = {1964},
  month = mar,
  volume = {2},
  pages = {111--117},
  doi = {10.1119/1.2350747},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1964PhTea...2..111F},
  journal = {The Physics Teacher},
  number = {3}
}

@article{feynman_1964_Special-Theory-Relativity,
  title = {The Special Theory of Relativity},
  author = {Feynman, Richard P.},
  year = {1964},
  month = apr,
  volume = {2},
  pages = {151--157},
  doi = {10.1119/1.2350764},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1964PhTea...2..151F},
  journal = {The Physics Teacher},
  number = {4}
}

@book{feynman_1965_Feynman-Lectures-Physics-Volume-3-Quantum-Mechancis,
  title = {Feynman Lectures on Physics. Volume 3: Quantum Mechancis},
  author = {Feynman, Richard P.},
  year = {1965},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1965flp..book.....F}
}

@article{feynman_1966_Development-Spacetime-View-Quantum-Electrodynamics,
  title = {The Development of the Space-Time View of Quantum Electrodynamics},
  author = {Feynman, Richard P.},
  year = {1966},
  month = jan,
  volume = {19},
  pages = {31},
  doi = {10.1063/1.3048404},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1966PhT....19h..31F},
  journal = {Physics Today},
  number = {8}
}

@article{feynman_1966_Development-Spacetime-View-Quantum-Electrodynamicsa,
  title = {The Development of the Space-Time View of Quantum Electrodynamics},
  author = {Feynman, Richard P.},
  year = {1966},
  month = aug,
  volume = {153},
  pages = {699--708},
  doi = {10.1126/science.153.3737.699},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1966Sci...153..699F},
  journal = {Science},
  number = {3737}
}

@article{feynman_1966_Symmetry-Physical-Laws,
  title = {Symmetry in Physical Laws},
  author = {Feynman, Richard P.},
  year = {1966},
  month = apr,
  volume = {4},
  pages = {161--174},
  doi = {10.1119/1.2350961},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1966PhTea...4..161F},
  journal = {The Physics Teacher},
  number = {4}
}

@article{feynman_1969_Very-Highenergy-Collisions-Hadrons,
  title = {Very High-Energy Collisions of Hadrons},
  author = {Feynman, Richard P.},
  year = {1969},
  month = dec,
  volume = {23},
  pages = {1415--1417},
  doi = {10.1103/PhysRevLett.23.1415},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1969PhRvL..23.1415F},
  journal = {Physical Review Letters},
  number = {24}
}

@article{feynman_1969_What-Science,
  title = {What Is Science},
  author = {Feynman, Richard P.},
  year = {1969},
  month = sep,
  volume = {7},
  pages = {313--320},
  doi = {10.1119/1.2351388},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1969PhTea...7..313F},
  journal = {The Physics Teacher},
  number = {6}
}

@article{feynman_1970_Comments-Baryonic-States,
  title = {Some Comments on Baryonic States},
  author = {Feynman, R. P. and Pakvasa, S. and Tuan, S. F.},
  year = {1970},
  month = oct,
  volume = {2},
  pages = {1267--1270},
  doi = {10.1103/PhysRevD.2.1267},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1970PhRvD...2.1267F},
  journal = {Physical Review D},
  number = {7}
}

@article{feynman_1971_Current-Matrix-Elements-Relativistic-Quark-Model,
  title = {Current Matrix Elements from a Relativistic Quark Model},
  author = {Feynman, R. P. and Kislinger, M. and Ravndal, F.},
  year = {1971},
  month = jun,
  volume = {3},
  pages = {2706--2732},
  doi = {10.1103/PhysRevD.3.2706},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1971PhRvD...3.2706F},
  journal = {Physical Review D},
  number = {11}
}

@book{feynman_1971_Lectures-Gravitation,
  title = {Lectures on Gravitation},
  author = {Feynman, Richard P.},
  year = {1971},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1971legr.book.....F}
}

@incollection{feynman_1972_Closed-Loop-Tree-Diagrams,
  title = {Closed Loop and Tree Diagrams},
  booktitle = {Magic without Magic: John Archibald Wheeler},
  author = {Feynman, R. P.},
  editor = {Klauder, John R.},
  year = {1972},
  pages = {355},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1972mwm..book..355F}
}

@incollection{feynman_1972_Problems-Quantizing-Gravitational-Field-Massless-Yangmills-Field,
  title = {Problems in Quantizing the Gravitational Field, and the Massless Yang-Mills Field},
  booktitle = {Magic without Magic: John Archibald Wheeler},
  author = {Feynman, R. P.},
  editor = {Klauder, John R.},
  year = {1972},
  pages = {377},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1972mwm..book..377F}
}

@inproceedings{feynman_1972_What-Neutrinos-Can-Tell-Us-Partons,
  title = {What Neutrinos Can Tell Us about Partons},
  booktitle = {Neutrino '72},
  author = {Feynman, R. P.},
  editor = {Frenkel, A. and Marx, G.},
  year = {1972},
  month = jan,
  pages = {75},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1972neut.conf...75F}
}

@inproceedings{feynman_1974_Conference-Summary,
  title = {Conference Summary},
  booktitle = {Neutrinos - 1974},
  author = {Feynman, R. P.},
  editor = {Baltay, Charles},
  year = {1974},
  month = jul,
  volume = {22},
  pages = {299--327},
  doi = {10.1063/1.2947418},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1974AIPC...22..299F},
  series = {American Institute of Physics Conference Series}
}

@article{feynman_1974_Structure-Proton,
  title = {Structure of the Proton},
  author = {Feynman, Richard P.},
  year = {1974},
  month = feb,
  volume = {183},
  pages = {601--610},
  doi = {10.1126/science.183.4125.601},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1974Sci...183..601F},
  journal = {Science},
  number = {4125}
}

@article{feynman_1977_Correlations-Particles-Jets-Produced-Large-Transverse-Momenta,
  title = {Correlations among Particles and Jets Produced with Large Transverse Momenta},
  author = {Feynman, R. P. and Field, R. D. and Fox, G. C.},
  year = {1977},
  month = sep,
  volume = {128},
  pages = {1--65},
  doi = {10.1016/0550-3213(77)90299-1},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1977NuPhB.128....1F},
  journal = {Nuclear Physics B},
  number = {1}
}

@article{feynman_1978_Quantumchromodynamic-Approach-Largetransversemomentum-Production-Particles-Jets,
  title = {Quantum-Chromodynamic Approach for the Large-Transverse-Momentum Production of Particles and Jets},
  author = {Feynman, R. P. and Field, R. D. and Fox, G. C.},
  year = {1978},
  month = nov,
  volume = {18},
  pages = {3320--3343},
  doi = {10.1103/PhysRevD.18.3320},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1978PhRvD..18.3320F},
  journal = {Physical Review D},
  number = {9}
}

@inproceedings{feynman_1980_Alamos,
  title = {Los Alamos from Below},
  booktitle = {Reminiscences of Los Alamos, 1943-1945},
  author = {Feynman, Richard P.},
  editor = {Badash, Lawrence and Hirschfelder, Joseph O. and Broida, Herbert P.},
  year = {1980},
  month = jan,
  volume = {80-36731},
  pages = {105},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1980rla..conf..105F}
}

@article{feynman_1981_Qualitative-Behavior-YangMills-Theory-2-1-Dimensions,
  title = {The Qualitative Behavior of Yang-Mills Theory in 2 + 1 Dimensions},
  author = {Feynman, Richard P.},
  year = {1981},
  month = oct,
  volume = {188},
  pages = {479--512},
  doi = {10.1016/0550-3213(81)90005-5},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1981NuPhB.188..479F},
  journal = {Nuclear Physics B},
  number = {3}
}

@inproceedings{feynman_1982_Partons,
  title = {Partons},
  booktitle = {Hawaii Topical Conferences in Particle Physics - Selected Lectures (in 2 Volumes). Edited by PAKVASA s \& TUAN s f. Published by World Scientific Publishing Co. Pte. Ltd},
  author = {Feynman, Richard P.},
  year = {1982},
  month = jan,
  pages = {329--424},
  doi = {10.1142/9789814542500_0005},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1982paph.conf..329F}
}

@article{feynman_1982_Simulating-Physics-Computers,
  title = {Simulating Physics with Computers},
  author = {Feynman, Richard P.},
  year = {1982},
  month = jun,
  volume = {21},
  pages = {467--488},
  doi = {10.1007/BF02650179},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1982IJTP...21..467F},
  journal = {International Journal of Theoretical Physics},
  number = {6-7}
}

@article{feynman_1984_Quantummechanical-Computers,
  title = {Quantum-Mechanical Computers (a)},
  author = {Feynman, Richard P.},
  year = {1984},
  month = jan,
  volume = {1},
  pages = {464},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1984JOSAB...1..464F},
  journal = {Journal of the Optical Society of America B Optical Physics},
  keywords = {COMPUTERS}
}

@book{feynman_1985_QED-Strange-Theory-Light-Matter,
  title = {QED. The Strange Theory of Light and Matter},
  author = {Feynman, Richard P.},
  year = {1985},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1985qstl.book.....F}
}

@book{feynman_1985_Surely-You-Re-Joking-Mr-Feynman-Adventures-Curious-Character-Told-Ralph-Leighton,
  title = {Surely You're Joking Mr. Feynman! Adventures of a Curious Character as Told to Ralph Leighton},
  author = {Feynman, Richard P.},
  year = {1985},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1985syrj.book.....F}
}

@article{feynman_1986_Effective-Classical-Partition-Functions,
  title = {Effective Classical Partition Functions},
  author = {Feynman, R. P. and Kleinert, H.},
  year = {1986},
  month = dec,
  volume = {34},
  pages = {5080--5084},
  doi = {10.1103/PhysRevA.34.5080},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1986PhRvA..34.5080F},
  journal = {Physical Review A},
  keywords = {03.65.Ca,Formalism},
  number = {6}
}

@article{feynman_1986_QED,
  title = {QED},
  author = {Feynman, Richard and Hughes, Will},
  year = {1986},
  month = aug,
  volume = {54},
  pages = {766--767},
  doi = {10.1119/1.14435},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1986AmJPh..54..766F},
  journal = {American Journal of Physics},
  keywords = {01.30.Bb,03.65.Db,12.20.-m,Functional analytical methods,Publications of lectures,Quantum electrodynamics},
  number = {8}
}

@article{feynman_1986_Quantum-Mechanical-Computers,
  title = {Quantum Mechanical Computers},
  author = {Feynman, Richard P.},
  year = {1986},
  month = jun,
  volume = {16},
  pages = {507--531},
  doi = {10.1007/BF01886518},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1986FoPh...16..507F},
  journal = {Foundations of Physics},
  number = {6}
}

@book{feynman_1987_Elementary-Particles-Laws-Physics,
  title = {Elementary Particles and the Laws of Physics},
  author = {Feynman, Richard P. and Weinberg, Steven},
  year = {1987},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1987eplp.book.....F}
}

@inproceedings{feynman_1988_Difficulties-Applying-Variational-Principle-Quantum-Field-Theories,
  title = {Difficulties in Applying the Variational Principle to Quantum Field Theories},
  booktitle = {Variational Calculations in Quantum Field Theory: Proceedings of the Internationsl Workshop. Edited by POLLEY l},
  author = {Feynman, Richard P.},
  year = {1988},
  month = jan,
  pages = {28--40},
  doi = {10.1142/9789814390187_0003},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1988vcqf.conf...28F}
}

@article{feynman_1988_Outsider-S-View-Challenger-Inquiry,
  title = {An Outsider's inside View of the Challenger Inquiry},
  author = {Feynman, Richard P.},
  year = {1988},
  month = feb,
  volume = {41},
  pages = {26--37},
  doi = {10.1063/1.881143},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1988PhT....41b..26F},
  journal = {Physics Today},
  number = {2}
}

@incollection{feynman_1988_Quantum-Mechanical-Computers,
  title = {Quantum Mechanical Computers},
  booktitle = {Between Quantum and Cosmos},
  author = {Feynman, Richard P.},
  editor = {Zurek, W. H. and {van der Merwe}, A. and Miller, W. A.},
  year = {1988},
  pages = {523},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1988bqc..book..523F}
}

@book{feynman_1988_What-You-Care-What-Other-People-Think-Further-Adventures-Curious-Character-Told-Ralph-Leighton,
  title = {What Do You Care What Other People Think? Further Adventures of a Curious Character as Told to Ralph Leighton},
  author = {Feynman, Richard P.},
  year = {1988},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1988wdyc.book.....F}
}

@book{feynman_2010_Quantum-Mechanics-Path-Integrals,
  title = {Quantum Mechanics and Path Integrals},
  author = {Feynman, Richard P. and Hibbs, Albert R. and Styer, Daniel F.},
  year = {2010},
  month = jul,
  publisher = {Courier Corporation},
  abstract = {From astrophysics to condensed matter theory, nearly all of modern physics employs the path integral technique. In this presentation, the developer of path integrals and one of the best-known scientists of all time, Nobel Prize\textendash winning physicist Richard P. Feynman, presents unique insights into this method and its applications. Avoiding dense, complicated descriptions, Feynman articulates his celebrated theory in a clear, concise manner, maintaining a perfect balance between mathematics and physics.This emended edition of the original 1965 publication corrects hundreds of typographical errors and recasts many equations for clearer comprehension. It retains the original\&\#39;s verve and spirit, and it is approved and endorsed by the Feynman family. The opening chapters explore the fundamental concepts of quantum mechanics and introduce path integrals. Subsequent chapters cover more advanced topics, including the perturbation method, quantum electrodynamics, and the relation of path integrals to statistical mechanics. In addition to its merit as a text for graduate courses in physics, this volume serves as an excellent resource for professionals.},
  googlebooks = {JkMuDAAAQBAJ},
  isbn = {978-0-486-47722-0},
  language = {en}
}

@article{field_1977_Quark-Elastic-Scattering-Source-Hightransversemomentum-Mesons,
  title = {Quark Elastic Scattering as a Source of High-Transverse-Momentum Mesons},
  author = {Field, R. D. and Feynman, R. P.},
  year = {1977},
  month = may,
  volume = {15},
  pages = {2590--2616},
  doi = {10.1103/PhysRevD.15.2590},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1977PhRvD..15.2590F},
  journal = {Physical Review D},
  number = {9}
}

@article{field_1978_Parametrization-Properties-Quark-Jets,
  title = {A Parametrization of the Properties of Quark Jets},
  author = {Field, R. D. and Feynman, R. P.},
  year = {1978},
  month = apr,
  volume = {136},
  pages = {1--76},
  doi = {10.1016/0550-3213(78)90015-9},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1978NuPhB.136....1F},
  journal = {Nuclear Physics B},
  number = {1}
}

@article{mercereau_1956_Physical-Conditions-Ferromagnetic-Resonance,
  title = {Physical Conditions for Ferromagnetic Resonance},
  author = {Mercereau, J. E. and Feynman, R. P.},
  year = {1956},
  month = oct,
  volume = {104},
  pages = {63--63},
  doi = {10.1103/PhysRev.104.63},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1956PhRv..104...63M},
  journal = {Physical Review},
  number = {1}
}

@article{thornber_1970_Velocity-Acquired-Electron-Finite-Electric-Field-Polar-Crystal,
  title = {Velocity Acquired by an Electron in a Finite Electric Field in a Polar Crystal},
  author = {Thornber, K. K. and Feynman, Richard P.},
  year = {1970},
  month = may,
  volume = {1},
  pages = {4099--4114},
  doi = {10.1103/PhysRevB.1.4099},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1970PhRvB...1.4099T},
  journal = {Physical Review B},
  number = {10}
}

@article{thornber_1971_Velocity-Acquired-Electron-Finite-Electric-Field-Polar-Crystal,
  title = {Velocity Acquired by an Electron in a Finite Electric Field in a Polar Crystal},
  author = {Thornber, K. K. and Feynman, Richard P.},
  year = {1971},
  month = jul,
  volume = {4},
  pages = {674--674},
  doi = {10.1103/PhysRevB.4.674},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1971PhRvB...4..674T},
  journal = {Physical Review B},
  number = {2}
}

@inproceedings{treiman_1972_Panel-Discussion,
  title = {Panel Discussion},
  booktitle = {American Institute of Physics Conference Series},
  author = {Treiman, S. B. and Feynman, R. P. and Jackson, J. D. and Lee, T. D. and Low, F. E.},
  year = {1972},
  month = apr,
  volume = {6},
  pages = {164--185},
  doi = {10.1063/1.2947505},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1972AIPC....6..164T},
  series = {American Institute of Physics Conference Series}
}

@article{vallarta_1939_Scattering-Cosmic-Rays-Stars-Galaxy,
  title = {The Scattering of Cosmic Rays by the Stars of a Galaxy},
  author = {Vallarta, M. S. and Feynman, R. P.},
  year = {1939},
  month = mar,
  volume = {55},
  pages = {506--507},
  doi = {10.1103/PhysRev.55.506.2},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1939PhRv...55..506V},
  journal = {Physical Review},
  number = {5}
}

@article{wheeler_1945_Interaction-Absorber-Mechanism-Radiation,
  title = {Interaction with the Absorber as the Mechanism of Radiation},
  author = {Wheeler, John Archibald and Feynman, Richard Phillips},
  year = {1945},
  month = apr,
  volume = {17},
  pages = {157--181},
  doi = {10.1103/RevModPhys.17.157},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1945RvMP...17..157W},
  journal = {Reviews of Modern Physics},
  number = {2-3}
}

@article{wheeler_1949_Classical-Electrodynamics-Terms-Direct-Interparticle-Action,
  title = {Classical Electrodynamics in Terms of Direct Interparticle Action},
  author = {Wheeler, John Archibald and Feynman, Richard Phillips},
  year = {1949},
  month = jul,
  volume = {21},
  pages = {425--433},
  doi = {10.1103/RevModPhys.21.425},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System},
  adsurl = {https://ui.adsabs.harvard.edu/abs/1949RvMP...21..425W},
  journal = {Reviews of Modern Physics},
  number = {3}
}

repository: grpaulfr/academic-kickstart

repo_name: grpaulfr/academic-kickstart


text:
message("<smake::CompilerChecker> /modules/CompilerChecker/cmake/compiler_conf.cmake in")
set(CompilerChecker_INNER_COMPILE_FLAG )
set(CompilerChecker_INNER_LINK_FLAG )

# CompilerChecker code debug level: DEBUG(0) INFO(1) WARN(2) ERROR(3) CRITICAL(4) RELEASE(5)
set(debug_CompilerChecker 0)
if(${debug_CompilerChecker} LESS 1)
    set(Db_Flage -D_TEST_LEVEL_DEBUG -D_TEST_LEVEL_INFO -D_TEST_LEVEL_WARN -D_TEST_LEVEL_ERROR -D_TEST_LEVEL_CRITICAL)
elseif(${debug_CompilerChecker} LESS 2)
    set(Db_Flage -D_TEST_LEVEL_INFO -D_TEST_LEVEL_WARN -D_TEST_LEVEL_ERROR -D_TEST_LEVEL_CRITICAL)
elseif(${debug_CompilerChecker} LESS 3)
    set(Db_Flage -D_TEST_LEVEL_WARN -D_TEST_LEVEL_ERROR -D_TEST_LEVEL_CRITICAL)
elseif(${debug_CompilerChecker} LESS 4)
    set(Db_Flage -D_TEST_LEVEL_ERROR -D_TEST_LEVEL_CRITICAL)
elseif(${debug_CompilerChecker} LESS 5)
    set(Db_Flage -D_TEST_LEVEL_CRITICAL)
else(${debug_CompilerChecker} LESS 6)
    set(Db_Flage )
endif()#include <boost/function.hpp>
message("<smake::CompilerChecker> Debug: ${Db_Flage}")
set(CompilerChecker_INNER_COMPILE_FLAG ${CompilerChecker_INNER_COMPILE_FLAG} ${Db_Flage})
# add_compile_options(${Db_Flage} ${CompilerChecker_INNER_COMPILE_FLAG})

if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
    set(CompilerChecker_INNER_COMPILE_FLAG ${CompilerChecker_INNER_COMPILE_FLAG}
            -Wl,-rpath=.
            -Wno-write-strings
            -fPIC)
    if(${CompilerChecker_BUILD_FLAG} MATCHES "shared")
        set(CompilerChecker_INNER_COMPILE_FLAG ${CompilerChecker_INNER_COMPILE_FLAG}
            )
    endif()
    set(CompilerChecker_INNER_LINK_FLAG ${CompilerChecker_INNER_LINK_FLAG}
        -lpthread
        -lrt)
elseif(${CMAKE_GENERATOR} STREQUAL "MinGW Makefiles")
    set(CompilerChecker_INNER_COMPILE_FLAG ${CompilerChecker_INNER_COMPILE_FLAG}
        )
elseif(${CMAKE_GENERATOR} STREQUAL "MSYS Makefiles")
elseif(${CMAKE_GENERATOR} STREQUAL "Borland Makefiles")
elseif(${CMAKE_GENERATOR} STREQUAL "NMake Makefiles JOM")
elseif(${CMAKE_GENERATOR} STREQUAL "NMake Makefiles")
elseif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
    set_property(GLOBAL PROPERTY USE_FOLDERS On)
    if(${CompilerChecker_BUILD_FLAG} MATCHES "shared")
        set(CompilerChecker_INNER_COMPILE_FLAG ${CompilerChecker_INNER_COMPILE_FLAG}
            -DPUMP_CORE_HAVE_BOOST
            -DGLOG_NO_ABBREVIATED_SEVERITIES)
    endif()
    if(${CMAKE_GENERATOR} STREQUAL "Visual Studio 14 2015")
    elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 14 2015 Win64")
    elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 12 2013")
    elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 10")
    elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 10 Win64")
    elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 9 2008")
    elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 9 2008 Win64")
    elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 8 2005")
    elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 8 2005 Win64")
    elseif(${CMAKE_GENERATOR} STREQUAL "Visual Studio 6")
    endif()
elseif(${CMAKE_GENERATOR} STREQUAL "Watcom WMake")
elseif(${CMAKE_GENERATOR} STREQUAL "CodeBlocks - MinGW Makefiles")
elseif(${CMAKE_GENERATOR} STREQUAL "CodeBlocks - NMake Makefiles")
elseif(${CMAKE_GENERATOR} STREQUAL "CodeBlocks - Unix Makefiles")
elseif(${CMAKE_GENERATOR} STREQUAL "Eclipse CDT4 - MinGW Makefiles")
elseif(${CMAKE_GENERATOR} STREQUAL "Eclipse CDT4 - NMake Makefiles")
elseif(${CMAKE_GENERATOR} STREQUAL "Eclipse CDT4 - Unix Makefiles")
endif()

message("<smake::CompilerChecker> /modules/CompilerChecker/cmake/compiler_conf.cmake out")

license: MIT

license_type: permissive

branch_name: refs/heads/main

extension: cmake


text:
@ARTICLE{chao2022Nepal,
    AUTHOR = {Fengqing Chao and Samir K.C. and Hernando Ombao},
     TITLE = {Estimation and probabilistic projection of levels and trends in the sex ratio at birth in seven provinces of Nepal from 1980 to 2050: a Bayesian modeling approach},
   JOURNAL = {BMC Public Health},
  FJOURNAL = {BMC Public Health},
      YEAR = {2022},
    VOLUME = {22},
    NUMBER = {1},
     PAGES = {358},
      ISSN = {1471-2458},
       DOI = {10.1186/s12889-022-12693-0}
}

repository: pinwheelovefaye/academic-kickstart

repo_name: pinwheelovefaye/academic-kickstart

branch_name: refs/heads/master

extension: bib


text:
package redis

import (
	"github.com/stretchr/testify/assert"
	"testing"
)

var healthCheck *RedisHealthCheck

const (
	JSONRedisDialOptions = `
	{"addr":"127.0.0.1:6379"}
	`
)

func TestMain(m *testing.M) {
	healthCheck = NewRedisHealthCheck()
	m.Run()
}

func Test_redixHealthCheck_LoadExtConfig(t *testing.T) {
	type args struct {
		extConfig string
	}
	tests := []struct {
		name    string
		args    args
		wantErr bool
	}{
		{
			name:    "testing",
			args:    args{extConfig: JSONRedisDialOptions},
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if err := healthCheck.LoadExtConfig(tt.args.extConfig); (err != nil) != tt.wantErr {
				t.Errorf("LoadExtConfig() error = %v, wantErr %v", err, tt.wantErr)
			}
		})
	}
}

func Test_redixHealthCheck_DoHealthCheck(t *testing.T) {
	err := healthCheck.LoadExtConfig(JSONRedisDialOptions)
	assert.Nil(t, err)
	_, err = healthCheck.DoHealthCheck()
	assert.Nil(t, err)
}

repository: UnparalleledBeauty/juno-agent

repo_name: UnparalleledBeauty/juno-agent

extension: go


text:
require linux-intel-acrn_5.19.inc

SRC_URI:append = " file://service-vm_5.15.scc"

LINUX_VERSION_EXTENSION = "-mainline-tracking-acrn-service-vm"

SUMMARY = "Linux Kernel with ACRN enabled (Service VM)"

KERNEL_FEATURES:append = " features/criu/criu-enable.scc \
                          cgl/cfg/iscsi.scc \
                          service-vm_5.15.scc \
"

# config warning:  'CONFIG_IRQ_REMAP' last val (y) and .config val (n) do not matchs
# It is because, CONFIG_IRQ_REMAP depends upon IOMMU_SUPPORT, which we are explicitly disabling by setting to 'n'
# So, to suppress this warning, set
KCONF_AUDIT_LEVEL = "0"

repository: intel/meta-acrn

repo_name: intel/meta-acrn

gha_license_id: MIT

gha_language: BitBake

extension: bb


text:
DESCRIPTION = "CF mount tool"
SECTION = "base"
PRIORITY = "optional"
MAINTAINER = "Mike Looijmans <MiLo@pli-images.org>"

PV = "1.0"
PR = "r6"

inherit klibc

SRC_URI = "file://boottool-${MACHINE}.c file://root_to_cf.sh"

S = "${WORKDIR}/"

do_install() {
	install -d ${D}/boot/bin
	install ${S}/boottool ${D}/boot/bin/initcf
	install -d ${D}/boot/dev
	install -d ${D}/usr/bin
	install -m 755 ${WORKDIR}/root_to_cf.sh ${D}/usr/bin/
}

do_compile() {
	${CC} ${S}/boottool-${MACHINE}.c -o ${S}/boottool
}

# Need a read/write /boot filesystem
pkg_preinst() {
	if grep -q ' /boot ' /proc/mounts
	then
		mount -o remount,rw /boot
	fi
}

pkg_postinst() {
	mknod -m 660 $D/boot/dev/hdc b 22 0
	mknod -m 660 $D/boot/dev/hdc1 b 22 1
	if [ ! -f $D/boot/bin/initflash ]
	then
		ln $D/boot/bin/init $D/boot/bin/initflash
	fi
}

pkg_prerm() {
	if [ -f /boot/bin/initflash ]
	then
		rm -f /boot/bin/init
		mv /boot/bin/initflash /boot/bin/init
	fi
}

PACKAGE_ARCH := "${MACHINE_ARCH}"
FILES_${PN} = "/boot/bin/initcf /boot/dev /usr/bin"

gha_language: C


text:
package runtimecp_test

import (
	"testing"
	"unsafe"

	. "github.com/cdongyang/library/test/runtimecp"
)

func read(x interface{}) {
	if *(*int)(EfaceOf(x).Data) != 1 {
		panic("not 1")
	}
	if x.(int) != 1 {
		panic("not 1")
	}
}

func readP(p unsafe.Pointer) {
	if *(*int)(p) != 1 {
		panic("not 1")
	}
}

func readE(e Eface) {
	if *(*int)(e.Data) != 1 {
		panic("not 1")
	}
}

func TestNoescape(t *testing.T) {
	var n float64
	var f func(interface{})
	var fp func(unsafe.Pointer)
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		read(a) // read inline, read only, no escape
	})
	if n != 0 {
		t.Fatal("should not escape", n)
	}
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		readP(unsafe.Pointer(&a)) // read inline, read only, no escape
	})
	if n != 0 {
		t.Fatal("should not escape", n)
	}
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		f = read
		f(a) // f not inline, a escape
	})
	if n != 1 {
		t.Fatal("should escape", n)
	}
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		fp = readP
		fp(unsafe.Pointer(&a)) // f not inline, a escape
	})
	if n != 1 {
		t.Fatal("should escape", n)
	}
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		f = read
		f(NoescapeInterface(a)) // use Noescape func to hide pointer from escape analysis
	})
	if n != 0 {
		t.Fatal("should not escape", n)
	}
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		fp = readP
		fp(Noescape(unsafe.Pointer(&a))) // use Noescape func to hide pointer from escape analysis
	})
	if n != 0 {
		t.Fatal("should not escape", n)
	}
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		var b interface{} = a
		_ = b
	})
	if n != 0 {
		t.Fatal("should not escape", n)
	}
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		func(p unsafe.Pointer) {
			func(b unsafe.Pointer) {
				for i := 0; i < 1000; i++ {
					if *(*int)(b) != 1 {
						t.Fatal("not 1")
					}
				}
			}(p)
		}(unsafe.Pointer(&a))
	})
	if n == 0 {
		t.Fatal("should escape", n)
	}
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		func(p unsafe.Pointer) {
			func(b unsafe.Pointer) {
				for i := 0; i < 1000; i++ {
					if *(*int)(b) != 1 {
						t.Fatal("not 1")
					}
				}
			}(p)
		}(Noescape(unsafe.Pointer(&a)))
	})
	if n != 0 {
		t.Fatal("should not escape", n)
	}
	n = testing.AllocsPerRun(1000, func() {
		var a = 1
		func(p unsafe.Pointer) {
			go func(b unsafe.Pointer) {
				for i := 0; i < 1000; i++ {
					if *(*int)(b) != 1 {
						t.Fatal("not 1")
					}
				}
			}(p)
		}(Noescape(unsafe.Pointer(&a)))
	})
	if n == 0 {
		t.Fatal("should escape", n)
	}
}

type struct32ber interface {
	fun1()
}

type struct32b struct {
	a, b, c, d int
}

func (s struct32b) fun1() {
}

func TestInterface(t *testing.T) {
	var a = 2
	var ap = &a
	eface := EfaceOf(a)
	pEface := EfaceOf(ap)
	ppEface := EfaceOf(&ap)
	if (*int)(eface.Data) == ap || *(*int)(eface.Data) != 2 || eface.Type.Kind != KindInt+KindNoPointers || eface.Type.Size != 8 {
		t.Fatal(eface.Type)
	}
	if (*int)(pEface.Data) != ap || *(*int)(pEface.Data) != 2 || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if *(**int)(ppEface.Data) != ap || **(**int)(ppEface.Data) != 2 || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}
	var b = "b"
	var bp = &b
	eface = EfaceOf(b)
	pEface = EfaceOf(bp)
	ppEface = EfaceOf(&bp)
	if *(*string)(eface.Data) != "b" || eface.Type.Kind != KindString || eface.Type.Size != 16 {
		t.Fatal(eface.Type)
	}
	if *(*string)(pEface.Data) != "b" || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if **(**string)(ppEface.Data) != "b" || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var c interface{} = 2
	var cp = &c
	eface = EfaceOf(c)
	pEface = EfaceOf(cp)
	ppEface = EfaceOf(&cp)
	if *(*int)(eface.Data) != 2 || eface.Type.Kind != KindInt+KindNoPointers || eface.Type.Size != 8 {
		t.Fatal(eface.Type)
	}
	if *(*interface{})(pEface.Data) != 2 || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if **(**interface{})(ppEface.Data) != 2 || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var s32 = &struct32b{1, 2, 3, 4}
	var d struct32ber = s32
	var dp = &d
	eface = EfaceOf(d) // ConvI2E, eface.Data is s32
	pEface = EfaceOf(dp)
	ppEface = EfaceOf(&dp)
	if (*struct32b)(eface.Data) != s32 || eface.Type.Kind != KindPtr+KindDirectIface || eface.Type.Size != 8 {
		t.Fatal(eface.Type)
	}
	if *(*struct32ber)(pEface.Data) != d || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if **(**struct32ber)(ppEface.Data) != d || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var e = *s32
	var ep = &e
	eface = EfaceOf(e)
	pEface = EfaceOf(ep)
	ppEface = EfaceOf(&ep)
	if *(*struct32b)(eface.Data) != e || eface.Type.Kind != KindStruct+KindNoPointers || eface.Type.Size != 32 {
		t.Fatal(eface.Type)
	}
	if *(*struct32b)(pEface.Data) != e || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if **(**struct32b)(ppEface.Data) != e || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var f = []int{1, 2, 3}
	var fp = &f
	eface = EfaceOf(f)
	pEface = EfaceOf(fp)
	ppEface = EfaceOf(&fp)
	if !equalIntSlice(*(*[]int)(eface.Data), f) || eface.Type.Kind != KindSlice || eface.Type.Size != 24 {
		t.Fatal(eface.Type)
	}
	if !equalIntSlice(*(*[]int)(pEface.Data), f) || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if !equalIntSlice(**(**[]int)(ppEface.Data), f) || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var g = [5]int{1, 2, 3, 4, 5}
	var gp = &g
	eface = EfaceOf(g)
	pEface = EfaceOf(gp)
	ppEface = EfaceOf(&gp)
	if *(*[5]int)(eface.Data) != g || eface.Type.Kind != KindArray+KindNoPointers || eface.Type.Size != 40 {
		t.Fatal(eface.Type)
	}
	if *(*[5]int)(pEface.Data) != g || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if **(**[5]int)(ppEface.Data) != g || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var h = make(chan bool)
	var hp = &h
	eface = EfaceOf(h)
	pEface = EfaceOf(hp)
	ppEface = EfaceOf(&hp)
	if *(*chan bool)(unsafe.Pointer(&eface.Data)) != h || eface.Type.Kind != KindChan+KindDirectIface || eface.Type.Size != 8 {
		t.Fatal(eface.Type)
	}
	if *(*chan bool)(pEface.Data) != h || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if **(**chan bool)(ppEface.Data) != h || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var i = map[int]bool{1: true, 2: true, 4: true}
	var ip = &i
	eface = EfaceOf(i)
	pEface = EfaceOf(ip)
	ppEface = EfaceOf(&ip)
	if !equalMap(*(*map[int]bool)(unsafe.Pointer(&eface.Data)), i) || eface.Type.Kind != KindMap+KindDirectIface || eface.Type.Size != 8 {
		t.Fatal(eface.Type)
	}
	if !equalMap(*(*map[int]bool)(pEface.Data), i) || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if !equalMap(**(**map[int]bool)(ppEface.Data), i) || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var j = func() {}
	var jp = &j
	eface = EfaceOf(j)
	pEface = EfaceOf(jp)
	ppEface = EfaceOf(&jp)
	if eface.Type.Kind != KindFunc+KindDirectIface || eface.Type.Size != 8 {
		t.Fatal(eface.Type)
	}
	if pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var k = unsafe.Pointer(&j)
	var kp = &k
	eface = EfaceOf(k)
	pEface = EfaceOf(kp)
	ppEface = EfaceOf(&kp)
	if eface.Data != k || eface.Type.Kind != KindUnsafePointer+KindDirectIface || eface.Type.Size != 8 {
		t.Fatal(eface.Type)
	}
	if *(*unsafe.Pointer)(pEface.Data) != k || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if **(**unsafe.Pointer)(ppEface.Data) != k || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var l = complex(1.0, 2.0)
	var lp = &l
	eface = EfaceOf(l)
	pEface = EfaceOf(lp)
	ppEface = EfaceOf(&lp)
	if *(*complex128)(eface.Data) != l || eface.Type.Kind != KindComplex128+KindNoPointers || eface.Type.Size != 16 {
		t.Fatal(eface.Type)
	}
	if *(*complex128)(pEface.Data) != l || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if **(**complex128)(ppEface.Data) != l || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	var m interface{} = 1
	var mp = &m
	eface = EfaceOf(m)
	pEface = EfaceOf(mp)
	ppEface = EfaceOf(&mp)
	if *(*int)(eface.Data) != 1 || eface.Type.Kind != KindInt+KindNoPointers || eface.Type.Size != 8 {
		t.Fatal(eface.Type)
	}
	if *(*interface{})(pEface.Data) != 1 || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
		t.Fatal(pEface.Type)
	}
	if **(**interface{})(ppEface.Data) != 1 || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
		t.Fatal(ppEface.Type)
	}

	func() {
		type pointerStruct struct {
			a *int
		}
		var aaa = 1
		var m interface{} = pointerStruct{a: &aaa}
		var mp = &m
		eface = EfaceOf(m)
		pEface = EfaceOf(mp)
		ppEface = EfaceOf(&mp)
		if *(*int)(eface.Data) != 1 || eface.Type.Kind != KindStruct+KindDirectIface || eface.Type.Size != 8 {
			t.Fatal(eface.Type)
		}
		if *(*interface{})(pEface.Data) != m || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
			t.Fatal(pEface.Type)
		}
		if **(**interface{})(ppEface.Data) != m || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
			t.Fatal(ppEface.Type)
		}
	}()

	func() {
		type pointerStruct struct {
			b int
			a *int
		}
		var aaa = 1
		var m interface{} = pointerStruct{b: 2, a: &aaa}
		var mp = &m
		eface = EfaceOf(m)
		pEface = EfaceOf(mp)
		ppEface = EfaceOf(&mp)
		if *(*int)(eface.Data) != 2 || eface.Type.Kind != KindStruct || eface.Type.Size != 16 {
			t.Fatal(eface.Type)
		}
		if *(*interface{})(pEface.Data) != m || pEface.Type.Kind != KindPtr+KindDirectIface || pEface.Type.Size != 8 {
			t.Fatal(pEface.Type)
		}
		if **(**interface{})(ppEface.Data) != m || pEface.Type.Kind != KindPtr+KindDirectIface || ppEface.Type.Size != 8 {
			t.Fatal(ppEface.Type)
		}
	}()
}

func equalIntSlice(a, b []int) bool {
	if len(a) != len(b) {
		return false
	}
	for i := 0; i < len(a); i++ {
		if a[i] != b[i] {
			return false
		}
	}
	return true
}

func equalMap(a, b map[int]bool) bool {
	for k, v := range a {
		if val, ok := b[k]; !ok || val != v {
			return false
		}
	}
	return true
}

repository: cdongyang/testcode

repo_name: cdongyang/testcode


text:
package medium

// Given a binary tree, return the level order traversal
// of its nodes' values. (ie, from left to right, level by level).
//
// For example:
// Given binary tree [3,9,20,null,null,15,7],
//     3
//    / \
//   9  20
//     /  \
//    15   7
//
// return its level order traversal as:
// [
//   [3],
//   [9,20],
//   [15,7]
// ]

func levelOrder(root *TreeNode) [][]int {
	if root == nil {
		return nil
	}

	var ans [][]int
	var q []*TreeNode
	q = append(q, root)
	for len(q) > 0 {
		l := len(q)
		var tmp []int
		for i := 0; i < l; i++ {
			node := q[0]
			q = q[1:]
			if node.Left != nil {
				q = append(q, node.Left)
			}
			if node.Right != nil {
				q = append(q, node.Right)
			}
			tmp = append(tmp, node.Val)
		}
		ans = append(ans, tmp)
	}

	return ans
}


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

package dynamicconfig_test

import (
	"testing"
	"time"

	"github.com/stretchr/testify/require"
	dconf "go.temporal.io/server/common/dynamicconfig"
)

func TestMutations(t *testing.T) {
	c := dconf.NewMutableEphemeralClient()
	shardInterval := 22122 * time.Second
	maxbad := 22122
	c.Set(dconf.AcquireShardInterval, shardInterval)
	c.Add(dconf.FrontendMaxBadBinaries, maxbad)

	d, err := c.GetDurationValue(dconf.AcquireShardInterval, nil, 1*time.Second)
	require.NoError(t, err)
	require.Equal(t, d, shardInterval)

	i, err := c.GetIntValue(dconf.FrontendMaxBadBinaries, nil, 100)
	require.NoError(t, err)
	require.Equal(t, i, maxbad)

	b, err := c.GetBoolValue(dconf.EnableAuthorization, nil, true)
	require.Error(t, err)
	require.True(t, b)
}

func TestConstrainedMutation(t *testing.T) {
	c := dconf.NewMutableEphemeralClient()
	maxbad := 22122
	c.Add(dconf.FrontendMaxBadBinaries, maxbad, dconf.ForNamespace("nsfoo"))

	i, err := c.GetIntValue(dconf.FrontendMaxBadBinaries, nil, 100)
	require.Error(t, err, "expected error from lookup with no namespace")
	require.Equal(t, i, 100)

	i, err = c.GetIntValue(dconf.FrontendMaxBadBinaries,
		composeFilters(dconf.NamespaceFilter("wrong_namespace")), 100)
	require.Error(t, err)
	require.Equal(t, i, 100)

	i, err = c.GetIntValue(dconf.FrontendMaxBadBinaries,
		composeFilters(dconf.NamespaceFilter("nsfoo")), 100)
	require.NoError(t, err)
	require.Equal(t, i, maxbad)
}

func TestMulti(t *testing.T) {
	c := dconf.NewMutableEphemeralClient()
	shardInterval := 22122 * time.Second
	maxbad := 22122
	c.MSet(map[dconf.Key]interface{}{
		dconf.AcquireShardInterval:   shardInterval,
		dconf.FrontendMaxBadBinaries: maxbad,
	})
	c.MAdd(map[dconf.Key]interface{}{
		dconf.AcquireShardInterval:   1 * time.Second,
		dconf.FrontendMaxBadBinaries: 1,
	}, dconf.ForNamespace("nsfoo"))

	d, err := c.GetDurationValue(dconf.AcquireShardInterval, nil, shardInterval)
	require.NoError(t, err)
	require.Equal(t, d, shardInterval)

	i, err := c.GetIntValue(dconf.FrontendMaxBadBinaries, nil, maxbad)
	require.NoError(t, err)
	require.Equal(t, i, maxbad)

	nsflt := composeFilters(dconf.NamespaceFilter("nsfoo"))
	d, err = c.GetDurationValue(dconf.AcquireShardInterval, nsflt, 1*time.Hour)
	require.NoError(t, err)
	require.Equal(t, d, 1*time.Second)

	i, err = c.GetIntValue(dconf.FrontendMaxBadBinaries, nsflt, 0)
	require.NoError(t, err)
	require.Equal(t, i, 1)
}

func composeFilters(fs ...dconf.FilterOption) map[dconf.Filter]interface{} {
	out := map[dconf.Filter]interface{}{}
	for _, f := range fs {
		f(out)
	}
	return out
}

repository: alexshtin/temporal

repo_name: alexshtin/temporal

gha_language: Go


text:
package cmd

import (
	"context"
	"net/http"
	"os"
	"os/signal"
	"syscall"

	ah "github.com/appist/appy/http"

	"github.com/spf13/cobra"
)

// NewServeCommand runs the GRPC/HTTP web server.
func NewServeCommand(s *ah.ServerT) *cobra.Command {
	return &cobra.Command{
		Use:   "serve",
		Short: "Run the GRPC/HTTP web server.",
		Run: func(cmd *cobra.Command, args []string) {
			if s.Config.HTTPSSLEnabled == true && !s.IsSSLCertsExist() {
				logger.Fatal("HTTP_SSL_ENABLED is set to true without SSL certs, please generate using `go run . ssl:setup` first.")
			}

			serve(s)
		},
	}
}

func serve(s *ah.ServerT) {
	s.PrintInfo()

	httpDone := make(chan bool, 1)
	httpQuit := make(chan os.Signal, 1)
	signal.Notify(httpQuit, os.Interrupt)
	signal.Notify(httpQuit, syscall.SIGTERM)
	go func() {
		<-httpQuit
		logger.Infof("Gracefully shutting down the server within %s...", s.Config.HTTPGracefulTimeout)
		ctx, cancel := context.WithTimeout(context.Background(), s.Config.HTTPGracefulTimeout)
		defer cancel()

		if err := s.HTTP.Shutdown(ctx); err != nil {
			logger.Fatal(err)
		}

		close(httpDone)
	}()

	var err error
	if s.Config.HTTPSSLEnabled == true {
		err = s.HTTP.ListenAndServeTLS(s.Config.HTTPSSLCertPath+"/cert.pem", s.Config.HTTPSSLCertPath+"/key.pem")
	} else {
		err = s.HTTP.ListenAndServe()
	}

	if err != http.ErrServerClosed {
		logger.Fatal(err)
	}

	<-httpDone
}

repository: GPC-debug/appy

repo_name: GPC-debug/appy


text:
package mid

import (
	"context"
	"github.com/jean-pasqualini/go-service/foundation/web"
	"github.com/pkg/errors"
	"go.opentelemetry.io/otel/trace"
	"log"
	"net/http"
	"runtime/debug"
)

// Panics recovers from panics and convert the panic to an error so it is reported in Metrics and handled in Errors.
// MIddleware factory
func Panics(log *log.Logger) web.Middleware {
	// Decorator
	return func(handler web.Handler) web.Handler {
		// Decorated
		return func(ctx context.Context, w http.ResponseWriter, r *http.Request) (err error) {
			ctx, span := trace.SpanFromContext(ctx).Tracer().Start(ctx, "business.mid.panics")
			defer span.End()

			// If the context is missing this value, request the service to be shutdown gracefully.
			v, ok := ctx.Value(web.KeyValues).(*web.Values)
			if !ok {
				return web.NewShutdownError("web value missing from context")
			}

			// Defer a function to recover from a panic and set the err return variable after the fact
			defer func() {
				if r := recover(); r != nil {
					err = errors.Errorf("PANIC     : %v", r)

					// Log the Go stack trace for this panic'd goroutine.
					log.Printf("%s : PANIC     :\n%s", v.TraceId, debug.Stack())
				}
			}()

			// Call the Handler and set its return value in the err variable
			return handler(ctx, w, r)
		}
	}
}

repository: jean-pasqualini/go-service

repo_name: jean-pasqualini/go-service


text:
package fakeinterface

import (
	"fmt"
	"net"
	"runtime"
	"sync"
	"sync/atomic"
	"time"

	"github.com/newtools/zsocket/inet"
	"github.com/newtools/zsocket/nettypes"
)

type FakeInterface struct {
	LocalMAC net.HardwareAddr
	LocalIP  *net.IPAddr
	MTU      uint16

	sendListeners []sendListener
	sendLock      *sync.RWMutex
	sockets       map[uint16]FakeIPSocket
	socketKill    map[uint16]bool
	socketLock    *sync.RWMutex

	portsInUse map[uint16]bool
	portLock   *sync.RWMutex

	arpCache     map[string]*arpEntry
	arpCacheLock *sync.RWMutex

	listen uint32

	name string

	rxPackets,
	rxBytes,
	rxErrors,
	rxDropped,
	rxOverruns,
	rxFrame uint64

	txPackets,
	txBytes,
	txErrors,
	txDropped,
	txOverruns,
	txCarrier,
	txCollision uint64
}

type IPPacketOut struct {
	To       *net.IPAddr
	IPPacket nettypes.IPPacket
	Len      uint16
}

type FakeIPSocket interface {
	IPProtocol() nettypes.IPProtocol
	ReceivePacket(*net.IPAddr, nettypes.IPPacket, uint16)
	SendPacketChan() chan *IPPacketOut
}

type sendListener func(*nettypes.Frame, uint16)

type arpEntry struct {
	HardwareAddr net.HardwareAddr
	Time         time.Time
}

func btsEqual(b1, b2 []byte) bool {
	b1l, b2l := len(b1), len(b2)
	if b1l != b2l {
		return false
	}
	for i := 0; i < b1l; i++ {
		if b1[i] != b2[i] {
			return false
		}
	}
	return true
}

func copyFx(dst, src []byte, len uint16) {
	copy(dst, src)
}

type byteSize float64

const (
	_           = iota // ignore first value by assigning to blank identifier
	kB byteSize = 1 << (10 * iota)
	mB
	gB
	tB
	pB
	eB
	zB
	yB
)

func (b byteSize) String() string {
	switch {
	case b >= yB:
		return fmt.Sprintf("%.1fYB", b/yB)
	case b >= zB:
		return fmt.Sprintf("%.1fZB", b/zB)
	case b >= eB:
		return fmt.Sprintf("%.1fEB", b/eB)
	case b >= pB:
		return fmt.Sprintf("%.1fPB", b/pB)
	case b >= tB:
		return fmt.Sprintf("%.1fTB", b/tB)
	case b >= gB:
		return fmt.Sprintf("%.1fGB", b/gB)
	case b >= mB:
		return fmt.Sprintf("%.1fMB", b/mB)
	case b >= kB:
		return fmt.Sprintf("%.1fKB", b/kB)
	}
	return fmt.Sprintf("%.1fB", b)
}

func NewFakeInterface(name string, localMAC net.HardwareAddr, localIP *net.IPAddr, mtu uint16) (*FakeInterface, error) {
	if localMAC == nil {
		return nil, fmt.Errorf("must assign a mac address")
	}
	if localIP == nil {
		return nil, fmt.Errorf("must assign an ip address")
	}
	if mtu < 1500 {
		return nil, fmt.Errorf("cannot have an mtu less than 1500")
	}
	fi := new(FakeInterface)
	fi.LocalMAC = localMAC
	fi.LocalIP = localIP
	fi.MTU = mtu

	fi.sendLock = &sync.RWMutex{}
	fi.socketLock = &sync.RWMutex{}

	fi.arpCache = make(map[string]*arpEntry)
	fi.arpCacheLock = &sync.RWMutex{}

	fi.name = name
	return fi, nil
}

// This function will Send a packet from the interface
func (fi *FakeInterface) sendEthPayload(to net.HardwareAddr, packet nettypes.EthPacket, length uint16) error {
	l := 14 + length
	atomic.AddUint64(&fi.txPackets, 1)
	atomic.AddUint64(&fi.txBytes, uint64(l))
	if l > fi.MTU {
		atomic.AddUint64(&fi.txOverruns, 1)
		return fmt.Errorf("packet length cannot exceed MTU")
	}
	frame := nettypes.Frame(make([]byte, l))
	copy(frame[14:], packet.Bytes()[:length])
	copy(frame[0:6], to)
	copy(frame[6:12], fi.LocalMAC)
	et := packet.EthType()
	frame[12] = et[0]
	frame[13] = et[1]
	fi.sendLock.RLock()
	defer fi.sendLock.RUnlock()
	wg := sync.WaitGroup{}
	wg.Add(len(fi.sendListeners))
	for _, listener := range fi.sendListeners {
		go func(list sendListener) {
			list(&frame, l)
			wg.Done()
		}(listener)
	}
	wg.Wait()
	return nil
}

func (fi *FakeInterface) sendIPPayload(to *net.IPAddr, packet nettypes.IPPacket, len uint16) error {
	var ha net.HardwareAddr
	var backoffBackoff, backoff uint
	for backoffBackoff, backoff, ha = uint(1), 8, fi.getFromARPCache(to); ha == nil; backoffBackoff, backoff, ha = backoffBackoff<<1, backoff<<backoffBackoff, fi.getFromARPCache(to) {
		if backoff < 30000 {
			targetHA := net.HardwareAddr([]byte{0x0, 0x0, 0x0, 0x0, 0x0, 0x0})
			broadcast := net.HardwareAddr([]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff})
			arp, l := ARPPacket(nettypes.Request, nettypes.IPv4, fi.LocalMAC, fi.LocalIP, targetHA, to)
			fi.sendEthPayload(broadcast, arp, l)
			time.Sleep(time.Millisecond * time.Duration(backoff))
		} else {
			return fmt.Errorf("backoff for ARP request exceeded 30 seconds")
		}
	}
	ipv4, l := IPv4Packet(fi.LocalIP, to, packet.IPProtocol(), packet.Bytes(), len)
	return fi.sendEthPayload(ha, ipv4, l)
}

func (fi *FakeInterface) receiveEthPayload(packet nettypes.Frame, length uint16) error {
	atomic.AddUint64(&fi.rxPackets, 1)
	atomic.AddUint64(&fi.rxBytes, uint64(length))
	macDest := packet.MACDestination()
	pLen := length
	if btsEqual(macDest, fi.LocalMAC) || btsEqual(macDest, []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}) {
		pType := packet.MACEthertype(0)
		p, mOff := packet.MACPayload(0)
		pLen -= mOff
		switch pType {
		case nettypes.ARP:
			arp := nettypes.ARPPacket(p)
			if !fi.processIncomingArpRequest(arp) {
				atomic.AddUint64(&fi.rxDropped, 1)
			}
		case nettypes.IPv4:
			ipv4 := nettypes.IPv4Packet(p)
			if ipv4.PacketCorrupt() {
				atomic.AddUint64(&fi.rxDropped, 1)
			}
			ipProto := ipv4.Protocol()
			ipPay, ipOff := ipv4.Payload()
			pLen -= ipOff
			fromIP := net.IPAddr{ipv4.SourceIP(), ""}
			switch ipProto {
			case nettypes.TCP:
				tcp := nettypes.TCPPacket(ipPay)
				if tcp.CalculateChecksum(pLen, ipv4.SourceIP(), ipv4.DestinationIP()) != tcp.Checksum() {
					atomic.AddUint64(&fi.rxDropped, 1)
				} else {
					port := tcp.DestinationPort()
					fi.socketLock.RLock()
					if sock, ok := fi.sockets[port]; ok && sock.IPProtocol() == nettypes.TCP {
						sock.ReceivePacket(&fromIP, nettypes.IPPacket(tcp), pLen)
					}
					fi.socketLock.RUnlock()
				}
			case nettypes.UDP:
				udp := nettypes.UDPPacket(ipPay)
				csum := udp.Checksum()
				if csum != 0 && csum != udp.CalculateChecksum() {
					atomic.AddUint64(&fi.rxDropped, 1)
				} else {
					port := udp.DestinationPort()
					fi.socketLock.RLock()
					if sock, ok := fi.sockets[port]; ok && sock.IPProtocol() == nettypes.UDP {
						sock.ReceivePacket(&fromIP, nettypes.IPPacket(udp), pLen)
					}
					fi.socketLock.RUnlock()
				}
			case nettypes.ICMP:
				icmp := nettypes.ICMPPacket(ipPay)
				if inet.HToNSFS(icmp.CalculateChecksum(pLen)) != icmp.Checksum() {
					atomic.AddUint64(&fi.rxDropped, 1)
				} else {
					typ := icmp.Type()
					if typ == nettypes.EchoRequest {
						icmpP, icmpOff := icmp.Payload()
						pay, l := ICMPRequestReply(nettypes.EchoReply, 0, icmpP, pLen-icmpOff)
						fi.sendIPPayload(&fromIP, pay, l)
					}
				}
			}
		default:
			atomic.AddUint64(&fi.rxErrors, 1)
			return fmt.Errorf("unsupported type %s", pType)
		}
	} else {
		atomic.AddUint64(&fi.rxDropped, 1)
	}
	return nil
}

func (fi *FakeInterface) processIncomingArpRequest(arp nettypes.ARPPacket) bool {
	oper := arp.Operation()
	if oper == nettypes.Request {
		if btsEqual(arp.TPA(), fi.LocalIP.IP) {
			ipAddr := net.IPAddr{arp.SPA(), ""}
			hardwareAddr := arp.SHA()
			arp, l := ARPPacket(nettypes.Reply, nettypes.IPv4, fi.LocalMAC, fi.LocalIP, hardwareAddr, &ipAddr)
			fi.sendEthPayload(hardwareAddr, arp, l)
		}
	} else if oper == nettypes.Reply {
		hardwareAddr := arp.SHA()
		ipAddr := net.IPAddr{arp.SPA(), ""}
		fi.addToARPCache(&ipAddr, hardwareAddr)
	} else {
		return false
	}
	return true
}

func (fi *FakeInterface) sendPacketListener(listener sendListener) {
	fi.sendLock.Lock()
	defer fi.sendLock.Unlock()
	fi.sendListeners = append(fi.sendListeners, listener)
}

func (fi *FakeInterface) getFreePort() uint16 {
	fi.portLock.Lock()
	defer fi.portLock.Unlock()
	p := uint16(6000)
	for {
		if _, ok := fi.portsInUse[p]; ok {
			p++
		} else {
			fi.portsInUse[p] = true
			return p
		}
	}
}

func (fi *FakeInterface) returnPort(p uint16) {
	fi.portLock.Lock()
	defer fi.portLock.Unlock()
	delete(fi.portsInUse, p)
}

func (fi *FakeInterface) socketLoop(socket FakeIPSocket, port uint16) {
	ch := socket.SendPacketChan()
	for {
		fi.socketLock.RLock()
		if kill, ok := fi.socketKill[port]; !ok || kill {
			fi.socketLock.RUnlock()
			break
		}
		fi.socketLock.RUnlock()
		select {
		case ipOut := <-ch:
			fi.sendIPPayload(ipOut.To, ipOut.IPPacket, ipOut.Len)
		case <-time.After(time.Millisecond):
			runtime.Gosched()
		}
	}
}

func (fi *FakeInterface) addToARPCache(ipAddr *net.IPAddr, hardwareAddr net.HardwareAddr) {
	arpEntry := new(arpEntry)
	arpEntry.HardwareAddr = hardwareAddr
	fi.arpCacheLock.Lock()
	defer fi.arpCacheLock.Unlock()
	arpEntry.Time = time.Now().Add(time.Second * 30)
	fi.arpCache[ipAddr.String()] = arpEntry

}

func (fi *FakeInterface) getFromARPCache(ipAddr *net.IPAddr) net.HardwareAddr {
	fi.arpCacheLock.RLock()
	defer fi.arpCacheLock.RUnlock()
	ha, ok := fi.arpCache[ipAddr.String()]
	if !ok || time.Now().After(ha.Time) {
		return nil
	}
	return ha.HardwareAddr
}

func (fi *FakeInterface) OpenSocket(socket FakeIPSocket, assignPort bool, port uint16) (uint16, error) {
	fi.socketLock.Lock()
	defer fi.socketLock.Unlock()
	if assignPort {
		port = fi.getFreePort()
	} else {
		fi.portLock.Lock()
		defer fi.portLock.Unlock()
		if _, ok := fi.portsInUse[port]; ok {
			return 0, fmt.Errorf("port %v is already in use", port)
		}
	}
	fi.portsInUse[port] = true
	fi.socketKill[port] = false
	fi.sockets[port] = socket
	go fi.socketLoop(socket, port)
	return port, nil
}

func (fi *FakeInterface) CloseSocket(port uint16) error {
	fi.socketLock.Lock()
	defer fi.socketLock.Unlock()
	fi.returnPort(port)
	delete(fi.socketKill, port)
	if _, ok := fi.sockets[port]; !ok {
		return fmt.Errorf("socket is not open")
	}
	delete(fi.sockets, port)
	return nil
}

func (fi *FakeInterface) MaxPackets() uint32 {
	return 1000
}

func (fi *FakeInterface) MaxPacketSize() uint16 {
	return uint16(fi.MTU)
}

func (fi *FakeInterface) WrittenPackets() uint32 {
	return 0
}

func (fi *FakeInterface) Listen(fx func(*nettypes.Frame, uint16)) error {
	atomic.SwapUint32(&fi.listen, 1)
	fi.sendPacketListener(fx)
	for {
		if atomic.LoadUint32(&fi.listen) == 0 {
			return fmt.Errorf("interface socket closed")
		}
		time.Sleep(time.Second)
	}
}

func (fi *FakeInterface) WriteToBuffer(buf []byte, l uint16) (int32, error) {
	return fi.CopyToBuffer(buf, l, copyFx)
}

func (fi *FakeInterface) CopyToBuffer(buf []byte, l uint16, copyFx func(dst, src []byte, l uint16)) (int32, error) {
	err := fi.receiveEthPayload(nettypes.Frame(buf[:l]), uint16(l))
	if err != nil {
		return 0, err
	}
	return 0, nil
}

func (fi *FakeInterface) FlushFrames() (uint, error, []error) {
	return 0, nil, nil
}

func (fi *FakeInterface) Close() error {
	atomic.SwapUint32(&fi.listen, 0)
	return nil
}

func (fi *FakeInterface) String() string {
	var status string
	if atomic.LoadUint32(&fi.listen) == 1 {
		status = "UP,RUNNING"
	} else {
		status = "DOWN"
	}
	rxBytes := atomic.LoadUint64(&fi.rxBytes)
	rxBytesF := byteSize(float64(rxBytes))
	txBytes := atomic.LoadUint64(&fi.txBytes)
	txBytesF := byteSize(float64(txBytes))
	return fmt.Sprintf("%s: ", fi.name) + fmt.Sprintf("flags=4163<%s> mtu %v\n", status, fi.MTU) +
		fmt.Sprintf("\tinet %s prefixlen 64 scopeid 0x20<link>\n", fi.LocalIP) +
		fmt.Sprintf("\tether %s txqueuelen 1000 (Ethernet)\n", fi.LocalMAC) +
		fmt.Sprintf("\tRX packets %d bytes %d (%s)\n", atomic.LoadUint64(&fi.rxPackets), rxBytes, rxBytesF) +
		fmt.Sprintf("\tRX errors %d dropped %d overruns %d frame %d\n", atomic.LoadUint64(&fi.rxErrors),
			atomic.LoadUint64(&fi.rxDropped), atomic.LoadUint64(&fi.rxOverruns), atomic.LoadUint64(&fi.rxFrame)) +
		fmt.Sprintf("\tTX packets %d bytes %d (%s)\n", atomic.LoadUint64(&fi.txPackets), txBytes, txBytesF) +
		fmt.Sprintf("\tTX errors %d dropped %d overruns %d carrier %d collision %d\n", atomic.LoadUint64(&fi.txErrors),
			atomic.LoadUint64(&fi.txDropped), atomic.LoadUint64(&fi.txOverruns), atomic.LoadUint64(&fi.txCarrier), atomic.LoadUint64(&fi.txCollision))
}

repository: chongtianfeiyu/zsocket

repo_name: chongtianfeiyu/zsocket


text:
% book
% Required fields: author or editor, title, publisher, year.
% Optional fields: volume or number, series, address, edition, month, note.
@book{coulouris,
  author = {Coulouris  G.  F.,  Dollimore J. e  Kindberg T},
  title = {Distributed Systems: concepts and Design},
  publisher = {Addison-Wesley},
  year = {1994},
  edition = "second edition"

}

% article
% Required fields: author, title, journal, year.
% Optional fields: volume, number, pages, month, note.

@article {PGM,
	author = {David Pager},
	title = {{A pratical general method for constructing LR(k) parser}},
	journal = {Acta Informatica},
	volume = {7},
	pages = {249-268},
	year = {1977}
}
@article {knuth,
	author = {Knuth, D. E.},
	title = {On the translation of languages from lefft to right},
	journal = {Information and Control},
	volume = {8},
	pages = {607-639},
	year = {1965}
}

@article {lanetrace,
	author = {Davide Pager},
	title = {{The lane-tracing algorithm for constructing LR(K) parser and ways of anhancing its efficiency}},
	journal = {Information Sciences},
	volume = {12},
	pages = {19-42},
	year = {1977}
}
@inproceedings {lanetrace2,
	author = {Davide Pager},
	title = {{The lane tracing algorithm for constructing LR(K) parser, In Proccedings of the fifth annual ACM symposium on the Theory of computing}},
	pages = {172-181},
	address = {Austin, Texas, Unites States},
	year = {1973}
}

@techreport {yacc,
	author = {Stephen C. Johnson},
	title = {{YACC-yet another compiler compiler}},
	institution = {Computer Systems Research Group, Univerversity of Toronto},
	address = {Bell Laboratories, Murray Hill, NY}
	number = {CSTR-32},
	year = {1975}
}
@conference {hyacc,
	author = {Xin Chen, David Pager},
	title = {{Full LR(1) parser generator Hyacc and study on the performance of LR(1) algorithms}},
	booktitle = {Proceedings of The Fourth International C* Conference on Computer Science and Software Engineering},
	publisher = {ACM},
	pages = {83-92},
	year = {2011}
}

@misc{grammars,
	title = {{"Yacc-keable" Grammars}},
	howpublished = {http://www.angelfire.com/ar/CompiladoresUCSE/COMPILERS.html}
}

@article{ballisticSocialData,
	author    = {Oliver Giudice and
	Antonino Paratore and
	Marco Moltisanti and
	Sebastiano Battiato},
	title     = {A Classification Engine for Image Ballistics of Social Data},
	journal   = {CoRR},
	volume    = {abs/1610.06347},
	year      = {2016},
	url       = {http://arxiv.org/abs/1610.06347},
	archivePrefix = {arXiv},
	eprint    = {1610.06347},
	timestamp = {Mon, 13 Aug 2018 16:47:55 +0200},
	biburl    = {https://dblp.org/rec/bib/journals/corr/GiudicePMB16},
	bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{originClassificationSN,
	author    = {Roberto Caldelli and
	Rudy Becarelli and
	Irene Amerini},
	title     = {Image Origin Classification Based on Social Network Provenance},
	journal   = {{IEEE} Trans. Information Forensics and Security},
	volume    = {12},
	number    = {6},
	pages     = {1299--1308},
	year      = {2017},
	url       = {https://doi.org/10.1109/TIFS.2017.2656842},
	doi       = {10.1109/TIFS.2017.2656842},
	timestamp = {Wed, 14 Nov 2018 10:48:10 +0100},
	biburl    = {https://dblp.org/rec/bib/journals/tifs/CaldelliBA17},
	bibsource = {dblp computer science bibliography, https://dblp.org}
}

@inproceedings{thin,
	author    = {Quoc{-}Tin Phan and
	Cecilia Pasquini and
	Giulia Boato and
	Francesco G. B. De Natale},
	title     = {Identifying Image Provenance: An Analysis of Mobile Instant Messaging
	Apps},
	booktitle = {20th {IEEE} International Workshop on Multimedia Signal Processing,
	{MMSP} 2018, Vancouver, BC, Canada, August 29-31, 2018},
	pages     = {1--6},
	year      = {2018},
	crossref  = {DBLP:conf/mmsp/2018},
	url       = {https://doi.org/10.1109/MMSP.2018.8547050},
	doi       = {10.1109/MMSP.2018.8547050},
	timestamp = {Tue, 04 Dec 2018 17:04:16 +0100},
	biburl    = {https://dblp.org/rec/bib/conf/mmsp/PhanPBN18},
	bibsource = {dblp computer science bibliography, https://dblp.org}
}

@inproceedings{CNNbalistics,
	author    = {Irene Amerini and
	Tiberio Uricchio and
	Roberto Caldelli},
	title     = {Tracing images back to their social network of origin: {A} CNN-based
	approach},
	booktitle = {2017 {IEEE} Workshop on Information Forensics and Security, {WIFS}
	2017, Rennes, France, December 4-7, 2017},
	pages     = {1--6},
	year      = {2017},
	crossref  = {DBLP:conf/wifs/2017},
	url       = {https://doi.org/10.1109/WIFS.2017.8267660},
	doi       = {10.1109/WIFS.2017.8267660},
	timestamp = {Tue, 30 Jan 2018 12:27:14 +0100},
	biburl    = {https://dblp.org/rec/bib/conf/wifs/AmeriniUC17},
	bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{dataset,
	author    = {Dasara Shullani and
	Marco Fontani and
	Massimo Iuliani and
	Omar Al Shaya and
	Alessandro Piva},
	title     = {{VISION:} a video and image dataset for source identification},
	journal   = {{EURASIP} J. Information Security},
	volume    = {2017},
	pages     = {15},
	year      = {2017},
	url       = {https://doi.org/10.1186/s13635-017-0067-2},
	doi       = {10.1186/s13635-017-0067-2},
	timestamp = {Sun, 02 Jun 2019 21:01:34 +0200},
	biburl    = {https://dblp.org/rec/bib/journals/ejisec/ShullaniFISP17},
	bibsource = {dblp computer science bibliography, https://dblp.org}
}

@inproceedings{Bianchi,
	author    = {Tiziano Bianchi and
	Alessandro Piva},
	title     = {Reverse engineering of double {JPEG} compression in the presence of
	image resizing},
	booktitle = {2012 {IEEE} International Workshop on Information Forensics and Security,
	{WIFS} 2012, Costa Adeje, Tenerife, Spain, December 2-5, 2012},
	pages     = {127--132},
	year      = {2012},
	crossref  = {DBLP:conf/wifs/2012},
	url       = {https://doi.org/10.1109/WIFS.2012.6412637},
	doi       = {10.1109/WIFS.2012.6412637},
	timestamp = {Mon, 05 Jun 2017 12:43:30 +0200},
	biburl    = {https://dblp.org/rec/bib/conf/wifs/BianchiP12},
	bibsource = {dblp computer science bibliography, https://dblp.org}
}


text:
// Copyright 2014 Google Inc. All Rights Reserved.
//
// 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 oauth2 contains Martini handlers to provide
// user login via an OAuth 2.0 backend.
package snsauth

import (
	"encoding/json"
	"fmt"
	"net/http"
	"net/url"
	"time"

	"github.com/go-martini/martini"
	"github.com/martini-contrib/sessions"
	"github.com/philsong/oauth2"
)

const (
	codeRedirect = 302
	keyToken     = "oauth2_token"
	keyNextPage  = "next"
)

var (
	// PathLogin is the path to handle OAuth 2.0 logins.
	PathLogin = "/oauth2login"
	// PathLogout is the path to handle OAuth 2.0 logouts.
	PathLogout = "/oauth2logout"
	// PathCallback is the path to handle callback from OAuth 2.0 backend
	// to exchange credentials.
	//PathCallback = "/oauth2callback"
	PathCallback = "/callback"
	// PathError is the path to handle error cases.
	PathError = "/oauth2error"
)

// Options represents OAuth 2.0 credentials and
// further configuration to be used during access token retrieval.
type Options oauth2.Config

// Tokens represents a container that contains user's OAuth 2.0 access and refresh tokens.
type Tokens interface {
	Access() string
	Refresh() string
	Expired() bool
	ExpiryTime() time.Time
	ProviderName() string
}

type token struct {
	oauth2.Token
	providerName string
}

// Access returns the access token.
func (t *token) Access() string {
	if t == nil {
		fmt.Println("token.Access.t=nil")
		return ""
	}
	fmt.Println("token.AccessToken:", t.AccessToken)
	return t.AccessToken
}

// Refresh returns the refresh token.
func (t *token) Refresh() string {
	if t == nil {
		fmt.Println("token.Refresh.t=nil")
		return ""
	}

	fmt.Println("token.Refresh:", t.RefreshToken)
	return t.RefreshToken
}

// Expired returns whether the access token is expired or not.
func (t *token) Expired() bool {
	if t == nil {
		fmt.Println("token.Expired.t=nil")
		return true
	}
	fmt.Println("token.Expired:", !t.Token.Valid())
	return !t.Token.Valid()
}

// ExpiryTime returns the expiry time of the user's access token.
func (t *token) ExpiryTime() time.Time {
	if t == nil {
		fmt.Println("token.ExpiryTime.t=nil")
	}

	fmt.Println("token.Expiry:", t.Expiry)
	return t.Expiry
}

func (t *token) ProviderName() string {
	return t.providerName
}

// String returns the string representation of the token.
func (t *token) String() string {
	if t == nil {
		fmt.Println("token.String.t=nil")
		return ""
	}

	return fmt.Sprintf("token.Token: %v", t.Token)
}

// Google returns a new Google OAuth 2.0 backend endpoint.
func Google(conf *oauth2.Config) martini.Handler {
	conf.Endpoint = oauth2.Endpoint{
		AuthURL:  "https://accounts.google.com/o/oauth2/auth",
		TokenURL: "https://accounts.google.com/o/oauth2/token",
	}

	return NewOAuth2Provider(conf, "Google")
}

// Github returns a new Github OAuth 2.0 backend endpoint.
func Github(conf *oauth2.Config) martini.Handler {
	conf.Endpoint = oauth2.Endpoint{
		AuthURL:  "https://github.com/login/oauth/authorize",
		TokenURL: "https://github.com/login/oauth/access_token",
	}

	return NewOAuth2Provider(conf, "Github")
}

// Facebook returns a new Facebook OAuth 2.0 backend endpoint.
func Facebook(conf *oauth2.Config) martini.Handler {
	conf.Endpoint = oauth2.Endpoint{
		AuthURL:  "https://www.facebook.com/dialog/oauth",
		TokenURL: "https://graph.facebook.com/oauth/access_token",
	}

	return NewOAuth2Provider(conf, "Facebook")
}

// LinkedIn returns a new LinkedIn OAuth 2.0 backend endpoint.
func LinkedIn(conf *oauth2.Config) martini.Handler {
	conf.Endpoint = oauth2.Endpoint{
		AuthURL:  "https://www.linkedin.com/uas/oauth2/authorization",
		TokenURL: "https://www.linkedin.com/uas/oauth2/accessToken",
	}

	return NewOAuth2Provider(conf, "LinkedIn")
}

func Dropbox(conf *oauth2.Config) martini.Handler {
	conf.Endpoint = oauth2.Endpoint{
		AuthURL:  "https://www.dropbox.com/1/oauth2/authorize",
		TokenURL: "https://api.dropbox.com/1/oauth2/token",
	}

	return NewOAuth2Provider(conf, "Dropbox")
}

func Tencent(conf *oauth2.Config) martini.Handler {
	conf.Endpoint = oauth2.Endpoint{
		AuthURL:  "https://graph.qq.com/oauth2.0/authorize",
		TokenURL: "https://graph.qq.com/oauth2.0/token",
	}

	return NewOAuth2Provider(conf, "Tencent")
}

func Weibo(conf *oauth2.Config) martini.Handler {
	conf.Endpoint = oauth2.Endpoint{
		AuthURL:  "https://api.weibo.com/oauth2/authorize",
		TokenURL: "https://api.weibo.com/oauth2/access_token",
	}

	return NewOAuth2Provider(conf, "Weibo")
}

func Weixin(conf *oauth2.Config) martini.Handler {
	conf.Endpoint = oauth2.Endpoint{
		AuthURL:  "https://open.weixin.qq.com/connect/qrconnect",
		TokenURL: "https://api.weixin.qq.com/sns/oauth2/access_token",
	}

	return NewOAuth2Provider(conf, "Weixin")
}

// NewOAuth2Provider returns a generic OAuth 2.0 backend endpoint.
func NewOAuth2Provider(conf *oauth2.Config, providerName string) martini.Handler {

	return func(s sessions.Session, c martini.Context, w http.ResponseWriter, r *http.Request) {
		fmt.Println("NewOAuth2Provider.r.URL.Path", r.Method, r.URL.Path, providerName)
		if r.Method == "GET" {
			switch r.URL.Path {
			case PathLogin:
				login(conf, s, w, r)
			case PathLogout:
				logout(s, w, r)
			case PathCallback:
				handleOAuth2Callback(conf, s, w, r)
			}
		}

		fmt.Println("NewOAuth2Provider.unmarshallToken", providerName)
		tk := unmarshallToken(s, providerName)
		if tk != nil {
			fmt.Println("NewOAuth2Provider. tk != nil")
			// check if the access token is expired
			if tk.Expired() && tk.Refresh() == "" {

				s.Delete(keyToken)
				tk = nil
			}
		} else {
			fmt.Println("NewOAuth2Provider. tk == nil")
		}

		// Inject tokens.
		c.MapTo(tk, (*Tokens)(nil))
	}
}

// Handler that redirects user to the login page
// if user is not logged in.
// Sample usage:
// m.Get("/login-required", oauth2.LoginRequired, func() ... {})
var LoginRequired = func() martini.Handler {
	return func(s sessions.Session, c martini.Context, w http.ResponseWriter, r *http.Request) {
		fmt.Println("LoginRequired.unmarshallToken")
		token := unmarshallToken(s, "")
		if token == nil {
			fmt.Println("LoginRequired.token is nil")
		} else {
			fmt.Println("LoginRequired.token", token)
		}

		if token == nil || token.Expired() {
			next := url.QueryEscape(r.URL.RequestURI())
			fmt.Println("LoginRequired.next", r.URL.RequestURI(), next)
			http.Redirect(w, r, PathLogin+"?next="+next, codeRedirect)
		}
	}
}()

func login(f *oauth2.Config, s sessions.Session, w http.ResponseWriter, r *http.Request) {
	next := extractPath(r.URL.Query().Get(keyNextPage))
	fmt.Println("login.next", next)
	if s.Get(keyToken) == nil {
		// User is not logged in.
		fmt.Println("login.s.Get(keyToken) == nil")
		if next == "" {
			next = "/"
		}
		http.Redirect(w, r, f.AuthCodeURL(next, oauth2.AccessTypeOffline), codeRedirect)
		//http.Redirect(w, r, f.AuthCodeURL(next), codeRedirect) //just for dropbox
		return
	}
	// No need to login, redirect to the next page.
	http.Redirect(w, r, next, codeRedirect)
}

func logout(s sessions.Session, w http.ResponseWriter, r *http.Request) {
	next := extractPath(r.URL.Query().Get(keyNextPage))
	s.Delete(keyToken)
	fmt.Println("logout.next", next)
	http.Redirect(w, r, next, codeRedirect)
}

func handleOAuth2Callback(f *oauth2.Config, s sessions.Session, w http.ResponseWriter, r *http.Request) {
	next := extractPath(r.URL.Query().Get("state"))
	code := r.URL.Query().Get("code")
	fmt.Println("handleOAuth2Callback.next", next, " code", code)
	t, err := f.Exchange(oauth2.NoContext, code)
	if err != nil {
		// Pass the error message, or allow dev to provide its own
		// error handler.
		fmt.Println("handleOAuth2Callback.err", err)
		http.Redirect(w, r, PathError, codeRedirect)
		return
	}
	// Store the credentials in the session.
	fmt.Println("handleOAuth2Callback.t", t)
	val, _ := json.Marshal(t)
	s.Set(keyToken, val)

	http.Redirect(w, r, next, codeRedirect)
}

func unmarshallToken(s sessions.Session, providerName string) (t *token) {
	if s.Get(keyToken) == nil {
		fmt.Println("unmarshallToken.nil")
		return
	}
	data := s.Get(keyToken).([]byte)
	var tk oauth2.Token
	fmt.Println("unmarshallToken.data", data)
	json.Unmarshal(data, &tk)
	fmt.Println("unmarshallToken.tk", tk)
	return &token{tk, providerName}
}

func extractPath(next string) string {
	n, err := url.Parse(next)
	if err != nil {
		return "/"
	}
	return n.Path
}

repository: philsong/snsauth

repo_name: philsong/snsauth


text:
package middleware

import (
	"log"
	"net/http"
	"time"

	"github.com/labstack/echo"
	"github.com/labstack/gommon/color"
)

func Logger(h echo.HandlerFunc) echo.HandlerFunc {
	return func(c *echo.Context) error {
		start := time.Now()
		if err := h(c); err != nil {
			c.Error(http.StatusInternalServerError, err)
		}
		end := time.Now()
		m := c.Request.Method
		p := c.Request.URL.Path
		n := c.Response.Status()
		col := color.Green

		switch {
		case n >= 500:
			col = color.Red
		case n >= 400:
			col = color.Yellow
		case n >= 300:
			col = color.Cyan
		}

		log.Printf("%s %s %s %s", m, p, col(n), end.Sub(start))
		return nil
	}
}

repository: dmcaulay/rtd

repo_name: dmcaulay/rtd


text:
@article{liu2014direct,
 author = {Liu, Rui and Milkie, Daniel E and Kerlin, Aaron and MacLennan, Bryan and Ji, Na},
 journal = {Optics express},
 number = {2},
 pages = {1619--1628},
 publisher = {Optical Society of America},
 title = {Direct phase measurement in zonal wavefront reconstruction using multidither coherent optical adaptive technique},
 volume = {22},
 year = {2014}
}

repository: dmilkie/starter-academic

repo_name: dmilkie/starter-academic


text:
package main

import (
	"fmt"
	"github.com/DataIntelligenceCrew/go-faiss"
)

func main() {
	dimension := 1
	dbSize := 5

	index, err := faiss.NewIndexFlat(dimension, faiss.MetricL2)
	if err != nil {
		fmt.Println(err.Error())
	}
	indexMap, err := faiss.NewIndexIDMap(index)
	if err != nil {
		fmt.Println(err.Error())
	}
	xb := []float32{1,2,3,4,5}
	ids := make([]int64, dbSize)
	for i := 0; i < dbSize; i++ {
		ids[i] = int64(i)
	}

	err = indexMap.AddWithIDs(xb, ids)
	if err != nil {
		fmt.Println(err.Error())
	}
	toFind := xb[dimension:2*dimension]
	distances1, resultIds, err := indexMap.Search(toFind, 5)
	fmt.Println(distances1, resultIds, err)
	fmt.Println(resultIds[0] == ids[1])
	fmt.Println(distances1[0] == 0)

}

repository: uhbuhb/go-faiss

repo_name: uhbuhb/go-faiss


text:
// Copyright (C) 2021 Gridworkz Co., Ltd.
// KATO, Application Management Platform

// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

package controller

import (
	"encoding/json"
	"github.com/go-chi/chi"
	"github.com/gridworkz/kato/builder/model"
	"github.com/gridworkz/kato/db"
	dbmodel "github.com/gridworkz/kato/db/model"
	httputil "github.com/gridworkz/kato/util/http"
	"net/http"
	"strings"

	"github.com/bitly/go-simplejson"
	"github.com/gridworkz/kato/builder/discover"
	"github.com/sirupsen/logrus"
	"io/ioutil"
)

func AddCodeCheck(w http.ResponseWriter, r *http.Request) {
	//b,_:=ioutil.ReadAll(r.Body)
	//{\"url_repos\": \"https://github.com/bay1ts/zk_cluster_mini.git\", \"check_type\": \"first_check\", \"code_from\": \"gitlab_manual\", \"service_id\": \"c24dea8300b9401b1461dd975768881a\", \"code_version\": \"master\", \"git_project_id\": 0, \"condition\": \"{\\\"language\\\":\\\"docker\\\",\\\"runtimes\\\":\\\"false\\\", \\\"dependencies\\\":\\\"false\\\",\\\"procfile\\\":\\\"false\\\"}\", \"git_url\": \"--branch master --depth 1 https://github.com/bay1ts/zk_cluster_mini.git\"}
	//logrus.Infof("request recive %s",string(b))
	result := new(model.CodeCheckResult)

	b, _ := ioutil.ReadAll(r.Body)
	j, err := simplejson.NewJson(b)
	if err != nil {
		logrus.Errorf("error decode json,details %s", err.Error())
		httputil.ReturnError(r, w, 400, "bad request")
		return
	}
	result.URLRepos, _ = j.Get("url_repos").String()
	result.CheckType, _ = j.Get("check_type").String()
	result.CodeFrom, _ = j.Get("code_from").String()
	result.ServiceID, _ = j.Get("service_id").String()
	result.CodeVersion, _ = j.Get("code_version").String()
	result.GitProjectId, _ = j.Get("git_project_id").String()
	result.Condition, _ = j.Get("condition").String()
	result.GitURL, _ = j.Get("git_url").String()

	defer r.Body.Close()

	dbmodel := convertModelToDB(result)
	//checkAndGet
	db.GetManager().CodeCheckResultDao().AddModel(dbmodel)
	httputil.ReturnSuccess(r, w, nil)
}
func Update(w http.ResponseWriter, r *http.Request) {
	serviceID := strings.TrimSpace(chi.URLParam(r, "serviceID"))
	result := new(model.CodeCheckResult)

	b, _ := ioutil.ReadAll(r.Body)
	defer r.Body.Close()
	logrus.Infof("update receive %s", string(b))
	j, err := simplejson.NewJson(b)
	if err != nil {
		logrus.Errorf("error decode json,details %s", err.Error())
		httputil.ReturnError(r, w, 400, "bad request")
		return
	}
	result.BuildImageName, _ = j.Get("image").String()
	portList, err := j.Get("port_list").Map()
	if err != nil {
		portList = make(map[string]interface{})
	}
	volumeList, err := j.Get("volume_list").StringArray()
	if err != nil {
		volumeList = nil
	}
	strMap := make(map[string]string)
	for k, v := range portList {
		strMap[k] = v.(string)
	}
	result.VolumeList = volumeList
	result.PortList = strMap
	result.ServiceID = serviceID
	dbmodel := convertModelToDB(result)
	dbmodel.DockerFileReady = true
	db.GetManager().CodeCheckResultDao().UpdateModel(dbmodel)
	httputil.ReturnSuccess(r, w, nil)
}
func convertModelToDB(result *model.CodeCheckResult) *dbmodel.CodeCheckResult {
	r := dbmodel.CodeCheckResult{}
	r.ServiceID = result.ServiceID
	r.CheckType = result.CheckType
	r.CodeFrom = result.CodeFrom
	r.CodeVersion = result.CodeVersion
	r.Condition = result.Condition
	r.GitProjectId = result.GitProjectId
	r.GitURL = result.GitURL
	r.URLRepos = result.URLRepos

	if result.Condition != "" {
		bs := []byte(result.Condition)
		l, err := simplejson.NewJson(bs)
		if err != nil {
			logrus.Errorf("error get condition,details %s", err.Error())
		}
		language, err := l.Get("language").String()
		if err != nil {
			logrus.Errorf("error get language,details %s", err.Error())
		}
		r.Language = language
	}
	r.BuildImageName = result.BuildImageName
	r.InnerPort = result.InnerPort
	pl, _ := json.Marshal(result.PortList)
	r.PortList = string(pl)
	vl, _ := json.Marshal(result.VolumeList)
	r.VolumeList = string(vl)
	r.VolumeMountPath = result.VolumeMountPath
	return &r
}
func GetCodeCheck(w http.ResponseWriter, r *http.Request) {
	serviceID := strings.TrimSpace(chi.URLParam(r, "serviceID"))
	//findResultByServiceID
	cr, err := db.GetManager().CodeCheckResultDao().GetCodeCheckResult(serviceID)
	if err != nil {
		logrus.Errorf("error get check result,details %s", err.Error())
		httputil.ReturnError(r, w, 500, err.Error())
		return
	}
	httputil.ReturnSuccess(r, w, cr)
}

func CheckHalth(w http.ResponseWriter, r *http.Request) {
	healthInfo := discover.HealthCheck()
	if healthInfo["status"] != "health" {
		httputil.ReturnError(r, w, 400, "builder service unusual")
	}
	httputil.ReturnSuccess(r, w, healthInfo)
}

repository: sitedata/kato

repo_name: sitedata/kato

gha_license_id: NOASSERTION


text:
@article{britten_qualitative_1995,
	title = {Qualitative Research: Qualitative interviews in medical research},
	volume = {311},
	issn = {0959-8138, 1468-5833},
	url = {http://www.bmj.com/content/311/6999/251},
	doi = {10.1136/bmj.311.6999.251},
	shorttitle = {Qualitative Research},
	abstract = {Abstract: "Much qualitative research is interview based, and this paper provides an outline of qualitative interview techniques and their application in medical settings. It explains the rationale for these techniques and shows how they can be used to research kinds of questions that are different from those dealt with by quantitative methods. Different types of qualitative interviews are described, and the way in which they differ from clinical consultations is emphasised. Practical guidance for conducting such interviews is given."},
	pages = {251--253},
	journaltitle = {{BMJ}},
	author = {Britten, N.},
	urldate = {2011-11-22},
	date = {1995-07-22}
}

repository: pmean/build-website

repo_name: pmean/build-website


text:
package reid

//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.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

// Device is a nested struct in reid response
type Device struct {
	AgentStatus      string `json:"AgentStatus" xml:"AgentStatus"`
	IpcStatus        string `json:"IpcStatus" xml:"IpcStatus"`
	AgentIp          string `json:"AgentIp" xml:"AgentIp"`
	IpcIp            string `json:"IpcIp" xml:"IpcIp"`
	AgentReceiveTime int64  `json:"AgentReceiveTime" xml:"AgentReceiveTime"`
	AgentMac         string `json:"AgentMac" xml:"AgentMac"`
	IpcReceiveTime   int64  `json:"IpcReceiveTime" xml:"IpcReceiveTime"`
	IpcId            int64  `json:"IpcId" xml:"IpcId"`
	IpcName          string `json:"IpcName" xml:"IpcName"`
}

repository: aliyun/alibaba-cloud-sdk-go

repo_name: aliyun/alibaba-cloud-sdk-go