text:
rolimus. The mean time from initiation of tacrolimus therapy until response was 8.5 days. The mean duration of response was 260 days. Eleven of 18 patients required colectomy, including all of the patients with steroid-resistant UC, but only 2 of 9 who were steroid-dependent. The mean time from initiation of tacrolimus until colectomy was 392 days. CONCLUSIONS: It is possible that tacrolimus may benefit selected patients with steroid-dependent UC, including those who are intolerant of 6-mercaptopurine or azathioprine. Conversely, patients with steroid-resistant UC are unlikely to sustain a prolonged clinical response to tacrolimus and seem to require colectomy eventually. Careful considerations of risk versus benefit, as well as close monitoring for adverse effects, are essential in all patients.},
   keywords = {Administration, Oral
Adolescent
Child
Child, Preschool
Colitis, Ulcerative/*drug therapy
Dose-Response Relationship, Drug
*Drug Resistance
Female
Humans
Immunosuppressive Agents/administration & dosage/adverse effects/*therapeutic use
Infant
Male
Remission Induction
Retrospective Studies
Steroids/*pharmacology
Tacrolimus/administration & dosage/adverse effects/*therapeutic use
Time Factors
Treatment Outcome},
   ISSN = {0277-2116},
   Accession Number = {17873742},
   DOI = {10.1097/MPG.0b013e31805b82e4},
   year = {2007},
   type = {Ref–rence Type}
}

license: MIT

license_type: permissive

branch_name: refs/heads/master


text:
@InProceedings{yoshiyasu:accv:2018,
  author    = {Yoshiyasu, Yusuke and Sagawa, Ryusuke and Ayusawa, Ko and Murai, Akihiko},
  title     = {Skeleton Transformer Networks:3D Human Pose and Skinned Mesh from single RGB Image},
  booktitle = {Asian Conference on Computer Vision},
  year      = {2018},
  address   = {Perth, Australia},
  month     = {December 2-December 6},
  url       = {https://www.researchgate.net/publication/330036375\_Skeleton\_Transformer\_Networks\_3D\_Human\_Pose\_and\_Skinned\_Mesh\_from\_Single\_RGB\_Image},
  keywords  = {Convolutional neural networks, 3D human pose, Skeleton},
  doi       = {10.1007/978-3-030-20870-7\_30},
  abstract  = {In this paper, we present Skeleton Transformer Networks (SkeletonNet), an end-to-end framework that can predict not only 3D joint positions but also 3D angular pose (bone rotations) of a human skeleton from a single color image. This in turn allows us to generate skinned mesh animations. Here, we propose a two-step regression approach. The first step regresses bone rotations in order to obtain an initial solution by considering skeleton structure. The second step performs refinement based on heatmap regressor using a 3D pose representation called cross heatmap which stacks heatmaps of xy and zy coordinates. By training the network using the proposed 3D human pose dataset that is comprised of images annotated with 3D skeletal angular poses, we showed that SkeletonNet can predict a full 3D human pose (joint positions and bone rotations) from a single image in-the-wild.}
}

gha_language: TeX

extension: bib


text:
package tls_test

import (
	"context"

	"github.com/go-logr/logr"
	. "github.com/onsi/ginkgo/v2"
	. "github.com/onsi/gomega"

	"github.com/kumahq/kuma/pkg/core/resources/manager"
	intercp_tls "github.com/kumahq/kuma/pkg/intercp/tls"
	"github.com/kumahq/kuma/pkg/plugins/resources/memory"
)

var _ = Describe("TLS", func() {
	var ch chan struct{}
	var defaults intercp_tls.DefaultsComponent
	var resManager manager.ResourceManager

	BeforeEach(func() {
		resManager = manager.NewResourceManager(memory.NewStore())
		defaults = intercp_tls.DefaultsComponent{
			ResManager: resManager,
			Log:        logr.Discard(),
		}
		ch = make(chan struct{})
	})

	AfterEach(func() {
		close(ch)
	})

	It("should generate default CA", func() {
		// when
		Expect(defaults.Start(ch)).To(Succeed())

		// then
		_, err := intercp_tls.LoadCA(context.Background(), resManager)
		Expect(err).ToNot(HaveOccurred())
	})

	It("should ignore creating CA when there is one already in place", func() {
		// given
		Expect(defaults.Start(ch)).To(Succeed())
		ca1, err := intercp_tls.LoadCA(context.Background(), resManager)
		Expect(err).ToNot(HaveOccurred())

		// when
		Expect(defaults.Start(ch)).To(Succeed())

		// then
		ca2, err := intercp_tls.LoadCA(context.Background(), resManager)
		Expect(err).ToNot(HaveOccurred())
		Expect(ca1).To(Equal(ca2))
	})
})

repository: kumahq/kuma

repo_name: kumahq/kuma

gha_language: Go

extension: go


text:
%Chap1绪论
%分层存储系统
  %商业存储系统
@misc{NetAppFas,
Howpublished = {\url{https://www.netapp.com/us/documentation/fas-storage-systems.aspx}},
Title = {NetApp FAS Storage Systems}
}

@misc{IBMDS8880,
Howpublished = {\url{https://www.ibm.com/cn-zh/marketplace/ds8000}},
Title = {IBM DS8880 Data Systems}
}
  %超算分层存储架构

%相关工作
@inproceedings{Panache,
  title={Panache: A Parallel File System Cache for Global File Access.},
  author={Eshel, Marc and Haskin, Roger L and Hildebrand, Dean and Naik, Manoj and Schmuck, Frank B and Tewari, Renu},
  booktitle={FAST},
  volume={10},
  pages={1--14},
  year={2010}
}
@inproceedings{Massively_Parallel_Loading,
 author = {Frings, Wolfgang and Ahn, Dong H. and LeGendre, Matthew and Gamblin, Todd and de Supinski, Bronis R. and Wolf, Felix},
 title = {Massively Parallel Loading},
 booktitle = {Proceedings of the 27th International ACM Conference on International Conference on Supercomputing},
 series = {ICS '13},
 year = {2013},
 isbn = {978-1-4503-2130-3},
 location = {Eugene, Oregon, USA},
 pages = {389--398},
 numpages = {10},
 url = {http://doi.acm.org/10.1145/2464996.2465020},
 doi = {10.1145/2464996.2465020},
 acmid = {2465020},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {hpc, os/runtime service, scalability},
}
@inproceedings{1PB,
  title={A 1 PB/s file system to checkpoint three million MPI tasks},
  author={Rajachandrasekar, Raghunath and Moody, Adam and Mohror, Kathryn and Panda, Dhabaleswar K},
  booktitle={Proceedings of the 22nd international symposium on High-performance parallel and distributed computing},
  pages={143--154},
  year={2013},
  organization={ACM}
}
@INPROCEEDINGS{HyCache+,
author={D. {Zhao} and K. {Qiao} and I. {Raicu}},
booktitle={2014 14th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing},
title={HyCache+: Towards Scalable High-Performance Caching Middleware for Parallel File Systems},
year={2014},
volume={},
number={},
pages={267-276},
doi={10.1109/CCGrid.2014.11},
ISSN={},
month={May}
}

@ARTICLE{Multi_Leve_Data_Staging_for_Blue_Gene,
author={F. {Isaila} and J. {Blas} and J. {Carretero} and R. {Latham} and R. {Ross}},
journal={IEEE Transactions on Parallel and Distributed Systems},
title={Design and Evaluation of Multiple-Level Data Staging for Blue Gene Systems},
year={2011},
volume={22},
number={6},
pages={946-959},
keywords={cache storage;input-output programs;parallel processing;pipeline processing;multiple-level data staging design;multiple-level data staging evaluation;blue gene systems;parallel applications;Petascale systems;file access;data pipelining;Exascale systems;parallel IO software system;file IO-related communication;file system access;file cache management;Delay;File systems;Concurrent computing;Bandwidth;Petascale computing;Pipeline processing;Software systems;Software design;Application software;Computer networks;MPI-IO;parallel I/O;parallel file systems;supercomputers.},
doi={10.1109/TPDS.2010.127},
ISSN={},
month={June},}

@inproceedings{Adaptive_Multi_level_Cache_Allocation_in_Distribute_Storage_Architectures,
 author = {Prabhakar, Ramya and Srikantaiah, Shekhar and Kandemir, Mahmut and Patrick, Christina},
 title = {Adaptive Multi-level Cache Allocation in Distributed Storage Architectures},
 booktitle = {Proceedings of the 24th ACM International Conference on Supercomputing},
 series = {ICS '10},
 year = {2010},
 isbn = {978-1-4503-0018-6},
 location = {Tsukuba, Ibaraki, Japan},
 pages = {211--221},
 numpages = {11},
 url = {http://doi.acm.org/10.1145/1810085.1810115},
 doi = {10.1145/1810085.1810115},
 acmid = {1810115},
 publisher = {ACM},
 address = {New York, NY, USA},
}
@INPROCEEDINGS{On_Urgency_of_I/O_Operations,
author={M. {Kandemir} and T. {Yemliha} and R. {Prabhakar} and M. {Jung}},
booktitle={2012 12th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (ccgrid 2012)},
title={On Urgency of I/O Operations},
year={2012},
volume={},
number={},
pages={188-195},
keywords={cache storage;parallel processing;I-O operation urgency;high-performance parallel file systems;multilayer storage cache hierarchy;data access latency reduction;data requests;hit-miss characteristics;data blocks;disk-resident data set manipulation;profile-based strategy;two-tier systems;three-tier systems;Cache storage;Servers;Computer architecture;Delay;Prefetching;Optimization},
doi={10.1109/CCGrid.2012.40},
ISSN={},
month={May},}
@INPROCEEDINGS{Masking_IO_latency_using_application_level_IO_caching_and_prefetching_on_Blue_Gene_systems,
author={S. {Seelam} and I. {Chung} and J. {Bauer} and H. {Wen}},
booktitle={2010 IEEE International Symposium on Parallel Distributed Processing (IPDPS)},
title={Masking I/O latency using application level I/O caching and prefetching on Blue Gene systems},
year={2010},
volume={},
number={},
pages={1-12},
doi={10.1109/IPDPS.2010.5470438},
month={April},}

@inproceedings{Cashing_in_on_Hints_for_Better_Prefetching_and_Caching_in_PVFS_and_MPI_IO,
 author = {Patrick, Christina M. and Kandemir, Mahmut and Karak, Mustafa and Son, Seung Woo and Choudhary, Alok},
 title = {Cashing in on Hints for Better Prefetching and Caching in PVFS and MPI-IO},
 booktitle = {Proceedings of the 19th ACM International Symposium on High Performance Distributed Computing},
 series = {HPDC '10},
 year = {2010},
 isbn = {978-1-60558-942-8},
 location = {Chicago, Illinois},
 pages = {191--202},
 numpages = {12},
 url = {http://doi.acm.org/10.1145/1851476.1851499},
 doi = {10.1145/1851476.1851499},
 acmid = {1851499},
 publisher = {ACM},
 address = {New York, NY, USA},
}
@INPROCEEDINGS{KNOWAC,
author={J. {He} and X. {Sun} and R. {Thakur}},
booktitle={2012 IEEE International Conference on Cluster Computing},
title={KNOWAC: I/O Prefetch via Accumulated Knowledge},
year={2012},
volume={},
number={},
pages={429-437},
doi={10.1109/CLUSTER.2012.83},
ISSN={},
month={Sep.},}

@inproceedings{Improving_read_performance_with_online_access_pattern_analysis_and_prefetching,
  title={Improving read performance with online access pattern analysis and prefetching},
  author={Tang, Houjun and Zou, Xiaocheng and Jenkins, John and Boyuka, David A and Ranshous, Stephen and Kimpe, Dries and Klasky, Scott and Samatova, Nagiza F},
  booktitle={European Conference on Parallel Processing},
  pages={246--257},
  year={2014},
  organization={Springer}
}
@ARTICLE{Endurance_Aware_Flash_Cache_Management_for_Storage_Servers,
author={P. {Suei} and M. {Yeh} and T. {Kuo}},
journal={IEEE Transactions on Computers},
title={Endurance-Aware Flash-Cache Management for Storage Servers},
year={2014},
volume={63},
number={10},
pages={2416-2430},
doi={10.1109/TC.2013.119},
ISSN={},
month={Oct},}

@INPROCEEDINGS{Optimizing_a_hybrid_SSD_HDD_HPC_storage_system_based_on_file_size_distributions,
author={B. {Welch} and G. {Noer}},
booktitle={2013 IEEE 29th Symposium on Mass Storage Systems and Technologies (MSST)},
title={Optimizing a hybrid SSD/HDD HPC storage system based on file size distributions},
year={2013},
volume={},
number={},
pages={1-12},
keywords={disc drives;hard discs;hybrid SSD-HDD HPC storage system;file size distributions;block-level metadata;file-level metadata;unique storage blade architecture;Panasas system;metadata intensive benchmarks;response time;measurement methodology;customer survey;File systems;Resource management;Blades;Histograms;Data models;Companies;Data processing;file systems;OSD;SSD;parallel file system;HPC},
doi={10.1109/MSST.2013.6558449},
ISSN={},
month={May},}

@inproceedings{Proceedings_of_the_22nd_international_symposium_on_High_performance_parallel_and_distributed_computing,
  title={I/O acceleration with pattern detection},
  author={He, Jun and Bent, John and Torres, Aaron and Grider, Gary and Gibson, Garth and Maltzahn, Carlos and Sun, Xian-He},
  booktitle={Proceedings of the 22nd international symposium on High-performance parallel and distributed computing},
  pages={25--36},
  year={2013},
  organization={ACM}
}
%主动预取相关研究
@inproceedings{c_miner,
  title={C-Miner: Mining Block Correlations in Storage Systems.},
  author={Li, Zhenmin and Chen, Zhifeng and Srinivasan, Sudarshan M and Zhou, Yuanyuan},
  booktitle={FAST},
  volume={4},
  pages={173--186},
  year={2004}
}
@article{Prefetching_on_storage_servers_through_mining_access_patterns_on_blocks,
  title={Prefetching on storage servers through mining access patterns on blocks},
  author={Liao, Jianwei and Trahay, Francois and Gerofi, Balazs and Ishikawa, Yutaka},
  journal={IEEE Transactions on Parallel and Distributed Systems},
  volume={27},
  number={9},
  pages={2698--2710},
  year={2015},
  publisher={IEEE}
}
@inproceedings{composite_file,
  title={The composite-file file system: decoupling the one-to-one mapping of files and metadata for better performance},
  author={Zhang, Shuanglong and Catanese, Helen and Wang, Andy An-I},
  booktitle={14th $\{$USENIX$\}$ Conference on File and Storage Technologies ($\{$FAST$\}$ 16)},
  pages={15--22},
  year={2016}
}
@inproceedings{stacker,
  title={Stacker: an autonomic data movement engine for extreme-scale data staging-based in-situ workflows},
  author={Subedi, Pradeep and Davis, Philip and Duan, Shaohua and Klasky, Scott and Kolla, Hemanth and Parashar, Manish},
  booktitle={Proceedings of the International Conference for High Performance Computing, Networking, Storage, and Analysis},
  pages={73},
  year={2018},
  organization={IEEE Press}
}
@article{dataspace,
  title={Dataspaces: an interaction and coordination framework for coupled simulation workflows},
  author={Docan, Ciprian and Parashar, Manish and Klasky, Scott},
  journal={Cluster Computing},
  volume={15},
  number={2},
  pages={163--181},
  year={2012},
  publisher={Springer}
}
@inproceedings{XGC1,
  title={Hybrid mpi/openmp/gpu parallelization of xgc1 fusion simulation code},
  author={D’Azevedo, Eduardo F and Lang, Jianying and Worley, Patrick H and Ethier, Stephane A and Ku, Seung-Hoe and Chang, C},
  booktitle={Supercomputing Conference 2013},
  pages={1441--1441},
  year={2013}
}
@article{S3D,
  title={Terascale direct numerical simulations of turbulent combustion using S3D},
  author={Chen, Jacqueline H and Choudhary, Alok and De Supinski, Bronis and DeVries, Matthew and Hawkes, Evatt R and Klasky, Scott and Liao, Wei-Keng and Ma, Kwan-Liu and Mellor-Crummey, John and Podhorszki, Norbert and others},
  journal={Computational Science \& Discovery},
  volume={2},
  number={1},
  pages={015001},
  year={2009},
  publisher={IOP Publishing}
}

%-----Chap2

%是一个开源、可扩展的分布式文件系统
@misc{GlusterFS,
	Howpublished = {\url{http://www.gluster.org/}},
	Title = {GlusterFS: A scalable network filesystem}
}
%层次存储
@INPROCEEDINGS{Adaptive_Data_Migration_in_Multi-tiered_Storage_Based_Cloud_Environment,
author={G. {Zhang} and L. {Chiu} and L. {Liu}},
booktitle={2010 IEEE 3rd International Conference on Cloud Computing},
title={Adaptive Data Migration in Multi-tiered Storage Based Cloud Environment},
year={2010},
volume={},
number={},
pages={148-155},
doi={10.1109/CLOUD.2010.60},
ISSN={},
month={July},}
@Article{A_Reinforcement_Learning_Framework_for_Online_data_migration,
author="Vengerov, David",
title="A reinforcement learning framework for online data migration in hierarchical storage systems",
journal="The Journal of Supercomputing",
year="2008",
month="Jan",
day="01",
volume="43",
number="1",
pages="1--19",
issn="1573-0484",
doi="10.1007/s11227-007-0135-3",
url="https://doi.org/10.1007/s11227-007-0135-3"
}

%是操作系统数据读取过程中的重要优化方法
@inproceedings{Reducing_File_System_Latency_using_a_Predictive_Approach,
  title={Reducing File System Latency using a Predictive Approach.},
  author={Griffioen, Jim and Appleton, Randy},
  booktitle={USENIX summer},
  pages={197--207},
  year={1994}
}
@inproceedings{Group_based_management_of_distributed_file_caches,
  title={Group-based management of distributed file caches},
  author={Amer, Ahmed and Long, Darrell DE and Burns, Randal C},
  booktitle={Proceedings 22nd International Conference on Distributed Computing Systems},
  pages={525--534},
  year={2002},
  organization={IEEE}
}
@article{A_data_mining_algorithm_for_generalized_web_prefetching,
  title={A data mining algorithm for generalized web prefetching},
  author={Nanopoulos, Alexandros and Katsaros, Dimitrios and Manolopoulos, Yannis},
  journal={IEEE Transactions on Knowledge \& Data Engineering},
  number={5},
  pages={1155--1169},
  year={2003},
  publisher={IEEE}
}

@article{BWFS,
  title={BWFS: A distributed file system with large capacity, high throughput and high scalability.},
  author={Yang, Dezhi and Huang, Hua and Zhang, Jiangang and Xu, Lu},
  journal={Jisuanji Yanjiu yu Fazhan(Comput. Res. Dev.)},
  volume={42},
  number={6},
  pages={1028--1033},
  year={2005}
}
@inproceedings{DPFS,
  title={DPFS: A distributed parallel file system},
  author={Shen, Xiaohui and Choudhary, Alok},
  booktitle={International Conference on Parallel Processing, 2001.},
  pages={533--541},
  year={2001},
  organization={IEEE}
}
@misc{Tiering,
Howpublished = {\url{https://staged-gluster-docs.readthedocs.io/en/release3.7.0beta1/Features/tier/}},
Title = {Tiering translator in GlusterFS}
}
@article{Red_Hat_Gluster_storage_on_supermicro_storage_servers_powered_by_Intel_Xeon_processors,
  title={Red Hat Gluster storage on supermicro storage servers powered by Intel Xeon processors},
  author={Dustin, B},
  journal={Super Micro computer. https://www.supermicro.com/white\_paper/white\_paper\_Redhat\_Gluster\_Storage.pdf},
  year={2017}
}
@misc{Tiered_Storage_Takes_Center_Stage,
  title={Horison Information Strategies,“Tiered Storage Takes Center Stage,”},
  author={Moore, F},
  year={2011}
}

%-----chap3
@article{自然语言处理的历史与现状,
  title={自然语言处理的历史与现状},
  author={冯志伟},
  journal={中国外语: 中英文版},
  number={1},
  pages={14--22},
  year={2008}
}
@article{宋一凡2019自然语言处理的发展历史与现状,
  title={自然语言处理的发展历史与现状},
  author={宋一凡},
  journal={中国高新科技},
  number={3},
  pages={31},
  year={2019}
}
@article{Natural_language_processing_(almost)_from_scratch,
  title={Natural language processing (almost) from scratch},
  author={Collobert, Ronan and Weston, Jason and Bottou, L{\'e}on and Karlen, Michael and Kavukcuoglu, Koray and Kuksa, Pavel},
  journal={Journal of machine learning research},
  volume={12},
  number={Aug},
  pages={2493--2537},
  year={2011}
}
@article{cbow,
  title={Efficient estimation of word representations in vector space},
  author={Mikolov, Tomas and Chen, Kai and Corrado, Greg and Dean, Jeffrey},
  journal={arXiv preprint arXiv:1301.3781},
  year={2013}
}
@inproceedings{skipgram,
  title={Distributed representations of words and phrases and their compositionality},
  author={Mikolov, Tomas and Sutskever, Ilya and Chen, Kai and Corrado, Greg S and Dean, Jeff},
  booktitle={Advances in neural information processing systems},
  pages={3111--3119},
  year={2013}
}
@article{fasttext,
  title={Enriching word vectors with subword information},
  author={Bojanowski, Piotr and Grave, Edouard and Joulin, Armand and Mikolov, Tomas},
  journal={Transactions of the Association for Computational Linguistics},
  volume={5},
  pages={135--146},
  year={2017},
  publisher={MIT Press}
}

%词向量
@article{distributional_hypothesis,
  title={Distributional structure},
  author={Harris, Zellig S},
  journal={Word},
  volume={10},
  number={2-3},
  pages={146--162},
  year={1954},
  publisher={Taylor \& Francis}
}
@article{visualizing,
  title={Visualizing and understanding neural models in nlp},
  author={Li, Jiwei and Chen, Xinlei and Hovy, Eduard and Jurafsky, Dan},
  journal={arXiv preprint arXiv:1506.01066},
  year={2015}
}
@misc{LSI,
  title={Computer information retrieval using latent semantic structure},
  author={Deerwester, Scott C and Dumais, Susan T and Furnas, George W and Harshman, Richard A and Landauer, Thomas K and Lochbaum, Karen E and Streeter, Lynn A},
  year={1989},
  month=jun # "~13",
  publisher={Google Patents},
  note={US Patent 4,839,853}
}
@article{LSA,
  title={Indexing by latent semantic analysis},
  author={Deerwester, Scott and Dumais, Susan T and Furnas, George W and Landauer, Thomas K and Harshman, Richard},
  journal={Journal of the American society for information science},
  volume={41},
  number={6},
  pages={391--407},
  year={1990},
  publisher={Wiley Online Library}
}
@article{cognitive_model,
  title={A solution to Plato's problem: The latent semantic analysis theory of acquisition, induction, and representation of knowledge.},
  author={Landauer, Thomas K and Dumais, Susan T},
  journal={Psychological review},
  volume={104},
  number={2},
  pages={211},
  year={1997},
  publisher={American Psychological Association}
}
@inproceedings{spell_checking,
  title={Contextual spelling correction using latent semantic analysis},
  author={Jones, Michael P and Martin, James H},
  booktitle={Fifth Conference on Applied Natural Language Processing},
  pages={166--173},
  year={1997}
}
@article{essay_grading,
  title={Using Latent Semantic Analysis to assess knowledge: Some technical considerations},
  author={Rehder, Bob and Schreiner, ME and Wolfe, Michael BW and Laham, Darrell and Landauer, Thomas K and Kintsch, Walter},
  journal={Discourse Processes},
  volume={25},
  number={2-3},
  pages={337--354},
  year={1998},
  publisher={Taylor \& Francis}
}
@article{bengio2003,
  title={A neural probabilistic language model},
  author={Bengio, Yoshua and Ducharme, R{\'e}jean and Vincent, Pascal and Jauvin, Christian},
  journal={Journal of machine learning research},
  volume={3},
  number={Feb},
  pages={1137--1155},
  year={2003}
}
@Inbook{Bengio2006,
author="Bengio, Yoshua
and Schwenk, Holger
and Sen{\'e}cal, Jean-S{\'e}bastien
and Morin, Fr{\'e}deric
and Gauvain, Jean-Luc",
editor="Holmes, Dawn E.
and Jain, Lakhmi C.",
title="Neural Probabilistic Language Models",
bookTitle="Innovations in Machine Learning: Theory and Applications",
year="2006",
publisher="Springer Berlin Heidelberg",
address="Berlin, Heidelberg",
pages="137--186",
isbn="978-3-540-33486-6",doi="10.1007/3-540-33486-6_6",url="https://doi.org/10.1007/3-540-33486-6_6"}
@inproceedings{bengio2007,
  title={Greedy layer-wise training of deep networks},
  author={Bengio, Yoshua and Lamblin, Pascal and Popovici, Dan and Larochelle, Hugo},
  booktitle={Advances in neural information processing systems},
  pages={153--160},
  year={2007}
}
%文件名、路径向量化
@misc{fhs,
Howpublished = {\url{http://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html}},
Title = "Filesystem Hierarchy Standard"
}
@inproceedings{Hierarchical_softmax,
  title={Hierarchical probabilistic neural network language model.},
  author={Morin, Frederic and Bengio, Yoshua},
  booktitle={Aistats},
  volume={5},
  pages={246--252},
  year={2005},
  organization={Citeseer}
}
%循环神经网络
@article{LSTM,
  title={Long short-term memory},
  author={Hochreiter, Sepp and Schmidhuber, J{\"u}rgen},
  journal={Neural computation},
  volume={9},
  number={8},
  pages={1735--1780},
  year={1997},
  publisher={MIT Press}
}
@article{GRU,
  title={Empirical evaluation of gated recurrent neural networks on sequence modeling},
  author={Chung, Junyoung and Gulcehre, Caglar and Cho, KyungHyun and Bengio, Yoshua},
  journal={arXiv preprint arXiv:1412.3555},
  year={2014}
}


text:
# - Find CCGS
# Find the CellML API C Code Generation Service includes and library
# This module defines
#  CCGS_INCLUDE_DIR, where to find CCGS header files.
#  CCGS_LIBRARIES, the libraries needed to use the CCGS.
#  CCGS_FOUND, If false, do not try to use the CCGS.
# also defined, but not for general use are
#  CCGS_LIBRARY, where to find the CCGS library.

FIND_PATH(CCGS_INCLUDE_DIR IfaceCCGS.hxx
		${CSIM_DEPENDENCY_DIR}/include
        /usr/include/
        /usr/local/include/
)

FIND_LIBRARY(CCGS_LIBRARY ccgs
		${CSIM_DEPENDENCY_DIR}/lib
        /usr/lib
        /usr/local/lib
)
FIND_LIBRARY(ANNO_TOOLS_LIBRARY annotools
		${CSIM_DEPENDENCY_DIR}/lib
        /usr/lib
        /usr/local/lib
)
FIND_LIBRARY(CEVAS_LIBRARY cevas
		${CSIM_DEPENDENCY_DIR}/lib
        /usr/lib
        /usr/local/lib
)
FIND_LIBRARY(CUSES_LIBRARY cuses
		${CSIM_DEPENDENCY_DIR}/lib
        /usr/lib
        /usr/local/lib
)
FIND_LIBRARY(MALAES_LIBRARY malaes
		${CSIM_DEPENDENCY_DIR}/lib
        /usr/lib
        /usr/local/lib
)

IF (CCGS_INCLUDE_DIR AND CCGS_LIBRARY AND ANNO_TOOLS_LIBRARY AND CEVAS_LIBRARY AND CUSES_LIBRARY AND MALAES_LIBRARY)
   SET(CCGS_LIBRARIES ${CCGS_LIBRARY} ${ANNO_TOOLS_LIBRARY} ${CEVAS_LIBRARY} ${CUSES_LIBRARY} ${MALAES_LIBRARY})
   SET(CCGS_FOUND TRUE)
ENDIF (CCGS_INCLUDE_DIR AND CCGS_LIBRARY AND ANNO_TOOLS_LIBRARY AND CEVAS_LIBRARY AND CUSES_LIBRARY AND MALAES_LIBRARY)

IF (CCGS_FOUND)
   IF (NOT CCGS_FIND_QUIETLY)
      MESSAGE(STATUS "Found CCGS: ${CCGS_LIBRARIES}")
   ENDIF (NOT CCGS_FIND_QUIETLY)
ELSE (CCGS_FOUND)
   IF (CCGS_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find CCGS")
   ELSE (CCGS_FIND_REQUIRED)
      MESSAGE(STATUS "CCGS not found")
   ENDIF (CCGS_FIND_REQUIRED)
ENDIF (CCGS_FOUND)

repository: nickerso/csim-archived

repo_name: nickerso/csim-archived

extension: cmake


text:
@article{melymcb-0083,
 author = {Uñac, R.O. and Vidales, A.M. and Pugnaloni, L.A.},
 document_type = {Article},
 doi = {10.1007/s10035-009-0143-5},
 journal = {Granular Matter},
 note = {cited By 6},
 number = {6},
 pages = {371-378},
 source = {Scopus},
 title = {Simple model for wet granular beds subjected to tapping},
 url = {https://www.scopus.com/inward/record.uri?eid=2-s2.0-72949094025&doi=10.1007%2fs10035-009-0143-5&partnerID=40&md5=2fca178eb273dec0b1790ff256f72c87},
 volume = {11},
 year = {2009}
}


text:
package goka

import (
	"context"
	"fmt"
	"strings"
	"sync"
	"sync/atomic"
	"testing"

	"github.com/IBM/sarama"
	"github.com/hashicorp/go-multierror"
	"github.com/lovoo/goka/multierr"
)

const (
	// TODO: what is this used for?
	anyOffset int64 = -1000
)

var (
	errOutOfExpectations           = fmt.Errorf("error out of expectations")
	errPartitionConsumerNotStarted = fmt.Errorf("error partition consumer not started")
)

// MockAutoConsumer implements sarama's Consumer interface for testing purposes.
// Before you can start consuming from this consumer, you have to register
// topic/partitions using ExpectConsumePartition, and set expectations on them.
type MockAutoConsumer struct {
	l                  sync.Mutex
	t                  *testing.T
	config             *sarama.Config
	partitionConsumers map[string]map[int32]*MockAutoPartitionConsumer
	metadata           map[string][]int32
}

// NewMockAutoConsumer returns a new mock Consumer instance. The t argument should
// be the *testing.T instance of your test method. An error will be written to it if
// an expectation is violated. The config argument can be set to nil.
func NewMockAutoConsumer(t *testing.T, config *sarama.Config) *MockAutoConsumer {
	if config == nil {
		config = sarama.NewConfig()
	}

	c := &MockAutoConsumer{
		t:                  t,
		config:             config,
		partitionConsumers: make(map[string]map[int32]*MockAutoPartitionConsumer),
	}
	return c
}

///////////////////////////////////////////////////
// Consumer interface implementation
///////////////////////////////////////////////////

// ConsumePartition implements the ConsumePartition method from the sarama.Consumer interface.
// Before you can start consuming a partition, you have to set expectations on it using
// ExpectConsumePartition. You can only consume a partition once per consumer.
func (c *MockAutoConsumer) ConsumePartition(topic string, partition int32, offset int64) (sarama.PartitionConsumer, error) {
	c.l.Lock()
	defer c.l.Unlock()

	if c.partitionConsumers[topic] == nil || c.partitionConsumers[topic][partition] == nil {
		c.t.Errorf("No expectations set for %s/%d", topic, partition)
		return nil, errOutOfExpectations
	}

	pc := c.partitionConsumers[topic][partition]
	if pc.consumed {
		return nil, sarama.ConfigurationError("The topic/partition is already being consumed")
	}

	if pc.offset != anyOffset && pc.offset != offset {
		c.t.Errorf("Unexpected offset when calling ConsumePartition for %s/%d. Expected %d, got %d.", topic, partition, pc.offset, offset)
	}

	pc.consumed = true
	return pc, nil
}

// Topics returns a list of topics, as registered with SetTopicMetadata
func (c *MockAutoConsumer) Topics() ([]string, error) {
	c.l.Lock()
	defer c.l.Unlock()

	if c.metadata == nil {
		c.t.Errorf("Unexpected call to Topics. Initialize the mock's topic metadata with SetTopicMetadata.")
		return nil, sarama.ErrOutOfBrokers
	}

	var result []string
	for topic := range c.metadata {
		result = append(result, topic)
	}
	return result, nil
}

// Partitions returns the list of partitions for the given topic, as registered with SetTopicMetadata
func (c *MockAutoConsumer) Partitions(topic string) ([]int32, error) {
	c.l.Lock()
	defer c.l.Unlock()

	if c.metadata == nil {
		c.t.Errorf("Unexpected call to Partitions. Initialize the mock's topic metadata with SetTopicMetadata.")
		return nil, sarama.ErrOutOfBrokers
	}
	if c.metadata[topic] == nil {
		return nil, sarama.ErrUnknownTopicOrPartition
	}

	return c.metadata[topic], nil
}

// HighWaterMarks returns a map of high watermarks for each topic/partition
func (c *MockAutoConsumer) HighWaterMarks() map[string]map[int32]int64 {
	c.l.Lock()
	defer c.l.Unlock()

	hwms := make(map[string]map[int32]int64, len(c.partitionConsumers))
	for topic, partitionConsumers := range c.partitionConsumers {
		hwm := make(map[int32]int64, len(partitionConsumers))
		for partition, pc := range partitionConsumers {
			hwm[partition] = pc.HighWaterMarkOffset()
		}
		hwms[topic] = hwm
	}

	return hwms
}

// Close implements the Close method from the sarama.Consumer interface. It will close
// all registered PartitionConsumer instances.
func (c *MockAutoConsumer) Close() error {
	c.l.Lock()
	defer c.l.Unlock()

	for _, partitions := range c.partitionConsumers {
		for _, partitionConsumer := range partitions {
			partitionConsumer.Close()
		}
	}

	return nil
}

func (c *MockAutoConsumer) Pause(topicPartitions map[string][]int32) {}

func (c *MockAutoConsumer) Resume(topicPartitions map[string][]int32) {}

func (c *MockAutoConsumer) PauseAll() {}

func (c *MockAutoConsumer) ResumeAll() {}

///////////////////////////////////////////////////
// Expectation API
///////////////////////////////////////////////////

// SetTopicMetadata sets the clusters topic/partition metadata,
// which will be returned by Topics() and Partitions().
func (c *MockAutoConsumer) SetTopicMetadata(metadata map[string][]int32) {
	c.l.Lock()
	defer c.l.Unlock()

	c.metadata = metadata
}

// ExpectConsumePartition will register a topic/partition, so you can set expectations on it.
// The registered PartitionConsumer will be returned, so you can set expectations
// on it using method chaining. Once a topic/partition is registered, you are
// expected to start consuming it using ConsumePartition. If that doesn't happen,
// an error will be written to the error reporter once the mock consumer is closed. It will
// also expect that the
func (c *MockAutoConsumer) ExpectConsumePartition(topic string, partition int32, offset int64) *MockAutoPartitionConsumer {
	c.l.Lock()
	defer c.l.Unlock()

	if c.partitionConsumers[topic] == nil {
		c.partitionConsumers[topic] = make(map[int32]*MockAutoPartitionConsumer)
	}

	if c.partitionConsumers[topic][partition] == nil {
		c.partitionConsumers[topic][partition] = &MockAutoPartitionConsumer{
			t:         c.t,
			topic:     topic,
			partition: partition,
			offset:    offset,
			messages:  make(chan *sarama.ConsumerMessage, c.config.ChannelBufferSize),
			errors:    make(chan *sarama.ConsumerError, c.config.ChannelBufferSize),
		}
	}

	return c.partitionConsumers[topic][partition]
}

///////////////////////////////////////////////////
// PartitionConsumer mock type
///////////////////////////////////////////////////

// MockAutoPartitionConsumer implements sarama's PartitionConsumer interface for testing purposes.
// It is returned by the mock Consumers ConsumePartitionMethod, but only if it is
// registered first using the Consumer's ExpectConsumePartition method. Before consuming the
// Errors and Messages channel, you should specify what values will be provided on these
// channels using YieldMessage and YieldError.
type MockAutoPartitionConsumer struct {
	highWaterMarkOffset     int64 // must be at the top of the struct because https://golang.org/pkg/sync/atomic/#pkg-note-BUG
	l                       sync.Mutex
	t                       *testing.T
	topic                   string
	partition               int32
	offset                  int64
	messages                chan *sarama.ConsumerMessage
	errors                  chan *sarama.ConsumerError
	singleClose             sync.Once
	consumed                bool
	errorsShouldBeDrained   bool
	messagesShouldBeDrained bool
}

///////////////////////////////////////////////////
// PartitionConsumer interface implementation
///////////////////////////////////////////////////

// AsyncClose implements the AsyncClose method from the sarama.PartitionConsumer interface.
func (pc *MockAutoPartitionConsumer) AsyncClose() {
	pc.singleClose.Do(func() {
		close(pc.messages)
		close(pc.errors)
		pc.consumed = false
	})
}

// Close implements the Close method from the sarama.PartitionConsumer interface. It will
// verify whether the partition consumer was actually started.
func (pc *MockAutoPartitionConsumer) Close() error {
	var err error
	pc.singleClose.Do(func() {
		if !pc.consumed {
			pc.t.Errorf("Expectations set on %s/%d, but no partition consumer was started.", pc.topic, pc.partition)
			err = errPartitionConsumerNotStarted
			return
		}

		if pc.errorsShouldBeDrained && len(pc.errors) > 0 {
			pc.t.Errorf("Expected the errors channel for %s/%d to be drained on close, but found %d errors.", pc.topic, pc.partition, len(pc.errors))
		}

		if pc.messagesShouldBeDrained && len(pc.messages) > 0 {
			pc.t.Errorf("Expected the messages channel for %s/%d to be drained on close, but found %d messages.", pc.topic, pc.partition, len(pc.messages))
		}

		pc.AsyncClose()

		var (
			closeErr error
			wg       sync.WaitGroup
		)

		wg.Add(1)
		go func() {
			defer wg.Done()

			errs := make(sarama.ConsumerErrors, 0)
			for err := range pc.errors {
				errs = append(errs, err)
			}

			if len(errs) > 0 {
				closeErr = errs
			}
		}()

		wg.Add(1)
		go func() {
			defer wg.Done()
			for range pc.messages {
				// drain
			}
		}()

		wg.Wait()
		err = closeErr
	})
	return err
}

// Errors implements the Errors method from the sarama.PartitionConsumer interface.
func (pc *MockAutoPartitionConsumer) Errors() <-chan *sarama.ConsumerError {
	return pc.errors
}

// Messages implements the Messages method from the sarama.PartitionConsumer interface.
func (pc *MockAutoPartitionConsumer) Messages() <-chan *sarama.ConsumerMessage {
	return pc.messages
}

// HighWaterMarkOffset returns the highwatermark for the partition
func (pc *MockAutoPartitionConsumer) HighWaterMarkOffset() int64 {
	return atomic.LoadInt64(&pc.highWaterMarkOffset)
}

///////////////////////////////////////////////////
// Expectation API
///////////////////////////////////////////////////

// YieldMessage will yield a messages Messages channel of this partition consumer
// when it is consumed. By default, the mock consumer will not verify whether this
// message was consumed from the Messages channel, because there are legitimate
// reasons forthis not to happen. ou can call ExpectMessagesDrainedOnClose so it will
// verify that the channel is empty on close.
func (pc *MockAutoPartitionConsumer) YieldMessage(msg *sarama.ConsumerMessage) {
	pc.l.Lock()
	defer pc.l.Unlock()

	msg.Topic = pc.topic
	msg.Partition = pc.partition
	msg.Offset = atomic.LoadInt64(&pc.highWaterMarkOffset)
	atomic.AddInt64(&pc.highWaterMarkOffset, 1)

	pc.messages <- msg
}

// YieldError will yield an error on the Errors channel of this partition consumer
// when it is consumed. By default, the mock consumer will not verify whether this error was
// consumed from the Errors channel, because there are legitimate reasons for this
// not to happen. You can call ExpectErrorsDrainedOnClose so it will verify that
// the channel is empty on close.
func (pc *MockAutoPartitionConsumer) YieldError(err error) {
	pc.errors <- &sarama.ConsumerError{
		Topic:     pc.topic,
		Partition: pc.partition,
		Err:       err,
	}
}

// ExpectMessagesDrainedOnClose sets an expectation on the partition consumer
// that the messages channel will be fully drained when Close is called. If this
// expectation is not met, an error is reported to the error reporter.
func (pc *MockAutoPartitionConsumer) ExpectMessagesDrainedOnClose() {
	pc.messagesShouldBeDrained = true
}

// ExpectErrorsDrainedOnClose sets an expectation on the partition consumer
// that the errors channel will be fully drained when Close is called. If this
// expectation is not met, an error is reported to the error reporter.
func (pc *MockAutoPartitionConsumer) ExpectErrorsDrainedOnClose() {
	pc.errorsShouldBeDrained = true
}

// Pause suspends fetching from this partition. Future calls to the broker will not return
// any records from these partition until it have been resumed using Resume().
// Note that this method does not affect partition subscription.
// In particular, it does not cause a group rebalance when automatic assignment is used.
func (pc *MockAutoPartitionConsumer) Pause() {
}

// Resume resumes this partition which have been paused with Pause().
// New calls to the broker will return records from these partitions if there are any to be fetched.
// If the partition was not previously paused, this method is a no-op.
func (pc *MockAutoPartitionConsumer) Resume() {
}

// IsPaused indicates if this partition consumer is paused or not
func (pc *MockAutoPartitionConsumer) IsPaused() bool {
	return false
}

// MockConsumerGroupSession mocks the consumer group session used for testing
type MockConsumerGroupSession struct {
	ctx        context.Context
	generation int32
	topics     []string
	claims     map[string]*MockConsumerGroupClaim

	mu sync.RWMutex

	consumerGroup *MockConsumerGroup
}

// MockConsumerGroupClaim mocks the consumergroupclaim
type MockConsumerGroupClaim struct {
	topic     string
	partition int32
	msgs      chan *sarama.ConsumerMessage
}

// NewMockConsumerGroupClaim creates a new mocksconsumergroupclaim
func NewMockConsumerGroupClaim(topic string, partition int32) *MockConsumerGroupClaim {
	return &MockConsumerGroupClaim{
		topic:     topic,
		partition: partition,
		msgs:      make(chan *sarama.ConsumerMessage),
	}
}

// Topic returns the current topic of the claim
func (cgc *MockConsumerGroupClaim) Topic() string {
	return cgc.topic
}

// Partition returns the partition
func (cgc *MockConsumerGroupClaim) Partition() int32 {
	return cgc.partition
}

// InitialOffset returns the initial offset
func (cgc *MockConsumerGroupClaim) InitialOffset() int64 {
	return 0
}

// HighWaterMarkOffset returns the hwm offset
func (cgc *MockConsumerGroupClaim) HighWaterMarkOffset() int64 {
	return 0
}

// Messages returns the message channel that must be
func (cgc *MockConsumerGroupClaim) Messages() <-chan *sarama.ConsumerMessage {
	return cgc.msgs
}

func newConsumerGroupSession(ctx context.Context, generation int32, cg *MockConsumerGroup, topics []string) *MockConsumerGroupSession {
	return &MockConsumerGroupSession{
		ctx:           ctx,
		generation:    generation,
		consumerGroup: cg,
		topics:        topics,
		claims:        make(map[string]*MockConsumerGroupClaim),
	}
}

// Claims returns the number of partitions assigned in the group session for each topic
func (cgs *MockConsumerGroupSession) Claims() map[string][]int32 {
	claims := make(map[string][]int32)
	for _, topic := range cgs.topics {
		claims[topic] = []int32{0}
	}
	return claims
}

func (cgs *MockConsumerGroupSession) createGroupClaim(topic string, partition int32) *MockConsumerGroupClaim {
	cgs.mu.Lock()
	defer cgs.mu.Unlock()

	cgs.claims[topic] = NewMockConsumerGroupClaim(topic, 0)

	return cgs.claims[topic]
}

// SendMessage sends a message to the consumer
func (cgs *MockConsumerGroupSession) SendMessage(msg *sarama.ConsumerMessage) {
	cgs.mu.RLock()
	defer cgs.mu.RUnlock()

	for topic, claim := range cgs.claims {
		if topic == msg.Topic {
			claim.msgs <- msg
		}
	}
}

// MemberID returns the member ID
// TODO: clarify what that actually means and whether we need to mock that somehow
func (cgs *MockConsumerGroupSession) MemberID() string {
	panic("MemberID not provided by mock")
}

// GenerationID returns the generation ID of the group consumer
func (cgs *MockConsumerGroupSession) GenerationID() int32 {
	return cgs.generation
}

// MarkOffset marks the passed offset consumed in topic/partition
func (cgs *MockConsumerGroupSession) MarkOffset(topic string, partition int32, offset int64, metadata string) {
	cgs.consumerGroup.markMessage(topic, partition, offset, metadata)
}

// Commit the offset to the backend
func (cgs *MockConsumerGroupSession) Commit() {
	panic("not implemented")
}

// ResetOffset resets the offset to be consumed from
func (cgs *MockConsumerGroupSession) ResetOffset(topic string, partition int32, offset int64, metadata string) {
	panic("reset offset is not implemented by the mock")
}

// MarkMessage marks the passed message as consumed
func (cgs *MockConsumerGroupSession) MarkMessage(msg *sarama.ConsumerMessage, metadata string) {
	panic("not implemented")
}

// Context returns the consumer group's context
func (cgs *MockConsumerGroupSession) Context() context.Context {
	return cgs.ctx
}

// MockConsumerGroup mocks the consumergroup
type MockConsumerGroup struct {
	errs chan error

	mu sync.RWMutex

	// setting this makes the consume call fail with this error for testing
	failOnConsume error

	// use the same offset counter for all topics
	offset            int64
	currentGeneration int32

	// messages we sent to the consumergroup and need to wait for
	mMessages  sync.Mutex
	messages   map[int64]int64
	wgMessages sync.WaitGroup

	sessions map[string]*MockConsumerGroupSession
}

// NewMockConsumerGroup creates a new consumer group
func NewMockConsumerGroup(t *testing.T) *MockConsumerGroup {
	return &MockConsumerGroup{
		errs:     make(chan error, 1),
		sessions: make(map[string]*MockConsumerGroupSession),
		messages: make(map[int64]int64),
	}
}

// FailOnConsume marks the consumer to fail on consume
func (cg *MockConsumerGroup) FailOnConsume(err error) {
	cg.failOnConsume = err
}

func (cg *MockConsumerGroup) nextOffset() int64 {
	return atomic.AddInt64(&cg.offset, 1)
}

func (cg *MockConsumerGroup) topicKey(topics []string) string {
	return strings.Join(topics, ",")
}

func (cg *MockConsumerGroup) markMessage(topic string, partition int32, offset int64, metadata string) {
	cg.mMessages.Lock()
	defer cg.mMessages.Unlock()

	cnt := cg.messages[offset-1]

	if cnt == 0 {
		panic(fmt.Errorf("Cannot mark message with offset %d, it's not a valid offset or was already marked", offset))
	}

	cg.messages[offset] = cnt - 1

	cg.wgMessages.Done()
}

// Consume starts consuming from the consumergroup
func (cg *MockConsumerGroup) Consume(ctx context.Context, topics []string, handler sarama.ConsumerGroupHandler) error {
	if cg.failOnConsume != nil {
		return cg.failOnConsume
	}

	key := cg.topicKey(topics)
	for {
		cg.currentGeneration++
		session := newConsumerGroupSession(ctx, cg.currentGeneration, cg, topics)

		cg.sessions[key] = session

		err := handler.Setup(session)
		if err != nil {
			return fmt.Errorf("Error setting up: %v", err)
		}
		errg, _ := multierr.NewErrGroup(ctx)
		for _, topic := range topics {
			claim := session.createGroupClaim(topic, 0)
			errg.Go(func() error {
				<-ctx.Done()
				close(claim.msgs)
				return nil
			})
			errg.Go(func() error {
				err := handler.ConsumeClaim(session, claim)
				return err
			})
		}

		err = multierror.Append(
			// wait for runner errors and collect error
			errg.Wait(),
			// cleanup and collect errors
			handler.Cleanup(session),
		).ErrorOrNil()

		// remove current sessions
		delete(cg.sessions, key)

		if err != nil {
			return fmt.Errorf("Error running or cleaning: %w", err)
		}

		select {
		// if the session was terminated because of a cancelled context,
		// stop the loop
		case <-ctx.Done():
			return nil

			// otherwise just continue with the next generation
		default:
		}
	}
}

// SendError sends an error the consumergroup
func (cg *MockConsumerGroup) SendError(err error) {
	cg.mu.RLock()
	defer cg.mu.RUnlock()
	cg.errs <- err
}

// SendMessage sends a message to the consumergroup
// returns a channel that will be closed when the message has been committed
// by the group
func (cg *MockConsumerGroup) SendMessage(message *sarama.ConsumerMessage) <-chan struct{} {
	cg.mMessages.Lock()
	defer cg.mMessages.Unlock()

	message.Offset = cg.nextOffset()

	var messages int
	for _, session := range cg.sessions {
		session.SendMessage(message)
		messages++
	}

	cg.messages[message.Offset] += int64(messages)
	cg.wgMessages.Add(messages)

	done := make(chan struct{})
	go func() {
		defer close(done)
		cg.wgMessages.Wait()
	}()

	return done
}

// SendMessageWait sends a message to the consumergroup waiting for the message for being committed
func (cg *MockConsumerGroup) SendMessageWait(message *sarama.ConsumerMessage) {
	<-cg.SendMessage(message)
}

// Errors returns the errors channel
func (cg *MockConsumerGroup) Errors() <-chan error {
	cg.mu.RLock()
	defer cg.mu.RUnlock()
	return cg.errs
}

// Close closes the consumergroup
func (cg *MockConsumerGroup) Close() error {
	cg.mu.Lock()
	defer cg.mu.Unlock()

	cg.messages = make(map[int64]int64)

	// close old errs chan and create new one
	close(cg.errs)
	return nil
}

func (cg *MockConsumerGroup) Pause(partitions map[string][]int32) {}

func (cg *MockConsumerGroup) Resume(partitions map[string][]int32) {}

func (cg *MockConsumerGroup) PauseAll() {}

func (cg *MockConsumerGroup) ResumeAll() {}

repository: lovoo/goka

repo_name: lovoo/goka


text:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * File:   IO_Channel.cpp
 * Author: julian
 *
 * Created on December 18, 2018, 6:42 PM
 */

#include "IO_Channel.h"

IO_Channel::IO_Channel() {
    //conf = _conf;
    token="none";
    permission=0;
}

IO_Channel::IO_Channel(const IO_Channel& orig) {
}

IO_Channel::~IO_Channel() {
}

//(*((this->insert(make_pair(k,mapped_type()))).first)).second

extension: cpp


text:
/**************************************************************************\
 *   This file is part of CaSPER.                                          *
 *                                                                         *
 *   Copyright:                                                            *
 *   2011-2011 - Marco Correia <marco.v.correia@gmail.com>           *
 *                                                                         *
 *   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.                                        *
 \*************************************************************************/

#include <casper/lp/var.h>
#include <casper/lp/solver.h>

#include <casper/util/exception.h>

namespace Casper {
namespace LP {

Var::Var(Solver& solver) : solver(solver), id(solver,solver.newVar())
{}

const Var& Var::operator=(const Var& s)
{
	if (&s.solver != &solver)
		throw Exception::InvalidOperation("assigning to an LP::Var associated with a distinct LP::Solver object");
	id = s.id;
	return *this;
}

double Var::getCurValue() const
{	return solver.getValue(id);	}

void Var::getActivityRange(double& lb, double& ub) const
{	solver.getActivityRange(id,lb,ub);	}

} // LP
} // Casper

std::ostream& operator<<(std::ostream& os, const Casper::LP::Var& v)
{
	os << v.getCurValue();
	return os;
}

repository: marcovc/casper

repo_name: marcovc/casper


text:
package event

import (
	"fmt"
	"testing"

	client "github.com/sensu/sensu-go/cli/client/testing"
	test "github.com/sensu/sensu-go/cli/commands/testing"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/mock"
	"github.com/stretchr/testify/require"
)

func TestDeleteCommand(t *testing.T) {
	cli := test.NewMockCLI()
	cmd := DeleteCommand(cli)

	assert.NotNil(t, cmd, "cmd should be returned")
	assert.NotNil(t, cmd.RunE, "cmd should be able to be executed")
	assert.Regexp(t, "delete", cmd.Use)
	assert.Regexp(t, "event", cmd.Short)
}

func TestDeleteCommandRunEClosure(t *testing.T) {
	cli := test.NewMockCLI()
	cli.Client.(*client.MockClient).
		On("DeleteEvent", mock.Anything, mock.Anything, mock.Anything).
		Return(nil)

	cmd := DeleteCommand(cli)
	require.NoError(t, cmd.Flags().Set("skip-confirm", "t"))
	out, err := test.RunCmd(cmd, []string{"foo", "check_foo"})

	assert.NotEmpty(t, out)
	assert.Contains(t, out, "Deleted")
	assert.Nil(t, err)
}

func TestDeleteCommandRunMissingArgs(t *testing.T) {
	cli := test.NewMockCLI()
	cmd := DeleteCommand(cli)
	require.NoError(t, cmd.Flags().Set("skip-confirm", "t"))
	out, err := test.RunCmd(cmd, []string{})

	require.Error(t, err)
	assert.Contains(t, out, "Usage")
}

func TestDeleteCommandRunEClosureWithErr(t *testing.T) {
	cli := test.NewMockCLI()
	cli.Client.(*client.MockClient).
		On("DeleteEvent", mock.Anything, mock.Anything, mock.Anything).
		Return(fmt.Errorf("error"))

	cmd := DeleteCommand(cli)
	require.NoError(t, cmd.Flags().Set("skip-confirm", "t"))
	out, err := test.RunCmd(cmd, []string{"foo", "check_foo"})

	assert.NotNil(t, err)
	assert.Equal(t, "error", err.Error())
	assert.Empty(t, out)
}

func TestDeleteCommandRunEFailConfirm(t *testing.T) {
	assert := assert.New(t)

	cli := test.NewMockCLI()
	cmd := DeleteCommand(cli)
	out, err := test.RunCmd(cmd, []string{"foo", "check_foo"})

	assert.Contains(out, "Canceled")
	assert.NoError(err)
}

repository: sensu/sensu-go

repo_name: sensu/sensu-go

branch_name: refs/heads/main

gha_license_id: MIT


text:
#include "com_chihun_learn_jnidemo_JNIExceptionLearn.h"
#include <android/log.h>
// 信号量
#include <signal.h>
#include <setjmp.h>
#include <pthread.h>

#define LOG_TAG "JNILog"
#define LOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
/*
 * Class:     com_chihun_learn_jnidemo_JNIExceptionLearn
 * Method:    action
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_com_chihun_learn_jnidemo_JNIExceptionLearn_action
  (JNIEnv *env, jclass cls, jstring msg) {

    //const jchar *c_str = env->GetStringChars(msg, JNI_FALSE);
    const char *c_str = env->GetStringUTFChars(msg, JNI_FALSE);
    if (c_str == NULL) {
        return;
    }
    LOGD("message: %s", c_str);

    jthrowable exc = NULL;
    jmethodID mid = env->GetStaticMethodID(cls,"exceptionCallback","()V");
    if (mid != NULL) {
        env->CallStaticVoidMethod(cls,mid);
    }
    LOGD("In C: JNICALL Java_com_chihun_learn_jnidemo_JNIExceptionLearn_action-->called!!!!");
    if (env->ExceptionCheck()) {  // 检查JNI调用是否有引发异常,若有异常返回JNI_TRUE，否则返回JNI_FALSE
        env->ExceptionDescribe();
        env->ExceptionClear(); // 清除引发的异常，在Java层不会打印异常的堆栈信息（如果不清除，后面调用ThrowNew抛出的异常堆栈信息会覆盖前面的异常信息）
        env->ThrowNew(env->FindClass("java/lang/Exception"), "JNI抛出的异常！");
        env->ReleaseStringUTFChars(msg, c_str); // 发生异常后释放前面所分配的内存
        return;
    }

    /*
    exc = env->ExceptionOccurred();  // 返回一个指向当前异常对象的引用，和ExceptionCheck类似，只是返回值不一样,若用异常返回该异常的引用，否则返回NULL
    if (exc) {
        env->ExceptionDescribe(); // 打印Java层抛出的异常堆栈信息
        env->ExceptionClear();        // 清除异常信息

        // 抛出我们自己的异常处理
        jclass newExcCls;
        newExcCls = env->FindClass("java/lang/Exception");
        if (newExcCls == NULL) {
            return;
        }
        env->ThrowNew(newExcCls, "throw from C Code.");
    }*/

    mid = env->GetStaticMethodID(cls,"normalCallback","()V");
    if (mid != NULL) {
        env->CallStaticVoidMethod(cls,mid);
    }
    env->ReleaseStringUTFChars(msg, c_str);
  }
  // 抛出异常工具类 JNU_ThrowByName(env, "java/lang/Exception", "exception from jni: jni exception happened at p0");
  void JNU_ThrowByName(JNIEnv *env, const char *name, const char *msg)
   {
       // 查找异常类
       jclass cls = env->FindClass(name);
       /* 如果这个异常类没有找到，VM会抛出一个NowClassDefFoundError异常 */
       if (cls != NULL) {
           env->ThrowNew(cls, msg);  // 抛出指定名字的异常
       }
       /* 释放局部引用 */
       env->DeleteLocalRef(cls);
   }

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

   /*
   jni捕获异常的方法之二：捕捉系统崩溃信号，适用于代码量大的情况。跳转到指定的异常处理逻辑代码，相当于全局异常处理
   */

   // 定义代码跳转锚点
   sigjmp_buf JUMP_ANCHOR;
   volatile sig_atomic_t error_cnt = 0;

   void exception_handler(int errorCode){
         error_cnt += 1;
         LOGE("JNI_ERROR, error code %d, cnt %d", errorCode, error_cnt);

         // DO SOME CLEAN STAFF HERE...

         // jump to main function to do exception process
         siglongjmp(JUMP_ANCHOR, 1);
   }

   jint process(JNIEnv * env, jobject jobj, jint m, jint n) {
       char* a = NULL;
       int val1 = a[1] - '0';

       char* b = NULL;
       int val2 = b[1] - '0';

       LOGE("val 1 %d", val1);
       return val1/val2;
   }

