text:
% Encoding: UTF-8
---
---

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

@book{einstein1956investigations,
  bibtex_show={true},
  title={Investigations on the Theory of the Brownian Movement},
  author={Einstein, Albert},
  year={1956},
  publisher={Courier Corporation,}
}

@article{einstein1950meaning,
  abbr={AJP},
  bibtex_show={true},
  title={The meaning of relativity},
  author={Einstein, Albert and Taub, AH},
  journal={American Journal of Physics,},
  volume={18},
  number={6},
  pages={403--404},
  year={1950},
  publisher={American Association of Physics Teachers,}
}

@article{PhysRev.47.777,
  abbr={PhysRev},
  title={Can Quantum-Mechanical Description of Physical Reality Be Considered Complete?},
  author={Einstein, A. and Podolsky, B. and Rosen, N.},
  abstract={In a complete theory there is an element corresponding to each element of reality. A sufficient condition for the reality of a physical quantity is the possibility of predicting it with certainty, without disturbing the system. In quantum mechanics in the case of two physical quantities described by non-commuting operators, the knowledge of one precludes the knowledge of the other. Then either (1) the description of reality given by the wave function in quantum mechanics is not complete or (2) these two quantities cannot have simultaneous reality. Consideration of the problem of making predictions concerning a system on the basis of measurements made on another system that had previously interacted with it leads to the result that if (1) is false then (2) is also false. One is thus led to conclude that the description of reality as given by a wave function is not complete.},
  journal={Phys. Rev.,},
  volume={47},
  issue={10},
  pages={777--780},
  numpages={0},
  year={1935},
  month={May},
  publisher=aps,
  doi={10.1103/PhysRev.47.777},
  url={http://link.aps.org/doi/10.1103/PhysRev.47.777},
  html={https://journals.aps.org/pr/abstract/10.1103/PhysRev.47.777},
  pdf={example_pdf.pdf},
  selected={false}}
}

@article{einstein1905molekularkinetischen,
  title={{\"U}ber die von der molekularkinetischen Theorie der W{\"a}rme geforderte Bewegung von in ruhenden Fl{\"u}ssigkeiten suspendierten Teilchen},
  author={Einstein, A.},
  journal={Annalen der physik,},
  volume={322},
  number={8},
  pages={549--560},
  year={1905},
  publisher={Wiley Online Library}
}

@article{einstein1905movement,
  abbr={Ann. Phys.},
  title={Un the movement of small particles suspended in statiunary liquids required by the molecular-kinetic theory 0f heat},
  author={Einstein, A.},
  journal={Ann. Phys.,},
  volume={17},
  pages={549--560},
  year={1905}
}

@article{einstein1905electrodynamics,
  title={On the electrodynamics of moving bodies},
  author={Einstein, A.},
  year={1905}
}

@Unpublished{eschenbaum-liebert-2021,
  abbr={arXiv},
  author   = {Nicolas Eschenbaum and Helge Liebert},
  title    = {Dealing with Uncertainty: The Value of Reputation in the Absence of Legal Institutions},
  month    = may,
  year     = {2021},
  keywords = {Reputation, institutions, uncertainty, dark web, drugs},
  abstract = {This paper studies reputation in the online market for illegal drugs in which no legal
  institutions exist to alleviate uncertainty. Trade takes place on platforms that offer
  rating systems for sellers, thereby providing an observable measure of reputation.
  The analysis exploits the fact that one of the two dominant platforms unexpectedly disappeared.
  Re-entering sellers reset their rating. The results show that on average prices decreased by up
  to 9% and that a 1% increase in rating causes a price increase of 1%. Ratings and prices recover
  after about three months. We calculate that identified good types earn 1,650 USD more per week.},
  pdf={dealing-with-uncertainty.pdf},
  arxiv={2107.11314},
  bibtex_show={true},
  selected={true}
}

@Article{buehler-eschenbaum-2020,
  abbr={JEBO},
  author   = {Stefan Buehler and Nicolas Eschenbaum},
  journal  = {Journal of Economic Behavior & Organization},
  title    = {Explaining escalating prices and fines: A unified approach},
  year     = {2020},
  issn     = {0167-2681},
  pages    = {153 - 164},
  volume   = {171},
  abstract = {This paper provides an explanation for escalating prices and fines based on a unified analytical framework that nests monopoly pricing and optimal law enforcement. We show that escalation emerges as an optimal outcome if the principal (i) lacks commitment ability, and (ii) gives less than full weight to agent benefits. Escalation is driven by decreasing transfers for non-active agents rather than increasing transfers for active agents. Some forward-looking agents then strategically delay their activity, which drives a wedge between the optimal static transfer and the benefit of an indifferent agent. This wedge is the source of escalation.},
  doi      = {https://doi.org/10.1016/j.jebo.2020.01.008},
  keywords = {Escalation, Behavior-based pricing, Repeat offenders, Deterrence},
  url      = {http://www.sciencedirect.com/science/article/pii/S0167268120300093},
  html={http://www.sciencedirect.com/science/article/pii/S0167268120300093},
  pdf={escalating-prices-and-fines.pdf},
  bibtex_show={true},
  selected={false}
}

@Unpublished{buehler-eschenbaum-2021,
  abbr={arXiv},
  author   = {Stefan Buehler and Nicolas Eschenbaum},
  title    = {Dynamic Monopoly Pricing with Multiple Varieties: Trading Up},
  month    = dec,
  year     = {2021},
  abstract = {This paper studies dynamic monopoly pricing for a class of settings that includes multiple durable, multiple rental, or a mix of varieties. We show that the driving force behind pricing dynamics is the seller's incentive to switch consumers - buyers and non-buyers - to higher-valued consumption options by lowering prices ("trading up"). If consumers cannot be traded up from the static optimal allocation, pricing dynamics do not emerge in equilibrium. If consumers can be traded up, pricing dynamics arise until all trading-up opportunities are exhausted. We study the conditions under which pricing dynamics end in finite time and characterize the final prices at which dynamics end.},
  pdf={Multiproduct_Dynamic_Pricing.pdf},
  arxiv={2108.07146},
  bibtex_show={true},
  selected={true}
}

@Unpublished{eschenbaum-2018,
  abbr={WP},
  author   = {Nicolas Eschenbaum},
  title    = {Estimating Geographic Market Size Nonparametrically: An Application to Grocery Retailing},
  month    = nov,
  year     = {2018},
  abstract = {This paper develops a nonparametric approach to empirically determine geographic
  market size. I exploit highly detailed spatial data and provide estimates of business-stealing
  effects across distance by studying the impact of store entry on competitors
  in an increasing range to the entry site. Entropy balancing is employed to control
  for systematic differences across local markets. I estimate that markets for Swiss
  grocery retailing stores are highly localized in a tight four kilometer radius. I further
  document evidence that the impact weakens with increasing distance and that
  smaller retailers compete in a more narrow market of only two kilometers in size.},
  pdf={geographic-market-definition.pdf},
  selected={false}
}

@Unpublished{eschenbaum-zahn-2021,
  abbr={arXiv},
  author   = {Nicolas Eschenbaum, Filip Mellgren, and Philipp Zahn},
  title    = {Robust Algorithmic Collusion},
  month    = dec,
  year     = {2021},
  abstract = {This paper develops a formal framework to assess policies of learning algorithms in economic games. We investigate whether reinforcement-learning agents with collusive pricing policies can successfully extrapolate collusive behavior from training to the market. We find that in testing environments collusion consistently breaks down. Instead, we observe static Nash play. We then show that restricting algorithms' strategy space can make algorithmic collusion robust, because it limits overfitting to rival strategies. Our findings suggest that policy-makers should focus on firm behavior aimed at coordinating algorithm design in order to make collusive policies robust},
  pdf={robust-algorithmic-collusion.pdf},
  arxiv={2201.00345},
  bibtex_show={true},
  selected={true}
}

@Unpublished{dynamic-pricing-experiment-2021,
  abbr={WP},
  author   = {Stefan Buehler and Thomas Epper and Nicolas Eschenbaum and Roberta Koch},
  title    = {Experimental Evidence on Coasian Dynamics and the Ratchet Effect},
  month    = jul,
  year     = {2021},
  selected={false}
}

@Comment{jabref-meta: databaseType:bibtex;}


text:
SECTION = "libs"
require libidl_${PV}.bb
inherit native

DEPENDS = "flex-native glib-2.0-native"

SRC_URI[md5sum] = "b43b289a859eb38a710f70622c46e571"
SRC_URI[sha256sum] = "bccc7e10dae979518ff012f8464e47ec4b3558a5456a94c8679653aa0b262b71"

license: MIT

license_type: permissive

branch_name: refs/heads/master

extension: bb


text:
package hash

import (
	"encoding/binary"
	"hash/crc32"
	"hash/crc64"
	"math/rand"
	"testing"
)

func TestHashCollisions_WASM(t *testing.T) {
	var (
		c32   int
		a32   int
		c16   int
		fn    int
		mur   int
		wy    int
		wy64  int
		met   int
		met64 int
		total int
	)

	type config struct {
		low            int
		high           int
		adder          int
		factor         float64
		addressStart   int
		multiplierLow  int
		multiplierHigh int
		multiplierAdd  int
	}
	for _, cfg := range []config{
		//{2, 10, 4, 8, 65580, 64, 4096, 128},
		// WASM like pointer values
		{40, 1024, 88, 3, 65580, 512, 256000, 96},
		{1024, 4096, 512, 3, 65580, 56, 52050, 512},
	} {
		for i := cfg.low; i < cfg.high; i += cfg.adder {
			var (
				entries = i
				slots   = int(float64(i) * cfg.factor)
			)
			for multiplier := cfg.multiplierLow; multiplier < cfg.multiplierHigh; multiplier += cfg.multiplierAdd {
				total += entries
				c32 += testCollisions(entries, multiplier, slots, crc32h)
				c16 += testCollisions(entries, multiplier, slots, crc16a)
				a32 += testCollisions(entries, multiplier, slots, Adler32)
				fn += testCollisions(entries, multiplier, slots, FNV32)
				mur += testCollisions(entries, multiplier, slots, Murmur32)
				wy += testCollisions(entries, multiplier, slots, WyHash32)
				wy64 += testCollisions64(entries, multiplier, slots, WyHash64)
				met += testCollisions(entries, multiplier, slots, Metro32)
				met64 += testCollisions64(entries, multiplier, slots, Metro64)
			}
		}

		//println("\tcrc32		", c32)
		//println("\tcrc16		", c16)
		//println("\tadler32		", a32)
		//println("\tfnv			", fn)
		//println("\tmurmur32		", mur)
		//println("\twyhash32	", wy)
		//println("\twyhash64	", wy64)
		//println("\tmetro32		", met)
		//println("\tmetro64		", met64)
	}

	println("")
	println("total		", total)
	println("\tcrc32		", c32)
	println("\tcrc16		", c16)
	println("\tAdler32		", a32)
	println("\tfnv			", fn)
	println("\tMurmur32	", mur)
	println("\tWyHash32	", wy)
	println("\tWyHash64	", wy64)
	println("\tMetro32		", met)
	println("\tMetro64		", met64)
}

func rangeRandom(min, max uint32) uint32 {
	return uint32(rand.Int31n(int32(max-min)) + int32(min))
}

func testCollisions(entries, multiplier, slots int, hasher func(uint32) uint32) int {
	m := make(map[uint32]struct{})
	count := 0

	ptr := 65680

	for i := 0; i < entries; i++ {
		v := hasher(uint32(ptr))
		ptr += multiplier
		index := v % uint32(slots)

		_, ok := m[index]
		if ok {
			count++
		} else {
			m[index] = struct{}{}
		}
	}
	return count
}

func testCollisionsRandom(entries, slots int, hasher func(uint32) uint32) int {
	m := make(map[uint32]struct{})
	count := 0

	for i := 0; i < entries; i++ {
		v := hasher(uint32(rand.Uint32()))
		index := v % uint32(slots)

		_, ok := m[index]
		if ok {
			count++
		} else {
			m[index] = struct{}{}
		}
	}
	return count
}

func testCollisions64(entries, multiplier, slots int, hasher func(uint64) uint64) int {
	m := make(map[uint64]struct{})
	count := 0

	ptr := 65536

	for i := uint64(0); i < uint64(entries); i++ {
		v := hasher(uint64(ptr))
		ptr += multiplier
		index := v % uint64(slots)

		_, ok := m[index]
		if ok {
			count++
		} else {
			m[index] = struct{}{}
		}
	}
	return count
}

func crc64h(v uint32) uint32 {
	h := crc64.New(crc64.MakeTable(crc64.ECMA))
	h.Reset()
	b := [4]byte{}
	binary.LittleEndian.PutUint32(b[0:], v)
	h.Write(b[0:4])
	return uint32(h.Sum64())
}

func crc32h(v uint32) uint32 {
	h := crc32.NewIEEE()
	h.Reset()
	b := [4]byte{}
	binary.LittleEndian.PutUint32(b[0:], v)
	h.Write(b[0:4])
	return uint32(h.Sum32())
}

var crc16tab = [256]uint16{
	0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
	0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
	0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
	0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de,
	0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485,
	0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
	0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4,
	0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc,
	0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823,
	0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b,
	0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12,
	0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a,
	0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41,
	0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49,
	0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70,
	0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78,
	0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f,
	0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067,
	0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e,
	0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256,
	0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d,
	0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
	0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c,
	0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634,
	0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab,
	0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3,
	0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a,
	0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92,
	0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9,
	0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1,
	0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8,
	0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0}

func crc16a(v uint32) uint32 {
	crc := uint16(0)
	crc = ((crc << 8) & 0xff00) ^ crc16tab[((crc>>8)&0xff)^uint16(byte(v))]
	crc = ((crc << 8) & 0xff00) ^ crc16tab[((crc>>8)&0xff)^uint16(byte(v<<8))]
	crc = ((crc << 8) & 0xff00) ^ crc16tab[((crc>>8)&0xff)^uint16(byte(v<<16))]
	crc = ((crc << 8) & 0xff00) ^ crc16tab[((crc>>8)&0xff)^uint16(byte(v<<24))]
	return uint32(crc)
}

func BenchmarkHash(b *testing.B) {
	//b.Run("crc32", func(b *testing.B) {
	//	for i := 0; i < b.N; i++ {
	//		crc32h(23)
	//	}
	//})
	//b.Run("crc16", func(b *testing.B) {
	//	for i := 0; i < b.N; i++ {
	//		crc16a(23)
	//	}
	//})
	//b.Run("crc16", func(b *testing.B) {
	//	for i := 0; i < b.N; i++ {
	//		crc16a(23)
	//	}
	//})
	b.Run("Adler32", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			Adler32(Adler32(uint32(i)))
		}
	})
	b.Run("FNV32", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			FNV32(FNV32(uint32(i)))
		}
	})
	b.Run("Murmur32", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			Murmur32(Murmur32(uint32(i)))
		}
	})
	b.Run("WyHash32", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			WyHash32(WyHash32(uint32(i)))
		}
	})
	b.Run("WyHash64", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			WyHash64(WyHash64(uint64(i)))
		}
	})
	b.Run("Metro32", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			Metro32(Metro32(uint32(i)))
		}
	})
	b.Run("Metro64", func(b *testing.B) {
		for i := 0; i < b.N; i++ {
			Metro64(Metro64(uint64(i)))
		}
	})
	//b.Run("WyHash", func(b *testing.B) {
	//	h := fnv.New32a()
	//	for i := 0; i < b.N; i++ {
	//		h.Reset()
	//
	//		WyHash32(23)
	//	}
	//})
}

