text:
package compiler

import (
	"github.com/elliotchance/ok/ast"
	"github.com/elliotchance/ok/types"
	"github.com/elliotchance/ok/vm"
)

// CompileFunc translates a single function into a set of instructions. The
// number of instructions returned may be zero.
func CompileFunc(
	fn *ast.Func,
	file *vm.File,
	parentFunc *vm.CompiledFunc,
	constants map[string]*ast.Literal,
	imports map[string]*types.Type,
	scopeOverrides map[string]*types.Type,
) (*vm.CompiledFunc, error) {
	compiled := vm.NewCompiledFunc(fn, parentFunc, constants, file)

	// All variables in a function are stored internally as a map right now. So
	// the first thing we need to do is initialise the map. Whether we return it
	// at the end will depend on the return type.
	//
	// It is important that we always use a map (even if it's not returned)
	// because we may need it for a subscope (closure).
	isObject := len(fn.Returns) == 1 && fn.Returns[0].Name == fn.Name

	// Load the arguments from the registers.
	for _, arg := range fn.Arguments {
		compiled.NextRegister()
		resolvedTypeRegister, err := file.Types.Add(arg.Type)
		if err != nil {
			return nil, err
		}

		compiled.NewVariable(arg.Name, file.Types.Get(resolvedTypeRegister))

		compiled.Arguments = append(compiled.Arguments, arg.Name)
	}

	err := compileBlock(compiled, fn.Statements, nil, nil,
		file, scopeOverrides)
	if err != nil {
		return nil, err
	}

	// If this is an object, always returns its state.
	if isObject {
		compiled.Append(&vm.Return{
			Results: []vm.Register{vm.StateRegister},
		})
	}

	// Now we have finished compiling this scope (and so have discovered and
	// resolved the type of all variables) we can now compile all the deferred
	// function literals that might reference variables in this scope.
	instructions := len(compiled.Instructions.Instructions)
	for _, fn := range compiled.DeferredFuncsToCompile {
		cf, err := CompileFunc(fn.Func, file, compiled, constants, imports, scopeOverrides)
		if err != nil {
			return nil, err
		}

		file.AddSymbolFunc(cf)

		compiled.Append(&vm.AssignFunc{
			Result:     fn.Register,
			Type:       file.AddType(fn.Func.Type()),
			UniqueName: fn.Func.UniqueName,
		})

		compiled.Append(&vm.ParentScope{
			X: fn.Register,
		})
	}

	// However... the instructions that were just appended to this scope need to
	// be hoisted to the top otherwise the variables containing the function
	// literals will be missing until the end.
	compiled.Instructions.Instructions = append(
		compiled.Instructions.Instructions[instructions:],
		compiled.Instructions.Instructions[:instructions]...)

	// Since we moved instructions to the top we also need to adjust the jump
	// positions down accordingly.
	if instructions > 0 {
		count := len(compiled.Instructions.Instructions) - instructions

		for index, ins := range compiled.Instructions.Instructions {
			switch actual := ins.(type) {
			case *vm.Jump:
				actual.To += count

			case *vm.JumpUnless:
				actual.To += count
			}

			compiled.Instructions.Instructions[index] = ins
		}
	}

	return compiled, nil
}

func compileFunc(
	compiledFunc *vm.CompiledFunc,
	fn *ast.Func,
) ([]vm.Register, []*types.Type, error) {
	// We cannot compile a function literal at this point because we
	// probably haven't finished compiling the current scope. This is
	// important because the function literal may reference variables in
	// this scope that haven't been discovered (or type resolved) yet.
	//
	// Instead we will defer the compilation of this literal to after we're
	// finished. We can reserve the register that will hold the compiled
	// function later so everything lines up without any post correction.
	funcLitRegister := compiledFunc.NextRegister()
	compiledFunc.DeferredFuncsToCompile = append(
		compiledFunc.DeferredFuncsToCompile, vm.DeferredFunc{
			Register: funcLitRegister,
			Func:     fn,
		})

	return []vm.Register{funcLitRegister}, []*types.Type{fn.Type()}, nil
}

repository: elliotchance/ok

repo_name: elliotchance/ok