JNIEXPORT jint JNICALL Java_com_chihun_learn_jnidemo_JNIExceptionLearn_jniDivide
     (JNIEnv * env, jobject jobj, jint m, jint n) {
     // 注册需要捕获的异常信号
           /*
            1    HUP Hangup                        33     33 Signal 33
            2    INT Interrupt                     34     34 Signal 34
            3   QUIT Quit                          35     35 Signal 35
            4    ILL Illegal instruction           36     36 Signal 36
            5   TRAP Trap                          37     37 Signal 37
            6   ABRT Aborted                       38     38 Signal 38
            7    BUS Bus error                     39     39 Signal 39
            8    FPE Floating point exception      40     40 Signal 40
            9   KILL Killed                        41     41 Signal 41
           10   USR1 User signal 1                 42     42 Signal 42
           11   SEGV Segmentation fault            43     43 Signal 43
           12   USR2 User signal 2                 44     44 Signal 44
           13   PIPE Broken pipe                   45     45 Signal 45
           14   ALRM Alarm clock                   46     46 Signal 46
           15   TERM Terminated                    47     47 Signal 47
           16 STKFLT Stack fault                   48     48 Signal 48
           17   CHLD Child exited                  49     49 Signal 49
           18   CONT Continue                      50     50 Signal 50
           19   STOP Stopped (signal)              51     51 Signal 51
           20   TSTP Stopped                       52     52 Signal 52
           21   TTIN Stopped (tty input)           53     53 Signal 53
           22   TTOU Stopped (tty output)          54     54 Signal 54
           23    URG Urgent I/O condition          55     55 Signal 55
           24   XCPU CPU time limit exceeded       56     56 Signal 56
           25   XFSZ File size limit exceeded      57     57 Signal 57
           26 VTALRM Virtual timer expired         58     58 Signal 58
           27   PROF Profiling timer expired       59     59 Signal 59
           28  WINCH Window size changed           60     60 Signal 60
           29     IO I/O possible                  61     61 Signal 61
           30    PWR Power failure                 62     62 Signal 62
           31    SYS Bad system call               63     63 Signal 63
           32     32 Signal 32                     64     64 Signal 64
           */

           // 代码跳转锚点
           if (sigsetjmp(JUMP_ANCHOR, 1) != 0) {
               return -1;
           }

           // 注册要捕捉的系统信号量
           struct sigaction sigact;
           struct sigaction old_action;
           sigaction(SIGABRT, NULL, &old_action);
           if (old_action.sa_handler != SIG_IGN) {
               sigset_t block_mask;
               sigemptyset(&block_mask);
               sigaddset(&block_mask, SIGABRT); // handler处理捕捉到的信号量时，需要阻塞的信号
               sigaddset(&block_mask, SIGSEGV); // handler处理捕捉到的信号量时，需要阻塞的信号

               sigemptyset(&sigact.sa_mask);
               sigact.sa_flags = 0;
               sigact.sa_mask = block_mask;
               sigact.sa_handler = exception_handler;
               sigaction(SIGABRT, &sigact, NULL); // 注册要捕捉的信号
               sigaction(SIGSEGV, &sigact, NULL); // 注册要捕捉的信号
           }

           jint value = process(env, jobj, m, n);
           return value;
   }

