text:
problems can stand in for the terminal F-coalgebra, which need not exist in general. As examples, we derive structure theoretic results about minimal coalgebras, showing that, for instance minimization of coalgebras is functorial, that products of finitely many minimal coalgebras exist and are given by their largest common subcoalgebra, that minimal subcoalgebras have no inner endomorphisms and show how minimal subcoalgebras can be constructed from Moore-automata. Since the elements of minimal subcoalgebras must correspond uniquely to the formulae of any logic characterizing observational equivalence, we give in the last section a straightforward and self-contained account of the coalgebraic logic of D. Pattinson and L. Schr{\"{o}}der, which we believe is simpler and more direct than the original exposition.},
author = {Gumm, H. Peter},
doi = {10.1007/s10485-007-9116-1},
issn = {0927-2852},
journal = {Appl. Categ. Struct.},
month = dec,
number = {3},
pages = {313--332},
publisher = {Springer},
title = {On minimal coalgebras},
type = {Journal article},
volume = {16},
year = {2007}
}
@misc{Riehl2009,
author = {Riehl, Emily},
title = {Weighted Limits and Colimits},
url = {http://www.math.harvard.edu/$\sim$eriehl/weighted.pdf},
year = {2009}
}
@incollection{Day1969,
abstract = {Predicting the binding mode of flexible polypeptides to proteins is an important task that falls outside the domain of applicability of most small molecule and protein−protein docking tools. Here, we test the small molecule flexible ligand docking program Glide on a set of 19 non-$\alpha$-helical peptides and systematically improve pose prediction accuracy by enhancing Glide sampling for flexible polypeptides. In addition, scoring of the poses was improved by post-processing with physics-based implicit solvent MM- GBSA calculations. Using the best RMSD among the top 10 scoring poses as a metric, the success rate (RMSD ≤ 2.0 {\AA} for the interface backbone atoms) increased from 21% with default Glide SP settings to 58% with the enhanced peptide sampling and scoring protocol in the case of redocking to the native protein structure. This approaches the accuracy of the recently developed Rosetta FlexPepDock method (63% success for these 19 peptides) while being over 100 times faster. Cross-docking was performed for a subset of cases where an unbound receptor structure was available, and in that case, 40% of peptides were docked successfully. We analyze the results and find that the optimized polypeptide protocol is most accurate for extended peptides of limited size and number of formal charges, defining a domain of applicability for this approach.},
archivePrefix = {arXiv},
arxivId = {arXiv:1011.1669v3},
author = {Day, Brian J.},
booktitle = {Reports Midwest Categ. Semin. IV},
doi = {10.1007/BFb0060438},
editor = {{Mac Lane}, Saunders and Appelgate, Harry Wesley and Barr, Michael and Day, Brian J. and Dubuc, Eduardo J. and Phreilambud and Pultr, Ale{\v{s}} and Street, Ross and Tierney, Myles and {\'{S}}wierczkowski, Stanis{\l}aw},
eprint = {arXiv:1011.1669v3},
isbn = {9788578110796},
issn = {1098-6596},
keywords = {icle},
pages = {1--38},
pmid = {25246403},
publisher = {Springer, Berlin, Heidelberg},
series = {Lecture Notes in Mathematics},
title = {On closed categories of functors},
volume = {137},
year = {1970}
}
@phdthesis{Chen2013,
author = {Chen, Liang-Ting},
school = {University of Birmingham},
title = {On a Purely Categorical Framework for Coalgebraic Modal Logic},
year = {2013}
}
@book{Kohlas2003,
address = {London},
author = {Kohlas, J{\"{u}}rg},
doi = {10.1007/978-1-4471-0009-6},
isbn = {978-1-85233-689-9},
pages = {265},
publisher = {Springer-Verlag London},
series = {Discrete Mathematics and Theoretical Computer Science},
title = {Information Algebras},
year = {2003}
}
@article{SLack2004a,
abstract = {We introduce adhesive categories, which are categories with structure ensuring that pushouts along monomorphisms are well- behaved, as well as quasiadhesive categories which restrict attention to regular monomorphisms. Many examples of graphical structures used in computer science are shown to be examples of adhesive and quasi- adhesive categories. Double-pushout graph rewriting generalizes well to rewriting on arbitrary adhesive and quasiadhesive categories. Mathematics},
author = {Ad{\'{a}}mek, Jiř{\'{i}} and L{\"{u}}cke, Dominik and Milius, Stefan},
doi = {10.1051/ita:2007028},
issn = {0988-3754},
journal = {RAIRO - Theor. Informatics Appl.},
keywords = {adhesive categories,and phrases,category theory,extensive categories,quasiadhesive categories},
month = oct,
number = {4},
pages = {447--462},
title = {Recursive coalgebras of finitary functors},
volume = {41},
year = {2007}
}
@article{Adamek2001,
author = {Ad{\'{a}}mek, Jiř{\'{i}} and Rosick{\'{y}}, Jiř{\'{i}}},
journal = {Theory Appl. Categ.},
number = {3},
pages = {33--53},
title = {On sifted colimits and generalized varieties},
volume = {8},
year = {2001}
}
@article{Chargueraud2012,
abstract = {This paper provides an introduction to the locally nameless approach to the representation of syntax with variable binding, focusing in particular on the use of this technique in formal proofs. First, it explains the benefits of representing bound variables with de Bruijn indices while retaining names for free variables. It then describes the operations involved for manipulating syntax in that form, and shows how to define and reason about judgments on locally nameless terms.},
author = {Chargu{\'{e}}raud, Arthur},
doi = {10.1007/s10817-011-9225-2},
issn = {01687433},
journal = {J. Autom. Reason.},
keywords = {Binders,Cofinite quantification,Formal proofs,Locally nameless,Metatheory},
number = {3},
pages = {363--408},
title = {The locally nameless representation},
volume = {49},
year = {2012}
}
@article{Moss2004,
abstract = {This paper connects coalgebra with a long discussion in the foundations of game theory on the modeling of type spaces. We argue that type spaces are coalgebras, that universal type spaces are final coalgebras, and that the modal logics already proposed in the economic theory literature are closely related to those in recent work in coalgebraic modal logic. In the other direction, the categories of interest in this work are usually measurable spaces or compact (Hausdorff) topological spaces. A coalgebraic version of the construction of the universal type space due to Heifetz and Samet [Journal of Economic Theory 82 (2) (1998) 324–341] is generalized for some functors in those categories. Since the concrete categories of interest have not been explored so deeply in the coalgebra literature, we have some new results. We show that every functor on the category of measurable spaces built from constant functors, products, coproducts, and the probability measure space functor has a final coalgebra. Moreover, we construct this final coalgebra from the relevant version of coalgebraic modal logic. Specifically, we consider the set of theories of points in all coalgebras and endow this set with a measurable and coalgebra structure.},
author = {Moss, Lawrence S. and Viglizzo, Ignacio Dario},
doi = {10.1016/j.entcs.2004.02.036},
issn = {15710661},
journal = {Electron. Notes Theor. Comput. Sci.},
keywords = {beliefs,coalgebra,final coalgebra,harsanyi type space,measurable space,probabilities},
month = dec,
pages = {279--295},
title = {Harsanyi type spaces and final coalgebras constructed from satisfied theories},
volume = {106},
year = {2004}
}
@article{Lindstrom1989,
author = {Lindstr{\"{o}}m, Ingrid},
journal = {J. Symb. Log.},
number = {1},
pages = {57--64},
publisher = {Association for Symbolic Logic},
title = {A Construction of Non-Well-Founded Sets within Martin-L{\"{o}}f's Type Theory},
volume = {54},
year = {1989}
}
@article{Domingo-Ferrer2015,
abstract = {$\kappa$-anonymity and $\epsilon$-differential privacy are two mainstream privacy models, the former introduced to anonymize data sets and the latter to limit the knowledge gain that results from including one individual in the data set. Whereas basic $\kappa$-anonymity only protects against identity disclosure, t-closeness was presented as an extension of $\kappa$-anonymity that also protects against attribute disclosure. We show here that, if not quite equivalent, t-closeness and $\epsilon$-differential privacy are strongly related to one another when it comes to anonymizing data sets. Specifically, $\kappa$-anonymity for the quasi-identifiers combined with $\epsilon$-differential privacy for the confidential attributes yields stochastic t-closeness (an extension of t-closeness), with t a function of $\kappa$ and $\epsilon$ Conversely, t-closeness can yield $\epsilon$-differential privacy when t = exp($\epsilon$/2) and the assumptions made by t-closeness about the prior and posterior views of the data hold.},
archivePrefix = {arXiv},
arxivId = {1512.05110},
author = {Domingo-Ferrer, Josep and Soria-Comas, Jordi},
doi = {10.1016/j.knosys.2014.11.011},
eprint = {1512.05110},
isbn = {09507051},
issn = {09507051},
journal = {Knowledge-Based Syst.},
keywords = {Data anonymization,Semantic anonymization,Statistical disclosure control,Syntactic anonymization,t-closeness,$\epsilon$-differential privacy},
pages = {151--158},
publisher = {Elsevier B.V.},
title = {From $t$-closeness to differential privacy and vice versa in data anonymization},
volume = {74},
year = {2015}
}
@incollection{Bauer2012a,
abstract = {This paper proposes a new theory of quantitative specifications. It generalizes the notions of step-wise refinement and compositional design operations from the Boolean to an arbitrary quantitative setting. It is shown that this general approach permits to recast many existing problems which arise in system design.},
author = {Bauer, Sebastian S and Fahrenberg, Uli and Legay, Axel and Thrane, Claus},
booktitle = {7th Int. Comput. Sci. - Theory Appl.},
doi = {10.1007/978-3-642-30642-6_3},
editor = {Hirsch, Edward and Karhum{\"{a}}ki, Juhani and Lepist{\"{o}}, Arto and Prilutskii, Michail},
isbn = {978-3-642-30641-9},
pages = {18--30},
publisher = {Springer Berlin / Heidelberg},
series = {Lecture Notes in Computer Science},
title = {General Quantitative Specification Theories with Modalities},
year = {2012}
}
@inproceedings{Barthe2014,
abstract = {Differential privacy is a rigorous, worst-case notion of privacy-preserving computation. Informally, a probabilistic program is differentially private if the participation of a single individual in the input database has a limited effect on the program's distribution on outputs. More technically, differential privacy is a quantitative 2-safety property that bounds the distance between the output distributions of a probabilistic program on adjacent inputs. Like many 2-safety properties, differential privacy lies outside the scope of traditional verification techniques. Existing approaches to enforce privacy are based on intricate, non-conventional type systems, or customized relational logics. These approaches are difficult to implement and often cumbersome to use. We present an alternative approach that verifies differential privacy by standard, non-relational reasoning on non-probabilistic programs. Our approach transforms a probabilistic program into a non-probabilistic program which simulates two executions of the original program. We prove that if the target program is correct with respect to a Hoare specification, then the original probabilistic program is differentially private. We provide a variety of examples from the differential privacy literature to demonstrate the utility of our approach. Finally, we compare our approach with existing verification techniques for privacy.},
archivePrefix = {arXiv},
arxivId = {1407.2988},
author = {Barthe, Gilles and Gaboardi, Marco and {Gallego Arias}, Emilio Jesus and Hsu, Justin and Kunz, Cesar and Strub, Pierre-Yves},
booktitle = {2014 IEEE 27th Comput. Secur. Found. Symp.},
doi = {10.1109/CSF.2014.36},
eprint = {1407.2988},
isbn = {978-1-4799-4290-9},
issn = {10636900},
keywords = {Differential privacy,Hoare logic,Privacy,Probabilistic hoare logic,Relational hoare logic,Verification},
month = jul,
pages = {411--424},
publisher = {IEEE},
title = {Proving differential privacy in Hoare logic},
volume = {2014-Janua},
year = {2014}
}
@incollection{Henzinger1991,
author = {Henzinger, Thomas A and Manna, Zohar and Pnueli, Amir},
booktitle = {Real-Time Theory Pract.},
doi = {10.1007/BFb0031995},
isbn = {978-3-540-55564-3},
keywords = {1this research was supported,by the defense advanced,by the national science,ccr-89-13641,concurrency,founda-,ibm graduate fellowship,in part by an,real time,research projects agency under,tion grants ccr-89-11512 and,transition systems},
pages = {226--251},
title = {Timed transition systems},
volume = {3096},
year = {1992}
}
@inproceedings{Gehrke2011,
author = {Gehrke, Mai},
booktitle = {Proc. 36th Int. Symp. Math. Found. Comput. Sci.},
doi = {10.1007/978-3-642-22993-0_3},
isbn = {9783642229923},
issn = {03029743},
pages = {3--18},
publisher = {Springer Berlin Heidelberg},
series = {Lecture Notes in Computer Science},
title = {Duality and Recognition},
volume = {6907},
year = {2011}
}
@book{Kashiwara2006,
address = {Berlin/Heidelberg},
author = {Kashiwara, Masaki and Schapira, Pierre},
doi = {10.1007/3-540-27950-4},
isbn = {3-540-27949-0},
pages = {497},
publisher = {Springer-Verlag},
series = {Grundlehren der mathematischen Wissenschaften},
title = {Categories and Sheaves},
volume = {332},
year = {2006}
}
@book{Awodey2010a,
author = {Awodey, Steve},
edition = {2},
isbn = {978-0-19-923718-0},
pages = {336},
publisher = {Oxford University Press},
series = {Oxford Logic Guides},
title = {Category Theory},
year = {2010}
}
@article{Rodriguez-Lopez2002,
abstract = {We investigate the problem of characterizing those quasi-uniform spaces for which the Vietoris topology is compatible with the Hausdorff quasi-uniformity. In particular, we prove that the Vietoris topology of a quasi-uniform space (X,U) is compatible with the Hausdorff quasi-uniformity on the family K 0(X) of nonempty compact subsets of X, if and only if for each K∈K 0(X),U -1 K is precompact. We show that for a T 1 quasi-uniform space (X,U), the Vietoris topology is compatible with the Hausdorff quasi-uniformity on the family of nonempty closed subsets of X, if and only if U is equinormal and U -1 is hereditarily precompact. We also discuss the problem in the setting of quasi-metric spaces and show, among other results, that the Vietoris topology of a quasi-metric space (X,d) is compatible with the Hausdorff extended quasi-pseudo-metric on the family of nonempty subsets of X, if and only if the quasi-uniformity induced by d coincides with the Pervin quasi-uniformity of X. {\textcopyright} 2001 Elsevier Science B.V. All rights reserved.},
author = {Rodr{\'{i}}guez-L{\'{o}}pez, Jes{\'{u}}s and Romaguera, Salvador},
doi = {10.1016/S0166-8641(01)00252-8},
issn = {01668641},
journal = {Topol. Appl.},
keywords = {Equinormal,Hausdorff quasi-uniformity,Hereditarily precompact,Pervin quasi-uniformity,Proximal topology,Quasi-metric,Uqu space,Vietoris topology},
month = oct,
number = {3},
pages = {451--464},
title = {The relationship between the Vietoris topology and the Hausdorff quasi-uniformity},
volume = {124},
year = {2002}
}
@incollection{Appelgate1969,
author = {Appelgate, Harry Wesley and Tierney, M},
booktitle = {Semin. Triples Categ. Homol. Theory},
doi = {10.1007/BFb0083086},
editor = {{B. Eckmann}},
pages = {156--244},
publisher = {Springer Berlin Heidelberg},
series = {Lecture Notes in Mathematics},
title = {Categories with models},
year = {1969}
}
@article{Ohm2010,
abstract = {Computer scientists have recently undermined our faith in the privacy- protecting power of anonymization, the name for techniques that protect the privacy of individuals in large databases by deleting information like names and social security numbers. These scientists have demonstrated that they can often “reidentify” or “deanonymize” individuals hidden in anonymized data with astonishing ease. By understanding this research, we realize we have made a mistake, labored beneath a fundamental misunderstanding, which has assured us much less privacy than we have assumed. This mistake pervades nearly every information privacy law, regulation, and debate, yet regulators and legal scholars have paid it scant attention. We must respond to the surprising failure of anonymization, and this Article provides the tools to do so.},
archivePrefix = {arXiv},
arxivId = {arXiv:gr-qc/9809069v1},
author = {Ohm, Paul},
doi = {10.2139/ssrn.1450006},
eprint = {9809069v1},
isbn = {0041-5650},
issn = {00415650},
journal = {UCLA Law Rev.},
number = {6},
pages = {1701--1777},
pmid = {15003161},
primaryClass = {arXiv:gr-qc},
title = {Broken Promises of Privacy: Responding to the Surprising Failure of Anonymization},
volume = {57},
year = {2010}
}
@article{Pattinson2004,
author = {Pattinson, Dirk},
issn = {1939-0726},
journal = {Notre Dame J. Form. Log.},
keywords = {behavioral equivalence,coalgebra,modal logic},
number = {1},
pages = {19--33},
title = {Expressive logics for coalgebras via terminal sequence induction},
volume = {45},
year = {2004}
}
@misc{Day1978,
author = {Day, Brian J.},
booktitle = {Bull. Aust. Math. Soc.},
doi = {10.1017/S0004972700008613},
issn = {0004-9727},
number = {03},
pages = {475--480},
title = {Duality in topological algebra},
volume = {18},
year = {1978}
}
@article{Determann2018,
author = {Determann, Lothar},
doi = {10.2139/ssrn.3123957},
issn = {1556-5068},
journal = {SSRN Electron. J.},
number = {265},
pages = {1--49},
title = {No One Owns Data},
year = {2018}
}
@incollection{Dinesh2008a,
abstract = {This paper considers the problem of checking whether an organization conforms to a body of regulation. Conformance is cast as a trace checking question {\^{a}}€“ the regulation is represented in a logic that is evaluated against an abstract trace or run representing the operations of an organization. We focus on a problem in designing a logic to represent regulation.\nA common phenomenon in regulatory texts is for sentences to refer to others for conditions or exceptions. We motivate the need for a formal representation of regulation to accomodate such references between statements. We then extend linear temporal logic to allow statements to refer to others. The semantics of the resulting logic is defined via a combination of techniques from Reiter{\^{a}}€™s default logic and Kripke{\^{a}}€™s theory of truth.\n},
author = {Dinesh, Nikhil and Joshi, Aravind and Lee, Insup and Sokolsky, Oleg},
booktitle = {Log. Comput. Sci. DEON 2008},
doi = {10.1007/978-3-540-70525-3_10},
editor = {van der Meyden, Ron and van der Torre, Leendert},
isbn = {3540705244},
issn = {03029743},
pages = {110--124},
publisher = {Springer, Berlin, Heidelberg},
series = {Lecture Notes in Computer Science},
title = {Reasoning about conditions and exceptions to laws in regulatory conformance checking},
volume = {5076},
year = {2008}
}
@book{Yager,
abstract = {In this review paper we survey the ways in which various micropipet techniques have been used to study the mechanochemical and interactive features of lipid bilayer vesicles and monolayer-coated gas bubbles. Special emphasis will be made on characterizing the barrier properties of grafted PEG layers and how a hierarchical approach that uses a short barrier and extended ligand allows us to start to mimic nature's own solution to the problem of ubiquitous repulsion and specific attraction. The information gained from such studies not only characterizes the membrane and other lipid surfaces and their intersurface interactions from a fundamental materials science perspective, but also provides essential materials property data that are required for the successful design and deployment of lipid-based carriers and other capsules in applications involving this so-called 'stealthy' surface. (C) 2000 Elsrvier Science B.V. All rights reserved},
address = {Berlin, Heidelberg},
doi = {10.1007/978-3-540-44792-4},
editor = {Yager, Roland R. and Liu, Liping},
isbn = {978-3-540-25381-5},
publisher = {Springer Berlin Heidelberg},
series = {Studies in Fuzziness and Soft Computing},
title = {Classic Works of the Dempster-Shafer Theory of Belief Functions},
volume = {219},
year = {2008}
}
@inproceedings{Polak2001,
author = {Pol{\'{a}}k, Libor},
booktitle = {Math. Found. Comput. Sci.},
doi = {10.1007/3-540-44683-4_53},
editor = {Sgall, Jiř{\'{i}} and Pultr, Ale{\v{s}} and Kolman, Petr},
keywords = {rational languages,syntactic semiring},
pages = {611--620},
publisher = {Springer Berlin Heidelberg},
series = {Lecture Notes in Computer Science},
title = {Syntactic Semiring of a Language},
year = {2001}
}

license_type: permissive

branch_name: refs/heads/master

extension: bib


text:
DESCRIPTION = "Fast, simple object-to-object and broadcast signaling."
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=42cd19c88fc13d1307a4efd64ee90e4e"

SRC_URI[sha256sum] = "4afd3de66ef3a9f8067559fb7a1cbe555c17dcbe15971b05d1b625c3e7abe213"

inherit pypi python_setuptools_build_meta ptest

SRC_URI += "file://run-ptest"

RDEPENDS:${PN} += "\
        ${PYTHON_PN}-asyncio \
"

RDEPENDS:${PN}-ptest += " \
	${PYTHON_PN}-pytest \
"

do_install_ptest() {
	install -d ${D}${PTEST_PATH}/tests
	cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
}

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_license_id: MIT

gha_language: BitBake

extension: bb


text:
package sarama

import (
	"fmt"
	"sync"
	"testing"
	"time"
)

const TestBatchSize = 1000

func TestFuncProducing(t *testing.T) {
	config := NewConfig()
	testProducingMessages(t, config)
}

func TestFuncProducingGzip(t *testing.T) {
	config := NewConfig()
	config.Producer.Compression = CompressionGZIP
	testProducingMessages(t, config)
}

func TestFuncProducingSnappy(t *testing.T) {
	config := NewConfig()
	config.Producer.Compression = CompressionSnappy
	testProducingMessages(t, config)
}

func TestFuncProducingNoResponse(t *testing.T) {
	config := NewConfig()
	config.Producer.RequiredAcks = NoResponse
	testProducingMessages(t, config)
}

func TestFuncProducingFlushing(t *testing.T) {
	config := NewConfig()
	config.Producer.Flush.Messages = TestBatchSize / 8
	config.Producer.Flush.Frequency = 250 * time.Millisecond
	testProducingMessages(t, config)
}

func TestFuncMultiPartitionProduce(t *testing.T) {
	setupFunctionalTest(t)
	defer teardownFunctionalTest(t)

	config := NewConfig()
	config.ChannelBufferSize = 20
	config.Producer.Flush.Frequency = 50 * time.Millisecond
	config.Producer.Flush.Messages = 200
	config.Producer.Return.Successes = true
	producer, err := NewSyncProducer(kafkaBrokers, config)
	if err != nil {
		t.Fatal(err)
	}

	var wg sync.WaitGroup
	wg.Add(TestBatchSize)

	for i := 1; i <= TestBatchSize; i++ {
		go func(i int) {
			defer wg.Done()
			msg := &ProducerMessage{Topic: "test.64", Key: nil, Value: StringEncoder(fmt.Sprintf("hur %d", i))}
			if _, _, err := producer.SendMessage(msg); err != nil {
				t.Error(i, err)
			}
		}(i)
	}

	wg.Wait()
	if err := producer.Close(); err != nil {
		t.Error(err)
	}
}

func TestFuncProducingToInvalidTopic(t *testing.T) {
	setupFunctionalTest(t)
	defer teardownFunctionalTest(t)

	producer, err := NewSyncProducer(kafkaBrokers, nil)
	if err != nil {
		t.Fatal(err)
	}

	if _, _, err := producer.SendMessage(&ProducerMessage{Topic: "in/valid"}); err != ErrUnknownTopicOrPartition {
		t.Error("Expected ErrUnknownTopicOrPartition, found", err)
	}

	if _, _, err := producer.SendMessage(&ProducerMessage{Topic: "in/valid"}); err != ErrUnknownTopicOrPartition {
		t.Error("Expected ErrUnknownTopicOrPartition, found", err)
	}

	safeClose(t, producer)
}

func testProducingMessages(t *testing.T, config *Config) {
	setupFunctionalTest(t)
	defer teardownFunctionalTest(t)

	config.Producer.Return.Successes = true
	config.Consumer.Return.Errors = true

	client, err := NewClient(kafkaBrokers, config)
	if err != nil {
		t.Fatal(err)
	}

	master, err := NewConsumerFromClient(client)
	if err != nil {
		t.Fatal(err)
	}
	consumer, err := master.ConsumePartition("test.1", 0, OffsetNewest)
	if err != nil {
		t.Fatal(err)
	}

	producer, err := NewAsyncProducerFromClient(client)
	if err != nil {
		t.Fatal(err)
	}

	expectedResponses := TestBatchSize
	for i := 1; i <= TestBatchSize; {
		msg := &ProducerMessage{Topic: "test.1", Key: nil, Value: StringEncoder(fmt.Sprintf("testing %d", i))}
		select {
		case producer.Input() <- msg:
			i++
		case ret := <-producer.Errors():
			t.Fatal(ret.Err)
		case <-producer.Successes():
			expectedResponses--
		}
	}
	for expectedResponses > 0 {
		select {
		case ret := <-producer.Errors():
			t.Fatal(ret.Err)
		case <-producer.Successes():
			expectedResponses--
		}
	}
	safeClose(t, producer)

	for i := 1; i <= TestBatchSize; i++ {
		select {
		case <-time.After(10 * time.Second):
			t.Fatal("Not received any more events in the last 10 seconds.")

		case err := <-consumer.Errors():
			t.Error(err)

		case message := <-consumer.Messages():
			if string(message.Value) != fmt.Sprintf("testing %d", i) {
				t.Fatalf("Unexpected message with index %d: %s", i, message.Value)
			}
		}

	}
	safeClose(t, consumer)
	safeClose(t, client)
}

// Benchmarks

func BenchmarkProducerSmall(b *testing.B) {
	benchmarkProducer(b, nil, "test.64", ByteEncoder(make([]byte, 128)))
}
func BenchmarkProducerMedium(b *testing.B) {
	benchmarkProducer(b, nil, "test.64", ByteEncoder(make([]byte, 1024)))
}
func BenchmarkProducerLarge(b *testing.B) {
	benchmarkProducer(b, nil, "test.64", ByteEncoder(make([]byte, 8192)))
}
func BenchmarkProducerSmallSinglePartition(b *testing.B) {
	benchmarkProducer(b, nil, "test.1", ByteEncoder(make([]byte, 128)))
}
func BenchmarkProducerMediumSnappy(b *testing.B) {
	conf := NewConfig()
	conf.Producer.Compression = CompressionSnappy
	benchmarkProducer(b, conf, "test.1", ByteEncoder(make([]byte, 1024)))
}

func benchmarkProducer(b *testing.B, conf *Config, topic string, value Encoder) {
	setupFunctionalTest(b)
	defer teardownFunctionalTest(b)

	producer, err := NewAsyncProducer(kafkaBrokers, conf)
	if err != nil {
		b.Fatal(err)
	}

	b.ResetTimer()

	for i := 1; i <= b.N; {
		msg := &ProducerMessage{Topic: topic, Key: StringEncoder(fmt.Sprintf("%d", i)), Value: value}
		select {
		case producer.Input() <- msg:
			i++
		case ret := <-producer.Errors():
			b.Fatal(ret.Err)
		}
	}
	safeClose(b, producer)
}

repository: f/koding

repo_name: f/koding

gha_language: CoffeeScript

extension: go


text:
package webglglobe

import (
	"math"

	"github.com/go4orward/gowebgl/geom3d"
	"github.com/go4orward/gowebgl/webgl3d"
)

type WorldCamera struct {
	gcam *webgl3d.Camera // Perspective Globe Camera
	// TODO: Add support for Orthographic projection camera
	// TODO: Add more cameras for flat world map projections
}

func NewWorldCamera(wh [2]int, fov float32, zoom float32) *WorldCamera {
	camera := webgl3d.NewPerspectiveCamera(wh, fov, zoom) // AspectRatio, FieldOfView, ZoomLevel
	self := WorldCamera{gcam: camera}
	return &self
}

func (self *WorldCamera) ShowInfo() {
	self.gcam.ShowInfo()
}

// ----------------------------------------------------------------------------
// Camera Internal Parameters
// ----------------------------------------------------------------------------

func (self *WorldCamera) SetAspectRatio(width int, height int) *WorldCamera {
	self.gcam.SetAspectRatio(width, height)
	return self
}

func (self *WorldCamera) SetZoom(zoom float32) *WorldCamera {
	self.gcam.SetZoom(zoom)
	return self
}

// ----------------------------------------------------------------------------
// Camera Pose
// ----------------------------------------------------------------------------

func (self *WorldCamera) SetPoseByLonLat(lon float32, lat float32, dist float32) *WorldCamera {
	Twc := GetXYZFromLonLat(lon, lat, dist)              // Camera center in WORLD space
	coslon := float32(math.Cos(float64(lon) * InRadian)) // cos(λ)
	sinlon := float32(math.Sin(float64(lon) * InRadian)) // sin(λ)
	camX := [3]float32{-sinlon, +coslon, 0}              // this prevents UP vector singularity at poles
	camZ := geom3d.Normalize(Twc)                        // camera's Z axis points backward (away from view frustum)
	camY := geom3d.CrossAB(camZ, camX)
	self.gcam.SetPoseWithCameraAxes(camX, camY, camZ, Twc)
	return self
}

func (self *WorldCamera) RotateAroundGlobe(horizontal_angle float32, vertical_angle float32) *WorldCamera {
	self.gcam.RotateAroundPoint(10, horizontal_angle, vertical_angle)
	self.RotateByRollToHeadUpNorth()
	return self
}

func (self *WorldCamera) RotateByRollToHeadUpNorth() *WorldCamera {
	e := self.gcam.GetViewMatrix().GetElements()
	// Note that {e[8],e[9]} is the NORTH (0,0,1) projected onto XY plane of Camera axes in WORLD space.
	if e[8]*e[8]+e[9]*e[9] > 0.01 { // Now compare {e[8],e[9]} with Y direction (90°) in CAMERA space.
		roll := 90 - float32(math.Atan2(float64(e[9]), float64(e[8])))*InDegree
		self.gcam.RotateByRoll(roll)
	}
	return self
}

// ----------------------------------------------------------------------------
//
// ----------------------------------------------------------------------------

branch_name: refs/heads/main

gha_language: Go


text:
@proceedings{SM19,
author={Soos, Mate and  Meel, Kuldeep S.},
title={BIRD: Engineering an Efficient CNF-XOR SAT Solver and its Applications to Approximate Model Counting},
booktitle={Proceedings of AAAI Conference on Artificial Intelligence (AAAI)},
month={1},
year={2019},
code={https://github.com/meelgroup/approxmc},
abstract={Given a Boolean formula F, the problem of model counting, also referred to as #SAT is to compute the number of solutions of F. Model counting is a fundamental problem in artificial intelligence with a wide range of applications including probabilistic reasoning, decision making under uncertainty, quantified information flow, and the like. Motivated by the success of SAT solvers, there has been surge of interest in the design of hashing-based techniques for approximate model counting for the past decade. We profiled the state of the art approximate model counter ApproxMC3 and observed that over 99.99% of time is consumed by the underlying SAT solver, CryptoMinisat. This observation motivated us to ask: Can we design an efficient underlying CNF-XOR SAT solver that can take advantage of the structure of hashing-based algorithms and would this lead to an efficient approximate model counter? The primary contribution of this paper is an affirmative answer to the above question. We present a novel architecture, called BIRD, to handle CNF-XOR formulas arising from hashing-based techniques. The resulting hashing-based approximate model counter, called ApproxMC3, employs the BIRD framework in its underlying SAT solver, CryptoMinisat. To the best of our knowledge, we conducted the most comprehensive study of evaluation performance of counting algorithms involving 1896 benchmarks with computational effort totaling 86400 computational hours. Our experimental evaluation demonstrates significant runtime performance improvement for ApproxMC3 over ApproMC2. In particular, we solve 648 benchmarks more than ApproMC2, the state of the art approximate model counter and for all the formulas where both ApproMC2 and ApproxMC3 did not timeout and took more than 1 seconds, the mean speedup is 284.40 -- more than two orders of magnitude.},
}

license: MIT

repository: meelgroup/meelgroup-website

repo_name: meelgroup/meelgroup-website

gha_language: TeX


text:
/*
Copyright 2019 Cisco Systems

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

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

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

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

package cisco_ios_xr_bundlemgr_oper_bundle_information_mac_allocation_mac_allocation_global_mac_allocation_global_item

import (
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	math "math"
)

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

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

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

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

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

var xxx_messageInfo_BmMacAlloc_KEYS proto.InternalMessageInfo

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

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

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

var xxx_messageInfo_BmMacAddrSt proto.InternalMessageInfo

func (m *BmMacAddrSt) GetAddress() string {
	if m != nil {
		return m.Address
	}
	return ""
}

type BmMacAlloc struct {
	MacAddress           []*BmMacAddrSt `protobuf:"bytes,50,rep,name=mac_address,json=macAddress,proto3" json:"mac_address,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

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

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

var xxx_messageInfo_BmMacAlloc proto.InternalMessageInfo

func (m *BmMacAlloc) GetMacAddress() []*BmMacAddrSt {
	if m != nil {
		return m.MacAddress
	}
	return nil
}

func init() {
	proto.RegisterType((*BmMacAlloc_KEYS)(nil), "cisco_ios_xr_bundlemgr_oper.bundle_information.mac_allocation.mac_allocation_global.mac_allocation_global_item.bm_mac_alloc_KEYS")
	proto.RegisterType((*BmMacAddrSt)(nil), "cisco_ios_xr_bundlemgr_oper.bundle_information.mac_allocation.mac_allocation_global.mac_allocation_global_item.bm_mac_addr_st")
	proto.RegisterType((*BmMacAlloc)(nil), "cisco_ios_xr_bundlemgr_oper.bundle_information.mac_allocation.mac_allocation_global.mac_allocation_global_item.bm_mac_alloc")
}

func init() { proto.RegisterFile("bm_mac_alloc.proto", fileDescriptor_47c2a08817ad8ba3) }

var fileDescriptor_47c2a08817ad8ba3 = []byte{
	// 192 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4a, 0xca, 0x8d, 0xcf,
	0x4d, 0x4c, 0x8e, 0x4f, 0xcc, 0xc9, 0xc9, 0x4f, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xca,
	0x4b, 0xce, 0x2c, 0x4e, 0xce, 0x8f, 0xcf, 0xcc, 0x2f, 0x8e, 0xaf, 0x28, 0x8a, 0x4f, 0x2a, 0xcd,
	0x4b, 0xc9, 0x49, 0xcd, 0x4d, 0x2f, 0x8a, 0xcf, 0x2f, 0x48, 0x2d, 0xd2, 0x83, 0x70, 0xe3, 0x33,
	0xf3, 0xd2, 0xf2, 0x8b, 0x72, 0x13, 0x4b, 0x32, 0xf3, 0xf3, 0xf4, 0xe0, 0xfa, 0xb1, 0x71, 0xe3,
	0xd3, 0x73, 0xf2, 0x93, 0x12, 0x73, 0xb0, 0x8b, 0xc6, 0x67, 0x96, 0xa4, 0xe6, 0x2a, 0x09, 0x73,
	0x09, 0x22, 0xbb, 0x22, 0xde, 0xdb, 0x35, 0x32, 0x58, 0x49, 0x8b, 0x8b, 0x0f, 0x26, 0x98, 0x92,
	0x52, 0x14, 0x5f, 0x5c, 0x22, 0x24, 0xc1, 0xc5, 0x0e, 0x62, 0xa6, 0x16, 0x17, 0x4b, 0x30, 0x2a,
	0x30, 0x6a, 0x70, 0x06, 0xc1, 0xb8, 0x4a, 0x1b, 0x18, 0xb9, 0x78, 0x90, 0x4d, 0x10, 0x9a, 0xcf,
	0xc8, 0xc5, 0x0d, 0xd3, 0x0a, 0x52, 0x6f, 0xa4, 0xc0, 0xac, 0xc1, 0x6d, 0x54, 0xa7, 0x47, 0x5f,
	0x8f, 0xe9, 0xa1, 0x7a, 0x20, 0x88, 0x2b, 0x37, 0x31, 0xd9, 0x11, 0xe2, 0xa2, 0x24, 0x36, 0x70,
	0x50, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x23, 0x7b, 0x27, 0x80, 0x01, 0x00, 0x00,
}

repository: cisco-ie/cisco-proto

repo_name: cisco-ie/cisco-proto


text:
@article{pasunuru2017multi,
  title={Multi-task video captioning with video and entailment generation},
  author={Pasunuru, Ramakanth and Bansal, Mohit},
  journal={arXiv preprint arXiv:1704.07489},
  year={2017},
  url={https://arxiv.org/pdf/1704.07489}
}

url: https://raw.githubusercontent.com/rbt-c/DL-NLP-Readings/82ca76e9184a3b00ac87129d99391477c85cfcd2/Bibtex/Multi-Task Video Captioning with Video and Entailment Generation.bib

repository: rbt-c/DL-NLP-Readings

repo_name: rbt-c/DL-NLP-Readings


text:
SUMMARY = "Python Qt5 Bindings"
AUTHOR = "Phil Thomson @ riverbank.co.uk"
HOMEPAGE = "https://www.riverbankcomputing.com/software/pyqt"
SECTION = "devel/python"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "\
    file://LICENSE;md5=d32239bcb673463ab874e80d47fae504 \
"

inherit pypi
inherit pkgconfig

PYPI_PACKAGE = "PyQt5"

SRC_URI[md5sum] = "b60f895e70d31d774e6cd374efd17c65"
SRC_URI[sha256sum] = "d9a76b850246d08da9863189ecb98f6c2aa9b4d97a3e85e29330a264aed0f9a1"

S = "${WORKDIR}/PyQt5-${PV}"

inherit qmake5
inherit python3native python3-dir

DEPENDS = "qtbase qtdeclarative qtquickcontrols2"
DEPENDS += "sip3 sip3-native python3 dbus python3-dbus-native python3-dbus"

export BUILD_SYS
export HOST_SYS
export STAGING_INCDIR
export STAGING_LIBDIR

PARALLEL_MAKEINST = ""

DISABLED_FEATURES = "PyQt_Desktop_OpenGL PyQt_Accessibility PyQt_SessionManager ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', '', 'PyQt_OpenGL', d)}"

PYQT_MODULES = "QtCore QtGui QtNetwork QtXml QtNetwork QtQml QtDBus ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'QtQuick QtWidgets QtQuickWidgets', '', d)}"

do_configure:prepend() {
    cd ${S}
    echo "py_platform = linux" > pyqt.cfg
    echo "py_inc_dir = %(sysroot)/$includedir/python%(py_major).%(py_minor)${PYTHON_ABI}" >> pyqt.cfg
    echo "py_pylib_dir = %(sysroot)/${libdir}/python%(py_major).%(py_minor)" >> pyqt.cfg
    echo "py_pylib_lib = python$%(py_major).%(py_minor)" >> pyqt.cfg
    echo "pyqt_module_dir = ${D}/${libdir}/python%(py_major).%(py_minor)/site-packages" >> pyqt.cfg
    echo "pyqt_bin_dir = ${D}/${bindir}" >> pyqt.cfg
    echo "pyqt_sip_dir = ${D}/${datadir}/sip/PyQt5" >> pyqt.cfg
    echo "pyuic_interpreter = ${D}/${bindir}/python%(py_major).%(py_minor)" >> pyqt.cfg
    echo "pyqt_disabled_features = ${DISABLED_FEATURES}" >> pyqt.cfg
    echo "qt_shared = True" >> pyqt.cfg
    QT_VERSION=`${OE_QMAKE_QMAKE} -query QT_VERSION`
    echo "[Qt $QT_VERSION]" >> pyqt.cfg
    echo "pyqt_modules = ${PYQT_MODULES}" >> pyqt.cfg
    echo yes | ${PYTHON} configure.py --verbose --qmake  ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}/qmake --configuration pyqt.cfg --sysroot ${STAGING_DIR_HOST}
}

do_compile() {
    cd ${S}
    oe_runmake
}

do_install() {
    cd ${S}
    oe_runmake MAKEFLAGS='-j 1' install
    #dbus mainloop gets installed in a sysroot-native location!
    install -d ${D}${libdir}/${PYTHON_DIR}/site-packages/dbus/mainloop/
    cp ${STAGING_LIBDIR_NATIVE}/${PYTHON_DIR}/site-packages/dbus/mainloop/pyqt5.so ${D}${libdir}/${PYTHON_DIR}/site-packages/dbus/mainloop/
}

FILES:${PN} += "${libdir}/${PYTHON_DIR}/site-packages ${datadir}/sip/PyQt5/"

RDEPENDS:${PN} = "qtbase qtdeclarative qtquickcontrols2 qtquickcontrols2-mkspecs"
RDEPENDS:${PN} += "python3-core python3-sip3"


text:
require gpe-bluetooth.inc

PR = "r1"

SRC_URI += "file://hciattach-bts.patch \
	file://include-sdp_lib.patch"

SRC_URI[md5sum] = "197603d957dda95a92c92038fb9f8341"
SRC_URI[sha256sum] = "5ffb41e7375c55450fc55428fd7b19e158a93ee91ae6b9519953363ec05f82c7"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
// +build !deadlockdebug

package gorex

import (
	"sync"
)

func goroutineOpenedLock(lockPtr sync.Locker, isWrite bool) {}
func goroutineClosedLock(lockPtr sync.Locker, isWrite bool) {}

repository: xaionaro-go/gorex

repo_name: xaionaro-go/gorex


text:
package cli

import (
	"fmt"

	"github.com/spf13/cobra"

	"github.com/cosmos/cosmos-sdk/client"
	"github.com/cosmos/cosmos-sdk/client/flags"
	"github.com/cosmos/cosmos-sdk/codec"
	"github.com/cosmos/cosmos-sdk/x/params/types"
)

// NewQueryCmd returns a root CLI command handler for all x/params query commands.
func NewQueryCmd(m codec.JSONMarshaler) *cobra.Command {
	cmd := &cobra.Command{
		Use:                        types.ModuleName,
		Short:                      "Querying commands for the params module",
		DisableFlagParsing:         true,
		SuggestionsMinimumDistance: 2,
		RunE:                       client.ValidateCmd,
	}

	cmd.AddCommand(NewQuerySubspaceParamsCmd(m))

	return cmd
}

// NewQuerySubspaceParamsCmd returns a CLI command handler for querying subspace
// parameters managed by the x/params module.
func NewQuerySubspaceParamsCmd(m codec.JSONMarshaler) *cobra.Command {
	cmd := &cobra.Command{
		Use:   "subspace [subspace] [key]",
		Short: "Query for raw parameters by subspace and key",
		Args:  cobra.ExactArgs(2),
		RunE: func(cmd *cobra.Command, args []string) error {
			clientCtx := client.NewContext().WithJSONMarshaler(m)

			params := types.NewQuerySubspaceParams(args[0], args[1])
			route := fmt.Sprintf("custom/%s/%s", types.QuerierRoute, types.QueryParams)

			bz, err := m.MarshalJSON(params)
			if err != nil {
				return fmt.Errorf("failed to marshal params: %w", err)
			}

			bz, _, err = clientCtx.QueryWithData(route, bz)
			if err != nil {
				return err
			}

			var resp types.SubspaceParamsResponse
			if err := m.UnmarshalJSON(bz, &resp); err != nil {
				return err
			}

			return clientCtx.PrintOutput(resp)
		},
	}

	return flags.GetCommands(cmd)[0]
}

repository: ChainSafe/cosmos-sdk

repo_name: ChainSafe/cosmos-sdk


text:
@inproceedings{DBLP:conf/trustcom/LiuWRMGTW18,
 abstract = {Nowadays, with the size and complexity of software increasing rapidly, vulnerabilities are becoming diversified and hard to identify. It is unpractical to detect and exploit vulnerabilities by manual construction. Therefore, an efficient automatic method of detecting and exploiting software vulnerability is in critical demand. This paper implements Pangr, an entire system for automatic vulnerability detection, exploitation, and patching. Pangr builds a complete vulnerability model based on its triggering behavior to identify vulnerabilities and generate exp or exploit schemes. According to the type and feature of the vulnerability, Pangr can generate the specific patch for the software. In the experiment, we tested 20 vulnerable programs on 32-bit Linux machine. Pangr detected 16 vulnerabilities, generated 10 exp, and patched 14 programs.},
 author = {Danjun Liu and
Jingyuan Wang and
Zelin Rong and
Xianya Mi and
Fangyu Gai and
Yong Tang and
Baosheng Wang},
 bibsource = {dblp computer science bibliography, https://dblp.org},
 biburl = {https://dblp.org/rec/bib/conf/trustcom/LiuWRMGTW18},
 booktitle = {17th IEEE International Conference On Trust, Security And Privacy
In Computing And Communications / 12th IEEE International Conference
On Big Data Science And Engineering, TrustCom/BigDataSE 2018, New
York, NY, USA, August 1-3, 2018},
 crossref = {DBLP:conf/trustcom/2018},
 doi = {10.1109/TrustCom/BigDataSE.2018.00103},
 pages = {705--712},
 timestamp = {Sun, 23 Dec 2018 08:29:10 +0100},
 title = {Pangr: A Behavior-Based Automatic Vulnerability Detection and Exploitation
Framework},
 url = {https://doi.org/10.1109/TrustCom/BigDataSE.2018.00103},
 year = {2018}
}

repository: gitferry/academic-kickstart

repo_name: gitferry/academic-kickstart


text:
package main

import (
	"fmt"
	"strings"
)

type trieTree struct {
	key        rune
	word       []rune
	isword     bool
	childNodes map[rune]*trieTree
}

func (t *trieTree) Insert(word []rune, index int) {
	//fmt.Println("插入的关键词是", string(word))
	//获取第index个字
	key := word[index]
	//fmt.Println("保存的key是:", string(key))
	index++
	//如果以前保存这个字,则找下一个节点
	if _, found := t.childNodes[key]; found {
		t.childNodes[key].Insert(word, index)
	} else {
		//如果没有保存过,则保存这个key
		trie := new(trieTree)
		t.childNodes[key] = trie
		trie.key = key
		//判断是否到词的最后
		if index == len(word) {
			trie.word = word
			trie.isword = true
		} else {
			trie.childNodes = make(map[rune]*trieTree)
			trie.Insert(word, index)
		}
	}

}

func (t *trieTree) Replace(msg []rune) string {
	//保存根节点指针
	var root *trieTree = t
	for index, s := range msg {
		if _, found := t.childNodes[s]; found {
			if t.childNodes[s].isword {
				wordlen := len(t.childNodes[s].word)
				copy(msg[index-wordlen+1:index+1], []rune(strings.Repeat("*", wordlen)))
				fmt.Println("找到过滤词", string(t.childNodes[s].word), "===>", string(msg[index-wordlen+1:index+1]))
				continue
			}
			t = t.childNodes[s]
		} else {
			t = root

		}
	}
	return string(msg)
}

func main() {
	//初始化根节点
	trie := new(trieTree)
	trie.childNodes = make(map[rune]*trieTree)

	var wordList = []string{"我擦", "我草", "我操", "fuck", "傻逼", "SB"}

	var msg string = "昨天见到你妈,逼我买房子,你说我怎么办呢,fuck了,我擦"

	for _, word := range wordList {
		//子节点开始保存数据
		word = strings.ToLower(word)
		trie.Insert([]rune(word), 0)
	}

	msg = trie.Replace([]rune(msg))
	fmt.Println(msg)
	//fmt.Printf("%s\n%v\n", trie.childNodes, trie.childNodes)
	//printMap(trie)
}

func printMap(trie *trieTree) {
	for _, v := range trie.childNodes {
		fmt.Println("key:", string(v.key), "word:", string(v.word), "isword:", v.isword)
		printMap(v)
	}

}

repository: huydeerpets/sdc

repo_name: huydeerpets/sdc


text:
LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=34c88b124db5fb2762c1676be7dadd36"

SRC_URI[archive.md5sum] = "25827cac1609cf1b5a089d9615d47d86"
SRC_URI[archive.sha256sum] = "87bc4ef307604f1ce4f09f6e5c9996ef8d37ca5e0a3bf76f6b27d71844adb40c"

DEPENDS = "libxml2 libsoup-2.4 libsecret gcr json-glib gtk+3 glib-2.0 glib-2.0-native xmlto-native webkitgtk rest"

inherit gnome gettext gobject-introspection vala

EXTRA_OECONF = "--disable-Werror"

repository: nicepixels/citadel

repo_name: nicepixels/citadel


text:
# From: https://github.com/ivansafrin/Polycode/

# Find if a Python module is installed
# Found at http://www.cmake.org/pipermail/cmake/2011-January/041666.html
# To use do: find_python_module(PyQt4 TRUE) # if required
#        or: find_python_module(PyQt4 FALSE) # if optional, check PY_PYQT4
#            if(PY_PYQT4)
#              # do stuff...
#            endif()
function(find_python_module module is_required)
  string(TOUPPER ${module} module_upper)
  if(NOT PY_${module_upper})
    if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
      set(${module}_FIND_REQUIRED TRUE)
    endif()
    # A module's location is usually a directory, but for binary modules
    # it's a .so file.
    execute_process(COMMAND ${CMAKE_COMMAND} -E env
        PYTHONPATH=${PYTHONPATH} ${Python_EXECUTABLE} "-c"
        "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))"
        RESULT_VARIABLE _${module}_status
        OUTPUT_VARIABLE _${module}_location
        ERROR_QUIET
        OUTPUT_STRIP_TRAILING_WHITESPACE)
    if(NOT _${module}_status)
      set(PY_${module_upper} ${_${module}_location} CACHE STRING
          "Location of Python module ${module}")
    endif(NOT _${module}_status)
  endif(NOT PY_${module_upper})
  find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper})
  if(is_required AND NOT PY_${module_upper})
    message(FATAL_ERROR "Failed to find python module: ${module}")
  endif()
endfunction(find_python_module)

repository: sxs-collaboration/spectre

repo_name: sxs-collaboration/spectre

branch_name: refs/heads/develop

gha_license_id: NOASSERTION

extension: cmake


text:
package govultr

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

	"github.com/google/go-querystring/query"
)

const vpc2Path = "/v2/vpc2"

// VPC2Service is the interface to interact with the VPC 2.0 endpoints on the Vultr API
// Link : https://www.vultr.com/api/#tag/vpc2
type VPC2Service interface {
	Create(ctx context.Context, createReq *VPC2Req) (*VPC2, *http.Response, error)
	Get(ctx context.Context, vpcID string) (*VPC2, *http.Response, error)
	Update(ctx context.Context, vpcID string, description string) error
	Delete(ctx context.Context, vpcID string) error
	List(ctx context.Context, options *ListOptions) ([]VPC2, *Meta, *http.Response, error)
	ListNodes(ctx context.Context, vpc2ID string, options *ListOptions) ([]VPC2Node, *Meta, *http.Response, error)
	Attach(ctx context.Context, vpcID string, attachReq *VPC2AttachDetachReq) error
	Detach(ctx context.Context, vpcID string, detachReq *VPC2AttachDetachReq) error
}

// VPC2ServiceHandler handles interaction with the VPC 2.0 methods for the Vultr API
type VPC2ServiceHandler struct {
	client *Client
}

// VPC2 represents a Vultr VPC 2.0
type VPC2 struct {
	ID           string `json:"id"`
	Region       string `json:"region"`
	Description  string `json:"description"`
	IPBlock      string `json:"ip_block"`
	PrefixLength int    `json:"prefix_length"`
	DateCreated  string `json:"date_created"`
}

// VPC2Node represents a node attached to a VPC 2.0 network
type VPC2Node struct {
	ID          string `json:"id"`
	IPAddress   string `json:"ip_address"`
	MACAddress  int    `json:"mac_address"`
	Description string `json:"description"`
	Type        string `json:"type"`
	NodeStatus  string `json:"node_status"`
}

// VPC2Req represents parameters to create or update a VPC 2.0 resource
type VPC2Req struct {
	Region       string `json:"region"`
	Description  string `json:"description"`
	IPType       string `json:"ip_type"`
	IPBlock      string `json:"ip_block"`
	PrefixLength int    `json:"prefix_length"`
}

// VPC2AttachDetachReq represents parameters to mass attach or detach nodes from VPC 2.0 networks
type VPC2AttachDetachReq struct {
	Nodes []string `json:"nodes"`
}

type vpcs2Base struct {
	VPCs []VPC2 `json:"vpcs"`
	Meta *Meta  `json:"meta"`
}

type vpc2Base struct {
	VPC *VPC2 `json:"vpc"`
}

type vpc2NodesBase struct {
	Nodes []VPC2Node `json:"nodes"`
	Meta  *Meta      `json:"meta"`
}

// Create creates a new VPC 2.0. A VPC 2.0 can only be used at the location for which it was created.
func (n *VPC2ServiceHandler) Create(ctx context.Context, createReq *VPC2Req) (*VPC2, *http.Response, error) {
	req, err := n.client.NewRequest(ctx, http.MethodPost, vpc2Path, createReq)
	if err != nil {
		return nil, nil, err
	}

	vpc := new(vpc2Base)
	resp, err := n.client.DoWithContext(ctx, req, vpc)
	if err != nil {
		return nil, resp, err
	}

	return vpc.VPC, resp, nil
}

// Get gets the VPC 2.0 of the requested ID
func (n *VPC2ServiceHandler) Get(ctx context.Context, vpcID string) (*VPC2, *http.Response, error) {
	uri := fmt.Sprintf("%s/%s", vpc2Path, vpcID)
	req, err := n.client.NewRequest(ctx, http.MethodGet, uri, nil)
	if err != nil {
		return nil, nil, err
	}

	vpc := new(vpc2Base)
	resp, err := n.client.DoWithContext(ctx, req, vpc)
	if err != nil {
		return nil, resp, err
	}

	return vpc.VPC, resp, nil
}

// Update updates a VPC 2.0
func (n *VPC2ServiceHandler) Update(ctx context.Context, vpcID, description string) error {
	uri := fmt.Sprintf("%s/%s", vpc2Path, vpcID)

	vpcReq := RequestBody{"description": description}
	req, err := n.client.NewRequest(ctx, http.MethodPut, uri, vpcReq)
	if err != nil {
		return err
	}

	_, err = n.client.DoWithContext(ctx, req, nil)
	return err
}

// Delete deletes a VPC 2.0. Before deleting, a VPC 2.0 must be disabled from all instances
func (n *VPC2ServiceHandler) Delete(ctx context.Context, vpcID string) error {
	uri := fmt.Sprintf("%s/%s", vpc2Path, vpcID)
	req, err := n.client.NewRequest(ctx, http.MethodDelete, uri, nil)
	if err != nil {
		return err
	}
	_, err = n.client.DoWithContext(ctx, req, nil)
	return err
}

// List lists all VPCs 2.0 on the current account
func (n *VPC2ServiceHandler) List(ctx context.Context, options *ListOptions) ([]VPC2, *Meta, *http.Response, error) { //nolint:dupl
	req, err := n.client.NewRequest(ctx, http.MethodGet, vpc2Path, nil)
	if err != nil {
		return nil, nil, nil, err
	}

	newValues, err := query.Values(options)
	if err != nil {
		return nil, nil, nil, err
	}

	req.URL.RawQuery = newValues.Encode()

	vpcs := new(vpcs2Base)
	resp, err := n.client.DoWithContext(ctx, req, vpcs)
	if err != nil {
		return nil, nil, resp, err
	}

	return vpcs.VPCs, vpcs.Meta, resp, nil
}

// ListNodes lists all nodes attached to a VPC 2.0 network
func (n *VPC2ServiceHandler) ListNodes(ctx context.Context, vpc2ID string, options *ListOptions) ([]VPC2Node, *Meta, *http.Response, error) { //nolint:dupl,lll
	uri := fmt.Sprintf("%s/%s/nodes", vpc2Path, vpc2ID)

	req, err := n.client.NewRequest(ctx, http.MethodGet, uri, nil)
	if err != nil {
		return nil, nil, nil, err
	}

	newValues, err := query.Values(options)
	if err != nil {
		return nil, nil, nil, err
	}

	req.URL.RawQuery = newValues.Encode()

	nodes := new(vpc2NodesBase)
	resp, err := n.client.DoWithContext(ctx, req, nodes)
	if err != nil {
		return nil, nil, resp, err
	}

	return nodes.Nodes, nodes.Meta, resp, nil
}

// Attach attaches nodes to a VPC 2.0 network
func (n *VPC2ServiceHandler) Attach(ctx context.Context, vpcID string, attachReq *VPC2AttachDetachReq) error {
	uri := fmt.Sprintf("%s/%s/nodes/attach", vpc2Path, vpcID)

	req, err := n.client.NewRequest(ctx, http.MethodPost, uri, attachReq)
	if err != nil {
		return err
	}

	_, err = n.client.DoWithContext(ctx, req, nil)
	return err
}

// Detach detaches nodes from a VPC 2.0 network
func (n *VPC2ServiceHandler) Detach(ctx context.Context, vpcID string, detachReq *VPC2AttachDetachReq) error {
	uri := fmt.Sprintf("%s/%s/nodes/detach", vpc2Path, vpcID)

	req, err := n.client.NewRequest(ctx, http.MethodPost, uri, detachReq)
	if err != nil {
		return err
	}

	_, err = n.client.DoWithContext(ctx, req, nil)
	return err
}

repository: vultr/govultr

repo_name: vultr/govultr


text:
@incollection{sparc,
  title={Towards Answer Set Programming with Sorts},
  author={Balai, Evgenii and Gelfond, Michael and Zhang, Yuanlin},
  booktitle={Logic Programming and Nonmonotonic Reasoning},
  pages={135--147},
  year={2013},
  publisher={Springer}
}

@article{paper,
  title={Probabilistic reasoning with answer sets},
  author={Baral, Chitta and Gelfond, Michael and Rushton, Nelson},
  journal={Theory and Practice of Logic Programming},
  volume={9},
  number={1},
  pages={57--144},
  year={2009},
  publisher={Cambridge University Press}
}

repository: iensen/sparc

repo_name: iensen/sparc

gha_language: Java


text:
# - Try to find LibConfig++
# Once done this will define
#  LIBCONFIGPP_FOUND - System has LibConfig++
#  LIBCONFIGPP_INCLUDE_DIRS - The LibConfig++ include directories
#  LIBCONFIGPP_LIBRARIES - The libraries needed to use LibConfig++
#  LIBCONFIGPP_DEFINITIONS - Compiler switches required for using LibConfig++

find_package(PkgConfig)
pkg_check_modules(PC_LIBCONFIGPP QUIET libconfig++)
set(LIBCONFIGPP_DEFINITIONS ${PC_LIBCONFIGPPCFLAGS_OTHER})

find_path(LIBCONFIGPP_INCLUDE_DIR libconfig.h++
          HINTS ${PC_LIBCONFIGPP_INCLUDEDIR} ${PC_LIBCONFIGPP_INCLUDE_DIRS})

find_library(LIBCONFIGPP_LIBRARY NAMES libconfig++ config++
             HINTS ${PC_LIBCONFIGPP_LIBDIR} ${PC_LIBCONFIGPP_LIBRARY_DIRS} )

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set LIBCONFIGPP_FOUND to TRUE
# if all listed variables are TRUE
find_package_handle_standard_args(LIBCONFIGPP DEFAULT_MSG
                                  LIBCONFIGPP_LIBRARY LIBCONFIGPP_INCLUDE_DIR)

mark_as_advanced(LIBCONFIGPP_INCLUDE_DIR LIBCONFIGPP_LIBRARY)

set(LIBCONFIGPP_LIBRARIES ${LIBCONFIGPP_LIBRARY} )
set(LIBCONFIGPP_INCLUDE_DIRS ${LIBCONFIGPP_INCLUDE_DIR} )


text:
@article{nuzzo2015fooling,
 author = {Nuzzo, Regina},
 journal = {Nature},
 number = {7572},
 pages = {182},
 publisher = {Nature Publishing Group},
 title = {Fooling ourselves},
 volume = {526},
 year = {2015}
}

repository: ReginaNuzzo/academic-kickstart

repo_name: ReginaNuzzo/academic-kickstart


text:
SECTION = "libs"
DESCRIPTION = "Free OSM/Motif implementation."
LICENSE = "LGPL"
PR = "r0"

SRC_URI = "\
	${SOURCEFORGE_MIRROR}/lesstif/${BP}.tar.bz2 \
	file://000_bootstrap_script.diff;patch=1 \
	file://000_libtool_linking.diff;patch=1 \
	file://010_rebootstrap-small.diff;patch=1 \
	file://020_bad_integer_cast.diff;patch=1 \
	file://020_missing_xm_h.diff;patch=1 \
	file://020_render_table_crash.diff;patch=1 \
	file://020_unsigned_int.diff;patch=1 \
	file://020_xpmpipethrough.diff;patch=1 \
	file://021_xim_chained_list_crash.diff;patch=1 \
	file://030_manpage.diff;patch=1 \
	file://disable-docs.patch;patch=1 \
	"

DEPENDS = "flex-native bison-native libice libsm libx11 libxext libxp libxt libxrender libxft fontconfig freetype"

inherit autotools

do_preconfigure() {
	mkdir -p m4
	mv ac_debug.m4 m4/
	mv ac_have_libxp.m4 m4/
	mv ac_find_xft.m4 m4/
	mv acinclude.m4 m4/

	rm aclocal.m4

	sed -i -e "s|LT_HAVE_FREETYPE|HAVEFREETYPE|" m4/acinclude.m4
	sed -i -e "s|LT_HAVE_XRENDER|HAVEXRENDER|" m4/acinclude.m4
}

addtask preconfigure after do_patch before do_configure

EXTRA_OECONF = "\
	--with-gnu-ld --disable-verbose --disable-build-12 --disable-build-20 \
	--enable-build-21 --enable-xrender --enable-production --without-motif \
	--x-includes=. \
"

PACKAGES += "${PN}-bin"

FILES_${PN} = "${libdir}"
FILES_${PN}-bin = "${bindir}"


text:
package main

import (
	"fmt"
	"os"
	"os/user"
	"path/filepath"
	"strings"

	"github.com/OpenPeeDeeP/xdg"
	"github.com/hoisie/mustache"
	"gopkg.in/alecthomas/kingpin.v2"
)

// Configuration file
var configFile string

var xdgDirs = xdg.New("base16-universal-manager", "")

//Flags
var (
	updateFlag         = kingpin.Flag("update-list", "Update the list of templates and colorschemes").Bool()
	clearListFlag      = kingpin.Flag("clear-list", "Delete local template and colorscheme list caches").Bool()
	clearTemplatesFlag = kingpin.Flag("clear-templates", "Delete local template caches").Bool()
	clearSchemesFlag   = kingpin.Flag("clear-schemes", "Delete local schemes caches").Bool()
	configFileFlag     = kingpin.Flag("config", "Specify configuration file to use").Default(xdgDirs.QueryConfig("config.yaml")).String()
	printConfigFlag    = kingpin.Flag("print-config", "Print current configuration").Bool()
	schemeFlag         = kingpin.Flag("scheme", "Specify scheme to use (Overrides config)").String()
)

//Configuration
var appConf SetterConfig

func main() {
	//Parse Flags
	kingpin.Version("1.0.0")
	kingpin.Parse()

	appConf = NewConfig(*configFileFlag)

	if *printConfigFlag {
		appConf.Show()
	}

	if *clearListFlag {
		err := os.Remove(appConf.SchemesListFile)
		if err == nil {
			fmt.Printf("Deleted cached colorscheme list %s\n", appConf.SchemesListFile)
		} else {
			fmt.Fprintf(os.Stderr, "Error deleting cached colorscheme list: %v\n", err)
		}
		err = os.Remove(appConf.TemplatesListFile)
		if err == nil {
			fmt.Printf("Deleted cached template list %s\n", appConf.TemplatesListFile)
		} else {
			fmt.Fprintf(os.Stderr, "Error deleting cached template list: %v\n", err)
		}
	}

	if *clearSchemesFlag {
		err := os.RemoveAll(appConf.SchemesCachePath)
		if err == nil {
			fmt.Printf("Deleted cached colorscheme list %s\n", appConf.SchemesCachePath)
		} else {
			fmt.Fprintf(os.Stderr, "Error deleting cached colorschemes: %v\n", err)
		}
	}

	if *clearTemplatesFlag {
		err := os.RemoveAll(appConf.TemplatesCachePath)
		if err == nil {
			fmt.Printf("Deleted cached templates %s\n", appConf.TemplatesCachePath)
		} else {
			fmt.Fprintf(os.Stderr, "Error deleting cached templates: %v\n", err)
		}
	}

	// Create cache paths, if missing
	os.MkdirAll(appConf.SchemesCachePath, os.ModePerm)
	os.MkdirAll(appConf.TemplatesCachePath, os.ModePerm)

	schemeList := LoadBase16ColorschemeList()
	templateList := LoadBase16TemplateList()

	if *updateFlag {
		schemeList.UpdateSchemes()
		templateList.UpdateTemplates()
	}

	var scheme Base16Colorscheme
	if *schemeFlag == "" {
	    // Scheme from config
	    scheme = schemeList.Find(appConf.Colorscheme)
	} else {
	    // Scheme from flag
	    scheme = schemeList.Find(*schemeFlag)
	}
	fmt.Println("[CONFIG]: Selected scheme: ", scheme.Name)

	templateEnabled := false
	for app, appConfig := range appConf.Applications {
        if appConfig.Template == "" {
            appConfig.Template = app
        }
		if appConfig.Enabled {
			err := Base16Render(templateList.Find(appConfig.Template), scheme, app)
			if err != nil {
				fmt.Fprintf(os.Stderr, "Error when rendering file: %v\n", err)
			}
			templateEnabled = true
		}
	}

	if !templateEnabled {
		fmt.Println("No templates enabled")
	}

}

// Base16Render takes an application-specific template and renders a config file
// implementing the provided colorscheme.
func Base16Render(templ Base16Template, scheme Base16Colorscheme, app string) error {
	fmt.Println("[RENDER]: Rendering template \"" + templ.Name + "\"")

	for k, v := range templ.Files {
		templFileData, err := DownloadFileToString(templ.RawBaseURL + "templates/" + k + ".mustache")
		if err != nil {
			return fmt.Errorf("could not download template file: %w", err)
		}
		renderedFile := mustache.Render(templFileData, scheme.MustacheContext(v.Extension))

		savePath, err := getSavePath(appConf.Applications[app].Files[k].Path, k+v.Extension)
		if err != nil {
			return fmt.Errorf("could not get location for save path: %w", err)
		}
		if savePath == "" {
			continue
		}

		//If DryRun is enabled, just print the output location for debugging
		if appConf.DryRun {
			fmt.Println("    - (dryrun) file would be written to: ", savePath)
		} else {
			switch appConf.Applications[app].Files[k].Mode {
			case "rewrite":
				fmt.Println("     - writing: ", savePath)
				if err = WriteFile(savePath, []byte(renderedFile)); err != nil {
					return err
				}
			case "replace":
				fmt.Println("     - replacing in: ", savePath)
				startMarker := appConf.Applications[app].Files[k].StartMarker
				endMarker := appConf.Applications[app].Files[k].EndMarker
				if err = ReplaceMultiline(savePath, renderedFile, startMarker, endMarker); err != nil {
					return err
				}
			}
		}
	}

	if appConf.DryRun {
		fmt.Println("Not running hook, DryRun enabled: ", appConf.Applications[app].Hook)
	} else {
		exe_cmd(appConf.Applications[app].Hook)
	}

	return nil
}

func getSavePath(path, defaultFilename string) (string, error) {
	if path == "" {
		return "", nil
	}

	var homeDir string
	if path[0] == '~' {
		usr, err := user.Current()
		if err != nil {
			return "", fmt.Errorf("could not get user home directory: %w", err)
		}
		homeDir = usr.HomeDir
	}

	var savePath string
	if path == "~" {
		savePath = homeDir
	} else if strings.HasPrefix(path, "~/") {
		savePath = filepath.Join(homeDir, path[2:])
	} else if path[0] != '/' {
		savePath = filepath.Join(".", path)
	} else {
		savePath = path
	}

	if strings.HasSuffix(path, "/") {
		err := os.MkdirAll(savePath, os.ModePerm)
		if err != nil {
			return "", fmt.Errorf("could not create folder: %w", err)
		}
		savePath = filepath.Join(savePath, defaultFilename)
	}

	return savePath, nil
}

//TODO proper error handling
func check(e error) {
	if e != nil {
		panic(e)
	}
}


text:
@Book{xie2015,
  title = {Dynamic Documents with {R} and knitr},
  author = {Yihui Xie},
  publisher = {Chapman and Hall/CRC},
  address = {Boca Raton, Florida},
  year = {2015},
  edition = {2nd},
  note = {ISBN 978-1498716963},
  url = {http://yihui.name/knitr/},
}
@Book{Shuttle2012,
  title = {Terrestrial Hydrometeorology},
  author = {Shuttleworth, W.J.},
  publisher = {Wiley-Blackwell},
  year = {2012},
  edition = {1},
  isbn={9780470659373},
  lccn={2011041765},
  url = {http://wiley.com/go/shuttleworth/hydrometeorology},
}
@Book{Eagleson1991,
  title = {Opportunities in the Hydrologic Sciences, Committee on Opportunities
in the Hydrologic Sciences, National Research Council},
  author = {Eagleson, P.S.},
  publisher = {National Academy Press},
  year = {1992},
  address = {Washington, DC},
}
@Book{Dingman2015,
  title = {Physical Hydrology},
  author = {Dingman, S.L.},
  publisher = {Waveland Press},
  year = {2015},
  address = {Long Grove, IL},
  isbn={9781478611189}
}
@Book{Brutsaert2005,
  title = {Hydrology: An Introduction},
  author = {Brutsaert, W.},
  publisher = {Cambridge University Press},
  year = {2005},
  isbn={9780521824798}
}
@incollection{Oki2011,
title = {Global Hydrology},
editor = {Wilderer, P.},
booktitle = {Treatise on Water Science},
publisher = {Elsevier},
address = {Oxford},
year = {2011},
pages = {3 - 25},
isbn = {978-0-444-53199-5},
doi = {http://dx.doi.org/10.1016/B978-0-444-53199-5.00025-7},
url = {http://www.sciencedirect.com/science/article/pii/B9780444531995000257},
author = {Oki, T.}
}

@Book{Turner2004,
  title = {Economic valuation of water resources in agriculture, FAO Water Reports 27},
  author = {Kerry Turner and Stavros Georgiou and Rebecca Clark and Roy Brouwer and Jacob Burke},
  publisher = {Food and Agriculture Organization of the United Nations},
  year = {2004},
  isbn={ 978-9251051900},
  address = {Rome}
}
@article {Sivapalan2015,
author = {Sivapalan, Murugesu and Blöschl, Günter},
title = {Time scale interactions and the coevolution of humans and water},
journal = {Water Resources Research},
volume = {51},
number = {9},
issn = {1944-7973},
url = {http://dx.doi.org/10.1002/2015WR017896},
doi = {10.1002/2015WR017896},
pages = {6988--7022},
keywords = {Catchment, Anthropogenic effects, Hydrologic scaling, Hydrological cycles and budgets, coevolution, time scalescoupled human-water systems, sociohydrology, dynamical systems, time scales},
year = {2015},
}
@Book{Alexandratos2012,
  title = {World agriculture towards 2030/2050, ESA Working paper No. 12–03},
 author = {N. Alexandratos and J. Bruinsma},
  publisher = {Agricultural Development Economics Division, Food and Agricultural Organisation of the United
Nations},
  year = {2012}
}
@article {Piao2007,
author = {S. Piao and P. Friedlingstein and P. Ciais and N. de Noblet-Ducoudre and D. Labat, S. Zaehle},
title = {Changes in climate and land use have a larger direct impact than rising CO2 on global river runoff trends},
journal = {PNAS},
volume = {104},
number = {39},
issn = {15242-15247},
doi = {10.1073/pnas.070721310},
year = {2007},
}

@article{Trenberth2007,
author = { Kevin E.  Trenberth  and  Lesley  Smith  and  Taotao  Qian  and  Aiguo  Dai  and  John  Fasullo },
title = {Estimates of the Global Water Budget and Its Annual Cycle Using Observational and Model Data},
journal = {Journal of Hydrometeorology},
volume = {8},
number = {4},
pages = {758-769},
year = {2007},
doi = {10.1175/JHM600.1},
URL = {http://dx.doi.org/10.1175/JHM600.1},
eprint = {http://dx.doi.org/10.1175/JHM600.1}
}

@article{jackson2001,
  author = {Jackson, Robert B. and Carpenter, Stephen R. and Dahm, Clifford N. and McKnight, Diane M. and Naiman, Robert J. and Postel, Sandra L. and Running, Steven W.},
  year = {2001},
  title = {WATER IN A CHANGING WORLD},
  journal = {Ecological Applications},
  publisher = {Wiley Online Library},
  issn = {1939-5582},
  doi = {10.1890/1051-0761(2001)011[1027:WIACW]2.0.CO;2},
  url = {http:https://dx.doi.org/10.1890/1051-0761(2001)011[1027:WIACW]2.0.CO;2},
  volume = {11},
  month = {8},
  pages = {1027--1045},
  number = {4}
}

@inbook {chase2006,
title = {Teleconnections in the Earth System},
author = {Chase, Thomas N. and Pielke, Roger A. and Avissar, R.},
isbn = {9780470848944},
url = {http://dx.doi.org/10.1002/0470848944.hsa190},
doi = {10.1002/0470848944.hsa190},
keywords = {teleconnection, circulation change, atmosphere-ocean interactions, biosphere-atmosphere interactions, ENSO, NAO/AO},
booktitle = {Encyclopedia of Hydrological Sciences},
pages = {2849},
year = {2006}
}

@article{Rossow1993,
author = {Rossow, William B. and Walker, Alison W. and Garder, Leonid C.},
title = {Comparison of ISCCP and Other Cloud Amounts},
journal = {Journal of Climate},
volume = {6},
number = {12},
pages = {2394-2418},
year = {1993},
doi = {10.1175/1520-0442(1993)006<2394:COIAOC>2.0.CO;2},

URL = {
        https://doi.org/10.1175/1520-0442(1993)006<2394:COIAOC>2.0.CO;2

},
eprint = {
        https://doi.org/10.1175/1520-0442(1993)006<2394:COIAOC>2.0.CO;2

}
}

@book{Marsh1987,
  title={Earthscape: A Physical Geography},
  author={Marsh, W.M.},
  isbn={9780471850557},
  lccn={lc86028209},
  url={https://books.google.com.br/books?id=XXkovgAACAAJ},
  year={1987},
  publisher={Wiley}
}

@book{Bruce1966,
        title =      {Introduction to Hydrometeorology},
        author =      {J. P. Bruce and R. H. Clark (Auth.)},
        size =    {6593429},
        year =   {1966},
        isbn = {},
        edition = {},
        volume =    {}
}

@book{Peixoto1992,
title = {Physics of climate},
author = {Peixoto, J.P. and Oort, A.H.},
doi = {},
journal = {},
edition = {1},
publisher = {AIP-Press},
place = {United States},
year = {1992},
month = {1},
pages = {520}
}

@book{Mays2005,
  title={Water resources engineering},
  author={Mays, L.W.},
  isbn={9780471705246},
  lccn={2004058650},
  url={https://books.google.com.br/books?id=EvlRAAAAMAAJ},
  year={2005},
  publisher={John Wiley \& Sons, Inc.}
}

repository: lhmet/hidrometeobook

repo_name: lhmet/hidrometeobook


text:
file(REMOVE_RECURSE
  "CMakeFiles/04_IndexMaxHeap.dir/main.cpp.obj"
  "04_IndexMaxHeap.pdb"
  "04_IndexMaxHeap.exe"
  "04_IndexMaxHeap.exe.manifest"
  "lib04_IndexMaxHeap.dll.a"
)

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

repository: weibangbang/MyAlgorithmWithC-

repo_name: weibangbang/MyAlgorithmWithC-


text:
SUMMARY = "Replacement syslog API"
HOMEPAGE = "http://www.balabit.com/network-security/syslog-ng/opensource-logging-system"
DESCRIPTION = "The EventLog library aims to be a replacement of the \
              simple syslog() API provided on UNIX systems. The \
              major difference between EventLog and syslog is that \
              EventLog tries to add structure to messages. EventLog \
              provides an interface to build, format and output an \
              event record. The exact format and output method can \
              be customized by the administrator via a configuration \
              file. his package is the runtime part of the library. \
"

LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=b8ba8e77bcda9a53fac0fe39fe957767"

PV = "0.2.13+git${SRCPV}"
SRCREV = "a5c19163ba131f79452c6dfe4e31c2b4ce4be741"

SRC_URI = "git://github.com/balabit/eventlog;protocol=https"

S = "${WORKDIR}/git"

inherit autotools

repository: kraj/meta-openembedded

repo_name: kraj/meta-openembedded


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

IMAGE_INSTALL_append = " \
  flashrom \
  gnupg \
  wget \
  ca-certificates \
  "

IMAGE_FEATURES_append = " ssh-server-openssh"

repository: pcengines/meta-pcengines

repo_name: pcengines/meta-pcengines

gha_language: Python


text:
@inproceedings{Han,
    author = {Han, Jun and Harishankar, Madhumitha and Wang, Xiao and Chung, Albert Jin and Tague, Patrick},
    title = {Convoy: Physical Context Verification for Vehicle Platoon Admission},
    booktitle = {Proceedings of the 18th International Workshop on Mobile Computing Systems and Applications},
    series = {HotMobile '17},
    year = {2017},
    isbn = {978-1-4503-4907-9},
    location = {Sonoma, CA, USA},
    pages = {73--78},
    numpages = {6},
    url = {http://doi.acm.org/10.1145/3032970.3032987},
    doi = {10.1145/3032970.3032987},
    acmid = {3032987},
    publisher = {ACM},
    address = {New York, NY, USA},
    keywords = {Authentication, Context Verification, Vehicle Platoons},
}

@article{Alanezi,
    author = {Alanezi, Khaled and Mishra, Shivakant},
    title = {Design, Implementation and Evaluation of a Smartphone Position Discovery Service for Accurate Context Sensing},
    journal = {Comput. Electr. Eng.},
    issue_date = {May 2015},
    volume = {44},
    number = {C},
    month = may,
    year = {2015},
    issn = {0045-7906},
    pages = {307--323},
    numpages = {17},
    url = {http://dx.doi.org/10.1016/j.compeleceng.2015.01.015},
    doi = {10.1016/j.compeleceng.2015.01.015},
    acmid = {2793668},
    publisher = {Pergamon Press, Inc.},
    address = {Tarrytown, NY, USA},
    keywords = {Pervasive computing, Position discovery, Sensing, Smartphone},
}

@MISC{PhoneAttitude,
    author = {Pengfei Zhou and Mo Li and Guobin Shen},
    title = {Use It Free: Instantly Knowing Your Phone Attitude},
    year = {}
}

@MISC{MadgwickCode,
    url = {https://github.com/arduino-libraries/MadgwickAHRS}
}

@INPROCEEDINGS{Madgwick,
    author={S. O. H. Madgwick and A. J. L. Harrison and R. Vaidyanathan},
    booktitle={2011 IEEE International Conference on Rehabilitation Robotics},
    title={Estimation of IMU and MARG orientation using a gradient descent algorithm},
    year={2011},
    volume={},
    number={},
    pages={1-7},
    keywords={accelerometers;biomechanics;biomedical equipment;biomedical measurement;estimation theory;gradient methods;gyroscopes;magnetic sensors;magnetometers;mean square error methods;patient rehabilitation;IMU;MARG orientation;accelerometers;dynamic RMS error;gradient descent algorithm;gravity sensor arrays;gyroscope measurement error;inertial measurement units;magnetic angular rate;magnetic distortion compensation;optical measurement system;orientation algorithm;orientation sensor;propriety Kalman-based algorithm;quaternion derivative;quaternion representation;rehabilitation applications;sampling rates;static RMS error;triaxis gyroscopes;triaxis magnetometers;wearable inertial human motion tracking system;Accelerometers;Equations;Gyroscopes;Heuristic algorithms;Magnetometers;Mathematical model;Quaternions;Algorithms;Biomechanics;Humans;Orientation},
    doi={10.1109/ICORR.2011.5975346},
    ISSN={1945-7898},
    month={June},
}

@inbook{inbook1,
	author		= {F. N. Author},
	title			= {Title of the book},
	chapter		= 8,
	pages        = {201-213},
	publisher    = {The name of the publisher},
	year         = 1993,
	volume       = 4,
	series       = {series 1},
	address      = {The address of the publisher},
	edition      = 3,
	month        = {April},
	note         = {An optional note}
}

@book{book1,
	author    = {Full Name Author},
	title     = {Title of the book},
	year      = {1993},
	volume    = 4,
	series    = 10,
	address   = {Country},
	publisher = {The name of the publisher},
	edition   = 3,
	month     = {April},
	note      = {An optional note}
}

@book{onlinebook1,
	title={The title of the online book},
	author={Full Name Author},
	publisher={P. Name},
	isbn={2000000000000},
	lccn={200000000},
	series={Example series},
	url={http://books.google.es},
	month     = {April},
	year={2003},
}

@article{article1,
	author={Full Name Author1 and F. N. Author2 and Full Name Author3},
	journal={Other Journal},
	title={The title of the article},
	year={1990},
	month= {March},
	volume={IA-21},
	number={4},
	pages={814-821},
	keywords={},
	doi={XX/XXXX/ZZZ.XXXX.XXXXXXX},
	}

@ARTICLE{article2,
	author={Full Name Author1},
	journal={Journal title},
	title={The title of the article},
	year={2009},
	volume={56},
	number={2},
	pages={581-588},
	keywords={},
	month={Feb},
	doi={XX/XXXX/ZZZ.XXXX.XXXXXXX},}

@INPROCEEDINGS{inproceedings1,
	author={Full Name Author1 and Full Name Author2},
	booktitle={Title of the Proceeding},
	title={The title of the conference},
	year={2003},
	month = {April},
	volume={3},
	pages={1-6},
	keywords={},
	doi={XX/XXXX/ZZZ.XXXX.XXXXXXX},}

@article{patent1,
	author={Full Name Author1 and Full Name Author2 and Full Name Author3},
	title="The title of the patent",
	journal={Jounal Name},
	year={1990},
	month= {Oct},
	number={146643245}
}

%-------------------------------------------------------------------------------------
%----------------------------------------Types----------------------------------------
%-------------------------------------------------------------------------------------
% article
                %An article from a journal or magazine.
% book
                %A book with an explicit publisher.
% booklet
                %A work that is printed and bound, but without a named publisher or sponsoring institution.
% ceedings
                %An article in a conference proceedings.
% proceedings
                %The proceedings of a conference.
% conference
                %The same as inproceedings.
% inbook
                %A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.
% incollection
                %A part of a book having its own title.
% manual
                %Technical documentation.
% mastersthesis
                %A Master's thesis.
% misc
                %Use this type when nothing else fits.
% phdthesis
                %A PhD thesis.
% techreport
                %A report published by a school or other institution, usually numbered within a series.
% unpublished
                %A document having an author and title, but not formally published.
% collection
                %A collection of works. The same as proceedings
% patent
                %A patent.

%-------------------------------------------------------------------------------------
%----------------------------------------Fields---------------------------------------
%-------------------------------------------------------------------------------------
%address
                %Usually the address of the publisher or other type of institution.
%annote
                %An annotation. It is not used by the standard bibliography styles, but may be used by others that produce an annotated bibliography.
%author
                %The name(s) of the author(s), in the format described in the LaTeX book.
%booktitle
                %Title of a book, part of which is being cited. See the LaTeX book for how to type titles. For book entries, use the title field instead.
%chapter
                %A chapter (or section or whatever) number.
%crossref
                %The database key of the entry being cross referenced. Any fields that are missing from the current record are inherited from the field being cross referenced.
%edition
                %The edition of a book---for example, ``Second''. This should be an ordinal, and should have the first letter capitalized, as shown here; the standard styles convert to lower case when necessary.
%editor
                %Name(s) of editor(s), typed as indicated in the LaTeX book. If there is also an author field, then the editor field gives the editor of the book or collection in which the reference appears.
%howpublished
                %How something strange has been published. The first word should be capitalized.
%institution
                %The sponsoring institution of a technical report.
%journal
                %A journal name. Abbreviations are provided for many journals.
%key
                %Used for alphabetizing, cross referencing, and creating a label when the ``author'' information is missing. This field should not be confused with the key that appears in the cite command and at the beginning of the database entry.
%month
                %The month in which the work was published or, for an unpublished work, in which it was written. You should use the standard three-letter abbreviation, as described in Appendix B.1.3 of the LaTeX book.
%note
                %Any additional information that can help the reader. The first word should be capitalized.
%number
                %The number of a journal, magazine, technical report, or of a work in a series. An issue of a journal or magazine is usually identified by its volume and number; the organization that issues a technical report usually gives it a number; and sometimes books are given numbers in a named series.
%organization
                %The organization that sponsors a conference or that publishes a manual.
%pages
                %One or more page numbers or range of numbers, such as 42--111 or 7,41,73--97 or 43+(the `+' in this last example indicates pages following that don't form a simple range). To make it easier to maintain Scribe-compatible databases, the standard styles convert a single dash (as in 7-33) to the double dash used in TeX to denote number ranges (as in 7--33).
%publisher
                %The publisher's name.
%school
                %The name of the school where a thesis was written.
%series
                %The name of a series or set of books. When citing an entire book, the the title field gives its title and an optional series field gives the name of a series or multi-volume set in which the book is published.
%title
                %The work's title, typed as explained in the LaTeX book.
%type
                %The type of a technical report---for example, ``Research Note''.
%volume
                %The volume of a journal or multi-volume book.
%year
                %The year of publication or, for an unpublished work, the year it was written. Generally it should consist of four numerals, such as 1984, although the standard styles can handle any year whose last four nonpunctuation characters are numerals, such as `\hbox{(about 1984)}'.
%affiliation
                %The authors affiliation.
%abstract
                %An abstract of the work.
%contents
                %A Table of Contents
%copyright
                %Copyright information.
%ISBN
                %The International Standard Book Number.
%ISSN
                %The International Standard Serial Number. Used to identify a journal.
%keywords
                %Key words used for searching or possibly for annotation.
%language
                %The language the document is in.
%location
                %A location associated with the entry, such as the city in which a conference took place.
%LCCN
                %The Library of Congress Call Number. I've also seen this as lib-congress.
%mrnumber
                %The Mathematical Reviews number.
%price
                %The price of the document.
%size
                %The physical dimensions of a work.
%URL
                %The WWW Universal Resource Locator that points to the item being referenced. This often is used for technical reports to point to the ftp site where the postscript source of the report is located.

repository: oserr/sensor-calibration

repo_name: oserr/sensor-calibration


text:
@Article{Malka2012b,
  title = {The association of religiosity and political conservatism: The role of political engagement},
  author = {Ariel Malka and Yphtach Lelkes and Sanjay Srivastava and Adam B. A.B. Cohen and D.T. Dale T. D.T. Dale T. Miller},
  journal = {Political Psychology},
  pages = {275--299},
  year = {2012},
  volume = {33},
  number = {2},
  isbn = {1467-9221},
  doi = {10.1111/j.1467-9221.2012.00875.x},
  keywords = {Conservative ideology,Political attitudes,Political engagement,Religion,Social influence,mypubs},
  url = {https://www.dropbox.com/s/s2t5zmkdgehj2hb/j.1467-9221.2012.00875.x.pdf?dl=1},
  abstract = {Some argue that there is an organic connection between being religious and being politically conservative. We evaluate an alternative thesis that the relation between religiosity and political conservatism largely results from engagement with political discourse that indicates that these characteristics go together. In a combined sample of national survey respondents from 1996 to 2008, religiosity was associated with conservative positions on a wide range of attitudes and values among the highly politically engaged, but this association was generally weaker or nonexistent among those less engaged with politics. The specific political characteristics for which this pattern existed varied across ethno-religious groups. These results suggest that whether religiosity trans- lates into political conservatism depends to an important degree on level of engagement with political discourse.},
  issn = {0162895X},
  mendeley.tags = {mypubs},
  pmid = {8228167},
  archiveprefix = {arXiv},
  arxivid = {arXiv:1011.1669v3},
  eprint = {arXiv:1011.1669v3},
  journaltitle = {Political Psychology},
  pubtype = {2},
}

repository: ylelkes/academic-kickstart

repo_name: ylelkes/academic-kickstart


text:
###########################################################################
#
#  Program: Visomics
#
#  Copyright (c) Kitware Inc.
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0.txt
#
#  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.
#
###########################################################################

if(NOT R_cmd)
  message(FATAL_ERROR "error: The variable 'R_COMMAND' is not set.")
endif()

execute_process(
  COMMAND ${R_cmd} ${R_cmd_args}
  RESULT_VARIABLE return_val
  )

# Print and delete output of R script
if(EXISTS ${R_output_name})
  file(READ ${R_output_name} R_output)
  message(${R_output})
  execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${R_output_name})
endif()

# If R script fails
if(NOT "${return_val}" STREQUAL "0")
  message( FATAL_ERROR
  "error: Could not install all external R packages.\n"
  "Try running \"make RExternalPackages\" as root (sudo)."
  )
endif()


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

/*
Package topocache is a mechanism for holding a cache of Devices.

When onos-topology is in place it will be the ultimate reference of device
availability and accessibility
Until then this simple cache will load a set of Device definitions from file
*/
package topocache

import (
	"context"
	"errors"
	"github.com/cenkalti/backoff"
	"github.com/onosproject/onos-config/pkg/events"
	"github.com/onosproject/onos-topo/pkg/northbound/device"
	"google.golang.org/grpc"
	log "k8s.io/klog"
	"time"
)

const (
	topoAddress = "onos-topo:5150"
)

// DeviceStore is the model of the Device store
type DeviceStore struct {
	client device.DeviceServiceClient
	cache  map[device.ID]*device.Device
}

// LoadDeviceStore loads a device store
func LoadDeviceStore(topoChannel chan<- events.TopoEvent, opts ...grpc.DialOption) (*DeviceStore, error) {
	if len(opts) == 0 {
		return nil, nil
	}

	conn, err := getTopoConn(opts...)
	if err != nil {
		return nil, err
	}

	client := device.NewDeviceServiceClient(conn)
	deviceStore := &DeviceStore{
		client: client,
		cache:  make(map[device.ID]*device.Device),
	}
	go deviceStore.start(topoChannel)
	return deviceStore, nil
}

// start starts listening for events from the DeviceService
func (s *DeviceStore) start(ch chan<- events.TopoEvent) {
	// Retry continuously to listen for devices from the device service. The root retry loop is constant, so
	// when the device listener disconnects, a new connection will be attempted a second later. Each connection
	// iteration is performed using an exponential backoff algorithm, ensuring the client doesn't attempt to connect
	// to a missing service constantly.
	_ = backoff.Retry(func() error {
		operation := func() error {
			return s.watchEvents(ch)
		}

		// Use exponential backoff until the client is able to list devices. This operation should never return
		// an error since we don't use the error type required to fail the exponential backoff operation.
		_ = backoff.Retry(operation, backoff.NewExponentialBackOff())

		// Return a placeholder error to ensure the connection is retried.
		return errors.New("retry")
	}, backoff.NewConstantBackOff(1*time.Second))
}

// watchEvents listens for events from the DeviceService
func (s *DeviceStore) watchEvents(ch chan<- events.TopoEvent) error {
	list, err := s.client.List(context.Background(), &device.ListRequest{
		Subscribe: true,
	})

	// Return an error if the client was unable to connect to the service.
	if err != nil {
		log.Error(err)
		return err
	}

	for {
		response, err := list.Recv()

		// When an error occurs, log the error and return nil to reset the exponential backoff algorithm.
		if err != nil {
			log.Error(err)
			return nil
		}

		switch response.Type {
		case device.ListResponse_NONE:
			if _, ok := s.cache[response.Device.ID]; !ok {
				s.cache[response.Device.ID] = response.Device
				ch <- events.CreateTopoEvent(response.Device.ID, true, response.Device.Address, *response.Device)
			}
		case device.ListResponse_ADDED:
			s.cache[response.Device.ID] = response.Device
			ch <- events.CreateTopoEvent(response.Device.ID, true, response.Device.Address, *response.Device)
		case device.ListResponse_UPDATED:
			s.cache[response.Device.ID] = response.Device
			ch <- events.CreateTopoEvent(response.Device.ID, true, response.Device.Address, *response.Device)
		case device.ListResponse_REMOVED:
			ch <- events.CreateTopoEvent(response.Device.ID, false, response.Device.Address, *response.Device)
		}
	}
}

// getTopoConn gets a gRPC connection to the topology service
func getTopoConn(opts ...grpc.DialOption) (*grpc.ClientConn, error) {
	return grpc.Dial(topoAddress, opts...)
}

repository: TizenTeam/onos-config

repo_name: TizenTeam/onos-config


text:
@inproceedings{Marcus:1994,
 author = {Marcus, Mitchell and Kim, Grace and Marcinkiewicz, Mary Ann and MacIntyre, Robert and Bies, Ann and Ferguson, Mark and Katz, Karen and Schasberger, Britta},
 title = {The Penn Treebank: Annotating Predicate Argument Structure},
 booktitle = {Proceedings of the Workshop on Human Language Technology},
 series = {HLT '94},
 year = {1994},
 isbn = {1-55860-357-3},
 location = {Plainsboro, NJ},
 pages = {114--119},
 numpages = {6},
 url = {https://doi.org/10.3115/1075812.1075835},
 doi = {10.3115/1075812.1075835},
 acmid = {1075835},
 publisher = {Association for Computational Linguistics},
 address = {Stroudsburg, PA, USA},
}

@unpublished{Jurafsky:2017,
    author  = {Dan Jurafsky and James H.Martin},
    title   = {Speech and Language Processing},
    year    = "2017",
    note    = {preprint on webpage at \url{https://web.stanford.edu/~jurafsky/slp3/}},
    chapter = 10,
    pages   = "1--2"
}

@online{cs224d,
author = {Richard Socher},
title  = {{CS}224d {D}eep {NLP} {L}ecture 8: {R}ecurrent {N}eural {N}etworks},
date   = {2016-04},
year = {2016},
url    = {{https://cs224d.stanford.edu/lectures/CS224d-Lecture8.pdf}}
note = {Accessed: 2018-03-18}
}

@online{colah,
author = {Christopher Olah},
title  = {Understanding {LSTM} {N}etworks},
date   = {2015-08},
year = {2015},
url    = {{http://colah.github.io/posts/2015-08-Understanding-LSTMs/}},
note = {Accessed: 2018-03-18}
}

@book{suffix,
    author  = {Bill Honig and Linda Diamond and Linda Gutlohn and Jacalyn Mahler},
    title   = {Teaching Reading Sourcebook: For Kindergarten Through Eighth Grade},
    year    = "2000",
    volume  = "1",
    publisher = {Academic Therapy Publications},
    address = {20 Leveroni Court, Novato, CA 94949-5746}
}

repository: xxks-kkk/Code-for-blog

repo_name: xxks-kkk/Code-for-blog

gha_language: MATLAB


text:
@inproceedings{mihaylovfrank:2016b,
 author = {Todor Mihaylov and Anette Frank},
 booktitle = {In Proceedings of the TAC Knowledge Base Population (KBP) 2016.},
 title = {AIPHES-HD system at TAC KBP 2016: Neural Event Trigger Span Detection and Event Type and Realis Disambiguation with Word Embeddingss},
 url = {https://tac.nist.gov/publications/2016/participant.papers/TAC2016.aipheshd_t16.proceedings.pdf},
 year = {2016}
}

repository: tbmihailov/homepage

repo_name: tbmihailov/homepage


text:
package main

import (
	"fmt"
	"os"

	"github.com/aviate-labs/imp/internal/cmd"
)

var pwd string

func init() {
	pwd, _ = os.Getwd()
}

var imp = cmd.Command{
	Name:    "imp",
	Summary: "experimental command line tool for the Internet Computer",
	Commands: []cmd.Command{
		versionCommand,
		modCommand,
		candidCommand,
		statsCommand,
	},
}

var versionCommand = cmd.Command{
	Name:    "version",
	Aliases: []string{"v"},
	Summary: "print Imp version",
	Method: func(args []string, _ map[string]string) error {
		if len(args) != 0 {
			return fmt.Errorf("too long")
		}
		fmt.Println("v0.1.0")
		return nil
	},
}

func main() {
	if len(os.Args) == 1 {
		imp.Help()
		return
	}
	if err := imp.Call(os.Args[1:]...); err != nil {
		imp.Help()
	}
}

repository: aviate-labs/imp

repo_name: aviate-labs/imp


text:
---
---

@string{aps = {American Physical Society,}}

@article{pandey2021pivotal,
  title={Pivotal role of magnetic ordering and strain in lattice thermal conductivity of chromium-trihalide monolayers},
  author={Pandey, T and Peeters, FM and Milo{\v{s}}evi{\'c}, MV},
  journal={2D Materials},
  volume={9},
  number={1},
  pages={015034},
  year={2021},
  publisher={IOP Publishing}
}


text:
DESCRIPTION = "ardrone-firmware"
PR = "r0"

COMPATIBLE_MACHINE = "ardrone2"

LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Proprietary;md5=0557f9d92cf58f2ccdd50f62f8ac0b28"

SRC_URI = "http://durrans.com/ardrone/firmware/${PV}/ardrone2_update.plf"
SRC_URI[md5sum] = "e779504b2fb362a1a727415290a9a914"
SRC_URI[sha256sum] = "d62f231d5961406f847e3d1d3e62c2e87f88fb2d64f81018d2691971fbfbde2a"

DEPENDS ="plftool-native"

S = "${WORKDIR}"

do_extract_firmware() {
	export LD_LIBRARY_PATH=${STAGING_LIBDIR_NATIVE}
	plftool -e nice -i ./ardrone2_update.plf -o out/
}

addtask extract_firmware after do_configure before do_install

do_install() {
	mkdir -p ${D}${base_libdir}/firmware
	cp -a out/lib/firmware/* ${D}${base_libdir}/firmware
}

INHIBIT_PACKAGE_STRIP = "1"
PACKAGES =+ "${PN}-atheros"
INSANE_SKIP_${PN}-atheros = "ldflags"
FILES_${PN}-atheros = "/lib/firmware/*"


text:
var write = document.querySelector('.btn-write');
var popup = document.querySelector('.pop-up');
var close = popup.querySelector('.modal-close');
var overLay = document.querySelector('.modal-overlay');
var login = popup.querySelector('[name=name]');
var form = popup.querySelector('form');
var email = popup.querySelector('[name=email]');
var storage = localStorage.getItem('login');
write.addEventListener('click', function (event) {
    event.preventDefault();
    popup.classList.add('pop-up-active');
    overLay.classList.add('modal-overlay-active');
    if (storage) {
        login.value = storage;
        email.focus();
    }
    else {
        login.focus();
    }
});
close.addEventListener('click', function (event) {
    event.preventDefault();
    popup.classList.remove('pop-up-active');
    popup.classList.remove('pop-up-error');
    overLay.classList.remove('modal-overlay-active');
});
form.addEventListener('submit', function (event) {
    if (!login.value || !email.value) {
        event.preventDefault();
        popup.classList.add('pop-up-error');
    }
    else {
        localStorage.setItem('login', login.value);
    }
});
window.addEventListener('keydown', function (event) {
    if (event.keyCode === 27) {
        if (popup.classList.contains('pop-up-active')) {
            popup.classList.remove('pop-up-active');
        }
        if (overLay.classList.contains('modal-overlay-active')) {
            overLay.classList.remove('modal-overlay-active');
        }
    }
});
var image = 'img/Vector%20Smart%20Object%20copy%202.png';

function initMap() {
    var uluru = {
        lat: 59.938816
        , lng: 30.323244
    };
    var map = new google.maps.Map(document.getElementById('map'), {
        zoom: 17
        , center: uluru
    });
    var marker = new google.maps.Marker({
        position: uluru
        , map: map
        , title: 'NЁRDS DESIGN STUDIO'
        , icon: image
    });
}

extension: js


text:
SUMMARY = "Yoshimi is a software synthesizer for Linux, a fork of ZynAddSubFX"
HOMEPAGE = "http://yoshimi.sourceforge.net/"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=4c5f39c482ca5ca058c1ebd39612cf98"

inherit cmake qemu-ext pkgconfig gtk-icon-cache distro_features_check

REQUIRED_DISTRO_FEATURES = "x11"

DEPENDS += " \
    alsa-lib \
    fftw \
    jack \
    dssi \
    lv2 \
    cairo \
    fltk fltk-native \
    mxml \
    libpng jpeg \
    libxrender \
    libxft \
"

SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/1.5/${BPN}-${PV}.tar.bz2"
SRC_URI[md5sum] = "5368486f9b1525ac9026e0934bbcb9ac"
SRC_URI[sha256sum] = "20f3b36caf8d3d3ba038a33cb9e75b22fab60bca63c0fc814195046430ef1cdb"

OECMAKE_SOURCEPATH = "${S}/src"

LDFLAGS += "-lpng16 -ljpeg -lXrender -lXft"

FILES_${PN} += " \
    ${datadir}/metainfo \
    ${libdir}/lv2 \
"