text:
/*
Copyright 2020 The Crossplane Authors.

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

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

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

package v1alpha1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

	xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1"
)

// ResourceConditionAfter is a configurable field of NopResource.
type ResourceConditionAfter struct {
	Time            string `json:"time"`
	ConditionType   string `json:"conditionType"`
	ConditionStatus string `json:"conditionStatus"`
}

// NopResourceParameters are the configurable fields of a NopResource.
type NopResourceParameters struct {
	ConditionAfter []ResourceConditionAfter `json:"conditionAfter"`
}

// NopResourceObservation are the observable fields of a NopResource.
type NopResourceObservation struct {
	ObservableField string `json:"observableField,omitempty"`
}

// A NopResourceSpec defines the desired state of a NopResource.
type NopResourceSpec struct {
	xpv1.ResourceSpec `json:",inline"`
	ForProvider       NopResourceParameters `json:"forProvider"`
}

// A NopResourceStatus represents the observed state of a NopResource.
type NopResourceStatus struct {
	xpv1.ResourceStatus `json:",inline"`
	AtProvider          NopResourceObservation `json:"atProvider,omitempty"`
}

// +kubebuilder:object:root=true

// A NopResource is an example API type.
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status"
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
// +kubebuilder:resource:scope=Cluster,categories={crossplane,managed,nop}
type NopResource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   NopResourceSpec   `json:"spec"`
	Status NopResourceStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// NopResourceList contains a list of NopResource
type NopResourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []NopResource `json:"items"`
}

repository: hasheddan/provider-nop

license_type: permissive

repo_name: hasheddan/provider-nop

branch_name: refs/heads/main

extension: go


text:
@article{feigenbaum_universal_1983,
	title = {Universal {Behavior} in {Nonlinear} {Systems}},
	volume = {7},
	issn = {0167-2789},
	doi = {10.1016/0167-2789(83)90112-4},
	number = {1-3},
	journal = {Physica D: Nonlinear Phenomena},
	author = {Feigenbaum, Mitchell J.},
	year = {1983},
	pages = {16--39}
}

@article{may_simple_1976,
	title = {Simple {Mathematical} {Models} with {Very} {Complicated} {Dynamics}},
	volume = {261},
	issn = {0028-0836},
	doi = {10.1038/261459a0},
	number = {5560},
	journal = {Nature},
	author = {May, Robert M.},
	year = {1976},
	pages = {459--467}
}

@book{mandelbrot_fractal_1983,
	address = {New York, NY},
	title = {The {Fractal} {Geometry} of {Nature}},
	isbn = {978-0-7167-1186-5},
	publisher = {Macmillan},
	author = {Mandelbrot, Benoit B.},
	year = {1983}
}

@article{mandelbrot_how_1967,
	title = {How {Long} {Is} the {Coast} of {Britain}? {Statistical} {Self}-{Similarity} and {Fractional} {Dimension}},
	volume = {156},
	issn = {0036-8075},
	doi = {10.1126/science.156.3775.636},
	number = {3775},
	journal = {Science},
	author = {Mandelbrot, Benoit B.},
	year = {1967},
	pages = {636--638}
}

@article{packard_geometry_1980,
	title = {Geometry from a {Time} {Series}},
	volume = {45},
	issn = {0031-9007},
	doi = {10.1103/PhysRevLett.45.712},
	number = {9},
	journal = {Physical Review Letters},
	author = {Packard, N. H. and Crutchfield, J. P. and Farmer, J. D. and Shaw, R. S.},
	month = sep,
	year = {1980},
	pages = {712--716}
}

@book{strogatz_nonlinear_2014,
	address = {Boulder, CO},
	edition = {2nd},
	title = {Nonlinear {Dynamics} and {Chaos}},
	isbn = {978-0-8133-4910-7},
	shorttitle = {Nonlinear {Dynamics} and {Chaos}},
	language = {English},
	publisher = {Westview Press},
	author = {Strogatz, Steven H.},
	month = jul,
	year = {2014}
}

@article{alpigini_dynamical_2004,
	title = {Dynamical {System} {Visualization} and {Analysis} via {Performance} {Maps}},
	volume = {3},
	issn = {1473-8716},
	doi = {10.1057/palgrave.ivs.9500082},
	number = {4},
	journal = {Information Visualization},
	author = {Alpigini, James J},
	year = {2004},
	pages = {271--287}
}

@book{layek_introduction_2015,
	address = {New Delhi, India},
	title = {An {Introduction} to {Dynamical} {Systems} and {Chaos}},
	isbn = {978-81-322-2556-0},
	publisher = {Springer India},
	author = {Layek, G. C.},
	year = {2015}
}

@article{sander_many_2015,
	title = {The {Many} {Facets} of {Chaos}},
	volume = {25},
	issn = {0218-1274},
	doi = {10.1142/S0218127415300116},
	language = {en},
	number = {4},
	journal = {International Journal of Bifurcation and Chaos},
	author = {Sander, Evelyn and Yorke, James A.},
	year = {2015},
	pages = {1530011}
}

@article{sprott_classifying_2015,
	title = {Classifying and {Quantifying} {Basins} of {Attraction}},
	volume = {25},
	issn = {10541500},
	doi = {10.1063/1.4927643},
	number = {8},
	journal = {Chaos: An Interdisciplinary Journal of Nonlinear Science},
	author = {Sprott, J. C. and Xiong, Anda},
	year = {2015},
	pages = {083101}
}

@article{grebogi_chaos_1987,
	title = {Chaos, {Strange} {Attractors}, and {Fractal} {Basin} {Boundaries} in {Nonlinear} {Dynamics}},
	volume = {238},
	issn = {0036-8075},
	doi = {10.1126/science.238.4827.632},
	number = {4827},
	journal = {Science},
	author = {Grebogi, Celso and Ott, Edward and Yorke, James A.},
	year = {1987},
	pages = {632--638}
}

@article{bradley_nonlinear_2015,
	title = {Nonlinear {Time}-{Series} {Analysis} {Revisited}},
	volume = {25},
	issn = {10541500},
	doi = {10.1063/1.4917289},
	language = {en},
	number = {9},
	journal = {Chaos: An Interdisciplinary Journal of Nonlinear Science},
	author = {Bradley, Elizabeth and Kantz, Holger},
	year = {2015},
	pages = {097610}
}

@article{boeing_visual_2016,
	title = {Visual {Analysis} of {Nonlinear} {Dynamical} {Systems}: {Chaos}, {Fractals}, {Self}-{Similarity} and the {Limits} of {Prediction}},
	volume = {4},
	issn = {2079-8954},
	shorttitle = {Visual {Analysis} of {Nonlinear} {Dynamical} {Systems}},
	doi = {10.3390/systems4040037},
	language = {en},
	number = {4},
	journal = {Systems},
	author = {Boeing, Geoff},
	month = nov,
	year = {2016},
	pages = {37}
}

@incollection{hofstadter_mathematical_1985,
	address = {New York, NY},
	title = {Mathematical {Chaos} and {Strange} {Attractors}},
	booktitle = {Metamagical {Themas}: {Questing} for the {Essence} of {Mind} and {Pattern}},
	publisher = {Basic Books},
	author = {Hofstadter, Douglas R.},
	year = {1985},
	pages = {364--395}
}

license: MIT

repository: liulinhui/pynamical

repo_name: liulinhui/pynamical

branch_name: refs/heads/master

extension: bib


text:
package score

import (
	"log"
	"testing"
	"time"

	"github.com/33cn/chain33/common"
	"github.com/33cn/chain33/common/address"
	"github.com/33cn/chain33/common/crypto"
	cty "github.com/33cn/chain33/system/dapp/coins/types"
	drivers "github.com/33cn/chain33/system/mempool"
	"github.com/33cn/chain33/types"
	"github.com/33cn/chain33/util"
	"github.com/33cn/chain33/util/testnode"
	"github.com/golang/protobuf/proto"
	"github.com/stretchr/testify/assert"

	_ "github.com/33cn/chain33/system"
)

var (
	c, _       = crypto.Load(types.GetSignName("", types.SECP256K1), -1)
	hex        = "CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"
	a, _       = common.FromHex(hex)
	privKey, _ = c.PrivKeyFromBytes(a)
	toAddr     = address.PubKeyToAddr(address.DefaultID, privKey.PubKey().Bytes())
	amount     = int64(1e8)
	v          = &cty.CoinsAction_Transfer{Transfer: &types.AssetsTransfer{Amount: amount}}
	transfer   = &cty.CoinsAction{Value: v, Ty: cty.CoinsActionTransfer}
	tx1        = &types.Transaction{Execer: []byte("coins"), Payload: types.Encode(transfer), Fee: 1000000, Expire: 1, To: toAddr}
	tx2        = &types.Transaction{Execer: []byte("coins"), Payload: types.Encode(transfer), Fee: 1000000, Expire: 2, To: toAddr}
	tx3        = &types.Transaction{Execer: []byte("coins"), Payload: types.Encode(transfer), Fee: 1000000, Expire: 3, To: toAddr}
	tx4        = &types.Transaction{Execer: []byte("coins"), Payload: types.Encode(transfer), Fee: 2000000, Expire: 4, To: toAddr}
	tx5        = &types.Transaction{Execer: []byte("coins"), Payload: types.Encode(transfer), Fee: 1000000, Expire: 5, To: toAddr}
	item1      = &drivers.Item{Value: tx1, Priority: tx1.Fee, EnterTime: types.Now().Unix()}
	item2      = &drivers.Item{Value: tx2, Priority: tx2.Fee, EnterTime: types.Now().Unix()}
	item3      = &drivers.Item{Value: tx3, Priority: tx3.Fee, EnterTime: types.Now().Unix() - 1000}
	item4      = &drivers.Item{Value: tx4, Priority: tx4.Fee, EnterTime: types.Now().Unix() - 1000}
	item5      = &drivers.Item{Value: tx5, Priority: tx5.Fee, EnterTime: types.Now().Unix() - 1000}
)

func initEnv(size int64) *Queue {
	if size == 0 {
		size = 100
	}
	_, sub := types.InitCfg("chain33.test.toml")
	var subcfg subConfig
	types.MustDecode(sub.Mempool["score"], &subcfg)
	subcfg.PoolCacheSize = size
	cache := NewQueue(subcfg)
	return cache
}

func TestMemFull(t *testing.T) {
	cache := initEnv(1)
	hash := string(tx1.Hash())
	err := cache.Push(item1)
	assert.Nil(t, err)
	assert.Equal(t, true, cache.Exist(hash))
	it, err := cache.GetItem(hash)
	assert.Nil(t, err)
	assert.Equal(t, item1, it)

	_, err = cache.GetItem(hash + ":")
	assert.Equal(t, types.ErrNotFound, err)

	err = cache.Push(item1)
	assert.Equal(t, types.ErrTxExist, err)

	err = cache.Push(item2)
	assert.Equal(t, types.ErrMemFull, err)

	cache.Remove(hash)
	assert.Equal(t, 0, cache.Size())
}

func TestWalk(t *testing.T) {
	//push to item
	cache := initEnv(2)
	cache.Push(item1)
	cache.Push(item2)
	assert.Equal(t, 2, cache.Size())
	var data [2]*drivers.Item
	i := 0
	cache.Walk(1, func(value *drivers.Item) bool {
		data[i] = value
		i++
		return true
	})
	assert.Equal(t, 1, i)
	assert.Equal(t, data[0], item1)

	i = 0
	cache.Walk(2, func(value *drivers.Item) bool {
		data[i] = value
		i++
		return true
	})
	assert.Equal(t, 2, i)
	assert.Equal(t, data[0], item1)
	assert.Equal(t, data[1], item2)

	i = 0
	cache.Walk(2, func(value *drivers.Item) bool {
		data[i] = value
		i++
		return false
	})
	assert.Equal(t, 1, i)
}

func TestTimeCompetition(t *testing.T) {
	cache := initEnv(1)
	cache.Push(item1)
	cache.Push(item3)
	assert.Equal(t, false, cache.Exist(string(item1.Value.Hash())))
	assert.Equal(t, true, cache.Exist(string(item3.Value.Hash())))
	assert.Equal(t, int64(item3.Value.Size()), cache.GetCacheBytes())
}

func TestPriceCompetition(t *testing.T) {
	cache := initEnv(1)
	cache.Push(item3)
	cache.Push(item4)
	assert.Equal(t, false, cache.Exist(string(item3.Value.Hash())))
	assert.Equal(t, true, cache.Exist(string(item4.Value.Hash())))
	assert.Equal(t, int64(item4.Value.Size()), cache.GetCacheBytes())
}

func TestAddDuplicateItem(t *testing.T) {
	cache := initEnv(1)
	cache.Push(item1)
	err := cache.Push(item1)
	assert.Equal(t, types.ErrTxExist, err)
}

func TestQueueDirection(t *testing.T) {
	cache := initEnv(0)
	cache.Push(item1)
	cache.Push(item2)
	cache.Push(item3)
	cache.Push(item4)
	cache.Push(item5)
	i := 0
	lastScore := cache.First().GetScore()
	var tmpScore int64
	cache.Walk(5, func(value *drivers.Item) bool {
		tmpScore = cache.CreateSkipValue(&scoreScore{Item: value, subConfig: cache.subConfig}).Score
		if lastScore < tmpScore {
			return false
		}
		lastScore = tmpScore
		i++
		return true
	})
	assert.Equal(t, 5, i)
	assert.Equal(t, true, lastScore == cache.Last().GetScore())
}

func TestRealNodeMempool(t *testing.T) {
	mock33 := testnode.New("chain33.test.toml", nil)
	cfg := mock33.GetClient().GetConfig()
	defer mock33.Close()
	mock33.Listen()
	mock33.WaitHeight(0)
	mock33.SendHot()
	mock33.WaitHeight(1)
	n := 10
	done := make(chan struct{}, n)
	keys := make([]crypto.PrivKey, n)
	for i := 0; i < n; i++ {
		addr, priv := util.Genaddress()
		tx := util.CreateCoinsTx(cfg, mock33.GetHotKey(), addr, 10*types.DefaultCoinPrecision)
		mock33.SendTx(tx)
		keys[i] = priv
	}
	mock33.Wait()
	for i := 0; i < n; i++ {
		go func(priv crypto.PrivKey) {
			for i := 0; i < 30; i++ {
				tx := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.DefaultCoinPrecision/1000)
				reply, err := mock33.GetAPI().SendTx(tx)
				if err != nil {
					log.Println(err)
					continue
				}
				//发送交易组
				tx1 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.DefaultCoinPrecision/1000)
				tx2 := util.CreateCoinsTx(cfg, priv, mock33.GetGenesisAddress(), types.DefaultCoinPrecision/1000)
				txgroup, err := types.CreateTxGroup([]*types.Transaction{tx1, tx2}, cfg.GetMinTxFeeRate())
				if err != nil {
					log.Println(err)
					continue
				}
				for i := 0; i < len(txgroup.GetTxs()); i++ {
					err = txgroup.SignN(i, types.SECP256K1, priv)
					if err != nil {
						t.Error(err)
						return
					}
				}
				reply, err = mock33.GetAPI().SendTx(txgroup.Tx())
				if err != nil {
					log.Println(err)
					continue
				}
				mock33.SetLastSend(reply.GetMsg())
			}
			done <- struct{}{}
		}(keys[i])
	}
	for i := 0; i < n; i++ {
		<-done
	}
	for {
		txs, err := mock33.GetAPI().GetMempool(&types.ReqGetMempool{})
		assert.Nil(t, err)
		println("len", len(txs.GetTxs()))
		if len(txs.GetTxs()) > 0 {
			mock33.Wait()
			continue
		}
		break
	}
	peer, err := mock33.GetAPI().PeerInfo(nil)
	assert.Nil(t, err)
	assert.Equal(t, len(peer.Peers), 0)
	//assert.Equal(t, peer.Peers[0].MempoolSize, int32(0))
}

func TestGetProperFee(t *testing.T) {
	cache := initEnv(0)
	assert.Equal(t, cache.subConfig.ProperFee, cache.GetProperFee())
	cache.Push(item3)
	cache.Push(item4)
	size3 := proto.Size(item3.Value)
	size4 := proto.Size(item3.Value)
	score3 := cache.subConfig.PriceConstant*cache.subConfig.PricePower*(item3.Value.Fee/int64(size3)) -
		item3.EnterTime*cache.subConfig.TimeParam
	score4 := cache.subConfig.PriceConstant*cache.subConfig.PricePower*(item4.Value.Fee/int64(size4)) -
		item4.EnterTime*cache.subConfig.TimeParam
	properFee := ((score3+score4)/2 + time.Now().Unix()*cache.subConfig.TimeParam) * int64(100) /
		(cache.subConfig.PriceConstant * cache.subConfig.PricePower)
	assert.Equal(t, int64(1), properFee/cache.GetProperFee())
}

gha_language: Go


text:
package cmd

import (
	"fmt"
	"os"
	"log"
	"bufio"
	"time"
	"net/http"

	"github.com/spf13/cobra"
	fastly "github.com/sethvargo/go-fastly"
)

// purgeallCmd represents the purgeall command
var purgeallCmd = &cobra.Command{
	Use:   "purgeall",
	Short: "Purges everything from a service",
	Run: func(cmd *cobra.Command, args []string) {
		client, err := fastly.NewClient(cfgAPIKey)
		if err != nil {
			log.Fatal(err)
		}

		purge, err := client.PurgeAll( &fastly.PurgeAllInput{
			Service: PurgeService,
			Soft: PurgeSoft,
		} )

		fmt.Printf("Purge All with Service ID: (%s)", PurgeService)
		if err != nil {
			log.Fatal(err)
			fmt.Printf("Purge-Error (%s)\n", err)
		} else {
			fmt.Printf("Purge-Response (%s)\n", purge)
		}

		time.Sleep(time.Duration(PurgeSleep)*time.Millisecond)

		_, err = os.Stat(PurgeFile)
		if os.IsNotExist(err) {
			fmt.Printf("+ file not found, skipping freshness check (%s)\n", PurgeFile)
	  } else {
				file, err := os.Open(PurgeFile)
				fmt.Printf("+ reading file (%s)\n", PurgeFile)
				if err != nil {
						log.Fatal(err)
				}
				defer file.Close()
				scanner := bufio.NewScanner(file)

				for scanner.Scan() {
						PurgeURL = scanner.Text()

						RequestURL, err := http.Get(PurgeURL)
						if err != nil {
							log.Fatal(err)
						}
						fmt.Printf("%s\tAge: (%s) X-Cache: (%s)\tLast-Modified (%s)\tURL (%s)\n", time.Now(), RequestURL.Header["Age"], RequestURL.Header["X-Cache"], RequestURL.Header["Last-Modified"], PurgeURL)
				}
		}

	},
}

func init() {
	RootCmd.AddCommand(purgeallCmd)

	purgeallCmd.Flags().StringVar(&PurgeService, "service", "", "Service ID to purge")
}

repository: edenecke/go-purge-fastly

repo_name: edenecke/go-purge-fastly


text:
package fides

import (
	"log"
	"math"
)

func SemiconductorFIT(comp *Component, mission *Mission) float64 {

	// Type: D / Q
	// Subtype: TVS, ZENER, MOS, JFET, IGBT, TRIAC, THYRISTOR
	//
	// Imax (D)
	// Pmax (ZENER, TVS)
	// Vmax (D)

	var fit, nfit float64

	/*
		if comp.Vmax == 0 || math.IsNaN(comp.Vmax) {
			log.Println("Vmax not set in semiconductor", comp.Name)
			return math.NaN()
		}
	*/
	ratio := comp.V / comp.Vmax
	if comp.Class == "D" && (comp.Type == "tvs" || comp.Type == "zener") {
		ratio = 1
	}

	lrh, lcase, lsolder, lmech := Lcase_semi(comp.Package)

	log.Println("SemiFIT", comp.Name, ratio, comp.Class, comp.Type, comp.V, comp.Vmax)

	for _, ph := range mission.Phases {

		if ph.On {
			nfit = ph.Time / 8760.0 *
				(Lchip(comp)*PiThermal_semiconductor(ratio, ph.Tmax /* *comp.Rth*comp.P */) +
					lcase*PiTCCase(ph.NCycles, ph.Time, ph.Tdelta, ph.Tmax) +
					lsolder*PiTCSolder(ph.NCycles, ph.Time, ph.CycleDuration, ph.Tdelta, ph.Tmax) +
					lrh*PiRH(ph.RH, ph.Tamb) +
					lmech*PiMech(ph.Grms))
		} else {
			nfit = ph.Time / 8760.0 *
				(lcase*PiTCCase(ph.NCycles, ph.Time, ph.Tdelta, ph.Tmax) +
					lsolder*PiTCSolder(ph.NCycles, ph.Time, ph.CycleDuration, ph.Tdelta, ph.Tmax) +
					lmech*PiMech(ph.Grms))
		}

		nfit *= PiInduced(ph.On, comp.IsAnalog, comp.IsInterface, comp.IsPower, 5.2)

		fit += nfit
	}

	return fit * PiPM() * PiProcess()
}

func Lchip(c *Component) float64 {

	var base float64

	// Transistors

	if c.Class == "Q" {

		switch c.Type {

		case "IGBT":
			base = 0.3021
		case "TRIAC":
			base = 0.1976
		case "JFET":
			base = 0.0143

		case "MOS":

			if c.Pmax > 5 {
				base = 0.0202
			} else {
				base = 0.0145
			}

		default:

			// bipolar silicon transistor
			if c.Pmax > 5 {
				base = 0.0478
			} else {
				base = 0.0138
			}
		}

		if c.N == 1 {
			return base
		}

		return base * math.Sqrt(float64(c.N))
	}

	// Diodes

	switch c.Type {

	case "zener":
		if c.Pmax < 1.5 {
			base = 0.08
		} else {
			base = 0.0954
		}

	case "tvs":
		if c.Pmax < 3000 {
			base = 0.021
		} else {
			base = 1.498
		}

	default:

		// diode, signal or rectifier
		if c.Imax < 1 {
			base = 0.01
		} else if c.Imax < 3 {
			base = 0.0044
		} else {
			base = 0.1574
		}

	}

	if c.N == 1 {
		return base
	}

	return base * math.Sqrt(float64(c.N))
}

repository: rveen/fides

repo_name: rveen/fides


text:
package proxy

// http://www.mayidaili.com/free/2
import (
	"errors"
	"fmt"
	"io/ioutil"
	"math"
	"net/http"
	"regexp"
	"strings"
	"time"
)

var u5re *regexp.Regexp

func init() {
	u5re = regexp.MustCompile(`<li>(\d+\.\d+\.\d+\.\d+)</li>(?s:.*?)<li\sclass="port.*?">(\d+)</li>(?s:.*?)>(https?)</a>`)
}

type u5 struct{}

func (s *u5) Wait() {
	time.Sleep(60 * time.Second)
}

func (s *u5) Fetch(page int) ([]string, int, error) {
	req, err := http.NewRequest(http.MethodGet, "http://www.data5u.com/free/index.shtml", nil)
	if err != nil {
		return nil, 0, err
	}

	req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		return nil, 0, err
	}
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		return nil, 0, errors.New(resp.Status)
	}

	data, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return nil, 0, err
	}

	proxies := u5re.FindAllSubmatch(data, -1)
	if len(proxies) < 1 {
		return nil, 0, errors.New("match proxy list: noting found")
	}

	var result []string
	for _, m := range proxies {
		result = append(result, fmt.Sprintf("%s://%s:%s", strings.ToLower(string(m[3])), string(m[1]), string(m[2])))
	}
	return result, math.MaxInt64, nil
}

repository: kosmgco/etym

repo_name: kosmgco/etym