repository: xiaoxiaoazhang/AndroidLearn

repo_name: xiaoxiaoazhang/AndroidLearn


text:
# Copyright 2019 NXP

DESCRIPTION = "Hardening Library for Machine Learning Security"
SECTION = "security"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://COPYING;md5=228c72f2a91452b8a03c4cab30f30ef9"

DEPENDS = "opencv"

SRC_URI[md5sum] = "5d071460a06057af29cecfcec610d33d"
SRC_URI[sha256sum] = "71c03a392aacdcc6d485e9001d7911c24d4b90cdbc4b878743bc99ce4625c3dc"

S = "${WORKDIR}/ml-security"

inherit fsl-eula2-unpack2

FILES_${PN} += " \
    ${datadir}/ml-security/examples/* \
"

RDEPENDS_${PN} = "bash"

repository: takayz/meta-dey-ml

repo_name: takayz/meta-dey-ml

extension: bb


text:
file(REMOVE_RECURSE
  "CMakeFiles/strdcta.dir/strcali_dcta.cxx.o"
  "../strdcta.pdb"
  "../strdcta"
)

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

repository: asiarabbit/BINGER

repo_name: asiarabbit/BINGER

gha_language: C


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

#include "syzygy/block_graph/orderers/original_orderer.h"

#include <algorithm>