repository: moontrade/memory

repo_name: moontrade/memory

branch_name: refs/heads/main

extension: go


text:
//go:build e2e

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

package bigquerydb

import (
	"math"
	"os"
	"testing"
	"time"

	"github.com/go-kit/log"
	"github.com/prometheus/prometheus/prompb"
	"github.com/stretchr/testify/assert"
)

var bigQueryClientTimeout = time.Second * 60
var logger = log.NewLogfmtLogger(log.NewSyncWriter(os.Stdout))

var googleAPIdatasetID = os.Getenv("BQ_DATASET_NAME")
var googleAPItableID = os.Getenv("BQ_TABLE_NAME")
var googleProjectID = os.Getenv("GCP_PROJECT_ID")

func TestLabelMatchers(t *testing.T) {

	nowUnix := time.Now().Unix() * 1000

	timeseriesData := map[string][]*prompb.TimeSeries{
		"first": {&prompb.TimeSeries{
			Labels: []*prompb.Label{
				{
					Name:  "__name__",
					Value: "first_metric",
				},
				{
					Name:  "label",
					Value: "first",
				},
			},
			Samples: []prompb.Sample{
				{
					Timestamp: nowUnix,
					Value:     1,
				},
			},
		}},
		"second": {&prompb.TimeSeries{
			Labels: []*prompb.Label{
				{
					Name:  "__name__",
					Value: "second_metric",
				},
				{
					Name:  "label",
					Value: "second",
				},
			},
			Samples: []prompb.Sample{
				{
					Timestamp: nowUnix,
					Value:     1,
				},
			},
		}},
		"nan": {&prompb.TimeSeries{
			Labels: []*prompb.Label{
				{
					Name:  "__name__",
					Value: "nan_metric",
				},
				{
					Name:  "label",
					Value: "NaN",
				},
			},
			Samples: []prompb.Sample{
				{
					Timestamp: nowUnix,
					Value:     math.NaN(),
				},
			},
		}},
		"emptyResult": {},
	}

	bqclient := NewClient(logger, "", googleProjectID, googleAPIdatasetID, googleAPItableID, bigQueryClientTimeout)

	for _, timeseries := range timeseriesData {
		err := bqclient.Write(timeseries)
		if err != nil {
			t.Fatal("error sending samples", err)
		}
	}

	testCases := map[string]struct {
		matchName      string
		matchValue     string
		matchType      prompb.LabelMatcher_Type
		expectedResult string
	}{
		"metric_name_equals":          {matchName: "__name__", matchValue: "first_metric", matchType: prompb.LabelMatcher_EQ, expectedResult: "first"},
		"metric_name_not_equals":      {matchName: "__name__", matchValue: "first_metric", matchType: prompb.LabelMatcher_NEQ, expectedResult: "second"},
		"metric_name_regex_match":     {matchName: "__name__", matchValue: "fi.*", matchType: prompb.LabelMatcher_RE, expectedResult: "first"},
		"metric_name_regex_not_equal": {matchName: "__name__", matchValue: "fi.*", matchType: prompb.LabelMatcher_NRE, expectedResult: "second"},
		"label_equals":                {matchName: "label", matchValue: "first", matchType: prompb.LabelMatcher_EQ, expectedResult: "first"},
		"label_not_equals":            {matchName: "label", matchValue: "first", matchType: prompb.LabelMatcher_NEQ, expectedResult: "second"},
		"label_regex_match":           {matchName: "label", matchValue: "fi.*", matchType: prompb.LabelMatcher_RE, expectedResult: "first"},
		"label_regex_not_equal":       {matchName: "label", matchValue: "fi.*", matchType: prompb.LabelMatcher_NRE, expectedResult: "second"},
		"nan_timeseries_sample_value": {matchName: "label", matchValue: "NaN", matchType: prompb.LabelMatcher_EQ, expectedResult: "emptyResult"},
	}

	for name, testCase := range testCases {
		t.Run(name, func(t *testing.T) {
			request := prompb.ReadRequest{
				Queries: []*prompb.Query{
					{
						StartTimestampMs: nowUnix,
						EndTimestampMs:   nowUnix + 10000,
						Matchers: []*prompb.LabelMatcher{
							{
								Type:  testCase.matchType,
								Name:  testCase.matchName,
								Value: testCase.matchValue,
							},
						},
					},
				},
			}
			result, err := bqclient.Read(&request)

			assert.Nil(t, err, "failed to process query")
			assert.Len(t, result.Results, 1)
			assert.Equal(t, timeseriesData[testCase.expectedResult], result.Results[0].Timeseries)
		})
	}
}

gha_language: Go


text:
package ip

import (
	"github.com/lxc/incus/shared"
)

// Addr represents arguments for address protocol manipulation.
type Addr struct {
	DevName string
	Address string
	Scope   string
	Family  string
}

// Add adds new protocol address.
func (a *Addr) Add() error {
	_, err := shared.RunCommand("ip", a.Family, "addr", "add", "dev", a.DevName, a.Address)
	if err != nil {
		return err
	}

	return nil
}

// Flush flushes protocol addresses.
func (a *Addr) Flush() error {
	cmd := []string{}
	if a.Family != "" {
		cmd = append(cmd, a.Family)
	}

	cmd = append(cmd, "addr", "flush", "dev", a.DevName)
	if a.Scope != "" {
		cmd = append(cmd, "scope", a.Scope)
	}

	_, err := shared.RunCommand("ip", cmd...)
	if err != nil {
		return err
	}

	return nil
}

repository: lxc/incus

repo_name: lxc/incus


text:
LICENSE  = "GPL-2.0-with-classpath-exception"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3e0b59f8fac05c3c03d4a26bbda13f8f"

inherit debian-package
require recipes-debian/sources/${BPN}.inc
inherit autotools-brokensep pkgconfig

SRC_URI_append = " \
    file://0001-make-autoconf-toolchain-remove-invalid-compiler-chec.patch \
    file://0002-make-lib-Lib-java.smartcardio.gmk-Prevent-host-conta.patch \
"

DEPENDS += " \
    zip-native unzip-native libxslt attr \
    fontconfig freetype libffi \
    giflib libpng zlib jpeg lcms pcsc-lite harfbuzz \
"

PACKAGECONFIG = " \
    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11 cups', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'alsa', '', d)} \
"

PACKAGECONFIG[x11] = "--with-x,,libx11 xorgproto libxt libxext libxrender libxtst"
PACKAGECONFIG[cups] = "--with-cups=${STAGING_DIR_HOST}/usr,,cups"
PACKAGECONFIG[alsa] = "--with-alsa,,alsa-lib"

EXTRA_CFLAGS = " \
    -Wdate-time \
    -D_FORTIFY_SOURCE=2 \
    -Wformat \
    -fno-stack-protector \
    -Wno-deprecated-declarations \
    -I${STAGING_INCDIR}/PCSC \
"

EXTRA_LDFLAGS = "-Xlinker -z -Xlinker relro -Xlinker -Bsymbolic-functions"

EXTRA_OECONF_append = " \
    --with-jvm-variants=server \
    --with-boot-jdk=/usr/lib/jvm/java-11-openjdk-amd64 \
    --disable-precompiled-headers \
    --with-jvm-features=zgc,shenandoahgc \
    --disable-ccache \
    --with-debug-level=release \
    --with-native-debug-symbols=zipped \
    --disable-warnings-as-errors \
    --disable-javac-server \
    --with-stdc++lib=dynamic \
    --with-giflib=system \
    --with-libpng=system \
    --with-zlib=system \
    --with-libjpeg=system \
    --with-lcms=system \
    --with-pcsclite=system \
    --with-harfbuzz=system \
    --with-extra-cflags='${CFLAGS} ${EXTRA_CFLAGS}' \
    --with-extra-cxxflags='${CXXFLAGS} ${EXTRA_CFLAGS}' \
    --with-extra-ldflags='${LDFLAGS} ${EXTRA_LDFLAGS}' \
    --with-sysroot=${STAGING_DIR_HOST} \
    --enable-option-checking=yes \
    --with-abi-profile=aarch64 \
    --with-cpu-port=aarch64 \
"

EXTRA_BUILD_ENV = "MAKE_VERBOSE=y QUIETLY= LOG=debug IGNORE_OLD_CONFIG=true LIBFFI_LIBS=-lffi_pic JOBS=${@oe.utils.cpu_count()}"

do_configure () {
    cd ${S}
    rm -rf ${S}/build
    mkdir ${S}/build
    cd ${S}/build
    oe_runconf
}

do_compile () {
    cd ${B}
    ${EXTRA_BUILD_ENV} oe_runmake images
}

PACKAGES = "${PN} ${PN}-dev ${PN}-source ${PN}-demo ${PN}-doc ${PN}-src ${PN}-dbg"