text:
@inproceedings{8816100,
 author = {Y. Ujitoko and Y. Ban and K. Hirota},
 booktitle = {2019 IEEE World Haptics Conference (WHC)},
 doi = {10.1109/WHC.2019.8816100},
 issn = {null},
 month = {July},
 number = {},
 pages = {181-186},
 title = {Presenting Static Friction Sensation at Stick-slip Transition using Pseudo-haptic Effect},
 volume = {},
 year = {2019}
}


text:
@techreport{Hjalmarsson:92c,
 address = {Linköping University, Sweden},
 author = {H. Hjalmarsson},
 institution = {Report LiTH-ISY-1411, Department of
Electrical Engineering},
 title = {Asymptotic Relations Between Non-Weighted
and Exponentially Weighted Series: A Functional
Limit Approach},
 year = {1992}
}

repository: hhjalmars/academic-kickstart

repo_name: hhjalmars/academic-kickstart


text:
package migrator

import (
	"fmt"
	"strings"
)

type command interface {
	toSQL() string
}

type createTableCommand struct {
	t Table
}

func (c createTableCommand) toSQL() string {
	if c.t.Name == "" {
		return ""
	}

	context := c.t.columns.render()
	if context == "" {
		context = "`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT"
	}

	if res := c.t.indexes.render(); res != "" {
		context += ", " + res
	}

	if res := c.t.foreigns.render(); res != "" {
		context += ", " + res
	}

	engine := c.t.Engine
	if engine == "" {
		engine = "InnoDB"
	}

	charset := c.t.Charset
	collation := c.t.Collation
	if charset == "" && collation == "" {
		charset = "utf8mb4"
		collation = "utf8mb4_unicode_ci"
	}
	if charset == "" && collation != "" {
		parts := strings.Split(collation, "_")
		charset = parts[0]
	}
	if charset != "" && collation == "" {
		collation = charset + "_unicode_ci"
	}

	return fmt.Sprintf(
		"CREATE TABLE `%s` (%s) ENGINE=%s DEFAULT CHARSET=%s COLLATE=%s",
		c.t.Name,
		context,
		engine,
		charset,
		collation,
	)
}

type dropTableCommand struct {
	table  string
	soft   bool
	option string
}

func (c dropTableCommand) toSQL() string {
	sql := "DROP TABLE"

	if c.soft {
		sql += " IF EXISTS"
	}

	sql += fmt.Sprintf(" `%s`", c.table)

	var validOptions = list{"RESTRICT", "CASCADE"}
	if validOptions.has(strings.ToUpper(c.option)) {
		sql += " " + strings.ToUpper(c.option)
	}

	return sql
}

type renameTableCommand struct {
	old string
	new string
}

func (c renameTableCommand) toSQL() string {
	return fmt.Sprintf("RENAME TABLE `%s` TO `%s`", c.old, c.new)
}

type alterTableCommand struct {
	name string
	pool TableCommands
}

func (c alterTableCommand) toSQL() string {
	if c.name == "" || len(c.pool) == 0 {
		return ""
	}

	return "ALTER TABLE `" + c.name + "` " + c.poolToSQL()
}

func (c alterTableCommand) poolToSQL() string {
	var sql []string

	for _, tc := range c.pool {
		sql = append(sql, tc.toSQL())
	}

	return strings.Join(sql, ", ")
}


text:
// This file is part of graze/golang-service
//
// Copyright (c) 2016 Nature Delivered Ltd. <https://www.graze.com>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
//
// license: https://github.com/graze/golang-service/blob/master/LICENSE
// link:    https://github.com/graze/golang-service

package auth

import (
	"context"
	"net/http"
)

// contextKey is a custom type to only allow this to access the key in the context
type contextKey int

// userKey is a private key to store the user information in the context in
const userKey contextKey = iota

// saveUser takes a nominal user and stores it in a new context for the provided request
func saveUser(r *http.Request, user interface{}) *http.Request {
	if user == nil {
		return r
	}
	return r.WithContext(context.WithValue(r.Context(), userKey, user))
}

// GetUser retrieves any user information provided by the validate request
//
// This is to handle different apiKeys having potentially different permissions
// or having different backend resources
//
// Usage:
// 	keyAuth := auth.ApiKey{"Graze", finder, onError}
//
// 	http.Handle("/thing", keyAuth.Handler(ItemHandler))
//
// 	func ItemHandler(w http.ResponseWriter, r *http.Request) {
// 		user, ok := auth.GetUser(r).(*User)
// 		if !ok {
// 			w.WriteHeader(403)
// 			return
// 		}
// 		...
// 	}
func GetUser(r *http.Request) interface{} {
	return r.Context().Value(userKey)
}

repository: graze/golang-service

repo_name: graze/golang-service


text:
package boltdb

import (
	"context"
	"errors"
	"testing"

	"github.com/stretchr/testify/require"

	"github.com/drand/drand/chain"
	chainerrors "github.com/drand/drand/chain/errors"
	"github.com/drand/drand/test"
)

func TestStoreBoltOrder(t *testing.T) {
	tmp := t.TempDir()
	ctx := IsATest(context.Background())
	l := test.Logger(t)
	store, err := NewBoltStore(ctx, l, tmp, nil)
	require.NoError(t, err)
	defer func() {
		require.NoError(t, store.Close(ctx))
	}()

	b1 := &chain.Beacon{
		PreviousSig: []byte("a magnificent signature"),
		Round:       145,
		Signature:   []byte("one signature to"),
	}

	b2 := &chain.Beacon{
		PreviousSig: []byte("is not worth an invalid one"),
		Round:       146,
		Signature:   []byte("govern them all"),
	}

	// we store b2 and check if it is last
	require.NoError(t, store.Put(ctx, b2))
	eb2, err := store.Last(ctx)
	require.NoError(t, err)
	require.Equal(t, b2, eb2)
	eb2, err = store.Last(ctx)
	require.NoError(t, err)
	require.Equal(t, b2, eb2)

	// then we store b1
	require.NoError(t, store.Put(ctx, b1))

	// and request last again
	eb2, err = store.Last(ctx)
	require.NoError(t, err)
	require.Equal(t, b2, eb2)
}

func TestStoreBolt(t *testing.T) {
	tmp := t.TempDir()
	ctx := IsATest(context.Background())
	l := test.Logger(t)

	var sig1 = []byte{0x01, 0x02, 0x03}
	var sig2 = []byte{0x02, 0x03, 0x04}

	store, err := NewBoltStore(ctx, l, tmp, nil)
	require.NoError(t, err)

	sLen, err := store.Len(ctx)
	require.NoError(t, err)
	require.Equal(t, 0, sLen)

	b1 := &chain.Beacon{
		PreviousSig: sig1,
		Round:       145,
		Signature:   sig2,
	}

	b2 := &chain.Beacon{
		PreviousSig: sig2,
		Round:       146,
		Signature:   sig1,
	}

	require.NoError(t, store.Put(ctx, b1))
	sLen, err = store.Len(ctx)
	require.NoError(t, err)
	require.Equal(t, 1, sLen)

	require.NoError(t, store.Put(ctx, b1))
	sLen, err = store.Len(ctx)
	require.NoError(t, err)
	require.Equal(t, 1, sLen)

	require.NoError(t, store.Put(ctx, b2))
	sLen, err = store.Len(ctx)
	require.NoError(t, err)
	require.Equal(t, 2, sLen)

	received, err := store.Last(ctx)
	require.NoError(t, err)
	require.Equal(t, b2, received)

	err = store.Close(ctx)
	require.NoError(t, err)

	store, err = NewBoltStore(ctx, l, tmp, nil)
	require.NoError(t, err)
	require.NoError(t, store.Put(ctx, b1))

	require.NoError(t, store.Put(ctx, b1))
	bb1, err := store.Get(ctx, b1.Round)
	require.NoError(t, err)
	require.Equal(t, b1, bb1)
	err = store.Close(ctx)
	require.NoError(t, err)

	store, err = NewBoltStore(ctx, l, tmp, nil)
	require.NoError(t, err)
	err = store.Put(ctx, b1)
	require.NoError(t, err)
	err = store.Put(ctx, b2)
	require.NoError(t, err)

	err = store.Cursor(ctx, func(ctx context.Context, c chain.Cursor) error {
		expecteds := []*chain.Beacon{b1, b2}
		i := 0
		b, err := c.First(ctx)

		for ; b != nil; b, err = c.Next(ctx) {
			require.NoError(t, err)
			require.True(t, expecteds[i].Equal(b))
			i++
		}
		// Last iteration will always produce an ErrNoBeaconSaved value
		if !errors.Is(err, chainerrors.ErrNoBeaconStored) {
			require.NoError(t, err)
		}

		unknown, err := c.Seek(ctx, 10000)
		require.ErrorIs(t, err, chainerrors.ErrNoBeaconStored)
		require.Nil(t, unknown)
		return nil
	})
	require.NoError(t, err)

	err = store.Cursor(ctx, func(ctx context.Context, c chain.Cursor) error {
		lb2, err := c.Last(ctx)
		require.NoError(t, err)
		require.NotNil(t, lb2)
		require.Equal(t, b2, lb2)
		return nil
	})
	require.NoError(t, err)

	_, err = store.Get(ctx, 10000)
	require.Equal(t, chainerrors.ErrNoBeaconStored, err)
}

func TestStore_Cursor(t *testing.T) {
	tmp := t.TempDir()
	ctx := IsATest(context.Background())
	l := test.Logger(t)
	dbStore, err := NewBoltStore(ctx, l, tmp, nil)
	require.NoError(t, err)
	defer func() {
		require.NoError(t, dbStore.Close(ctx))
	}()

	sigs := map[int][]byte{
		0: {0x01, 0x02, 0x03},
		1: {0x02, 0x03, 0x04},
		2: {0x03, 0x04, 0x05},
		3: {0x04, 0x05, 0x06},
		4: {0x05, 0x06, 0x07},
		5: {0x06, 0x07, 0x08},
	}

	beacons := make(map[int]*chain.Beacon, len(sigs)-1)

	for i := 1; i < len(sigs); i++ {
		b := &chain.Beacon{
			PreviousSig: sigs[i-1],
			Round:       uint64(i),
			Signature:   sigs[i],
		}

		beacons[i] = b

		require.NoError(t, dbStore.Put(ctx, b))
	}

	t.Log("generated beacons:")
	for i, beacon := range beacons {
		t.Logf("beacons[%d]: %#v\n", i, *beacon)
	}

	err = dbStore.Cursor(ctx, func(ctx context.Context, c chain.Cursor) error {
		b, err := c.Last(ctx)
		require.NoError(t, err)
		require.NotNil(t, b)
		require.Equal(t, beacons[len(beacons)], b)

		for key, orig := range beacons {
			t.Logf("seeking beacon %d\n", key)

			b, err := c.Seek(ctx, uint64(key))
			require.NoError(t, err)
			require.NotNil(t, b)
			require.Equal(t, orig, b)

			n, err := c.Next(ctx)
			if key == len(beacons) {
				require.ErrorIs(t, err, chainerrors.ErrNoBeaconStored)
			} else {
				require.NoError(t, err)
				require.Equal(t, beacons[key+1], n)
			}
		}

		return nil
	})
	require.NoError(t, err)
}

func TestShouldUseTrimmedBolt(t *testing.T) {
	tests := map[string]struct {
		ctx              context.Context
		sourceBeaconPath string
		want             bool
	}{
		"with context set and new db":          {IsATest(context.Background()), "./testdata/trimmed.db", false},
		"with context set and old db":          {IsATest(context.Background()), "./testdata/untrimmed.db", false},
		"with context unset and new db":        {context.Background(), "./testdata/trimmed.db", true},
		"with context unset and old db":        {context.Background(), "./testdata/untrimmed.db", false},
		"with context unset and db is missing": {context.Background(), "./testdata/missing.db", true},
	}
	for name, tt := range tests {
		name := name
		tt := tt
		t.Run(name, func(t *testing.T) {
			logger := test.Logger(t)
			got := shouldUseTrimmedBolt(tt.ctx, logger, tt.sourceBeaconPath, nil)
			require.Equal(t, tt.want, got)
		})
	}
}

repository: drand/drand

repo_name: drand/drand

gha_license_id: NOASSERTION


text:
DESCRIPTION = "Phone input method manager module"
SECTION = "gpephone"
PRIORITY = "optional"
LICENSE = "LiPS"
DEPENDS = "gtk+ ptim-headers libiac"
PR = "r0"

inherit gpephone pkgconfig autotools

SRC_URI = "${GPEPHONE_MIRROR}/ptim-manager-${PV}/immanager-${PV}.tar.bz2"

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

FILES_${PN} += "${libdir}/gtk-2.0/*/immodules/*.so ${libdir}/gtk-2.0/*/immodules/ptim"
FILES_${PN}-dbg += "${libdir}/gtk-2.0/*/immodules/.debug/*.so"
FILES_${PN}-dev += "${libdir}/gtk-2.0/*/immodules/*.la"