#include "base/strings/stringprintf.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "syzygy/block_graph/unittest_util.h"

namespace block_graph {
namespace orderers {

namespace {

using testing::Pointwise;

// Declares a tuple matcher that gets the section() property of the first
// value, and compares it to the second value. It would be nice to do
// this with Pointwise(Property(&section, Eq())), but Property can't
// handle tuple matchers.
MATCHER(SectionEq, std::string("has section() ") +
    std::string(negation ? "not " : "") + std::string("equal to")) {
  return ::std::tr1::get<0>(arg)->section() == ::std::tr1::get<1>(arg);
}

// Adds a block to the given block-graph with the provided properties.
BlockGraph::Block* AddBlock(BlockGraph* bg,
                            BlockGraph::Section* section,
                            size_t number,
                            size_t src_addr,
                            bool initialized) {
  DCHECK(bg != NULL);
  DCHECK(section != NULL);

  std::string name = base::StringPrintf("block%d", number);
  BlockGraph::Block* block = bg->AddBlock(
      BlockGraph::DATA_BLOCK, 10, name);
  DCHECK(block != NULL);

  if (src_addr != 0)
    block->source_ranges().Push(
        BlockGraph::Block::DataRange(0, block->size()),
        BlockGraph::Block::SourceRange(BlockGraph::RelativeAddress(src_addr),
                                       block->size()));

  block->set_section(section->id());
  if (initialized) {
    uint8* data = block->AllocateData(block->size());
    // Make some non-zero data so that this block can not be implicitly
    // initialized.
    data[0] = 1;
  }

  return block;
}

}  // namespace

TEST(OriginalOrdererTest, OrderIsAsExpected) {
  BlockGraph bg;
  BlockGraph::Section* section1 = bg.AddSection("section1", 0);
  BlockGraph::Section* section2 = bg.AddSection("section2", 0);
  BlockGraph::Section* section3 = bg.AddSection("section3", 0);

  // Blocks 2 and 3 have the same source range but 3 is not initialized,
  //     testing criteria 1.
  // Blocks 1-3 have source range data, block 4-5 do not. This tests criteria 2.
  // Blocks 1 and 2 have differing source ranges, testing criteria 3.
  // Blocks 4 and 5 are identical except block 5 has a higher block ID, testing
  //     criteria 4.

  // These blocks are scrambled so that ordering them by ID is not correct.
  BlockGraph::Block* block1 = AddBlock(&bg, section1, 3, 30, false);
  BlockGraph::Block* block2 = AddBlock(&bg, section1, 2, 30, true);
  BlockGraph::Block* block3 = AddBlock(&bg, section1, 4, 0, false);
  BlockGraph::Block* block4 = AddBlock(&bg, section1, 1, 10, true);

  // Needs to be created last so that the ID is the greatest.
  BlockGraph::Block* block5 = AddBlock(&bg, section1, 5, 0, false);

  OrderedBlockGraph obg(&bg);

  // Shuffle the sections.
  std::vector<BlockGraph::Section*> sections, shuffled_sections;
  sections.push_back(section1);
  sections.push_back(section2);
  sections.push_back(section3);
  shuffled_sections = sections;
  std::random_shuffle(shuffled_sections.begin(), shuffled_sections.end());
  for (size_t i = 0; i < shuffled_sections.size(); ++i)
    obg.PlaceAtTail(shuffled_sections[i]);

  // Shuffle the blocks in section1.
  BlockVector blocks, shuffled_blocks;
  blocks.push_back(block4);
  blocks.push_back(block2);
  blocks.push_back(block1);
  blocks.push_back(block3);
  blocks.push_back(block5);
  shuffled_blocks = blocks;
  std::random_shuffle(shuffled_blocks.begin(), shuffled_blocks.end());
  for (size_t i = 0; i < shuffled_blocks.size(); ++i)
    obg.PlaceAtTail(section1, shuffled_blocks[i]);

  // Run the default orderer.
  OriginalOrderer orderer;
  EXPECT_TRUE(orderer.OrderBlockGraph(&obg, block1));

  EXPECT_THAT(obg.ordered_sections(),
              Pointwise(SectionEq(), sections));

  EXPECT_THAT(obg.ordered_section(section1).ordered_blocks(),
              Pointwise(testing::Eq(), blocks));
}

}  // namespace orderers
}  // namespace block_graph