do_install () {
    mkdir -p ${D}${DEBIAN_JDK_BASE_DIR}
    cp -rp ${B}/images/jdk/* ${D}${DEBIAN_JDK_BASE_DIR}
    cp -rp ${B}/images/jmods ${D}${DEBIAN_JDK_BASE_DIR}
    cp -rp ${B}/images/jdk/lib/src.zip ${D}${DEBIAN_JDK_BASE_DIR}
    rm ${D}${DEBIAN_JDK_BASE_DIR}/lib/src.zip
    chown -R root:root ${D}${DEBIAN_JDK_BASE_DIR}
}

FILES_${PN} = " \
    ${DEBIAN_JDK_BASE_DIR}/bin/* \
    ${DEBIAN_JDK_BASE_DIR}/jmods/* \
    ${DEBIAN_JDK_BASE_DIR}/lib/* \
    ${DEBIAN_JDK_BASE_DIR}/conf/* \
    ${DEBIAN_JDK_BASE_DIR}/release \
    ${DEBIAN_JDK_BASE_DIR}/legal/* \
"

FILES_${PN}-demo = " \
    ${DEBIAN_JDK_BASE_DIR}/demo/* \
"

FILES_${PN}-doc = " \
    ${DEBIAN_JDK_BASE_DIR}/man/* \
"

FILES_${PN}-dev = " \
    ${DEBIAN_JDK_BASE_DIR}/include/* \
"

FILES_${PN}-source = " \
    ${DEBIAN_JDK_BASE_DIR}/src.zip \
"

B = "${S}/build"

PARALLEL_MAKE=""
PARALLEL_MAKEINST=""

export DEBIAN_JDK_BASE_DIR="${libdir}/jvm/${PN}"

inherit update-alternatives

ALTERNATIVE_PRIORITY = "100"

ALTERNATIVE_${PN} = "java javac jar"
ALTERNATIVE_LINK_NAME[java] = "${bindir}/java"
ALTERNATIVE_TARGET[java] = "${DEBIAN_JDK_BASE_DIR}/bin/java"

ALTERNATIVE_LINK_NAME[javac] = "${bindir}/javac"
ALTERNATIVE_TARGET[javac] = "${DEBIAN_JDK_BASE_DIR}/bin/javac"

ALTERNATIVE_LINK_NAME[jar] = "${bindir}/jar"
ALTERNATIVE_TARGET[jar] = "${DEBIAN_JDK_BASE_DIR}/bin/jar"

repository: aliceinwire/meta-debian-extended

repo_name: aliceinwire/meta-debian-extended

branch_name: refs/heads/warrior

gha_license_id: MIT


text:
SUMMARY = "Enable userspace control of Cypress USB-Serial bridge devices"
HOMEPAGE = "https://github.com/cyrozap/libcyusbserial"
BUGTRACKER = "https://github.com/cyrozap/libcyusbserial/issues"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING.LESSER.txt;md5=4fbd65380cdd255951079008b364516c"
DEPENDS = "libusb udev"

PV = "1.0.0+git${SRCPV}"

SRCREV = "655e2d544183d094f0e2d119c7e0c6206a0ddb3f"
SRC_URI = "git://github.com/cyrozap/${BPN}.git;branch=master;protocol=https"

S = "${WORKDIR}/git"

inherit cmake

PACKAGES =+ "${PN}-utils"
FILES:${PN}-utils = "${bindir}/*"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake


text:
package workers

import (
	"fmt"
	"sync/atomic"
)

// Worker is a simple primitive construct that listens on WorkChan for Work to do,
// Might hear a "true" on QuitChan if it is underworked,
// Might see a closed KillChan if it's time to leave expeditiously
type Worker struct {
	// WorkChan is where the work comes from
	WorkChan chan Work
	// QuitChan will get some bools sent to it when the Worker pool needs to shrink
	QuitChan chan bool
	// KillChan will close when all the Workers need to exit
	KillChan chan struct{}

	self atomic.Value
}

// Do forks off a Workerloop that listens for Work, quits, or kills
func (w *Worker) Do() {
	w.self.Store(true)

	go func() {
		Close := func() { w.self.Store(false) }
		defer Close()

		for {
			select {
			case work := <-w.WorkChan:
				DebugOut.Printf("Work: %T %+v \n", work, work)
				w.workIt(work)
			case b := <-w.QuitChan:
				if b {
					return
				}
			case <-w.KillChan:
				return
			}
		}
	}()
}

func (w *Worker) workIt(work Work) {
	defer w.recovery(work)
	work.Return(work.Work())
}

// recovery is used internally to recover from panic's caused by shoddy Work
func (w *Worker) recovery(panicwork Work) {
	if r := recover(); r != nil {
		DebugOut.Printf("Worker panic'd: %s\n", r)
		ErrorOut.Printf("Worker panic'd: %s\n", r)

		if panicwork != nil {
			panicwork.Return(WorkError{fmt.Sprintf("Work generated panic: %s", r)})
		}
	}
}

repository: cognusion/go-jar

repo_name: cognusion/go-jar


text:
package storage

import (
	"time"
	"database/sql"

	tgtypes "github.com/thewug/gogram/data"

	"github.com/thewug/dml"
)

var ErrNoLogin error = NewCommitAndYield("no stored credentials for telegram user")

type UserCreds struct {
	TelegramId           tgtypes.UserID `dml:"telegram_id"`
	User                 string         `dml:"api_user"`
	ApiKey               string         `dml:"api_apikey"`
	Janitor              bool           `dml:"privilege_janitorial"`
	Blacklist            string         `dml:"api_blacklist"`
	BlacklistFetched     time.Time      `dml:"api_blacklist_last_updated"`
}

func GetUserCreds(d DBLike, id tgtypes.UserID) (UserCreds, error) {
	creds := UserCreds{TelegramId: id}

	f := func(d DBLike) error {
		return d.Enter(func(tx Queryable) error {
			query := "SELECT telegram_id, api_user, api_key, privilege_janitorial, api_blacklist, api_blacklist_last_updated FROM remote_user_credentials WHERE telegram_id = $1"
			if err := dml.QuickScan(tx.QueryRow(query, id), &creds); err == sql.ErrNoRows {
				return ErrNoLogin
			} else {
				return err
			}
		})
	}

	var err error
	if d == nil {
		err = DefaultTransact(f)
	} else {
		err = f(d)
	}

	return creds, err
}

func WriteUserCreds(d DBLike, creds UserCreds) (error) {
	query := `
INSERT INTO remote_user_credentials (telegram_id, api_user, api_key, api_blacklist, api_blacklist_last_updated)
VALUES ($1, $2, $3, $4, $5)
ON CONFLICT (telegram_id) DO UPDATE
SET	api_user = EXCLUDED.api_user,
	api_key = EXCLUDED.api_key,
	api_blacklist = EXCLUDED.api_blacklist,
	api_blacklist_last_updated = EXCLUDED.api_blacklist_last_updated
`
	return d.Enter(func(tx Queryable) error {
		_, err := tx.Exec(query, creds.TelegramId, creds.User, creds.ApiKey, creds.Blacklist, creds.BlacklistFetched)
		return err
	})
}

func DeleteUserCreds(d DBLike, id tgtypes.UserID) (error) {
	query := "DELETE FROM remote_user_credentials WHERE telegram_id = $1"

	return d.Enter(func(tx Queryable) error {
		_, err := tx.Exec(query, id)
		return err
	})
}

func WriteUserTagRules(d DBLike, id tgtypes.UserID, name, rules string) (error) {
	// Change this to UPSERT

	return d.Enter(func(tx Queryable) error {
		_, err := tx.Exec("DELETE FROM user_tagrules WHERE telegram_id = $1 AND name = $2", id, name)
		if (err != nil) { return err }
		_, err = tx.Exec("INSERT INTO user_tagrules (telegram_id, name, rules) VALUES ($1, $2, $3)", id, name, rules)
		return err
	})
}

func GetUserTagRules(d DBLike, id tgtypes.UserID, name string) (string, error) {
	var rules string
	err := d.Enter(func(tx Queryable) error {
		row := tx.QueryRow("SELECT rules FROM user_tagrules WHERE telegram_id = $1 AND name = $2", id, name)
		return row.Scan(&rules)
	})
	return rules, err
}

func DeleteUserTagRules(d DBLike, id tgtypes.UserID) (error) {
	return d.Enter(func(tx Queryable) error {
		_, err := tx.Exec("DELETE FROM user_tagrules WHERE telegram_id = $1", id)
		return err
	})
}

repository: TheWug/fsb

repo_name: TheWug/fsb


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

/*
Package weather is a generated protocol buffer package.

It is generated from these files:
	proto/weather.proto

It has these top-level messages:
	Event
*/
package weather

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import 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.ProtoPackageIsVersion2 // please upgrade the proto package

// Example message
type Event struct {
	// city name
	City string `protobuf:"bytes,1,opt,name=city" json:"city,omitempty"`
	// unix timestamp
	Timestamp int64 `protobuf:"varint,2,opt,name=timestamp" json:"timestamp,omitempty"`
	// temperaure in Celcius
	Temperature int64 `protobuf:"varint,3,opt,name=temperature" json:"temperature,omitempty"`
}

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

func (m *Event) GetCity() string {
	if m != nil {
		return m.City
	}
	return ""
}

func (m *Event) GetTimestamp() int64 {
	if m != nil {
		return m.Timestamp
	}
	return 0
}

func (m *Event) GetTemperature() int64 {
	if m != nil {
		return m.Temperature
	}
	return 0
}

func init() {
	proto.RegisterType((*Event)(nil), "Event")
}

func init() { proto.RegisterFile("proto/weather.proto", fileDescriptor0) }

var fileDescriptor0 = []byte{
	// 115 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x2e, 0x28, 0xca, 0x2f,
	0xc9, 0xd7, 0x2f, 0x4f, 0x4d, 0x2c, 0xc9, 0x48, 0x2d, 0xd2, 0x03, 0xf3, 0x94, 0xa2, 0xb9, 0x58,
	0x5d, 0xcb, 0x52, 0xf3, 0x4a, 0x84, 0x84, 0xb8, 0x58, 0x92, 0x33, 0x4b, 0x2a, 0x25, 0x18, 0x15,
	0x18, 0x35, 0x38, 0x83, 0xc0, 0x6c, 0x21, 0x19, 0x2e, 0xce, 0x92, 0xcc, 0xdc, 0xd4, 0xe2, 0x92,
	0xc4, 0xdc, 0x02, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xe6, 0x20, 0x84, 0x80, 0x90, 0x02, 0x17, 0x77,
	0x49, 0x6a, 0x6e, 0x41, 0x6a, 0x51, 0x62, 0x49, 0x69, 0x51, 0xaa, 0x04, 0x33, 0x58, 0x1e, 0x59,
	0x28, 0x89, 0x0d, 0x6c, 0x87, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x0a, 0x47, 0xc3, 0x7a,
	0x00, 0x00, 0x00,
}


text:
package hit_test

import (
	"net/http"
	"testing"

	. "github.com/Eun/go-hit"
)

func TestExpectStatus_Equal(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().Equal(http.StatusOK),
	)
	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().Equal(http.StatusNotFound),
		),
		PtrStr("not equal"), nil, nil, nil, nil, nil, nil,
	)
}

func TestExpectStatus_NotEqual(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().NotEqual(http.StatusNotFound),
	)
	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().NotEqual(http.StatusOK),
		),
		PtrStr("should not be 200"),
	)
}

func TestExpectStatus_OneOf(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().OneOf(200, 300),
	)
	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().OneOf(300, 400),
		),
		PtrStr(`200 should be one of []interface {}{`), PtrStr("300,"), PtrStr("400,"), PtrStr("}"),
	)
}

func TestExpectStatus_NotOneOf(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().NotOneOf(300, 400),
	)
	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().NotOneOf(200, 300),
		),
		PtrStr(`200 should not contain 200`),
	)
}

func TestExpectStatus_GreaterThan(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().GreaterThan(199),
	)
	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().GreaterThan(299),
		),
		PtrStr("expected 200 to be greater than 299"),
	)
}

func TestExpectStatus_GreaterOrEqualThan(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().GreaterOrEqualThan(200),
	)
	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().GreaterOrEqualThan(299),
		),
		PtrStr("expected 200 to be greater or equal than 299"),
	)
}

func TestExpectStatus_LessThan(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().LessThan(201),
	)

	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().LessThan(100),
		),
		PtrStr("expected 200 to be less than 100"),
	)
}

func TestExpectStatus_LessOrEqualThan(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().LessOrEqualThan(200),
	)

	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().LessOrEqualThan(100),
		),
		PtrStr("expected 200 to be less or equal than 100"),
	)
}

func TestExpectStatus_Between(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().Between(100, 200),
	)
	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().Between(300, 400),
		),
		PtrStr("expected 200 to be between 300 and 400"),
	)
}

func TestExpectStatus_NotBetween(t *testing.T) {
	s := EchoServer()
	defer s.Close()

	Test(t,
		Post(s.URL),
		Send().Body().String("Hello World"),
		Expect().Status().NotBetween(300, 400),
	)
	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().NotBetween(200, 300),
		),
		PtrStr("expected 200 not to be between 200 and 300"),
	)
	ExpectError(t,
		Do(
			Post(s.URL),
			Send().Body().String("Hello World"),
			Expect().Status().NotBetween(100, 200),
		),
		PtrStr("expected 200 not to be between 100 and 200"),
	)
}

repository: Eun/go-hit

repo_name: Eun/go-hit


text:
package protocol

type IkeErrorCode uint16

const (
	ERR_UNSUPPORTED_CRITICAL_PAYLOAD IkeErrorCode = 1
	ERR_INVALID_IKE_SPI              IkeErrorCode = 4
	ERR_INVALID_MAJOR_VERSION        IkeErrorCode = 5
	ERR_INVALID_SYNTAX               IkeErrorCode = 7
	ERR_INVALID_MESSAGE_ID           IkeErrorCode = 9
	ERR_INVALID_SPI                  IkeErrorCode = 11
	ERR_NO_PROPOSAL_CHOSEN           IkeErrorCode = 14
	ERR_INVALID_KE_PAYLOAD           IkeErrorCode = 17
	ERR_AUTHENTICATION_FAILED        IkeErrorCode = 24
	ERR_SINGLE_PAIR_REQUIRED         IkeErrorCode = 34
	ERR_NO_ADDITIONAL_SAS            IkeErrorCode = 35
	ERR_INTERNAL_ADDRESS_FAILURE     IkeErrorCode = 36
	ERR_FAILED_CP_REQUIRED           IkeErrorCode = 37
	ERR_TS_UNACCEPTABLE              IkeErrorCode = 38
	ERR_INVALID_SELECTORS            IkeErrorCode = 39 // appears in INFORMATIONAL
	ERR_TEMPORARY_FAILURE            IkeErrorCode = 43
	ERR_CHILD_SA_NOT_FOUND           IkeErrorCode = 44
)

func GetIkeErrorCode(nt NotificationType) (IkeErrorCode, bool) {
	switch nt {
	case UNSUPPORTED_CRITICAL_PAYLOAD:
		return ERR_UNSUPPORTED_CRITICAL_PAYLOAD, true
	case INVALID_IKE_SPI:
		return ERR_INVALID_IKE_SPI, true
	case INVALID_MAJOR_VERSION:
		return ERR_INVALID_MAJOR_VERSION, true
	case INVALID_SYNTAX:
		return ERR_INVALID_SYNTAX, true
	case INVALID_MESSAGE_ID:
		return ERR_INVALID_MESSAGE_ID, true
	case INVALID_SPI:
		return ERR_INVALID_SPI, true
	case NO_PROPOSAL_CHOSEN:
		return ERR_NO_PROPOSAL_CHOSEN, true
	case INVALID_KE_PAYLOAD:
		return ERR_INVALID_KE_PAYLOAD, true
	case AUTHENTICATION_FAILED:
		return ERR_AUTHENTICATION_FAILED, true
	case SINGLE_PAIR_REQUIRED:
		return ERR_SINGLE_PAIR_REQUIRED, true
	case NO_ADDITIONAL_SAS:
		return ERR_NO_ADDITIONAL_SAS, true
	case INTERNAL_ADDRESS_FAILURE:
		return ERR_INTERNAL_ADDRESS_FAILURE, true
	case FAILED_CP_REQUIRED:
		return ERR_FAILED_CP_REQUIRED, true
	case TS_UNACCEPTABLE:
		return ERR_TS_UNACCEPTABLE, true
	case INVALID_SELECTORS:
		return ERR_INVALID_SELECTORS, true
	case TEMPORARY_FAILURE:
		return ERR_TEMPORARY_FAILURE, true
	case CHILD_SA_NOT_FOUND:
		return ERR_CHILD_SA_NOT_FOUND, true
	default:
		return 0, false
	}
}