do_install_append () {
	# That's evil...
	install -m 644 ${S}/conf/imconfig ${D}/${libdir}/gtk-2.0/*/immodules/ptim
}

SRC_URI[md5sum] = "cafd1d222ae30fa496e299950de19ae7"
SRC_URI[sha256sum] = "e8e5144314fd2cd13722835338105c0236bf3da4dbf383a6ce052574c1ba7230"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD

extension: bb


text:
@Article{whitwellevaluation2019,
  title = {An Evaluation of the Progressive Supranuclear Palsy Speech/Language Variant},
  volume = {6},
  copyright = {\textcopyright 2019 International Parkinson and Movement Disorder Society},
  issn = {2330-1619},
  url = {https://onlinelibrary.wiley.com/doi/abs/10.1002/mdc3.12796},
  doi = {10.1002/mdc3.12796},
  abstract = {Background The Movement Disorder Society clinical criteria for progressive supranuclear palsy (PSP) provide a framework for assessing the presence/severity of clinical symptoms and define a speech/language variant of PSP. Objectives To evaluate the clinical criteria in a cohort of speech/language patients with longitudinal follow-up. Methods A total of 52 patients presenting with progressive apraxia of speech and/or agrammatic aphasia were followed longitudinally for up to 6 visits with clinical assessments and magnetic resonance imaging. We assessed oculomotor, postural instability, and akinesia diagnostic levels and determined whether patients met criteria for possible PSP-speech/language or probable PSP at each visit. Kaplan-Meier curves assessed time-to-event probabilities according to age. Statistical parametric mapping and midbrain volume were assessed according to disease progression. Results Few PSP symptoms were observed early in the disease, with oculomotor abnormalities and falls first observed 2 years after onset. Falls were more common than vertical supranuclear gaze palsy. Bradykinesia and rigidity commonly developed but axial was rarely greater than appendicular rigidity. During follow-up, 54% met criteria for possible PSP-speech/language, 38% for probable PSP-Richardson's syndrome, and 38% for probable PSP-parkinsonism, most commonly 6 to 6.9 years after onset. The probability of developing PSP was greater when onset was at an age older than 70 years. Patients who progressed to probable PSP had more parkinsonism and oculomotor impairment at baseline and greater midbrain atrophy when compared with those who did not develop probable PSP. Conclusions Symptoms typical of PSP commonly develop in patients presenting with a progressive speech/language disorder. Older age appears to be an important prognostic factor in these patients.},
  language = {en},
  urldate = {2020-09-19},
  journal = {Movement Disorders Clinical Practice},
  author = {Jennifer L. Whitwell and Chase A. Stevens and Joseph R. Duffy and Heather M. Clark and Mary M. Machulda and Edythe A. Strand and Peter R. Martin and Rene L. Utianski and Hugo Botha and Anthony J. Spychalla and Matthew L. Senjem and Christopher G. Schwarz and Clifford R. Jack and Farwa Ali and Anhar Hassan and Keith A. Josephs},
  year = {2019},
  keywords = {apraxia of speech, agrammatism, aphasia, midbrain, PSP},
  pages = {452--461},
  number = {6},
  note = {\_eprint: https://onlinelibrary.wiley.com/doi/pdf/10.1002/mdc3.12796},
  pubtype = {2},
  date = {2019-01-01},
}

repository: HugoBothaMD/academic-kickstart

repo_name: HugoBothaMD/academic-kickstart

gha_license_id: MIT


text:
# GFlags.
if(GFLAGS)
  handle_legacy_include_dependency_hint(GFLAGS_INCLUDE GFLAGS_INCLUDE_DIR_HINTS)
  handle_legacy_library_dependency_hint(GFLAGS_LIB GFLAGS_LIBRARY_DIR_HINTS)

  # Don't search with REQUIRED as we can continue without gflags.
  find_package(Gflags)
  if(GFLAGS_FOUND)
    message("-- Found Google Flags header in: ${GFLAGS_INCLUDE_DIRS}")
  else()
    message("-- Did not find Google Flags (gflags), Building without gflags "
      "- no tests or tools will be built!")
    # Retain the help string associated with the GFLAGS option
    # when updating it to disable use of gflags.
    get_property(HELP_STRING CACHE GFLAGS PROPERTY HELPSTRING)
    set(GFLAGS OFF CACHE BOOL "${HELP_STRING}" FORCE)
    add_definitions(-DCERES_NO_GFLAGS)
  endif()
else()
  message("-- Google Flags disabled; no tests or tools will be built!")
  add_definitions(-DCERES_NO_GFLAGS)
  # Mark as advanced (remove from default GUI view) the gflags search
  # variables in case user enabled GFLAGS, FindGflags did not find it, so
  # made search variables visible in GUI for user to set, but then user disables
  # GFLAGS instead of setting them.
  mark_as_advanced(FORCE GFLAGS_INCLUDE_DIR
                         GFLAGS_LIBRARY)
endif()

extension: cmake


text:
package random

import (
	"fmt"
	"strings"

	"k8s.io/apimachinery/pkg/api/meta"
	corev1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/apimachinery/pkg/util/rand"
)

func Namespace() string {
	return fmt.Sprintf("pullup-test-%s", rand.String(5))
}

type NamespaceMap struct {
	m map[string]string
}

func NewNamespaceMap() *NamespaceMap {
	return &NamespaceMap{
		m: map[string]string{},
	}
}

func (r *NamespaceMap) GetRandom(original string) string {
	result, ok := r.m[original]

	if !ok {
		result = Namespace()
		r.m[original] = result
	}

	return result
}

func (r *NamespaceMap) GetOriginal(random string) string {
	for k, v := range r.m {
		if v == random {
			return k
		}
	}

	return ""
}

func (r *NamespaceMap) setNamespace(obj corev1.Object, newNamespace string) {
	oldNamespace := obj.GetNamespace()
	obj.SetNamespace(newNamespace)
	obj.SetSelfLink(strings.Replace(obj.GetSelfLink(), oldNamespace, newNamespace, -1))
}

func (r *NamespaceMap) SetObject(input runtime.Object) {
	obj, err := meta.Accessor(input)

	if err == nil {
		r.setNamespace(obj, r.GetRandom(obj.GetNamespace()))
	}
}

func (r *NamespaceMap) RestoreObject(input runtime.Object) {
	obj, err := meta.Accessor(input)

	if err == nil {
		r.setNamespace(obj, r.GetOriginal(obj.GetNamespace()))
	}
}

repository: forkkit/pullup

repo_name: forkkit/pullup


text:
require s3ctl-module.inc
LICENSE = "GPLv2&MIT"
DEPENDS = "linux-renesas"
PN = "s3ctl-kernel-module"
PR = "r0"
SRC_URI = "file://s3ctl-kernel.tar.bz2"
LIC_FILES_CHKSUM = "file://drv/GPL-COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
					file://drv/MIT-COPYING;md5=fea016ce2bdf2ec10080f69e9381d378"

do_compile() {
# Build kernel module
	cd ${S}/drv
	make all ARCH=arm
}

do_install() {
# Create shared folder
	mkdir -p ${D}/lib/modules/${KERNEL_VERSION}/extra/ ${D}/usr/src/kernel/include

# Copy kernel module
	cp -f ${S}/drv/s3ctl.ko ${D}/lib/modules/${KERNEL_VERSION}/extra/

# Copy shared header files
	cp -f ${S}/drv/Module.symvers ${KERNELSRC}/include/s3ctl.symvers
	cp -f ${KERNELSRC}/include/s3ctl_private.h ${D}/usr/src/kernel/include
	cp -f ${S}/drv/Module.symvers ${D}/usr/src/kernel/include/s3ctl.symvers
}

# Append function to clean extract source
do_cleansstate_prepend() {
        bb.build.exec_func('do_clean_source', d)
}

do_clean_source() {
	rm -Rf ${KERNELSRC}/include/s3ctl_private.h
	rm -Rf ${KERNELSRC}/include/s3ctl.symvers
}

PACKAGES = "\
  ${PN} \
  ${PN}-dev \
"
FILES_${PN} = " \
  /lib/modules/${KERNEL_VERSION}/extra/s3ctl.ko \
"
FILES_${PN}-dev = " \
  /usr/src/kernel/include \
  /usr/src/kernel/include/*.h \
  /usr/src/kernel/include/s3ctl.symvers \
"
RPROVIDES_${PN} += "s3ctl-kernel-module"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

repository: renesas-devel/meta-renesas-proprietary

repo_name: renesas-devel/meta-renesas-proprietary


text:
@article{LIGO:Gravitational2011,
 author = {The LIGO Scientific Collaboration},
 doi = {doi:10.1038/NPHYS2083},
 journal = {Nature Physics},
 pages = {962},
 title = {A gravitational wave observatory operating beyond the quantum shot-noise limit},
 volume = {7},
 year = {2011}
}

repository: mcoughlin/personal-website

repo_name: mcoughlin/personal-website

gha_language: TeX


text:
package cli

import (
	"strings"

	"github.com/Sam-Izdat/pogo/deps/odin/cli/values"
)

// defineHelp defines a help function and alias if they are not present
func (cmd *CLI) defineHelp() {
	if _, ok := cmd.flags["help"]; !ok {
		cmd.DefineBoolFlag("help", false, "show help and exit")
		if _, ok := cmd.aliases['h']; !ok {
			cmd.AliasFlag('h', "help")
		}
	}
}

// defineVersion defines a version if one has been set
func (cmd *CLI) defineVersion() {
	if _, ok := cmd.flags["version"]; !ok && len(cmd.Version()) > 0 {
		cmd.DefineBoolFlag("version", false, "show version and exit")
		if _, ok := cmd.aliases['v']; !ok {
			cmd.AliasFlag('v', "version")
		}
	}
}

// flagFromArg determines the flags from an argument
func (cmd *CLI) flagFromArg(arg string) (bool, []*Flag) {
	var flags []*Flag

	// Do nothing if flags terminated
	if cmd.flagsTerminated {
		return false, flags
	}
	if arg[len(arg)-1] == '=' {
		cmd.errf("invalid flag format")
	}
	arg = strings.Split(arg, "=")[0]

	// Determine if we need to terminate flags
	isFlag := arg[0] == '-'
	areAliases := isFlag && arg[1] != '-'
	isTerminator := !areAliases && len(arg) == 2

	if !isFlag || isTerminator {
		cmd.flagsTerminated = true
		return false, flags
	}

	// Determine if name or alias
	if areAliases {
		aliases := arg[1:]
		for _, c := range aliases {
			flag, ok := cmd.aliases[c]
			if !ok {
				cmd.errf("invalid alias: %v", string(c))
			}
			flags = append(flags, flag)
		}
	} else {
		name := arg[2:]
		flag, ok := cmd.flags[name]
		if !ok {
			cmd.errf("invalid flag")
		}
		flags = append(flags, flag)
	}
	return areAliases, flags
}

func (cmd *CLI) initValues() {
	if cmd.flagValues == nil {
		cmd.flagValues = make(map[*Flag]values.Value)
	}
}

// parseFlags flag definitions from the argument list, returns any left over
// arguments after flags have been parsed.
func (cmd *CLI) parseFlags(args []string) []string {
	cmd.defineHelp()
	cmd.defineVersion()
	cmd.initValues()

	// Set all the flags to defaults before setting
	cmd.setFlagDefaults()

	// copy propogating flags
	cmd.copyPropogatingFlags()

	// Set inherited values
	cmd.setFlagValuesFromParent()

	// Set each flag by its set value
	for {
		// Break if no arguments remain
		if len(args) == 0 {
			cmd.flagsTerminated = true
			break
		}
		arg := args[0]
		isAlias, flags := cmd.flagFromArg(arg)

		// Break if the flags have been terminated
		if cmd.flagsTerminated {
			// Remove the flag terminator if it exists
			if arg == "--" {
				args = args[1:]
			}
			break
		}
		if isAlias {
			args = cmd.setAliasValues(flags, args)
		} else {
			args = cmd.setFlagValue(flags[0], args)
		}
	}
	// return the remaining unused args
	return args
}

// setAliasValues sets the values of flags from thier aliases
func (cmd *CLI) setAliasValues(flags []*Flag, args []string) []string {
	for i, flag := range flags {
		isLastFlag := i == len(flags)-1
		if isLastFlag {
			args = cmd.setFlagValue(flag, args)
		} else {
			cmd.setFlagValue(flag, []string{})
		}
	}
	return args
}

// setFlagDefaults sets the default values of all flags
func (cmd *CLI) setFlagDefaults() {
	for _, flag := range cmd.flags {
		cmd.setFlag(flag, flag.DefValue)
	}
}

// setFlag sets the value of the named flag.
func (cmd *CLI) setFlag(flag *Flag, value string) error {
	_ = cmd.flags[flag.Name] // Verify the flag is a flag for f set
	err := flag.value.Set(value)
	if err != nil {
		return err
	}
	cmd.flagValues[flag] = flag.value
	return nil
}

// setFlagValue sets the value of a given flag
func (cmd *CLI) setFlagValue(flag *Flag, args []string) []string {
	if flag == nil {
		flag = noFlag // Fix for when we continue on error
	}
	splitArgs := []string{}
	hasSetValue := false
	hasPosValue := false
	isBoolFlag := false
	if fv, ok := flag.value.(boolFlag); ok && fv.IsBoolValue() {
		isBoolFlag = true
	}

	if len(args) > 0 {
		splitArgs = strings.Split(args[0], "=")
		hasSetValue = len(splitArgs) >= 2
		hasPosValue = len(args) >= 2 && args[1][0] != '-'
	}

	cutLen := 0

	var err error

	if hasSetValue {
		err = cmd.setFlag(flag, splitArgs[1])
		cutLen = 1
	} else if isBoolFlag {
		cmd.setFlag(flag, "true")
		cutLen = 1
	} else if hasPosValue {
		err = cmd.setFlag(flag, args[1])
		cutLen = 2
	} else {
		cmd.errf("flag \"--%v\" is missing a value", flag.Name)
	}

	cmd.handleErr(err)

	if len(args) > cutLen {
		return args[cutLen:]
	}
	return []string{}
}

repository: Sam-Izdat/pogo

repo_name: Sam-Izdat/pogo


text:
//go:build unit
// +build unit

// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
//	http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file 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 status

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestStatusToString(t *testing.T) {
	testCases := []struct {
		status AttachmentStatus
		str    string
	}{
		{
			status: AttachmentNone,
			str:    "NONE",
		},
		{
			status: AttachmentAttached,
			str:    "ATTACHED",
		},
		{
			status: AttachmentDetached,
			str:    "DETACHED",
		},
	}

	for _, tc := range testCases {
		t.Run(tc.str, func(t *testing.T) {
			assert.Equal(t, tc.str, (&tc.status).String())
		})
	}
}

func TestShouldSend(t *testing.T) {
	testCases := []struct {
		name       string
		status     AttachmentStatus
		shouldSend bool
	}{
		{
			name:       "NONE",
			status:     AttachmentNone,
			shouldSend: false,
		},
		{
			name:       "ATTACHED",
			status:     AttachmentAttached,
			shouldSend: true,
		},
		{
			name:       "DETACHED",
			status:     AttachmentDetached,
			shouldSend: false,
		},
	}

	for _, tc := range testCases {
		t.Run(tc.name, func(t *testing.T) {
			assert.Equal(t, tc.shouldSend, (&tc.status).ShouldSend())
		})
	}
}

repository: aws/amazon-ecs-agent

repo_name: aws/amazon-ecs-agent


text:
@article{barron2021,
  title = {Neural Inhibition for Continual Learning and Memory},
  author = {Barron, Helen C},
  year = {2021},
  journal = {Current Opinion in Neurobiology},
  series = {Neurobiology of {{Learning}} and {{Plasticity}}},
  volume = {67},
  pages = {85--94},
  issn = {0959-4388},
  doi = {10.1016/j.conb.2020.09.007},
  url = {https://www.sciencedirect.com/science/article/pii/S0959438820301343},
  urldate = {2021-07-20},
  abstract = {Humans are able to continually learn new information and acquire skills that meet the demands of an ever-changing environment. Yet, this new learning does not necessarily occur at the expense of old memories. The specialised biological mechanisms that permit continual learning in humans and other mammals are not fully understood. Here I explore the possibility that neural inhibition plays an important role. I present recent findings from studies in humans that suggest inhibition regulates the stability of neural networks to gate cortical plasticity and memory retrieval. These studies use non-invasive methods to obtain an indirect measure of neural inhibition and corroborate comparable findings in animals. Together these studies reveal a model whereby neural inhibition protects memories from interference to permit continual learning. Neural inhibition may, therefore, play a critical role in the computations that underlie higher-order cognition and adaptive behaviour.},
  langid = {english}
}

@article{clopath2012,
  title = {Synaptic Consolidation: An Approach to Long-Term Learning},
  author = {Clopath, Claudia},
  year = {2012},
  journal = {Cognitive Neurodynamics},
  volume = {6},
  number = {3},
  pages = {251--257},
  issn = {1871-4080},
  doi = {10.1007/s11571-011-9177-6},
  url = {http://link.springer.com/10.1007/s11571-011-9177-6},
  abstract = {Synaptic plasticity is thought to be the basis of learning and memory, but it is mostly studied on the timescale of mere minutes. This review discusses synaptic consolidation, a process that enables synapses to retain their strength for a much longer time (days to years), instead of returning to their original value. The process involves specific plasticity-related proteins, and depends on the dopamine D1/D5 receptors. Here, we review the research on synaptic consolidation, describing electrophysiology experiments, recent modeling work, as well as behavioral correlates.},
  isbn = {1871-4080 (Print)},
  pmid = {23730356},
  keywords = {[hebbian],Behavior,Electrophysiology,Model,Review,Synaptic consolidation,Synaptic plasticity,Synaptic tagging}
}

@article{gonzalez2019,
  title = {Can Sleep Protect Memories from Catastrophic Forgetting?},
  author = {Gonzalez, Oscar C and Sokolov, Yury and Krishnan, Giri and Bazhenov, Maxim},
  year = {2019},
  journal = {bioRxiv},
  pages = {569038},
  doi = {10.1101/569038},
  url = {https://www.biorxiv.org/content/10.1101/569038v1},
  abstract = {Previously encoded memories can be damaged by encoding of new memories, especially when they are relevant to the new data and hence can be disrupted by new training - a phenomenon called "catastrophic forgetting." Human and animal brains are capable of continual learning, allowing them to learn from past experience and to integrate newly acquired information with previously stored memories. A range of empirical data suggest important role of sleep in consolidation of recent memories and protection of the past knowledge from catastrophic forgetting. To explore potential mechanisms of how sleep can enable continual learning in neuronal networks, we developed a biophysically-realistic thalamocortical network model where we could train multiple memories with different degree of interference. We found that in a wake-like state of the model, training of a "new" memory that overlaps with previously stored "old" memory results in degradation of the old memory. Simulating NREM sleep state immediately after new learning led to replay of both old and new memories - this protected old memory from forgetting and ultimately enhanced both memories. The effect of sleep was similar to the interleaved training of the old and new memories. The study revealed that the network slow-wave oscillatory activity during simulated deep sleep leads to a complex reorganization of the synaptic connectivity matrix that maximizes separation between groups of synapses responsible for conflicting memories in the overlapping population of neurons. The study predicts that sleep may play a protective role against catastrophic forgetting and enables brain networks to undergo continual learning.},
  keywords = {catastrophic,continual learning,memory consolidation,neural network,sleep}
}

@book{hebb2002,
  title = {The {{Organization}} of {{Behavior}}: A {{Neuropsychological Theory}}},
  shorttitle = {The {{Organization}} of {{Behavior}}},
  author = {Hebb, D O},
  year = {2002},
  journal = {Lawrence Erlbaum},
  publisher = {{Psychology Press}},
  url = {https://www.amazon.com/Organization-Behavior-Neuropsychological-Theory/dp/0805843000 https://books.google.it/books/about/The_Organization_of_Behavior.html?id=ddB4AgAAQBAJ&printsec=frontcover&source=kp_read_button&redir_esc=y#v=onepage&q&f=false},
  abstract = {Since its publication in 1949, D.O. Hebb's, The Organization of Behavior has been one of the most influential books in the fields of psychology and neuroscience. However, the original edition has been unavailable since 1966, ensuring that Hebb's comment that a classic normally means "cited but not read" is true in his case. This new edition rectifies a long-standing problem for behavioral neuroscientists\textendash the inability to obtain one of the most cited publications in the field. The Organization of Behavior played a significant part in stimulating the investigation of the neural foundations of behavior and continues to be inspiring because it provides a general framework for relating behavior to synaptic organization through the dynamics of neural networks. D.O. Hebb was also the first to examine the mechanisms by which environment and experience can influence brain structure and function, and his ideas formed the basis for work on enriched environments as stimulants for behavioral development. References to Hebb, the Hebbian cell assembly, the Hebb synapse, and the Hebb rule increase each year. These forceful ideas of 1949 are now applied in engineering, robotics, and computer science, as well as neurophysiology, neuroscience, and psychology\textendash a tribute to Hebb's foresight in developing a foundational neuropsychological theory of the organization of behavior.},
  isbn = {978-1-135-63191-8},
  langid = {english},
  keywords = {[hebbian],Psychology / Cognitive Psychology \& Cognition,Psychology / General,Psychology / Neuropsychology,Psychology / Physiological Psychology}
}

@article{ratcliff1990,
  title = {Connectionist Models of Recognition Memory: Constraints Imposed by Learning and Forgetting Functions.},
  author = {Ratcliff, R},
  year = {1990},
  journal = {Psychological review},
  volume = {97},
  number = {2},
  pages = {285--308},
  issn = {0033-295X},
  url = {http://www.ncbi.nlm.nih.gov/pubmed/2186426},
  abstract = {Multilayer connectionist models of memory based on the encoder model using the backpropagation learning rule are evaluated. The models are applied to standard recognition memory procedures in which items are studied sequentially and then tested for retention. Sequential learning in these models leads to 2 major problems. First, well-learned information is forgotten rapidly as new information is learned. Second, discrimination between studied items and new items either decreases or is nonmonotonic as a function of learning. To address these problems, manipulations of the network within the multilayer model and several variants of the multilayer model were examined, including a model with prelearned memory and a context model, but none solved the problems. The problems discussed provide limitations on connectionist models applied to human memory and in tasks where information to be learned is not all available during learning.},
  pmid = {2186426}
}

@article{woltz2000,
  title = {Negative Transfer Errors in Sequential Cognitive Skills: Strong-but-Wrong Sequence Application.},
  shorttitle = {Negative Transfer Errors in Sequential Cognitive s},
  author = {Woltz, Dan J. and Gardner, Michael K. and Bell, Brian G.},
  year = {2000},
  journal = {Journal of Experimental Psychology: Learning, Memory, and Cognition},
  volume = {26},
  number = {3},
  pages = {601--625},
  issn = {1939-1285},
  doi = {10.1037/0278-7393.26.3.601},
  url = {http://doi.apa.org/getdoi.cfm?doi=10.1037/0278-7393.26.3.601},
  abstract = {Three experiments investigated the role of processing sequence knowledge in negative transfer within multistep cognitive skills. In Experiments 1 and 2, more training resulted in higher error rates when new processing sequences that resembled familiar ones were introduced in transfer. Transfer error responses were executed with the same speed as correct responses to familiar sequence trials, and the errors appeared to be undetected by the performers. Experiment 3 tested whether the effects of sequence learning were attributable to explicit or implicit knowledge of processing sequences. Evidence favored the implicit learning interpretation. Findings are discussed in relationship to earlier demonstrations of the einstellung effect and to current taxonomic theories of human error.},
  langid = {english}
}


text:
package clair

import (
	"encoding/json"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"testing"

	"github.com/coreos/pkg/capnslog"
)

func getSampleAnalysis() []byte {
	file, err := ioutil.ReadFile("./samples/clair_report.json")
	if err != nil {
		log.Errorf("File error: %v\n", err)
	}

	return file
}

func newServer(httpStatus int) *httptest.Server {
	return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(httpStatus)
	}))
}

func TestIsHealthy(t *testing.T) {
	server := newServer(http.StatusOK)
	defer server.Close()
	healthURI = server.URL
	if h := IsHealthy(); !h {
		t.Errorf("IsHealthy() => %v, want %v", h, true)
	}
}

func TestIsNotHealthy(t *testing.T) {
	server := newServer(http.StatusInternalServerError)
	defer server.Close()
	uri = server.URL
	if h := IsHealthy(); h {
		t.Errorf("IsHealthy() => %v, want %v", h, true)
	}
}

func TestRelativeCount(t *testing.T) {
	var analysis ImageAnalysis
	err := json.Unmarshal([]byte(getSampleAnalysis()), &analysis)
	if err != nil {
		t.Errorf("Failing with error: %v", err)
	}

	vulnerabilitiesCount := AllVulnerabilities(analysis)
	if vulnerabilitiesCount.RelativeCount("High") != 1.3 {
		t.Errorf("analysis.CountAllVulnerabilities().RelativeCount(\"High\") => %v, want 1.3", vulnerabilitiesCount.RelativeCount("High"))
	}

	if vulnerabilitiesCount.RelativeCount("Medium") != 23.38 {
		t.Errorf("analysis.CountAllVulnerabilities().RelativeCount(\"Medium\") => %v, want 23.38", vulnerabilitiesCount.RelativeCount("Medium"))
	}

	if vulnerabilitiesCount.RelativeCount("Low") != 74.03 {
		t.Errorf("analysis.CountAllVulnerabilities().RelativeCount(\"Low\") => %v, want 74.03", vulnerabilitiesCount.RelativeCount("Low"))
	}
}

repository: ContinuousSecurityTooling/clairctl

repo_name: ContinuousSecurityTooling/clairctl


text:
DESCRIPTION = "GLib-based DBus bindings for freesmartphone.org - Vala implementation"
AUTHOR = "Didier 'Ptitjes"
LICENSE = "LGPL"
SECTION = "devel"
DEPENDS = "vala-native vala-dbus-binding-tool-native dbus-glib glib-2.0 fso-specs"
PV = "0.2.2+gitr${SRCREV}"
PR = "r0"

inherit autotools_stage pkgconfig vala

SRC_URI = "${FREESMARTPHONE_GIT}/libfso-glib.git;protocol=git;branch=master"
S = "${WORKDIR}/git"

EXTRA_OECONF = "\
  SPECS_PATH=${STAGING_DATADIR}/fso-specs/ \
"

FILES_${PN}-dev += "${datadir}/gir-1.0/*.gir"

repository: demsey/openembedded

repo_name: demsey/openembedded


text:
package wikibrief

import (
	"bytes"
	"context"
	"encoding/base64"
	"encoding/json"
	"encoding/xml"
	"reflect"
	"sync"
	"testing"

	"github.com/ebonetti/ctxutils"

	"github.com/negapedia/wikibots"
)

func TestUnit(t *testing.T) {
	ctx, fail := ctxutils.WithFail(context.Background())
	pages := New(ctx, fail, "/tmp", "zu", true)
	wg := sync.WaitGroup{}
	for i := 0; i < 200; i++ {
		wg.Add(1)
		go func() {
			defer wg.Done()
			for p := range pages {
				for range p.Revisions {
					//Do nothing
				}
			}
		}()
	}
	wg.Wait()

	if err := fail(nil); err != nil {
		t.Fatalf("%+v", err)
	}
}

func TestRun(t *testing.T) {
	b, err := base64.StdEncoding.DecodeString(holyGrail)
	if err != nil {
		t.Fatalf("Error in holyGrail encoding %+v", err)
	}

	ctx := context.Background()
	ID2Bot, err := wikibots.New(ctx, "en")
	if err != nil {
		t.Fatalf("%+v", err)
	}

	ch := make(chan EvolvingPage)
	go func() {
		defer close(ch)
		err := run(ctx, bBase{xml.NewDecoder(bytes.NewBuffer(b)), func(uint32) (uint32, bool) { return 0, true }, ID2Bot, ch, &errorContext{"holyGrail", "holyGrail"}})
		if err != nil {
			t.Fatalf("%+v", err)
		}
	}()

	var s summary
	for page := range ch {
		s.PageID = page.PageID
		for r := range page.Revisions {
			s.Revisions = append(s.Revisions, r)
		}
	}

	var st summary
	bSummary, err := base64.StdEncoding.DecodeString(encodedHolyGrailSummary)
	errt := json.Unmarshal(bSummary, &st)

	switch {
	case err != nil:
		t.Fatalf("Error in holyGrail summary encoding %+v", err)
	case errt != nil:
		t.Fatalf("Error while loading summary test info %+v", err)
	case !reflect.DeepEqual(s, st):
		t.Fatal("Error different summaries")
	}
}

type summary struct {
	PageID    uint32
	Revisions []Revision
}

repository: negapedia/wikibrief

repo_name: negapedia/wikibrief


text:
package kata

import "testing"

func TestOpposite(t *testing.T) {
	type args struct {
		value int
	}
	tests := []struct {
		name string
		args args
		want int
	}{
		{
			name: "1 then -1",
			args: args{1},
			want: -1,
		},
		{
			name: "14 then -14",
			args: args{14},
			want: -14,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := Opposite(tt.args.value); got != tt.want {
				t.Errorf("Opposite() = %v, want %v", got, tt.want)
			}
		})
	}
}

repository: blackhorseya/codewars-golang

repo_name: blackhorseya/codewars-golang


text:
package check

import (
	"context"
	"fmt"

	"github.com/vmware/govmomi/view"
	"github.com/vmware/govmomi/vim25/types"
	"k8s.io/klog/v2"
)

// CheckFolderList tests that OCP has permissions to list volumes in Datastore.
// This is necessary to create volumes.
func CheckTaskPermissions(ctx *CheckContext) error {
	tctx, cancel := context.WithTimeout(ctx.Context, *Timeout)
	defer cancel()

	mgr := view.NewManager(ctx.VMClient)
	view, err := mgr.CreateTaskView(tctx, ctx.VMClient.ServiceContent.TaskManager)
	if err != nil {
		return fmt.Errorf("error creating task view: %s", err)
	}

	taskCount := 0
	tctx, cancel = context.WithTimeout(ctx.Context, *Timeout)
	defer cancel()
	err = view.Collect(tctx, func(tasks []types.TaskInfo) {
		taskCount += len(tasks)
	})

	if err != nil {
		return fmt.Errorf("error listing recent tasks: %s", err)
	}
	klog.V(2).Infof("CheckTaskPermissions: %d tasks found", taskCount)
	return nil
}


text:
file(REMOVE_RECURSE
  "CMakeFiles/project_secp256k1"
  "CMakeFiles/project_secp256k1-complete"
  "vendor/secp256k1-zkp/src/project_secp256k1-stamp/project_secp256k1-install"
  "vendor/secp256k1-zkp/src/project_secp256k1-stamp/project_secp256k1-mkdir"
  "vendor/secp256k1-zkp/src/project_secp256k1-stamp/project_secp256k1-download"
  "vendor/secp256k1-zkp/src/project_secp256k1-stamp/project_secp256k1-update"
  "vendor/secp256k1-zkp/src/project_secp256k1-stamp/project_secp256k1-patch"
  "vendor/secp256k1-zkp/src/project_secp256k1-stamp/project_secp256k1-configure"
  "vendor/secp256k1-zkp/src/project_secp256k1-stamp/project_secp256k1-build"
  "vendor/secp256k1-zkp/src/project_secp256k1-stamp/project_secp256k1-autogen"
)

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


text:
%%% -*-BibTeX-*-
@inproceedings{Cao2018ICML,
    title       = {Adversarial Learning with Local Coordinate Coding},
    author      = {Jiezhang  Cao  and  Yong  Guo  and Qingyao Wu  and Chunhua Shen and   Junzhou  Huang  and Mingkui  Tan},
    year        = {2018},
    month       = {},
    booktitle   = {International  Conference on Machine Learning (ICML'18)},
    address     = {},
    venue       = {ICML},
    pages       = {},
    volume      = {},
    publisher   = {},
    eprint      = {1806.04895},
    url         = {},
    project     = {},
}


text:
# Only search for clang-tidy if user has not supplied it through CMAKE_CXX_CLANG_TIDY
if(NOT DEFINED CMAKE_CXX_CLANG_TIDY)
    find_program(
        PTL_CLANG_TIDY_COMMAND NAMES clang-tidy clang-tidy-12 clang-tidy-11 clang-tidy-10
                                     clang-tidy-9 clang-tidy-8 clang-tidy-7)
    mark_as_advanced(PTL_CLANG_TIDY_COMMAND)
    if(NOT PTL_CLANG_TIDY_COMMAND)
        message(
            FATAL_ERROR
                "PTL_USE_CLANG_TIDY is ON, but no clang-tidy program could be found")
    endif()
    set(CMAKE_CXX_CLANG_TIDY "${PTL_CLANG_TIDY_COMMAND}")
endif()

# Create a preprocessor definition that depends on .clang-tidy content so the compile
# command will change when .clang-tidy changes. Nothing actually uses this definition, it
# is simply added to trigger a rebuild when *only* .clang-tidy changes.
file(SHA1 ${PROJECT_SOURCE_DIR}/.clang-tidy __ptl_clang_tidy_sha1)
add_compile_definitions("PTL_CLANG_TIDY_SHA1=${__ptl_clang_tidy_sha1}")
unset(__ptl_clang_tidy_sha1)
configure_file(${PROJECT_SOURCE_DIR}/.clang-tidy ${PROJECT_SOURCE_DIR}/.clang-tidy
               COPYONLY)

repository: jrmadsen/PTL

repo_name: jrmadsen/PTL


text:
SUMMARY = "Decode EDID data in human-readable format"
DESCRIPTION = "edid-decode decodes EDID monitor description data in human-readable format."
AUTHOR = "Hans Verkuil <hverkuil-cisco@xs4all.nl>"
HOMEPAGE = "https://hverkuil.home.xs4all.nl/edid-decode/edid-decode.html"

SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2ef696d66c156139232201f223c22592"

SRC_URI= "git://git.linuxtv.org/edid-decode.git;protocol=https;branch=master"
SRCREV = "e052f5f9fdf74ca11aa1a8edfa62eff8d0aa3d0d"
PV = "0.0+git${SRCPV}"
S = "${WORKDIR}/git"

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

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake


text:
# Adapted from recipe in meta-musicians layer:
# https://github.com/schnitzeltony/meta-musicians/tree/master/recipes-musicians/csound
# with tweaks for headless build and minimizing dependencies for Elk
# Original license: MIT

SUMMARY = "A sound and music computing system"
HOMEPAGE = "https://csound.com/"

LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343"

# TBD: fltk is not propely detected
DEPENDS += "\
    flex-native \
    bison-native \
    swig-native \
    python3 \
    libsndfile1 \
    fluidsynth \
    curl \
    liblo \
    stk \
    libvorbis \
    libeigen \
    libwebsockets \
"

PV = "6.13.0"
SRC_URI = "\
    git://github.com/csound/csound.git;nobranch=1 \
    file://0001-Do-not-set-include-path-to-usr-local-include.patch \
    file://0002-Do-not-use-try_run-for-portaudio.patch \
"
SRCREV = "3b08a449cc147dec35ba843ced86e0058a9ac865"

S = "${WORKDIR}/git"

inherit cmake gettext python3-dir

# Where to get lua-version from?
LUA_VERSION = "5.3"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pulseaudio', d)}"
PACKAGECONFIG[pulseaudio] = "-DUSE_PULSEAUDIO=ON,-DUSE_PULSEAUDIO=OFF,pulseaudio,pulseaudio-server"
PACKAGECONFIG[luajit] = "-DLUA_MODULE_INSTALL_DIR=${libdir}/lua/${LUA_VERSION},,luajit"

EXTRA_OECMAKE += "\
    -DUSE_DOUBLE=OFF \
    -DBUILD_BELA=OFF \
    -DBUILD_CUDA_OPCODES=OFF \
    -DBUILD_FRAMEBUFFER_OPCODES=OFF \
    -DBUILD_IMAGE_OPCODES=OFF \
    -DBUILD_JACK_OPCODES=OFF \
    -DUSE_ALSA=OFF \
    -DUSE_AUDIOUNIT=OFF \
    -DUSE_COREMIDI=OFF \
    -DUSE_FLTK=OFF \
    -DUSE_JACK=OFF \
    -DUSE_PORTAUDIO=OFF \
    -DUSE_PORTMIDI=OFF \
    -DUSE_PULSEAUDIO=OFF \
    -DBUILD_PYTHON_INTERFACE=OFF \
    -DPYTHON_MODULE_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} \
    -DUSE_LIB64=${@bb.utils.contains("baselib", "lib64", "ON", "OFF",d)} \
"

OECMAKE_C_FLAGS_RELEASE += " -O3 -ffast-math"
OECMAKE_CXX_FLAGS_RELEASE += " -O3 -ffast-math"

PACKAGES =+ "\
    ${PN}-python3 \
    ${PN}-luajit \
"

FILES_${PN}-python3 = "${PYTHON_SITEPACKAGES_DIR}"
FILES_${PN}-luajit = "${libdir}/lua"

RDEPENDS_${PN}-python3 += "python3"

repository: elk-audio/meta-elk

repo_name: elk-audio/meta-elk

branch_name: refs/heads/hardknott


text:
package mgdsn

import (
	"flag"
	"testing"
)

func TestDSN(t *testing.T) {
	type testCase struct {
		in, out string
	}
	for _, v := range []testCase{
		{"api_key=as=d", "api_key=as=d"},
		{"domain=abc  api_key=asd1 public_api_key=asdf  ", "domain=abc api_key=asd1 public_api_key=asdf"},
		{"domain=abc api_koo=1", ""},
		{"domain=abc  api_key=asd1 public_api_key=asdf  api_koo=1", ""},
		{"domain= api_key=1 public_api_key=1", "api_key=1 public_api_key=1"},
	} {
		var d DSN
		err := d.Set(v.in)
		if v.out == "" && err == nil {
			t.Fatal("should have failed", v.in, d.String())
		}
	}
}

func TestNil(t *testing.T) {
	var d *DSN
	if d.String() != "" {
		t.Fail()
	}
}

func TestFlag(t *testing.T) {
	fs := flag.NewFlagSet("test", flag.ContinueOnError)
	var dsn DSN
	fs.Var(&dsn, "testdsn", "testtest")
	err := fs.Parse([]string{"-testdsn", "domain=1 api_key=2 public_api_key=3"})
	if err != nil {
		t.Fatal(err)
	}
	if dsn.Domain != "1" {
		t.Fatal("domain", dsn.Domain)
	}
	if dsn.APIKey != "2" {
		t.Fatal("api key", dsn.APIKey)
	}
	if dsn.PublicAPIKey != "3" {
		t.Fatal("pub pi key", dsn.PublicAPIKey)
	}
	fs.VisitAll(func(f *flag.Flag) {
		v := f.Value.(flag.Getter).Get()
		if v.(*DSN).Domain != "1" {
			t.Fatal(v)
		}
	})
}

repository: go-pa/mgdsn

repo_name: go-pa/mgdsn


text:
package render

import (
	"encoding/json"
	"io"
	"net/http"
)

const contentTypeJSON = "application/json"

// JSON encodes a given value using the standard json package and writes
// the encoding output to a given writer. If the writer implements the
// http.ResponseWriter interface, then this function will also set the JSON
// content-type header. Status will be used when w is a http.ResponseWriter and
// must be a valid http status code.
func JSON(w io.Writer, status int, value interface{}) error {
	if hw, ok := w.(http.ResponseWriter); ok {
		hw.Header().Set("Content-Type", contentTypeJSON)
		hw.WriteHeader(status)
	}

	return json.NewEncoder(w).Encode(value)
}

repository: Jordan-Cartwright/simple-weather-api

repo_name: Jordan-Cartwright/simple-weather-api


text:
package main

import (
	"flag"
	"fmt"
	"log"
	"os"

	"github.com/qeedquan/go-media/stb/stbtt"
)

var flags struct {
	Font  string
	Scale float64
}

func main() {
	flags.Scale = 20
	flag.StringVar(&flags.Font, "f", flags.Font, "use font file")
	flag.Float64Var(&flags.Scale, "s", flags.Scale, "use scale")
	flag.Usage = usage
	flag.Parse()
	if flags.Font == "" || flag.NArg() < 1 {
		usage()
	}

	f, err := loadfont(flags.Font)
	ck(err)
	defer f.Free()

	for _, arg := range flag.Args() {
		for _, ch := range arg {
			render(f, ch)
		}
	}
}

func render(f *stbtt.FontInfo, ch rune) {
	b, w, h, _, _ := f.CodepointBitmap(0, f.ScaleForPixelHeight(flags.Scale), ch)
	for y := 0; y < h; y++ {
		for x := 0; x < w; x++ {
			const p = "  .:ioVM@"
			fmt.Printf("%c", p[b[y*w+x]>>5])
		}
		fmt.Println()
	}
	fmt.Println()
}

func loadfont(name string) (*stbtt.FontInfo, error) {
	data, err := os.ReadFile(name)
	if err != nil {
		return nil, err
	}

	var f stbtt.FontInfo
	err = f.Init(data, stbtt.GetFontOffsetForIndex(data, 0))
	return &f, nil
}

func ck(err error) {
	if err != nil {
		log.Fatal(err)
	}
}

func usage() {
	fmt.Fprintln(os.Stderr, "usage: [options] chars ...")
	flag.PrintDefaults()
	os.Exit(2)
}


text:
package mocks

import "github.com/argoproj/notifications-engine/pkg/api"

type FakeFactory struct {
	Api api.API
	Err error
}

func (f *FakeFactory) GetAPI() (api.API, error) {
	return f.Api, f.Err
}

repository: sergeyshevch/notifications-engine

repo_name: sergeyshevch/notifications-engine


text:
DESCRIPTION = "TinyLogin is a suite of tiny UNIX \
utilities for handling logins, user authentication, \
changing passwords, and otherwise maintaining users \
and groups on an embedded system."
HOMEPAGE = "http://tinylogin.busybox.net/"
SECTION = "base"
LICENSE = "GPLv2+|NewBSD"
PR = "r7"

#SRC_URI = "http://tinylogin.busybox.net/downloads/tinylogin-${PV}.tar.bz2 \
SRC_URI = "http://limpens.net/trac/at91-kit-trac/export/4/trunk/sources/tinylogin-${PV}.tar.bz2 \
	file://cvs-20040608.patch \
	file://add-system.patch \
	file://adduser-empty_pwd.patch \
	file://remove-index.patch"

EXTRA_OEMAKE = ""

do_compile () {
	oe_runmake 'CC=${CC}' 'CROSS=${HOST_PREFIX}'
}

do_install () {
	install -d ${D}${base_bindir}
	install -m 4755 tinylogin ${D}${base_bindir}/tinylogin
	install -d ${D}${sysconfdir}
	install -m 0644 tinylogin.links ${D}${sysconfdir}
}

pkg_postinst_${PN} () {
    # If we are not making an image we create links for the utilities that doesn't exist
    # so the update-alternatives script will get the utilities it needs
    # (update-alternatives have no problem replacing links later anyway)
    if test "x$D" = "x"; then while read link; do if test ! -h "$link"; then case "$link" in /*/*/*) to="../../bin/tinylogin";; /bin/*) to="tinylogin";; /*/*) to="../bin/tinylogin";; esac; ln -s $to $link; fi; done </etc/tinylogin.links; fi

    # This adds the links, remember that this has to work when building an image too, hence the $D
    while read link; do case "$link" in /*/*/*) to="../../bin/tinylogin";; /bin/*) to="tinylogin";; /*/*) to="../bin/tinylogin";; esac; bn=`basename $link`; update-alternatives --install $link $bn $to 60; done <$D/etc/tinylogin.links
}