repository: pombreda/syzygy

repo_name: pombreda/syzygy

extension: cc


text:
DESCRIPTION = "REC testing recipe. Does nothing, yust says something..."
LICENSE = "REC"
LIC_FILES_CHKSUM = "file://${COREBASE}/../meta-mdm-rec/files/rec-license;md5=cce63d5b4335303d80851a3ffd492e96"
PR = "r0"

# SRC_URI = "git://github.com/linneman/idefix.git"
# SRCREV = "master"
# S = "${WORKDIR}/git"

FILESEXTRAPATHS_prepend := "${WORKSPACE}"
SRC_URI = "file://rec/idefix"
S = "${WORKDIR}/idefix"

inherit autotools

repository: majanko/meta-mdm-rec

repo_name: majanko/meta-mdm-rec


text:
// +build ignore

// This is just a test binary to validate that the package is working correctly
// by trying to do something semi-useful.  It is excluded from the build so that
// it does not get installed by users of this package.
package main

import (
	"flag"
	"fmt"
	"net"
	"net/http"
	"os"
	"strconv"
	"strings"
	"time"

	"github.com/dnesting/uhttp"
)

var (
	address  = flag.String("address", "239.255.255.250:1900", "send requests to this address in host:port form (or [addr%iface]:port for ipv6)")
	waitSecs = flag.Int("wait_secs", 1, "number of seconds to wait for a response")
	target   = flag.String("target", "ssdp:all", "search target (e.g. upnp:rootdevice)")
)

