text:
= {Semi-Supervised Classification Method for Hyperspectral Remote Sensing Images},
Author                   = {Gómez-Chova, L. and Calpe, J. and Camps-Valls, G. and Martín, J.D. and Soria, E. and Vila, J. and Alonso-Chorda, L. and Moreno, J.},
Year                     = {2003},
Note                     = {4},
Pages                    = {1776-1778},
Volume                   = {3},

Document_type            = {Conference Paper},
Journal                  = {International Geoscience and Remote Sensing Symposium (IGARSS)},
Url                      = {http://www.scopus.com/inward/record.url?eid=2-s2.0-0242541981&partnerID=40&md5=4d4eca2d95473e163cd2d077d63697ca}
}

@InProceedings{Gomez-Chova2003555,
Title                    = {Feature Selection of Hyperspectral Data Through Local Correlation and SFFS for Crop Classification},
Author                   = {Gómez-Chova, L. and Calpe, J. and Camps-Valls, G. and Martín, J.D. and Soria, E. and Vila, J. and Alonso-Chorda, L. and Moreno, J.},
Year                     = {2003},
Note                     = {22},
Pages                    = {555-557},
Volume                   = {1},

Document_type            = {Conference Paper},
Journal                  = {International Geoscience and Remote Sensing Symposium (IGARSS)},
Url                      = {http://www.scopus.com/inward/record.url?eid=2-s2.0-0242459609&partnerID=40&md5=baf5a872c15835ca0229b51109aaabcc}
}

@InProceedings{Gomez-Chova2003589,
Title                    = {CART-based feature selection of hyperspectral images for crop cover classification},
Author                   = {Gómez-Chova, L. and Calpe, J. and Soria, E. and Camps-Valls, G. and Martín, J.D. and Moreno, J.},
Year                     = {2003},
Note                     = {7},
Pages                    = {589-592},
Volume                   = {3},

Document_type            = {Conference Paper},
Journal                  = {IEEE International Conference on Image Processing},
Url                      = {http://www.scopus.com/inward/record.url?eid=2-s2.0-0345134153&partnerID=40&md5=280799f49bd0d4038c3938e82f0363f0}
}

@InProceedings{GomezSPIE03,
Title                    = {Robust Automatic Classification Method for Hyperspectral Imagery},
Author                   = {Gómez, L. and Calpe, J. and Camps-Valls, G. and Martín, J. D. and Soria, E. and Moreno, J.},
Booktitle                = {SPIE Remote Sensing Symposium. Image and Signal Processing for Remote Sensing IX. SPIE03},
Year                     = {2003},

Address                  = {Barcelona, Spain},
Month                    = {Sep},
Pages                    = {398-407},
Volume                   = {5238}
}

@InProceedings{Gutierrez03,
Title                    = {Perceptual regularization functionals for natural image restoration},
Author                   = {Jaime Gutiérrez and Jesús Malo and Francesc J. Ferri},
Booktitle                = {{ICIP} {(2)}},
Year                     = {2003},
Pages                    = {989--992},

Doi                      = {http://dx.doi.org/10.1109/ICIP.2003.1246850},
Url                      = {http://dx.doi.org/10.1109/ICIP.2003.1246850}
}

@InProceedings{Malo03,
Title                    = {Normalized Image Representation for Efficient Coding},
Author                   = {J. Malo},
Booktitle                = {Proc. IEEE 37th Asilomar Conf. Signals Systems \& Comp.},
Year                     = {2003},
Pages                    = {1408-1412},
Volume                   = {2}
}

@InProceedings{MartinISPA03,
Title                    = {A soft approach to {ERA} algorithm for hyperspectral image classification},
Author                   = {Martín, J. D. and Gómez, L. and Calpe, J. and Camps-Valls, G. and Soria, E. and Moreno, J.},
Booktitle                = {IEEE International International. Symposium on Image and Signal Processing and Analysis (ISPA 2003)},
Year                     = {2003},

Address                  = {Rome, Italy},
Month                    = {Sep},
Pages                    = {761-765},
Volume                   = {2}
}

@InProceedings{Fernando02,
Title                    = {Multi-dimensional Function Approximation and Regression Estimation},
Author                   = {F. Pérez-Cruz and G. Camps-Valls and E. Soria-Olivas and J. J. Pérez-Ruixo and A. R. Figueiras-Vidal and A. Artés-Rodríguez},
Booktitle                = {{I}nternational {C}onference on {A}rtificial {N}eural {N}etworks, {ICANN}'02.},
Year                     = {2002},

Address                  = {Madrid, Spain},
Month                    = {Aug},
Pages                    = {757-782},
Publisher                = {Lecture Notes in Computer Science (LNCS). Springer-Verlag},
Volume                   = {2415}
}

@InProceedings{GomezRARQS02,
Title                    = {Semi-supervised method for crop classification using hyperspectral remote sensing images},
Author                   = {Gómez, L. and Calpe, J. and Soria, E. and Camps-Valls, G. and Martín, J. D. and Moreno, J.},
Booktitle                = {{1st International Symposium. Recent Advantages in Quantitative Remote Sensing, RAQRS'2002}},
Year                     = {2002},

Address                  = {Torrent (València)},
Month                    = {Sep},
Pages                    = {488-495}
}

@InProceedings{MartinEUNITE02,
Title                    = {Solving clinical problems with artificial neural networks: some case studies},
Author                   = {Martín, J. D. and Soria, E. and Camps-Valls, G. and Serrano, A. J. and Sepúlveda, J. R. and Jiménez, N. V.},
Booktitle                = {Second European Symposium on Intelligent Technologies, Hybrid Systems and their implementation on Smart Adaptive Systems EUNITE 2002},
Year                     = {2002},

Address                  = {Albufeira (Portugal)},
Month                    = {Sep},
Note                     = {CD y Booklet. Published at ``Intelligent e-Health Applications in Medicine'' (Univ. of Aegean)}
}

@InProceedings{Rosado-Munoz2002209,
Title                    = {Enhancing feature extraction for VF detection using data mining techniques},
Author                   = {Rosado-Muñoz, A. and Camps-Valls, G. and Guerrero-Martínez, J. and Francés-Villora, J.V. and Muñoz-Marí, J. and Serrano-López, A.J.},
Year                     = {2002},
Note                     = {3},
Pages                    = {209-212},
Volume                   = {29},

Document_type            = {Conference Paper},
Journal                  = {Computers in Cardiology},
Url                      = {http://www.scopus.com/inward/record.url?eid=2-s2.0-0036955664&partnerID=40&md5=e2f36b97a50d29d6b029fea3296785e2}
}

@InProceedings{RosadoTELEC02,
Title                    = {Two different approaches for a real-time acquisition system for Ventricular Fibrillation detection using time-frequency algorithms},
Author                   = {Rosado, A. and Magdalena, J. R. and Muñoz, J. and Bataller, M. and Camps, G.},
Booktitle                = {International Conference TELEC02},
Year                     = {2002},

Address                  = {Santiago de Cuba (Cuba)},
Month                    = {Jul},
Note                     = {Libro de Actas+CD-ROM}
}

@InProceedings{Sepulveda-Sanchis2002413,
Title                    = {Support vector machines and genetic algorithms for detecting unstable angina},
Author                   = {Sepúlveda-Sanchis, J. and Camps-Valls, G. and Soria-Olivas, E. and Salcedo-Sanz, S. and Bousoño-Calzón, C. and Sanz-Romero, G. and Marrugat de la Iglesia, J.},
Year                     = {2002},
Note                     = {1},
Pages                    = {413-416},
Volume                   = {29},

Document_type            = {Conference Paper},
Journal                  = {Computers in Cardiology},
Url                      = {http://www.scopus.com/inward/record.url?eid=2-s2.0-0036945610&partnerID=40&md5=b163149c2f9feb4566ac2842bc154434}
}

@InProceedings{SerranoEUNITE02,
Title                    = {Web-based Clinical Decision Support System Using Neural Networks},
Author                   = {Serrano, A. J. and Soria, E. and Camps-Valls, G. and Martín, J. D. and Sepúlveda, J. R. and Magdalena, R. and Jiménez, N. V.},
Booktitle                = {Second European Symposium on Intelligent Technologies, Hybrid Systems and their implementation on Smart Adaptive Systems EUNITE 2002},
Year                     = {2002},

Address                  = {Albufeira (Portugal)},
Month                    = {Sep},
Note                     = {CD y Booklet. Published at ``Intelligent e-Health Applications in Medicine'' (Univ. of Aegean)}
}

@InProceedings{Watson02,
Title                    = {Video quality measures based on the standard spatial observer},
Author                   = {Andrew B. Watson and Jesús Malo},
Booktitle                = {{ICIP} {(3)}},
Year                     = {2002},
Pages                    = {41--44},

Doi                      = {http://dx.doi.org/10.1109/ICIP.2002.1038898},
Url                      = {http://dx.doi.org/10.1109/ICIP.2002.1038898}
}

@InProceedings{Camps01cinc,
Title                    = {Fetal {ECG} extraction using an {FIR} neural network},
Author                   = {Camps, G. and Martínez, M. and Soria, E.},
Booktitle                = {{C}omputers in {C}ardiology. {IEEE} {C}omputer {S}ociety {P}ress},
Year                     = {2001},

Address                  = {Rotterdam, The Netherlands},
Month                    = {Sep},
Number                   = {28},
Pages                    = {249--252}
}

@InProceedings{Camps01icann,
Title                    = {Neural Networks Ensemble for Cyclosporine Concentration Monitoring},
Author                   = {Camps-Valls, G. and Soria-Olivas, E. and Martín-Guerrero, J. D. and Pérez-Ruixo, J. J. and Jiménez-Torres, N. V.},
Booktitle                = {{I}nternational {C}onference on {A}rtificial {N}eural {N}etworks, {ICANN}'2001},
Year                     = {2001},

Address                  = {Vienna, Austria},
Month                    = {Aug},
Pages                    = {706-711},
Publisher                = {Lecture Notes in Computer Science (LNCS). Springer-Verlag},
Volume                   = {2130}
}

@InProceedings{Camps01nips,
Title                    = {A Profile-Dependent Kernel-based Regression for Cyclosporine Concentration Prediction},
Author                   = {Camps-Valls, G. and Soria-Olivas, E. and Pérez-Ruixo, J. and Artés-Rodríguez, A. and Pérez-Cruz, F. and Figueiras-Vidal, A.},
Booktitle                = {{N}eural {I}nformation {P}rocessing {S}ystems, {NIPS}'01. {W}orkshop on {N}ew {D}irections in {K}ernel-based {L}earning {M}ethods},
Year                     = {2001},

Address                  = {Vancouver, British Columbia, Canada},
Month                    = {Dec}
}

@InProceedings{CampsPAGE01,
Title                    = {Comparative study of {NONMEM} and Neural Networks for Cyclosporine Dosage Prediction in Renal Allograft Recipients},
Author                   = {Camps-Valls, G. and Porta, B. and Pérez-Ruixo, J. J. and Soria, E. and Martín, J. D. and Jiménez, V.},
Booktitle                = {Population Approach Group Europe (PAGE2001), ISSN 1871-6032},
Year                     = {2001},

Address                  = {Basel, Suiza},
Month                    = {Jun},
Volume                   = {Abstr 217},

Url                      = {http://www.page-meeting.org/}
}

@InProceedings{MartinCIN01,
Title                    = {Optimización de dosis de {EPO} en pacientes con anemia secundaria a insuficiencia renal crónica a través de la predicción del nivel de hemoglobina},
Author                   = {Martín-Guerrero, J. D. and Soria-Olivas, E. and Pérez-Ruixo, J. J. and Camps-Valls, G. and Serrano-López, A. J. and Sepúlveda-Sanchis, J. R. and Jiménez-Torres, N. V.},
Booktitle                = {2nd International Congress of Nephrology in Internet},
Year                     = {2001},

Address                  = {Burgos, Spain},
Month                    = {Nov},

Url                      = {http://www.uninet.edu/cin2001/html/index.html}
}

@InProceedings{Martinez01cinc,
Title                    = {Methods to evaluate the performance of fetal electrocardiogram extraction algorithms},
Author                   = {Martínez, M. and Calpe, J. and Soria, E. and Guerrero, J.F. and Camps, G. and Gómez, L.},
Booktitle                = {Computers in Cardiology 2001},
Year                     = {2001},
Pages                    = {253-256},

Doi                      = {10.1109/CIC.2001.977640},
ISSN                     = {0276-6547},
Keywords                 = {electrocardiography;medical signal processing;obstetrics;software performance evaluation;algorithm performance evaluation;extraction algorithm quality indexes;fetal ECG;fetal electrocardiogram extraction algorithms;objective measurements;operational parameters;recovered signal quality measurements;simulated registers;visual inspection criteria;Data compression;Data mining;Electrocardiography;Electrodes;Inspection;Inverse problems;Proposals;Signal generators;Signal to noise ratio;Visual databases}
}

@InProceedings{MartinPAGE01,
Title                    = {Erythropoietin Dosage Individualisation in Anemic Patients With Chronic Renal Failure},
Author                   = {Martín, J. D. and Jiménez, V. and Pérez-Ruixo, J. and Serrano, A. and Rosado, A. and Soria, E. and Camps-Valls, G.},
Booktitle                = {Population Approach Group Europe (PAGE2001), ISSN 1871-6032},
Year                     = {2001},

Address                  = {Basel, Suiza},
Month                    = {Jun},
Volume                   = {Abstr 214},

Url                      = {http://www.page-meeting.org/}
}

@InProceedings{Sepulveda01cinc,
Title                    = {Risk Assessment For Acute Myocardial Infarction Patients Using Artificial Neural Networks},
Author                   = {Sepulveda, J. and Soria, E. and Camps-Valls, G. and Sanz, G. Marrugat, J. and Gómez, L.},
Booktitle                = {Computers in Cardiology, CINC'01. IEEE Computer Society Press},
Year                     = {2001},

Address                  = {Rotterdam (Holanda)},
Month                    = {Sep},
Number                   = {28},
Pages                    = {573-575}
}

@InProceedings{Serrano01,
Title                    = {Some examples for solving Clinical Problems using Neural Networks},
Author                   = {Serrano, A. J. and Soria, E. and Camps-Valls, G. and Martín, J. D.},
Booktitle                = {6th {I}nternational {W}ork-Conference On {A}rtificial and {N}atural {N}eural {N}etworks. {IWANN}'2001},
Year                     = {2001},

Address                  = {Granada, Spain},
Month                    = {Jun},
Pages                    = {345-355},
Publisher                = {Lecture Notes in Computer Science (LNCS). Springer-Verlag},
Volume                   = {2085}
}

@InProceedings{SerranoPAGE01,
Title                    = {An Example of a Neural Network Like a Pharmacokinetic/Pharmacodynamic Model},
Author                   = {Serrano, A. J. and Martín, J. D. and Jiménez, V. and Pérez-Ruixo, J. J. and Camps-Valls, G. and Soria, E.},
Booktitle                = {Population Approach Group Europe (PAGE2001), ISSN 1871-6032},
Year                     = {2001},

Address                  = {Basel, Suiza},
Month                    = {Jun},
Volume                   = {Abstr 216},

Url                      = {http://www.page-meeting.org/}
}

@InProceedings{CampsWC00,
Title                    = {A Neural Approach to Ciclosporine dose Prediction},
Author                   = {Camps-Valls, G. and Soria, E. and Jiménez, N. V. and Martín, J. D. and Serrano, A. J. and Porta, B.},
Booktitle                = {Chicago 2000 World Congress on Medical Physics and Biomedical Engineering},
Year                     = {2000},

Address                  = {Chicago (Illinois), EE.UU.},
Month                    = {Jul}
}

@InProceedings{CampsWC00b,
Title                    = {Artificial Neural Networks for the Classification of potentially Intoxicates Patients Treated with Digoxin},
Author                   = {Camps-Valls, G. and Soria, E. and Jiménez, N. V.},
Booktitle                = {Chicago 2000 World Congress on Medical Physics and Biomedical Engineering},
Year                     = {2000},

Address                  = {Chicago (Illinois), EE.UU.},
Month                    = {Jul}
}

@InProceedings{GuerreroWC00,
Title                    = {Cross-correlation of the Heart Rate Variability and Ventricular Repolarization Duration in Diabetic Patients Affected by Autonomic Cardiovascular Neuropathy},
Author                   = {Guerrero, J. and López, M. P. and Chorro, J. and Martínez, M. and Camps-Valls, G. and Ampudia, J.},
Booktitle                = {Chicago 2000 World Congress on Medical Physics and Biomedical Engineering},
Year                     = {2000},

Address                  = {Chicago (Illinois), EE.UU.},
Month                    = {Jul}
}

@InProceedings{JimenezASHP99,
Title                    = {Prediction of digoxin Plasma Potentially Toxic Levels by Using a Neural Network Model},
Author                   = {Jiménez, N. V. and Soria, E. and Albert, A. and Serrano, A. J. and Camps, G.},
Booktitle                = {1999 Midyear Clinical Meeting. ASHP'99. American Society of Health-System Pharmacists},
Year                     = {2000},

Address                  = {Orlando (EEUU)},
Month                    = {Jan},
Pages                    = {2277}
}

@InProceedings{MartinWC00a,
Title                    = {Nonlinear Prediction of rh{EPO} Dose by Using Neural Networks},
Author                   = {Martín, J. D. and Soria, E. and Jiménez, N. V. and Camps-Valls, G. and Serrano, A. J. and Pérez Ruixo, J.},
Booktitle                = {Chicago 2000 World Congress on Medical Physics and Biomedical Engineering},
Year                     = {2000},

Address                  = {Chicago (Illinois), EE.UU.},
Month                    = {Jul}
}

@InProceedings{GuerreroCINC99,
Title                    = {Analysis of Heart Rate Variability In Diabetic Patients Affected By Autonomic Cardiovascular Neuropathy},
Author                   = {Guerrero, J. and López, P. and Chorro, J. and Martínez, M. and Camps-Valls, G. and Magdalena, R. Rosado, A. and Ampudia, J.},
Booktitle                = {Computers in Cardiology 1999, CINC'1999. IEEE Computer Society Press},
Year                     = {1999},

Address                  = {Hannover, Germany},
Month                    = {Sep},
Pages                    = {241-244}
}

@InProceedings{RosadoESEM99,
Title                    = {Ventricular Fibrillation Detection Method Using Pseudo {W}igner-{V}ille Time-Frequency Representation},
Author                   = {Rosado, A. and Guerrero, J. and Serrano, A. and Soria, E. and Martínez, M. and Camps, G.},
Booktitle                = {Fifth Conference of the European Society for Engineering \& Medicine. ESEM'1999},
Year                     = {1999},

Address                  = {Barcelona},
Month                    = {May},
Pages                    = {379-380}
}

@InProceedings{Ferri98,
Title                    = {Variable-size block matching algorithm for motion estimation using a perceptual-based splitting criterion},
Author                   = {Francesc J. Ferri and Jesús Malo and Jesús V. Albert and J. Soret},
Booktitle                = {Fourteenth International Conference on Pattern Recognition, {ICPR} 1998, Brisbane, Australia, 16-20 August, 1998},
Year                     = {1998},
Pages                    = {286--288},

Doi                      = {http://dx.doi.org/10.1109/ICPR.1998.711137},
Url                      = {http://dx.doi.org/10.1109/ICPR.1998.711137}
}

@InProceedings{SoriaMexico98a,
Title                    = {Uso de redes neuronales en la clasificación de pacientes con riesgo de intoxicación por digoxina},
Author                   = {Soria, E. and Camps-Valls, G. and Serrano, A. J. and Molina, J. and Martín, J. D. and Albert, A.},
Booktitle                = {I Congreso Latinoamericano de Ingeniería Biomédica MAZATLáN '98},
Year                     = {1998},

Address                  = {Mazatlán, México},
Month                    = {Nov},
Pages                    = {167-170}
}

@InProceedings{SoriaMexico98b,
Title                    = {Aplicación informática para la identificación de pacientes con riesgo de intoxicación digitálica},
Author                   = {Soria, E. and Camps-Valls, G. and Serrano, A. J. and Albert, A. and Jiménez, N. V.},
Booktitle                = {I Congreso Latinoamericano de Ingeniería Biomédica MAZATLáN '98},
Year                     = {1998},

Address                  = {Mazatlán, México},
Month                    = {Nov},
Pages                    = {211-214}
}

@InProceedings{Malo97,
Title                    = {Adaptive Motion Estimation and Video Vector Quantization Based on Spatiotemporal Non-linearities of Human Perception},
Author                   = {Jesús Malo and Francesc J. Ferri and Jesús V. Albert and J. M. Artigas},
Booktitle                = {Image Analysis and Processing, 9th International Conference, {ICIAP} '97, Florence, Italy, September 17-19, 1997, Proceedings, Volume {I}},
Year                     = {1997},
Pages                    = {454--461},

Doi                      = {http://dx.doi.org/10.1007/3-540-63507-6_232},
Url                      = {http://dx.doi.org/10.1007/3-540-63507-6_232}
}

repository: EvaUV/web-group-theme

repo_name: EvaUV/web-group-theme

gha_license_id: MIT


text:
%# -*- coding: utf-8-unix -*-

%1
@TechReport{NRL,
	institution =  {Networking Research Lab at Department of Computer Science And Engineering at Shanghai Jiao Tong University},
  url =          {http://202.120.37.78:8080/nrl}
}

%2
@article{agrawal1993efficient,
  title={Efficient similarity search in sequence databases},
  author={Agrawal, Rakesh and Faloutsos, Christos and Swami, Arun},
  journal={Foundations of data organization and algorithms},
  pages={69--84},
  year={1993},
  publisher={Springer}
}

%3
@article{chan1999efficient,
  title={Efficient time series matching by wavelets},
  author={Chan, Kin-Pong and Fu, Ada Wai-Chee},
  booktitle={Data Engineering, 1999. Proceedings., 15th International Conference on},
  pages={126--133},
  year={1999},
  organization={IEEE}
}

%4
@article{bernad1996finding,
  title={Finding patterns in time series: a dynamic programming approach},
  author={Bernad, DJ},
  journal={Advances in knowledge discovery and data mining},
  year={1996},
  publisher={AAAI Press/The MIT Press}
}

%5
@article{yanagisawa2003shape,
  title={Shape-based similarity query for trajectory of mobile objects},
  author={Yanagisawa, Yutaka and Akahani, Jun-ichi and Satoh, Tetsuji},
  booktitle={International Conference on Mobile Data Management},
  pages={63--77},
  year={2003},
  organization={Springer}
}

%6
@article{cai2004indexing,
  title={Indexing spatio-temporal trajectories with Chebyshev polynomials},
  author={Cai, Yuhan and Ng, Raymond},
  booktitle={Proceedings of the 2004 ACM SIGMOD international conference on Management of data},
  pages={599--610},
  year={2004},
  organization={ACM}
}

%7
@article{vlachos2004rotation,
  title={Rotation invariant distance measures for trajectories},
  author={Vlachos, Michail and Gunopulos, Dimitrios and Das, Gautam},
  booktitle={Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining},
  pages={707--712},
  year={2004},
  organization={ACM}
}

%8
@article{sakurai2005ftw,
  title={FTW: fast similarity search under the time warping distance},
  author={Sakurai, Yasushi and Yoshikawa, Masatoshi and Faloutsos, Christos},
  booktitle={Proceedings of the twenty-fourth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems},
  pages={326--337},
  year={2005},
  organization={ACM}
}

%9
@article{vlachos2002discovering,
  title={Discovering similar multidimensional trajectories},
  author={Vlachos, Michail and Kollios, George and Gunopulos, Dimitrios},
  booktitle={Data Engineering, 2002. Proceedings. 18th International Conference on},
  pages={673--684},
  year={2002},
  organization={IEEE}
}

%10
@article{chen2005robust,
  title={Robust and fast similarity search for moving object trajectories},
  author={Chen, Lei and {\"O}zsu, M Tamer and Oria, Vincent},
  booktitle={Proceedings of the 2005 ACM SIGMOD international conference on Management of data},
  pages={491--502},
  year={2005},
  organization={ACM}
}

%11
@article{chen2004marriage,
  title={On the marriage of lp-norms and edit distance},
  author={Chen, Lei and Ng, Raymond},
  booktitle={Proceedings of the Thirtieth international conference on Very large data bases-Volume 30},
  pages={792--803},
  year={2004},
  organization={VLDB Endowment}
}

%12
@article{frentzos2007index,
  title={Index-based most similar trajectory search},
  author={Frentzos, Elias and Gratsias, Kostas and Theodoridis, Yannis},
  booktitle={Data Engineering, 2007. ICDE 2007. IEEE 23rd International Conference on},
  pages={816--825},
  year={2007},
  organization={IEEE}
}

%13
@article{sankararaman2013model,
  title={Model-driven matching and segmentation of trajectories},
  author={Sankararaman, Swaminathan and Agarwal, Pankaj K and M{\o}lhave, Thomas and Pan, Jiangwei and Boedihardjo, Arnold P},
  booktitle={Proceedings of the 21st ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems},
  pages={234--243},
  year={2013},
  organization={ACM}
}

%14
@article{visvalingam1990douglas,
  title={The Douglas-Peucker Algorithm for Line Simplification: Re-evaluation through Visualization},
  author={Visvalingam, Mahes and Whyatt, J Duncan},
  booktitle={Computer Graphics Forum},
  volume={9},
  number={3},
  pages={213--225},
  year={1990},
  organization={Wiley Online Library}
}
%15
@misc{flasklibrary,
    %author = "Saleh Elmohamed",
    title = "Jinja2 and WSGI",
    howpublished = "Website",
    %year = {1996},
    note = {\url{http://werkzeug.pocoo.org/docs/0.12/} \url{http://jinja.pocoo.org/docs/2.9/}}
}

%15
@book{hershberger1992speeding,
  title={Speeding up the Douglas-Peucker line-simplification algorithm},
  author={Hershberger, John Edward and Snoeyink, Jack},
  year={1992},
  publisher={University of British Columbia, Department of Computer Science}
}

%16 RTREE
@techreport{sellis1987r+,
  title={The R+-Tree: A Dynamic Index for Multi-Dimensional Objects.},
  author={Sellis, Timos and Roussopoulos, Nick and Faloutsos, Christos},
  year={1987}
}

%17 mapReduce
@article{dean2008mapreduce,
  title={MapReduce: simplified data processing on large clusters},
  author={Dean, Jeffrey and Ghemawat, Sanjay},
  journal={Communications of the ACM},
  volume={51},
  number={1},
  pages={107--113},
  year={2008},
  publisher={ACM}
}

%18 spark
@article{zaharia2010spark,
  title={Spark: Cluster Computing with Working Sets.},
  author={Zaharia, Matei and Chowdhury, Mosharaf and Franklin, Michael J and Shenker, Scott and Stoica, Ion},
  journal={HotCloud},
  volume={10},
  number={10-10},
  pages={95},
  year={2010}
}

%19
@article{zheng2015trajectory,
  title={Trajectory data mining: an overview},
  author={Zheng, Yu},
  journal={ACM Transactions on Intelligent Systems and Technology (TIST)},
  volume={6},
  number={3},
  pages={29},
  year={2015},
  publisher={ACM}
}

%20
@article{zheng2011computing,
  title={Computing with spatial trajectories},
  author={Zheng, Yu and Zhou, Xiaofang},
  year={2011},
  publisher={Springer Science \& Business Media}
}

%21
@article{morse2007efficient,
  title={An efficient and accurate method for evaluating time series similarity},
  author={Morse, Michael D and Patel, Jignesh M},
  booktitle={Proceedings of the 2007 ACM SIGMOD international conference on Management of data},
  pages={569--580},
  year={2007},
  organization={ACM}
}

%21
@article{qi2015efficient,
  title={Efficient point-based trajectory search},
  author={Qi, Shuyao and Bouros, Panagiotis and Sacharidis, Dimitris and Mamoulis, Nikos},
  booktitle={International Symposium on Spatial and Temporal Databases},
  pages={179--196},
  year={2015},
  organization={Springer}
}

%22
@article{roussopoulos1995nearest,
  title={Nearest neighbor queries},
  author={Roussopoulos, Nick and Kelley, Stephen and Vincent, Fr{\'e}d{\'e}ric},
  booktitle={ACM sigmod record},
  volume={24},
  number={2},
  pages={71--79},
  year={1995},
  organization={ACM}
}

%23
@article{chen2010searching,
  title={Searching trajectories by locations: an efficiency study},
  author={Chen, Zaiben and Shen, Heng Tao and Zhou, Xiaofang and Zheng, Yu and Xie, Xing},
  booktitle={Proceedings of the 2010 ACM SIGMOD International Conference on Management of data},
  pages={255--266},
  year={2010},
  organization={ACM}
}

%24
@article{tang2011retrieving,
  title={Retrieving k-nearest neighboring trajectories by a set of point locations},
  author={Tang, Lu-An and Zheng, Yu and Xie, Xing and Yuan, Jing and Yu, Xiao and Han, Jiawei},
  booktitle={International Symposium on Spatial and Temporal Databases},
  pages={223--241},
  year={2011},
  organization={Springer}
}

%25
@article{chen2009trajectory,
  title={Trajectory simplification method for location-based social networking services},
  author={Chen, Yukun and Jiang, Kai and Zheng, Yu and Li, Chunping and Yu, Nenghai},
  booktitle={Proceedings of the 2009 International Workshop on Location Based Social Networks},
  pages={33--40},
  year={2009},
  organization={ACM}
}

%26
@article{shang2014personalized,
  title={Personalized trajectory matching in spatial networks},
  author={Shang, Shuo and Ding, Ruogu and Zheng, Kai and Jensen, Christian S and Kalnis, Panos and Zhou, Xiaofang},
  journal={The VLDB Journal},
  volume={23},
  number={3},
  pages={449--468},
  year={2014},
  publisher={Springer}
}

%27
@TechReport{AutoNavi,
	institution =  {AutoNavi Map Javascript Application Program Interface},
  url =          {http://lbs.amap.com/api/javascript-api/summary/}
}

%28
@article{tuw2002software,
  title={Software requirement specification},
  author={TUW, Rainer Pamminger and Fraunhofer, IZM},
  year={2002}
}

%29
@TechReport{sparkclustermanager,
	institution =  {Cluster Mode Overview},
  url =          {http://spark.apache.org/docs/latest/cluster-overview.html#cluster-manager-types}
}

%30
@article{hongzhi2017parallel,
  title={Parallel Trajectory Search Based on Distributed Index},
  author={Hongzhi, Wang and Belhassena, Amina},
  journal={Information Sciences},
  year={2017},
  publisher={Elsevier}
}

%31
@TechReport{rtreedocument,
	institution =  {Rtree: Spatial indexing for Python},
  url =          {http://toblerity.org/rtree/}
}

%32
@article{alt1995computing,
  title={Computing the Fr{\'e}chet distance between two polygonal curves},
  author={Alt, Helmut and Godau, Michael},
  journal={International Journal of Computational Geometry \& Applications},
  volume={5},
  number={01n02},
  pages={75--91},
  year={1995},
  publisher={World Scientific}
}

%34
@article{agarwal2014computing,
  title={Computing the discrete Fr{\'e}chet distance in subquadratic time},
  author={Agarwal, Pankaj K and Avraham, Rinat Ben and Kaplan, Haim and Sharir, Micha},
  journal={SIAM Journal on Computing},
  volume={43},
  number={2},
  pages={429--449},
  year={2014},
  publisher={SIAM}
}

%35
@article{rabiner1993fundamentals,
  title={Fundamentals of speech recognition},
  author={Rabiner, Lawrence R and Juang, Biing-Hwang},
  year={1993},
  publisher={PTR Prentice Hall}
}

%36
@article{durbin1998biological,
  title={Biological sequence analysis: probabilistic models of proteins and nucleic acids},
  author={Durbin, Richard and Eddy, Sean R and Krogh, Anders and Mitchison, Graeme},
  year={1998},
  publisher={Cambridge university press}
}

%37
@article{ranu2015indexing,
  title={Indexing and matching trajectories under inconsistent sampling rates},
  author={Ranu, Sayan and Deepak, P and Telang, Aditya D and Deshpande, Prasad and Raghavan, Sriram},
  booktitle={Data Engineering (ICDE), 2015 IEEE 31st International Conference on},
  pages={999--1010},
  year={2015},
  organization={IEEE}
}

license_type: permissive

branch_name: refs/heads/master

extension: bib


text:
SUMMARY = "Web Platform for Embedded Framework"
HOMEPAGE = "https://github.com/rdkcentral"
SECTION = "wpe"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f1dffbfd5c2eb52e0302eb6296cc3711"
PR = "r0"

require include/wpeframework.inc

# FIXME the compositor shares flags across wpeframework and wpeframework-plugins. Not sure if this is a good idea...
include include/compositor.inc

DEPENDS = " \
    zlib wpeframework-tools-native virtual/egl \
    ${@bb.utils.contains('DISTRO_FEATURES', 'compositor', '${WPE_COMPOSITOR_DEP}', '', d)} \
"

DEPENDS_append_libc-musl = " libexecinfo"

PV = "3.0+git${SRCPV}"

SRC_URI = "git://github.com/rdkcentral/Thunder.git;protocol=git;branch=master \
           file://wpeframework-init \
           file://wpeframework.service.in \
           "
# Revision hash of R1 release
SRCREV = "7769b6b10c33627221efae7cf249caed798c73fb"

inherit cmake pkgconfig systemd update-rc.d

WPEFRAMEWORK_SYSTEM_PREFIX = "OE"
WPE_CDMI_ADAPTER_IMPL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'nexus_svp', 'opencdmi_brcm_svp', 'opencdm_gst', d)}"

PACKAGECONFIG ?= " \
    release \
    ${@bb.utils.contains('MACHINE_FEATURES', 'bluetooth', 'bluetooth', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opencdm', 'opencdm ${WPE_CDMI_ADAPTER_IMPL}', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'provisioning', 'provisionproxy', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'security', 'securityagent', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'playready_nexus_svp', 'opencdmi_prnx_svp', '', d)} \
    virtualinput websource webkitbrowser \
    "

# add compositor client if Wayland is present
PACKAGECONFIG_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'compositor', 'compositorclient', '', d)}"

# Buildtype
# Maybe we need to couple this to a Yocto feature
PACKAGECONFIG[debug]          = "-DBUILD_TYPE=Debug,,"
PACKAGECONFIG[debugoptimized] = "-DBUILD_TYPE=DebugOptimized,,"
PACKAGECONFIG[releasesymbols] = "-DBUILD_TYPE=ReleaseSymbols,,"
PACKAGECONFIG[release]        = "-DBUILD_TYPE=Release,,"
PACKAGECONFIG[production]     = "-DBUILD_TYPE=Production,,"

PACKAGECONFIG[bluetooth]        = "-DBLUETOOTH=ON,-DBLUETOOTH=OFF,bluez5"
PACKAGECONFIG[compositorclient] = "-DCOMPOSITORCLIENT=ON,-DCOMPOSITORCLIENT=OFF"
PACKAGECONFIG[cyclicinspector]  = "-DTEST_CYCLICINSPECTOR=ON,-DTEST_CYCLICINSPECTOR=OFF,"
PACKAGECONFIG[provisionproxy]   = "-DPROVISIONPROXY=ON,-DPROVISIONPROXY=OFF,libprovision"
PACKAGECONFIG[securityagent]    = "-DSECURITYAGENT=ON, -DSECURITYAGENT=OFF"
PACKAGECONFIG[testloader]       = "-DTEST_LOADER=ON,-DTEST_LOADER=OFF,"
PACKAGECONFIG[virtualinput]     = "-DVIRTUALINPUT=ON,-DVIRTUALINPUT=OFF,"

# OCDM
PACKAGECONFIG[opencdm]          = "-DCDMI=ON,-DCDMI=OFF,"
PACKAGECONFIG[opencdm_gst]      = '-DCDMI_ADAPTER_IMPLEMENTATION="gstreamer",,gstreamer1.0'
PACKAGECONFIG[opencdmi_brcm_svp]= '-DCDMI_BCM_NEXUS_SVP=ON -DCDMI_ADAPTER_IMPLEMENTATION="broadcom-svp",,gstreamer-plugins-soc'

# FIXME
# The WPEFramework also needs limited Plugin info in order to determine what to put in the "resumes" configuration
# it feels a bit the other way around but lets set at least webserver and webkit
PACKAGECONFIG[websource]       = "-DPLUGIN_WEBSERVER=ON,,"
PACKAGECONFIG[webkitbrowser]   = "-DPLUGIN_WEBKITBROWSER=ON,,"

# FIXME, determine this a little smarter
# Provision event is required for libprovision and provision plugin
# Network is provided by the Network control plugin
# Location event is required for locationsync plugin
# Time event is required for timesync plugin
# Identifier event is required for Compositor plugin
# Internet event is provided by the LocationSync plugin
# WebSource event is provided by the WebServer plugin

# Only enable certain events if wpeframework is in distro features
WPEFRAMEWORK_DIST_EVENTS ?= "${@bb.utils.contains('DISTRO_FEATURES', 'thunder', 'Network Time', '', d)}"

WPEFRAMEWORK_EXTERN_EVENTS ?= " \
    ${@bb.utils.contains('PACKAGECONFIG', 'opencdm', 'Decryption', '', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'provisionproxy', 'Provisioning', '', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'websource', 'WebSource', '', d)} \
    ${@bb.utils.contains('PACKAGECONFIG', 'securityagent', 'Security', '', d)} \
    ${WPEFRAMEWORK_DIST_EVENTS} \
    Location Internet"

def getlayerrevision(d):
    topdir = d.getVar('TOPDIR', d)

    layers = (d.getVar("BBLAYERS", d) or "").split()
    for layer in layers:
        my_layer = layer.split('/')[-1]
        if my_layer == 'meta-wpe':
            return base_get_metadata_git_revision(layer, None)

    return "unknown"

WPE_LAYER_REV = "${@getlayerrevision(d)}"

EXTRA_OECMAKE += " \
    -DINSTALL_HEADERS_TO_TARGET=ON \
    -DEXTERN_EVENTS="${WPEFRAMEWORK_EXTERN_EVENTS}" \
    -DBUILD_SHARED_LIBS=ON \
    -DRPC=ON \
    -DBUILD_REFERENCE=${SRCREV} \
    -DTREE_REFERENCE=${WPE_LAYER_REV} \
    -DPERSISTENT_PATH=${WPEFRAMEWORK_PERSISTENT_PATH} \
    -DSYSTEM_PREFIX=${WPEFRAMEWORK_SYSTEM_PREFIX} \
    -DPLUGIN_COMPOSITOR_IMPLEMENTATION=${WPE_COMPOSITOR_IMPL} \
    -DPLUGIN_COMPOSITOR_SUB_IMPLEMENTATION=${WPE_COMPOSITOR_SUB_IMPL} \
    -DPYTHON_EXECUTABLE=${STAGING_BINDIR_NATIVE}/python3-native/python3 \
"

do_install_append() {
    if ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "true", "false", d)}
    then
        if ${@bb.utils.contains("MACHINE_FEATURES", "platformserver", "true", "false", d)}
        then
           extra_after=""
        elif ${@bb.utils.contains("PREFERRED_PROVIDER_virtual/egl", "broadcom-refsw", "true", "false", d)}
        then
           extra_after="nxserver.service"
        fi
        extra_after="${extra_after} ${WAYLAND_COMPOSITOR}"
        install -d ${D}${systemd_unitdir}/system
        sed -e "s|@EXTRA_AFTER@|${extra_after}|g" < ${WORKDIR}/wpeframework.service.in > ${D}${systemd_unitdir}/system/wpeframework.service
    else
        install -d ${D}${sysconfdir}/init.d
        install -m 0755 ${WORKDIR}/wpeframework-init ${D}${sysconfdir}/init.d/wpeframework
    fi

    if ${@bb.utils.contains("PACKAGECONFIG", "opencdm", "true", "false", d)}
    then
        install -m 0644 ${D}${includedir}/WPEFramework/interfaces/IDRM.h ${D}${includedir}/cdmi.h
    fi
}

SYSTEMD_SERVICE_${PN} = "wpeframework.service"

# ----------------------------------------------------------------------------

PACKAGES =+ "${PN}-initscript"

FILES_${PN}-initscript = "${sysconfdir}/init.d/wpeframework"

FILES_SOLIBSDEV = ""
FILES_${PN} += "${libdir}/*.so ${datadir}/WPEFramework/* ${PKG_CONFIG_DIR}/*.pc"
FILES_${PN} += "${includedir}/cdmi.h"
FILES_${PN}-dev += "${libdir}/cmake/*"

# ----------------------------------------------------------------------------

INITSCRIPT_PACKAGES = "${PN}-initscript"
INITSCRIPT_NAME_${PN}-initscript = "wpeframework"

# If WPE Framework is enabled as distro feature, start earlier. Assuming packagegroup-wpe-boot is used and we're in control for the network
WPEFRAMEWORK_START = "${@bb.utils.contains('DISTRO_FEATURES', 'wpeframework', '40', '80', d)}"

INITSCRIPT_PARAMS_${PN}-initscript = "defaults ${WPEFRAMEWORK_START} 24"

RRECOMMENDS_${PN} = "${PN}-initscript"

# ----------------------------------------------------------------------------

INSANE_SKIP_${PN} += "dev-so"
INSANE_SKIP_${PN}-dbg += "dev-so"

# ----------------------------------------------------------------------------

RDEPENDS_${PN}_rpi = "userland"

# Avoid settings ADNEEDED in LDFLAGS as this can cause the libcompositor.so to drop linking to libEGL/libGLES
# which might not be needed at first glance but will cause problems higher up in the change, there for lets drop -Wl,--as-needed
# some distros, like POKY (morty) enable --as-needed by default (e.g. https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/conf/distro/include/as-needed.inc?h=morty)
ASNEEDED = ""

license: MIT

repository: wouterlucas/meta-wpe

repo_name: wouterlucas/meta-wpe

gha_license_id: NOASSERTION

extension: bb


text:
const parseNodeArgs = require("parse-node-args");
const details = require("../package.json");
const MarkoDevTools = require("./util/MarkoDevTools");
const markoTest = require(".");

exports.parse = function parse(argv) {
  const { cliArgs, nodeArgs } = parseNodeArgs(argv);
  const options = require("argly")
    .createParser({
      "--help": {
        type: "string",
        description: "Show this help message"
      },
      "--server": {
        type: "boolean",
        description: "Run only server tests"
      },
      "--debug": {
        type: "boolean",
        description:
          "Does not shutdown the test server and disables headless mode for browser tests"
      },
      "--browser": {
        type: "boolean",
        description: "Run only browser tests"
      },
      "--files --file -f *": {
        type: "string[]",
        description: "File patterns to match tests to run"
      },
      "--version -v": {
        type: "boolean",
        descrption: `print ${details.name} version`
      }
      // TODO: Add `--test-template-path` option, which should ultimately map to
      // the `pageTemplate` option in the browser tests runner.
    })
    .usage("Usage: $0 [options]")
    .example("Run all tests", "$0")
    .example(
      "Run all tests for a single component",
      "marko test ./src/components/app-foo/**/test*.js"
    )
    .example(
      "Run all UI component tests",
      "marko test ./src/components/**/test*.js"
    )
    .example(
      "Run only server tests",
      "marko test ./src/components/**/test*server.js --server"
    )
    .example(
      "Run only browser tests",
      "marko test ./src/components/**/test*browser.js --browser"
    )
    .validate(function(result) {
      if (result.version) {
        console.log(`v${details.version}`);
        process.exit(0);
      }

      if (result.help) {
        this.printUsage();
        process.exit(0);
      }
    })
    .onError(function(err) {
      this.printUsage();
      console.error(err);
      process.exit(1);
    })
    .parse(cliArgs);

  options.patterns = options.files;
  options.nodeArgs = nodeArgs;
  delete options.files;

  return options;
};

exports.run = function run(options) {
  const markoCli = new MarkoDevTools();
  const {
    mochaOptions,
    lassoOptions,
    wdioOptions,
    testMatcher,
    workDir,
    browserTestDependencies
  } = markoCli.config;

  return markoTest.run(
    Object.assign(
      {
        mochaOptions,
        lassoOptions,
        wdioOptions,
        testMatcher,
        workDir,
        browserTestDependencies,
        dir: markoCli.cwd,
        cliRoot: markoCli.__dirname
      },
      options
    )
  );
};

repository: ednihs-yahska/cli

repo_name: ednihs-yahska/cli

branch_name: refs/heads/main

extension: js


text:
DESCRIPTION = "RPC program number mapper."
SECTION = "console/network"
LICENSE = "GPL"
PR = "r2"
COMPATIBLE_MACHINE = "nslu2"

SRC_URI = "${DEBIAN_MIRROR}/main/p/portmap/portmap_5.orig.tar.gz \
	${DEBIAN_MIRROR}/main/p/portmap/portmap_${PV}.diff.gz;patch=1 \
	file://no-libwrap.patch;patch=1;pnum=0 \
	file://portmap.init \
	file://make.patch;patch=1"
S = "${WORKDIR}/portmap_5beta"

sbindir = "/sbin"

do_compile() {
	oe_runmake
}

do_install() {
	oe_runmake 'docdir=${datadir}/doc/portmap' 'DESTDIR=${D}' install
}


text:
/*
Copyright 2020 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
	"fmt"
	"io"
	"sort"
	"text/tabwriter"

	"golang.org/x/mod/modfile"
	"k8s.io/kubeadm/k8s-repo-tools/pkg"
)

const golangPath = "Golang"

func process(d *pkg.Data) (*output, error) {
	dataSource, err := pkg.ReadFromFileOrURL(d.Source, d.Timeout)
	if err != nil {
		return nil, err
	}
	dataDest, err := pkg.ReadFromFileOrURL(d.Dest, d.Timeout)
	if err != nil {
		return nil, err
	}
	return processBytes(dataSource, dataDest, d.IgnorePaths)
}

func processBytes(dataSource, dataDest []byte, ignorePaths []string) (*output, error) {
	m := pathVersionTuple{}

	// Parse the source data.
	modFileSource, err := modfile.Parse("", []byte(dataSource), nil)
	if err != nil {
		return nil, err
	}

	for _, r := range modFileSource.Require {
		if r.Indirect {
			continue // Skip indirect dependencies.
		}
		for _, ip := range ignorePaths {
			if r.Mod.Path == ip {
				goto skip // Skip paths that are ignored.
			}
		}
		m[r.Mod.Path] = &versionTuple{Source: r.Mod.Version}
	skip:
	}

	// Parse the destination data.
	modFileDest, err := modfile.Parse("", []byte(dataDest), nil)
	if err != nil {
		return nil, err
	}

	for _, r := range modFileDest.Require {
		if r.Indirect {
			continue // Skip indirect dependencies.
		}
		if _, ok := m[r.Mod.Path]; !ok {
			continue
		}
		m[r.Mod.Path].Dest = r.Mod.Version
	}

	// Add Golang to the dependency list.
	var skipGolang bool
	for _, ip := range ignorePaths {
		if ip == golangPath {
			skipGolang = true
			break
		}
	}
	if !skipGolang {
		m[golangPath] = &versionTuple{
			Source: modFileSource.Go.Version,
			Dest:   modFileDest.Go.Version,
		}
	}

	// Format output.
	o := &output{
		Dependencies: m,
	}
	return o, nil
}

type output struct {
	Dependencies pathVersionTuple `json:"dependencies"`
}

type versionTuple struct {
	Source string `json:"source"`
	Dest   string `json:"dest"`
}

type pathVersionTuple map[string]*versionTuple

func formatOutput(w io.Writer, o *output, source, dest string) {
	var header = fmt.Sprintf("Comparing Go module files:\n  Source: %s\n  Destination: %s\n"+
		"The following dependency versions differ:", source, dest)
	var hasHeader bool
	var tabW *tabwriter.Writer

	// Store the Dependencies map keys and sort them.
	keys := make([]string, len(o.Dependencies))
	var i int
	for k := range o.Dependencies {
		keys[i] = k
		i++
	}
	sort.Strings(keys)

	// Loop trough the keys.
	for _, k := range keys {
		v := o.Dependencies[k]

		// If the destination version is empty, dest does not have this dependency.
		if v.Dest == "" || v.Source == v.Dest {
			continue
		}
		if !hasHeader {
			fmt.Fprintln(w, header)
			tabW = tabwriter.NewWriter(w, 12, 0, 2, ' ', 0)
			fmt.Fprintln(tabW, "PATH\tSOURCE\tDEST")
			hasHeader = true
		}
		fmt.Fprintf(tabW, "%s\t%s\t%s\n", k, v.Source, v.Dest)
	}

	if tabW != nil {
		tabW.Flush()
	}
}

gha_language: Go

extension: go


text:
package targets

import (
	"archive/tar"
	"archive/zip"
	"bytes"
	"compress/gzip"
	"fmt"
	"io"
	"log"
	"net/http"
	"net/url"
	"os"
	"os/exec"
	"path"
	"runtime"
	"strings"
	"sync"
	"syscall"
	"text/template"
	"time"
)

type Target func(TargetOptions) error

type TargetOptions struct {
	ScrapeTarget    string
	ReceiveEndpoint string
	Timeout         time.Duration
}

var downloadMtx sync.Mutex

func downloadBinary(urlPattern string, filenameInArchivePattern string) (string, error) {
	downloadMtx.Lock()
	defer downloadMtx.Unlock()
	return downloadBinaryUnlocked(urlPattern, filenameInArchivePattern)
}

func downloadBinaryUnlocked(urlPattern string, filenameInArchivePattern string) (string, error) {
	urlToDownload, err := instantiateTemplate(urlPattern)
	if err != nil {
		return "", nil
	}

	filenameInArchive, err := instantiateTemplate(filenameInArchivePattern)
	if err != nil {
		return "", nil
	}

	parsed, err := url.Parse(urlToDownload)
	if err != nil {
		return "", nil
	}

	cwd, err := os.Getwd()
	if err != nil {
		return "", err
	}

	filename := path.Join(cwd, "bin", path.Base(parsed.Path))
	decompressTgz := strings.HasSuffix(filename, ".tar.gz")
	if decompressTgz {
		filename = strings.TrimSuffix(filename, ".tar.gz")
	}

	decompressZip := strings.HasSuffix(filename, ".zip")
	if decompressZip {
		filename = strings.TrimSuffix(filename, ".zip")
	}

	// If we've already downloaded it, then skip.
	if _, err := os.Stat(filename); !os.IsNotExist(err) {
		return filename, nil
	}

	tempfile, err := downloadURL(urlToDownload)
	if err != nil {
		return "", nil
	}

	if err := os.Mkdir(path.Dir(filename), 0o755); err != nil && !os.IsExist(err) {
		return "", nil
	}

	if decompressTgz {
		if err := extractTarGz(tempfile, filenameInArchive, filename); err != nil {
			return "", err
		}
	} else if decompressZip {
		if err := extractZip(tempfile, filenameInArchive, filename); err != nil {
			return "", err
		}
	} else {
		if err := os.Rename(tempfile, filename); err != nil {
			return "", err
		}
	}

	if err := os.Chmod(filename, 0o744); err != nil {
		return "", err
	}

	return filename, nil
}

func instantiateTemplate(pattern string) (string, error) {
	t := template.Must(template.New("url").Parse(pattern))
	var buf bytes.Buffer
	err := t.Execute(&buf, map[string]interface{}{
		"OS":   runtime.GOOS,
		"Arch": runtime.GOARCH,
	})
	return buf.String(), err
}

func downloadURL(url string) (filename string, err error) {
	fmt.Println("Downloading", url)

	tempfile, err := os.CreateTemp("", "")
	if err != nil {
		return "", err
	}
	defer tempfile.Close()

	resp, err := http.Get(url)
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()

	if resp.StatusCode != 200 {
		return "", fmt.Errorf("error downloading: %d", resp.StatusCode)
	}

	if _, err := io.Copy(tempfile, resp.Body); err != nil {
		return "", err
	}

	return tempfile.Name(), nil
}

func extractZip(srcFile, filename, destFile string) error {
	fmt.Println("Decompressing", srcFile)

	r, err := zip.OpenReader(srcFile)
	if err != nil {
		return err
	}
	defer r.Close()

	for _, f := range r.File {
		if path.Base(f.Name) != filename {
			continue
		}

		fmt.Println("Extracting", f.Name)

		src, err := f.Open()
		if err != nil {
			return err
		}
		defer src.Close()

		dest, err := os.Create(destFile)
		if err != nil {
			return err
		}
		defer dest.Close()

		_, err = io.Copy(dest, src)
		return err
	}

	return fmt.Errorf("did not find binary in .zip: %s", filename)
}

func extractTarGz(srcFile, filename, destFile string) error {
	fmt.Println("Decompressing", srcFile)

	f, err := os.Open(srcFile)
	if err != nil {
		return err
	}
	defer f.Close()

	gzf, err := gzip.NewReader(f)
	if err != nil {
		return err
	}
	defer gzf.Close()

	tarReader := tar.NewReader(gzf)
	for {
		header, err := tarReader.Next()
		if err == io.EOF {
			break
		}
		if err != nil {
			return err
		}

		if header.Typeflag != tar.TypeReg {
			continue
		}

		if path.Base(header.Name) != filename {
			continue
		}

		fmt.Println("Extracting", header.Name)

		dest, err := os.Create(destFile)
		if err != nil {
			return err
		}
		defer dest.Close()

		if _, err := io.Copy(dest, tarReader); err != nil {
			return err
		}

		return nil
	}

	return fmt.Errorf("did not find binary in .tar.gz: %s", filename)
}

func writeTempFile(contents, name string) (filename string, err error) {
	f, err := os.CreateTemp("", name)
	if err != nil {
		return "", err
	}

	_, err = f.Write([]byte(contents))
	if err != nil {
		return "", err
	}

	return f.Name(), f.Close()
}

// runCommand runs the given command with the given args in a temporary working
// directory and connecting that processes stdin/stdout to stdin/stdout.
// After timeout seconds, it send SIGINT to the process to shut it down and
// returns an error if the process exits with non-zero status code.
func runCommand(prog string, timeout time.Duration, args ...string) error {
	cwd, err := os.MkdirTemp("", "")
	if err != nil {
		return err
	}
	defer os.RemoveAll(cwd)

	var output *os.File
	if true {
		output, err = os.CreateTemp("", "")
		if err != nil {
			return err
		}
		defer output.Close()
		defer os.Remove(output.Name())
	} else {
		output = os.Stdout
	}

	cmd := exec.Command(prog, args...)
	cmd.Dir = cwd
	cmd.Stdout = output
	cmd.Stderr = output
	err = cmd.Start()
	if err != nil {
		return err
	}

	go func() {
		time.Sleep(timeout)
		if err := cmd.Process.Signal(syscall.SIGINT); err != nil {
			log.Fatalf("failed to send signal: %v", err)
		}
	}()

	return cmd.Wait()
}


text:
@inproceedings{corena2014userstorage,
 address = {Singapore},
 author = {Corena, Juan Camilo and Basu, Anirban and Nakano, Yuto and Kiyomoto, Shinsaku and Miyake, Yutaka},
 booktitle = {Poster in the IEEE Cloudcom},
 title = {Data storage on the cloud under user control},
 year = {2014}
}

gha_language: TeX


text:
//Copyright (c) 2011 Brian Ketelsen

//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 main

import "rpc"
import "os"
import "net"
import "log"
import "http"
import "skylib"
import "flag"
import "time"
import "fmt"
import "myStartup"

const sName = "GetUserDataService.GetUserData"

type GetUserDataService struct {
	Version int
}

func NewGetUserDataService() *GetUserDataService {

	r := &GetUserDataService{
		Version: 1,
	}
	return r
}

func (ls *GetUserDataService) GetUserData(cr *myStartup.GetUserDataRequest, lr *myStartup.GetUserDataResponse) (err os.Error) {
	result := make (chan string)
	timeout := make(chan bool)

	//This function produces the actual result
	go func() {
		time.Sleep(1e8) // force the fail
		result <- " was here"
	}()

	go func(){
		time.Sleep(1e9)
		timeout <- true
	}()

	select {
	case retVal := <-result:
			lr.YourOutputValue = cr.YourInputValue + retVal
	case <- timeout:
		lr.Errors = append(lr.Errors, "Service Timeout")
	}

	skylib.Requests.Add(1)
	return nil
}

func main() {

	// Pull in command line options or defaults if none given
	flag.Parse()

	f, err := os.OpenFile(*skylib.LogFileName, os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666)
	if err == nil {
		defer f.Close()
		log.SetOutput(f)
	}

	skylib.Setup(sName)

	r := NewGetUserDataService()

	rpc.Register(r)

	rpc.HandleHTTP()

	portString := fmt.Sprintf("%s:%d", *skylib.BindIP, *skylib.Port)

	l, e := net.Listen("tcp", portString)
	if e != nil {
		log.Fatal("listen error:", e)
	}

	log.Println("Starting server")
	http.Serve(l, nil)

}


text:
require libx11.inc
DEPENDS = "${COMMON_DEPENDS}"
PR = "${INC_PR}.2"

SRC_URI += " file://configure.ac-nios2.patch"
SRC_URI[archive.md5sum] = "d1512d65dadd4f48c779d4749e7753a8"
SRC_URI[archive.sha256sum] = "da9272900e41615e9c5dc25d84730b8966da6f5c8f4c40418dca2ad040fc8b82"

EXTRA_OECONF += " --without-xcb"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
@conference{PlancherTinyMLedu2022,
	author = {Plancher, Brian and Janapa Reddi, Vijay},
	title = {TinyMLedu: The Tiny Machine Learning Open Education Initiative},
	year = {2022},
	isbn = {9781450390712},
	publisher = {Association for Computing Machinery},
	address = {New York, NY, USA},
	doi = {10.1145/3478432.3499093},
	booktitle = {Proceedings of the 53rd ACM Technical Symposium on Computer Science Education},
	pages = {1159},
	numpages = {1},
	location = {Providence, RI, USA},
	series = {SIGCSE 2022}
}


text:
#
# This file is the performance-tests recipe.
#

SUMMARY = "Simple performance-tests application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://drive-test.sh \
      file://network-test.sh \
      file://sd-test.sh \
        "

S = "${WORKDIR}"

do_install() {
        install -d ${D}/home/root
        install -m 0755 ${S}/drive-test.sh ${D}/home/root
        install -m 0755 ${S}/network-test.sh ${D}/home/root
        install -m 0755 ${S}/sd-test.sh ${D}/home/root
}

FILES_${PN} += "/home/root/drive-test.sh \
           /home/root/network-test.sh \
           /home/root/sd-test.sh \
               "

repository: ubfx/meta-avnet

repo_name: ubfx/meta-avnet


text:
@InProceedings{yun12,
  title = {Quilting Stochastic Kronecker Product Graphs to Generate Multiplicative Attribute Graphs},
  author = {Hyokun Yun and S V N Vishwanathan},
  pages = {1389--1397},
  abstract = {We describe the first sub-quadratic sampling algorithm for Multiplicative Attribute Graph Model (MAGM) of Kim and Leskovec (2010). We exploit the close connection between MAGM and the Kronecker Product Graph Model (KPGM) of Leskovec et al. (2010), and show that to sample a graph from a MAGM it suffices to sample small number of KPGM graphs and quilt them together. Under a restricted set of technical conditions, our algorithm runs in O((\log_2(n))^3 |E|) time, where n is the number of nodes and |E| is the number of edges in the sampled graph. We demonstrate the scalability of our algorithm via extensive empirical evaluation; we can sample a MAGM graph with 8  million nodes and 20 billion edges in under 6 hours.},
  pdf = {http://jmlr.org/proceedings/papers/v22/yun12/yun12.pdf},
  supplementary = {Supplementary:http://jmlr.org/proceedings/papers/v22/yun12/yun12Supple.pdf},
}

repository: mreid/papersite

repo_name: mreid/papersite


text:
package main

import (
	"github.com/just1689/pyrate-server/db"
	"github.com/just1689/pyrate-server/maps"
	"github.com/just1689/pyrate-server/model"
	"github.com/sirupsen/logrus"
	"sync"
	"sync/atomic"
	"time"
)

const workers = 64

var ops uint64
var rowsWritten uint64

var wStop []chan bool

var mapWidth = 5000
var mapHeight = 5000
var chunkDiff = 50

func main() {
	start := time.Now()

	//Figure out when all work is done
	var wg sync.WaitGroup

	c := model.GenerateWaterChunks(0, mapWidth, 0, mapHeight, chunkDiff)

	//Start workers go generate chunks
	wg.Add(1)
	go func() {
		for i := 0; i < workers; i++ {

			//Run worker in go routine
			startWorker(c, &wg)

			//Give the DB some breathing room
			time.Sleep(10 * time.Millisecond)
		}
		wg.Done()
	}()

	wg.Wait()

	//Stop the DB writers
	for _, c := range wStop {
		c <- true
		close(c)
	}

	logrus.Infoln("Took: ", time.Since(start), "to write", atomic.AddUint64(&rowsWritten, 0), "rows")

}

func startWorker(in chan model.Chunk, wg *sync.WaitGroup) {
	wg.Add(1)
	conn, err := db.Connect()
	if err != nil {
		logrus.Fatalln(err)
	}
	go func() {
		for chunk := range in {
			wg.Add(1)
			chunkID := atomic.AddUint64(&ops, 1)
			start := time.Now()
			ct := maps.RandomizeChunckType()
			maps.GenerateChunk(chunk, ct)
			chunk.InsertUsingCopy(conn)
			logrus.Infoln("Inserted chunk", chunkID, "took", time.Since(start), "(", ct, ")")
			wg.Done()
			atomic.AddUint64(&rowsWritten, uint64(len(chunk)))
		}
		conn.Close()
		wg.Done()
	}()

}


text:
require swupdate.inc

DEFAULT_PREFERENCE = "-1"

SRCREV ?= "e0684ea4f491e4b87d5c0ce1c1418005b4158cb2"
PV = "2020.11+git${SRCPV}"


text:
package routers

import (
	"go-demos/taskmanager/controllers"
	"go-demos/taskmanager/utils"
	"net/http"
	"os"

	"github.com/gorilla/handlers"
	"github.com/gorilla/mux"
	"github.com/justinas/alice"
)

// handlers.AllowedOrigins([]string{"http://localhost:3002"})
func corsHandler(next http.Handler) http.Handler {
	return handlers.CORS()(next)
}

func loggingHandler(next http.Handler) http.Handler {
	logFile, err := os.OpenFile("server.log", os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0777)
	if err != nil {
		panic(err)
	}
	return handlers.CombinedLoggingHandler(logFile, next)
}

// recoveryHandler and CompressHandler download .gz --#
func recoveryHandler(next http.Handler) http.Handler {
	return handlers.RecoveryHandler()(next)
}

func MyHandler(next http.HandlerFunc) http.Handler {
	return alice.New(corsHandler, loggingHandler, handlers.CompressHandler).ThenFunc(next)
}

func InitRoutes() *mux.Router {

	r := mux.NewRouter()

	r.NotFoundHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		utils.DisplayAppError(w, "404", http.StatusNotFound)
	})

	r.Handle("/users/register", MyHandler(controllers.Register)).Methods("POST")
	r.Handle("/users/login", MyHandler(controllers.Login)).Methods("POST")

	r.Handle("/tasks", MyHandler(utils.Auth(controllers.GetTasks))).Methods("GET")
	r.Handle("/tasks", MyHandler(utils.Auth(controllers.CreateTask))).Methods("POST")
	r.Handle("/tasks/{id}", MyHandler(utils.Auth(controllers.GetTaskById))).Methods("GET")
	r.Handle("/tasks/{id}", MyHandler(utils.Auth(controllers.UpdateTask))).Methods("PUT")
	r.Handle("/tasks/{id}", MyHandler(utils.Auth(controllers.DeleteTask))).Methods("DELETE")
	r.Handle("/tasks/users/{username}", MyHandler(utils.Auth(controllers.GetTasksByUser))).Methods("GET")

	return r
}

repository: guohaoxu/go-demos

repo_name: guohaoxu/go-demos


text:
@inproceedings{2017-01-0017,

author="Azeem Hafeez and Hafiz Malik and Omid Avatefipour and Prudhvi Raj Rongali and Shan Zehra",

journal="",

publisher="SAE International",

title="Comparative Study of CAN-Bus and FlexRay Protocols for In-Vehicle Communication",

booktitle="SAE Technical Paper",

year="2017",

month="03",

volume="",

url="https://doi.org/10.4271/2017-01-0017",

pages="",

abstract="Technological advances in automotive industry have resulted in an increased number of Electronic Control Units (ECU)s. These ECUs are used for sensing and controlling actuators in the modern vehicles. Various network protocols have been proposed to achieve scalable and reliable communication amonglarge number ECUs in modern vehicles.Various network protocols have been proposed for invehicle communication,such as Controlled Area Network (CAN), Local Interconnected Network (LIN), Media Oriented System Transport (MOST), and FlexRay. This study compares latency and reliability of CAN-Bus and FlexRay communication protocols. The HSC12 microcontroller is used to implement these protocols, and for secure communication data is encrypted.Our experimental results indicate that the CAN-Bus communication protocol is a better option for hard real-time systems and FlexRay protocol is appropriate for deterministic data transmission, e.g., priority-less message communication.",

number="",

doi="10.4271/2017-01-0017"

}

repository: oavatefi/academic-kickstart

repo_name: oavatefi/academic-kickstart


text:
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: cluster.proto

package cluster

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

type GenericResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *GenericResponse) Reset()         { *m = GenericResponse{} }
func (m *GenericResponse) String() string { return proto.CompactTextString(m) }
func (*GenericResponse) ProtoMessage()    {}
func (*GenericResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_3cfb3b8ec240c376, []int{0}
}

func (m *GenericResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_GenericResponse.Unmarshal(m, b)
}
func (m *GenericResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_GenericResponse.Marshal(b, m, deterministic)
}
func (m *GenericResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_GenericResponse.Merge(m, src)
}
func (m *GenericResponse) XXX_Size() int {
	return xxx_messageInfo_GenericResponse.Size(m)
}
func (m *GenericResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_GenericResponse.DiscardUnknown(m)
}

var xxx_messageInfo_GenericResponse proto.InternalMessageInfo

type ClusterListRequest struct {
	Pattern              string   `protobuf:"bytes,1,opt,name=pattern,proto3" json:"pattern,omitempty"`
	Count                int32    `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ClusterListRequest) Reset()         { *m = ClusterListRequest{} }
func (m *ClusterListRequest) String() string { return proto.CompactTextString(m) }
func (*ClusterListRequest) ProtoMessage()    {}
func (*ClusterListRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_3cfb3b8ec240c376, []int{1}
}

func (m *ClusterListRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ClusterListRequest.Unmarshal(m, b)
}
func (m *ClusterListRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ClusterListRequest.Marshal(b, m, deterministic)
}
func (m *ClusterListRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ClusterListRequest.Merge(m, src)
}
func (m *ClusterListRequest) XXX_Size() int {
	return xxx_messageInfo_ClusterListRequest.Size(m)
}
func (m *ClusterListRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_ClusterListRequest.DiscardUnknown(m)
}

var xxx_messageInfo_ClusterListRequest proto.InternalMessageInfo

func (m *ClusterListRequest) GetPattern() string {
	if m != nil {
		return m.Pattern
	}
	return ""
}

func (m *ClusterListRequest) GetCount() int32 {
	if m != nil {
		return m.Count
	}
	return 0
}

type ClusterInfo struct {
	Name                 string   `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ClusterInfo) Reset()         { *m = ClusterInfo{} }
func (m *ClusterInfo) String() string { return proto.CompactTextString(m) }
func (*ClusterInfo) ProtoMessage()    {}
func (*ClusterInfo) Descriptor() ([]byte, []int) {
	return fileDescriptor_3cfb3b8ec240c376, []int{2}
}

func (m *ClusterInfo) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ClusterInfo.Unmarshal(m, b)
}
func (m *ClusterInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ClusterInfo.Marshal(b, m, deterministic)
}
func (m *ClusterInfo) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ClusterInfo.Merge(m, src)
}
func (m *ClusterInfo) XXX_Size() int {
	return xxx_messageInfo_ClusterInfo.Size(m)
}
func (m *ClusterInfo) XXX_DiscardUnknown() {
	xxx_messageInfo_ClusterInfo.DiscardUnknown(m)
}

var xxx_messageInfo_ClusterInfo proto.InternalMessageInfo

func (m *ClusterInfo) GetName() string {
	if m != nil {
		return m.Name
	}
	return ""
}

type ClusterListResponse struct {
	Info                 map[string]*ClusterInfo `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
	XXX_NoUnkeyedLiteral struct{}                `json:"-"`
	XXX_unrecognized     []byte                  `json:"-"`
	XXX_sizecache        int32                   `json:"-"`
}

func (m *ClusterListResponse) Reset()         { *m = ClusterListResponse{} }
func (m *ClusterListResponse) String() string { return proto.CompactTextString(m) }
func (*ClusterListResponse) ProtoMessage()    {}
func (*ClusterListResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_3cfb3b8ec240c376, []int{3}
}

func (m *ClusterListResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ClusterListResponse.Unmarshal(m, b)
}
func (m *ClusterListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ClusterListResponse.Marshal(b, m, deterministic)
}
func (m *ClusterListResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ClusterListResponse.Merge(m, src)
}
func (m *ClusterListResponse) XXX_Size() int {
	return xxx_messageInfo_ClusterListResponse.Size(m)
}
func (m *ClusterListResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_ClusterListResponse.DiscardUnknown(m)
}

var xxx_messageInfo_ClusterListResponse proto.InternalMessageInfo

func (m *ClusterListResponse) GetInfo() map[string]*ClusterInfo {
	if m != nil {
		return m.Info
	}
	return nil
}

type CheckHealthRequest struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *CheckHealthRequest) Reset()         { *m = CheckHealthRequest{} }
func (m *CheckHealthRequest) String() string { return proto.CompactTextString(m) }
func (*CheckHealthRequest) ProtoMessage()    {}
func (*CheckHealthRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_3cfb3b8ec240c376, []int{4}
}

func (m *CheckHealthRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_CheckHealthRequest.Unmarshal(m, b)
}
func (m *CheckHealthRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_CheckHealthRequest.Marshal(b, m, deterministic)
}
func (m *CheckHealthRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CheckHealthRequest.Merge(m, src)
}
func (m *CheckHealthRequest) XXX_Size() int {
	return xxx_messageInfo_CheckHealthRequest.Size(m)
}
func (m *CheckHealthRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_CheckHealthRequest.DiscardUnknown(m)
}

var xxx_messageInfo_CheckHealthRequest proto.InternalMessageInfo

type CheckHealthResponse struct {
	Status               string   `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *CheckHealthResponse) Reset()         { *m = CheckHealthResponse{} }
func (m *CheckHealthResponse) String() string { return proto.CompactTextString(m) }
func (*CheckHealthResponse) ProtoMessage()    {}
func (*CheckHealthResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_3cfb3b8ec240c376, []int{5}
}

func (m *CheckHealthResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_CheckHealthResponse.Unmarshal(m, b)
}
func (m *CheckHealthResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_CheckHealthResponse.Marshal(b, m, deterministic)
}
func (m *CheckHealthResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_CheckHealthResponse.Merge(m, src)
}
func (m *CheckHealthResponse) XXX_Size() int {
	return xxx_messageInfo_CheckHealthResponse.Size(m)
}
func (m *CheckHealthResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_CheckHealthResponse.DiscardUnknown(m)
}

var xxx_messageInfo_CheckHealthResponse proto.InternalMessageInfo

func (m *CheckHealthResponse) GetStatus() string {
	if m != nil {
		return m.Status
	}
	return ""
}

func init() {
	proto.RegisterType((*GenericResponse)(nil), "cluster.GenericResponse")
	proto.RegisterType((*ClusterListRequest)(nil), "cluster.ClusterListRequest")
	proto.RegisterType((*ClusterInfo)(nil), "cluster.ClusterInfo")
	proto.RegisterType((*ClusterListResponse)(nil), "cluster.ClusterListResponse")
	proto.RegisterMapType((map[string]*ClusterInfo)(nil), "cluster.ClusterListResponse.InfoEntry")
	proto.RegisterType((*CheckHealthRequest)(nil), "cluster.CheckHealthRequest")
	proto.RegisterType((*CheckHealthResponse)(nil), "cluster.CheckHealthResponse")
}

func init() { proto.RegisterFile("cluster.proto", fileDescriptor_3cfb3b8ec240c376) }

var fileDescriptor_3cfb3b8ec240c376 = []byte{
	// 301 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0x4d, 0x4b, 0xfb, 0x40,
	0x10, 0xc6, 0xbb, 0x7d, 0xa5, 0x53, 0xfe, 0xfc, 0x75, 0x1a, 0x24, 0x54, 0x0f, 0x71, 0x0f, 0x12,
	0x04, 0x73, 0x88, 0x17, 0xe9, 0xb5, 0x8a, 0x2f, 0xe8, 0x65, 0xbf, 0x41, 0x0c, 0x53, 0x1a, 0x1a,
	0x77, 0x63, 0x76, 0x23, 0xf4, 0xdb, 0xe8, 0x37, 0x95, 0x6c, 0xb6, 0xb5, 0xb5, 0xc5, 0xdb, 0x3e,
	0x93, 0x99, 0xe7, 0xf9, 0xcd, 0x10, 0xf8, 0x97, 0xe6, 0x95, 0x36, 0x54, 0x46, 0x45, 0xa9, 0x8c,
	0xc2, 0x81, 0x93, 0xfc, 0x18, 0xfe, 0xdf, 0x93, 0xa4, 0x32, 0x4b, 0x05, 0xe9, 0x42, 0x49, 0x4d,
	0xfc, 0x16, 0x70, 0xd6, 0x7c, 0x7d, 0xce, 0xb4, 0x11, 0xf4, 0x5e, 0x91, 0x36, 0xe8, 0xc3, 0xa0,
	0x48, 0x8c, 0xa1, 0x52, 0xfa, 0x2c, 0x60, 0xe1, 0x50, 0xac, 0x25, 0x7a, 0xd0, 0x4b, 0x55, 0x25,
	0x8d, 0xdf, 0x0e, 0x58, 0xd8, 0x13, 0x8d, 0xe0, 0xe7, 0x30, 0x72, 0x2e, 0x8f, 0x72, 0xae, 0x10,
	0xa1, 0x2b, 0x93, 0x37, 0x72, 0xb3, 0xf6, 0xcd, 0x3f, 0x19, 0x8c, 0x77, 0x92, 0x1a, 0x00, 0x9c,
	0x42, 0x37, 0x93, 0x73, 0xe5, 0xb3, 0xa0, 0x13, 0x8e, 0xe2, 0x8b, 0x68, 0x8d, 0x7e, 0xa0, 0x37,
	0xaa, 0xcd, 0xef, 0xa4, 0x29, 0x57, 0xc2, 0xce, 0x4c, 0x5e, 0x60, 0xb8, 0x29, 0xe1, 0x11, 0x74,
	0x96, 0xb4, 0x72, 0x99, 0xf5, 0x13, 0x2f, 0xa1, 0xf7, 0x91, 0xe4, 0x15, 0x59, 0xd6, 0x51, 0xec,
	0xfd, 0xf6, 0xae, 0x67, 0x45, 0xd3, 0x32, 0x6d, 0xdf, 0x30, 0xee, 0x01, 0xce, 0x16, 0x94, 0x2e,
	0x1f, 0x28, 0xc9, 0xcd, 0xc2, 0xdd, 0x82, 0x5f, 0xc1, 0x78, 0xa7, 0xea, 0xb8, 0x4f, 0xa0, 0xaf,
	0x4d, 0x62, 0x2a, 0xed, 0x12, 0x9d, 0x8a, 0xbf, 0x18, 0x0c, 0x9c, 0x3f, 0x3e, 0x6d, 0xce, 0x52,
	0xaf, 0x81, 0xa7, 0x87, 0x97, 0xb3, 0x31, 0x93, 0xb3, 0xbf, 0x36, 0xe7, 0x2d, 0xeb, 0xf5, 0x83,
	0xb1, 0xed, 0xb5, 0x87, 0xbc, 0xed, 0xb5, 0x4f, 0xce, 0x5b, 0xaf, 0x7d, 0xfb, 0x5f, 0x5c, 0x7f,
	0x07, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x41, 0x6a, 0x46, 0x28, 0x02, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// ClusterClient is the client API for Cluster service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ClusterClient interface {
	ClusterList(ctx context.Context, in *ClusterListRequest, opts ...grpc.CallOption) (*ClusterListResponse, error)
	CheckHealth(ctx context.Context, in *CheckHealthRequest, opts ...grpc.CallOption) (*CheckHealthResponse, error)
}

type clusterClient struct {
	cc *grpc.ClientConn
}

func NewClusterClient(cc *grpc.ClientConn) ClusterClient {
	return &clusterClient{cc}
}

func (c *clusterClient) ClusterList(ctx context.Context, in *ClusterListRequest, opts ...grpc.CallOption) (*ClusterListResponse, error) {
	out := new(ClusterListResponse)
	err := c.cc.Invoke(ctx, "/cluster.Cluster/ClusterList", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *clusterClient) CheckHealth(ctx context.Context, in *CheckHealthRequest, opts ...grpc.CallOption) (*CheckHealthResponse, error) {
	out := new(CheckHealthResponse)
	err := c.cc.Invoke(ctx, "/cluster.Cluster/CheckHealth", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ClusterServer is the server API for Cluster service.
type ClusterServer interface {
	ClusterList(context.Context, *ClusterListRequest) (*ClusterListResponse, error)
	CheckHealth(context.Context, *CheckHealthRequest) (*CheckHealthResponse, error)
}

// UnimplementedClusterServer can be embedded to have forward compatible implementations.
type UnimplementedClusterServer struct {
}

func (*UnimplementedClusterServer) ClusterList(ctx context.Context, req *ClusterListRequest) (*ClusterListResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ClusterList not implemented")
}
func (*UnimplementedClusterServer) CheckHealth(ctx context.Context, req *CheckHealthRequest) (*CheckHealthResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CheckHealth not implemented")
}

func RegisterClusterServer(s *grpc.Server, srv ClusterServer) {
	s.RegisterService(&_Cluster_serviceDesc, srv)
}

func _Cluster_ClusterList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ClusterListRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ClusterServer).ClusterList(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/cluster.Cluster/ClusterList",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ClusterServer).ClusterList(ctx, req.(*ClusterListRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Cluster_CheckHealth_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CheckHealthRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ClusterServer).CheckHealth(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/cluster.Cluster/CheckHealth",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ClusterServer).CheckHealth(ctx, req.(*CheckHealthRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Cluster_serviceDesc = grpc.ServiceDesc{
	ServiceName: "cluster.Cluster",
	HandlerType: (*ClusterServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ClusterList",
			Handler:    _Cluster_ClusterList_Handler,
		},
		{
			MethodName: "CheckHealth",
			Handler:    _Cluster_CheckHealth_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cluster.proto",
}

repository: continuul/edgefs-csi

repo_name: continuul/edgefs-csi


text:
//
// media.go
// Copyright 2017 Konstantin Dovnar
//
// Licensed under the Apache License, Version 2.0 (the "License");
// http://www.apache.org/licenses/LICENSE-2.0
//

package instagram

import (
	"strconv"
	"encoding/json"
)

// TypeImage is a string that define image type for media.
const TypeImage = "image"

// TypeVideo is a string that define video type for media.
const TypeVideo = "video"

// TypeCarousel is a string that define carousel (collection of media) type for media.
const TypeCarousel = "carousel"

const (
	graphVideo   = "GraphVideo"
	graphSidecar = "GraphSidecar"

	video    = "video"
	carousel = "carousel"
)

// A Media describes an Instagram media info.
type Media struct {
	Caption       string
	Code          string
	CommentsCount uint32
	Date          uint64
	ID            string
	AD            bool
	LikesCount    uint32
	Type          string
	MediaURL      string
	Owner         Account
	MediaList     []mediaItem
}

type mediaItem struct {
	Type string
	URL  string
	Code string
}

// Update try to update media data
func (m *Media) Update() error {
	media, err := GetMediaByCode(m.Code)
	if err != nil {
		return err
	}
	*m = media
	return nil
}

func getFromMediaPage(data []byte) (Media, error) {
	var mediaJSON struct {
		Graphql struct {
			ShortcodeMedia struct {
				Typename   string `json:"__typename"`
				ID         string `json:"id"`
				Shortcode  string `json:"shortcode"`
				DisplayURL string `json:"display_url"`
				VideoURL   string `json:"video_url"`
				IsVideo    bool `json:"is_video"`
				EdgeMediaToCaption struct {
					Edges []struct {
						Node struct {
							Text string `json:"text"`
						} `json:"node"`
					} `json:"edges"`
				} `json:"edge_media_to_caption"`
				EdgeMediaToComment struct {
					Count int `json:"count"`
				} `json:"edge_media_to_comment"`
				TakenAtTimestamp int `json:"taken_at_timestamp"`
				EdgeMediaPreviewLike struct {
					Count int `json:"count"`
				} `json:"edge_media_preview_like"`
				Owner struct {
					ID            string `json:"id"`
					ProfilePicURL string `json:"profile_pic_url"`
					Username      string `json:"username"`
					FullName      string `json:"full_name"`
					IsPrivate     bool `json:"is_private"`
				} `json:"owner"`
				IsAd bool `json:"is_ad"`
				EdgeSidecarToChildren struct {
					Edges []struct {
						Node struct {
							Typename   string `json:"__typename"`
							ID         string `json:"id"`
							Shortcode  string `json:"shortcode"`
							DisplayURL string `json:"display_url"`
							VideoURL   string `json:"video_url"`
							IsVideo    bool `json:"is_video"`
						} `json:"node"`
					} `json:"edges"`
				} `json:"edge_sidecar_to_children"`
			} `json:"shortcode_media"`
		} `json:"graphql"`
	}

	err := json.Unmarshal(data, &mediaJSON)
	if err != nil {
		return Media{}, err
	}

	media := Media{}
	media.Code = mediaJSON.Graphql.ShortcodeMedia.Shortcode
	media.ID = mediaJSON.Graphql.ShortcodeMedia.ID
	media.AD = mediaJSON.Graphql.ShortcodeMedia.IsAd
	media.Date = uint64(mediaJSON.Graphql.ShortcodeMedia.TakenAtTimestamp)
	media.CommentsCount = uint32(mediaJSON.Graphql.ShortcodeMedia.EdgeMediaToComment.Count)
	media.LikesCount = uint32(mediaJSON.Graphql.ShortcodeMedia.EdgeMediaPreviewLike.Count)

	if len(mediaJSON.Graphql.ShortcodeMedia.EdgeMediaToCaption.Edges) > 0 {
		media.Caption = mediaJSON.Graphql.ShortcodeMedia.EdgeMediaToCaption.Edges[0].Node.Text
	}

	var mediaType = mediaJSON.Graphql.ShortcodeMedia.Typename
	if mediaType == graphSidecar {
		for _, itemJSON := range mediaJSON.Graphql.ShortcodeMedia.EdgeSidecarToChildren.Edges {
			var item mediaItem
			item.Code = itemJSON.Node.Shortcode
			if itemJSON.Node.IsVideo {
				item.URL = itemJSON.Node.VideoURL
				item.Type = TypeVideo
			} else {
				item.URL = itemJSON.Node.DisplayURL
				item.Type = TypeImage
			}
			media.MediaList = append(media.MediaList, item)
		}
		media.Type = TypeCarousel
	} else {
		if mediaType == graphVideo {
			media.Type = TypeVideo
			media.MediaURL = mediaJSON.Graphql.ShortcodeMedia.VideoURL
		} else {
			media.Type = TypeImage
			media.MediaURL = mediaJSON.Graphql.ShortcodeMedia.DisplayURL
		}
		var item mediaItem
		item.Code = media.Code
		item.Type = media.Type
		item.URL = media.MediaURL
		media.MediaList = append(media.MediaList, item)
	}

	media.Owner.ID = mediaJSON.Graphql.ShortcodeMedia.Owner.ID
	media.Owner.ProfilePicURL = mediaJSON.Graphql.ShortcodeMedia.Owner.ProfilePicURL
	media.Owner.Username = mediaJSON.Graphql.ShortcodeMedia.Owner.Username
	media.Owner.FullName = mediaJSON.Graphql.ShortcodeMedia.Owner.FullName
	media.Owner.Private = mediaJSON.Graphql.ShortcodeMedia.Owner.IsPrivate

	return media, nil
}

func getFromAccountMediaList(data []byte) (Media, error) {
	var mediaJSON struct {
		ID   string `json:"id"`
		Code string `json:"code"`
		User struct {
			ID             string `json:"id"`
			FullName       string `json:"full_name"`
			ProfilePicture string `json:"profile_picture"`
			Username       string `json:"username"`
		} `json:"user"`
		Images struct {
			StandardResolution struct {
				Width  int `json:"width"`
				Height int `json:"height"`
				URL    string `json:"url"`
			} `json:"standard_resolution"`
		} `json:"images"`
		CreatedTime string `json:"created_time"`
		Caption struct {
			Text string `json:"text"`
		} `json:"caption"`
		Likes struct {
			Count float64 `json:"count"`
		} `json:"likes"`
		Comments struct {
			Count float64 `json:"count"`
		} `json:"comments"`
		Type string `json:"type"`
		Videos struct {
			StandardResolution struct {
				Width  int `json:"width"`
				Height int `json:"height"`
				URL    string `json:"url"`
			} `json:"standard_resolution"`
		} `json:"videos"`
		CarouselMedia []struct {
			Images struct {
				StandardResolution struct {
					URL string `json:"url"`
				} `json:"standard_resolution"`
			} `json:"images"`
			Videos struct {
				StandardResolution struct {
					URL string `json:"url"`
				} `json:"standard_resolution"`
			} `json:"videos"`
			UsersInPhoto []interface{} `json:"users_in_photo"`
			Type         string `json:"type"`
		} `json:"carousel_media"`
	}

	err := json.Unmarshal(data, &mediaJSON)
	if err != nil {
		return Media{}, err
	}

	media := Media{}
	media.Code = mediaJSON.Code
	media.ID = mediaJSON.ID
	media.Caption = mediaJSON.Caption.Text
	media.LikesCount = uint32(mediaJSON.Likes.Count)
	media.CommentsCount = uint32(mediaJSON.Comments.Count)

	date, err := strconv.ParseUint(mediaJSON.CreatedTime, 10, 64)
	if err == nil {
		media.Date = date
	}

	if mediaJSON.Type == carousel {
		media.Type = TypeCarousel
		for _, itemJSOM := range mediaJSON.CarouselMedia {
			var item mediaItem
			item.Type = itemJSOM.Type
			if item.Type == video {
				item.URL = itemJSOM.Videos.StandardResolution.URL
			} else {
				item.URL = itemJSOM.Images.StandardResolution.URL
			}
			media.MediaList = append(media.MediaList, item)
		}
	} else {
		if mediaJSON.Type == video {
			media.MediaURL = mediaJSON.Videos.StandardResolution.URL
			media.Type = TypeVideo
		} else {
			media.MediaURL = mediaJSON.Images.StandardResolution.URL
			media.Type = TypeImage
		}
		var item mediaItem
		item.Type = media.Type
		item.URL = media.MediaURL
		item.Code = media.Code
		media.MediaList = append(media.MediaList, item)
	}

	media.Owner.Username = mediaJSON.User.Username
	media.Owner.FullName = mediaJSON.User.FullName
	media.Owner.ID = mediaJSON.User.ID
	media.Owner.ProfilePicURL = mediaJSON.User.ProfilePicture

	return media, nil
}

func getFromSearchMediaList(data []byte) (Media, error) {
	var mediaJSON struct {
		CommentsDisabled bool `json:"comments_disabled"`
		ID               string `json:"id"`
		Owner struct {
			ID string `json:"id"`
		} `json:"owner"`
		ThumbnailSrc string `json:"thumbnail_src"`
		IsVideo      bool `json:"is_video"`
		Code         string `json:"code"`
		Date         float64 `json:"date"`
		DisplaySrc   string `json:"display_src"`
		Caption      string `json:"caption"`
		Comments struct {
			Count float64 `json:"count"`
		} `json:"comments"`
		Likes struct {
			Count float64 `json:"count"`
		} `json:"likes"`
	}

	err := json.Unmarshal(data, &mediaJSON)
	if err != nil {
		return Media{}, err
	}

	media := Media{}
	media.ID = mediaJSON.ID
	media.Code = mediaJSON.Code
	media.MediaURL = mediaJSON.DisplaySrc
	media.Caption = mediaJSON.Caption
	media.Date = uint64(mediaJSON.Date)
	media.LikesCount = uint32(mediaJSON.Likes.Count)
	media.CommentsCount = uint32(mediaJSON.Comments.Count)
	media.Owner.ID = mediaJSON.Owner.ID

	if mediaJSON.IsVideo {
		media.Type = TypeVideo
	} else {
		media.Type = TypeImage
	}

	return media, nil
}

repository: Vorkytaka/instagram-go-scraper

repo_name: Vorkytaka/instagram-go-scraper


text:
// options returns live quota for the specified option.
package main

import (
	"flag"
	"fmt"
	"math"
	"time"

	rh "github.com/edpin/robinhood"
)

var (
	symbol     = flag.String("symbol", "", "Symbol of the underlying security")
	expiration = flag.String("expiration", "", "Expiration date (YYYY-MM-DD)")
	strike     = flag.Float64("strike", 0.0, "Strike price of option")
	token      = flag.String("token", "", "User's access token with Robinhood")
	optType    = flag.String("type", "put", "<put|call>")
)

func main() {
	flag.Parse()

	if flag.NFlag() < 4 {
		fmt.Printf(`
Usage:
  options --symbol=SPY --expiration=2018-06-22 --strike=290 \
          --token=<auth_token>  --type=call
`)
		return
	}
	client := &rh.Client{
		Token: *token,
	}
	exp, err := time.Parse("2006-01-02", *expiration)
	if err != nil {
		panic(err)
	}
	chains, err := client.Chains(*symbol, exp)
	if err != nil {
		panic(err)
	}
	// Look for the right strike price.
	idx := -1
	for i, chain := range chains {
		if floatEquals(*strike, chain.Strike) {
			idx = i
			break
		}
	}
	if idx < 0 {
		panic("no chain found")
	}

	opt, err := client.Option(chains[idx])
	if err != nil {
		panic(err)
	}
	fmt.Printf("%+v\n", opt)
}

const fEpsilon = 0.00001

func floatEquals(a, b float64) bool {
	return math.Abs(a-b) < fEpsilon
}

repository: edpin/robinhood

repo_name: edpin/robinhood


text:
DESCRIPTION = "htop process monitor"
HOMEPAGE = "http://htop.sf.net"
SECTION = "console/utils"
PRIORITY = "optional"
LICENSE = "GPLv2"

LIC_FILES_CHKSUM = "file://COPYING;md5=c312653532e8e669f30e5ec8bdc23be3"

DEPENDS = "ncurses"
RDEPENDS_${PN} = "ncurses-terminfo"

SRC_URI = "${SOURCEFORGE_MIRROR}/htop/htop-${PV}.tar.gz \
           file://remove-proc-test.patch"

inherit autotools

SRC_URI[md5sum] = "7c5507f35f363f3f40183a2ba3c561f8"
SRC_URI[sha256sum] = "4de65c38e1886bccd30ed692b30eb9bf195240680781bfe1eaf5faf84ee6fbfd"


text:
SRCREV = "49c4ddb7feed3653dde1c77e235e41e42c3e73e5"

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

require npcm8xx-tip-fw.inc

branch_name: refs/heads/npcm-master


text:
package pr_test

import (
	"context"
	"github.com/runatlantis/atlantis/server/neptune/workflows/activities"
	"github.com/runatlantis/atlantis/server/neptune/workflows/activities/github"
	"github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr"
	"github.com/runatlantis/atlantis/server/neptune/workflows/internal/pr/revision"
	"github.com/stretchr/testify/assert"
	"go.temporal.io/sdk/testsuite"
	"go.temporal.io/sdk/workflow"
	"testing"
	"time"
)

type request struct {
	TestPRNumber int
	TestRepo     github.Repo
	ga           *testGithubActivities
}

type response struct {
	ShouldShutdown bool
}

func testWorkflow(ctx workflow.Context, r request) (response, error) {
	ctx = workflow.WithActivityOptions(ctx, workflow.ActivityOptions{
		ScheduleToCloseTimeout: time.Minute,
	})
	shutdownChecker := pr.ShutdownStateChecker{
		GithubActivities: r.ga,
		PRNumber:         r.TestPRNumber,
	}
	shouldShutdown := shutdownChecker.ShouldShutdown(ctx, revision.Revision{
		Repo: r.TestRepo,
	})
	return response{ShouldShutdown: shouldShutdown}, nil
}
func TestShutdownStateChecker_ShouldShutdown(t *testing.T) {
	testRepo := github.Repo{
		Owner: "owner",
		Name:  "name",
	}
	testPRNum := 10

	ts := testsuite.WorkflowTestSuite{}
	env := ts.NewTestWorkflowEnvironment()
	ga := &testGithubActivities{
		expectedRepo:     testRepo,
		expectedPRNumber: testPRNum,
		state:            pr.ClosedState,
		t:                t,
	}
	env.RegisterActivity(ga)
	env.ExecuteWorkflow(testWorkflow, request{
		TestPRNumber: testPRNum,
		TestRepo:     testRepo,
		ga:           ga,
	})
	var resp response
	err := env.GetWorkflowResult(&resp)
	assert.NoError(t, err)
	assert.True(t, resp.ShouldShutdown)
}

func TestShutdownStateChecker_ShouldNotShutdown(t *testing.T) {
	testRepo := github.Repo{
		Owner: "owner",
		Name:  "name",
	}
	testPRNum := 10

	ts := testsuite.WorkflowTestSuite{}
	env := ts.NewTestWorkflowEnvironment()
	ga := &testGithubActivities{
		expectedRepo:     testRepo,
		expectedPRNumber: testPRNum,
		state:            "open",
		t:                t,
	}
	env.RegisterActivity(ga)
	env.ExecuteWorkflow(testWorkflow, request{
		TestPRNumber: testPRNum,
		TestRepo:     testRepo,
		ga:           ga,
	})
	var resp response
	err := env.GetWorkflowResult(&resp)
	assert.NoError(t, err)
	assert.False(t, resp.ShouldShutdown)
}

func TestShutdownStateChecker_Error(t *testing.T) {
	testRepo := github.Repo{
		Owner: "owner",
		Name:  "name",
	}
	testPRNum := 10

	ts := testsuite.WorkflowTestSuite{}
	env := ts.NewTestWorkflowEnvironment()
	ga := &testGithubActivities{
		expectedRepo:     testRepo,
		expectedPRNumber: testPRNum,
		state:            pr.ClosedState,
		error:            assert.AnError,
		t:                t,
	}
	env.RegisterActivity(ga)
	env.ExecuteWorkflow(testWorkflow, request{
		TestPRNumber: testPRNum,
		TestRepo:     testRepo,
		ga:           ga,
	})
	var resp response
	err := env.GetWorkflowResult(&resp)
	assert.NoError(t, err)
	assert.False(t, resp.ShouldShutdown)
}

type testGithubActivities struct {
	error            error
	state            string
	t                *testing.T
	expectedPRNumber int
	expectedRepo     github.Repo
}

func (g *testGithubActivities) GithubGetPullRequestState(_ context.Context, request activities.GetPullRequestStateRequest) (activities.GetPullRequestStateResponse, error) {
	assert.Equal(g.t, g.expectedPRNumber, request.PRNumber)
	assert.Equal(g.t, g.expectedRepo, request.Repo)
	return activities.GetPullRequestStateResponse{State: g.state}, g.error
}

repository: lyft/atlantis

repo_name: lyft/atlantis


text:
DESCRIPTION = "Qt/Embedded Fonts Common Files"
SECTION = "opie/fonts"
PRIORITY = "optional"
MAINTAINER = "Michael 'Mickey' Lauer <mickey@Vanille.de>"
LICENSE = "GPL QPL"
PR = "r2"

SRC_URI = "file://update-qtfontdir"
S = "${WORKDIR}/qt-${PV}"

do_install() {
	install -d ${D}${sbindir}/
	install -m 0755 ${WORKDIR}/update-qtfontdir ${D}${sbindir}/
}

repository: Terentyev/familiar-linux

repo_name: Terentyev/familiar-linux


text:
require mariadb.inc
inherit native

PROVIDES += "mysql5-native"
DEPENDS = "ncurses-native zlib-native bison-native libpcre2-native \
gnutls-native fmt-native \
"

RDEPENDS:${PN} = ""
PACKAGES = ""
EXTRA_OEMAKE = ""

do_install() {
    oe_runmake 'DESTDIR=${D}' install

    install -d ${D}${bindir}
    install -m 0755 sql/gen_lex_hash ${D}${bindir}/
    install -m 0755 sql/gen_lex_token ${D}${bindir}/
    install -m 0755 extra/comp_err ${D}${bindir}/
    install -m 0755 scripts/comp_sql ${D}${bindir}/
    install -m 0755 strings/uca-dump ${D}${bindir}/
}

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake


text:
package cnd

// Card conditions
const (
	SummoningSickness = "summoning_sickness"
	DoubleBreaker     = "doublebreaker"
	TripleBreaker     = "triplebreaker"
	PowerAmplifier    = "power_amplifier"
	PowerAttacker     = "power_attacker"
	AttackUntapped    = "attack_untapped"
	Creature          = "creature"
	Spell             = "spell"
	Blocker           = "blocker"
	ShieldTrigger     = "shield_trigger"
	Slayer            = "slayer"
	Active            = "active"
	CantBeBlocked     = "cant_be_blocked"
	ReducedCost       = "reduced_cost"
)

repository: eirikbjornr/duel-masters

repo_name: eirikbjornr/duel-masters


text:
@article{Leeks_2018,
 author = {Leeks, Asher and Segredo-Otero, Ernesto A and Sanju{\'{a}}n, Rafael and West, Stuart A},
 title = {Beneficial coinfection can promote within-host viral diversity},
 journal = {Virus Evolution},
 publisher = {Oxford University Press ({OUP})},
 year = {2018},
 month = {jul},
 number = {2},
 volume = {4},
 url = {https://doi.org/10.1093%2Fve%2Fvey028},
 doi = {10.1093/ve/vey028}
}