pkg_prerm_${PN} () {
    while read link
    do
        case "$link" in
            /*/*/*) to="../../bin/tinylogin";;
            /bin/*) to="tinylogin";;
            /*/*) to="../bin/tinylogin";;
        esac
        bn=`basename $link`
        sh /usr/bin/update-alternatives --remove $bn $to
    done < /etc/tinylogin.links
}

SRC_URI[md5sum] = "44da0ff2b727455669890b24305e351d"
SRC_URI[sha256sum] = "5e542e4b7825305a3678bf73136c392feb0d44b8bbf926e8eda5453eea7ddd6b"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty


text:
package miniapp

import (
	"net/url"

	"github.com/bububa/opentaobao/model"
)

// TaobaoCoinAwardDeliveryAPIRequest 淘金币奖励投放 API请求
// taobao.coin.award.delivery
//
// 淘金币奖励投放
type TaobaoCoinAwardDeliveryAPIRequest struct {
	model.Params
	// openid
	_param0 string
	// 渠道ID
	_param1 int64
	// 订单信息
	_orderDto *OrderDto
}

// NewTaobaoCoinAwardDeliveryRequest 初始化TaobaoCoinAwardDeliveryAPIRequest对象
func NewTaobaoCoinAwardDeliveryRequest() *TaobaoCoinAwardDeliveryAPIRequest {
	return &TaobaoCoinAwardDeliveryAPIRequest{
		Params: model.NewParams(),
	}
}

// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoCoinAwardDeliveryAPIRequest) GetApiMethodName() string {
	return "taobao.coin.award.delivery"
}

// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoCoinAwardDeliveryAPIRequest) GetApiParams(params url.Values) {
	for k, v := range r.Params {
		params.Set(k, v.String())
	}
}

// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoCoinAwardDeliveryAPIRequest) GetRawParams() model.Params {
	return r.Params
}

// SetParam0 is Param0 Setter
// openid
func (r *TaobaoCoinAwardDeliveryAPIRequest) SetParam0(_param0 string) error {
	r._param0 = _param0
	r.Set("param0", _param0)
	return nil
}

// GetParam0 Param0 Getter
func (r TaobaoCoinAwardDeliveryAPIRequest) GetParam0() string {
	return r._param0
}

// SetParam1 is Param1 Setter
// 渠道ID
func (r *TaobaoCoinAwardDeliveryAPIRequest) SetParam1(_param1 int64) error {
	r._param1 = _param1
	r.Set("param1", _param1)
	return nil
}

// GetParam1 Param1 Getter
func (r TaobaoCoinAwardDeliveryAPIRequest) GetParam1() int64 {
	return r._param1
}

// SetOrderDto is OrderDto Setter
// 订单信息
func (r *TaobaoCoinAwardDeliveryAPIRequest) SetOrderDto(_orderDto *OrderDto) error {
	r._orderDto = _orderDto
	r.Set("order_dto", _orderDto)
	return nil
}