func main() {
	flag.Parse()
	client := uhttp.Client{
		Transport: &uhttp.Transport{
			HeaderCanon: func(n string) string { return strings.ToUpper(n) },
			Repeat:      uhttp.RepeatAfter(50*time.Millisecond, 1),
		},
	}
	req, _ := http.NewRequest("M-SEARCH", "", nil)
	req.URL.Host = *address
	req.URL.Path = "*"
	req.Header.Add("MAN", `"ssdp:discover"`)
	req.Header.Add("MX", strconv.Itoa(*waitSecs))
	req.Header.Add("ST", *target)
	req.Header.Add("CPFN.UPNP.ORG", "Test")

	// Add 500ms to waitSecs to account for any network or device delays.
	wait := time.Duration(*waitSecs)*time.Second + 500*time.Millisecond

	err := client.Do(req, wait, func(sender net.Addr, resp *http.Response) error {
		fmt.Printf("--- From %s:\n", sender)
		resp.Write(os.Stdout)
		fmt.Println("---")
		return nil
	})
	if err != nil {
		fmt.Printf("error: %s\n", err)
	}
}

repository: dnesting/uhttp

repo_name: dnesting/uhttp


text:
package util

// AlibabaMosFalconPosCounterQueryResultDo
type AlibabaMosFalconPosCounterQueryResultDo struct {

    // traceId

    TraceId   string `json:"trace_id,omitempty" xml:"trace_id,omitempty"`

    // total

    Total   int64 `json:"total,omitempty" xml:"total,omitempty"`

    // 是否成功

    Data   *PosInfoDto `json:"data,omitempty" xml:"data,omitempty"`

    // 调用是否成功

    Success   bool `json:"success,omitempty" xml:"success,omitempty"`

    // 错误码

    ErrCode   int64 `json:"err_code,omitempty" xml:"err_code,omitempty"`

    // 额外

    Extra   string `json:"extra,omitempty" xml:"extra,omitempty"`

    // 错误信息

    ErrMsg   string `json:"err_msg,omitempty" xml:"err_msg,omitempty"`

    // 标题

    Titles   []string `json:"titles,omitempty" xml:"titles>string,omitempty"`

}

repository: phpyandong/opentaobao

repo_name: phpyandong/opentaobao


text:
DESCRIPTION = "Lua is a powerful light-weight programming language designed \
for extending applications."
LICENSE = "MIT"
HOMEPAGE = "http://www.lua.org/"

DEPENDS += "readline"
PR = "r0"
SRC_URI = "http://www.lua.org/ftp/lua-${PV}.tar.gz \
           file://makefile.patch;patch=1 \
           file://lua5.1.pc"
S = "${WORKDIR}/lua-${PV}"

inherit binconfig

EXTRA_OEMAKE = "'CC=${CC}' 'MYCFLAGS=${CFLAGS}' 'MYLDFLAGS=${LDFLAGS}'"

do_compile () {
	oe_runmake linux
}

do_stage () {
	oe_libinstall -C src liblua5.1 ${STAGING_LIBDIR}/
	install -d ${STAGING_INCDIR}/lua5.1
	install -m 0644 src/lua.h src/luaconf.h src/lualib.h src/lauxlib.h ${STAGING_INCDIR}/lua5.1
	install -m 0644 ${WORKDIR}/lua5.1.pc ${STAGING_LIBDIR}/pkgconfig/
}

do_install () {
	oe_runmake \
		'INSTALL_TOP=${D}${prefix}' \
		'INSTALL_BIN=${D}${bindir}' \
		'INSTALL_INC=${D}${includedir}/lua5.1' \
		'INSTALL_MAN=${D}${mandir}/man1' \
		'INSTALL_SHARE=${D}${datadir}/lua' \
		install
}


text:
/**
 * \class MuonTemplate
 *
 *
 * Description: L1 Global Trigger muon template.
 *
 * Implementation:
 *    <TODO: enter implementation details>
 *
 * \author: Vasile Mihai Ghete - HEPHY Vienna
 *          Vladimir Rekovic - extend for indexing
 *          Rick Cavanaugh - extend for displaced muons
 *
 * $Date$
 * $Revision$
 *
 */

// this class header
#include "L1Trigger/L1TGlobal/interface/MuonTemplate.h"

// system include files

#include <iostream>
#include <iomanip>

// user include files

//   base class

// forward declarations

// constructors
MuonTemplate::MuonTemplate() : GlobalCondition() { m_condCategory = l1t::CondMuon; }

MuonTemplate::MuonTemplate(const std::string& cName) : GlobalCondition(cName) { m_condCategory = l1t::CondMuon; }

MuonTemplate::MuonTemplate(const std::string& cName, const l1t::GtConditionType& cType)
    : GlobalCondition(cName, l1t::CondMuon, cType) {
  int nObjects = nrObjects();

  if (nObjects > 0) {
    m_objectParameter.reserve(nObjects);

    m_objectType.reserve(nObjects);
    m_objectType.assign(nObjects, l1t::gtMu);
  }
}

// copy constructor
MuonTemplate::MuonTemplate(const MuonTemplate& cp) : GlobalCondition(cp.m_condName) { copy(cp); }

// destructor
MuonTemplate::~MuonTemplate() {
  // empty now
}

// assign operator
MuonTemplate& MuonTemplate::operator=(const MuonTemplate& cp) {
  copy(cp);
  return *this;
}

// setConditionParameter - set the parameters of the condition
void MuonTemplate::setConditionParameter(const std::vector<ObjectParameter>& objParameter,
                                         const CorrelationParameter& corrParameter) {
  m_objectParameter = objParameter;
  m_correlationParameter = corrParameter;
}