func (e IkeErrorCode) Error() string {
	switch e {
	case ERR_UNSUPPORTED_CRITICAL_PAYLOAD:
		return "UNSUPPORTED_CRITICAL_PAYLOAD"
	case ERR_INVALID_IKE_SPI:
		return "INVALID_IKE_SPI"
	case ERR_INVALID_MAJOR_VERSION:
		return "INVALID_MAJOR_VERSION"
	case ERR_INVALID_SYNTAX:
		return "INVALID_SYNTAX"
	case ERR_INVALID_MESSAGE_ID:
		return "INVALID_MESSAGE_ID"
	case ERR_INVALID_SPI:
		return "INVALID_SPI"
	case ERR_NO_PROPOSAL_CHOSEN:
		return "NO_PROPOSAL_CHOSEN"
	case ERR_INVALID_KE_PAYLOAD:
		return "INVALID_KE_PAYLOAD"
	case ERR_AUTHENTICATION_FAILED:
		return "AUTHENTICATION_FAILED"
	case ERR_SINGLE_PAIR_REQUIRED:
		return "SINGLE_PAIR_REQUIRED"
	case ERR_NO_ADDITIONAL_SAS:
		return "NO_ADDITIONAL_SAS"
	case ERR_INTERNAL_ADDRESS_FAILURE:
		return "INTERNAL_ADDRESS_FAILURE"
	case ERR_FAILED_CP_REQUIRED:
		return "FAILED_CP_REQUIRED"
	case ERR_TS_UNACCEPTABLE:
		return "TS_UNACCEPTABLE"
	case ERR_INVALID_SELECTORS:
		return "INVALID_SELECTORS"
	case ERR_TEMPORARY_FAILURE:
		return "TEMPORARY_FAILURE"
	case ERR_CHILD_SA_NOT_FOUND:
		return "CHILD_SA_NOT_FOUND"
	default:
		return "Unknown Error"
	}
}

repository: msgboxio/ike

repo_name: msgboxio/ike


text:
require firmware.inc
require firmisrar.inc
# obsolete, en/decrypt with openssl
# require firmware-cip.inc

ARM_INSTRUCTION_SET = "arm"

PR = "r0"

DL_URI = "http://downloadcenter.samsung.com/content/FM/200911/20091119185403937/${MACHINE}[__________PX__].exe"

# S = "${WORKDIR}
P_OFFSET = "52204062"
P_LINE = ";/mtd_rwarea/rcSGO     &"
require firmware-package.bbclass

repository: metalsky/SamyGO

repo_name: metalsky/SamyGO


text:
@book{arrighi1994long,
  title={The long twentieth century: Money, power, and the origins of our times},
  author={Arrighi, Giovanni},
  year={1994},
  publisher={verso}
}

@book{arrighi2007adam,
  title={Adam Smith in Beijing},
  author={Arrighi, Giovanni},
  pages={332},
  year={2007},
  publisher ={verso}
}

@article{beck1995and,
  title={What to do (and not to do) with time-series cross-section data},
  author={Beck, Nathaniel and Katz, Jonathan N},
  journal={American political science review},
  pages={634--647},
  year={1995},
  publisher={JSTOR}
}

@book{brenner2003boom,
  title={The boom and the bubble: The US in the world economy},
  author={Brenner, Robert},
  year={2003},
  publisher={Verso}
}

@article{carruthers2011sociology,
  title={The sociology of finance},
  author={Carruthers, Bruce G and Kim, Jeong-Chul},
  journal={Annual Review of Sociology},
  volume={37},
  pages={239--259},
  year={2011},
  publisher={Annual Reviews}
}

@book{lenin1999imperialism,
  title={Imperialism: The highest stage of capitalism},
  author={Lenin, Vladimir Ilʹich},
  year={1917},
  note = {Reprinted in 1999},
  publisher={Resistance Books}
}

@article{dore2002stock,
  title={Stock market capitalism vs. welfare capitalism-Stock market capitalism and its diffusion},
  author={Dore, Ron},
  journal={New Political Economy},
  volume={7},
  number={1},
  pages={115--115},
  year={2002},
  publisher={Proquest ABI/INFORM}
}

@article{dore2008financialization,
  title={Financialization of the global economy},
  author={Dore, Ronald},
  journal={Industrial and Corporate Change},
  volume={17},
  number={6},
  pages={1097--1112},
  year={2008},
  publisher={Oxford University Press}
}

@article{dynan2009changing,
  title={Changing household financial opportunities and economic security},
  author={Dynan, Karen E},
  journal={Journal of Economic Perspectives},
  volume={23},
  number={4},
  pages={49--68},
  year={2009}
}

@article{carruthers1996state,
  title={State and Status: The Rise of the State and Aristocratic Power in Western Europe. by Samuel Clark},
  author={Carruthers, Bruce G},
  journal={American Journal of Sociology},
  volume={102},
  number={3},
  pages={878--879},
  year={1996},
  publisher={University of Chicago}
}

@article{davis2013financialization,
  title={Financialization and the nonfinancial corporation: an investigation of firm-level investment behavior in the US, 1971-2011},
  author={Davis, Leila E},
  year={2013}
}

@book{epstein2005financialization,
  title={Financialization and the world economy},
  author={Epstein, Gerald A},
  year={2005},
  publisher={Edward Elgar Publishing}
}

@book{mizruchi2013fracturing,
  title={The fracturing of the American corporate elite},
  author={Mizruchi, Mark S},
  year={2013},
  publisher={Harvard University Press}
}

@article{fligstein2015emergence,
  title={The emergence of a finance culture in American households, 1989--2007},
  author={Fligstein, Neil and Goldstein, Adam},
  journal={Socio-Economic Review},
  volume={13},
  number={3},
  pages={575--601},
  year={2015},
  publisher={Oxford University Press}
}

@article{davis2009rise,
  title={The rise and fall of finance and the end of the society of organizations},
  author={Davis, Gerald F},
  journal={Academy of Management Perspectives},
  volume={23},
  number={3},
  pages={27--44},
  year={2009},
  publisher={Academy of Management Briarcliff Manor, NY}
}

@book{fligstein1993transformation,
  title={The transformation of corporate control},
  author={Fligstein, Neil},
  year={1993},
  publisher={Harvard University Press}
}

@article{garten2009antigenic,
  title={Antigenic and genetic characteristics of swine-origin 2009 A (H1N1) influenza viruses circulating in humans},
  author={Garten, Rebecca J and Davis, C Todd and Russell, Colin A and Shu, Bo and Lindstrom, Stephen and Balish, Amanda and Sessions, Wendy M and Xu, Xiyan and Skepner, Eugene and Deyde, Varough and others},
  journal={science},
  volume={325},
  number={5937},
  pages={197--201},
  year={2009},
  publisher={American Association for the Advancement of Science}
}

@incollection{harvey1985geopolitics,
  title={The geopolitics of capitalism},
  author={Harvey, David},
  booktitle={Social relations and spatial structures},
  pages={128--163},
  year={1985},
  publisher={Springer}
}

@book{krippner2011capitalizing,
  title={Capitalizing on crisis: The political origins of the rise of finance},
  author={Krippner, Greta R},
  year={2011},
  publisher={Harvard University Press}
}

@book{lachmann2020first,
  title={First Class Passengers on a Sinking Ship: Elite Politics and the Decline of Great Powers},
  author={Lachmann, Richard},
  year={2020},
  publisher={Verso Trade}
}

@article{lin2013financialization,
  title={Financialization and US income inequality, 1970--2008},
  author={Lin, Ken-Hou and Tomaskovic-Devey, Donald},
  journal={American Journal of Sociology},
  volume={118},
  number={5},
  pages={1284--1329},
  year={2013},
  publisher={University of Chicago Press Chicago, IL}
}