// GetOrderDto OrderDto Getter
func (r TaobaoCoinAwardDeliveryAPIRequest) GetOrderDto() *OrderDto {
	return r._orderDto
}

repository: bububa/opentaobao

repo_name: bububa/opentaobao


text:
SUMMARY = "Phosphor OpenBMC pre-init scripts for mmc"
DESCRIPTION = "Phosphor OpenBMC filesystem mount implementation for mmc."
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
PR = "r1"

SRC_URI += "file://mmc-init.sh"

S = "${WORKDIR}"

inherit allarch

do_install() {
    install -m 0755 ${WORKDIR}/mmc-init.sh ${D}/init
    install -d ${D}/dev
    mknod -m 622 ${D}/dev/console c 5 1
}

RDEPENDS:${PN} += " \
    ${@d.getVar('PREFERRED_PROVIDER_u-boot-fw-utils', True) or 'u-boot-fw-utils'} \
    ${VIRTUAL-RUNTIME_base-utils} \
    e2fsprogs-e2fsck \
    e2fsprogs-mke2fs \
    gptfdisk \
    libgpiod-tools \
    parted \
    udev \
"

FILES:${PN} += " /init /dev "

repository: openbmc/openbmc

repo_name: openbmc/openbmc

gha_language: Python


text:
# Copyright (c) 2019 LG Electronics, Inc.

require suitesparse-5.4.0.inc

LICENSE = "GPL-2.0"
LIC_FILES_CHKSUM += "file://Doc/License.txt;md5=1c0c48edf24526b3cda72ce1a8a20b1d"

DEPENDS = " \
    suitesparse-config \
    suitesparse-amd \
    suitesparse-colamd \
    suitesparse-cholmod \
    lapack \
"

S = "${WORKDIR}/SuiteSparse/SPQR"

EXTRA_OEMAKE = "CC='${CC}' BLAS='-lopenblas -lblas'"

do_compile() {
    # build only the library, not the demo
    oe_runmake library
}

do_install() {
    oe_runmake install INSTALL=${D}${prefix}
}