void MuonTemplate::print(std::ostream& myCout) const {
  myCout << "\n  MuonTemplate print..." << std::endl;

  GlobalCondition::print(myCout);

  int nObjects = nrObjects();

  for (int i = 0; i < nObjects; i++) {
    myCout << std::endl;
    myCout << "  Template for object " << i << " [ hex ]" << std::endl;
    myCout << "    ptHighThreshold   = " << std::hex << m_objectParameter[i].ptHighThreshold << std::endl;
    myCout << "    ptLowThreshold    = " << std::hex << m_objectParameter[i].ptLowThreshold << std::endl;
    myCout << "    uptHighCut        = " << std::hex << m_objectParameter[i].unconstrainedPtHigh << std::endl;
    myCout << "    uptLowCut         = " << std::hex << m_objectParameter[i].unconstrainedPtLow << std::endl;
    myCout << "    indexHigh           = " << std::hex << m_objectParameter[i].indexHigh << std::endl;
    myCout << "    indexLow            = " << std::hex << m_objectParameter[i].indexLow << std::endl;
    myCout << "    enableMip         = " << std::hex << m_objectParameter[i].enableMip << std::endl;
    myCout << "    enableIso         = " << std::hex << m_objectParameter[i].enableIso << std::endl;
    myCout << "    requestIso        = " << std::hex << m_objectParameter[i].requestIso << std::endl;
    myCout << "    charge            =" << std::dec << m_objectParameter[i].charge << std::endl;
    myCout << "    qualityLUT        = " << std::hex << m_objectParameter[i].qualityLUT << std::endl;
    myCout << "    isolationLUT      = " << std::hex << m_objectParameter[i].isolationLUT << std::endl;
    myCout << "    impactParameterLUT= " << std::hex << m_objectParameter[i].impactParameterLUT << std::endl;
    myCout << "    phiWindow1Lower   =" << std::hex << m_objectParameter[i].phiWindow1Lower << std::endl;
    myCout << "    phiWindow1Upper   =" << std::hex << m_objectParameter[i].phiWindow1Upper << std::endl;
    myCout << "    phiWindow2Lower   =" << std::hex << m_objectParameter[i].phiWindow2Lower << std::endl;
    myCout << "    phiWindow2Upper   =" << std::hex << m_objectParameter[i].phiWindow2Upper << std::endl;

    size_t etaWindowIndex = 1;
    for (const auto& window : m_objectParameter[i].etaWindows) {
      myCout << "    etaWindows[" << etaWindowIndex << "].lower =" << std::hex << window.lower << std::endl;
      myCout << "    etaWindows[" << etaWindowIndex << "].upper =" << std::hex << window.upper << std::endl;
      ++etaWindowIndex;
    }
  }

  if (wsc()) {
    myCout << "  Correlation parameters "
           << "[ hex ]" << std::endl;

    myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;

    myCout << "    deltaEtaRange      = " << std::hex << m_correlationParameter.deltaEtaRange << std::endl;
    myCout << "    deltaPhiRange1Word = " << std::hex << m_correlationParameter.deltaPhiRange1Word << std::endl;
    myCout << "    deltaPhiRange0Word = " << std::hex << m_correlationParameter.deltaPhiRange0Word << std::endl;
    myCout << "    deltaPhiMaxbits    = " << std::hex << m_correlationParameter.deltaPhiMaxbits << std::endl;
  } else {
    if (m_condType == l1t::Type1s) {
      myCout << "  Correlation parameters "
             << "[ hex ]" << std::endl;

      myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << " (charge sign) "
             << std::endl;

    } else {
      myCout << "\n  Correlation parameters "
             << "[ hex ]" << std::endl;

      myCout << "    chargeCorrelation  = " << std::hex << m_correlationParameter.chargeCorrelation << std::endl;
    }
  }

  // reset to decimal output
  myCout << std::dec << std::endl;
}

void MuonTemplate::copy(const MuonTemplate& cp) {
  m_condName = cp.condName();
  m_condCategory = cp.condCategory();
  m_condType = cp.condType();
  m_objectType = cp.objectType();
  m_condGEq = cp.condGEq();
  m_condChipNr = cp.condChipNr();
  m_condRelativeBx = cp.condRelativeBx();

  m_objectParameter = *(cp.objectParameter());
  m_correlationParameter = *(cp.correlationParameter());
}

// output stream operator
std::ostream& operator<<(std::ostream& os, const MuonTemplate& result) {
  result.print(os);
  return os;
}

repository: cms-sw/cmssw

repo_name: cms-sw/cmssw


text:
package main

import (
	"encoding/json"
	"errors"
	"flag"
	"fmt"
	"io/fs"
	"os"
	"path/filepath"
	"strings"

	sabac "github.com/cybozu-go/sabakan/v2/client"
	ign22 "github.com/flatcar/ignition/config/v2_2/types"
	"github.com/vincent-petithory/dataurl"
	"sigs.k8s.io/yaml"
)

func fileExists(path string) (bool, error) {
	_, err := os.Stat(path)

	if err == nil {
		return true, nil
	}
	if errors.Is(err, fs.ErrNotExist) {
		return false, nil
	}

	return false, err
}

var (
	cluster string
)

func init() {
	flag.CommandLine.Usage = func() {
		o := flag.CommandLine.Output()
		fmt.Fprintf(o, "\nUsage: %s --cluster=<cluster> <role>\n", flag.CommandLine.Name())
	}
	flag.StringVar(&cluster, "cluster", "", "cluster flag")
}

func main() {
	err := buildConfig()
	if err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(-1)
	}
}

func buildConfig() error {
	flag.Parse()

	role := flag.Arg(0)
	if len(role) == 0 {
		return fmt.Errorf("please set role argument")
	}

	abs, err := filepath.Abs("../ignitions/roles")
	if err != nil {
		return err
	}

	path := filepath.Join(abs, role, fmt.Sprintf("site-%s.yml", cluster))
	exist, err := fileExists(path)
	if err != nil {
		return err
	}
	if !exist {
		path = filepath.Join(abs, role, "site.yml")
	}

	tmpl, err := sabac.BuildIgnitionTemplate(path, nil)
	if err != nil {
		return err
	}
	var cfg *ign22.Config
	if err := json.Unmarshal(tmpl.Template, &cfg); err != nil {
		return err
	}

	// unescape file contents source
	for i, file := range cfg.Storage.Files {
		source := file.FileEmbedded1.Contents.Source
		source = strings.ReplaceAll(source, "data:,", "")
		decodeContents, err := dataurl.UnescapeToString(source)
		if err != nil {
			return err
		}
		cfg.Storage.Files[i].FileEmbedded1.Contents.Source = decodeContents
	}

	data, err := yaml.Marshal(cfg)
	if err != nil {
		return err
	}
	_, err = os.Stdout.Write(data)

	return err
}

repository: cybozu-go/neco

repo_name: cybozu-go/neco


text:
package explainpanic

import (
	"fmt"

	"github.com/dogmatiq/dogma"
)

// UnexpectedMessage calls fn() and converts dogma.UnexpectedMessage panic
// values to strings that provide more information.
func UnexpectedMessage(
	handler interface{},
	method string,
	m dogma.Message,
	fn func(),
) {
	defer func() {
		v := recover()

		if v == nil {
			return
		}

		if v == dogma.UnexpectedMessage {
			panic(fmt.Sprintf(
				"%T.%s() panicked due to an unexpected message of type %T",
				handler,
				method,
				m,
			))
		}

		panic(v)
	}()

	fn()
}

repository: dogmatiq/aperture

repo_name: dogmatiq/aperture


text:
package routes

import (
	"net/http"

	"github.com/higordiego/curso-alura-crud-golang-web/controllers"
)

// CarregarRotas - handler loading routes
func CarregarRotas() {
	http.HandleFunc("/", controllers.TodosOsProdutos)
	http.HandleFunc("/new", controllers.New)
	http.HandleFunc("/insert", controllers.Insert)
	http.HandleFunc("/delete", controllers.Delete)
	http.HandleFunc("/edit", controllers.Edite)
	http.HandleFunc("/update", controllers.Update)
}

repository: higordiego/curso-alura-crud-golang-web

repo_name: higordiego/curso-alura-crud-golang-web


text:
/**
 * The MIT License (MIT)
 *
 * Copyright (c) 2015-2016 Ripcord Software Ltd
 *
 * 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.
**/

#ifndef RS_JSAPI_EXCEPTIONS_H
#define RS_JSAPI_EXCEPTIONS_H

#include <exception>
#include <string>

#include <jsapi.h>

namespace rs {
namespace jsapi {

class Exception : public std::exception {
public:
    virtual const char* what() const noexcept override {
        return "An exception in JSAPI occurred";
    }
};

class ContextWrongThreadException : public Exception {
public:
    virtual const char* what() const noexcept override {
        return "Context call made from the wrong thread";
    }
};

class ContextThreadInstanceException : public Exception {
public:
    virtual const char* what() const noexcept override {
        return "A context is already active on this thread";
    }
};

class ScriptException : public Exception {
public:
    ScriptException(const char* message, const JSErrorReport* error) :
        message(message != nullptr ? message : ""),
        filename(error->filename != nullptr ? error->filename : ""),
        lineno(error->lineno),
        column(error->column),
        uclinebuf(error->linebuf() != nullptr ? error->linebuf() : u""),
        uctokenOffset(error->tokenOffset()),
        errorNumber(error->errorNumber),
        exnType(error->exnType) {
    }

    ScriptException(const JSErrorReport* error) :
        ScriptException(GetExceptionMessage(error).c_str(), error) {}

    virtual const char* what() const noexcept override {
        return message.length() > 0 ? message.c_str() : "An error or exception happened in JSAPI";
    }

    const std::string message;
    const std::string filename;
    const unsigned lineno;
    const unsigned column;
    const std::u16string uclinebuf;
    const unsigned uctokenOffset;
    const unsigned errorNumber;
    const int16_t exnType;

private:
    static std::string U16toString(const char16_t* ptr);
    static std::string GetExceptionMessage(const JSErrorReport* error);
};

class ValueCastException : public Exception {
public:
    virtual const char* what() const noexcept override {
        return "Invalid object or value cast";
    }
};

class FunctionArgumentsIndexException : public Exception {
public:
    virtual const char* what() const noexcept override {
        return "The FunctionArguments index value was invalid";
    }
};

}}

#endif	/* RS_JSAPI_EXCEPTIONS_H */

extension: h


text:
@misc{pythonxy,
        author="Rayabut, P.",
        title="PythonXY - Scientific-oriented Python Distribution based on Qt and Eclipse",
        howpublished="http://www.pythonxy.com/",
        year="2010"
}

@book{wober,
        author="Karl W. Wöber",
        title="Domain Specific Search Engines",
        year="2006",
        publisher="CABI",
        address="Londres"
}

@article{ong,
        author = "{Toan C. Ong, Michael V. Mannino, Lisa M. Schilling, Michael G. Kahn}",
        title="{Improving record linkage performance in the presence of missing linkage data}",
        year="2014",
        journal="Journal of Biomedical Informatics",
        pages="43--54",
        volume="52"
}

@article{survey,
        author = "{Christen P.}",
        title="{A Survey of Indexing Techniques for Scalable Record Linkage and Deduplication}",
        year="2012",
        journal="IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING",
        pages="1537--1555",
        volume="24"
}

@article{fellegi,
        author = "{Fellegi I., Sunter A.}",
        title="{A theory for record linkage}",
        year="1969",
        journal="Journal of the American Statistical Association",
        pages="1183--1210",
        volume="64"
}

@article{jaro,
        author = "{Winkler, W.}",
        title="{String Comparator Metrics and Enhanced Decision Rules in the Fellegi-Sunter Model of Record Linkage}",
        year="1990",
        journal="Proceedings of the Section on Survey Research Methods",
        pages="354--359"
}

@article{churches,
        author = "{T. Churches, P. Christen, K. Lim, J.X. Zhu}",
        title="{Preparation of Name and Address Data for Record Linkage Using Hidden Markov Models}",
        year="2002",
        journal="BioMed Central Medical Informatics and Decision Making",
        volume="2"
}

@article{clark,
        author = "{Clark D.}",
        title="{Practical Introduction to Record Linkage for Injury Research}",
        year="2004",
        journal="Injury prevention",
        volume="10",
        pages="186--191"
}

@article{survey2,
        author = "{Elmagarmid A. et. al.}",
        title="{Duplicate Record Detection: A Survey}",
        year="2007",
        journal="IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING",
        volume="19",
        pages="1--16"
}