@book{orhangazi2008financialization,
  title={Financialization and the US Economy},
  author={Orhangazi, {\`E}},
  year={2008},
  publisher={Edward Elgar Publishing}
}

@book{prasad2012land,
  title={The land of too much: American abundance and the paradox of poverty},
  author={Prasad, Monica},
  year={2012},
  publisher={Harvard University Press}
}

@article{quinn2017miracles,
  title={“The miracles of bookkeeping”: How budget politics link fiscal policies and financial markets},
  author={Quinn, Sarah},
  journal={American Journal of Sociology},
  volume={123},
  number={1},
  pages={48--85},
  year={2017},
  publisher={University of Chicago Press Chicago, IL}
}

@book{quinn2019american,
  title={American bonds: how credit markets shaped a nation},
  author={Quinn, Sarah L},
  year={2019},
  publisher={Princeton University Press}
}

@article{krippner2005financialization,
  title={The financialization of the American economy},
  author={Krippner, Greta R},
  journal={Socio-economic review},
  volume={3},
  number={2},
  pages={173--208},
  year={2005},
  publisher={Oxford University Press}
}

@article{stockhammer2004financialisation,
  title={Financialisation and the slowdown of accumulation},
  author={Stockhammer, Engelbert},
  journal={Cambridge journal of economics},
  volume={28},
  number={5},
  pages={719--741},
  year={2004},
  publisher={Oxford University Press}
}

@book{sassen2012global,
  title={Global finance and its institutional spaces},
  author={Sassen, Saskia},
  year={2012},
  publisher={Oxford University Press Oxford}
}

@article{sum2008great,
  title={The great divergence: real-wage growth of all workers versus finance workers},
  author={Sum, Andrew and Tobar, Paulo and McLaughlin, Joseph and Palma, Sheila},
  journal={Challenge},
  volume={51},
  number={3},
  pages={57--79},
  year={2008},
  publisher={Taylor \& Francis}
}

@book{dumenil2004capital,
  title={Capital resurgent: Roots of the neoliberal revolution},
  author={Dum{\'e}nil, G{\'e}rard and Dum{\'e}nil, G{\'e}rard and L{\'e}vy, Dominique and Levy, Dominique},
  year={2004},
  publisher={Harvard University Press}
}

@article{fingleton1999praise,
  title={In praise of hard industries},
  author={Fingleton, Eamonn},
  journal={The International Economy},
  volume={13},
  number={5},
  pages={52},
  year={1999},
  publisher={International Economy Publications, Incorporated}
}

@article{castells1998information,
  title={The information age: economy, society and culture. Volume 1. The rise of the network society},
  author={Castells, Manuel and Blackwell, Cambridge},
  journal={Environment and Planning B: Planning and Design},
  volume={25},
  pages={631--636},
  year={1998},
  publisher={Citeseer}
}

@article{van2014making,
  title={Making sense of financialization},
  author={Van der Zwan, Natascha},
  journal={Socio-economic review},
  volume={12},
  number={1},
  pages={99--129},
  year={2014},
  publisher={Oxford University Press}
}

@inproceedings{wade2005march,
  title={The March of Neoliberalism And What to Do about It},
  author={Wade, H Robert},
  booktitle={draft paper for plenary talk at conference Beyond ‘Deregulation’: Finance in the 21st Century, University of Sussex},
  pages={26--28},
  year={2005}
}

@book{darmofal2015spatial,
  title={Spatial analysis for the social sciences},
  author={Darmofal, David},
  year={2015},
  publisher={Cambridge University Press}
}

@book{mauro2013modern,
  title={A modern history of fiscal prudence and profligacy},
  author={Mauro, Mr Paolo and Romeu, Rafael and Binder, Mr Ariel J and Zaman, Mr Asad},
  number={13-15},
  year={2013},
  publisher={International Monetary Fund}
}

@book{baltagi2008econometric,
  title={Econometric analysis of panel data},
  author={Baltagi, Badi},
  year={2008},
  publisher={John Wiley \& Sons}
}

@article{parks1967efficient,
  title={Efficient estimation of a system of regression equations when disturbances are both serially and contemporaneously correlated},
  author={Parks, Richard W},
  journal={Journal of the American Statistical Association},
  volume={62},
  number={318},
  pages={500--509},
  year={1967},
  publisher={Taylor \& Francis Group}
}

@article{beck1995and,
  title={What to do (and not to do) with time-series cross-section data},
  author={Beck, Nathaniel and Katz, Jonathan N},
  journal={American political science review},
  pages={634--647},
  year={1995},
  publisher={JSTOR}
}

@article{bailey2011implementing,
  title={Implementing panel corrected standard errors in R: the pcse package},
  author={Bailey, Delia and Katz, Jonathan N},
  journal={Journal of Statistical Software},
  volume={42},
  number={CS1},
  pages={1--11},
  year={2011},
  publisher={University of California, Los Angeles}
}

@article{beck2001time,
  title={Time-series--cross-section data: What have we learned in the past few years?},
  author={Beck, Nathaniel},
  journal={Annual review of political science},
  volume={4},
  number={1},
  pages={271--293},
  year={2001},
  publisher={Annual Reviews 4139 El Camino Way, PO Box 10139, Palo Alto, CA 94303-0139, USA}
}

@book{croissant2019panel,
  title={Panel data econometrics with R},
  author={Croissant, Yves and Millo, Giovanni},
  year={2019},
  publisher={Wiley Online Library}
}

@article{breusch1980lagrange,
  title={The Lagrange multiplier test and its applications to model specification in econometrics},
  author={Breusch, Trevor S and Pagan, Adrian R},
  journal={The review of economic studies},
  volume={47},
  number={1},
  pages={239--253},
  year={1980},
  publisher={JSTOR}
}

@article{pesaran2004general,
  title={General diagnostic tests for cross-sectional dependence in panels},
  author={Pesaran, M Hashem},
  journal={Empirical Economics},
  pages={1--38},
  year={2004},
  publisher={Springer}
}

@article{pesaran2015testing,
  title={Testing weak cross-sectional dependence in large panels},
  author={Pesaran, M Hashem},
  journal={Econometric reviews},
  volume={34},
  number={6-10},
  pages={1089--1117},
  year={2015},
  publisher={Taylor \& Francis}
}

@article{breusch1979simple,
  title={A simple test for heteroscedasticity and random coefficient variation},
  author={Breusch, Trevor S and Pagan, Adrian R},
  journal={Econometrica: Journal of the econometric society},
  pages={1287--1294},
  year={1979},
  publisher={JSTOR}
}

@article{koenker1981note,
  title={A note on studentizing a test for heteroscedasticity},
  author={Koenker, Roger},
  journal={Journal of econometrics},
  volume={17},
  number={1},
  pages={107--112},
  year={1981},
  publisher={Elsevier}
}

@book{kramer2012linear,
  title={The linear regression model under test},
  author={Kr{\"a}mer, Walter and Sonnberger, Harald},
  year={2012},
  publisher={Springer Science \& Business Media}
}

@article{breusch1978testing,
  title={Testing for autocorrelation in dynamic linear models},
  author={Breusch, Trevor S},
  journal={Australian Economic Papers},
  volume={17},
  number={31},
  pages={334--355},
  year={1978},
  publisher={Wiley Online Library}
}

@article{godfrey1978testing,
  title={Testing against general autoregressive and moving average error models when the regressors include lagged dependent variables},
  author={Godfrey, Leslie G},
  journal={Econometrica: Journal of the Econometric Society},
  pages={1293--1301},
  year={1978},
  publisher={JSTOR}
}

@book{wooldridge2015introductory,
  title={Introductory econometrics: A modern approach},
  author={Wooldridge, Jeffrey M},
  year={2015},
  publisher={Cengage learning}
}

@article{phillips1990asymptotic,
  title={Asymptotic properties of residual based tests for cointegration},
  author={Phillips, Peter CB and Ouliaris, Sam},
  journal={Econometrica: journal of the Econometric Society},
  pages={165--193},
  year={1990},
  publisher={JSTOR}
}

@article{garrett2001globalization,
  title={Globalization and government spending around the world},
  author={Garrett, Geoffrey},
  journal={Studies in comparative international development},
  volume={35},
  number={4},
  pages={3--29},
  year={2001},
  publisher={Springer}
}

@article{banerjee1993co,
  title={Co-integration, error correction, and the econometric analysis of non-stationary data},
  author={Banerjee, Anindya and Dolado, Juan J and Galbraith, John W and Hendry, David and others},
  journal={OUP Catalogue},
  year={1993},
  publisher={Oxford university press}
}

@article{de2008taking,
  title={Taking time seriously},
  author={De Boef, Suzanna and Keele, Luke},
  journal={American Journal of Political Science},
  volume={52},
  number={1},
  pages={184--200},
  year={2008},
  publisher={Wiley Online Library}
}

@article{engle1987co,
  title={Co-integration and error correction: representation, estimation, and testing},
  author={Engle, Robert F and Granger, Clive WJ},
  journal={Econometrica: journal of the Econometric Society},
  pages={251--276},
  year={1987},
  publisher={JSTOR}
}

@article{kelly2012federalism,
  title={Federalism and American inequality},
  author={Kelly, Nathan J and Witko, Christopher},
  journal={The Journal of Politics},
  volume={74},
  number={2},
  pages={414--426},
  year={2012},
  publisher={Cambridge University Press New York, USA}
}

@article{kristal2010good,
  title={Good times, bad times: Postwar labor’s share of national income in capitalist democracies},
  author={Kristal, Tali},
  journal={American Sociological Review},
  volume={75},
  number={5},
  pages={729--763},
  year={2010},
  publisher={Sage Publications Sage CA: Los Angeles, CA}
}

@article{volscho2012rise,
  title={The rise of the super-rich: Power resources, taxes, financial markets, and the dynamics of the top 1 percent, 1949 to 2008},
  author={Volscho, Thomas W and Kelly, Nathan J},
  journal={American Sociological Review},
  volume={77},
  number={5},
  pages={679--699},
  year={2012},
  publisher={Sage Publications Sage CA: Los Angeles, CA}
}

@misc{oecdinflation,
  title = {Inflation(cpi)},
  author ={{OECD}},
  year = {2021},
  howpublished = {\url{https://data.oecd.org/price/inflation-cpi.htm}},
  note = {Accessed: 14 May 2021}
}

@misc{oecdreer,
  title = {REAL EFFECTIVE EXCHANGE RATES},
  author ={{OECD}},
  year = {2021},
  howpublished = {\url{https://stats.oecd.org/glossary/detail.asp?ID=2243}},
  note = {Accessed: 14 May 2021}
}

@article{keele2004not,
  title={Not just for cointegration: error correction models with stationary data},
  author={Keele, Luke and De Boef, Suzanna},
  journal={Documento de Trabajo. Departamento de Pol{\'\i}tica y Relaciones Internacionales, Nuffield College y Oxford University},
  year={2004}
}

@incollection{kotz20191,
  title={1. Financialization and Neoliberalism},
  author={Kotz, David M},
  booktitle={Relations of Global Power},
  pages={1--18},
  year={2019},
  publisher={University of Toronto Press}
}

@article{oecddeficit,
  title = {General government deficit},
  author= {{OECD}},
  year={2021},
  howpublished = {\url{https://data.oecd.org/gga/general-government-deficit.htm}},
  note = {Accessed: 14 May 2021}
}

@article{oecdva,
  author = {{OECD}},
  year={2021},
  title = {Value added by activity},
  howpublished = {\url{https://data.oecd.org/natincome/value-added-by-activity.htm}},
  note = {Accessed: 14 May 2021}
}

@article{wiidguide,
title={World Income Inequality Database (WIID) User Guide},
author={{United Nations}},
year={2021}
}

@article{wbgini,
  title = {Gini Index},
  author={{World Bank}},
  year={2021},
  howpublished = {\url{https://data.worldbank.org/indicator/SI.POV.GINI}},
  note = {Accessed: 14 May 2021}
}

@article{wbfdi,
  title = {Foreign direct investment, net inflows (BoP, current US dollars)},
  author = {{World Bank}},
  year={2021},
  howpublished = {\url{https://data.worldbank.org/indicator/BX.KLT.DINV.CD.WD}},
  note = {Accessed: 14 May 2021}
}

@article{wbnet,
  title = {Net trade in goods and services (BoP, current US dollars)},
  author = {{World Bank}},
  year={2021},
  howpublished = {\url{https://data.worldbank.org/indicator/BN.GSR.GNFS.CD}},
  note = {Accessed: 14 May 2021}
}

@article{imfnfc,
  title = {Nonfinancial corporate debt, loans and debt securities},
  author = {{IMF}},
  year={2021},
  howpublished = {\url{https://www.imf.org/external/datamapper/NFC_LS@GDD/SWE}},
  note = {Accessed: 14 May 2021}
}

extension: bib


text:
L4T_DEB_COPYRIGHT_MD5 = "fab0c15b4bbf7f8d5ac2bd6673d4211c"

require tegra-debian-libraries-common.inc

LICENSE += "& Apache-2.0"
LIC_FILES_CHKSUM += "file://usr/share/doc/nvidia-tegra/LICENSE.tegra_sensors;md5=e7fe81c64aaee40b3d9e5b11c3e0ea58"

MAINSUM = "41845dade9d3e1cd67be7875e0634167de414678f088d4c6342ccd696894e63e"
MAINSUM:tegra210 = "553a56f565e0ac9659a6633c3fe07afc3e68fad4451bcec9b651a929c0e986c5"

TEGRA_LIBRARIES_TO_INSTALL = "\
    tegra/libnvcolorutil.so \
    tegra/libnvdc.so \
    tegra/libnvddk_2d_v2.so \
    tegra/libnvddk_vic.so \
    tegra/libnvdla_compiler.so \
    tegra/libnvdla_runtime.so \
    tegra/libnvidia-tls.so.${L4T_VERSION} \
    tegra/libnvimp.so \
    tegra/libnvll.so \
    tegra/libnvos.so \
    tegra/libnvphs.so \
    tegra/libnvrm.so \
    tegra/libnvrm_gpu.so \
    tegra/libnvrm_graphics.so \
    tegra/libsensors.hal-client.nvs.so \
    tegra/libsensors.l4t.no_fusion.nvs.so \
    tegra/libsensors_hal.nvs.so \
    ${SOC_SPECIFIC_LIBS} \
"

SOC_SPECIFIC_LIBS = "\
    tegra/libnvisp_utils.so \
    tegra/libnvpva.so \
"
SOC_SPECIFIC_LIBS:tegra210 = ""

FILES_SOLIBSDEV = ""
SOLIBS = ".so*"
RRECOMMENDS:${PN} = "kernel-module-nvgpu"

repository: danielwangksu/meta-tegra

repo_name: danielwangksu/meta-tegra


text:
FILE(REMOVE_RECURSE
  "CMakeFiles/singlepoint.dir/src/singlepoint/singlepoint.cpp.o"
  "bin/singlepoint.pdb"
  "bin/singlepoint"
)

# Per-language clean rules from dependency scanning.
FOREACH(lang CXX)
  INCLUDE(CMakeFiles/singlepoint.dir/cmake_clean_${lang}.cmake OPTIONAL)
ENDFOREACH(lang)

extension: cmake


text:
@article{porwal2019order,
  title={Order estimation of 2-dimensional complex superimposed exponential signal model using exponentially embedded family (EEF) rule: large sample consistency properties},
  author={Porwal, Anupreet and Mitra, Sharmishtha and Mitra, Amit},
  journal={Multidimensional Systems and Signal Processing},
  volume={30},
  number={3},
  pages={1293--1308},
  year={2019},
  publisher={Springer}
}

repository: Anupreet-Porwal/academic-kickstart

repo_name: Anupreet-Porwal/academic-kickstart


text:
package models

import (
	"errors"
	"github.com/fatih/structs"
	"github.com/mitchellh/mapstructure"
	"strconv"
)

type Consumer struct {
	id        int
	Username  string         `json:"username"`
	ApiKey    string         `json:"apikey"`
	RateLimit map[string]int `json:"ratelimit"`
	Groups    []string       `json:"groups"`
}

// NewConsumer creates new consumer. It generates an apikey if none is given.
func NewConsumer(username, apiKey string) (*Consumer, error) {
	usernameExists := FindConsumerBy("Username", username)
	apikeyExists := FindConsumerBy("ApiKey", apiKey)
	if usernameExists != nil {
		return nil, errors.New("Given username already exists")
	}
	if apiKey != "" && apikeyExists != nil {
		return nil, errors.New("Given apikey already exists")
	}

	if apiKey == "" {
		var keyExists *Consumer
		for {
			apiKey = newUuid()
			keyExists = FindConsumerBy("ApiKey", apiKey)
			if keyExists == nil {
				break
			}
		}
	}
	return &Consumer{
		id:        0,
		Username:  username,
		ApiKey:    apiKey,
		RateLimit: map[string]int{"s": 0, "m": 0, "h": 0, "d": 0},
		Groups:    make([]string, 0),
	}, nil
}

// GetConsumerFromInterface converts an map[string]interface{} (from tiedot) to a Consumer struct
func GetConsumerFromInterface(id int, c map[string]interface{}) *Consumer {
	var consumer Consumer
	if err := mapstructure.Decode(c, &consumer); err != nil {
		return nil
	}

	consumer.id = id
	return &consumer
}

// UpdateFromForm update consumer from form values
func (c *Consumer) UpdateFromForm(form map[string][]string) {
	for k, v := range form {
		switch k {
		case "username":
			c.Username = v[0]
		case "apikey":
			c.ApiKey = v[0]
		case "ratelimit[s]":
			c.RateLimit["s"], _ = strconv.Atoi(v[0])
		case "ratelimit[m]":
			c.RateLimit["m"], _ = strconv.Atoi(v[0])
		case "ratelimit[h]":
			c.RateLimit["h"], _ = strconv.Atoi(v[0])
		case "ratelimit[d]":
			c.RateLimit["d"], _ = strconv.Atoi(v[0])
		case "groups":
			c.Groups = v
		}
	}
}

// FindAllConsumers returns all consumers
func FindAllConsumers() []*Consumer {
	consumers := store.Use("Consumers")
	var consumersList []*Consumer = make([]*Consumer, 0)
	consumers.ForEachDoc(func(id int, docContent []byte) (willMoveOn bool) {
		doc, err := consumers.Read(id)
		if err != nil {
			return true
		}
		consumersList = append(consumersList, GetConsumerFromInterface(id, doc))
		return true // move on to the next document
	})

	return consumersList
}

func FindConsumerByID(id int) *Consumer {
	c := FindByID("Consumers", id)
	return GetConsumerFromInterface(id, c)
}

// FindConsumerBy returns consumer matching provided field->value
func FindConsumerBy(field string, value string) *Consumer {
	results := FindBy("Consumers", []interface{}{field}, value, 1)
	if len(results) == 0 {
		return nil
	}
	var consumer map[string]interface{}
	var consumerId int
	for id, c := range results {
		consumer = c
		consumerId = id
	}
	return GetConsumerFromInterface(consumerId, consumer)
}

func (c *Consumer) GetId() int {
	return c.id
}

// Save consumer in database
// Insert a new document if the id == 0
func (c *Consumer) Save() (int, error) {
	consumers := store.Use("Consumers")
	if c.id == 0 {
		docID, err := consumers.Insert(structs.Map(c))
		c.id = docID
		return c.id, err
	} else {
		err := consumers.Update(c.id, structs.Map(c))
		return c.id, err
	}
}

// Delete removes consumer from database
func (c *Consumer) Delete() error {
	consumers := store.Use("Consumers")
	return consumers.Delete(c.id)
}

repository: xaviergodart/gydro

repo_name: xaviergodart/gydro


text:
package openstack

import (
	"fmt"

	"github.com/cycloidio/inframap/errcode"
	"github.com/cycloidio/inframap/provider"

	tfdocOS "github.com/cycloidio/tfdocs/providers/openstack"
	"github.com/cycloidio/tfdocs/resource"
)

// Provider is the Type that implements the interface 'provider.Interface'
type Provider struct {
	provider.NopProvider
}

var (
	usedAttributes = []string{
		"id",
		"instance_id",
		"direction",
		"remote_group_id",
		"security_group_ids",
		"loadbalancer_id",
		"listener_id",
		"pool_id",
	}
)

// Type returns the type of the implementation
func (a Provider) Type() provider.Type { return provider.OpenStack }

// IsNode returns if the resource is a Node
func (a Provider) IsNode(resource string) bool {
	_, ok := nodeTypes[resource]
	return ok
}

// IsEdge returns if the resource is an Edge
func (a Provider) IsEdge(resource string) bool {
	_, ok := edgeTypes[resource]
	return ok
}

// Resource returns the resource information
func (a Provider) Resource(resource string) (*resource.Resource, error) {
	r, err := tfdocOS.GetResource(resource)
	if err != nil {
		return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundResource)
	}
	return r, nil
}

// DataSource returns the resource information
func (a Provider) DataSource(resource string) (*resource.Resource, error) {
	r, err := tfdocOS.GetDataSource(resource)
	if err != nil {
		return nil, fmt.Errorf("could not get resource %q: %w", resource, errcode.ErrProviderNotFoundDataSource)
	}
	return r, nil
}

// ResourceInOutNodes returns the In, Out and Nodes of the rs based on the cfg
func (a Provider) ResourceInOutNodes(id, rs string, cfgs map[string]map[string]interface{}) ([]string, []string, []string) {
	var ins, outs []string
	cfg := cfgs[id]
	switch rs {
	case "openstack_compute_interface_attach_v2":
		if instanceID, ok := cfg["instance_id"]; ok {
			ins = append(ins, instanceID.(string))
		}
	case "openstack_networking_secgroup_rule_v2":
		if direction, ok := cfg["direction"]; ok {
			if direction.(string) == "ingress" {
				if rg, ok := cfg["remote_group_id"]; ok {
					ins = append(ins, rg.(string))
				}
			} else {
				if rg, ok := cfg["remote_group_id"]; ok {
					outs = append(outs, rg.(string))
				}
			}
		}
	case "openstack_networking_port_v2":
		if sgs, ok := cfg["security_group_ids"]; ok {
			for _, sg := range sgs.([]interface{}) {
				ins = append(ins, sg.(string))
			}
		}
	case "openstack_lb_listener_v2":
		if lbid, ok := cfg["loadbalancer_id"]; ok {
			ins = append(ins, lbid.(string))
		}
	case "openstack_lb_pool_v2":
		if lid, ok := cfg["listener_id"]; ok {
			ins = append(ins, lid.(string))
		}
	case "openstack_lb_member_v2":
		if pid, ok := cfg["pool_id"]; ok {
			ins = append(ins, pid.(string))
		}
	}
	return ins, outs, nil
}

// UsedAttributes returns all the attributes that are
// required/used/needed on the providers, so when we have to
// prune we know what to keep
func (a Provider) UsedAttributes() []string {
	return usedAttributes
}

repository: cycloidio/inframap

repo_name: cycloidio/inframap


text:
package main

import (
	"encoding/json"
	"fmt"
	gin "github.com/gin-gonic/gin"
	"io/ioutil"
	"net/http"
	"strconv"
	"time"
)

func maoGet(c *gin.Context) {
	c.JSON(200, gin.H{
		"beijing": 118.5,
	})
}

func registerPage(c *gin.Context) {
	c.HTML(200, "index.html", nil)
}

type DeviceConnector struct {
	ip string `form:"ipv4"`
	port uint16 `form:"port"`
}

func register(c *gin.Context) {
	//data := DeviceConnector{}
	//err := c.ShouldBind(&data)
	//if err == nil {
	//	c.JSON(200, gin.H{"ipv4": data.ip, "port": data.port})
	//} else {
	//	c.JSON(509, gin.H{"err": err})
	//}

	data := DeviceConnector{}
	data.ip = c.PostForm("ipv4")
	tmpPort,_ := strconv.ParseUint(c.PostForm("port"),0, 16)
	data.port = uint16(tmpPort)

	c.JSON(200, gin.H{"ipv4": data.ip, "port": data.port})
}

func addDevice() {

	request, err := http.NewRequest("GET", "http://192.168.1.230:8181/onos/mao/MaoIntegration/netconf/biKnownLinks", nil)
	request.Header.Add("Authorization", "Basic a2FyYWY6a2FyYWY=")
	if err != nil {
		fmt.Println(err)
		return
	}

	//resp, err := http.Get("http://192.168.1.230:8181/onos/mao/MaoIntegration/netconf/biKnownLinks")
	client := http.Client{}
	resp, err := client.Do(request)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer resp.Body.Close()

	body,err := ioutil.ReadAll(resp.Body)
	//str := string(body)
	//fmt.Println(str)

	links := make([]map[string]interface{}, 0)
	err = json.Unmarshal(body, &links)
	if err != nil {
		fmt.Println("err")
		fmt.Println(err)
		return
	}
	//fmt.Println("*************************")
	//for index, link := range links {
	//	fmt.Println("============= " + strconv.Itoa(index) + " =============")
	//	fmt.Println(link["localDeviceName"])
	//	fmt.Println(link["localPortName"])
	//	fmt.Println(link["remoteDeviceName"])
	//	fmt.Println(link["remotePortName"])
	//}

	//fmt.Println(links)
}

func startRestful() {
	fmt.Printf("qingdao\n")
	//gin.SetMode(gin.ReleaseMode)
	restful := gin.Default()
	restful.LoadHTMLFiles("index.html")
	restful.GET("/", registerPage)
	restful.POST("/register", register)
	//restful.GET("/test", addDevice)
	restful.Run()
}

func main() {
	go startRestful()

	count := 1
	for {
		if count % 1000 == 0 {
			fmt.Println(count)
			fmt.Println(time.Now())
		}
		count++
		addDevice()
		//time.Sleep(3 * time.Second)
	}
}


text:
%% This BibTeX bibliography file was created using BibDesk.
%% https://bibdesk.sourceforge.io/

%% Created for Gamblin, Todd at 2018-12-15 13:53:11 -0800

%% Saved with string encoding Unicode (UTF-8)

@misc{mendoza:jupyterhub-ssl,
	Author = {Thomas Mendoza},
	Date-Added = {2018-12-15 13:31:20 -0800},
	Date-Modified = {2018-12-15 13:32:41 -0800},
	Howpublished = {{Online, GitHub}},
	Month = {July},
	Title = {{Pull Request to JupyterHub: End-to-end SSL (merged)}},
	Url = {https://github.com/jupyterhub/jupyterhub/pull/2055},
	Year = {2018}}

@inproceedings{gamblin+:sc18-spack-bof,
	Address = {Dallas, TX},
	Author = {Todd Gamblin and Adam Stewart and Johannes Albert-von der G\"{o}nna an Marc P\'{e}rache and Matt Belhorn},
	Booktitle = {{Supercomputing 2018}},
	Date-Added = {2018-12-15 13:23:39 -0800},
	Date-Modified = {2018-12-15 13:25:11 -0800},
	Month = {November 13},
	Title = {{Spack Community Birds-of-a-Feather Session}},
	Year = {2018},
	Bdsk-Url-1 = {http://spack.readthedocs.io/en/latest/tutorial_sc16.html}}

@inproceedings{gamblin+:sc18-spack-tutorial,
	Address = {Dallas, TX},
	Author = {Todd Gamblin and Gregory Becker and Massimiliano Culpo and Gregory L. Lee and Matt Legendre and Mario Melara and Adam J. Stewart},
	Booktitle = {{Supercomputing 2018}},
	Date-Added = {2018-12-15 13:23:31 -0800},
	Date-Modified = {2018-12-15 13:23:31 -0800},
	Month = {November 12},
	Note = {Full day},
	Title = {{Tutorial: Managing HPC Software Complexity with Spack}},
	Url = {https://spack.readthedocs.io/en/latest/tutorial.html},
	Year = {2018},
	Bdsk-Url-1 = {http://spack.readthedocs.io/en/latest/tutorial_sc16.html}}

@inproceedings{gamblin+:sc17-spack-tutorial,
	Address = {Salt Lake City, Utah},
	Author = {Todd Gamblin and Gregory Becker and Massimiliano Culpo and Gregory L. Lee and Matt Legendre and Mario Melara and Adam J. Stewart},
	Booktitle = {{Supercomputing 2017}},
	Date-Added = {2018-04-16 07:44:22 +0000},
	Date-Modified = {2018-04-16 07:44:22 +0000},
	Month = {November 13},
	Note = {Full day},
	Title = {{Tutorial: Managing HPC Software Complexity with Spack}},
	Url = {https://spack.readthedocs.io/en/latest/tutorial.html},
	Year = {2017},
	Bdsk-Url-1 = {http://spack.readthedocs.io/en/latest/tutorial_sc16.html}}

@inproceedings{gamblin+:sc16-spack-tutorial,
	Address = {Salt Lake City, Utah},
	Author = {Todd Gamblin and Massimiliano Culpo and Gregory Becker and Matt Legendre and Greg Lee and Elizabeth Fischer and Benedikt Hegner},
	Booktitle = {{Supercomputing 2016}},
	Date-Added = {2018-04-16 07:44:22 +0000},
	Date-Modified = {2018-04-16 07:44:22 +0000},
	Month = {November 13},
	Note = {Half day},
	Title = {{Tutorial: Managing HPC Software Complexity with Spack}},
	Url = {https://spack.readthedocs.io/en/latest/tutorial.html},
	Year = {2016},
	Bdsk-Url-1 = {http://spack.readthedocs.io/en/latest/tutorial_sc16.html}}

@manual{gamblin+:llnl-spack-tutorial-17,
	Address = {Lawrence Livermore National Laboratory, Livermore, CA},
	Author = {Gregory Becker and Matt Legendre and Todd Gamblin},
	Date-Added = {2018-04-16 07:44:22 +0000},
	Date-Modified = {2018-04-16 07:44:22 +0000},
	Institution = {LLNL},
	Month = {April 6},
	Note = {Half day},
	Organization = {Livermore Computing},
	Title = {{Tutorial: Spack for HPC}},
	Year = {2017}}

@inproceedings{gamblin+:ecp18-spack-tutorial,
	Address = {Knoxville, TN},
	Author = {Todd Gamblin and Gregory Becker and Peter Scheibel and Matt Legendre and Mario Melara},
	Booktitle = {{Exascale Computing Project 2nd Annual Meeting}},
	Date-Added = {2018-04-16 07:44:22 +0000},
	Date-Modified = {2018-04-16 07:44:22 +0000},
	Month = {February 6-8},
	Note = {Half day},
	Title = {{Managing HPC Software Complexity with Spack}},
	Year = {2018}}

@inproceedings{gamblin:hpckp17,
	Address = {San Sebasti{\'a}n, Spain},
	Author = {Todd Gamblin},
	Booktitle = {{HPC Knowledge Meeting (HPCKP'17)}},
	Date-Added = {2018-04-16 07:44:22 +0000},
	Date-Modified = {2018-04-16 07:44:22 +0000},
	Month = {June 16},
	Note = {2 hours},
	Title = {{Tutorial: Managing HPC Software Complexity with Spack}},
	Url = {http://www.hpckp.org/index.php/conference/2017/170-managing-hpc-software-complexity-with-spack},
	Year = {2017},
	Bdsk-Url-1 = {http://spack.readthedocs.io/en/latest/tutorial_sc16.html}}

@inproceedings{melara+:cug17,
	Address = {Seattle, WA},
	Author = {Mario Melara and Todd Gamblin and Gregory Becker and Robert French and Matt Belhorn and Kelly Thompson and Peter Scheibel and Rebecca Hartman-Baker},
	Booktitle = {Cray Users Group (CUG 2017)},
	Date-Added = {2018-04-16 07:43:27 +0000},
	Date-Modified = {2018-04-16 07:43:27 +0000},
	Month = {May 7-11},
	Title = {{Using Spack to Manage Software on Cray Supercomputers}},
	Year = {2017}}

@inproceedings{becker+:hust16,
	Address = {Salt Lake City, UT},
	Author = {Gregory Becker and Peter Scheibel and Matthew P. LeGendre and Todd Gamblin},
	Booktitle = {Second International Workshop on HPC User Support Tools (HUST'16)},
	Date-Added = {2018-04-16 07:43:27 +0000},
	Date-Modified = {2018-04-16 07:43:27 +0000},
	Keywords = {LLNL-CONF-701389},
	Month = {November 13},
	Title = {{Managing Combinatorial Software Installations with Spack}},
	Year = {2016}}

@inproceedings{gamblin:eb-user-meeting18,
	Address = {Amsterdam, The Netherlands},
	Author = {Todd Gamblin},
	Booktitle = {Easybuild User Meeting},
	Date-Added = {2018-04-16 07:41:54 +0000},
	Date-Modified = {2018-04-16 07:41:54 +0000},
	Month = {January 30},
	Title = {{Recent developments in Spack}},
	Year = {2018}}

@inproceedings{gamblin:ecp18-spack-sotu,
	Address = {Knoxville, TN},
	Author = {Todd Gamblin},
	Booktitle = {{Exascale Computing Project 2nd Annual Meeting}},
	Date-Added = {2018-04-16 07:41:54 +0000},
	Date-Modified = {2018-04-16 07:41:54 +0000},
	Month = {February 6-8, 2018},
	Note = {LLNL-PRES-746210},
	Title = {{Spack State of the Union}},
	Year = {2018}}

@inproceedings{gamblin:fosdem18-binary,
	Address = {Brussels, Belgium},
	Author = {Todd Gamblin},
	Booktitle = {{Free and Open source Software Developers' European Meeting (FOSDEM'18)}},
	Date-Added = {2018-04-16 07:41:54 +0000},
	Date-Modified = {2018-04-16 07:41:54 +0000},
	Month = {February 4},
	Note = {LLNL-PRES-745747},
	Title = {{Binary packaging for HPC with Spack}},
	Url = {https://fosdem.org/2018/schedule/event/llnl_spack/},
	Year = {2018},
	Bdsk-Url-1 = {https://fosdem.org/2018/schedule/event/llnl_spack/}}

@inproceedings{gamblin:fosdem18-compilers,
	Address = {Brussels, Belgium},
	Author = {Todd Gamblin},
	Booktitle = {{Free and Open source Software Developers' European Meeting (FOSDEM'18)}},
	Date-Added = {2018-04-16 07:41:54 +0000},
	Date-Modified = {2018-04-16 07:41:54 +0000},
	Month = {February 3},
	Note = {LLNL-PRES-745770},
	Title = {{How compilers affect dependency resolution in Spack}},
	Url = {https://fosdem.org/2018/schedule/event/spack/},
	Year = {2018},
	Bdsk-Url-1 = {https://fosdem.org/2018/schedule/event/spack/}}

@inproceedings{gamblin:pp18-spack,
	Address = {Tokyo, Japan},
	Author = {Todd Gamblin},
	Booktitle = {{SIAM Conference on Parallel Processing for Scientific Computing (PP'18)}},
	Date-Added = {2018-04-16 07:41:54 +0000},
	Date-Modified = {2018-04-16 07:41:54 +0000},
	Month = {March 7},
	Series = {Minisymposium on Productive Programming using Parallel Models, Tools and Scientific Workflows},
	Title = {{Decluttering HPC Software Chaos with SPACK}},
	Year = {2018}}

@inproceedings{stewart+:sc19-spack-bof,
	Address = {Denver, CO},
	Author = {Adam J. Stewart and Massimiliano Culpo and Gregory Becker and Peter Scheibel and Todd Gamblin},
	Booktitle = {{Supercomputing 2019}},
	Date-Added = {2019-11-02 14:29:40 -0700},
	Date-Modified = {2019-11-02 14:35:15 -0700},
	Month = {November 21},
	Title = {{Spack Community BoF}},
	Url = {https://sc19.supercomputing.org/session/?sess=sess310},
	Year = {2019}}

@inproceedings{gamblin+:sc19-spack-tutorial,
	Address = {Denver, CO},
	Author = {Todd Gamblin and Gregory Becker and Massimiliano Culpo and Mario Melara and Peter Scheibel and Adam J. Stewart},
	Booktitle = {{Supercomputing 2019}},
	Date-Added = {2019-11-02 14:32:27 -0700},
	Date-Modified = {2019-11-02 14:32:27 -0700},
	Month = {November 18},
	Note = {Full day},
	Title = {{Tutorial: Managing HPC Software Complexity with Spack}},
	Url = {https://spack.readthedocs.io/en/latest/tutorial.html},
	Year = {2019},
	Bdsk-Url-1 = {http://spack.readthedocs.io/en/latest/tutorial_sc16.html}}

@inproceedings{gamblin+:lanl-spack-tutorial-2019,
	Address = {Los Alamos, NM},
	Author = {Todd Gamblin and Gregory Becker},
	Booktitle = {{Los Alamos National Laboratory}},
	Date-Added = {2019-11-02 14:27:58 -0700},
	Date-Modified = {2019-11-02 14:33:16 -0700},
	Month = {November 5},
	Note = {Full day},
	Title = {{Tutorial: Spack for Developers}},
	Url = {https://spack.readthedocs.io/en/latest/tutorial.html},
	Year = {2019},
	Bdsk-Url-1 = {http://spack.readthedocs.io/en/latest/tutorial_sc16.html}}

@inproceedings{gamblin+:doe-nsf-spack-tutorial,
	Address = {Eugene, OR},
	Author = {Todd Gamblin and Gregory Becker},
	Booktitle = {{1st Workshop on NSF and DOE High Performance Computing Tools}},
	Date-Added = {2019-11-02 14:21:21 -0700},
	Date-Modified = {2019-11-02 14:22:17 -0700},
	Month = {July 10-11},
	Organization = {{University of Oregon}},
	Title = {{Spack Tutorial}},
	Year = {2019}}

@inproceedings{baber+:pearc19-spack-tutorial,
	Address = {Chicago, IL},
	Author = {Levi Baber and Adam J. Stewart and Gregory Becker and Todd Gamblin},
	Booktitle = {{Practice and Experience in Advanced Research Computing (PEARC'19)}},
	Date-Added = {2019-11-02 14:23:57 -0700},
	Date-Modified = {2019-11-02 14:34:53 -0700},
	Month = {July 31},
	Note = {Half day},
	Title = {{Tutorial: Managing HPC Software Complexity with Spack}},
	Year = {2019}}

@inproceedings{gamblin+:isc19-spack-tutorial,
	Address = {Houston, TX},
	Author = {Todd Gamblin and Gregory Becker and Massimiliano Culpo and Michael K\"{u}hn},
	Booktitle = {{ISC High Performance}},
	Date-Added = {2019-11-02 14:22:33 -0700},
	Date-Modified = {2019-11-02 14:31:52 -0700},
	Month = {June 16},
	Note = {Half day},
	Title = {{Tutorial: Managing HPC Software Complexity with Spack}},
	Year = {2019}}

repository: curfman/ECP-ST-CAR-PUBLIC

repo_name: curfman/ECP-ST-CAR-PUBLIC


text:
package download

import (
	"errors"
	"net/url"
	"os"
	"sync"
	"time"

	"github.com/muniere/glean/internal/app/server/batch/lumber"
	"github.com/muniere/glean/internal/pkg/images"
	"github.com/muniere/glean/internal/pkg/std"
	"github.com/muniere/glean/internal/pkg/sys"
)

//
// Error
//
var skipDownload = errors.New("skip download")

//
// Struct
//
type Options struct {
	Prefix      string
	Scope       images.Scope
	Interval    time.Duration
	Concurrency int
	Blocking    bool
	Overwrite   bool
	DryRun      bool
}

type command struct {
	uri *url.URL
}

type context struct {
	uri  *url.URL
	temp string
	path string
}

func (c *context) dict() std.Dict {
	dict := std.NewDict()
	if c.uri != nil {
		dict.Put("uri", c.uri.String())
	}
	if len(c.temp) > 0 {
		dict.Put("temp", c.temp)
	}
	if len(c.path) > 0 {
		dict.Put("path", c.path)
	}
	return dict
}

//
// Action
//
func Perform(urls []*url.URL, options Options) error {
	// prepare
	if err := mkdir(options); err != nil {
		return err
	}

	// workers
	wg := &sync.WaitGroup{}
	ch := make(chan command, len(urls))

	for i := 0; i < options.Concurrency; i++ {
		launch(wg, ch, options)
	}

	// enqueue
	for _, u := range urls {
		ch <- command{uri: u}
	}
	close(ch)

	// join
	wg.Wait()

	return nil
}

func mkdir(options Options) error {
	ctx := std.NewDict(
		std.Pair("path", options.Prefix),
	)

	if options.DryRun {
		lumber.Skip(ctx)
		return nil
	}

	if sys.Exists(options.Prefix) {
		lumber.Skip(ctx)
		return nil
	}

	lumber.Start(ctx)

	defer lumber.Finish(ctx)

	return os.MkdirAll(options.Prefix, 0755)
}

repository: muniere/glean

repo_name: muniere/glean


text:
package login_handler

import (
	"fgame/fgame/account/login/login"
	"fgame/fgame/account/login/types"
	uipb "fgame/fgame/common/codec/pb/ui"

	log "github.com/Sirupsen/logrus"
)

func init() {
	login.RegisterLogin(types.SDKTypePC, login.LoginHandlerFunc(handlePCLogin))
}

func handlePCLogin(devicePlatformType types.DevicePlatformType, msg interface{}) (flag bool, returnPlatform int32, userId string, err error) {
	csAccountLogin := msg.(*uipb.CSAccountLogin)
	pcLoginData := csAccountLogin.GetPcLoginData()
	if pcLoginData == nil {
		log.WithFields(
			log.Fields{}).Warn("login:pc登陆,数据是空的")
		return
	}
	userId = pcLoginData.GetName()
	if len(userId) == 0 {
		log.WithFields(
			log.Fields{}).Warn("login:pc登陆,登录名为空")
		return
	}
	returnPlatform = csAccountLogin.GetPlatform()
	flag = true
	return
}

repository: rebider/Fgame

repo_name: rebider/Fgame


text:
@ARTICLE{astroplan2018,
   author = {{Morris}, B.~M. and {Tollerud}, E. and {Sip{\H o}cz}, B. and
    {Deil}, C. and {Douglas}, S.~T. and {Berlanga Medina}, J. and
    {Vyhmeister}, K. and {Smith}, T.~R. and {Littlefair}, S. and
    {Price-Whelan}, A.~M. and {Gee}, W.~T. and {Jeschke}, E.},
    title = "{astroplan: An Open Source Observation Planning Package in Python}",
  journal = {\aj},
archivePrefix = "arXiv",
   eprint = {1712.09631},
 primaryClass = "astro-ph.IM",
 keywords = {methods: numerical, methods: observational },
     year = 2018,
    month = mar,
   volume = 155,
      eid = {128},
    pages = {128},
      doi = {10.3847/1538-3881/aaa47e},
   adsurl = {http://adsabs.harvard.edu/abs/2018AJ....155..128M},
  adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

repository: herpichfr/astroplan

repo_name: herpichfr/astroplan


text:
package cloudingress

import (
	"context"

	"github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	cloudingress "github.com/openshift/cloud-ingress-operator/pkg/apis/cloudingress/v1alpha1"
	"github.com/openshift/osde2e/pkg/common/constants"
	"github.com/openshift/osde2e/pkg/common/helper"
	apierrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/runtime/schema"
)

var _ = ginkgo.Describe(constants.SuiteOperators+TestPrefix, func() {
	h := helper.New()
	testDaCRpublishingstrategies(h)
	testCRpublishingstrategies(h)

})

func createPublishingstrategies() cloudingress.PublishingStrategy {
	publishingstrategy := cloudingress.PublishingStrategy{
		TypeMeta: metav1.TypeMeta{
			Kind:       "PublishingStrategy",
			APIVersion: cloudingress.SchemeGroupVersion.String(),
		},
		ObjectMeta: metav1.ObjectMeta{
			Name: "publshingstrategy-cr-test",
		},
		Spec: cloudingress.PublishingStrategySpec{
			DefaultAPIServerIngress: cloudingress.DefaultAPIServerIngress{},
			ApplicationIngress:      []cloudingress.ApplicationIngress{},
		},
	}
	return publishingstrategy
}

func addPublishingstrategy(h *helper.H, publishingstrategy cloudingress.PublishingStrategy) error {
	obj, err := runtime.DefaultUnstructuredConverter.ToUnstructured(publishingstrategy.DeepCopy())
	if err != nil {
		return err
	}
	unstructuredObj := unstructured.Unstructured{obj}
	_, err = h.Dynamic().Resource(schema.GroupVersionResource{
		Group: "cloudingress.managed.openshift.io", Version: "v1alpha1", Resource: "publishingstrategies",
	}).Namespace(OperatorNamespace).Create(context.TODO(), &unstructuredObj, metav1.CreateOptions{})
	return err
}

func testDaCRpublishingstrategies(h *helper.H) {
	ginkgo.Context("cloud-ingress-operator", func() {
		ginkgo.It("dedicated admin should not be allowed to manage publishingstrategies CR", func() {
			h.SetServiceAccount("system:serviceaccount:%s:dedicated-admin-project")
			ps := createPublishingstrategies()
			err := addPublishingstrategy(h, ps)
			Expect(apierrors.IsForbidden(err)).To(BeTrue())

		})
	})
}

func testCRpublishingstrategies(h *helper.H) {
	ginkgo.Context("cloud-ingress-operator", func() {
		ginkgo.It("admin should be allowed to manage publishingstrategies CR", func() {
			ps := createPublishingstrategies()
			err := addPublishingstrategy(h, ps)
			Expect(err).NotTo(HaveOccurred())

		})
	})
}


text:
require apt-native.inc
PR = "r3"

SRC_URI += "file://nodoc.patch \
            file://noconfigure.patch \
	    file://no-curl.patch"

SRC_URI[md5sum] = "19efa18fb1ef20c58b9b44e94258b814"
SRC_URI[sha256sum] = "8fc06effaf8a4e4333308eedcdc6840f1c8056f2e924210f151dfc076bcd4045"


text:
ISMIR Proceedings
www.ismir.net

Generation de playlist dynamique a partir des programmation de radio
@inproceedings{ref1,
    author = "Bosteels, Klass AND Pampalk, Ellias AND Kerre, Etienne E.",
    title = "Evaluating and analysing dynamic playlist generation heuristics using radio logs and fuzzy set theory",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2009",
}

Recoupements d'information a partirs des metadonnées musicales
Permet de rapprocher les similarités des musiques
@inproceedings{ref2,
    author = "Wang, Fei AND Wang, Xin AND Shao, Bo AND Lee, Tao AND Ogihara, Mitsunori",
    title = "Tag intregrated multilabel music style classification with hypergraph",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2009",
}

Evaluation des emotions de la musique
Trouver des similarités entre le contenu musical et les emotions qu'il provoque
@inproceedings{ref3,
    author = "Song, Yading AND Dison, Simon AND Pearce, Marcus",
    title = "Evaluation of musical features for emotion classification",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2012",
}

basé sur des tags utilisateurs pour trouver des super tags (folklore musical)
gain deb pertinence sur la taxonomie
@inproceedings{ref4,
    author = "Font, Frederic AND Serrà, Joan AND Serra, Xavier",
    title = "Folksonomy-based tag recommendation for online audio clip sharing",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2012",
}

classer des chansons polyphoniques en les ramenant a des chansons monophoniques
utiles si on analyse des morceaux
@inproceedings{ref5,
    author = "Anan, Yoko AND Hatano, Kohei AND Bannai, Hideo AND Takeda, Masayuki AND Satoh, Ken",
    title = "Polyphonic music classification on symbolic data using dissimilarity functions",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2012",
}

comte rendu d'experience, test de playlist générée par des tags utilisateurs
montre la faible corrélation entre les playlist basé tags et basé metadonnées
utilisable pour le mood
@inproceedings{ref6,
    author = "Hu, Xiao AND Kando, Noriko",
    title = "User-centered measures vs. system effectiveness in finding similar songs",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2012",
}

info sur la million song dataset
@inproceedings{ref7,
    author = "Bertin-Mahieux, Thierry AND Ellis, Daniel P. W. AND Whitman, Brian AND Lamere, Paul",
    title = "The million song dataset",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2011",
}

representation visuelle de playlist
@inproceedings{ref8,
    author = "Van Gulik, Rob AND Vignoli, Fabio",
    title = "Visual Playlist generation on the artist map",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2011",
}

generation de playlist basé sur basé sur l'analyse du son
@inproceedings{ref9,
    author = "Logan, Beth",
    title = "Content-based playlist generation: exploratory experiments",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2002",
}

Etat de l'art dans la reconaissance d'emotion d'un contenu musical
@inproceedings{ref10,
    author = "Kim, Youngmoo E. AND Schmidt, Erik M. AND Migneco, Raymond AND Morton, Brandon G. AND Richardson, Patrick AND Scott, Jeffrey AND Speck, Jacquelin A. AND Turnbull, Douglas",
    title = "Music emotion recognition: a state of the art review",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2010",
}

pleins d'information sur la constructions de playlists, tutorial très complet
@inproceedings{ref11,
    author = "Fields, Ben AND Lamere, Paul",
    title = "Finding a path through the Juke Box The Playlist Tutorial",
    booktitle = "ISMIR, International Society for Music Information Retrieval",
    year = "2010",
}

repository: NoZip/soundcity

repo_name: NoZip/soundcity


text:
package jpmcpvpgo

import (
	"encoding/json"
	"net/url"
	"time"
)

type Matches []Match

type Match struct {
	ID              *string           `json:"id,omitempty"`
	Map             *string           `json:"map,omitempty"`
	Server          *string           `json:"server,omitempty"`
	GameMode        *string           `json:"gamemode,omitempty"`
	Ranked          *bool             `json:"ranked,omitempty"`
	Win             *string           `json:"win,omitempty"`
	KillCount       *int              `json:"kill_count,omitempty"`
	DeathCount      *int              `json:"death_count,omitempty"`
	PlayerCount     *int              `json:"player_count,omitempty"`
	Started         *time.Time        `json:"started,omitempty"`
	Finished        *time.Time        `json:"finished,omitempty"`
	MatchTeams      *[]MatchTeam      `json:"teams,omitempty"`
	PermalinkURL    *string           `json:"permalink_url,omitempty"`
	MatchObjectives *[]MatchObjective `json:"objectives,omitempty,omitempty"`
}

type MatchTeam struct {
	Name         *string        `json:"name,omitempty"`
	Score        *int           `json:"score,omitempty"`
	KillCount    *int           `json:"kill_count,omitempty"`
	DeathCount   *int           `json:"death_count,omitempty"`
	MatchPlayers *[]MatchPlayer `json:"players,omitempty"`
}

type MatchPlayer struct {
	UUID       *string `json:"uuid,omitempty"`
	Name       *string `json:"name,omitempty"`
	Score      *int    `json:"score,omitempty"`
	KillCount  *int    `json:"kill_count,omitempty"`
	DeathCount *int    `json:"death_count,omitempty"`
	ShotCount  *int    `json:"shot_count,omitempty"`
	HitCount   *int    `json:"hit_count,omitempty"`
	PaintCount *int    `json:"paint_count,omitempty"`
}

type MatchObjective struct {
	Player *string    `json:"player,omitempty"`
	Name   *string    `json:"name,omitempty"`
	Color  *string    `json:"color,omitempty"`
	Type   *string    `json:"type,omitempty"`
	Team   *string    `json:"team,omitempty"`
	Time   *time.Time `json:"time,omitempty"`
}

type MatchesOptions struct {
	Max_Id *string
	Limit  *string
	Fields *string
}

func (session Session) GetMatches(options MatchesOptions) (*Matches, error) {
	values := url.Values{}
	if options.Max_Id != nil {
		values.Add("max_id", *options.Max_Id)
	}
	if options.Limit != nil {
		values.Add("limit", *options.Limit)
	}
	if options.Fields != nil {
		values.Add("fields", *options.Fields)
	}

	body, err := session.request("matches", values)

	if err != nil {
		return nil, err
	}

	matches := Matches{}

	err = json.Unmarshal(body, &matches)

	return &matches, err
}


text:
# This file was derived from the linux-yocto-custom.bb recipe in
# oe-core.
#
# linux-yocto-custom.bb:
#
#   A yocto-bsp-generated kernel recipe that uses the linux-yocto and
#   oe-core kernel classes to apply a subset of yocto kernel
#   management to git managed kernel repositories.
#
# Warning:
#
#   Building this kernel without providing a defconfig or BSP
#   configuration will result in build or boot errors. This is not a
#   bug.
#
# Notes:
#
#   patches: patches can be merged into to the source git tree itself,
#            added via the SRC_URI, or controlled via a BSP
#            configuration.
#
#   example configuration addition:
#            SRC_URI += "file://smp.cfg"
#   example patch addition:
#            SRC_URI += "file://0001-linux-version-tweak.patch
#   example feature addition:
#            SRC_URI += "file://feature.scc"
#

inherit kernel
require recipes-kernel/linux/linux-yocto.inc

SRC_URI = "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git;protocol=git;bareclone=1"

SRC_URI += "file://defconfig"

SRC_URI += "file://sunxi.scc \
            file://sunxi.cfg \
            file://sunxi-user-config.cfg \
            file://sunxi-user-patches.scc \
           "

LINUX_VERSION ?= "3.19"
LINUX_VERSION_EXTENSION ?= "rc1-fixes"

SRCREV="aa39477b5692611b91ac9455ae588738852b3f60"

PR = "r0"
PV = "${LINUX_VERSION}+git${SRCPV}"

COMPATIBLE_MACHINE_sunxi = "sunxi"


text:
SUMMARY = "TI SCI firmware"

LICENSE = "TI-TFL"
LIC_FILES_CHKSUM = "file://LICENSE.ti;md5=b5aebf0668bdf95621259288c4a46d76"

DEPENDS = "openssl-native u-boot-mkimage-native dtc-native"

CLEANBROKEN = "1"

COMPATIBLE_MACHINE = "k3"

PACKAGE_ARCH = "${MACHINE_ARCH}"

SRCREV = "7a6ce28348a99d2ad08a6cb2b36450d73bfccc80"

BRANCH ?= "ti-linux-firmware-4.1.y"

SRC_URI = " \
	git://git.ti.com/processor-firmware/ti-linux-firmware.git;protocol=git;branch=${BRANCH} \
	git://git.ti.com/processor-firmware/system-firmware-image-gen.git;protocol=git;branch=master;destsuffix=imggen;name=imggen \
"

SRCREV_imggen = "3cbf4003060ead508653e2ec8f25c59bbe813e74"
SRCREV_FORMAT = "imggen"

S = "${WORKDIR}/git"

SYSFW_TISCI_am65xx-evm = "ti-sci-firmware-am65x-gp.bin"
SYSFW_BINARY = "sysfw.itb"
SYSFW_IMAGE = "sysfw-${PV}.itb"

CROSS_COMPILE_V7 = "${ELT_TARGET_SYS_ARMV7}-"
PATH_prepend = "${TOOLCHAIN_PATH_ARMV7}/bin:"

do_compile() {
	cp ${S}/ti-sysfw/${SYSFW_TISCI} ${WORKDIR}/imggen/
	cd ${WORKDIR}/imggen/
	oe_runmake SYSFW_DL_URL=""
}

do_install() {
	install -d ${D}/boot
	install -m 644 ${WORKDIR}/imggen/${SYSFW_BINARY} ${D}/boot/${SYSFW_IMAGE}
	ln -sf ${SYSFW_IMAGE} ${D}/boot/${SYSFW_BINARY}
}

FILES_${PN} = "/boot"

inherit deploy

do_deploy () {
	install -d ${DEPLOYDIR}
	install -m 644 ${WORKDIR}/imggen/${SYSFW_BINARY} ${DEPLOYDIR}/${SYSFW_IMAGE}
	rm -f ${DEPLOYDIR}/${SYSFW_BINARY}
	ln -sf ${SYSFW_IMAGE} ${DEPLOYDIR}/${SYSFW_BINARY}

        install -m 644 ${S}/ti-sysfw/${SYSFW_TISCI} ${DEPLOYDIR}/${SYSFW_TISCI}
}

addtask deploy before do_build after do_compile


text:
SUMMARY = "a little task queue for python"
SECTION = "devel/python"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=5cac039fcc82f01141cc170b48f315d4"

PYPI_PACKAGE = "huey"

SRC_URI[sha256sum] = "de9b6d0fd59794378fe05813d302be68038044ef3b68274b84ca8d285e20f803"

inherit pypi setuptools3

repository: ni/meta-openembedded

repo_name: ni/meta-openembedded

branch_name: refs/heads/nilrt/master/hardknott


text:
// run

package main

import "fmt"

func main() {
	var x int = 1
	{
		var x int = x + 1
		fmt.Print(x)
	}
}


text:
SUMMARY = "Library to control webOS based LG Tv devices"
HOMEPAGE = "https://github.com/TheRealLink/pylgtv"
SECTION = "devel/python"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=d4ae7def6b740abc020a2700493fef4e"

inherit setuptools3

SRCREV = "babf7b65c419ce4533b33d7e2aced7bc1abe7458"
SRC_URI = "git://github.com/TheRealLink/pylgtv.git;protocol=https"
S = "${WORKDIR}/git"

RDEPENDS_${PN} = "${PYTHON_PN}-websockets"

repository: bluelightning/meta-homeassistant

repo_name: bluelightning/meta-homeassistant


text:
SUMMARY = "OPTEE Ledge application"
DESCRIPTION = "OPTEE Ledge (Client and Trusted Applications)"
HOMEPAGE = ""

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=cd95ab417e23b94f381dafc453d70c30"

DEPENDS = "optee-client python3-pycrypto-native"
DEPENDS += "python3-pycryptodomex-native python3-pycrypto-native"

inherit python3native

SRC_URI = "git://git.linaro.org/people/christophe.priouzeau/optee-ledge.git;protocol=https"
SRCREV = "43da370ccbb0de1f957271c907940ae985b2a652"

S = "${WORKDIR}/git"

OPTEE_CLIENT_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TEEC_EXPORT = "${STAGING_DIR_HOST}${prefix}"
TA_DEV_KIT_DIR = "${STAGING_INCDIR}/optee/export-user_ta"

EXTRA_OEMAKE = " TA_DEV_KIT_DIR=${TA_DEV_KIT_DIR} \
                 OPTEE_CLIENT_EXPORT=${OPTEE_CLIENT_EXPORT} \
                 TEEC_EXPORT=${TEEC_EXPORT} \
                 HOST_CROSS_COMPILE=${TARGET_PREFIX} \
                 TA_CROSS_COMPILE=${TARGET_PREFIX} \
                 V=1 \
               "

B = "${S}"
do_compile() {
    export CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_HOST}"
    oe_runmake
}

do_install () {
    mkdir -p ${D}${libdir}/optee_armtz
    mkdir -p ${D}${bindir}
    install -D -p -m0755 ${S}/out/ca/* ${D}${bindir}
    install -D -p -m0444 ${S}/out/ta/* ${D}${libdir}/optee_armtz
}

FILES_${PN} += "${libdir}/optee_armtz/"

# Imports machine specific configs from staging to build
PACKAGE_ARCH = "${MACHINE_ARCH}"
INSANE_SKIP_${PN} += "ldflags"

repository: Linaro/meta-ledge

repo_name: Linaro/meta-ledge

branch_name: refs/heads/hardknott

gha_language: Shell


text:
@article {Zaslavsky2018a,
   author = {Zaslavsky, Noga and Kemp, Charles and Regier, Terry and Tishby, Naftali},
   title = {Efficient compression in color naming and its evolution},
   journal = {Proceedings of the National Academy of Sciences}
   volume = {115},
   number = {31},
   pages = {7937--7942},
   year = {2018},
   doi = {10.1073/pnas.1800521115},
   publisher = {National Academy of Sciences},
   issn = {0027-8424},
   URL = {http://www.pnas.org/content/115/31/7937}
}

repository: rycolab/website

repo_name: rycolab/website