text:
// Copyright (c) 2018 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package client

import (
	"errors"
	"fmt"
	"time"

	"github.com/m3db/m3/src/aggregator/sharding"
	"github.com/m3db/m3/src/cluster/placement"
	"github.com/m3db/m3/src/metrics/encoding/protobuf"
	"github.com/m3db/m3/src/x/clock"
	"github.com/m3db/m3/src/x/instrument"
	xio "github.com/m3db/m3/src/x/io"
)

// AggregatorClientType determines the aggregator client type.
type AggregatorClientType int

const (
	// LegacyAggregatorClient is an alias for TCPAggregatorClient
	LegacyAggregatorClient AggregatorClientType = iota
	// M3MsgAggregatorClient is the M3Msg aggregator client type that uses M3Msg to
	// handle publishing to a M3Msg topic the aggregator consumes from.
	M3MsgAggregatorClient
	// TCPAggregatorClient is the TCP aggregator client type and uses it's own
	// TCP negotiation, load balancing and data transmission protocol.
	TCPAggregatorClient

	defaultAggregatorClient = LegacyAggregatorClient

	defaultFlushWorkerCount = 64

	// defaultMaxTimerBatchSize is the default maximum timer batch size.
	// By default there is no limit on the timer batch size.
	defaultMaxTimerBatchSize = 0

	// defaultInstanceQueueSize determines how many protobuf payloads can be buffered
	// before it must wait for an existing batch to be flushed to an instance.
	defaultInstanceQueueSize = 128

	// By default traffic is cut over to shards 10 minutes before the designated
	// cutover time in case there are issues with the instances owning the shards.
	defaultShardCutoverWarmupDuration = 10 * time.Minute

	// By default traffic doesn't stop until one hour after the designated cutoff
	// time in case there are issues with the instances taking over the shards
	// and as such we need to switch the traffic back to the previous owner of the shards.
	defaultShardCutoffLingerDuration = time.Hour

	// By default the oldest metrics in the queue are dropped when it is full.
	defaultDropType = DropOldest

	// By default set maximum batch size to 8mb.
	defaultMaxBatchSize = 2 << 22
)

var (
	validAggregatorClientTypes = []AggregatorClientType{
		LegacyAggregatorClient,
		M3MsgAggregatorClient,
		TCPAggregatorClient,
	}

	errTCPClientNoWatcherOptions = errors.New("legacy client: no watcher options set")
	errM3MsgClientNoOptions      = errors.New("m3msg aggregator client: no m3msg options set")
	errNoRWOpts                  = errors.New("no rw opts set for aggregator")
)

func (t AggregatorClientType) String() string {
	switch t {
	case LegacyAggregatorClient:
		return "legacy"
	case M3MsgAggregatorClient:
		return "m3msg"
	case TCPAggregatorClient:
		return "tcp"
	}
	return "unknown"
}

// MarshalYAML returns the YAML representation of the AggregatorClientType.
func (t AggregatorClientType) MarshalYAML() (interface{}, error) {
	return t.String(), nil
}

// UnmarshalYAML unmarshals a AggregatorClientType into a valid type from string.
func (t *AggregatorClientType) UnmarshalYAML(unmarshal func(interface{}) error) error {
	var str string
	if err := unmarshal(&str); err != nil {
		return err
	}
	if str == "" {
		*t = defaultAggregatorClient
		return nil
	}
	for _, valid := range validAggregatorClientTypes {
		if str == valid.String() {
			*t = valid
			return nil
		}
	}
	return fmt.Errorf("invalid AggregatorClientType: value=%s, valid=%v",
		str, validAggregatorClientTypes)
}

// Options provide a set of client options.
type Options interface {
	// Validate validates the client options.
	Validate() error

	// SetAggregatorClientType sets the client type.
	SetAggregatorClientType(value AggregatorClientType) Options

	// AggregatorClientType returns the client type.
	AggregatorClientType() AggregatorClientType

	// SetM3MsgOptions sets the M3Msg aggregator client options.
	SetM3MsgOptions(value M3MsgOptions) Options

	// M3MsgOptions returns the M3Msg aggregator client options.
	M3MsgOptions() M3MsgOptions

	// SetClockOptions sets the clock options.
	SetClockOptions(value clock.Options) Options

	// ClockOptions returns the clock options.
	ClockOptions() clock.Options

	// SetInstrumentOptions sets the instrument options.
	SetInstrumentOptions(value instrument.Options) Options

	// InstrumentOptions returns the instrument options.
	InstrumentOptions() instrument.Options

	// SetEncoderOptions sets the encoder options.
	SetEncoderOptions(value protobuf.UnaggregatedOptions) Options

	// EncoderOptions returns the encoder options.
	EncoderOptions() protobuf.UnaggregatedOptions

	// SetShardFn sets the sharding function.
	SetShardFn(value sharding.ShardFn) Options

	// ShardFn returns the sharding function.
	ShardFn() sharding.ShardFn

	// SetWatcherOptions sets the placement watcher options.
	SetWatcherOptions(value placement.WatcherOptions) Options

	// WatcherOptions returns the placement watcher options.
	WatcherOptions() placement.WatcherOptions

	// SetShardCutoverWarmupDuration sets the warm up duration for traffic cut over to a shard.
	SetShardCutoverWarmupDuration(value time.Duration) Options

	// ShardCutoverWarmupDuration returns the warm up duration for traffic cut over to a shard.
	ShardCutoverWarmupDuration() time.Duration

	// SetShardCutoffLingerDuration sets the linger duration for traffic cut off from a shard.
	SetShardCutoffLingerDuration(value time.Duration) Options

	// ShardCutoffLingerDuration returns the linger duration for traffic cut off from a shard.
	ShardCutoffLingerDuration() time.Duration

	// SetConnectionOptions sets the connection options.
	SetConnectionOptions(value ConnectionOptions) Options

	// ConnectionOptions returns the connection options.
	ConnectionOptions() ConnectionOptions

	// SetFlushWorkerCount sets the max number of workers used for flushing.
	SetFlushWorkerCount(value int) Options

	// FlushWorkerCount returns the max number of workers used for flushing.
	FlushWorkerCount() int

	// SetForceFlushEvery sets the duration between forced flushes.
	SetForceFlushEvery(value time.Duration) Options

	// ForceFlushEvery returns the duration, if any, between forced flushes.
	ForceFlushEvery() time.Duration

	// SetMaxTimerBatchSize sets the maximum timer batch size.
	SetMaxTimerBatchSize(value int) Options

	// MaxTimerBatchSize returns the maximum timer batch size.
	MaxTimerBatchSize() int

	// SetInstanceQueueSize sets the instance queue size.
	SetInstanceQueueSize(value int) Options

	// InstanceQueueSize returns the instance queue size.
	InstanceQueueSize() int

	// SetQueueDropType sets the strategy for which metrics should metrics should be dropped when
	// the queue is full.
	SetQueueDropType(value DropType) Options

	// QueueDropType returns sets the strategy for which metrics should metrics should be dropped
	// when the queue is full.
	QueueDropType() DropType

	// SetMaxBatchSize sets the buffer limit that triggers a write of queued buffers.
	SetMaxBatchSize(value int) Options

	// MaxBatchSize returns the maximum buffer size that triggers a queue drain.
	MaxBatchSize() int

	// SetRWOptions sets RW options.
	SetRWOptions(value xio.Options) Options

	// RWOptions returns the RW options.
	RWOptions() xio.Options
}

type options struct {
	watcherOpts                placement.WatcherOptions
	clockOpts                  clock.Options
	instrumentOpts             instrument.Options
	encoderOpts                protobuf.UnaggregatedOptions
	m3msgOptions               M3MsgOptions
	connOpts                   ConnectionOptions
	rwOpts                     xio.Options
	shardFn                    sharding.ShardFn
	shardCutoffLingerDuration  time.Duration
	shardCutoverWarmupDuration time.Duration
	forceFlushEvery            time.Duration
	maxTimerBatchSize          int
	instanceQueueSize          int
	dropType                   DropType
	maxBatchSize               int
	flushWorkerCount           int
	aggregatorClientType       AggregatorClientType
}

// NewOptions creates a new set of client options.
func NewOptions() Options {
	return &options{
		clockOpts:                  clock.NewOptions(),
		instrumentOpts:             instrument.NewOptions(),
		encoderOpts:                protobuf.NewUnaggregatedOptions(),
		shardFn:                    sharding.DefaultHash.MustShardFn(),
		shardCutoverWarmupDuration: defaultShardCutoverWarmupDuration,
		shardCutoffLingerDuration:  defaultShardCutoffLingerDuration,
		watcherOpts:                placement.NewWatcherOptions(),
		connOpts:                   NewConnectionOptions(),
		flushWorkerCount:           defaultFlushWorkerCount,
		maxTimerBatchSize:          defaultMaxTimerBatchSize,
		instanceQueueSize:          defaultInstanceQueueSize,
		dropType:                   defaultDropType,
		maxBatchSize:               defaultMaxBatchSize,
		rwOpts:                     xio.NewOptions(),
	}
}

func (o *options) Validate() error {
	if o.rwOpts == nil {
		return errNoRWOpts
	}
	switch o.aggregatorClientType {
	case M3MsgAggregatorClient:
		opts := o.m3msgOptions
		if opts == nil {
			return errM3MsgClientNoOptions
		}
		return opts.Validate()
	case LegacyAggregatorClient:
		fallthrough // intentional, LegacyAggregatorClient is an alias
	case TCPAggregatorClient:
		if o.watcherOpts == nil {
			return errTCPClientNoWatcherOptions
		}
		return nil
	default:
		return fmt.Errorf("unknown client type: %v", o.aggregatorClientType)
	}
}

func (o *options) SetAggregatorClientType(value AggregatorClientType) Options {
	opts := *o
	opts.aggregatorClientType = value
	return &opts
}

func (o *options) AggregatorClientType() AggregatorClientType {
	return o.aggregatorClientType
}

func (o *options) SetM3MsgOptions(value M3MsgOptions) Options {
	opts := *o
	opts.m3msgOptions = value
	return &opts
}

func (o *options) M3MsgOptions() M3MsgOptions {
	return o.m3msgOptions
}

func (o *options) SetClockOptions(value clock.Options) Options {
	opts := *o
	opts.clockOpts = value
	return &opts
}

func (o *options) ClockOptions() clock.Options {
	return o.clockOpts
}

func (o *options) SetInstrumentOptions(value instrument.Options) Options {
	opts := *o
	opts.instrumentOpts = value
	return &opts
}

func (o *options) InstrumentOptions() instrument.Options {
	return o.instrumentOpts
}

func (o *options) SetEncoderOptions(value protobuf.UnaggregatedOptions) Options {
	opts := *o
	opts.encoderOpts = value
	return &opts
}

func (o *options) EncoderOptions() protobuf.UnaggregatedOptions {
	return o.encoderOpts
}

func (o *options) SetShardFn(value sharding.ShardFn) Options {
	opts := *o
	opts.shardFn = value
	return &opts
}

func (o *options) ShardFn() sharding.ShardFn {
	return o.shardFn
}

func (o *options) SetShardCutoverWarmupDuration(value time.Duration) Options {
	opts := *o
	opts.shardCutoverWarmupDuration = value
	return &opts
}

func (o *options) ShardCutoverWarmupDuration() time.Duration {
	return o.shardCutoverWarmupDuration
}

func (o *options) SetShardCutoffLingerDuration(value time.Duration) Options {
	opts := *o
	opts.shardCutoffLingerDuration = value
	return &opts
}

func (o *options) ShardCutoffLingerDuration() time.Duration {
	return o.shardCutoffLingerDuration
}

func (o *options) SetWatcherOptions(value placement.WatcherOptions) Options {
	opts := *o
	opts.watcherOpts = value
	return &opts
}

func (o *options) WatcherOptions() placement.WatcherOptions {
	return o.watcherOpts
}

func (o *options) SetConnectionOptions(value ConnectionOptions) Options {
	opts := *o
	opts.connOpts = value
	return &opts
}

func (o *options) ConnectionOptions() ConnectionOptions {
	return o.connOpts
}

func (o *options) SetFlushWorkerCount(value int) Options {
	opts := *o
	opts.flushWorkerCount = value
	return &opts
}

func (o *options) FlushWorkerCount() int {
	return o.flushWorkerCount
}

func (o *options) SetForceFlushEvery(value time.Duration) Options {
	opts := *o
	opts.forceFlushEvery = value
	return &opts
}

func (o *options) ForceFlushEvery() time.Duration {
	return o.forceFlushEvery
}

func (o *options) SetMaxTimerBatchSize(value int) Options {
	opts := *o
	opts.maxTimerBatchSize = value
	return &opts
}

func (o *options) MaxTimerBatchSize() int {
	return o.maxTimerBatchSize
}

func (o *options) SetInstanceQueueSize(value int) Options {
	opts := *o
	opts.instanceQueueSize = value
	return &opts
}

func (o *options) InstanceQueueSize() int {
	return o.instanceQueueSize
}

func (o *options) SetQueueDropType(value DropType) Options {
	opts := *o
	opts.dropType = value
	return &opts
}

func (o *options) QueueDropType() DropType {
	return o.dropType
}