repository: herberthamaral/mestrado

repo_name: herberthamaral/mestrado


text:
package config

// Config is base struct for reading configuration
type Config struct {
	DBPath     string `toml:"db_path"`
	BundlePath string `toml:"bundle_path"`

	Command struct {
		CAPath   string `toml:"ca_path"`
		CertPath string `toml:"cert_path"`
		KeyPath  string `toml:"key_path"`
		Addr     string `toml:"addr"`
	} `toml:"command"`

	Query struct {
		CAPath   string `toml:"ca_path"`
		CertPath string `toml:"cert_path"`
		KeyPath  string `toml:"key_path"`
		Addr     string `toml:"addr"`
	} `toml:"query"`
}

repository: alinz/warpdrive

repo_name: alinz/warpdrive


text:
package tableaupublic

import (
	"errors"
	"fmt"
	"github.com/franela/goreq"
	"io"
	"net/http"
	"os"
	"path/filepath"
	"strings"
	"time"
)

// ErrWorkbookNotFound is returned when a request to
// download a workbook file doesn't return a workbook file.
var ErrWorkbookNotFound = errors.New("workbook not found")

// IsNotFound returns true or false whether the err
// is an ErrWorkbookNotFound error.
func IsNotFound(err error) bool {
	if err == ErrWorkbookNotFound {
		return true
	}

	return false
}

// Workbook contains information about a Tableau Public workbook.
type Workbook struct {
	RepoURL         string `json:"workbookRepoUrl"`
	Size            int64  `json:"size"`
	Title           string `json:"title"`
	Description     string `json:"description"`
	ShowInProfile   bool   `json:"showInProfile"`
	AllowDataAccess bool   `json:"allowDataAccess"`
}

// DownloadWorkbookFile downloads the workbook to the directory and returns
// the full path to the downloaded file. The file name will
// be the repoURL plus a TWB or TWBX extension depending
// on the file type downloaded.
func DownloadWorkbookFile(repoURL string, directory string) (filename string, err error) {
	url := fmt.Sprintf("https://public.tableau.com/workbooks/%v?format=twb", repoURL)

	var res *http.Response
	res, err = http.Get(url)
	if err != nil {
		return
	}
	defer res.Body.Close()

	contentType := res.Header.Get("Content-Type")
	if !strings.EqualFold(contentType, "application/x-twb") {
		err = ErrWorkbookNotFound
		return
	}

	filename = filepath.Join(directory, repoURL)
	disposition := res.Header.Get("Content-Disposition")
	if strings.Contains(strings.ToLower(disposition), ".twbx") {
		filename += ".twbx"
	} else {
		filename += ".twb"
	}

	var out *os.File
	out, err = os.Create(filename)
	if err != nil {
		return
	}
	defer out.Close()

	_, err = io.Copy(out, res.Body)
	return
}

// AllWorkbooks gets a list of all workbooks for the username.
func AllWorkbooks(username string) ([]*Workbook, error) {
	const COUNT = 20
	var index = 0
	var all []*Workbook
	var res *goreq.Response
	var err error
	for {
		res, err = goreq.Request{
			Uri:    fmt.Sprintf("https://public.tableau.com/profile/api/%v/workbooks?no_cache=%v&index=%v&count=%v", username, time.Now().Unix(), index, COUNT),
			Accept: "application/json",
		}.Do()
		if err != nil {
			break
		}

		var workbooks []*Workbook
		err = res.Body.FromJsonTo(&workbooks)
		if err != nil {
			break
		}

		for _, w := range workbooks {
			all = append(all, w)
		}

		if len(workbooks) < COUNT {
			break
		}

		index += len(workbooks)
	}

	return all, err
}

repository: jpoehls/go-tableaupublic

repo_name: jpoehls/go-tableaupublic


text:
package gifcont

import (
	"testing"
)

func Test_byte2color_color2byte(t *testing.T) {
	// check all possible bytes
	for b := 0x00; b <= 0xff; b++ {

		// get color
		c := byte2color(uint8(b))

		// get byte
		ret := color2byte(c)

		// check
		if ret != uint8(b) {
			t.Errorf("wrong return: ret=%x, b=%x, c=%v", ret, b, c)
		}
	}
}

repository: SchnorcherSepp/gifcontainer

repo_name: SchnorcherSepp/gifcontainer


text:
#pragma region License
/*
 * This file is part of the Boomerang Decompiler.
 *
 * See the file "LICENSE.TERMS" for information on usage and
 * redistribution of this file, and for a DISCLAIMER OF ALL
 * WARRANTIES.
 */
#pragma endregion License
#include "TableEntry.h"

TableEntry::TableEntry()
    : m_rtl(Address::INVALID)
{
}

TableEntry::TableEntry(const std::list<QString> &params, const RTL &rtl)
    : m_rtl(rtl)
{
    std::copy(params.begin(), params.end(), std::back_inserter(m_params));
}

int TableEntry::appendRTL(const std::list<QString> &params, const RTL &rtl)
{
    if (!std::equal(m_params.begin(), m_params.end(), params.begin(), params.end())) {
        return -1;
    }

    m_rtl.append(rtl.getStatements());
    return 0;
}

repository: BoomerangDecompiler/boomerang

repo_name: BoomerangDecompiler/boomerang

branch_name: refs/heads/develop

gha_license_id: NOASSERTION


text:
#ifndef GFP_PAINTING_GFP_DRAWING_BOARD_H_
#define GFP_PAINTING_GFP_DRAWING_BOARD_H_

#ifndef GFP_PAINTING_GFP_CONST_H_
#include "painting/gfp_const.h"
#endif

#ifndef GFP_PAINTING_GFP_PEN_H_
#include "painting/gfp_pen.h"
#endif

#include <fstream>

namespace gfp
{

class DrawingBoard
{
private:
    std::string output_file_name_;
    std::ofstream * output_file_stream_;
    std::ostream *board_;
public:
    DrawingBoard();
    DrawingBoard(std::string output_file_name);
    void SetBoard();
    void SetBoard(std::string out_file_name);
    void Draw(Pen *pen);
    void Draw(char c);
    void Put(char c);

    void Close();
};

} // namespace gfp

#endif

repository: erician/gf-parser

repo_name: erician/gf-parser


text:
SUMMARY = "An alternative to dbug-glib."
DESCRIPTION = "An alternative to dbus-glib. It is designed specifically to \
make it comfortable to work with very large and potentially \
complex D-Bus services like e.g. DeviceKit-disks"

HOMEPAGE = "http://cgit.freedesktop.org/~david/eggdbus"
LICENSE = "LGPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=155db86cdbafa7532b41f390409283eb \
                    file://src/eggdbus/eggdbus.h;md5=6b312aef57ed8d738b3f131ad037d6c2"

DEPENDS = "dbus glib-2.0 dbus-glib eggdbus-native"
DEPENDS_class-native = "dbus-native glib-2.0-native dbus-glib-native"

SRC_URI = "http://cgit.freedesktop.org/~david/${BPN}/snapshot/${BPN}-${PV}.tar.bz2 \
    file://gtk-doc.patch \
"
SRC_URI_append_class-target = "file://marshal.patch"
SRC_URI[md5sum] = "0a111faa54dfba2cf432c2c8e8a76e06"
SRC_URI[sha256sum] = "3ad26e271c1a879bafcd181e065fe0ed53b542299a773c3188c9edb25b895ed1"

inherit autotools gtk-doc

EXTRA_OECONF = " --disable-man-pages "

BBCLASSEXTEND = "native"

PARALLEL_MAKE = ""

do_configure_prepend() {
    # Create ChangeLog to walk around automake error.
    # " Makefile.am: error: required file './ChangeLog' not found "
    touch ${S}/ChangeLog
}

branch_name: refs/heads/fido

gha_language: BitBake


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

set(jsoncpp_URL https://github.com/open-source-parsers/jsoncpp.git)
set(jsoncpp_TAG ddabf50f72cf369bf652a95c4d9fe31a1865a781) # 1.8.4
set(jsoncpp_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}/jsoncpp/include)

if(WIN32)
  set(jsoncpp_STATIC_LIBS
    ${CMAKE_CURRENT_BINARY_DIR}/jsoncpp/lib/jsoncpp.lib)
  set(jsoncpp_STATIC_LIBS_DEBUG
    ${CMAKE_CURRENT_BINARY_DIR}/jsoncpp/lib/jsoncppd.lib)
else()
  set(jsoncpp_STATIC_LIBS
    ${CMAKE_CURRENT_BINARY_DIR}/jsoncpp/lib/libjsoncpp.a)
  set(jsoncpp_STATIC_LIBS_DEBUG
    ${CMAKE_CURRENT_BINARY_DIR}/jsoncpp/lib/libjsoncppd.a)
endif()

ExternalProject_Add(jsoncpp-src
  PREFIX jsoncpp
  GIT_REPOSITORY ${jsoncpp_URL}
  GIT_TAG ${jsoncpp_TAG}
  CMAKE_CACHE_ARGS
    -DJSONCPP_WITH_POST_BUILD_UNITTEST:BOOL=OFF
    -DJSONCPP_WITH_TESTS:BOOL=OFF
    -DCMAKE_DEBUG_POSTFIX:STRING=d
    -DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
    -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}
    -DCMAKE_INSTALL_PREFIX:STRING=<INSTALL_DIR>)

include_directories(${jsoncpp_INCLUDE_DIRS})
add_library(jsoncpp STATIC IMPORTED)
add_dependencies(jsoncpp jsoncpp-src)
set_target_properties(jsoncpp PROPERTIES
  IMPORTED_LOCATION ${jsoncpp_STATIC_LIBS}
  IMPORTED_LOCATION_DEBUG ${jsoncpp_STATIC_LIBS_DEBUG})

repository: LoSealL/lltech

repo_name: LoSealL/lltech


text:
package digestmd5

import (
	"testing"

	"github.com/twstrike/coyim/sasl"

	. "gopkg.in/check.v1"
)

func Test(t *testing.T) { TestingT(t) }

type DigestMD5 struct{}

var _ = Suite(&DigestMD5{})

func (s *DigestMD5) Test(c *C) {
	client := Mechanism.NewClient()
	c.Check(client.NeedsMore(), Equals, true)

	client.SetProperty(sasl.AuthID, "chris")
	client.SetProperty(sasl.Password, "secret")
	client.SetProperty(sasl.Service, "imap")
	//client.SetProperty(sasl.Realm, "elwood.innosoft.com")
	client.SetProperty(sasl.QOP, "auth")

	client.SetProperty(sasl.ClientNonce, "OA6MHXh6VqTrRk")

	t, err := client.Step(nil)
	c.Check(err, IsNil)
	c.Check(client.NeedsMore(), Equals, true)
	c.Check(t, IsNil)

	rec := sasl.Token(`realm="elwood.innosoft.com",nonce="OA6MG9tEQGm2hh",qop="auth",algorithm=md5-sess,charset=utf-8`)
	t, err = client.Step(rec)

	c.Check(err, IsNil)
	c.Check(client.NeedsMore(), Equals, true)
	c.Check(t, DeepEquals, sasl.Token(`charset=utf-8,username="chris",realm="elwood.innosoft.com",nonce="OA6MG9tEQGm2hh",nc=00000001,cnonce="OA6MHXh6VqTrRk",digest-uri="imap/elwood.innosoft.com",response=d388dad90d4bbd760a152321f2143af7,qop=auth`))

	rec = sasl.Token("rspauth=ea40f60335c427b5527b84dbabcdfffd")
	t, err = client.Step(rec)

	c.Check(err, IsNil)
	c.Check(client.NeedsMore(), Equals, true)
	c.Check(t, IsNil)

	t, err = client.Step(nil)
	c.Check(err, IsNil)
	c.Check(client.NeedsMore(), Equals, false)
	c.Check(t, IsNil)
}


text:
SUMMARY = "Faust : signal processing language."
SECTION = "multimedia"

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

SRCREV = "2eab0d77c61e3abf8c5abee3f6ab8d4e481542b6"
SRC_URI = "git://git.code.sf.net/p/faudiostream/code;protocol=https"

RDEPENDS_faust = "bash"

FILES_${PN}-staticdev = "/usr/share/faust/iOS/osclib/liboscpack.a \
	/usr/share/faust/iOS/osclib/libOSCFaust.a \
	/usr/share/faust/iOS/osclib/faust/libOSCFaust.a \
	/usr/share/faust/iOS/osclib/oscpack/liboscpack.a "

S = "${WORKDIR}/git"

do_install() {
	oe_runmake install "DESTDIR=${D}" "PREFIX=${prefix}"
}