DEPENDS_append_class-target = " chrpath-replacement-native"
# For some reason ends with bad RPATH
# WARNING: suitesparse-spqr-5.4.0-r0 do_package_qa: QA Issue: package suitesparse-spqr contains bad RPATH /jenkins/mjansa/build-ros/ros2-dashing-master/tmp-glibc/work/core2-32-oe-linux/suitesparse-spqr/5.4.0-r0/image/usr/lib in file /jenkins/mjansa/build-ros/ros2-dashing-master/tmp-glibc/work/core2-32-oe-linux/suitesparse-spqr/5.4.0-r0/packages-split/suitesparse-spqr/usr/lib/libspqr.so.2.0.9 [rpaths]
do_install_append() {
    chrpath --delete ${D}${libdir}/*${SOLIBS}
}

repository: jianchangfeng/meta-ros

repo_name: jianchangfeng/meta-ros


text:
@inproceedings{futrell2018natural,
 address = {Miyazaki, Japan},
 author = {Richard Futrell and Edward Gibson and Harry J. Tily and Idan Blank and Anastasia Vishnevetsky and Steven T. Piantadosi and Evelina Fedorenko},
 booktitle = {Proceedings of LREC 2018, Eleventh International Conference on Language Resources and Evaluation},
 data = {http://github.com/languageMIT/naturalstories},
 editors = {Nicoletta Calzolari and Khalid Choukri and Christopher Cieri and Thierry Declerck and Sara Goggi and Koiti Hasida and Hitoshi Isahara and Bente Maegaardand Joseph Mariani and Hélène Mazo and Asuncion Moreno and Jan Odijk and Stelios Piperidis and Takenobu Tokunaga},
 pages = {76--82},
 publisher = {European Language Resources Association},
 title = {The Natural Stories Corpus},
 url = {http://www.lrec-conf.org/proceedings/lrec2018/pdf/337.pdf},
 year = {2018}
}

repository: langprocgroup/academic-kickstart

repo_name: langprocgroup/academic-kickstart


text:
@incollection{Faggiani2018,
 address = {Singapore},
 author = {Faggiani, Pietro and Schmehl, Roland},
 booktitle = {Airborne Wind Energy -- Advances in Technology Development and Research},
 chapter = {16},
 date = {2018-04-01},
 doi = {10.1007/978-981-10-1947-0_16},
 editor = {Schmehl, Roland},
 pages = {391--411},
 publisher = {Springer},
 series = {Green Energy and Technology},
 title = {Design and Economics of a Pumping Kite Wind Park},
 year = {2018}
}


text:
KBRANCH ?= "dev-5.4"
LINUX_VERSION ?= "5.4.48"

SRCREV="f77eed1af7f260c2444fd5d4e1ebb0d8c4aa366f"

require linux-aspeed.inc

repository: xuhai-git/openbmc

repo_name: xuhai-git/openbmc


text:
package core

import (
	"encoding/json"
	"fmt"
)

type Route string

//Cmd is an executable command
type Command struct {
	ID              string           `json:"id"`
	Command         string           `json:"command"`
	Arguments       *json.RawMessage `json:"arguments"`
	Queue           string           `json:"queue"`
	StatsInterval   int              `json:"stats_interval,omitempty"`
	MaxTime         int              `json:"max_time,omitempty"`
	MaxRestart      int              `json:"max_restart,omitempty"`
	RecurringPeriod int              `json:"recurring_period,omitempty"`
	LogLevels       []int            `json:"log_levels,omitempty"`
	Tags            string           `json:"tags"`

	Route Route `json:"-"`
}

type M map[string]interface{}

func MustArguments(args interface{}) *json.RawMessage {
	bytes, err := json.Marshal(args)
	if err != nil {
		panic(err)
	}

	raw := json.RawMessage(bytes)
	return &raw
}

//String represents cmd as a string
func (cmd *Command) String() string {
	return fmt.Sprintf("(%s# %s)", cmd.ID, cmd.Command)
}

//LoadCmd loads cmd from json string.
func LoadCmd(str []byte) (*Command, error) {
	var cmd Command
	err := json.Unmarshal(str, &cmd)
	if err != nil {
		return nil, err
	}

	return &cmd, err
}


text:
@book{Kohler2011,
author = {K\"{o}hler, Jens},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/eclipse.pdf:pdf},
mendeley-groups = {Bachelor Thesis},
pages = {1--17},
title = {{OpenWrt C / C ++ Development with Eclipse}},
year = {2011}
}
@inproceedings{widyawan2012ihome,
author = {Widyawan and Wibowo, Sigit Basuki and Zul, Muhammad Ihsan and Nugroho, Budi},
booktitle = {5th AUN/SEED-Net Regional Conference on Information and Communications Technology (RCICT)},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/iHome- Low-Cost Domotic for Residential Houses.pdf:pdf},
mendeley-groups = {Metopen,Bachelor Thesis},
organization = {AUN/SEED-Net},
title = {{iHome: Low-Cost Domotic for Residential Houses}},
year = {2012}
}
@misc{Network2014,
author = {Network, Microsoft Development},
mendeley-groups = {Bachelor Thesis},
title = {{How Microsoft Helps Software Development Succeed}},
url = {http://msdn.microsoft.com/en-us/hh126360.aspx},
urldate = {13/01/2014},
lastchecked = {13/01/2014},
year = {2014}
}
@inproceedings{Raluca2008,
author = {Raluca, M-E and Razvan, M-E and Terzis, Andreas},
booktitle = {Sensor, Mesh and Ad Hoc Communications and Networks, 2008. SECON'08. 5th Annual IEEE Communications Society Conference on},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/Gateway Design for Data Gathering Sensor Network.pdf:pdf},
isbn = {1424417775},
mendeley-groups = {Bachelor Thesis},
pages = {296--304},
publisher = {IEEE},
title = {{Gateway design for data gathering sensor networks}},
year = {2008}
}
@misc{Gabriel2013,
author = {Gabriel, Vincent},
mendeley-groups = {Bachelor Thesis},
title = {{Bootstrap Admin Theme}},
lastchecked = {29/12/2013},
note = {[Online]. Available: http://vinceg.github.io/Bootstrap-Admin-Theme/. [Accessed: December 29, 2013]},
year = {2013}
}
@misc{DigiInternationalInc.2013,
author = {{Digi International Inc.}},
mendeley-groups = {Bachelor Thesis},
title = {{ZigBee\textsuperscript{\textregistered} Wireless Standard}},
note = {[Online]. Available: https://www.digi.com/technology/rf-articles/wireless-zigbee. [Accessed: March 13, 2013]},
year = {2013}
}
@misc{OpenWrtProject2013,
abstract = {A GNU/Linux based firmware program for embedded devices such as residential gateways and routers.},
author = {{OpenWrt Project}},
mendeley-groups = {Bachelor Thesis},
title = {{OpenWRT}},
note = {[Online]. Available: https://openwrt.org/. [Accessed: March 13, 2013]},
lastchecked = {13/03/2013},
year = {2013}
}
@misc{MICRORISCs.r.o.2013,
author = {MICRORISC},
mendeley-groups = {Bachelor Thesis},
title = {{IQRF}},
note = {[Online]. Available: https://iqrf.org/. [Accessed: March 13, 2013]},
urldate = {13/03/2013},
year = {2013}
}
@inproceedings{Dunkels2004,
author = {Dunkels, Adam and Voigt, Thiemo and Bergman, Niclas and J\"{o}nsson, Mats},
booktitle = {Swedish National Computer Networking Workshop},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/The Design and Implementation of an IP-based Sensor Network for Intrusion Monitoring.pdf:pdf},
mendeley-groups = {Bachelor Thesis},
publisher = {Citeseer},
title = {{The design and implementation of an IP-based sensor network for intrusion monitoring}},
year = {2004}
}
@inproceedings{Spinar2009,
author = {Spinar, Rostislav and Muthukumaran, Panneer and de Paz, Rodolfo and Pesch, Dirk and Song, Weiping and Chaudhry, Shafique Ahmad and Sreenan, Cormac J and Jafer, Essa and O'Flynn, Brendan and O'Donnell, James},
booktitle = {6th European Conference on Wireless Sensor Networks, Cork},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/Demo- Efficient Building Management with  IP-based Wireless Sensor Network.pdf:pdf},
mendeley-groups = {Bachelor Thesis},
pages = {1--2},
title = {{Demo Abstract: Efficient Building Management with IP-based Wireless Sensor Network}},
year = {2009}
}
@misc{Erratt2013,
abstract = {In this study, we present our novel development of a general gateway system for data collection in wireless sensor networks (WSNs). The unique characteristic of our developed WSN gateway is that it has been designed easily configurable for nearly any WSN data collection applications, with diverse data managements and WSN protocols. In particular, it supports WSN transport layer at the gateway. Our implementation leverages Java and widely adopted TinyOS platform for various WSNs. We have conducted thorough tests for the validation of our developed gateway system, including the use of three realworld WSN field test-beds. The evaluation and validation results demonstrate the effectiveness and robustness of our gateway system.},
author = {Erratt, N and Liang, Yao},
booktitle = {Wireless Communications and Networking Conference (WCNC), 2013 IEEE},
doi = {10.1109/WCNC.2013.6555285},
file = {:Users/gtrdp/Documents/TETI/riset/paper-references/06555285.pdf:pdf},
isbn = {1525-3511 VO -},
keywords = {Databases,Java,Logic gates,Message systems,Servers,TinyOS platform,WSN protocols,computer network management,data collection,data collection applications,diverse data managements,gateway architecture,gateway system,general gateway system,internetworking,network servers,operating systems (computers),protocols,real-world field test-beds,transport layer,user configurable design and implementation,wireless sensor networks},
mendeley-groups = {Bachelor Thesis},
pages = {4392--4397},
title = {{The design and implementation of a general WSN gateway for data collection}},
year = {2013}
}
@article{Matsuura2007,
author = {Matsuura, Tomoko and Hisazumi, Kenji and Kitasuka, Teruaki and Nakanishi, Tsuneo and Fukuda, Akira},
doi = {10.1109/INSS.2007.4297419},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/UDSS Sensor Device for Context Awareness in Home Network.pdf:pdf},
isbn = {1-4244-1231-5},
journal = {2007 Fourth International Conference on Networked Sensing Systems},
keywords = {computer in the appliance,context awareness,home net-,internet appliance,of human senses,sensor network,the user context instead,to determine,uses the sensor device,work},
mendeley-groups = {Bachelor Thesis},
month = jun,
pages = {196--200},
publisher = {Ieee},
title = {{UDSS: Sensor Device for Context Awareness in Home Network}},
url = {http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=4297419},
year = {2007}
}
@article{Baronti,
author = {Baronti, Paolo and Pillai, Prashant and Chook, Vince and Chessa, Stefano and Gotta, Alberto and Hu, Y Fun},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/Wireless sensor networks- A survey on the state of the art and the 802.15.4 and ZigBee standards.pdf:pdf},
mendeley-groups = {Bachelor Thesis},
title = {{Wireless Sensor Networks : a Survey on the State of the Art and the 802 . 15 . 4 and ZigBee Standards}}
}
@article{Hwang2003,
author = {Hwang, Kwang-il and In, Jeongsik and Park, Nhokyung and Eom, Doo-seop},
doi = {10.1109/TCE.2003.1261201},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/A Design and Implementation of Wireless Sensor Gateway for Efiicient Querying and Managing through World Wide Web.pdf:pdf},
issn = {0098-3063},
journal = {IEEE Transactions on Consumer Electronics},
mendeley-groups = {Bachelor Thesis},
month = nov,
number = {4},
pages = {1090--1097},
title = {{A design and implementation of wireless sensor gateway for efficient querying and managing through world wide web}},
url = {http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=1261201},
volume = {49},
year = {2003}
}
@article{Fainelli2008,
author = {Fainelli, Florian},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/The OpenWrt Embedded Development Framework.pdf:pdf},
mendeley-groups = {Bachelor Thesis},
title = {{The OpenWrt embedded development framework}},
year = {2008}
}
@article{Jin2012,
author = {Jin, Tao},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/OpenWrt Development Guide.pdf:pdf},
mendeley-groups = {Bachelor Thesis},
title = {{OpenWrt Development Guide}},
year = {2012}
}
@article{Elias2012,
author = {Elias, Andre G.F. and Rodrigues, Joel J.P.C. and Oliveira, Luis M.L. and Zarpelao, Bruno B.},
doi = {10.1109/IMIS.2012.33},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/A Ubiquitous Model for Wireless Sensor Networks Monitoring.pdf:pdf},
isbn = {978-1-4673-1328-5},
journal = {2012 Sixth International Conference on Innovative Mobile and Internet Services in Ubiquitous Computing},
keywords = {- wireless sensor networks,internet of,mobile computing,network monitoring,ubiquitous computing,web services},
mendeley-groups = {Bachelor Thesis},
month = jul,
pages = {835--839},
publisher = {Ieee},
title = {{A Ubiquitous Model for Wireless Sensor Networks Monitoring}},
url = {http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=6296962},
year = {2012}
}
@inproceedings{wibowo2013wireless,
author = {Wibowo, Sigit Basuki and Widyawan},
booktitle = {2013 AUN/SEED-Net Regional Conference in Electrical and Electronics Engineering},
file = {:Users/gtrdp/Documents/TETI/riset/paper-references/Wireless Sensor Network and Internet Protocol Integration with COTSaa.pdf:pdf},
mendeley-groups = {Metopen,Bachelor Thesis},
organization = {Department of EE, Chulalongkorn University},
pages = {120--123},
title = {{Wireless Sensor Network and Internet Protocol Integration with COTS}},
year = {2013}
}
@article{Lin2011,
author = {Lin, Hsueh-Chun and Kan, Yiao-Chiang and Hong, Yao-Ming},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/The Comprehensive Gateway Model for Diverse Envirionmental Monitoring upon Wireless Sensor Network.pdf:pdf},
issn = {1530-437X},
journal = {Sensors Journal, IEEE},
mendeley-groups = {Bachelor Thesis},
number = {5},
pages = {1293--1303},
publisher = {IEEE},
title = {{The comprehensive gateway model for diverse environmental monitoring upon wireless sensor network}},
volume = {11},
year = {2011}
}
@inproceedings{DaSilvaCampos2011,
author = {{da Silva Campos}, Bruno and Rodrigues, Joel J P C and Mendes, Lucas D P and Nakamura, Eduardo Freire and Figueiredo, Carlos Mauricio S},
booktitle = {Communications (ICC), 2011 IEEE International Conference on},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/Design and Construction of Wireless Sensor Network Gateway with IPv4$\backslash$:IPv6 Support.pdf:pdf},
isbn = {1612842321},
mendeley-groups = {Bachelor Thesis},
pages = {1--5},
publisher = {IEEE},
title = {{Design and construction of wireless sensor network gateway with IPv4/IPv6 support}},
year = {2011}
}
@article{Kang2007,
author = {Kang, Suk-bum and Yang, Tae-kyu},
doi = {10.1109/ICCAS.2007.4406942},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/Tracking for Moving Object Using Adaptive Rao Blackwellized Particle Filter and Fuzzy Control System.pdf:pdf},
isbn = {9788995003862},
journal = {2007 International Conference on Control, Automation and Systems},
keywords = {controller,fuzzy,object,rao-blackwellized particle filter,tracking},
mendeley-groups = {Bachelor Thesis},
number = {1},
pages = {420--424},
publisher = {Ieee},
title = {{Tracking for moving object using adaptive Rao-Blackwellized particle filter and fuzzy control system}},
url = {http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=4406942},
year = {2007}
}
@article{Sato2007,
author = {Sato, Kenya and Koita, Takahiro and Fukuda, Akira},
doi = {10.1155/2007/29391},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/Broadcasted Location - Aware Data Cache fpr Vehicular Application.pdf:pdf},
issn = {1687-3955},
journal = {EURASIP Journal on Embedded Systems},
mendeley-groups = {Bachelor Thesis},
pages = {1--11},
title = {{Broadcasted Location-Aware Data Cache for Vehicular Application}},
url = {http://jes.eurasipjournals.com/content/2007/1/029391},
volume = {2007},
year = {2007}
}
@article{Sulc2011,
author = {Sulc, Vladimir},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/Home Automation with IQRF Wireless Communication Platform.pdf:pdf},
isbn = {9781612081137},
keywords = {- home automation,and communication,communication,faculty of electrical engineering,iqmesh,iqrf,jaroslav kadlec,networking,radek kuchta,wireless},
mendeley-groups = {Bachelor Thesis},
number = {c},
pages = {212--217},
title = {{Home Automation with IQRF Wireless Communication Platform : A Case Study}},
year = {2011}
}
@article{Rodrigues2010,
author = {Rodrigues, Joel J P C and Neves, Paulo A C S},
doi = {10.1002/dac},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/A Survey on IP Based WSN Solutions.pdf:pdf},
keywords = {internet protocol,ip-enabled wireless sensor networks,mote,ubiquitous computing,wireless sensor networks},
mendeley-groups = {Bachelor Thesis},
number = {January},
pages = {963--981},
title = {{A survey on IP-based wireless sensor network solutions}},
year = {2010}
}
@inproceedings{Seflova2012,
author = {Seflova, Petra and Sulc, Vladimir and Pos, Jiri and Spinar, Rostislav},
booktitle = {Telecommunications and Signal Processing (TSP), 2012 35th International Conference on},
file = {:Users/gtrdp/Documents/TETI/riset/bachelor thesis/Paper/iqmesh.pdf:pdf},
isbn = {1467311170},
mendeley-groups = {Bachelor Thesis},
pages = {101--104},
publisher = {IEEE},
title = {{IQRF wireless technology utilizing IQMESH protocol}},
year = {2012}
}

repository: sendz/template-skripsi

repo_name: sendz/template-skripsi


text:
require optee-test.inc

SRC_URI:append = " \
    file://Update-arm_ffa_user-driver-dependency.patch \
    file://ffa_spmc-Add-arm_ffa_user-driver-compatibility-check.patch \
    file://musl-workaround.patch \
   "
SRCREV = "5db8ab4c733d5b2f4afac3e9aef0a26634c4b444"

EXTRA_OEMAKE:append:libc-musl = " OPTEE_OPENSSL_EXPORT=${STAGING_INCDIR}"
DEPENDS:append:libc-musl = " openssl"
CFLAGS:append:libc-musl = " -Wno-error=deprecated-declarations"

branch_name: refs/heads/npcm-master


text:
DESCRIPTION = "lua-expat"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://doc/us/license.html;beginline=61;endline=105;md5=233d45b83cb017f713f5293cabd9f391"
HOMEPAGE = "https://www.github.com/keplerproject"
DEPENDS += "expat lua"
RDEPENDS_${PN} += "lua"

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

SRC_URI = "https://matthewwild.co.uk/projects/luaexpat/luaexpat-${PV}.tar.gz \
           file://expat_${PV}-make.patch \
           "

SRC_URI[md5sum] = "3c20b5795e7107f847f8da844fbfe2da"
SRC_URI[sha256sum] = "d060397960d87b2c89cf490f330508b7def1a0677bdc120531c571609fc57dc3"

LDFLAGS = "-llua"

LUA_LIB_DIR = "${libdir}/lua/5.2"
LUA_SHARE_DIR = "${datadir}/lua/5.2"

FILES_${PN} = "${LUA_LIB_DIR}/*.so \
	       ${LUA_SHARE_DIR}/lxp/*.lua "

FILES_${PN}-dbg += "${LUA_LIB_DIR}/.debug/*.so"

EXTRA_OEMAKE = "LUA_V=5.2"

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

BBCLASSEXTEND = "native nativesdk"

repository: ahmedmoselhi/meta-neutrino

repo_name: ahmedmoselhi/meta-neutrino


text:
# Use the lightweight mDNS querier built into the RDMnet library. This discovery provider only
# supports broker discovery, not broker registration.

set(RDMNET_DISC_PLATFORM_SOURCES
  ${RDMNET_SRC}/rdmnet/disc/lightweight/rdmnet_disc_platform_defs.h
  ${RDMNET_SRC}/rdmnet/disc/lightweight/rdmnet_disc_lightweight.c
  ${RDMNET_SRC}/rdmnet/disc/lightweight/lwmdns_common.h
  ${RDMNET_SRC}/rdmnet/disc/lightweight/lwmdns_common.c
  ${RDMNET_SRC}/rdmnet/disc/lightweight/lwmdns_recv.h
  ${RDMNET_SRC}/rdmnet/disc/lightweight/lwmdns_recv.c
  ${RDMNET_SRC}/rdmnet/disc/lightweight/lwmdns_send.h
  ${RDMNET_SRC}/rdmnet/disc/lightweight/lwmdns_send.c
)
set(RDMNET_DISC_PLATFORM_INCLUDE_DIRS ${RDMNET_SRC}/rdmnet/disc/lightweight)

repository: ETCLabs/RDMnet

repo_name: ETCLabs/RDMnet

gha_language: C


text:
@article{Agrawal:2017ksf,
 archiveprefix = {arXiv},
 author = {Agrawal, Prateek and Howe, Kiel},
 doi = {10.1007/JHEP12(2018)029},
 eprint = {1710.04213},
 journal = {JHEP},
 pages = {029},
 primaryclass = {hep-ph},
 reportnumber = {FERMILAB-PUB-17-500-T},
 title = {Factoring the Strong CP Problem},
 volume = {12},
 year = {2018}
}

repository: prateekagrawal/academic-kickstart

repo_name: prateekagrawal/academic-kickstart


text:
@Article{hu_essential_2007,
  title = {Essential gene identification and drug target prioritization in {Aspergillus} fumigatus},
  volume = {3},
  doi = {10.1371/journal.ppat.0030024},
  number = {3},
  journal = {PLoS Pathog},
  author = {W. Hu and S. Sillaots and S. Lemieux and J. Davison and S. Kauffman and A. Breton and A. Linteau and C. Xin and J. Bowman and J. Becker and B. Jiang and T. Roemer},
  year = {2007},
  note = {Type: Journal Article},
  pages = {e24},
  issn = {1553-7366 (Print) 1553-7366},
  date = {2007-01-01},
}