func (o *options) SetMaxBatchSize(value int) Options {
	opts := *o
	if value < 0 {
		value = defaultMaxBatchSize
	}
	opts.maxBatchSize = value

	return &opts
}

func (o *options) MaxBatchSize() int {
	return o.maxBatchSize
}

func (o *options) SetRWOptions(value xio.Options) Options {
	opts := *o
	opts.rwOpts = value
	return &opts
}

func (o *options) RWOptions() xio.Options {
	return o.rwOpts
}


text:
@online{rbates14,
author = 	{Richard Bates},
title = 	{Travels with applied geophysics - Dendrochronology Glen Affric, 2014},
year = 		{2014},
url =  		{http://geophysicistatlarge.blogspot.co.uk/search/label/dendrochronology},
urldate = 	{2017-02-08},
addendum = 	{\\ \vspace{5pt} \hspace{10pt} This blog talks about a
            previous use of the boats, under remote control, that are to be
            used in this project. \vspace{5pt}}
}

@online{mmp,
author = 	{Mark Neal},
title =		{Major/Minor Project (MMP) Info for 2016-2017},
year = 		{2017},
url = 		{https://teaching.dcs.aber.ac.uk/mmp/#mjn},
urldate = 	{2017-02-08},
addendum = 	{\\ \vspace{5pt} \hspace{10pt} whats this? \vspace{5pt}}
}

license: MIT

license_type: permissive

branch_name: refs/heads/master

extension: bib


text:
package impl

import (
	"context"

	"github.com/filecoin-project/go-address"
	"github.com/filecoin-project/go-state-types/abi"

	"github.com/filecoin-project/venus-miner/miner"
	"github.com/filecoin-project/venus-miner/node/impl/common"
	"github.com/filecoin-project/venus-miner/node/modules/dtypes"
	"github.com/filecoin-project/venus-miner/node/modules/minermanage"
)

type MinerAPI struct {
	common.CommonAPI

	MinerManager minermanage.MinerManageAPI
	miner.MiningAPI
}

func (m *MinerAPI) UpdateAddress(ctx context.Context, skip int64, limit int64) ([]dtypes.MinerInfo, error) {

	return m.MiningAPI.UpdateAddress(ctx, skip, limit)
}

func (m *MinerAPI) ListAddress(ctx context.Context) ([]dtypes.MinerInfo, error) {
	return m.MiningAPI.ListAddress(ctx)
}

func (m *MinerAPI) StatesForMining(ctx context.Context, addrs []address.Address) ([]dtypes.MinerState, error) {
	return m.MiningAPI.StatesForMining(ctx, addrs)
}

func (m *MinerAPI) CountWinners(ctx context.Context, addrs []address.Address, start abi.ChainEpoch, end abi.ChainEpoch) ([]dtypes.CountWinners, error) {
	return m.MiningAPI.CountWinners(ctx, addrs, start, end)
}

func (m *MinerAPI) Start(ctx context.Context, addrs []address.Address) error {
	return m.MiningAPI.ManualStart(ctx, addrs)
}

func (m *MinerAPI) Stop(ctx context.Context, addrs []address.Address) error {
	return m.MiningAPI.ManualStop(ctx, addrs)
}

func (s *MinerAPI) AddAddress(ctx context.Context, mi dtypes.MinerInfo) error {
	return s.MiningAPI.AddAddress(ctx, mi)
}

extension: go


text:
package gui

import (
	"image"
	"image/draw"
	"sync"
)

type Mux struct {
	mu        sync.Mutex
	eventsIns []chan<- Event
	draw      chan<- func(draw.Image) image.Rectangle
}

func NewMux(env Env) (mux *Mux, master Env) {
	drawChan := make(chan func(draw.Image) image.Rectangle)
	mux = &Mux{draw: drawChan}
	master = mux.makeEnv(true)

	go func() {
		for d := range drawChan {
			env.Draw() <- d
		}
		close(env.Draw())
	}()

	go func() {
		for e := range env.Events() {
			mux.mu.Lock()
			for _, eventsIn := range mux.eventsIns {
				eventsIn <- e
			}
			mux.mu.Unlock()
		}
		mux.mu.Lock()
		for _, eventsIn := range mux.eventsIns {
			close(eventsIn)
		}
		mux.mu.Unlock()
	}()

	return mux, master
}

func (mux *Mux) MakeEnv() Env {
	return mux.makeEnv(false)
}

type muxEnv struct {
	events <-chan Event
	draw   chan<- func(draw.Image) image.Rectangle
}

func (m *muxEnv) Events() <-chan Event                          { return m.events }
func (m *muxEnv) Draw() chan<- func(draw.Image) image.Rectangle { return m.draw }

func (mux *Mux) makeEnv(master bool) Env {
	eventsOut, eventsIn := MakeEventsChan()
	drawChan := make(chan func(draw.Image) image.Rectangle)
	env := &muxEnv{eventsOut, drawChan}

	mux.mu.Lock()
	mux.eventsIns = append(mux.eventsIns, eventsIn)
	mux.mu.Unlock()

	go func() {
		func() {
			// When the master Env gets its Draw() channel closed, it closes all the Events()
			// channels of all the children Envs, and it also closes the internal draw channel
			// of the Mux. Otherwise, closing the Draw() channel of the master Env wouldn't
			// close the Env the Mux is muxing. However, some child Envs of the Mux may still
			// send some drawing commmands before they realize that their Events() channel got
			// closed.
			//
			// That is perfectly fine if their drawing commands simply get ignored. This down here
			// is a little hacky, but (I hope) perfectly fine solution to the problem.
			//
			// When the internal draw channel of the Mux gets closed, the line marked with ! will
			// cause panic. We recover this panic, then we receive, but ignore all furhter draw
			// commands, correctly draining the Env until it closes itself.
			defer func() {
				if recover() != nil {
					for range drawChan {
					}
				}
			}()
			for d := range drawChan {
				mux.draw <- d // !
			}
		}()
		if master {
			mux.mu.Lock()
			for _, eventsIn := range mux.eventsIns {
				close(eventsIn)
			}
			mux.eventsIns = nil
			close(mux.draw)
			mux.mu.Unlock()
		} else {
			mux.mu.Lock()
			i := -1
			for i = range mux.eventsIns {
				if mux.eventsIns[i] == eventsIn {
					break
				}
			}
			if i != -1 {
				mux.eventsIns = append(mux.eventsIns[:i], mux.eventsIns[i+1:]...)
			}
			mux.mu.Unlock()
		}
	}()

	return env
}

repository: isgasho/gui

repo_name: isgasho/gui


text:
package local

import (
	"fmt"
	"strings"
	"testing"

	"github.com/scootdev/scoot/os/temp"
	"github.com/scootdev/scoot/runner"
	"github.com/scootdev/scoot/runner/execer/execers"
	"github.com/scootdev/scoot/runner/runners"
	"github.com/scootdev/scoot/snapshot/snapshots"
)

const errorMsgFromRunner = "Error in fakeRunner Run()"

// Send a run request that pauses, then another run request.
// Verify that the status of the first run request is running, and
// the status of the second request is queued.
// Then send a signal to allow the first (paused) run request to finish.
// Wait that all are run
func TestQueueing2Messages(t *testing.T) {
	env := setup(10, t)
	defer env.teardown()
	qr := env.qr

	// send the first command - it should pause
	run1 := assertRun(t, qr, running(), "pause", "complete 0")
	run2 := assertRun(t, qr, pending(), "complete 1")
	env.sim.Resume()
	assertWait(t, qr, run1, complete(0), "n/a")
	assertWait(t, qr, run2, complete(1), "n/a")
}

func TestQueueingMoreThanMaxMessage(t *testing.T) {
	env := setup(4, t)
	defer env.teardown()
	qr := env.qr

	var runIDs []runner.RunId

	// block the runner
	runID := assertRun(t, qr, running(), "pause", "complete 0")
	runIDs = append(runIDs, runID)

	// fill the queue
	for i := 0; i < 4; i++ {
		runID := assertRun(t, qr, pending(), "complete 0")
		runIDs = append(runIDs, runID)
	}

	// overflow
	_, err := qr.Run(&runner.Command{Argv: []string{"complete 5"}})
	if err == nil || strings.Compare(QueueFullMsg, err.Error()) != 0 {
		t.Fatal("Should not be able to schedule: ", err)
	}

	// resume
	env.sim.Resume()

	// drain
	for _, id := range runIDs {
		assertWait(t, qr, id, complete(0), "n/a")
	}

	// repeat
	runID = assertRun(t, qr, running(), "pause", "complete 0")
	runIDs = append(runIDs, runID)
	for i := 0; i < 4; i++ {
		runID := assertRun(t, qr, pending(), "complete 0")
		runIDs = append(runIDs, runID)
	}
	_, err = qr.Run(&runner.Command{Argv: []string{"complete 5"}})
	if err == nil || strings.Compare(QueueFullMsg, err.Error()) != 0 {
		t.Fatal("Should not be able to schedule: ", err)
	}
	env.sim.Resume()
	for _, id := range runIDs {
		assertWait(t, qr, id, complete(0), "n/a")
	}
}

func TestUnknownRunIdInStatusRequest(t *testing.T) {
	env := setup(4, t)
	defer env.teardown()
	qr := env.qr

	st, err := qr.Status(runner.RunId("not a real run id"))
	if err == nil || !strings.Contains(err.Error(), UnknownRunIdMsg) {
		t.Fatal("Should not be able to get status", err, st)
	}
}

func TestRunnerReturningAnErrorOnRunRequest(t *testing.T) {
	env := setup(4, t)
	defer env.teardown()
	qr := env.qr

	// fill the queue
	_ = assertRun(t, qr, running(), "pause", "complete 0")
	run2 := assertRun(t, qr, pending(), "complete 0")
	run3 := assertRun(t, qr, pending(), "complete 0")
	run4 := assertRun(t, qr, pending(), "complete 0")
	run5 := assertRun(t, qr, pending(), "complete 0")

	// Now kill the connection to the runner
	env.chaos.SetError(fmt.Errorf("can't even"))
	env.sim.Resume()
	// The next line will fail because we can't talk to the underlying
	// Runner anymore
	// assertWait(t, qr, run1, complete(0), "n/a")
	assertWait(t, qr, run2, failed("can't even"))
	assertWait(t, qr, run3, failed("can't even"))
	assertWait(t, qr, run4, failed("can't even"))
	assertWait(t, qr, run5, failed("can't even"))
}

func TestStatus(t *testing.T) {
	env := setup(4, t)
	defer env.teardown()
	qr := env.qr

	// We want to get lots of runs with statuses in different places:
	// *) in the queue
	// *) in errored (because delegate refuses it)
	// *) in errored (because it was aborted while in the queue)
	// *) in delegate (running, aborted, and complete)

	env.chaos.SetError(fmt.Errorf("can't even"))
	run1 := assertRun(t, qr, failed("can't even"), "complete 5")
	env.chaos.SetError(nil)
	// run1 is in errored (because delegate refused it)
	assertWait(t, qr, run1, failed("can't even"))

	run2 := assertRun(t, qr, running(), "pause", "complete 1")
	run3 := assertRun(t, qr, pending(), "complete 0")
	run4 := assertRun(t, qr, pending(), "complete 0")
	run5 := assertRun(t, qr, pending(), "complete 0")

	// run5 is in errored (because it was aborted while in the queue)
	if _, err := qr.Abort(run5); err != nil {
		t.Fatal(err)
	}
	assertWait(t, qr, run5, aborted())

	if _, err := qr.Abort(run2); err != nil {
		t.Fatal(err)
	}
	// run2 is delegated (aborted)
	assertWait(t, qr, run2, aborted())

	// run3 and 4 are in delegate, complete
	assertWait(t, qr, run3, complete(0))
	assertWait(t, qr, run4, complete(0))

	// run6 is in delegate, running
	run6 := assertRun(t, qr, running(), "pause", "complete 2")

	// run7 and 8 are in queue
	run7 := assertRun(t, qr, pending(), "complete 0")
	run8 := assertRun(t, qr, pending(), "complete 0")

	all, err := qr.StatusAll()
	if err != nil {
		t.Fatal(err)
	}

	// How do we check the result of StatusAll?
	// We've already waited for each status to be correct, so we trust that.
	// So, for each status in StatusAll, we'll call Status on its ID and error if not equal
	for _, st := range all {
		st2, err := qr.Status(st.RunId)
		if err != nil {
			t.Fatal(err)
		}
		if st != st2 {
			t.Fatalf("status for id %v unequal: %v vs %v", st.RunId, st, st2)
		}
	}

	env.sim.Resume()
	assertWait(t, qr, run6, complete(2))
	assertWait(t, qr, run7, complete(0))
	assertWait(t, qr, run8, complete(0))
}

func setup(size int, t *testing.T) *env {
	runnerAvailableCh := make(chan struct{}, 1)

	sim := execers.NewSimExecer()
	tempDir, err := temp.TempDirDefault()
	if err != nil {
		t.Fatalf("Test setup() failed getting temp dir:%s", err.Error())
	}

	outputCreator, err := NewOutputCreator(tempDir)
	if err != nil {
		t.Fatalf("Test setup() failed getting output creator:%s", err.Error())
	}
	sr := NewSimpleReportBackRunner(sim, snapshots.MakeInvalidFiler(), outputCreator, runnerAvailableCh)
	chaos := runners.NewChaosRunner(sr)
	qr := NewQueuingRunner(chaos, size, runnerAvailableCh).(*QueueingRunner)

	return &env{chaos: chaos, sim: sim, qr: qr, sr: sr}
}

type env struct {
	chaos *runners.ChaosRunner
	sim   *execers.SimExecer
	qr    *QueueingRunner
	sr    *simpleRunner
}

func (t *env) teardown() {
	t.sr.Close()
	t.qr.Close()
}

repository: JieGhost/scoot

repo_name: JieGhost/scoot

gha_language: Go


text:
// Copyright © 2016 Samsung CNCT
//
// 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 cmd

import (
	"github.com/spf13/cobra"
	"os"
)

var k2Config string

// toolCmd represents the tool command
var toolCmd = &cobra.Command{
	Use:   "tool",
	Short: "Use tools with k2 cluster",
	Long: `Use various third-party tools with a
	k2 cluster configured by specified yaml`,
	Run: func(cmd *cobra.Command, args []string) {
		cmd.Usage()
		ExitCode = 1
	},
}

func init() {
	RootCmd.AddCommand(toolCmd)
	toolCmd.PersistentFlags().StringVarP(
		&k2Config,
		"config",
		"c",
		os.ExpandEnv("$HOME/.kraken/config.yaml"),
		"Location of the k2config")
}


text:
package appField

import (
	"fmt"
	"sort"
)

// a structure represents one app info field (app name, dev name, ..)t
type AppField int

const (
	AllFields AppField = iota
	AppID
	AppUrl
	IconUrls
	AppName
	DevName
	DevPageUrl
	Category

	// TODO,
	//SecCategory

	InAppOffering

	// TODO,
	//ContainsAds
	//OffersInAppPurchases

	Price
	VideoTrailerUrls
	ScreenShotsUrls
	Description
	Rating
	RatingCount
	RatingHistogram
	WhatsNew

	// TODO,
	//LastUpdated
	//Size
	//NumOfDownloads
	//AppVer
	//MinAndroidVer
	//AgeRating
)

// ValidateAppFields checks if the provided AppField array contains only valid instances,
// and if not it will return an error.
// this function never returns an empty array (except with an non-nil error).
func ValidateAppFields(fields []AppField) ([]AppField, error) {
	// if no fields are provided, then retrieve all the fields.
	if len(fields) == 0 {
		return valuesArr[1:], nil
	}

	sort.Stable(appFields(fields))

	var retFields = []AppField{fields[0]}
	for _, f := range fields {
		if !isValidAppField(f) {
			return nil, fmt.Errorf("error validating the required app fields: unsupported app field")
		}

		// remove duplicate fields
		if f != retFields[len(retFields)-1] {
			retFields = append(retFields, f)
		}
	}

	// if the AllFields value is provided, then populate the returned array with all the fields.
	if fields[0] == AllFields {
		return valuesArr[1:], nil
	}

	return retFields, nil
}

// internal type used for implementing sorting
type appFields []AppField

func (f appFields) Len() int           { return len(f) }
func (f appFields) Less(i, j int) bool { return f[i] < f[j] }
func (f appFields) Swap(i, j int)      { f[i], f[j] = f[j], f[i] }

var valuesArr = []AppField{
	AllFields, AppID, AppUrl, IconUrls, AppName, DevName, DevPageUrl, Category, InAppOffering, Price,
	VideoTrailerUrls, ScreenShotsUrls, Description, Rating, RatingCount, RatingHistogram, WhatsNew,
}

func isValidAppField(f AppField) bool {
	for _, v := range valuesArr {
		if v == f {
			return true
		}
	}
	return false
}

repository: asmsh/go-playstore-scraper

repo_name: asmsh/go-playstore-scraper

branch_name: refs/heads/beta

gha_license_id: MIT


text:
require fvp-envelope.inc

SUMMARY = "Arm Fixed Virtual Platform - Armv8-R Base Architecture Envelope Model FVP"
LIC_FILES_CHKSUM = "file://license_terms/license_agreement.txt;md5=1a33828e132ba71861c11688dbb0bd16 \
                    file://license_terms/third_party_licenses/third_party_licenses.txt;md5=34a1ba318d745f05e6197def68ea5411 \
                    file://license_terms/third_party_licenses/arm_license_management_utilities/third_party_licenses.txt;md5=c09526c02e631abb95ad61528892552d"

SRC_URI[fvp-x86_64.sha256sum] = "e819bfbccd91749345e3c7c6db22cbe41e02223118eb6395a4307ca81b175f7a"

MODEL_CODE = "FVP_Base_AEMv8R"

repository: openbmc/openbmc

repo_name: openbmc/openbmc

gha_license_id: NOASSERTION

gha_language: Python

extension: bb


text:
@inproceedings{druga2018smart,
  title={How smart are the smart toys? children and parents' agent interaction and intelligence attribution},
  author={Druga, Stefania and Williams, Randi and Park, Hae Won and Breazeal, Cynthia},
  booktitle={Proceedings of the 17th ACM Conference on Interaction Design and Children},
  pages={231--240},
  year={2018}
}

@inproceedings{druga2017hey,
  title={" Hey Google is it OK if I eat you?" Initial Explorations in Child-Agent Interaction},
  author={Druga, Stefania and Williams, Randi and Breazeal, Cynthia and Resnick, Mitchel},
  booktitle={Proceedings of the 2017 Conference on Interaction Design and Children},
  pages={595--600},
  year={2017}
}

@inproceedings{williams2018my,
  title={" My doll says it's ok" a study of children's conformity to a talking doll},
  author={Williams, Randi and Machado, Christian V{\'a}zquez and Druga, Stefania and Breazeal, Cynthia and Maes, Pattie},
  booktitle={Proceedings of the 17th ACM Conference on Interaction Design and Children},
  pages={625--631},
  year={2018}
}

@phdthesis{druga2018growing,
  title={Growing up with AI: Cognimates: from coding to teaching machines},
  author={Druga, Stefania},
  year={2018},
  school={Massachusetts Institute of Technology}
}

@incollection{druga2019inclusive,
  title={Inclusive AI literacy for kids around the world},
  author={Druga, Stefania and Vu, Sarah T and Likhith, Eesh and Qiu, Tammy},
  booktitle={Proceedings of FabLearn 2019},
  pages={104--111},
  year={2019}
}

@article{druga2019co,
  title={Co-designing inclusive and equitable intelligent systems with and for kids around the world},
  author={Druga, Stefania},
  journal={Journal of Design and Science},
  year={2019},
  publisher={PubPub}
}

@inproceedings{druga2017motif,
  title={Motif: a wearable sonic cueing device for memory support and cognitive intervention},
  author={Druga, Stefania and Maes, Pattie and Rieger, Alexandra},
  booktitle={Proceedings of the 2017 ACM International Symposium on Wearable Computers},
  pages={180--185},
  year={2017}
}

gha_language: HTML


text:
@techreport{koussaifi:hal-03120776,
 author = {Koussaifi, Maroun and Arcangeli, Jean-Paul and Trouilhet, Sylvie and Bruel, Jean-Michel},
 hal_id = {hal-03120776},
 hal_version = {v1},
 institution = {IRIT - Institut de Recherche en Informatique de Toulouse},
 keywords = {Ambient systems , model-driven engineering , user in the loop , software composition , service composition , service description , emergent software},
 month = {May},
 number = {IRIT/RR--2020--06--FR},
 pdf = {https://hal.archives-ouvertes.fr/hal-03120776/file/IRIT_RR_2020_06_FR.pdf},
 title = {Putting the End-User in the Loop in Smart Ambient Systems: an Approach based on Model-Driven Engineering},
 type = {Research Report},
 url = {https://hal.archives-ouvertes.fr/hal-03120776},
 year = {2020}
}

gha_language: TeX


text:
require genromfs.inc

SRCREV = "3b02d7a"
PV = "0.0+git${SRCREV}"
PR = "${INC_PR}.0"

SRC_URI = "git://github.com/chexum/genromfs;protocol=git;branch=master"
S = "${WORKDIR}/git"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
package entities

type Role struct {
	ID int64 `json:"id_role" gorm:"column:id_role"`
	NamaRole string `json:"nama_role"`
	Status bool `json:"status"`
	CreateAt string `json:"create_at"`
	UpdateAt string `json:"update_at"`
}

func (e *Role) TableName() string {
	return "tb_role"
}

branch_name: refs/heads/main


text:
package aaa

import "github.com/valyala/fasthttp"

func recovery(next func(ctx *fasthttp.RequestCtx)) func(ctx *fasthttp.RequestCtx) {
	return func(ctx *fasthttp.RequestCtx) {
		defer func() {
			if rvr := recover(); rvr != nil {
				ctx.Error("recover", 500)
			}
		}()
		next(ctx)
	}
}

repository: netkey/goums

repo_name: netkey/goums


text:
require x11-apps.inc

DESCRIPTION = "a text pager"

LIC_FILES_CHKSUM = "file://COPYING;md5=4641deddaa80fe7ca88e944e1fd94a94"

S = "${DEBIAN_UNPACK_DIR}/xmore"

repository: manut/meta-combo

repo_name: manut/meta-combo

branch_name: refs/heads/morty

gha_language: BitBake


text:
# find or download AngelScript SDK

if (${FG_EXTERNALS_USE_PREBUILD} AND ${FG_ENABLE_ANGELSCRIPT})
	add_library( "AngelScript-lib" INTERFACE )
	target_include_directories( "AngelScript-lib" INTERFACE "${FG_EXTERNAL_PREBUILD_PATH}/angelscript/include" )
	target_compile_definitions( "AngelScript-lib" INTERFACE "FG_ENABLE_ANGELSCRIPT" )
	set_property( TARGET "AngelScript-lib" PROPERTY INTERFACE_LINK_LIBRARIES
		"${FG_EXTERNAL_PREBUILD_PATH}/angelscript/lib/${CMAKE_STATIC_LIBRARY_PREFIX}angelscript${CMAKE_STATIC_LIBRARY_SUFFIX}"
		"${FG_EXTERNAL_PREBUILD_PATH}/angelscript/lib/${CMAKE_STATIC_LIBRARY_PREFIX}angelscript_stdstring${CMAKE_STATIC_LIBRARY_SUFFIX}"
		"${FG_EXTERNAL_PREBUILD_PATH}/angelscript/lib/${CMAKE_STATIC_LIBRARY_PREFIX}angelscript_stdvector${CMAKE_STATIC_LIBRARY_SUFFIX}" )

elseif (${FG_ENABLE_ANGELSCRIPT})
	set( FG_EXTERNAL_ANGELSCRIPT_PATH "" CACHE PATH "path to AngelScript SDK" )
	mark_as_advanced( FG_EXTERNAL_ANGELSCRIPT_PATH )

	# reset to default
	if (NOT EXISTS "${FG_EXTERNAL_ANGELSCRIPT_PATH}/angelscript/projects/cmake/CMakeLists.txt")
		message( STATUS "AngelScript SDK is not found in \"${FG_EXTERNAL_ANGELSCRIPT_PATH}\"" )
		set( FG_EXTERNAL_ANGELSCRIPT_PATH "${FG_EXTERNALS_PATH}/AngelScript" CACHE PATH "" FORCE )
	else ()
		message( STATUS "AngelScript SDK found in \"${FG_EXTERNAL_ANGELSCRIPT_PATH}\"" )
	endif ()

	if (NOT EXISTS "${FG_EXTERNAL_ANGELSCRIPT_PATH}/angelscript/projects/cmake/CMakeLists.txt")
		set( FG_ANGELSCRIPT_DOWNLOAD_LINK "https://www.angelcode.com/angelscript/sdk/files/angelscript_2.33.0.zip" )
	else ()
		set( FG_ANGELSCRIPT_DOWNLOAD_LINK "" )
	endif ()

	set( FG_ANGELSCRIPT_INSTALL_DIR "${FG_EXTERNALS_INSTALL_PATH}/angelscript" )

	ExternalProject_Add( "External.AngelScript"
		LIST_SEPARATOR		"${FG_LIST_SEPARATOR}"
		LOG_OUTPUT_ON_FAILURE 1
		# download
		URL					"${FG_ANGELSCRIPT_DOWNLOAD_LINK}"
		DOWNLOAD_DIR		"${FG_EXTERNAL_ANGELSCRIPT_PATH}"
		LOG_DOWNLOAD		1
		# update
		PATCH_COMMAND		${CMAKE_COMMAND} -E copy
							${CMAKE_FOLDER}/angelscript_CMakeLists.txt
							${FG_EXTERNAL_ANGELSCRIPT_PATH}/CMakeLists.txt
		UPDATE_DISCONNECTED	1
		# configure
		SOURCE_DIR			"${FG_EXTERNAL_ANGELSCRIPT_PATH}"
		CMAKE_GENERATOR		"${CMAKE_GENERATOR}"
		CMAKE_GENERATOR_PLATFORM "${CMAKE_GENERATOR_PLATFORM}"
		CMAKE_GENERATOR_TOOLSET	"${CMAKE_GENERATOR_TOOLSET}"
		CMAKE_ARGS			"-DCMAKE_CONFIGURATION_TYPES=${FG_EXTERNAL_CONFIGURATION_TYPES}"
							"-DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION}"
							"-DCMAKE_DEBUG_POSTFIX="
							"-DCMAKE_RELEASE_POSTFIX="
							"-DCMAKE_INSTALL_PREFIX=${FG_ANGELSCRIPT_INSTALL_DIR}"
							${FG_BUILD_TARGET_FLAGS}
		LOG_CONFIGURE 		1
		# build
		BINARY_DIR			"${CMAKE_BINARY_DIR}/build-AngelScript"
		BUILD_COMMAND		${CMAKE_COMMAND}
							--build .
							--target ALL_BUILD
							--config $<CONFIG>
		LOG_BUILD 			1
		# install
		INSTALL_DIR 		"${FG_ANGELSCRIPT_INSTALL_DIR}"
		LOG_INSTALL 		1
		# test
		TEST_COMMAND		""
	)

	set_property( TARGET "External.AngelScript" PROPERTY FOLDER "External" )

	add_library( "AngelScript-lib" INTERFACE )
	target_include_directories( "AngelScript-lib" INTERFACE "${FG_ANGELSCRIPT_INSTALL_DIR}/include" )
	target_compile_definitions( "AngelScript-lib" INTERFACE "FG_ENABLE_ANGELSCRIPT" )
	add_dependencies( "AngelScript-lib" "External.AngelScript" )
	set_property( TARGET "AngelScript-lib" PROPERTY INTERFACE_LINK_LIBRARIES
		"${FG_ANGELSCRIPT_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}angelscript${CMAKE_STATIC_LIBRARY_SUFFIX}"
		"${FG_ANGELSCRIPT_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}angelscript_stdstring${CMAKE_STATIC_LIBRARY_SUFFIX}"
		"${FG_ANGELSCRIPT_INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}angelscript_stdvector${CMAKE_STATIC_LIBRARY_SUFFIX}" )

endif ()

repository: azhirnov/FrameGraph

repo_name: azhirnov/FrameGraph

branch_name: refs/heads/dev

extension: cmake


text:
[Unit]
Description=Auto control fan according to SoC temperature
DefaultDependencies=no
Wants=local-fs.target
ConditionPathExists=@CMAKE_INSTALL_PREFIX@/bin/fanctl

[Service]
Type=idle
ExecStart=@CMAKE_INSTALL_PREFIX@/bin/fanctl
KillSignal=SIGINT
User=pi
Group=pi

[Install]
WantedBy=multi-user.target

repository: JokerQyou/fanctl

repo_name: JokerQyou/fanctl


text:
# this recipe is only intended for specific users, so don't choose it by default
DEFAULT_PREFERENCE = "-1"

RELEASE = "TIP_FW_L0_0.4.5_L1_0.3.4_GOOGLE"

SRC_URI[bin.sha256sum] = "bca18be4484d02f2c881e1078aff6cfc323f620e02e3508dcff965aadd841110"

require npcm8xx-tip-fw.inc

repository: daleghent/openbmc

repo_name: daleghent/openbmc


text:
%% This BibTeX bibliography file was created using BibDesk.
%% http://bibdesk.sourceforge.net/
%% Created for Ariel Meilij at 2017-10-11 21:36:39 -0500
%% Saved with string encoding Unicode (UTF-8)

@book{shaiShai,
	Address = {New York, USA},
	Author = {Shai Shalev-Shwartz and Shai Ben-David},
	Date-Added = {2017-10-12 02:22:56 +0000},
	Date-Modified = {2017-10-12 02:23:59 +0000},
	Publisher = {Cambridge University Press},
	Title = {Understanding Machine Learning},
	Year = {2014},
	}

@book{blumHopcroft,
	Address = {New York, USA},
	Author = {Avrim Blum and John Hopcroft and Ravindran Kannan},
	Date-Added = {2017-10-12 02:15:11 +0000},
	Date-Modified = {2017-10-12 02:17:12 +0000},
	Publisher = {Cornell University},
	Title = {Foundations of Data Science},
	Year = {2016},
    }

@book{efronHastie,
	Address = {Cambridge, USA},
	Author = {Bradley Efron and Trevor Hastie},
	Date-Added = {2017-10-12 02:11:09 +0000},
	Date-Modified = {2017-10-12 02:13:04 +0000},
	Publisher = {Cambridge University Press},
	Title = {Computer Age Statistical Inference},
	Year = {2016},
	}

@article{mercadoDerivados,
	Author = {Nathali Alvarado and Juan Robayo and Juan Moreno},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Journal = {Borradores de Economia},
	Keywords = {Derivados, cobertura cambiaria, devaluaci{\'o}n impl{\'\i}cita, forwards, opciones, paridad, riesgo cambiario.},
	Number = {860},
	Pages = {2-46},
	Title = {Caracterizaci{\'o}n del Mercado de Derivados Cambiarios en Colombia},
	Year = {2014},
	}

@techreport{futurosTRM,
	Author = {Nicolas Mayorga},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Institution = {Bolsa de Valores de Colombia},
	Title = {Futuros de TRM},
	Year = {2010},
	}

@article{rengifo,
	Author = {John Jairo Rengifo},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Journal = {Gestion y Desarrollo},
	Keywords = {Derivatives, futures, forward contracts, short position, long position.},
	Month = {July},
	Number = {2},
	Pages = {123-133},
	Title = {Registro Contable de Futuros y Contratos a Plazo},
	Volume = {6},
	Year = {2009},
	}

@article{bonanzaCrisis,
	Author = {Ligia Melo-Becerra and Enrique Ramos-Forero and Ligia Parrado-Galvis and H{\'e}ctor Zarate-Solano},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Journal = {Borradores de Economia},
	Keywords = {Petr{\'o}leo, Finanzas Publicas Colombia, PCT-VAR.},
	Number = {961},
	Pages = {1-32},
	Title = {Bonanza y Crisis Petrolera y su Efecto sobre la Economia Colombiana},
	Year = {2016},
	}

@manual{packageForecast,
	Address = {Melbourne Australia},
	Author = {Robert Hyndman},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Organization = {CRAN},
	Title = {Forecasting Functions for Time Series and Linear Models},
	Year = {2016},
	}

@article{grangerEngle,
	Author = {Robert Engle and Clive Granger},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Journal = {The Royal Swedish Academy of Sciences},
	Month = {October},
	Pages = {2-30},
	Title = {Time Series Econometrics: Cointegration and Autoregressive Conditional Heteroskedasticity},
	Year = {2003},
	}

@unpublished{theodosiouSwamy,
	Author = {Marina Theodosiou and Murali Swamy},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Note = {Imperial College of South Kensington, UK},
	Title = {A Hybrid Forecasting Approach: Structural Decomposition, Generalized Regression Neural Networks and Theta Method},
	}

@article{dickeyfuller,
	Author = {David Dickey and Wayne Fuller},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Journal = {Econometrica},
	Month = {July},
	Number = {4},
	Pages = {1057-1072},
	Title = {Likelihood Ratio Statistics for Autoregressive Time Series with a Unit Root},
	Volume = {49},
	Year = {1981},
	}

@article{yuWangLai,
	Author = {Lean Yu and Shouyang Wang and KK Lai},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Journal = {Computers and Operations Research},
	Number = {32},
	Pages = {2523-2541},
	Title = {A novel nonlinear ensemble forecasting model incorporating GLAR andANN for foreign exchange rates},
	Year = {2005},
}

@article{talebiHoang,
	Author = {Hossein Talebi and Winsor Hoang and Marina Gavrilova},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Journal = {Procedia Computer Science},
	Pages = {2065-2075},
	Title = {Multi-Scale Foreign Exchange Rates Ensemble for Classification of Trends in Forex Market},
	Volume = {29},
	Year = {2014},
}

@article{rehmanKhanMahmud,
	Author = {Mehreen Rehman and Gul Muhammad Khan and Sahibzada Mahmud},
	Booktitle = {2014 International Conference on Future Information Engineering},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Editor = {Elvesier},
	Journal = {IERI Procedia},
	Organization = {IERI Procedia},
	Pages = {239-244},
	Publisher = {Elvesier},
	Title = {Foreign Currency Exchange Rates Prediction using CGP and Recurrent Neural Network},
	Volume = {10},
	Year = {2014},
}

@unpublished{dietterich,
	Author = {Thomas Dietterich},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Note = {Oregon State University},
	Title = {Ensemble Methods in Machine Learning},
}

@article{popularEnsemble,
	Author = {David Opitz and Richard Maclin},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Journal = {Journal of Artificial Intelligence Research},
	Keywords = {ensemble methods},
	Pages = {169-198},
	Title = {Popular Ensemble Methods: An Empirical Study},
	Volume = {II},
	Year = {1999},
}

@book{daume,
	Address = {Maryland, USA},
	Author = {Hal Daume},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {University of Maryland},
	Title = {A Course in Machine Learning},
	Year = {2013}}

@book{intoStats7,
	Address = {Willimantic, USA},
	Author = {Prem S. Mann and Christopher Jay Lacke},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Wiley},
	Title = {Introductory Statistics},
	Year = {2010},
}

@book{thinkStats,
	Address = {Massachusetts, USA},
	Author = {Allen B. Downey},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Green Tea Press},
	Title = {Think Stats},
	Year = {2014},
}

@book{yakir,
	Address = {Jerusalem, Israel},
	Author = {Benjamin Yakir},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {The Hebrew University},
	Title = {Introduction to Statistical Thinking (With R, Without Calculus)},
	Year = {2011},
}

@book{experienciasExportadoras,
	Author = {Adolfo Meisel Roca and Joaquin Viloria de la Hoz and Jaime Bonet Mor{\'o}n and Mar{\'\i}a Aguilera Diaz},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Editor = {Adolfo Meisel Roca},
	Publisher = {Colecci{\'o}n de Econom{\'\i}a Regional},
	Title = {Experiencias Exportadoras del Caribe Colombiano},
	Year = {2002}}

@book{crisisCambiarias,
	Address = {Barranquilla, Colombia},
	Author = {Bernardo Bernardi Carriello},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Ediciones Uninorte},
	Title = {Crisis Cambiarias en Pa{\'\i}ses Emergentes},
	Year = {2010}}

@book{ecoCol,
	Address = {Bogot{\'a}, Colombia},
	Author = {Jaime Ramirez Plazas},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Libreria Ediciones del Profesional Ltda.},
	Title = {Economia Colombiana},
	Year = {2013}}

@book{cardenas,
	Address = {Bogot{\'a}, Colombia},
	Author = {Alfonso Ortega C{\'a}rdenas},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {ECOE Ediciones},
	Title = {Econom{\'\i}a Colombiana 5ta Edici{\'o}n},
	Year = {2016}}

@book{hyndman,
	Address = {Melbourne Australia},
	Author = {Robert Hyndman and Gregory Athanasopoulos},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Otexts},
	Title = {Forecasting Principles and Practice},
	Year = {2014}}

@book{30seconds,
	Address = {New York, USA},
	Author = {Donald Marron and Adam Fishwick and Christakis Georgiou and Katie Huston and Aurélie Maréchal},
	Publisher = {Metro Books},
	Title = {30-Seconds Economics},
	Year = {2010}}

@book{hayashi,
	Address = {Kobe Japan},
	Author = {Chikio Hayashi and Keiji Yajima and Hans H. Bock and Noboru Ohsumi and Yutaka Tanaka and Yasumasa Baba},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Springer},
	Title = {Data Science, Classification, and Related Methods},
	Year = {1981},
}

@article{tukey,
	Author = {John Tukey},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Journal = {The Annals of Mathematical Statistics},
	Pages = {67},
	Title = {The Future of Data Analysis},
	Volume = {33},
	Year = {1962},
}

@article{kohaviProvost,
	Author = {Ron Kohavi and Foster Provost},
	Journal = {Machine Learning},
	Pages = {271},
	Title-274 = {Special Issue on Applications of Machine Learning and the Knowledge Discovery Process},
	Volume = {30},
	Year = {1998},
}

@book{naur,
	Address = {Lund Sweden},
	Author = {Peter Naur},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Petrocelli Charter},
	Rating = {4},
	Title = {Consice Survey of Computer Methods},
	Year = {1974},
}

@book{zumelMount,
	Address = {Shelter Island, USA},
	Author = {Zumel, N. and Mount, J.},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Manning},
	Title = {Practical Data Science with R},
	Year = 2014,
}

@book{daroczi,
	Address = {Birmingham, UK},
	Author = {Daroczi, G.},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Packt Publishing},
	Title = {Mastering Data Science with R},
	Year = 2015,
}

@book{narayanachar,
	Address = {Birmingham, UK},
	Author = {Narayanachar, P.},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Packt Publishing},
	Title = {R Statistical Application Development by Example},
	Year = 2013,
}

@book{viswanathan,
	Address = {Birmingham, UK},
	Author = {Viswanathan, V. and Viswanathan, S.},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Packt Publishing},
	Title = {R Data Analysis Cookbook},
	Year = 2015,
}

@book{datamining,
	Address = {San Francisco, USA},
	Author = {Witten, I. and Frank, E.},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Morgan Kaufmann Publishing},
	Title = {Data Mining Practical Machine Learning Tools and Techniques},
	Year = 2005,
}

@book{ensembleMethods,
	Address = {Boca Raton, USA},
	Author = {Zhi-Hua Zhou},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Chapman and Hall - CRC},
	Title = {Ensemble Methods},
	Year = 2012,
}

@book{ensembleMachineLearning,
	Address = {New York, USA},
	Author = {Zhang, C. and Ma, Y.},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Springer},
	Title = {Ensemble Machine Learning},
	Year = 2012,
}

@book{alpaydin,
	Address = {Massachusetts, USA},
	Author = {Alpaydin, E.},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {The MIT Press},
	Title = {Introduction to Machine Learning 2nd Edition},
	Year = 2010,
}

@book{harrington,
	Address = {Shelter Island, USA},
	Author = {Harrington, P.},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Manning Publications},
	Title = {Machine Learning in Action},
	Year = 2012,
}

@book{mitchell,
	Address = {New York, USA},
	Author = {Mitchell, T.},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {McGraw Hill},
	Title = {Machine Learning},
	Year = 1997,
}

@book{theElements,
	Address = {Stanford, USA},
	Author = {Trevor Hastie and Robert Tibshirani and Jerome Friedman},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Springer},
	Title = {The Elements of Statistical Learning},
	Year = 1997,
}

@book{yau,
	Address = {Stanford, USA},
	Author = {Chi Yau},
	Date-Added = {2017-11-14 01:37:20 +0000},
	Date-Modified = {2017-11-14 01:37:20 +0000},
	Publisher = {Amazon Digital Services},
	Title = {R Tutorial with Bayesian Statistics Using OpenBUGS},
	Year = 2013,}

@article{cafeMain,
	Author = {Dario Echeverri and Lorena Buitrago and Felix Montes and Ingrid Mejia and María del Pilar González},
	Journal = {Revista Colombiana de Cardiología},
	Keywords = {cafe, Colombia},
	Month = {Marzo-Abril},
	Number = {8},
	Pages = {357-365},
	Title = {Café para Cardiólogos},
	Volume = {11},
	Year = {2005},
	}

@article{niquelMain,
	Author = {Jorge Fernando Forero Castañeda and Jorge Hernán Londoño De Los Ríos and Juan José Manrique Galvis and Fredy Wilman Rojas Cruz},
	Journal = {Unidad de Planeación Minero Energético},
	Keywords = {níquel, Colombia},
	Month = {Noviembre},
	Number = {},
	Pages = {5-42},
	Title = {El Níquel En Colombia},
	Volume = {},
	Year = {2009},
}

@article{carbonMain,
	Author = {Alvaro Ponce Muriel and Gloria Patricia Gamba Saavedra and José Vicente Dulce Cabrera and Luz Constanza Fierro Encizo and María Claudia Díaz Orozco and Sergio Alonso Mejía Tobón},
	Journal = {Unidad de Planeación Minero Energético},
	Keywords = {carbon, Colombia},
	Month = {Noviembre},
	Number = {},
	Pages = {1-52},
	Title = {El Carbón Colombiano, Fuente de Energía para el Mundo},
	Volume = {},
	Year = {2005},
}

@misc{arango_2017,
title={La explotación de oro en Colombia, conflicto armado y efectos al medio ambiente},
url={http://blogs.eltiempo.com/biogenic-colombia/2017/04/15/la-explotacion-de-oro-en-colombia-conflicto-armado-y-efectos-al-medio-ambiente/},
journal={El Tiempo},
author={Arango, Adriana},
year={2017}
}

@article{oroMain,
	Author = {Miguel Casallas and Jose Alejandro Martinez},
	Journal = {Ploutos},
	Keywords = {oro, Colombia},
	Month = {Marzo},
	Number = {1},
	Pages = {20-26},
	Title = {El Carbón Colombiano, Fuente de Energía para el Mundo},
	Volume = {5},
	Year = {2015},
}

@article{bananoC,
	Author = {JUAN FELIPE SIERRA SUÁREZ},
	Journal = {El Colombiano},
	Keywords = {banano, Colombia},
	Month = {March},
	Number = {},
	Pages = {19},
	Title = {Producción bananera colombiana apunta a crecer 3,2% este año},
	Volume = {},
	Year = {2017},
}

@misc{bananoFINAGRO,
title={Informacion sobre la Exportación del Banano en Colombia},
url={http://finagro.com.co},
journal={FINAGRO},
author={FINAGRO},
year={2017}
}

@misc{bananoAUGURA,
title={Quienes Somos},
url={http://www.augura.com.co/augura/quienes-somos/},
journal={AUGURA},
author={AUGURA},
year={2018}
}

@phdthesis{cardenasRodriguez,
author = {Luz Marina Cárdenas Poveda and Maria Yamile Rodríguez Espejo},
title = {Estudio de la agroindustria de las flores en Colombia y la creación de una empresa productora de flores},
year = {2011},
school = {Universidad de la Sabana}
}

@article{DzeroskiZenko,
	Author = {Sasso Dzeroski and Bernard Zenko},
	Date-Added = {2018-01-01 01:37:20 +0000},
	Date-Modified = {2018-01-01 01:37:20 +0000},
	Journal = {Machine Learning},
	Pages = {255-273},
	Title = {Is Combining Classifiers with Stacking Better than Selecting the Best One?},
	Volume = {54},
	Year = {2004},
}

@misc{smolyakov,
title={Ensemble Learning to Improve Machine Learning Results},
note={https://blog.statsbot.co/ensemble-learning-d1dcd548e936},
journal={Statsbot},
author={Vadim Smolyakov},
year={2017},
month={August},
}

@article{dupontPlummer,
	Author = {William Dupont and Walton Plummer},
	Date-Added = {2018-01-01 01:37:20 +0000},
	Date-Modified = {2018-01-01 01:37:20 +0000},
	Journal = {Controlled Clinical Trials},
	Pages = {589-601},
	Title = {Power and Sample Size Calculations for Studies Involving Linear Regression},
	Volume = {19},
	Year = {1998},
}

@article{wolpert,
	Author = {David Wolpert},
	Date-Added = {2018-01-01 01:37:20 +0000},
	Date-Modified = {2018-01-01 01:37:20 +0000},
	Journal = {Complex  Systems  Group,  Theoretical  Division,  and  Center  for  Non-linear  Studies},
	Pages = {1-57},
	Title = {STACKED GENERALIZATION},
	Year = {1992},
}

@article{tingwitten,
	Author = {Kai Ting and Ian Witten},
	Journal = {Journal of Artificial Intelligence Research},
	Pages = {271-289},
	Title = {Issues in Stacked Generalization},
	Volume = {10},
	Year = {1999},
}

@article{cleveland,
	Author = {William Cleveland},
	Journal = {Revue Internationale de Statistique},
	Pages = {21-26},
	Title = {Data Science: an action plan for expanding the technical areas of the field of statistics},
	Volume = {1},
	Year = {2001},
}

@misc{CODATA,
  title={International Council for Science : Committee on Data for
  Science and Technology},
  note={http://www.codata.org/},
  journal={Committee on Data for Science and Technology},
  author={CODATA},
  year={2012},
  month={April}
}

@phdthesis{fry,
	author={Benjamin Jotham Fry},
	title={Computational Information Design},
	school={Carnegie Mellon University},
	year={2000},
    month={April},
}

@misc{wikipediaDS,
  title={Data Science},
  note={https://en.wikipedia.org/wiki/Datascience/},
  journal={Wikipedia},
  author={Wikipedia},
  year={2018},
  month={April},}

@book{pengMatsui,
	Address = {Maryland, USA},
	Author = {Roger Peng and Elizabeth Matsui},
	Publisher = {LeanPub Publishers},
	Title = {The Art of Data Science},
	Year = 2017,}

@misc{srivastava,
  title={A Complete Tutorial on Time Series Modeling in R},
  note={https://www.analyticsvidhya.com/blog/2015/12/complete-tutorial-time-series-modeling/},
  journal={Analytics Vidhya},
  author={Tavish Srivastava},
  year={2015},
  month={December},
  day={16}}

@misc{guiaAcademicaDAG,
  title={Guía Académica para la Estructura Final de la Tesis Doctoral},
  author={Dirección Académica del Doctorado en Administración Gerencial},
  year={2018},
  month={April},
  day={}}

@book{robertson,
	Address = {Cambridge, UK},
	Author = {Dennis Robertson},
	Date-Added = {2017-10-12 01:37:20 +0000},
	Date-Modified = {2017-10-12 01:37:20 +0000},
	Publisher = {Cambridge Economics Handbook},
	Title = {Money},
	Year = 1922,
}

@book{leek,
	Address = {Baltimore, USA},
	Author = {Jeffrey Leek},
	Publisher = {Leanpub Publishers},
	Title = {The Elements of Data Analytic Style},
	Year = 2015,
}

@article{huertas,
	Author = {David Huertas},
	Journal = {La Cinta de Moebio},
	Pages = {1-19},
	Title = {La Formulación de la Hipótesis},
	Volume = {15},
	Year = {2002},
}

@book{mendehall,
	Address = {Ciudad de México, México},
	Author = {William Mendehall and Robert Beaver and Barbara Beaver},
	Publisher = {CENGAGE Publishing},
	Title = {Introducción a la Probabilidad y Estadística},
	Year = 2010,
}

@book{estadisticaBasica,
	Address = {Madrid, España},
	Author = {Javier Gorgas García and Nicolás Cardiel López and Jaime Zamorano Calvo},
	Date-Added = {2018-09-07 02:11:09 +0000},
	Date-Modified = {2018-09-07 02:13:04 +0000},
	Publisher = {Universidad Complutense de Madrid},
	Title = {Estadística Básica para Estudiantes de Ciencias},
	Year = {2011},
}

@article{modelandoIntervenciones,
	Author = {Mauricio Lopera Castaño and Ramón Javier Mesa Callejas and Sergio Iván Restrepo Ochoa and Charle Augusto Londoño Henao},
	Journal = {Cuadernos de Economia},
	Pages = {310-338},
	Title = {Modelando el Esquema de Intervenciones del Tipo de Cambio para Colombia},
	Volume = {32},
	Year = 2013,
}

@article{scarpinSteiner,
	Author = {Cassius Tadeu Scarpin and Maria Teresinha Arms Steiner},
	Journal = {Pesquisa Operacional},
	Pages = {351-371},
	Title = {Proposal for a Strategic Planning for the Replacement of Products in Stores Based on Sales Forecast},
	Volume = {31},
	Year = 2011,
}

@article{wangXu,
	Author = {Wen Jiew Wand and Q Xu},
	Journal = {Journal of Applied Research and Technology},
	Pages = {315-324},
	Title = {A Bayesian Combination Forecasting Model for Retail Supply Chain Coordination},
	Volume = {12},
	Year = 2014,
}

@article{townsend,
author = {Townsend, James},
year = {1971},
month = {01},
pages = {40-50},
title = {Theoretical analysis of an alphabet confusion matrix},
volume = {9},
booktitle = {Perception & Psychophysics}
}

@misc{techdirt,
  title={Why Netflix Never Implemented The Algorithm That Won The Netflix \$1 Million Challenge},
  note={https://www.techdirt.com/articles/20120409/03412518422/why-netflix-never-implemented-algorithm-that-won-netflix-1-million-challenge.shtml/},
  journal={Techdirt},
  author={Mike Masnick},
  year={2012},
  month={April},
  day={13}
  }

  @misc{caret,
  title={The CARET Package},
  note={http://topepo.github.io/caret/index.html/},
  journal={Github},
  author={Max Kuhn},
  year={2018},
  month={May},
  day={26}
  }

repository: ameilij/UBJ

repo_name: ameilij/UBJ


text:
require bug-app.inc

DESCRIPTION = "Detects motion, takes a snapshot, geo-tags it, and uploads it to user's flickr account. Uses Camera, GPS, Motion and Display modules."
HOMEPAGE = "http://buglabs.net/applications/FlickrUppr"

DEPENDS += "service-tracker com.buglabs.bug.module.motion com.buglabs.bug.module.lcd com.buglabs.bug.module.camera com.buglabs.common com.buglabs.bug.module.gps com.buglabs.osgi "

PV = "3"

SRC_LINK = "http://buglabs.net/program_version/download/40"

APIVERSION = ""

BROKEN = "1"


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

package ctags

import (
	"fmt"
	"strconv"
	"strings"
)

type Entry struct {
	Sym        string
	Path       string
	Line       int
	Kind       string
	Language   string
	Parent     string
	ParentType string

	FileLimited bool
}

// Parse parses a single line of exuberant "ctags -n" output.
func Parse(in string) (*Entry, error) {
	fields := strings.Split(in, "\t")
	e := Entry{}

	if len(fields) < 3 {
		return nil, fmt.Errorf("too few fields: %q", in)
	}

	e.Sym = fields[0]
	e.Path = fields[1]

	lstr := fields[2]
	if len(lstr) < 2 {
		return nil, fmt.Errorf("got %q for linenum field", lstr)
	}

	l, err := strconv.ParseInt(lstr[:len(lstr)-2], 10, 64)
	if err != nil {
		return nil, err
	}
	e.Line = int(l)
	e.Kind = fields[3]

field:
	for _, f := range fields[3:] {
		if string(f) == "file:" {
			e.FileLimited = true
		}
		for _, p := range []string{"class", "enum"} {
			if strings.HasPrefix(f, p+":") {
				e.Parent = strings.TrimPrefix(f, p+":")
				e.ParentType = p
				continue field
			}
		}
	}
	return &e, nil
}

repository: GerritCodeReview/zoekt

repo_name: GerritCodeReview/zoekt


text:
# Copyright 2014-2023 Google LLC
#
# 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
#
#     https://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.

# Compiler checks
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")  # GCC
  set(_pawn_compiler_supported TRUE)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")  # Clang or Apple Clang
  set(_pawn_compiler_supported TRUE)

  include(Sanitizers)
else()
  message(WARNING "Unsupported compiler: ${CMAKE_CXX_COMPILER_ID}")
endif()

# These affect ABI and linking, so set them globally, even for dependencies
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS FALSE)

set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

if(_pawn_compiler_supported)
  add_compile_options(-fno-exceptions)
endif()

repository: google/pawn

repo_name: google/pawn


text:
DESCRIPTION = "A library for faking the system time in user-space programs"
SECTION = "libs"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

SRCREV = "d475b925943ad404c6c728ac868dc73949e7281c"

SRC_URI = "git://github.com/wolfcw/libfaketime.git;branch=master;protocol=https \
           file://0001-Makefile-Detect-compiler-in-makefile.patch \
           "

S = "${WORKDIR}/git"

CFLAGS:append:libc-musl = " -D_LARGEFILE64_SOURCE"

do_configure[noexec] = "1"
do_compile () {
    oe_runmake
}
do_install () {
    install -d ${D}${libdir}/faketime
    oe_libinstall -C src libfaketime ${D}${libdir}/faketime
    install -d ${D}${bindir}
    install -m 0755 src/faketime ${D}${bindir}
}

PACKAGES =+ "lib${PN}"

FILES:${PN} = "${bindir}/faketime"
FILES:lib${PN} = "${libdir}/faketime/*"

INSANE_SKIP:${PN} += "dev-so"
INSANE_SKIP:lib${PN} += "dev-so"

repository: YoeDistro/meta-openembedded

repo_name: YoeDistro/meta-openembedded


text:
#-----------------------------------------------------------------------------------------------------------------------
# Copyright (C) 2021 Fabrizio Maj
#
# This file is part of the cpp_libs_build_scripts project, which is distributed under the MIT license.
# Refer to the licenses of the managed libraries for conditions on their use and distribution.
# For details, see https://github.com/fabriz/cpp_libs_build_scripts
#-----------------------------------------------------------------------------------------------------------------------

function(debugMessage _message)
    get_filename_component(CALLER_FILE_NAME "${CMAKE_PARENT_LIST_FILE}" NAME_WE)
    string(REGEX REPLACE "^Find(.+)$" "\\1" CALLER_PACKAGE_NAME "${CALLER_FILE_NAME}")
    if (NOT ${CALLER_PACKAGE_NAME}_FIND_QUIETLY)
        message(DEBUG "[CPPLIBS] ${CALLER_FILE_NAME}: ${_message}")
    endif ()
endfunction()

function(warningMessage _message)
    get_filename_component(CALLER_FILE_NAME "${CMAKE_PARENT_LIST_FILE}" NAME_WE)
    string(REGEX REPLACE "^Find(.+)$" "\\1" CALLER_PACKAGE_NAME "${CALLER_FILE_NAME}")
    if (NOT ${CALLER_PACKAGE_NAME}_FIND_QUIETLY)
        message(WARNING "[CPPLIBS] ${CALLER_FILE_NAME}: ${_message}")
    endif ()
endfunction()

function(fatalError _message)
    get_filename_component(CALLER_FILE_NAME "${CMAKE_PARENT_LIST_FILE}" NAME_WE)
    message(FATAL_ERROR "[CPPLIBS] ${CALLER_FILE_NAME}: ${_message}")
endfunction()

macro(requiredDependencyMissing _dependency _isFatalError)
    if (DEFINED ${_isFatalError})
        fatalError("Required dependency ${_dependency} not found")
    else()
        debugMessage("Required dependency ${_dependency} not found")
    endif()
endmacro()

function(validate_package_components PACKAGE_COMPONENTS FIND_COMPONENTS)
    cmake_policy(PUSH)
    cmake_policy(SET CMP0057 NEW)
    get_filename_component(CALLER_FILE_NAME "${CMAKE_PARENT_LIST_FILE}" NAME_WE)
    string(REGEX REPLACE "^Find(.+)$" "\\1" CALLER_PACKAGE_NAME "${CALLER_FILE_NAME}")
    foreach(COMPONENT_NAME IN LISTS ${FIND_COMPONENTS})
        if (NOT COMPONENT_NAME IN_LIST ${PACKAGE_COMPONENTS})
            set(${CALLER_PACKAGE_NAME}_${COMPONENT_NAME}_FOUND FALSE PARENT_SCOPE)
            warningMessage("Unknown ${CALLER_PACKAGE_NAME} component: ${COMPONENT_NAME}")
        endif()
    endforeach()
    cmake_policy(POP)
endfunction()

function(check_package_component_items COMPONENT_NAME)
    get_filename_component(CALLER_FILE_NAME "${CMAKE_PARENT_LIST_FILE}" NAME_WE)
    string(REGEX REPLACE "^Find(.+)$" "\\1" CALLER_PACKAGE_NAME "${CALLER_FILE_NAME}")
    cmake_parse_arguments(PARSE_ARGV 1 CPC "" "" "REQUIRED_ITEMS")
    set(CPC_ALL_REQUIRED_ITEMS_FOUND TRUE)
    foreach(REQUIRED_ITEM IN LISTS CPC_REQUIRED_ITEMS)
        if(NOT EXISTS "${${REQUIRED_ITEM}}")
            set(CPC_ALL_REQUIRED_ITEMS_FOUND FALSE)
        endif()
    endforeach()
    string(TOUPPER ${CALLER_PACKAGE_NAME} UPPER_CALLER_PACKAGE_NAME)
    string(TOUPPER ${COMPONENT_NAME} UPPER_COMPONENT_NAME)
    set(${CALLER_PACKAGE_NAME}_${COMPONENT_NAME}_FOUND ${CPC_ALL_REQUIRED_ITEMS_FOUND} PARENT_SCOPE)
    set(${UPPER_CALLER_PACKAGE_NAME}_${UPPER_COMPONENT_NAME}_FOUND ${CPC_ALL_REQUIRED_ITEMS_FOUND} PARENT_SCOPE)
endfunction()

if(ANDROID)
    debugMessage("Target platform: Android")
elseif(IOS)
    debugMessage("Target platform: iOS")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    set(MACOS TRUE)
    debugMessage("Target platform: macOS")
elseif(MINGW)
    debugMessage("Target platform: Windows/MinGW")
elseif(UNIX)
    set(LINUX TRUE)
    debugMessage("Target platform: Linux")
elseif(MSVC)
    debugMessage("Target platform: Windows/MSVC")
else()
    message(FATAL_ERROR "Target platform not detected.")
endif()

debugMessage("Source: ${CMAKE_PARENT_LIST_FILE}")

if(DEFINED CPPLIBS_VARIANT_ROOT)
    debugMessage("CPPLIBS_VARIANT_ROOT: (specified) ${CPPLIBS_VARIANT_ROOT}")
else()
    get_filename_component(CPPLIBS_VARIANT_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
    debugMessage("CPPLIBS_VARIANT_ROOT: (detected) ${CPPLIBS_VARIANT_ROOT}")
endif()

include(FindPackageHandleStandardArgs)


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

package protocol

import proto "code.google.com/p/goprotobuf/proto"
import json "encoding/json"
import math "math"

// Reference proto, json, and math imports to suppress error if they are not otherwise used.
var _ = proto.Marshal
var _ = &json.SyntaxError{}
var _ = math.Inf

type SSSrvRegiste struct {
	Id               *int32  `protobuf:"varint,1,req" json:"Id,omitempty"`
	Type             *int32  `protobuf:"varint,2,req" json:"Type,omitempty"`
	AreaId           *int32  `protobuf:"varint,3,req" json:"AreaId,omitempty"`
	Name             *string `protobuf:"bytes,4,req" json:"Name,omitempty"`
	Data             *string `protobuf:"bytes,5,opt" json:"Data,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (m *SSSrvRegiste) Reset()         { *m = SSSrvRegiste{} }
func (m *SSSrvRegiste) String() string { return proto.CompactTextString(m) }
func (*SSSrvRegiste) ProtoMessage()    {}

func (m *SSSrvRegiste) GetId() int32 {
	if m != nil && m.Id != nil {
		return *m.Id
	}
	return 0
}

func (m *SSSrvRegiste) GetType() int32 {
	if m != nil && m.Type != nil {
		return *m.Type
	}
	return 0
}

func (m *SSSrvRegiste) GetAreaId() int32 {
	if m != nil && m.AreaId != nil {
		return *m.AreaId
	}
	return 0
}

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

func (m *SSSrvRegiste) GetData() string {
	if m != nil && m.Data != nil {
		return *m.Data
	}
	return ""
}

func init() {
}

repository: konser/go-pack

repo_name: konser/go-pack


text:
# Copyright (C) 2017, STMicroelectronics - All Rights Reserved
# Released under the MIT license (see COPYING.MIT for the terms)

SUMMARY = "Script for creating raw SDCARD image ready to flash"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://create_sdcard_from_flashlayout.sh"

BBCLASSEXTEND = "native nativesdk"

RDEPENDS:${PN}:append = " bash "

RRECOMMENDS:${PN}:append:class-nativesdk = " nativesdk-gptfdisk "

inherit deploy

SCRIPT_DEPLOYDIR ?= "scripts"

do_configure() {
    if [ -e ${WORKDIR}/create_sdcard_from_flashlayout.sh ]; then
        bbnote "Update DEFAULT_ROOTFS_PARTITION_SIZE to ${STM32MP_ROOTFS_SIZE}"
        sed 's/^DEFAULT_ROOTFS_PARTITION_SIZE=.*$/DEFAULT_ROOTFS_PARTITION_SIZE='"${STM32MP_ROOTFS_SIZE}"'/' -i ${WORKDIR}/create_sdcard_from_flashlayout.sh
        if [ ${STM32MP_ROOTFS_SIZE} -gt 1572864 ]; then
            # rootfs > 1.5GB then put sdcard raw size = STM32MP_ROOTFS_SIZE + 1.5GB
            raw_size=$(expr ${STM32MP_ROOTFS_SIZE} / 1024 )
            raw_size=$(expr $raw_size + 1536)
            sed 's/^DEFAULT_RAW_SIZE=.*$/DEFAULT_RAW_SIZE='"$raw_size"'/' -i ${WORKDIR}/create_sdcard_from_flashlayout.sh
        fi

        bbnote "Update DEFAULT_SDCARD_PARTUUID to ${DEVICE_PARTUUID_ROOTFS:SDCARD}"
        sed 's/^DEFAULT_SDCARD_PARTUUID=.*$/DEFAULT_SDCARD_PARTUUID='"${DEVICE_PARTUUID_ROOTFS:SDCARD}"'/' -i ${WORKDIR}/create_sdcard_from_flashlayout.sh
        sed 's/^DEFAULT_FIP_TYPEUUID=.*$/DEFAULT_FIP_TYPEUUID='"${DEVICE_TYPEUUID_FIP}"'/' -i ${WORKDIR}/create_sdcard_from_flashlayout.sh
        sed 's/^DEFAULT_FIP_A_PARTUUID=.*$/DEFAULT_FIP_A_PARTUUID='"${DEVICE_PARTUUID_FIP_A}"'/' -i ${WORKDIR}/create_sdcard_from_flashlayout.sh
        sed 's/^DEFAULT_FIP_B_PARTUUID=.*$/DEFAULT_FIP_B_PARTUUID='"${DEVICE_PARTUUID_FIP_B}"'/' -i ${WORKDIR}/create_sdcard_from_flashlayout.sh
        sed 's/^DEFAULT_FWU_MDATA_TYPEUUID=.*$/DEFAULT_FWU_MDATA_TYPEUUID='"${DEVICE_PARTUUID_FWU_MDATA}"'/' -i ${WORKDIR}/create_sdcard_from_flashlayout.sh
        sed 's/^DEFAULT_UBOOT_ENV_TYPEUUID=.*$/DEFAULT_UBOOT_ENV_TYPEUUID='"${DEVICE_PARTUUID_UBOOT_ENV}"'/' -i ${WORKDIR}/create_sdcard_from_flashlayout.sh
    fi
}

do_install() {
    install -d ${D}/${bindir}
    install -m 0755 ${WORKDIR}/create_sdcard_from_flashlayout.sh ${D}/${bindir}
}

do_deploy() {
    :
}
do_deploy:class-native() {
    install -d ${DEPLOYDIR}/${SCRIPT_DEPLOYDIR}
    install -m 0755 ${WORKDIR}/create_sdcard_from_flashlayout.sh ${DEPLOYDIR}/${SCRIPT_DEPLOYDIR}/
}
addtask deploy before do_build after do_compile

branch_name: refs/heads/mickledore


text:
DESCRIPTION = "I've been writing the equivalent of this module at the top of my code for \
about a year now. I figured it was time to make it shorter."

SECTION = "libs"
LICENSE = "Artistic-1.0 | GPL-1.0-or-later"
PR = "r0"

MAINTAINER=	"Poky <poky@yoctoproject.org>"
HOMEPAGE=	"https://metacpan.org/release/strictures"

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Artistic-1.0;md5=cda03bbdc3c1951996392b872397b798 \
file://${COMMON_LICENSE_DIR}/GPL-1.0-or-later;md5=30c0b8a5048cc2f4be5ff15ef0d8cf61"

SRC_URI = "https://cpan.metacpan.org/authors/id/H/HA/HAARG/strictures-2.000006.tar.gz"

SRC_URI[md5sum] = "35c14fd25320f32ff40e977feae95d0d"
SRC_URI[sha256sum] = "09d57974a6d1b2380c802870fed471108f51170da81458e2751859f2714f8d57"
RRECOMMENDS:${PN} += "bareword-filehandles-perl"
RRECOMMENDS:${PN} += "indirect-perl"
RRECOMMENDS:${PN} += "multidimensional-perl"

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

inherit cpan allarch

BBCLASSEXTEND = "native"

repository: rehsack/meta-cpan

repo_name: rehsack/meta-cpan


text:
package main

import (
	"github.com/EndlessCheng/codeforces-go/main/testutil"
	"testing"
)

func Test(t *testing.T) {
	cases := [][2]string{
		{
			`2
12 6
3
1 1
2 2
1 2`,
			`12
6
10`,
		},
		{
			`5
1 2 3 0 4
5
1 5
1 2
4 4
3 4
2 5`,
			`4
3
0
3
5`,
		},
		{
			`7
1 1 1 1 1 1 1
9
1 7
2 6
3 4
2 5
5 7
6 6
3 3
2 7
1 1`,
			`1
1
0
0
1
1
1
0
1`,
		},
	}
	testutil.AssertEqualStringCase(t, cases, 0, run)
}

repository: EndlessCheng/codeforces-go

repo_name: EndlessCheng/codeforces-go


text:
require chromium-upstream-tarball.inc
require chromium-gn.inc

SRC_URI += " \
        file://0001-ozone-wayland-Factored-the-clipboard-logic-out-of-Wa.patch \
        file://0002-Convert-wayland-buffer-to-the-new-shared-memory-API.patch \
        file://0003-Migrate-WaylandCanvasSurface-to-the-new-shared-memor.patch \
        file://0004-ozone-wayland-Ease-the-buffer-swap-and-maintenance.patch \
        file://0005-ozone-wayland-Fix-presentation-feedback-flags.patch \
        file://0006-wayland-Do-not-release-shared-memory-fd-when-passing.patch \
        file://0007-ozone-wayland-Don-t-wait-for-frame-callback-after-su.patch \
        file://0008-ozone-wayland-Do-not-add-window-if-manager-does-not-.patch \
        file://0009-ozone-wayland-Fix-NativeGpuMemoryBuffers-usage.patch \
        file://0010-ozone-wayland-Add-immediate-release-support.patch \
        file://0011-ozone-wayland-Wrap-wl_shm-to-WaylandShm.patch \
        file://0012-ozone-wayland-Shm-Proxy-make-mojo-calls-on-the-gpu-t.patch \
        file://0013-ozone-wayland-Shm-add-buffer_id.patch \
        file://0014-ozone-wayland-Unite-Wayland-ShmBufferManager-and-Buf.patch \
        file://0015-ozone-wayland-Stop-providing-WaylandConnection-throu.patch \
        file://0016-ozone-wayland-Improve-logging-when-creating-gbm-buff.patch \
        file://0017-ozone-wayland-Establish-BufferManagerGpu-and-BufferM.patch \
        file://0018-ozone-wayland-Use-new-shmen-API-when-loading-keymap.patch \
        file://0019-ozone-wayland-Prepare-WaylandCanvasSurface-for-compl.patch \
        file://0020-ozone-wayland-Reset-surface-contents-in-a-safe-way.patch \
        file://0021-Ozone-Wayland-Manager-make-mojo-calls-on-IO-thread.patch \
        file://0022-ozone-wayland-Manager-tests-exercise-tests-with-mojo.patch \
        file://0023-ozone-wayland-Fix-broken-software-rendering-path.patch \
        file://0001-v4l2_device-CanCreateEGLImageFrom-support-all-ARM-So.patch \
        file://0001-Add-support-for-V4L2VDA-on-Linux.patch \
        file://0002-Add-mmap-via-libv4l-to-generic_v4l2_device.patch \
        file://0001-ozone-wayland-Fix-method-prototype-match.patch \
"

# Chromium can use v4l2 device for hardware accelerated video decoding. Make sure that
# /dev/video-dec exists.
PACKAGECONFIG[use-linux-v4l2] = "use_v4l2_codec=true use_v4lplugin=true use_linux_v4l2_only=true"

GN_ARGS += "\
        ${PACKAGECONFIG_CONFARGS} \
        use_ozone=true \
        ozone_auto_platforms=false \
        ozone_platform_headless=true \
        ozone_platform_wayland=true \
        ozone_platform_x11=false \
        use_xkbcommon=true \
        use_system_libwayland=true \
        use_system_minigbm=true \
        use_system_libdrm=true \
"

# The chromium binary must always be started with those arguments.
CHROMIUM_EXTRA_ARGS_append = " --ozone-platform=wayland"


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

package emport

import (
	"fmt"
	"testing"

	"github.com/LianjiaTech/d18n/common"
)

var testES *EmportStruct

func init() {
	var err error
	common.InitTestEnv()
	common.TestConfig.Schema = common.TestPath + "/test/schema.txt"
	testES, err = NewEmportStruct(common.TestConfig)
	if err != nil {
		panic(err.Error())
	}
	testES.Status.Header, err = common.TestConfig.ParseSchema()
	fmt.Println(testES.Status.Header)
	if err != nil {
		panic(err.Error())
	}
}

func TestEmportCSV(t *testing.T) {
	orgCfg := common.TestConfig

	common.TestConfig.File = common.TestPath + "/test/actor.csv"
	common.TestConfig.User = ""
	common.TestConfig.Limit = 2
	common.TestConfig.Table = "actor_csv"
	common.TestConfig.Replace = true
	common.TestConfig.Comma = ','
	testES.Config = common.TestConfig
	testES.Status.Lines = 0

	conn, _ := common.TestConfig.NewConnection()
	err := emportCSV(testES, conn)
	if err != nil {
		t.Error(err.Error())
	}

	common.TestConfig = orgCfg

}


text:
package main

import (
	"testing"
)

const source = `package main

type User struct {
	// User's name
	Name string
	// User's age
	Age  int
	Languages []string
}

type Order struct {
	ID string
	Price int
}`

func TestCollectStructsLen(t *testing.T) {
	in := source
	want := 2

	structs := ParseSource(in)
	got := len(structs)
	if got != want {
		t.Fatalf("Structs length was incorrect, got: %v, want: %v", got, want)
	}
}

func TestIsExportedName(t *testing.T) {
	cases := []struct {
		in   string
		want bool
	}{
		{"Abc", true},
		{"Zyx", true},
		{"abc", false},
		{"zyx", false},
	}

	for _, c := range cases {
		got := isExportedName(c.in)
		if got != c.want {
			t.Errorf("isExportedName(%s) was incorrect, got: %v, want: %v", c.in, got, c.want)
		}
	}
}

repository: rodrigoieh/postman-doc-generator

repo_name: rodrigoieh/postman-doc-generator


text:
package trigger

import (
	"github.com/ind9/rocks/cmd"
	"github.com/spf13/cobra"
)

var trigger = &cobra.Command{
	Use:   "trigger",
	Short: "Triggers a backup on a remote system",
	Long:  `Triggers a backup on a remote system`,
}

func init() {
	cmd.Rocks.AddCommand(trigger)
}

repository: etsangsplk/rocks

repo_name: etsangsplk/rocks


text:
package str

//双指针，题解最优版
func OneEditAway(first string, second string) bool {
	l1, l2 := len(first), len(second)
	if l1 - l2 > 1 || l1 - l2 < -1 {
		return false
	}

	i := 0
	for i < l1 && i < l2 {
		//如果first和second满足要求，则当出现一个字符不等时，剩下的字符一定相等
		if first[i] != second[i] {
			if l1 > l2 {
				return first[i+1:] == second[i:]
			} else if l1 < l2 {
				return first[i:] == second[i+1:]
			} else {
				return first[i+1:] == second[i+1:]
			}
		}
		i++
	}
	return true
}

repository: Lcoderfit/Introduction-to-algotithms

repo_name: Lcoderfit/Introduction-to-algotithms

filename: jd面试题 01.05. 一次编辑.go


text:
DESCRIPTION = "libgee is a collection library providing GObject-based interfaces \
and classes for commonly used data structures."
HOMEPAGE = "http://live.gnome.org/Libgee"
SECTION = "libs"
DEPENDS = "glib-2.0"
DEPENDS_virtclass-native = "glib-2.0-native"
LICENSE = "LGPL"
SRCREV = "9a3d48187d87b0ed151a339a9b05f6f4eefb0922"
PV = "0.5.0+gitr${SRCPV}"
PE = "1"

SRC_URI = "\
  git://git.gnome.org/libgee;protocol=git;branch=master \
"
S = "${WORKDIR}/git"

inherit autotools vala

BBCLASSEXTEND = "native"


text:
require octave.inc

SRC_URI = "ftp://ftp.octave.org/pub/octave/obsolete/${PN}-${PV}.tar.gz"

PR = "${INC_PR}.0"

PACKAGES =+ "libcruft-dev liboctave-dev liboctinterp-dev"

FILES_libcruft-dev = "${libdir}/${PN}-${PV}/libcruft*"
FILES_liboctave-dev = "${libdir}/${PN}-${PV}/liboctave*"
FILES_liboctinterp-dev = "${libdir}/${PN}-${PV}/liboctinterp*"

SRC_URI[md5sum] = "e75a109620e57de081ee73e0489e5990"
SRC_URI[sha256sum] = "d44d23b09165e1d7008dbd4d0e052bb3fa3641de7705c9c0302c9cff583de609"


text:
#
#   Copyright (C) 2015 Pelagicore AB
#
DESCRIPTION = "avdecc-lib"
HOMEPAGE = "https://github.com/audioscience/avdecc-lib"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=89e9087cf8523e423297c8e41541ac39"

FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

inherit cmake

EXTRA_OECMAKE += "-DCMAKE_CXX_FLAGS='${TARGET_CC_ARCH}'"

SRC_URI = " \
    git://github.com/audioscience/avdecc-lib.git;branch=master;protocol=https \
    file://avdecc-lib-fix-cmake-variables.patch \
    file://clone_using_https.patch \
    "

SRCREV = "f3fa82399fb8a5664ab2f4f2c1430b3a28e3fc2b"

S = "${WORKDIR}/git/"

do_submodule_initupdate() {
    cd ${S}
    git submodule init
    git submodule update
}

do_install() {
    mkdir -p ${D}/${bindir}
    mkdir -p ${D}/${libdir}

    install ${B}/controller/lib/libcontroller.so ${D}/${libdir}
    install ${B}/controller/app/cmdline/avdecccmdline ${D}/${bindir}

}

FILES_${PN} =+ " \
    ${bindir}/* \
    ${libdir}/* \
"

addtask submodule_initupdate after do_patch before do_configure

repository: socec/meta-bistro

repo_name: socec/meta-bistro


text:
include(FindPackageHandleStandardArgs)

find_path(MEMKIND_INCLUDE_DIR pmem_allocator.h)
find_library(MEMKIND_LIBRARY NAMES memkind libmemkind)

mark_as_advanced(MEMKIND_LIBRARY MEMKIND_INCLUDE_DIR)

find_package_handle_standard_args(MEMKIND
	DEFAULT_MSG
	MEMKIND_INCLUDE_DIR
	MEMKIND_LIBRARY
	)

if(MEMKIND_FOUND)
	set(MEMKIND_LIBRARIES ${MEMKIND_LIBRARY})
	set(MEMKIND_INCLUDE_DIRS ${MEMKIND_INCLUDE_DIR})
endif()

repository: umn-cris/pmemkv

repo_name: umn-cris/pmemkv


text:
require python-pyqt5.inc

inherit python3native python3-dir

DEPENDS += "sip3 sip3-native python3"

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


text:
#################################################
macro (ign_build_tests)
  # Find the Python interpreter for running the
  # check_test_ran.py script
  find_package(PythonInterp QUIET)

  # Build all the tests
  foreach(GTEST_SOURCE_file ${ARGN})
    string(REGEX REPLACE ".cc" "" BINARY_NAME ${GTEST_SOURCE_file})
    set(BINARY_NAME ${TEST_TYPE}_${BINARY_NAME})
    if(USE_LOW_MEMORY_TESTS)
      add_definitions(-DUSE_LOW_MEMORY_TESTS=1)
    endif(USE_LOW_MEMORY_TESTS)
    add_executable(${BINARY_NAME} ${GTEST_SOURCE_file})

    add_dependencies(${BINARY_NAME}
      ${PROJECT_LIBRARY_TARGET_NAME}
      gtest gtest_main
      )

    if (UNIX)
      target_link_libraries(${BINARY_NAME}
         libgtest_main.a
         libgtest.a
         pthread
         ${PROJECT_LIBRARY_TARGET_NAME})
    elseif(WIN32)
      target_link_libraries(${BINARY_NAME}
         gtest.lib
         gtest_main.lib
         ${PROJECT_LIBRARY_TARGET_NAME})

      # Copy in ignition-msgs library
      add_custom_command(TARGET ${BINARY_NAME}
        COMMAND ${CMAKE_COMMAND} -E copy_if_different
        "$<TARGET_FILE:${PROJECT_NAME}>"
        $<TARGET_FILE_DIR:${BINARY_NAME}> VERBATIM)

    else()
       message(FATAL_ERROR "Unsupported platform")
    endif()

    add_test(${BINARY_NAME} ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_NAME}
	--gtest_output=xml:${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)

    set_tests_properties(${BINARY_NAME} PROPERTIES TIMEOUT 240)

    if(PYTHONINTERP_FOUND)
      # Check that the test produced a result and create a failure if it didn't.
      # Guards against crashed and timed out tests.
      add_test(check_${BINARY_NAME} ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/check_test_ran.py
        ${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)
    endif()
  endforeach()
endmacro()

repository: LanxinL/CrowdSimCityU

repo_name: LanxinL/CrowdSimCityU


text:
/*
Copyright © 2020 NAME HERE <EMAIL ADDRESS>

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 cmd

import (
	"errors"
	"github.com/mhewedy/vermin/vms"
	"github.com/spf13/cobra"
)

// commitCmd represents the commit command
var commitCmd = &cobra.Command{
	Use:   "commit",
	Short: "Commit a VM into a new Image",
	Long:  `Commit a VM into a new Image to be used later as a template to create VMs from.`,
	Example: `
Commit vm_01 that have installed elastic inside as an image so to be used later to obtain a VM that contains elastic installed.
$ vermin commit vm_01 elk/elastic
`,
	Run: func(cmd *cobra.Command, args []string) {

		vmName := args[0]
		imageName := args[1]
		override, _ := cmd.Flags().GetBool("override")

		err := vms.Commit(vmName, imageName, override)
		exitOnError(err)
	},
	Args: func(cmd *cobra.Command, args []string) error {
		if len(args) < 1 {
			return errors.New("vm required")
		}
		if len(args) < 2 {
			return errors.New("new image name required, and should be in format base/name, example k8s/worker")
		}
		return nil
	},
	ValidArgsFunction: listStoppedVms,
}

func init() {
	rootCmd.AddCommand(commitCmd)

	// Here you will define your flags and configuration settings.

	// Cobra supports Persistent Flags which will work for this command
	// and all subcommands, e.g.:
	// commitCmd.PersistentFlags().String("foo", "", "A help for foo")

	// Cobra supports local flags which will only run when this command
	// is called directly, e.g.:
	commitCmd.Flags().BoolP("override", "", false, "override any existing image")
}


text:
PR = "r1"

SRC_URI_append += "file://02_noexec-stack.diff;patch=1 \
		   file://03_gnu89-inline.diff;patch=1 \
		   file://mpf_set_str_c.diff;patch=1 \
		   file://sh4-asmfix.patch;patch=1 \
		  "
require gmp.inc


text:
package sign

//go:generate runGoMobile.sh

import (
	crypto_rand "crypto/rand" // Custom so it's clear which rand we're using.
	"encoding/hex"

	"github.com/pkg/errors"
	"golang.org/x/crypto/nacl/sign"
)

type KeyPair struct {
	PrivateKey string
	PublicKey  string
}

func GenerateKey() (*KeyPair, error) {
	publicKey, privateKey, err := sign.GenerateKey(crypto_rand.Reader)
	if err != nil {
		return nil, errors.Wrap(err, "Failed to generate identity key pair")
	}

	keyPair := &KeyPair{
		PrivateKey: hex.EncodeToString(privateKey[:]),
		PublicKey:  hex.EncodeToString(publicKey[:]),
	}

	return keyPair, err
}

func Sign(privateKeyHex string, message string) (string, error) {
	var err error
	var privateKey [64]byte

	bytes, err := hex.DecodeString(privateKeyHex)
	if err != nil {
		return "", errors.Wrap(err, "Failed to decode hex string to bytes")
	}
	copy(privateKey[:], bytes)

	signedBytes := sign.Sign(nil, []byte(message), &privateKey)
	return hex.EncodeToString(signedBytes[:]), err
}

func Open(publicKeyHex string, signedMessage string) (string, error) {
	var publicKey [32]byte
	var err error
	bytes, err := hex.DecodeString(publicKeyHex)
	if err != nil {
		return "", errors.Wrap(err, "Failed to decode hex key to byte")
	}
	copy(publicKey[:], bytes)

	signedMessageBytes, err := hex.DecodeString(signedMessage)
	if err != nil {
		return "", errors.Wrap(err, "Failed to decode signed message hex to bytes")
	}

	message, ok := sign.Open(nil, signedMessageBytes, &publicKey)
	if !ok {
		return "", errors.New("Failed to verify signed message")
	}

	return string(message), nil
}


text:
package service

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

	"github.com/gomvn/gomvn/internal/config"
	"github.com/gomvn/gomvn/internal/entity"
)

func NewRepoService(conf *config.App, storage *Storage, ps *PathService) *RepoService {
	return &RepoService{
		repository: conf.Repository,
		storage:    storage,
		ps:         ps,
	}
}

type RepoService struct {
	repository []string
	storage    *Storage
	ps         *PathService
}

func (s *RepoService) GetRepositories() map[string][]*entity.Artifact {
	result := map[string][]*entity.Artifact{}
	for _, repo := range s.repository {
		result[repo] = []*entity.Artifact{}
		repoPath := s.storage.File(repo)
		_ = filepath.Walk(repoPath, func(path string, info os.FileInfo, err error) error {
			if strings.HasSuffix(path, ".pom") {
				path = strings.Replace(path, "\\", "/", -1)
				path = strings.Replace(path, repoPath+"/", "", 1)
				artifact := entity.NewArtifact(path, info.ModTime())
				result[repo] = append(result[repo], artifact)
			}
			return nil
		})
	}
	return result
}

repository: ciceroverneck/gomvn

repo_name: ciceroverneck/gomvn


text:
// MIT License

// Copyright (c) 2017 FLYING

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

package db

import (
	"log"

	"github.com/yang-f/beauty/settings"
	"github.com/ziutek/mymysql/mysql"
	_ "github.com/ziutek/mymysql/thrsafe"
)

func Query(sql string, params ...interface{}) ([]mysql.Row, mysql.Result, error) {
	return query(sql, true, params...)
}

func QueryNonLogging(sql string, params ...interface{}) ([]mysql.Row, mysql.Result, error) {
	return query(sql, false, params...)
}

func query(sql string, logging bool, params ...interface{}) ([]mysql.Row, mysql.Result, error) {
	db := mysql.New("tcp", "", settings.Local["mysql_host"], settings.Local["mysql_user"], settings.Local["mysql_pass"], settings.Local["mysql_database"])
	if err := db.Connect(); err != nil {
		log.Println(err)
		return nil, nil, err
	}
	defer db.Close()
	if logging {
		go log.Printf("query:"+sql, params...)
	}
	raws, res, err := db.Query(sql, params...)
	if err != nil {
		log.Println(err)
		return nil, nil, err
	}

	return raws, res, err
}

repository: yang-f/beauty

repo_name: yang-f/beauty


text:
package list

import (
	"fmt"
	"testing"
)

func TestLinkedList(t *testing.T) {
	// Test Prepend/Get
	l := NewList()

	l.Prepend(NewNode(1))
	l.Prepend(NewNode(2))
	l.Prepend(NewNode(3))

	zero := *slice(l.Get(0))[0].(*Node).Value.(*Node)
	one := *slice(l.Get(1))[0].(*Node).Value.(*Node)
	two := *slice(l.Get(2))[0].(*Node).Value.(*Node)

	if zero != *NewNode(3) ||
		one != *NewNode(2) ||
		two != *NewNode(1) {

		fmt.Println(*one.Value.(*Node), *NewNode(2))
		fmt.Println(zero.Value)
		fmt.Println(one.Value)
		fmt.Println(two.Value)
		t.Error()
	}

	// Test Append
	k := NewList()

	k.Append(NewNode(1))
	k.Append(NewNode(2))
	k.Append(NewNode(3))

	zero = *slice(k.Get(0))[0].(*Node).Value.(*Node)
	one = *slice(k.Get(1))[0].(*Node).Value.(*Node)
	two = *slice(k.Get(2))[0].(*Node).Value.(*Node)

	if zero != *NewNode(1) ||
		one != *NewNode(2) ||
		two != *NewNode(3) {

		fmt.Println(zero.Value)
		fmt.Println(one.Value)
		fmt.Println(two.Value)
		t.Error()
	}

	// Test Add
	k.Add(NewNode(8), 1)

	zero = *slice(k.Get(0))[0].(*Node).Value.(*Node)
	one = *slice(k.Get(1))[0].(*Node).Value.(*Node)
	two = *slice(k.Get(2))[0].(*Node).Value.(*Node)

	if zero != *NewNode(1) ||
		one != *NewNode(8) ||
		two != *NewNode(2) {

		fmt.Println(zero.Value)
		fmt.Println(one.Value)
		fmt.Println(two.Value)

		t.Error()
	}

	// Test Concat
	l.Concat(k)
	if l.Len() != 7 {
		t.Error()
	}

	// Test Each
	counter := 0
	f := func(node *Node) {
		counter += node.Value.(int)
	}

	l.Map(f)
	if counter != 20 {
		t.Error()
	}

	// Test Find
	index, _ := l.Find(NewNode(1))
	if index != 3 {
		fmt.Println(index)
		t.Error()
	}

	// Test Remove
	l.Remove(*NewNode(8))

	counter = 0
	l.Map(func(n *Node) {
		counter += n.Value.(int)
	})

	if counter != 12 {
		t.Error()
	}

	// Test Clear
	l.Clear()
	if l.Len() != 0 {
		t.Error()
	}

}

func slice(args ...interface{}) []interface{} {
	return args
}


text:
require recipes-bsp/barebox/barebox.inc

SRC_URI[sha256sum] = "20532daff1720fbefa0e02dba0294e6817d29c155f49b9b549db9577435fc7b6"

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

SRC_URI += "file://defconfig \
            file://env \
            file://0001-of-base-factor-out-of_merge_nodes-from-of_copy_node.patch \
            file://0002-of-support-of_ensure_probed-for-top-level-machine-de.patch \
            file://0003-boards-qemu-virt-ensure-board-driver-probe-at-postco.patch \
            file://0004-boards-qemu-virt-support-passing-in-FIT-public-key.patch \
            "

repository: jluebbe/meta-code-signing

repo_name: jluebbe/meta-code-signing


text:
SUMMARY = "PolicyKit Qt wrapper"
LICENSE = "BSD-3-Clause & GPL-2.0-or-later & LGPL-2.0-or-later"
LIC_FILES_CHKSUM = " \
    file://LICENSES/BSD-3-Clause.txt;md5=954f4d71a37096249f837652a7f586c0 \
    file://LICENSES/GPL-2.0-or-later.txt;md5=9e2385fe012386d34dcc5c9863070881 \
    file://LICENSES/LGPL-2.0-or-later.txt;md5=da48810c4ddf8e49efa031294a26b98c \
"

inherit kde-base cmake_lib features_check

REQUIRED_DISTRO_FEATURES = "polkit"

DEPENDS += "polkit glib-2.0"

PV = "0.114.0"
SRC_URI = "${KDE_MIRROR}/stable/${BPN}/${BPN}-${PV}.tar.xz"
SRC_URI[sha256sum] = "2eb0f22445888295ffa2bfbc0c3693847a0f973bb6b0c3e4cce0218be7e3907e"

CMAKE_ALIGN_SYSROOT[1] = "PolkitQt5-1, -S${libdir}, -s${OE_QMAKE_PATH_HOST_LIBS}/"
CMAKE_ALIGN_SYSROOT[2] = "PolkitQt5-1, -s${POLKITQT-1_LIB_DIR}, -s${OE_QMAKE_PATH_HOST_LIBS}"
CMAKE_ALIGN_SYSROOT[3] = "PolkitQt5-1, -S${includedir}, -s${CMAKE_QT5_EX_PATH_HOST_HEADERS}"
CMAKE_ALIGN_SYSROOT[4] = "PolkitQt5-1, -s${PACKAGE_PREFIX_DIR}/include, -s${CMAKE_QT5_EX_PATH_HOST_HEADERS}"