text:
package main

import (
	"context"
	"os"

	"github.com/chunganhbk/gin-go/internal/app"
	"github.com/chunganhbk/gin-go/pkg/logger"
	"github.com/urfave/cli/v2"
)

// VERSION：go build -ldflags "-X main.VERSION=x.x.x"
var VERSION = "1.0.1"

func main() {
	logger.SetVersion(VERSION)
	ctx := logger.NewTraceIDContext(context.Background(), "main")

	app := cli.NewApp()
	app.Name = "server"
	app.Version = VERSION
	app.Usage = "RBAC scaffolding based on GIN + GORM/MONGO + CASBIN + WIRE."
	app.Commands = []*cli.Command{
		newWebCmd(ctx),
	}
	err := app.Run(os.Args)
	if err != nil {
		logger.Errorf(ctx, err.Error())
	}
}

func newWebCmd(ctx context.Context) *cli.Command {
	return &cli.Command{
		Name:  "web",
		Usage: "Run web service",
		Flags: []cli.Flag{
			&cli.StringFlag{
				Name:     "conf",
				Aliases:  []string{"c"},
				Usage:    "Configuration file(.json,.yaml,.toml)",
				Required: true,
			},
			&cli.StringFlag{
				Name:     "models",
				Aliases:  []string{"m"},
				Usage:    "casbin's access control model(.conf)",
				Required: true,
			},
			&cli.StringFlag{
				Name:  "menu",
				Usage: "Initialize the menu data configuration file (.yaml)",
			},
			&cli.StringFlag{
				Name:  "www",
				Usage: "Static site directory",
			},
		},
		Action: func(c *cli.Context) error {
			return app.Run(ctx,
				app.SetConfigFile(c.String("conf")),
				app.SetModelFile(c.String("models")),
				app.SetWWWDir(c.String("www")),
				app.SetMenuFile(c.String("menu")),
				app.SetVersion(VERSION))
		},
	}
}

license: MIT

repository: chunganhbk/gin-go

license_type: permissive

repo_name: chunganhbk/gin-go

branch_name: refs/heads/master

extension: go


text:
// Copyright (c) 2004-present Facebook All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Code generated by entc, DO NOT EDIT.

package ent

import (
	"context"
	"errors"
	"fmt"
	"time"

	"github.com/facebook/ent/dialect/sql/sqlgraph"
	"github.com/facebook/ent/schema/field"
	"github.com/facebookincubator/symphony/pkg/ent/block"
	"github.com/facebookincubator/symphony/pkg/ent/flow"
	"github.com/facebookincubator/symphony/pkg/ent/flowdraft"
	"github.com/facebookincubator/symphony/pkg/flowengine/flowschema"
)

// FlowCreate is the builder for creating a Flow entity.
type FlowCreate struct {
	config
	mutation *FlowMutation
	hooks    []Hook
}

// SetCreateTime sets the create_time field.
func (fc *FlowCreate) SetCreateTime(t time.Time) *FlowCreate {
	fc.mutation.SetCreateTime(t)
	return fc
}

// SetNillableCreateTime sets the create_time field if the given value is not nil.
func (fc *FlowCreate) SetNillableCreateTime(t *time.Time) *FlowCreate {
	if t != nil {
		fc.SetCreateTime(*t)
	}
	return fc
}

// SetUpdateTime sets the update_time field.
func (fc *FlowCreate) SetUpdateTime(t time.Time) *FlowCreate {
	fc.mutation.SetUpdateTime(t)
	return fc
}

// SetNillableUpdateTime sets the update_time field if the given value is not nil.
func (fc *FlowCreate) SetNillableUpdateTime(t *time.Time) *FlowCreate {
	if t != nil {
		fc.SetUpdateTime(*t)
	}
	return fc
}

// SetName sets the name field.
func (fc *FlowCreate) SetName(s string) *FlowCreate {
	fc.mutation.SetName(s)
	return fc
}

// SetDescription sets the description field.
func (fc *FlowCreate) SetDescription(s string) *FlowCreate {
	fc.mutation.SetDescription(s)
	return fc
}

// SetNillableDescription sets the description field if the given value is not nil.
func (fc *FlowCreate) SetNillableDescription(s *string) *FlowCreate {
	if s != nil {
		fc.SetDescription(*s)
	}
	return fc
}

// SetEndParamDefinitions sets the end_param_definitions field.
func (fc *FlowCreate) SetEndParamDefinitions(fd []*flowschema.VariableDefinition) *FlowCreate {
	fc.mutation.SetEndParamDefinitions(fd)
	return fc
}

// SetStatus sets the status field.
func (fc *FlowCreate) SetStatus(f flow.Status) *FlowCreate {
	fc.mutation.SetStatus(f)
	return fc
}

// SetNillableStatus sets the status field if the given value is not nil.
func (fc *FlowCreate) SetNillableStatus(f *flow.Status) *FlowCreate {
	if f != nil {
		fc.SetStatus(*f)
	}
	return fc
}

// SetNewInstancesPolicy sets the newInstancesPolicy field.
func (fc *FlowCreate) SetNewInstancesPolicy(fip flow.NewInstancesPolicy) *FlowCreate {
	fc.mutation.SetNewInstancesPolicy(fip)
	return fc
}

// SetNillableNewInstancesPolicy sets the newInstancesPolicy field if the given value is not nil.
func (fc *FlowCreate) SetNillableNewInstancesPolicy(fip *flow.NewInstancesPolicy) *FlowCreate {
	if fip != nil {
		fc.SetNewInstancesPolicy(*fip)
	}
	return fc
}

// AddBlockIDs adds the blocks edge to Block by ids.
func (fc *FlowCreate) AddBlockIDs(ids ...int) *FlowCreate {
	fc.mutation.AddBlockIDs(ids...)
	return fc
}

// AddBlocks adds the blocks edges to Block.
func (fc *FlowCreate) AddBlocks(b ...*Block) *FlowCreate {
	ids := make([]int, len(b))
	for i := range b {
		ids[i] = b[i].ID
	}
	return fc.AddBlockIDs(ids...)
}

// SetDraftID sets the draft edge to FlowDraft by id.
func (fc *FlowCreate) SetDraftID(id int) *FlowCreate {
	fc.mutation.SetDraftID(id)
	return fc
}

// SetNillableDraftID sets the draft edge to FlowDraft by id if the given value is not nil.
func (fc *FlowCreate) SetNillableDraftID(id *int) *FlowCreate {
	if id != nil {
		fc = fc.SetDraftID(*id)
	}
	return fc
}

// SetDraft sets the draft edge to FlowDraft.
func (fc *FlowCreate) SetDraft(f *FlowDraft) *FlowCreate {
	return fc.SetDraftID(f.ID)
}

// Mutation returns the FlowMutation object of the builder.
func (fc *FlowCreate) Mutation() *FlowMutation {
	return fc.mutation
}

// Save creates the Flow in the database.
func (fc *FlowCreate) Save(ctx context.Context) (*Flow, error) {
	var (
		err  error
		node *Flow
	)
	fc.defaults()
	if len(fc.hooks) == 0 {
		if err = fc.check(); err != nil {
			return nil, err
		}
		node, err = fc.sqlSave(ctx)
	} else {
		var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
			mutation, ok := m.(*FlowMutation)
			if !ok {
				return nil, fmt.Errorf("unexpected mutation type %T", m)
			}
			if err = fc.check(); err != nil {
				return nil, err
			}
			fc.mutation = mutation
			node, err = fc.sqlSave(ctx)
			mutation.done = true
			return node, err
		})
		for i := len(fc.hooks) - 1; i >= 0; i-- {
			mut = fc.hooks[i](mut)
		}
		if _, err := mut.Mutate(ctx, fc.mutation); err != nil {
			return nil, err
		}
	}
	return node, err
}

// SaveX calls Save and panics if Save returns an error.
func (fc *FlowCreate) SaveX(ctx context.Context) *Flow {
	v, err := fc.Save(ctx)
	if err != nil {
		panic(err)
	}
	return v
}

// defaults sets the default values of the builder before save.
func (fc *FlowCreate) defaults() {
	if _, ok := fc.mutation.CreateTime(); !ok {
		v := flow.DefaultCreateTime()
		fc.mutation.SetCreateTime(v)
	}
	if _, ok := fc.mutation.UpdateTime(); !ok {
		v := flow.DefaultUpdateTime()
		fc.mutation.SetUpdateTime(v)
	}
	if _, ok := fc.mutation.Status(); !ok {
		v := flow.DefaultStatus
		fc.mutation.SetStatus(v)
	}
	if _, ok := fc.mutation.NewInstancesPolicy(); !ok {
		v := flow.DefaultNewInstancesPolicy
		fc.mutation.SetNewInstancesPolicy(v)
	}
}

// check runs all checks and user-defined validators on the builder.
func (fc *FlowCreate) check() error {
	if _, ok := fc.mutation.CreateTime(); !ok {
		return &ValidationError{Name: "create_time", err: errors.New("ent: missing required field \"create_time\"")}
	}
	if _, ok := fc.mutation.UpdateTime(); !ok {
		return &ValidationError{Name: "update_time", err: errors.New("ent: missing required field \"update_time\"")}
	}
	if _, ok := fc.mutation.Name(); !ok {
		return &ValidationError{Name: "name", err: errors.New("ent: missing required field \"name\"")}
	}
	if v, ok := fc.mutation.Name(); ok {
		if err := flow.NameValidator(v); err != nil {
			return &ValidationError{Name: "name", err: fmt.Errorf("ent: validator failed for field \"name\": %w", err)}
		}
	}
	if _, ok := fc.mutation.Status(); !ok {
		return &ValidationError{Name: "status", err: errors.New("ent: missing required field \"status\"")}
	}
	if v, ok := fc.mutation.Status(); ok {
		if err := flow.StatusValidator(v); err != nil {
			return &ValidationError{Name: "status", err: fmt.Errorf("ent: validator failed for field \"status\": %w", err)}
		}
	}
	if _, ok := fc.mutation.NewInstancesPolicy(); !ok {
		return &ValidationError{Name: "newInstancesPolicy", err: errors.New("ent: missing required field \"newInstancesPolicy\"")}
	}
	if v, ok := fc.mutation.NewInstancesPolicy(); ok {
		if err := flow.NewInstancesPolicyValidator(v); err != nil {
			return &ValidationError{Name: "newInstancesPolicy", err: fmt.Errorf("ent: validator failed for field \"newInstancesPolicy\": %w", err)}
		}
	}
	return nil
}

func (fc *FlowCreate) sqlSave(ctx context.Context) (*Flow, error) {
	_node, _spec := fc.createSpec()
	if err := sqlgraph.CreateNode(ctx, fc.driver, _spec); err != nil {
		if cerr, ok := isSQLConstraintError(err); ok {
			err = cerr
		}
		return nil, err
	}
	id := _spec.ID.Value.(int64)
	_node.ID = int(id)
	return _node, nil
}

func (fc *FlowCreate) createSpec() (*Flow, *sqlgraph.CreateSpec) {
	var (
		_node = &Flow{config: fc.config}
		_spec = &sqlgraph.CreateSpec{
			Table: flow.Table,
			ID: &sqlgraph.FieldSpec{
				Type:   field.TypeInt,
				Column: flow.FieldID,
			},
		}
	)
	if value, ok := fc.mutation.CreateTime(); ok {
		_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
			Type:   field.TypeTime,
			Value:  value,
			Column: flow.FieldCreateTime,
		})
		_node.CreateTime = value
	}
	if value, ok := fc.mutation.UpdateTime(); ok {
		_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
			Type:   field.TypeTime,
			Value:  value,
			Column: flow.FieldUpdateTime,
		})
		_node.UpdateTime = value
	}
	if value, ok := fc.mutation.Name(); ok {
		_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
			Type:   field.TypeString,
			Value:  value,
			Column: flow.FieldName,
		})
		_node.Name = value
	}
	if value, ok := fc.mutation.Description(); ok {
		_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
			Type:   field.TypeString,
			Value:  value,
			Column: flow.FieldDescription,
		})
		_node.Description = &value
	}
	if value, ok := fc.mutation.EndParamDefinitions(); ok {
		_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
			Type:   field.TypeJSON,
			Value:  value,
			Column: flow.FieldEndParamDefinitions,
		})
		_node.EndParamDefinitions = value
	}
	if value, ok := fc.mutation.Status(); ok {
		_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
			Type:   field.TypeEnum,
			Value:  value,
			Column: flow.FieldStatus,
		})
		_node.Status = value
	}
	if value, ok := fc.mutation.NewInstancesPolicy(); ok {
		_spec.Fields = append(_spec.Fields, &sqlgraph.FieldSpec{
			Type:   field.TypeEnum,
			Value:  value,
			Column: flow.FieldNewInstancesPolicy,
		})
		_node.NewInstancesPolicy = value
	}
	if nodes := fc.mutation.BlocksIDs(); len(nodes) > 0 {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2M,
			Inverse: false,
			Table:   flow.BlocksTable,
			Columns: []string{flow.BlocksColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: &sqlgraph.FieldSpec{
					Type:   field.TypeInt,
					Column: block.FieldID,
				},
			},
		}
		for _, k := range nodes {
			edge.Target.Nodes = append(edge.Target.Nodes, k)
		}
		_spec.Edges = append(_spec.Edges, edge)
	}
	if nodes := fc.mutation.DraftIDs(); len(nodes) > 0 {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2O,
			Inverse: false,
			Table:   flow.DraftTable,
			Columns: []string{flow.DraftColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: &sqlgraph.FieldSpec{
					Type:   field.TypeInt,
					Column: flowdraft.FieldID,
				},
			},
		}
		for _, k := range nodes {
			edge.Target.Nodes = append(edge.Target.Nodes, k)
		}
		_spec.Edges = append(_spec.Edges, edge)
	}
	return _node, _spec
}

// FlowCreateBulk is the builder for creating a bulk of Flow entities.
type FlowCreateBulk struct {
	config
	builders []*FlowCreate
}

// Save creates the Flow entities in the database.
func (fcb *FlowCreateBulk) Save(ctx context.Context) ([]*Flow, error) {
	specs := make([]*sqlgraph.CreateSpec, len(fcb.builders))
	nodes := make([]*Flow, len(fcb.builders))
	mutators := make([]Mutator, len(fcb.builders))
	for i := range fcb.builders {
		func(i int, root context.Context) {
			builder := fcb.builders[i]
			builder.defaults()
			var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
				mutation, ok := m.(*FlowMutation)
				if !ok {
					return nil, fmt.Errorf("unexpected mutation type %T", m)
				}
				if err := builder.check(); err != nil {
					return nil, err
				}
				builder.mutation = mutation
				nodes[i], specs[i] = builder.createSpec()
				var err error
				if i < len(mutators)-1 {
					_, err = mutators[i+1].Mutate(root, fcb.builders[i+1].mutation)
				} else {
					// Invoke the actual operation on the latest mutation in the chain.
					if err = sqlgraph.BatchCreate(ctx, fcb.driver, &sqlgraph.BatchCreateSpec{Nodes: specs}); err != nil {
						if cerr, ok := isSQLConstraintError(err); ok {
							err = cerr
						}
					}
				}
				mutation.done = true
				if err != nil {
					return nil, err
				}
				id := specs[i].ID.Value.(int64)
				nodes[i].ID = int(id)
				return nodes[i], nil
			})
			for i := len(builder.hooks) - 1; i >= 0; i-- {
				mut = builder.hooks[i](mut)
			}
			mutators[i] = mut
		}(i, ctx)
	}
	if len(mutators) > 0 {
		if _, err := mutators[0].Mutate(ctx, fcb.builders[0].mutation); err != nil {
			return nil, err
		}
	}
	return nodes, nil
}

// SaveX calls Save and panics if Save returns an error.
func (fcb *FlowCreateBulk) SaveX(ctx context.Context) []*Flow {
	v, err := fcb.Save(ctx)
	if err != nil {
		panic(err)
	}
	return v
}

repository: duranrojasm/symphony

repo_name: duranrojasm/symphony

branch_name: refs/heads/main


text:
@techreport{Defend:2008,
  author = {Benessa Defend and Mastooreh Salajegheh and Kevin Fu and Sozo Inoue},
  title = {Protecting Global Medical Telemetry Infrastructure},
  institution = {Institute of Information Infrastructure Protection (I3P)},
  url = {https://web.eecs.umich.edu/~kevinfu/papers/whitepaper-protecting_global_medical.pdf},
  note = {\\\url{https://web.eecs.umich.edu/~kevinfu/papers/whitepaper-protecting_global_medical.pdf}},
  month = jan,
  monthnum = 1,
  year = 2008,
  sponsors = {DHS Science and Technology Directorate 2003-TK-TX-0003},
  keywords = {Security, Health}
}

extension: bib


text:
<!doctype html>

		<meta charset="utf-8">

		<title>reveal.js - The HTML Presentation Framework</title>

		<meta name="description" content="A framework for easily creating beautiful presentations using HTML">
		<meta name="author" content="Hakim El Hattab">

		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

		<link rel="stylesheet" href="css/reveal.min.css">
		<link rel="stylesheet" href="css/theme/default.css" id="theme">

		<link rel="stylesheet" href="lib/css/zenburn.css">

extension: bb


text:
package main

import (
	"fmt"
	"log"
	"os"
	"path/filepath"
)

func matcher(pattern string, name string) {
	matches, err := filepath.Match(pattern, name)
	if err != nil {
		fmt.Println(err)
	}

	fmt.Println(matches)
}

func matcher_glob(pattern string) {
	matches, err := filepath.Glob(pattern)
	if err != nil {
		fmt.Println(err)
	}

	fmt.Println(matches)
}

func main() {

	// just print current working dir
	dir, err := os.Getwd()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(dir)

	// test 1
	matcher_glob("./src/github.com/de-jcup/playground/files/sub*")
	matcher_glob("./src/github.com/de-jcup/playground/files/*sub*/*sub*/*.txt")
	matcher_glob("src/github.com/de-jcup/playground/files/*sub*/*sub*/*.txt")
	matcher_glob("src/github.com/de-jcup/playground/files")
	matcher_glob("src/github.com/de-jcup/*/*les")
	matcher_glob("*files*")

	// test 2
	matcher("*/src/github.com/de-jcup/*/*les", "./src/github.com/de-jcup/playground/xyz/files")
}

repository: de-jcup/playground

repo_name: de-jcup/playground


text:
################################################################################                                                                             #
# Copyright (c) Almério José Venâncio Pains Soares                            #
#                                                                             #
# Distributed under the terms of the Apache 2 License.                        #
#                                                                             #
# The full license is in the file LICENSE, distributed with this software.    #
################################################################################
# cmps cmake module
# This module sets the following variables in your project::
#
#   cmps_FOUND - true if mps found on the system
#   cmps_INCLUDE_DIRS - the directory containing mps headers
#   cmps_LIBRARY - empty

@PACKAGE_INIT@

if(NOT TARGET @PROJECT_NAME@)
    include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake")
    get_target_property(@PROJECT_NAME@_INCLUDE_DIRS @PROJECT_NAME@ INTERFACE_INCLUDE_DIRECTORIES)
endif()

repository: almeriopamplona/cmps

repo_name: almeriopamplona/cmps

extension: in


text:
import { createCrystallizeOrder } from 'lib-api/crystallize/order';
import { emailOrderConfirmation } from 'lib-api/emails';
import { orderNormalizer } from 'lib-api/payment-providers/stripe';
import { validatePaymentModel } from 'lib-api/util/checkout';

export default async (req, res) => {
  try {
    const { paymentIntentId, paymentModel } = req.body;
    const validPaymentModel = await validatePaymentModel({ paymentModel });

    const validCrystallizeOrder = await orderNormalizer({
      paymentIntentId,
      paymentModel: validPaymentModel
    });

    const createCrystallizeOrderResponse = await createCrystallizeOrder(
      validCrystallizeOrder
    );

    await emailOrderConfirmation(
      createCrystallizeOrderResponse.data.orders.create.id
    );

    return res.status(200).send({
      success: true,
      ...createCrystallizeOrderResponse
    });
  } catch (error) {
    console.log(error);
    return res.status(503).send({
      success: false,
      error: error.stack
    });
  }
};

gha_license_id: MIT

extension: js


text:
SUMMARY = "Perl module for runtime module handling"
DESCRIPTION = "Module::Runtime deals with runtime handling of Perl modules, which are normally\n\
 handled at compile time.\n\
 .\n\
 This module provide functions that can, for example, require or use modules at\n\
 runtime, check for module names validity, compose module names and more."
HOMEPAGE = "https://metacpan.org/release/Module-Runtime/"

PR = "r0"
inherit debian-package
PV = "0.014"

LICENSE = "Artistic-1.0 | GPL-1.0+"
LIC_FILES_CHKSUM = "file://README;beginline=43;endline=44;md5=62e24a93342fede7221d66335c716f34"
inherit cpan_build
# Souce format is 3.0 but there is no debian patch files
DEBIAN_QUILT_PATCHES = ""

repository: manut/meta-combo

repo_name: manut/meta-combo

branch_name: refs/heads/morty

gha_language: BitBake


text:
@String{elsevier_adhoc = {Elsevier Ad-Hoc Networks}}
@String{toit = {IEEE Transactions on Information Theory}}
@String{toc = {IEEE Transactions on Computers}}
@String{ton = {IEEE/ACM Transactions on Networking}}
@String{ccr = {ACM SIGCOMM Computer Communication Review}}
@String{jsac = {IEEE Journal on Selected Areas in Communications}}
@String{mc2r = {Mobile Computing and Communications Review}}
@String{tocs = {ACM Transactions on Computer Systems}}
@String{physrevE = {American Physical Society Physical Review E}}
@String{mna = {Mobile Networks and Applications}}

gha_language: TeX


text:
DESCRIPTION= " DVI Viewer for Opie/Qtopia"
SECTION = "base"
PRIORITY = "optional"
LICENSE = "GPL"

SRC_URI = "http://ichitokumei.hp.infoseek.co.jp/${PN}/source/${P}.tar.gz"
S = "${WORKDIR}/${PN}/src"

inherit palmtop

do_install() {
        install -d ${D}${palmtopdir}/{bin,apps/Applications,pics}
        install -D -m 755 qualendar ${D}${palmtopdir}/bin/qualendar
        install -D -m 644 qualendar.desktop ${D}${palmtopdir}/apps/Applications/qualendar.desktop
        install -d ${D}${palmtopdir}/pics
        cp -pPR *.png ${D}${palmtopdir}/pics/
}

SRC_URI[md5sum] = "32b3c853aab4cc3f259864f9cd232e4a"
SRC_URI[sha256sum] = "d358a4012496ddaf2b7b9d337327cb6c3372698cd5c8572e227ace01e8558072"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
package cslb

import (
	"math"
	"sync"
	"sync/atomic"
)

const (
	NodeCountUnlimited = math.MaxInt
)

type Group struct {
	m             sync.Map // string => *Node
	originalCount int64
	currentCount  int64

	maxNodeCount int
}

func NewGroup(maxNodeCount int) *Group {
	return &Group{
		m:             sync.Map{},
		originalCount: 0,
		currentCount:  0,
		maxNodeCount:  maxNodeCount,
	}
}

func (g *Group) Set(nodes []Node) {
	nodesCheck := make(map[string]struct{}, len(nodes))
	for _, node := range nodes {
		key := node.String()
		nodesCheck[key] = struct{}{}
		g.m.Store(key, node)
	}

	g.m.Range(func(key, value interface{}) bool {
		if _, ok := nodesCheck[key.(string)]; !ok {
			g.m.Delete(key)
		}
		return true
	})

	atomic.StoreInt64(&g.originalCount, int64(len(nodes)))
	atomic.StoreInt64(&g.currentCount, int64(len(nodes)))
}

func (g *Group) Get() []Node {
	result := make([]Node, 0)
	g.m.Range(func(key, value interface{}) bool {
		result = append(result, value.(Node))
		if len(result) >= g.maxNodeCount {
			return false
		}
		return true
	})
	return result
}

func (g *Group) GetNode(key string) Node {
	if val, loaded := g.m.Load(key); loaded {
		return (val).(Node)
	}
	return nil
}

func (g *Group) GetOriginalCount() int64 {
	return atomic.LoadInt64(&g.originalCount)
}

func (g *Group) GetCurrentCount() int64 {
	return atomic.LoadInt64(&g.currentCount)
}

func (g *Group) Exile(node Node) bool {
	_, loaded := g.m.LoadAndDelete(node.String())
	if loaded {
		atomic.AddInt64(&g.currentCount, -1)
	}
	return loaded
}

repository: XiaoMi/go-fds

repo_name: XiaoMi/go-fds

gha_language: Go


text:
DESCRIPTION = "eZ430 Chronos Tools - MSP430 Development Kit/Watch"
HOMEPAGE = "http://processors.wiki.ti.com/index.php/EZ430-Chronos"
LICENSE = "TI-BSD"
# We can't use the actualy source file, since it has space in its name :(
LIC_FILES_CHKSUM = "file://eZ430-Chronos_CC_1_1.tcl;md5=59ba6ee0a26650ec660a4e65a9462806"

SECTION = "multimedia"

inherit allarch

PV = "1_05_00_00"

SRC_URI = "http://focus.ti.com/lit/sw/slac388/slac388.zip;name=slac388zip"

SRC_URI[slac388zip.md5sum] = "22d4104a07af584222828fb377793796"
SRC_URI[slac388zip.sha256sum] = "1c9cd1e36015e8db3b36c98be41907628144b76002b3f76b27fd310f4bd35ad7"

require ../includes/ti-paths.inc
require ../includes/ti-staging.inc
require ../includes/ti-eula-unpack.inc

S = "${WORKDIR}/ti/eZ430-Chronos"

BINFILE="Chronos-Setup"
TI_BIN_UNPK_CMDS="Y:workdir:"

do_unpack_append() {
    os.system('mv "Texas Instruments" ti')
}

do_configure() {
	cp Control\ Center/Chronos\ Control\ Center/eZ430-Chronos_CC_1_1.tcl ${S}
}

do_compile() {
    echo "Do Nothing for Now"
}

do_install() {

    install -d ${D}/${installdir}/ti-msp430-chronos-apps
    cp -pPrf "${S}"/"Control Center"/* ${D}/${installdir}/ti-msp430-chronos-apps

    # Remove dos formatting
    dos2unix "${D}/${installdir}/ti-msp430-chronos-apps/Chronos Data Logger"/*
    dos2unix "${D}/${installdir}/ti-msp430-chronos-apps/Chronos Control Center"/*

    # Should probably also remove hardcoded script reference to tcl8.5
}

PACKAGES += "ti-msp430-chronos-apps"
FILES_ti-msp430-chronos-apps = "${installdir}/ti-msp430-chronos-apps/*"

RDEPENDS_ti-msp430-chronos-apps += " tcl tk xdotool"
RRECOMMENDS_ti-msp430-chronos-apps = "kernel-module-cdc-acm"

repository: Angstrom-distribution/meta-ti

repo_name: Angstrom-distribution/meta-ti

gha_language: BlitzBasic


text:
@inproceedings{baduel:hal-01815510,
 address = {Toulouse, France},
 author = {Baduel, Ronan and Chami, Mohammad and Bruel, Jean-Michel and Ober, Iulian},
 booktitle = {European Conference on Modelling Foundations and Applications},
 hal_id = {hal-01815510},
 hal_version = {v1},
 keywords = {SysML , Systems Modeling , MBSE , Model Verification},
 month = {June},
 pdf = {https://hal.archives-ouvertes.fr/hal-01815510/file/2018-ECMFA.pdf},
 title = {SysML Models Verification and Validation in an Industrial Context: Challenges and Experimentation},
 url = {https://hal.archives-ouvertes.fr/hal-01815510},
 year = {2018}
}


text:
#
#   Copyright (C) 2015 Pelagicore AB
#
#   SPDX-License-Identifier: MIT
#
require ${PN}.inc

PR = "${INC_PR}.0"

SRC_URI += " \
	git://git.gitorious.org/qt/qtpim.git;protocol=https \
	"

S = "${WORKDIR}/git/"

SRCREV = "7bd0f9ad742558cf4b33aa7e372713fdb680d2ad"

repository: sashko/meta-bistro

repo_name: sashko/meta-bistro


text:
FILE(REMOVE_RECURSE
  "CMakeFiles/flb-plugin-out_nats.dir/nats.c.o"
  "../../library/libflb-plugin-out_nats.pdb"
  "../../library/libflb-plugin-out_nats.a"
)

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

extension: cmake


text:
#.rst:
# FindShadow
# -----------
#
# Find the Shadow binary
#
# Imported Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the following :prop_tgt:`IMPORTED` targets:
#
# ``shadow``
#   The Binary for shadow, if found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module will set the following variables in your project:
#
# ``SHADOW_FOUND``
#   System has the Bitcoin plugin for v0.19.1 dev.

find_program(_SHADOW
        NAMES
        shadow
        HINTS
        "${CMAKE_CURRENT_LIST_DIR}/../Install"
        PATH_SUFFIXES
        bin
        NO_DEFAULT_PATH
        NO_SYSTEM_ENVIRONMENT_PATH
        )

include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)

find_package_handle_standard_args(shadow
        REQUIRED_VARS
        _SHADOW
        FAIL_MESSAGE
        "Could NOT find shadow binary , try to install shadow first."
        )

if(shadow_FOUND)
    if(NOT TARGET shadow)
        add_executable(shadow IMPORTED)
        set_target_properties(shadow PROPERTIES
                IMPORTED_LINK_INTERFACE_LANGUAGES "C"
                IMPORTED_LOCATION "${_SHADOW}")
    endif()
endif()


text:
package mapstats

import (
	"context"
	"database/sql"
	"errors"

	"github.com/FlowingSPDG/get5-web-go/backend/entity"
	"github.com/FlowingSPDG/get5-web-go/backend/gateway/database"
	mapstats_gen "github.com/FlowingSPDG/get5-web-go/backend/gateway/database/mysql/mapstats/generated"
)

type mapStatsRepository struct {
	queries *mapstats_gen.Queries
}

func NewMapStatsRepository(db *sql.DB) database.MapStatsRepository {
	queries := mapstats_gen.New(db)
	return &mapStatsRepository{
		queries: queries,
	}
}

func NewMapStatsRepositoryWithTx(db *sql.DB, tx *sql.Tx) database.MapStatsRepository {
	queries := mapstats_gen.New(db).WithTx(tx)
	return &mapStatsRepository{
		queries: queries,
	}
}

// GetMapStats implements database.MapStatsRepository.
func (msr *mapStatsRepository) GetMapStats(ctx context.Context, id int64) (*entity.MapStats, error) {
	res, err := msr.queries.GetMapStats(ctx, id)
	if err != nil {
		if errors.Is(err, sql.ErrNoRows) {
			return nil, database.NewNotFoundError(err)
		}
		return nil, database.NewInternalError(err)
	}

	return &entity.MapStats{
		ID:         res.ID,
		MatchID:    res.MatchID,
		MapNumber:  res.MapNumber,
		MapName:    res.MapName,
		StartTime:  &res.StartTime.Time,
		EndTime:    &res.EndTime.Time,
		Winner:     &res.Winner.Int64,
		Team1Score: res.Team1Score,
		Team2Score: res.Team2Score,
	}, nil
}

// GetMapStatsByMatch implements database.MapStatsRepository.
func (msr *mapStatsRepository) GetMapStatsByMatch(ctx context.Context, matchID int64) ([]*entity.MapStats, error) {
	res, err := msr.queries.GetMapStatsByMatch(ctx, matchID)
	if err != nil {
		if errors.Is(err, sql.ErrNoRows) {
			return nil, database.NewNotFoundError(err)
		}
		return nil, database.NewInternalError(err)
	}

	mapStats := make([]*entity.MapStats, 0, len(res))
	for _, m := range res {
		mapStats = append(mapStats, &entity.MapStats{
			ID:         m.ID,
			MatchID:    m.MatchID,
			MapNumber:  m.MapNumber,
			MapName:    m.MapName,
			StartTime:  &m.StartTime.Time,
			EndTime:    &m.EndTime.Time,
			Winner:     &m.Winner.Int64,
			Team1Score: m.Team1Score,
			Team2Score: m.Team2Score,
		})
	}

	return mapStats, nil
}

// GetMapStatsByMatchAndMap implements database.MapStatsRepository.
func (msr *mapStatsRepository) GetMapStatsByMatchAndMap(ctx context.Context, matchID int64, mapNumber uint32) (*entity.MapStats, error) {
	res, err := msr.queries.GetMapStatsByMatchAndMap(ctx, mapstats_gen.GetMapStatsByMatchAndMapParams{
		MatchID:   matchID,
		MapNumber: mapNumber,
	})
	if err != nil {
		if errors.Is(err, sql.ErrNoRows) {
			return nil, database.NewNotFoundError(err)
		}
		return nil, database.NewInternalError(err)
	}

	return &entity.MapStats{
		ID:         res.ID,
		MatchID:    res.MatchID,
		MapNumber:  res.MapNumber,
		MapName:    res.MapName,
		StartTime:  &res.StartTime.Time,
		EndTime:    &res.EndTime.Time,
		Winner:     &res.Winner.Int64,
		Team1Score: res.Team1Score,
		Team2Score: res.Team2Score,
	}, nil
}


text:
DESCRIPTION = "This module was created to enable test suites to test code at specific \
points in time. Specifically it overrides localtime, gmtime and time at \
compile time and then relies on the user supplying a mock time via \
set_relative_time, set_absolute_time or set_fixed_time to alter future \
calls to gmtime,time or localtime."

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

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

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/D/DD/DDICK/Test-MockTime-0.17.tar.gz"

SRC_URI[md5sum] = "3cd809ebccc72b0701afbba51029ac56"
SRC_URI[sha256sum] = "3363e118b2606f1d6abc956f22b0d09109772b7086155fb5c9c7f983350602f9"

S = "${WORKDIR}/Test-MockTime-${PV}"

inherit cpan allarch

BBCLASSEXTEND = "native"

repository: rehsack/meta-cpan

repo_name: rehsack/meta-cpan


text:
if(CMAKE_VERSION VERSION_LESS "3.12.4")
  add_definitions(-D_USE_MATH_DEFINES)
else()
  add_compile_definitions(_USE_MATH_DEFINES)
endif()

if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
  set(CMAKE_CXX_FLAGS
      "${CMAKE_CXX_FLAGS} /Zc:__cplusplus /DPROTOBUF_WARNINGS=\"4251 4996\"")
else()
  list(APPEND CMAKE_PREFIX_PATH "C:/msys64/mingw64" "C:/msys64/usr")
endif()

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
  message(STATUS "Setting build type to 'Debug' as none was specified.")
  set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)
  # Set the possible values of build type for cmake-gui
  set_property(CACHE CMAKE_BUILD_TYPE
               PROPERTY STRINGS
                        "Debug"
                        "Release"
                        "MinSizeRel"
                        "RelWithDebInfo")
endif()

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -ggdb")
  set(CMAKE_CXX_FLAGS_RELEASE
      "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
endif()

repository: fromasmtodisasm/AeonEngine

repo_name: fromasmtodisasm/AeonEngine


text:
#
# Copyright (c) 2019, New York University and Max Planck Gesellschaft. License
# BSD-3 clause
#

# cmake-format off
#[=======================================================================[.rst:
Findrt
----------

Finds the rt library.

Imported Targets
^^^^^^^^^^^^^^^^

This module provides the following imported targets, if found:

``rt::rt``
  The rt interface library.

Result Variables
^^^^^^^^^^^^^^^^

This will define the following variables:

``rt_FOUND``
  True if the system has the rt library.
``rt_VERSION``
  The version of the rt library which was found.
``rt_INCLUDE_DIRS``
  Include directories needed to use rt.
``rt_LIBRARIES``
  Libraries needed to link to rt. This will be empty as this is a header
  only library.

Cache Variables
^^^^^^^^^^^^^^^

The following cache variables may also be set:

``rt_INCLUDE_DIR``
  The directory containing ``rt.h``.
``rt_LIBRARY``
  The path to the rt library.

#]=======================================================================]
# cmake-format on
set(rt_error_message "Could not find 'rt', the serialization library.")

find_library(rt_LIBRARY rt)
if(rt_LIBRARY STREQUAL "rt_LIBRARY-NOTFOUND")
  message(FATAL_ERROR ${rt_error_message})
  set(rt_path_found FALSE)
endif()

set(rt_path_found TRUE)

if(rt_path_found)

  # Verify the information given.
  include(FindPackageHandleStandardArgs)
  find_package_handle_standard_args(
    rt
    REQUIRED_VARS rt_LIBRARY
    FOUND_VAR rt_FOUND)

  # Export the library.
  if(rt_FOUND)
    set(rt_LIBRARIES ${rt_LIBRARY})
    set(rt_INCLUDE_DIR "")
    set(rt_INCLUDE_DIRS ${rt_INCLUDE_DIR})
    set(rt_DEFINITIONS "")
  endif()

  if(rt_FOUND)
    if(NOT TARGET rt::rt)
      add_library(rt::rt UNKNOWN IMPORTED)
      set_target_properties(rt::rt PROPERTIES IMPORTED_LOCATION ${rt_LIBRARY})
    endif()
  endif()

  mark_as_advanced(
    rt_INCLUDE_DIR
    rt_INCLUDE_DIRS
    rt_LIBRARY
    rt_LIBRARIES
    rt_DEFINITIONS
    rt_VERSION
    rt_FOUND)
endif()

gha_language: CMake


text:
package ast

import (
	"fmt"
)

// Valuer represents a value interface
type Valuer interface {
	Type() NodeType
	Value() interface{}
	Encode() string
}

type nodeValue struct {
	t NodeType
	v interface{}
}

func newNodeValue(t NodeType, v interface{}) *nodeValue {
	return &nodeValue{
		t: t,
		v: v,
	}
}

func (n *nodeValue) Type() NodeType {
	return n.t
}

func (n *nodeValue) Value() interface{} {
	return n.v
}

func (n *nodeValue) Encode() string {
	switch n.t {
	case NodeTypeInt:
		return fmt.Sprintf("%d", n.v)
	case NodeTypeFloat:
		return fmt.Sprintf("%v", n.v)
	case NodeTypeSymbol:
		return fmt.Sprintf("%s", n.v)
	case NodeTypeAtom:
		return fmt.Sprintf("%s", n.v)
	case NodeTypeString:
		return fmt.Sprintf("%q", n.v)
	}

	panic("unreachable")
}

// NewStringValue creates a node of type string and sets it to the given value
func NewStringValue(v string) Valuer {
	return newNodeValue(NodeTypeString, v)
}

// NewFloatValue creates a node of type float and sets it to the given value
func NewFloatValue(v float64) Valuer {
	return newNodeValue(NodeTypeFloat, v)
}

// NewIntValue creates a node of type node and sets it to the given value
func NewIntValue(v int64) Valuer {
	return newNodeValue(NodeTypeInt, v)
}

// NewAtomValue creates a node of type atom and sets it to the given value
func NewAtomValue(v string) Valuer {
	return newNodeValue(NodeTypeAtom, v)
}

// NewSymbolValue creates a node of type symbol and sets it to the given value
func NewSymbolValue(v string) Valuer {
	return newNodeValue(NodeTypeSymbol, v)
}

var _ = Valuer(&nodeValue{})

repository: xiam/sexpr

repo_name: xiam/sexpr


text:
package services

import "syscall"

const detachedProcess uint32 = 0x8

func processAttr() *syscall.SysProcAttr {
	return &syscall.SysProcAttr{
		HideWindow:    true,
		CreationFlags: detachedProcess,
	}
}


text:
// compile

package main

func main() {

	_ = (func())(nil)

	_ = (func())(func(){})

	switch interface{}(0).(type) {
	case func():

	}

}


text:
package main

const statusTemplate = `package main

import (
	"github.com/ProductHealth/gose4"
)

func init() {
	gose4.ServiceStatus = gose4.Status{
		ArtifactId: "{{.ArtifactId}}",
		BuildNumber: "{{.BuildNumber}}",
		BuildMachine: "{{.BuildMachine}}",
		BuildBy: "{{.BuildBy}}",
		BuildWhen: "{{.BuildWhen}}",
		CompilerVersion: "{{.CompilerVersion}}",
		GitSha: "{{.GitSha}}",
	}
}
`


text:
#
# CACHE
#
# Here all cache variables are set
#
#
# If you add something here, make sure to also add it in
# src/plugins/constants/

include(LibAddMacros)

remember_for_removal(PLUGINS TO_REMOVE_PLUGINS)

#
# the default list of plugins
#
# They are essential so that elektra can work
#
set (PLUGINS_LIST_DEFAULT
	dump
	resolver
	sync
	error
	)

#
# force default list
# (default plugins are always included, so PLUGINS_LIST is unset)
#
if (PLUGINS MATCHES "DEFAULT")
	set (PLUGINS_FORCE FORCE)
endif ()

#
# Those plugins can only be compiled, but cannot be used.
# Should compile on every system where elektra compiles.
#
set (PLUGINS_LIST_COMPILE
	template
	doc
	)

#
# Plugins which only need Ansi C/C++,
# (like elektra core itself)
# Should compile on every system where elektra compiles.
#
set (PLUGINS_LIST_NODEP
	ccode
	fstab
	csvstorage
	lineendings
	hexcode
	hidden
	ni
	null
	struct
	tracer
	counter
	type
	constants
	noresolver
	wresolver
	ini
	list
	)

#
# Plugins which use some posix facility
#
set (PLUGINS_LIST_POSIX
	glob
	hosts
	iconv
	network
	path
	enum
	mathcheck
	conditionals
	keytometa
	rename
	syslog
	uname
	timeofday
	simpleini
	line
	validation
	regexstore
	)

#
# force no dependency list
#
if (PLUGINS MATCHES "NODEP")
	set (PLUGINS_LIST
		${PLUGINS_LIST_COMPILE}
		${PLUGINS_LIST_NODEP}
		${PLUGINS_LIST_POSIX}
	    )
	set (PLUGINS_FORCE FORCE)
endif ()

#
# some are handy for tests,
# other are for standard-compliance
#
set (PLUGINS_LIST_RESOLVER
	resolver_fm_b_b
	resolver_fm_hb_b
	resolver_fm_hp_b
	resolver_fm_ub_x
	resolver_fm_xb_x
	resolver_fm_xp_x
	resolver_fm_xhp_x
	resolver_fm_uhb_xb
	)

#
# plugins with dependencies
#
set (PLUGINS_LIST_DEP
	yajl
	dbus
	tcl
	xmltool
	augeas
	journald
	jni
	python
	python2
	lua
	crypto
	)

#
# force all plugins
#
if (PLUGINS MATCHES "ALL")
	set (PLUGINS_LIST
		${PLUGINS_LIST_COMPILE}
		${PLUGINS_LIST_NODEP}
		${PLUGINS_LIST_POSIX}
		${PLUGINS_LIST_RESOLVER}
		${PLUGINS_LIST_DEP}
		)
	set (PLUGINS_FORCE FORCE)
endif ()

set (PLUGINS_DOC "Which plugins should be added? ALL for all available, NODEP for plugins without additional dependencies and DEFAULT for minimal set.")

#
# now actually set the plugins cache variable
#
# Always include DEFAULT plugins, but maybe include more
#
set (PLUGINS
	${PLUGINS_LIST_DEFAULT}
	${PLUGINS_LIST}
	CACHE STRING ${PLUGINS_DOC}
	${PLUGINS_FORCE}
	)

removal(PLUGINS TO_REMOVE_PLUGINS)
set(PLUGINS ${PLUGINS} CACHE STRING ${PLUGINS_DOC} FORCE)

#
# set BINDINGS cache variable
#

remember_for_removal(BINDINGS TO_REMOVE_BINDINGS)

set (BINDINGS_LIST_DEFAULT cpp)

if (BINDINGS MATCHES "NODEP")
	set (BINDINGS_FORCE FORCE)
endif()

if (BINDINGS MATCHES "DEFAULT")
	set (BINDINGS_FORCE FORCE)
endif()

list (FIND BINDINGS "SWIG" FINDEX)
if (BINDINGS MATCHES "ALL" OR FINDEX GREATER -1)
	set (BINDINGS_LIST_SWIG
		swig_lua
		swig_python2
		swig_python
		)
	set (BINDINGS_FORCE FORCE)
endif ()
# rename swig_python3 to swig_python - TODO remove sometime in the future
list (FIND BINDINGS "swig_python3" FINDEX)
if (FINDEX GREATER -1)
	message (STATUS "swig_python3 has been renamed to swig_python")
	list (REMOVE_ITEM BINDINGS swig_python3)
	list (APPEND BINDINGS swig_python)
endif ()

list (FIND BINDINGS "GI" FINDEX)
if (BINDINGS MATCHES "ALL" OR FINDEX GREATER -1)
	set (BINDINGS_LIST_GI
		glib
		gi_lua
		gi_python
		)
	set (BINDINGS_FORCE FORCE)
endif ()

if (BINDINGS MATCHES "ALL")
	set(BINDINGS_LIST_ALL
		jna
		)
endif()

set (BINDINGS_DOC "Which bindings should be added? ALL for all available, SWIG, GI for plugins based on respective technology, DEFAULT for minimal set.")

set (BINDINGS
	${BINDINGS_LIST_DEFAULT}
	${BINDINGS_LIST_SWIG}
	${BINDINGS_LIST_GI}
	${BINDINGS_LIST_ALL}
	CACHE STRING ${BINDINGS_DOC}
	${BINDINGS_FORCE}
	)

removal(BINDINGS TO_REMOVE_BINDINGS)
set(BINDINGS ${BINDINGS} CACHE STRING ${BINDINGS_DOC} FORCE)

#
# set TOOLS cache variable
#

remember_for_removal(TOOLS TO_REMOVE_TOOLS)

set (TOOLS_LIST_DEFAULT kdb)

if (TOOLS MATCHES "DEFAULT")
	set (TOOLS_FORCE FORCE)
endif ()

if (TOOLS MATCHES "NODEP")
	set (TOOLS_LIST
		)
	set (TOOLS_FORCE FORCE)
endif ()

if (TOOLS MATCHES "ALL")
	set (TOOLS_LIST
		gen
		race
		qt-gui
		)
	set (TOOLS_FORCE FORCE)
endif ()

set (TOOLS_DOC "Which TOOLS should be added? ALL for all available, NODEP for TOOLS without additional dependencies, DEFAULT for minimal set.")

set (TOOLS
	${TOOLS_LIST_DEFAULT}
	${TOOLS_LIST}
	CACHE STRING ${TOOLS_DOC}
	${TOOLS_FORCE}
	)

removal(TOOLS TO_REMOVE_TOOLS)
set(TOOLS ${TOOLS} CACHE STRING ${TOOLS_DOC} FORCE)

#
# Runtime pathes for KDB
#

set (KDB_DB_SYSTEM "/etc/kdb" CACHE PATH
		"The path to the system key database."
		)

set (KDB_DB_HOME "/home" CACHE PATH
		"The compiled-in fallback path to users home directories."
		)

set (KDB_DB_USER ".config" CACHE PATH
		"This path will be appended after the resolved home directory. It completes the path to the user key database."
		)

set (KDB_DB_SPEC "share/elektra/specification" CACHE PATH
		"This path will be appended after the prefix. It completes the path to the specification key database."
		)

set (KDB_DB_DIR ".dir" CACHE PATH
		"The configuration directory for config files in dir namespace."
		)

set (KDB_DB_FILE "default.ecf" CACHE PATH
		"This configuration file will be used initially (for bootstrapping)."
		)

set (KDB_DEFAULT_STORAGE "dump" CACHE STRING
	"This storage plugin will be used initially (for bootstrapping).")

set (KDB_DEFAULT_RESOLVER "resolver" CACHE STRING
	"This resolver plugin will be used initially (for bootstrapping).")

list (FIND PLUGINS ${KDB_DEFAULT_STORAGE} output)
if (output EQUAL -1)
	message(SEND_ERROR "selected default storage (${KDB_DEFAULT_STORAGE})  is not selected in PLUGINS, please change KDB_DEFAULT_STORAGE or PLUGINS")
endif()

list (FIND PLUGINS ${KDB_DEFAULT_RESOLVER} output)
if (output EQUAL -1)
	message(SEND_ERROR "selected default resolver (${KDB_DEFAULT_RESOLVER}) is not selected in PLUGINS, please change KDB_DEFAULT_RESOLVER or PLUGINS")
endif()

#
# Compile options
#

option (ENABLE_CXX11 "WARNING: Option will be removed with 0.8.13. See libelektra.org/issues/262. Include code using C++11 standard, needs gcc 4.7 or comparable clang/icc." ON)

set (GTEST_ROOT "" CACHE PATH "use external gtest instead of internal")

set (CMAKE_PIC_FLAGS "-fPIC"
	CACHE STRING "Which pic flags should be used for cases cmake cannot handle it itself")

set (CMAKE_STATIC_FLAGS ""
	CACHE STRING "Which static flags should be used for compilation of *-static libs+tools, use \"-static\" if you want a real static kdb-static (it needs .a for every dependency though)")

#
# Build properties
#

option (BUILD_SHARED "Build the shared version of elektra." ON)
option (BUILD_FULL "Build the full version of elektra (shared with all selected backends included)." ON)
option (BUILD_STATIC "Build the static version of elektra (all selected backends included statically)." ON)

option (BUILD_DOCUMENTATION "Build the documentation (API, man pages)" ON)
if (BUILD_DOCUMENTATION)
	option (INSTALL_DOCUMENTATION "Install the documentation (API, man pages)" ON)
	option (BUILD_PDF "Build the documentation also in PDF form" OFF)
else (BUILD_DOCUMENTATION)
	#install documentation makes no sense if it is not build
	#(even though the option would not harm)
	set (INSTALL_DOCUMENTATION OFF CACHE BOOL
			"Install the documentation (API, man pages)"
			FORCE
		)
	set (BUILD_PDF OFF CACHE BOOL
			"Build the documentation also in PDF form"
			FORCE
		)
endif (BUILD_DOCUMENTATION)

option (ENABLE_TESTING "Enable to run (any) tests by make test" ON)
if (ENABLE_TESTING)
	option (ENABLE_KDB_TESTING "Enable to run tests writing to hard disc" ON)
else (ENABLE_TESTING)
	set (ENABLE_KDB_TESTING OFF CACHE BOOL "Enable to run tests writing to hard disc" FORCE)
endif (ENABLE_TESTING)

option (BUILD_TESTING "Build main test suite (does not affect plugins+bindings)" ON)
if (BUILD_TESTING)
	option (INSTALL_TESTING "Install testcases" ON)
else (BUILD_TESTING)
	#install testing makes no sense if it is not build
	#(even though the option would not harm)
	set (INSTALL_TESTING OFF CACHE BOOL "Install testcases" FORCE)
endif (BUILD_TESTING)

set (ENABLE_COVERAGE OFF CACHE BOOL "enable coverage analysis (using gcov)")
set (COVERAGE_PREFIX
		"${PROJECT_SOURCE_DIR}/.."
		CACHE FILEPATH
		"Full path to common prefix of build+source directory"
    )

option (INSTALL_SYSTEM_FILES "Install files to system directories" ON)

#
# Developer builds (debug or verbose build)
#

option (ELEKTRA_DEBUG_BUILD "Build with extra debug print messages (to debug elektra).")
if (ELEKTRA_DEBUG_BUILD)
	set (DEBUG "1")
else (ELEKTRA_DEBUG_BUILD)
	set (DEBUG "0")
endif (ELEKTRA_DEBUG_BUILD)
MARK_AS_ADVANCED(ELEKTRA_DEBUG_BUILD)

option (ELEKTRA_VERBOSE_BUILD "Build with even more print messages (to debug elektra).")
if (ELEKTRA_VERBOSE_BUILD)
	set (VERBOSE "1")
else (ELEKTRA_VERBOSE_BUILD)
	set (VERBOSE "0")
endif (ELEKTRA_VERBOSE_BUILD)
MARK_AS_ADVANCED(ELEKTRA_VERBOSE_BUILD)

#
# Target installation folders
#

set (TARGET_INCLUDE_FOLDER
		"elektra"
		CACHE STRING
		"This folder (below prefix/include) will be used to install include files."
    )

set (TARGET_CMAKE_FOLDER
		"lib${LIB_SUFFIX}/cmake/Elektra"
		CACHE STRING
		"This folder (below prefix) will be used to install cmake files."
    )

set (TARGET_PLUGIN_FOLDER
		"elektra"
		CACHE STRING
		"This folder (below prefix/lib) will be used to install elektra plugins. LIB_SUFFIX is honored."
    )

set (TARGET_PKGCONFIG_FOLDER
		"pkgconfig"
		CACHE STRING
		"The folder (below prefix/lib) folder where to install pkgconfig files. LIB_SUFFIX is honored."
    )

set (TARGET_DOCUMENTATION_HTML_FOLDER
		"share/doc/elektra-api/html"
		CACHE STRING
		"The folder (below prefix) where to install html api documentation files."
    )

set (TARGET_DOCUMENTATION_MAN_FOLDER
		"share/man/man3"
		CACHE STRING
		"The folder (below prefix) where to install man3 api documentation files."
    )

set (TARGET_DOCUMENTATION_LATEX_FOLDER
		"share/doc/elektra-api/latex"
		CACHE STRING
		"The folder (below prefix) where to install latex api documentation files."
    )

set (TARGET_TOOL_EXEC_FOLDER
		"lib${LIB_SUFFIX}/elektra/tool_exec"
		CACHE STRING
		"This folder (below prefix) will be used to install additional kdb-tools"
    )

set (TARGET_TEST_DATA_FOLDER
		"share/elektra/test_data"
		CACHE STRING
		"This folder (below prefix) will be used to install test data"
    )

set (TARGET_TEMPLATE_FOLDER
		"share/elektra/templates"
		CACHE STRING
		"This folder (below prefix) will be used to install templates"
    )

set (TARGET_LUA_CMOD_FOLDER "lib${LIB_SUFFIX}/lua/5.2"
	CACHE PATH
	"Directory to install Lua binary modules, should be in LUA_CPATH"
   )

set (TARGET_LUA_LMOD_FOLDER "share/lua/5.2"
	CACHE PATH
	"Directory to install Lua source modules, should be in LUA_PATH)"
    )

#
# Misc.
#

set (LIB_SUFFIX ""
		CACHE STRING
		"Optional suffix to use on lib folders (e.g. 64 for lib64)"
    )

set (MEMORYCHECK_COMMAND
		/usr/bin/valgrind
		CACHE FILEPATH
		"Full path to valgrind"
    )

set(MEMORYCHECK_SUPPRESSIONS_FILE
		${CMAKE_SOURCE_DIR}/tests/valgrind.suppression
		CACHE FILEPATH
		"Full path to suppression file for valgrind")

set(DISCLAMER "
/***************************************************************************
 *                                                                         *
 * This header file is AUTO GENERATED.                                     *
 * Do not edit this file, otherwise your changes will be discarded in the  *
 * next cmake run.                                                         *
 *                                                                         *
 ***************************************************************************/")

MARK_AS_ADVANCED(FORCE
	# might be relevant to users:
	GTEST_ROOT
	COVERAGE_PREFIX
	Boost_DIR

	# are kind of internal:
	SWIG_DIR SWIG_EXECUTABLE SWIG_VERSION
	gtest_build_samples gtest_build_tests gtest_disable_pthreads
	gtest_force_shared_crt BUILD_SHARED_LIBS
	)


text:
@article{JSSv067i01,
   author = {Douglas Bates and Martin Mächler and Ben Bolker and Steve Walker},
   title = {Fitting Linear Mixed-Effects Models Using lme4},
   journal = {Journal of Statistical Software, Articles},
   volume = {67},
   number = {1},
   year = {2015},
   keywords = {sparse matrix methods; linear mixed models; penalized least squares; Cholesky decomposition},
   abstract = {Maximum likelihood or restricted maximum likelihood (REML) estimates of the parameters in linear mixed-effects models can be determined using the lmer function in the lme4 package for R. As for most model-fitting functions in R, the model is described in an lmer call by a formula, in this case including both fixed- and random-effects terms. The formula and data together determine a numerical representation of the model from which the profiled deviance or the profiled REML criterion can be evaluated as a function of some of the model parameters. The appropriate criterion is optimized, using one of the constrained optimization functions in R, to provide the parameter estimates. We describe the structure of the model, the steps in evaluating the profiled deviance or REML criterion, and the structure of classes or types that represents such a model. Sufficient detail is included to allow specialization of these structures by users who wish to write functions to fit specialized linear mixed models, such as models incorporating pedigrees or smoothing splines, that are not easily expressible in the formula language used by lmer.},
   issn = {1548-7660},
   pages = {1--48},
   doi = {10.18637/jss.v067.i01},
   url = {https://www.jstatsoft.org/v067/i01}
}

@article{RJ-2017-066,
  author = {Mollie E. Brooks and Kasper Kristensen and Koen J. van
          Benthem and Arni Magnusson and Casper W. Berg and Anders
          Nielsen and Hans J. Skaug and Martin Mächler and Benjamin M.
          Bolker},
  title = {{glmmTMB Balances Speed and Flexibility Among Packages for
          Zero-inflated Generalized Linear Mixed Modeling}},
  year = {2017},
  journal = {{The R Journal}},
  doi = {10.32614/RJ-2017-066},
  url = {https://doi.org/10.32614/RJ-2017-066},
  pages = {378--400},
  volume = {9},
  number = {2}
}

@article{bolker2012owls,
  title={Owls example: a zero-inflated, generalized linear mixed model for count data},
  author={Bolker, Ben and Brooks, Mollie and Gardner, Beth and Lennert, Cleridy and Minami, Mihoko},
  journal={Departments of Mathematics \& Statistics and Biology, McMaster University, Hamilton},
  url = {https://groups.nceas.ucsb.edu/non-linear-modeling/projects/owls/WRITEUP/owls.pdf/@@download},
  year={2012}
}

@article{bolker2021faqs,
  title={GLMM FAQ},
  author={Bolker, Ben and others},
  journal={},
  url = {http://bbolker.github.io/mixedmodels-misc/glmmFAQ.html#zero-inflation},
  year={2021}
}

@book{zuur2009mixed,
  title={Mixed effects models and extensions in ecology with R},
  author={Zuur, Alain and Ieno, Elena N and Walker, Neil and Saveliev, Anatoly A and Smith, Graham M},
  year={2009},
  publisher={Springer Science \& Business Media}
}

@book{hilbe2011negative,
  title={Negative binomial regression},
  author={Hilbe, Joseph M},
  year={2011},
  doi = {10.1017/CBO9780511973420},
  url = {https://doi.org/10.1017/CBO9780511973420},
  publisher={Cambridge University Press}
}

@article{bolker2013strategies,
  title={Strategies for fitting nonlinear ecological models in R, AD M odel B uilder, and BUGS},
  author={Bolker, Benjamin M and Gardner, Beth and Maunder, Mark and Berg, Casper W and Brooks, Mollie and Comita, Liza and Crone, Elizabeth and Cubaynes, Sarah and Davies, Trevor and de Valpine, Perry and others},
  journal={Methods in Ecology and Evolution},
  volume={4},
  number={6},
  pages={501--512},
  year={2013},
  doi = {doi.org/10.1111/2041-210x.12044},
  url = {https://doi.org/10.1111/2041-210x.12044},
  publisher={Wiley Online Library}
}

@Manual{R-base,
  title = {R: A Language and Environment for Statistical Computing},
  author = {{R Core Team}},
  organization = {R Foundation for Statistical Computing},
  address = {Vienna, Austria},
  year = {2020},
  url = {https://www.R-project.org/},
}

@misc{bolker2020getting,
  title={Getting started with the glmmTMB package},
  author={Bolker, Ben},
  year={2020},
  publisher={R Foundation for Statistical Computing Vienna, Austria}
}

@Manual{R-rmarkdown,
  title = {rmarkdown: Dynamic Documents for R},
  author = {JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
  year = {2020},
  note = {R package version 2.4},
  url = {https://github.com/rstudio/rmarkdown},
}

@Book{rmarkdown2018,
  title = {R Markdown: The Definitive Guide},
  author = {Yihui Xie and J.J. Allaire and Garrett Grolemund},
  publisher = {Chapman and Hall/CRC},
  address = {Boca Raton, Florida},
  year = {2018},
  note = {ISBN 9781138359338},
  url = {https://bookdown.org/yihui/rmarkdown},
}

@Book{rmarkdown2020,
  title = {R Markdown Cookbook},
  author = {Yihui Xie and Christophe Dervieux and Emily Riederer},
  publisher = {Chapman and Hall/CRC},
  address = {Boca Raton, Florida},
  year = {2020},
  note = {ISBN 9780367563837},
  url = {https://bookdown.org/yihui/rmarkdown-cookbook},
}


text:
@article {Garrott2013BLM,
	author = {Garrott, Robert A. and Oli, Madan K.},
	title = {A Critical Crossroad for BLM{\textquoteright}s Wild Horse Program},
	volume = {341},
	number = {6148},
	pages = {847--848},
	year = {2013},
	doi = {10.1126/science.1240280},
	publisher = {American Association for the Advancement of Science},
	issn = {0036-8075},
	URL = {http://science.sciencemag.org/content/341/6148/847},
	eprint = {http://science.sciencemag.org/content/341/6148/847.full.pdf},
	journal = {Science}
}

@BOOK{NAP2013BLM,
  author    = "National Research Council",
  title     = "Using Science to Improve the BLM Wild Horse and Burro Program: A Way Forward",
  isbn      = "978-0-309-26494-5",
  doi       = "10.17226/13511",
  abstract  = "Using Science to Improve the BLM Wild Horse and Burro Program: A Way Forward reviews the science that underpins the Bureau of Land Management's oversight of free-ranging horses and burros on federal public lands in the western United States, concluding that constructive changes could be implemented. The Wild Horse and Burro Program has not used scientifically rigorous methods to estimate the population sizes of horses and burros, to model the effects of management actions on the animals, or to assess the availability and use of forage on rangelands.\nEvidence suggests that horse populations are growing by 15 to 20 percent each year, a level that is unsustainable for maintaining healthy horse populations as well as healthy ecosystems. Promising fertility-control methods are available to help limit this population growth, however. In addition, science-based methods exist for improving population estimates, predicting the effects of management practices in order to maintain genetically diverse, healthy populations, and estimating the productivity of rangelands. Greater transparency in how science-based methods are used to inform management decisions may help increase public confidence in the Wild Horse and Burro Program.",
  url       = "https://www.nap.edu/catalog/13511/using-science-to-improve-the-blm-wild-horse-and-burro-program",
  year      = 2013,
  publisher = "The National Academies Press",
  address   = "Washington, DC"
}
@article{linkie2006assessing,
  title={Assessing the viability of tiger subpopulations in a fragmented landscape},
  author={Linkie, Matthew and Chapron, Guillaume and Martyr, Deborah J and Holden, Jeremy and LEADER-WILLIAMS, NIGEL},
  journal={Journal of Applied Ecology},
  volume={43},
  number={3},
  pages={576--586},
  year={2006},
  publisher={Wiley Online Library}
}
@article{beissinger1998use,
  title={On the use of demographic models of population viability in endangered species management},
  author={Beissinger, Steven R and Westphal, M Ian},
  journal={The Journal of wildlife management},
  pages={821--841},
  year={1998},
  publisher={JSTOR}
}
@article{chauvenet2010optimal,
  title={Optimal allocation of conservation effort among subpopulations of a threatened species: How important is patch quality?},
  author={Chauvenet, Ali{\'e}nor LM and Baxter, Peter WJ and McDonald-Madden, Eve and Possingham, Hugh P},
  journal={Ecological Applications},
  volume={20},
  number={3},
  pages={789--797},
  year={2010},
  publisher={Wiley Online Library}
}
@article{doak1994modeling,
  title={Modeling population viability for the desert tortoise in the western Mojave Desert},
  author={Doak, Daniel and Kareiva, Peter and Klepetka, Brad},
  journal={Ecological applications},
  volume={4},
  number={3},
  pages={446--460},
  year={1994},
  publisher={Eco Soc America}
}
@article{crouse1987stage,
  title={A stage-based population model for loggerhead sea turtles and implications for conservation},
  author={Crouse, Deborah T and Crowder, Larry B and Caswell, Hal},
  journal={Ecology},
  volume={68},
  number={5},
  pages={1412--1423},
  year={1987},
  publisher={Eco Soc America}
}

@article{box1976science,
  title={Science and statistics},
  author={Box, George EP},
  journal={Journal of the American Statistical Association},
  volume={71},
  number={356},
  pages={791--799},
  year={1976},
  publisher={Taylor \& Francis}
}

@article{havera1988distribution,
  title={Distribution and abundance of winter populations of bald eagles in Illinois},
  author={Havera, Stephen P and Kruse, Glen W},
  year={1988},
  publisher={Champaign, Ill.: Illinois Natural History Survey}
}

@article{romesburg1981wildlife,
  title={Wildlife science: gaining reliable knowledge},
  author={Romesburg, H Charles},
  journal={The Journal of Wildlife Management},
  pages={293--313},
  year={1981},
  publisher={JSTOR}
}

@book{rosen2010lawless,
  title={Lawless universe: science and the hunt for reality},
  author={Rosen, Joe},
  year={2010},
  publisher={JHU Press}
}

@article{spencer1970muskox,
  title={The muskox of Nunivak island, Alaska},
  author={Spencer, David L and Lensink, Calvin J},
  journal={The Journal of Wildlife Management},
  pages={1--15},
  year={1970},
  publisher={JSTOR}
}

@book{turchin2003complex,
  title={Complex population dynamics: a theoretical/empirical synthesis},
  author={Turchin, Peter},
  volume={35},
  year={2003},
  publisher={Princeton University Press}
}

@article{linnell2010sustainably,
  title={Sustainably harvesting a large carnivore? Development of Eurasian lynx populations in Norway during 160 years of shifting policy},
  author={Linnell, John DC and Broseth, Henrik and Odden, John and Nilsen, Erlend Birkeland},
  journal={Environmental management},
  volume={45},
  number={5},
  pages={1142--1154},
  year={2010},
  publisher={Springer}
}

@book{baron2010beast,
  title={The beast in the garden: A modern parable of man and nature},
  author={Baron, David},
  year={2010},
  publisher={WW Norton \& Company}
}

@article{bischof2012implementation,
  title={Implementation uncertainty when using recreational hunting to manage carnivores},
  author={Bischof, Richard and Nilsen, Erlend B and Br{\o}seth, Henrik and M{\"a}nnil, Peep and Ozoli{\c{n}}{\v{s}}, Ja{\=a}nis and Linnell, John DC},
  journal={Journal of Applied Ecology},
  volume={49},
  number={4},
  pages={824--832},
  year={2012},
  publisher={Wiley Online Library}
}

@book{berger2009better,
  title={The Better to eat you with: fear in the animal world},
  author={Berger, Joel},
  year={2009},
  publisher={University of Chicago Press}
}

@article{runge2009assessing,
  title={Assessing allowable take of migratory birds},
  author={Runge, Michael C and Sauer, John R and Avery, Michael L and Blackwell, Bradley F and Koneff, Mark D},
  journal={The Journal of Wildlife Management},
  volume={73},
  number={4},
  pages={556--565},
  year={2009},
  publisher={Wiley Online Library}
}
    @article{bartmannetal1992,
     jstor_articletype = {research-article},
     title = {Compensatory Mortality in a Colorado Mule Deer Population},
     author = {Bartmann, Richard M. and White, Gary C. and Carpenter, Len H.},
     journal = {Wildlife Monographs},
     jstor_issuetitle = {Compensatory Mortality in a Colorado Mule Deer Population},
     volume = {121},
     number = {},
     jstor_formatteddate = {Jan., 1992},
     pages = {pp. 3-39},
     url = {http://0-www.jstor.org.library.unl.edu/stable/3830602},
     ISSN = {00840173},
     abstract = {A thorough test of the hypothesis of compensatory mortality is a fundamental requirement for a better understanding of the population dynamics of wildlife species. This knowledge is vital, whether populations are managed for recreational hunting or other purposes. Our research on a pinyon pine (Pinus edulis)-Utah juniper (Juniperus osteosperma) winter range in Piceance Basin, northwest Colorado, from 1981 to 1988 tested for compensatory mortality in the fawn portion of a mule deer (Odocoileus hemionus hemionus) population. Three experimental manipulations were used employing radio-collared deer. In a field study, removing 16-22% of the population from the treatment unit each winter for 2 years had no measurable effect on fawn survival rates as compared to rates on the control unit (P = 0.566). We attributed this mostly to not removing enough deer to immediately affect fawn survival under existing range conditions. In a controlled study, deer removed from the treatment unit were used to stock 3 large pastures at densities of 44, 89, and <tex-math>$133\ \text{deer}/{\rm km}^{2}$</tex-math> to simulate hunting removals of 67, 33, and 0%, respectively. Fawn survival rates varied inversely with density (P < 0.001). Starvation was the leading cause of fawn mortality in all pastures indicating a nutritional limitation at all densities. We believe the density-dependent survival response in the pastures demonstrated that a strong compensatory mortality process operated in this mule deer population. In another field study, 49-77% of fawns were killed by predators during 4 winters. We then reduced the coyote (Canis latrans) population for 3 winters while we continued to monitor fawn mortality. Predation rates decreased (P = 0.004) and starvation rates increased (P = 0.042) between pre- and posttreatment periods, but no change in fawn survival was detected (P = 0.842). These results support those from the pastures even though the primary mortality causes differed. Mean fawn weights varied among years, study areas, and trap sites (P < 0.001). Male fawns averaged 2.4 and 3.0 kg heavier than females (P < 0.001) on the 2 field-study areas. Larger fawns had higher survival (P < 0.001), but size was not a significant predictor of whether or not a fawn starved (P = 0.237). In both field-study areas, female fawns had higher survival than males (P < 0.001) when weight was a covariate, but not when weight was excluded (P = 0.697). Adult females had higher survival rates than fawns (P < 0.001) even though adult rates were calculated over 5.5 more months. Vegetation biomass differed among pastures (P < 0.001), but differences were unrelated to fawn survival rates. Biomass estimates indicated adequate forage was available in all pastures. Tame deer in the low density pasture took more bites per 15-minute trial (P < 0.001), had shorter mean times between consecutive bites of Utah serviceberry (Amelanchier utahensis) and true mountainmahogany (Cercocarpus montanus) (P ≤ 0.002), and traveled less distance during afternoon trials (P = 0.015) than tame deer in the high density pasture. These differences were assumed to reflect lower forage quality in the high density pasture. For the Piceance Basin mule deer population, mortality rather than reproduction seemed the major process driving the density-dependent mechanism because the former fluctuated over a much broader range. High survival of adult females, even during severe winters, tended to temper population fluctuations that can occur in harsher environments and allowed density-dependent processes in the fawn segment to continue operating. With density-dependent population regulation, the common management strategy of decreasing harvest when fawn survival is low and increasing harvest when survival is high is counterproductive.},
     language = {English},
     year = {1992},
     publisher = {Wiley on behalf of the Wildlife Society},
     copyright = {Copyright © 1992 Wiley},
    }

    @article{unsworthetal1999,
     jstor_articletype = {research-article},
     title = {Mule Deer Survival in Colorado, Idaho, and Montana},
     author = {Unsworth, James W. and Pac, David F. and White, Gary C. and Bartmann, Richard M.},
     journal = {The Journal of Wildlife Management},
     jstor_issuetitle = {},
     volume = {63},
     number = {1},
     jstor_formatteddate = {Jan., 1999},
     pages = {pp. 315-326},
     url = {http://0-www.jstor.org.library.unl.edu/stable/3802515},
     ISSN = {0022541X},
     abstract = {We examined survival rates of mule deer (Odocoileus hemionus) fawns (1 Jan-31 May) and adult (≥1 yr old) females (1 Jun-31 May) from Colorado, Idaho, and Montana to assess the influence of survival on population dynamics over a broad geographic area. Survival rates were estimated from 1,875 radiocollared fawns and 1,536 radiocollared adult female-years. We found significant year-to-year differences in overwinter survival rates of fawns among states (P < 0.001), while annual survival rates of adult females showed less variation across years (P < 0.256). Sampling distributions of survival rates by age class were modeled with the beta-binomial distribution (BBD) and not found different among states (ad F: P = 0.118; fawns: P = 0.856). The mean overwinter survival rate for fawns was 0.444 (SE = 0.033), with SD = 0.217 (SE = 0.019). The mean annual survival rate for adult females was 0.853 (SE = 0.011), with SD = 0.034 (SE = 0.014). All 3 states exhibited differences in body size of fawns at the start of winter across years, and body size was a predictor of overwinter survival (P < 0.001). Fawn sex ratios in December at time of capture were not different from 50:50 (P = 0.729). However, a sex differential in overwinter survival of fawns was observed (P = 0.002), but beta-binomial models of survival distributions were not different between sexes (P = 0.458). Frequencies of 3 categories of proximal causes of fawn mortality (predation, winter malnutrition, other) differed among states (χ 2 4 = 41.24, P < 0.001). A deterministic model with a mean winter survival rate of 0.444 for fawns and an annual rate of 0.853 for adult females predicted December fawn: doe ratios would have to be at least 66: 100 to maintain population levels. Similarity of mule deer population dynamics across the 3 states suggests similar processes regulate these populations; hence, results from specific study areas are generally more applicable than commonly thought.},
     language = {English},
     year = {1999},
     publisher = {Wiley on behalf of the Wildlife Society},
     copyright = {Copyright © 1999 Wiley},
    }


text:
package controllers

import (
	"GRE3000/base/cache"
	"GRE3000/const_conf"
	"GRE3000/filters"
	"GRE3000/models"
	"github.com/astaxie/beego"
	"strconv"
	"time"
)

type WordsController struct {
	beego.Controller
}

func (c *WordsController) Index() {
	var rawWordsList []*models.WordsList
	var userWordsList []*const_conf.RawWord

	isLogin, UserInfo := filters.IsLogin(c.Controller.Ctx)
	c.Data["IsLogin"], c.Data["UserInfo"] = isLogin, UserInfo
	needRandom, _ := c.GetBool("RandomSort")

	if isLogin && !needRandom {
		userWordsList = models.LoadWordsListForUser(&UserInfo)
	} else if !needRandom {
		rawWordsList = models.LoadRawWords()
	}
	if isLogin {
		c.Data["PageTitle"] = UserInfo.Username + "同学的单词表"
	} else {
		c.Data["PageTitle"] = "GRE单词表"
	}
	c.Data["IsWordsPage"] = true
	c.Data["RawWords"] = &rawWordsList
	c.Data["UserWords"] = &userWordsList
	c.Data["ShowMeans"], _ = c.GetBool("ShowMeans")
	c.Data["RandomSort"] = needRandom
	c.Layout = "layout/layout.tpl"
	c.TplName = "words/vocabulary.tpl"
}

func (c *WordsController) LoadWordsJson() {
	needRandom, _ := c.GetBool("RandomSort")
	isLogin, UserInfo := filters.IsLogin(c.Controller.Ctx)
	if isLogin {
		c.Data["json"] = models.LoadUserWordsJson(&UserInfo, needRandom)
	} else {
		c.Data["json"] = models.LoadRawWordsJson(needRandom)
	}
	c.ServeJSON()
}

func (c *WordsController) IncrMark() {
	ErrCode := -1
	id := c.Ctx.Input.Param(":id")
	token, flag := c.GetSecureCookie(const_conf.CookieSecure, const_conf.WebCookieName)
	userWordId, err := strconv.Atoi(id)
	if flag && !cache.Redis.IsExist(token+id) && err == nil && userWordId > 0 {
		isLogin, UserInfo := filters.IsLogin(c.Controller.Ctx)
		if isLogin {
			userWord, ok := models.FindUserWordByWordId(&UserInfo, userWordId)
			if ok {
				go models.IncrWordMark(userWord, &UserInfo)
				go cache.Redis.Put(token+id, UserInfo.Username, time.Duration(const_conf.MarkWordTimeLimit)*time.Minute)
				ErrCode = 0
			}
		}
	}
	c.Data["json"] = map[string]int{"ErrCode": ErrCode}
	c.ServeJSON()
}

func (c *WordsController) DeleteWord() {
	ErrCode := -1
	id := c.Ctx.Input.Param(":id")
	userWordId, err := strconv.Atoi(id)
	if err == nil && userWordId > 0 {
		isLogin, UserInfo := filters.IsLogin(c.Controller.Ctx)
		if isLogin {
			go models.DeleteWord(&UserInfo, userWordId)
			ErrCode = 0
		}
	}
	c.Data["json"] = map[string]int{"ErrCode": ErrCode}
	c.ServeJSON()
}

func (c *WordsController) Statistics() {
	isLogin, UserInfo := filters.IsLogin(c.Controller.Ctx)
	var countMarked, countAll int64
	if isLogin {
		countMarked = models.CountOfMarkedWords(&UserInfo)
		countAll = models.CountOfUserWords(&UserInfo)
	}
	c.Data["json"] = map[string]int64{"Marked": countMarked, "All": countAll}
	c.ServeJSON()
}


text:
SUMMARY = "WSGI HTTP Server for UNIX"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f75f3fb94cdeab1d607e2adaa6077752"

SRC_URI[md5sum] = "543669fcbb5739ee2af77184c5e571a1"
SRC_URI[sha256sum] = "1904bb2b8a43658807108d59c3f3d56c2b6121a701161de0ddf9ad140073c626"

inherit pypi setuptools3

RDEPENDS_${PN} += "${PYTHON_PN}-setuptools ${PYTHON_PN}-fcntl"


text:
@Article{vasalya:pn:2018,
  author    = {Vasalya, Ashesh and Ganesh, Gowrishankar and Kheddar, Abderrahmane},
  title     = {More than just co-worker influences human performance},
  journal   = {PLoS One},
  year      = {2018},
  volume    = {13},
  number    = {11},
  pages     = {e0206698},
  month     = {November},
  doi       = {https://doi.org/10.1371/journal.pone.0206698},
  url       = {http://www.comanoid.cnrs.fr/publications\_files/2018/vasalya-plone-2018.pdf},
  abstract  = {Does the presence of a robot co-worker influence the performance of humans around it? Studies of motor contagions during human-robot interactions have examined either how the observation of a robot affects a human’s movement velocity, or how it affects the human’s
movement variance, but never both together. Performance however, has to be measured considering both task speed (or frequency) as well as task accuracy. Here we examine an empirical repetitive industrial task in which a human participant and a humanoid robot work
near each other. We systematically varied the robot behavior, and observed whether and how the performance of a human participant is affected by the presence of the robot. To investigate the effect of physical form, we added conditions where the robot co-worker torso
and head were covered, and only the moving arm was visible to the human participants. Finally, we compared these behaviors with a human co-worker, and examined how the observed behavioral affects scale with experience of robots. Our results show that human
task frequency, but not task accuracy, is affected by the observation of a humanoid robot co-worker, provided the robot’s head and torso are visible.},
  publisher = {Public Library Science},
  address   = {1160 BATTERY STREET, STE 100, SAN FRANCISCO, CA 94111 USA}
}


text:
package agent

import (
	"github.com/edgexfoundry/edgex-go/internal/system/agent/interfaces"
	"github.com/edgexfoundry/go-mod-core-contracts/clients/logger"
	requests "github.com/edgexfoundry/go-mod-core-contracts/requests/configuration"
	responses "github.com/edgexfoundry/go-mod-core-contracts/responses/configuration"
)

type setExecutor struct {
	executor      interfaces.SetExecutor
	loggingClient logger.LoggingClient
	configuration *ConfigurationStruct
}

func NewSetExecutor(executor interfaces.SetExecutor,
	loggingClient logger.LoggingClient,
	configuration *ConfigurationStruct) *setExecutor {
	return &setExecutor{
		executor:      executor,
		loggingClient: loggingClient,
		configuration: configuration,
	}
}

// Set provides the callout to the set config service executor.
func (se setExecutor) Set(services []string, sc requests.SetConfigRequest) interface{} {
	result := struct {
		Configuration map[string]responses.SetConfigResponse `json:"configuration"`
	}{
		Configuration: map[string]responses.SetConfigResponse{},
	}

	// Loop over services and accumulate the response (i.e. "result") to return to requester.
	for _, service := range services {
		result.Configuration[service] = se.executor(service, sc)
	}
	return result
}


text:
@inproceedings{ho2016model,
  title={Model-free imitation learning with policy optimization},
  author={Ho, Jonathan and Gupta, Jayesh and Ermon, Stefano},
  booktitle={International Conference on Machine Learning},
  pages={2760--2769},
  year={2016},
  url={https://arxiv.org/abs/1605.08478},
}


text:
package platform

// Generated file, please do not change!!!

import (
	"fmt"
)

type ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestBuilder struct {
	projectKey string
	storeKey   string
	key        string
	client     *Client
}

/**
*	If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
*
 */
func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestBuilder) Get() *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestMethodGet {
	return &ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestMethodGet{
		url:    fmt.Sprintf("/%s/in-store/key=%s/customers/key=%s", rb.projectKey, rb.storeKey, rb.key),
		client: rb.client,
	}
}

/**
*	If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
*
 */
func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestBuilder) Post(body CustomerUpdate) *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestMethodPost {
	return &ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestMethodPost{
		body:   body,
		url:    fmt.Sprintf("/%s/in-store/key=%s/customers/key=%s", rb.projectKey, rb.storeKey, rb.key),
		client: rb.client,
	}
}

/**
*	Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message.
*
*	If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
*
 */
func (rb *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestBuilder) Delete() *ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestMethodDelete {
	return &ByProjectKeyInStoreKeyByStoreKeyCustomersKeyByKeyRequestMethodDelete{
		url:    fmt.Sprintf("/%s/in-store/key=%s/customers/key=%s", rb.projectKey, rb.storeKey, rb.key),
		client: rb.client,
	}
}

repository: labd/commercetools-go-sdk

repo_name: labd/commercetools-go-sdk


text:
DESCRIPTION = "This kernel module provides support for AMD Watchdog driver"
LICENSE = "BSD | GPLv2"
LIC_FILES_CHKSUM = "file://amd_wdt.c;endline=29;md5=8e7a9706367d146e5073510a6e176dc2"

inherit module kernel-openssl

SRC_URI = "file://Makefile \
           file://amd_wdt.c \
           file://amd_wdt.h \
          "

S = "${WORKDIR}"

# The inherit of module.bbclass will take care of the rest


text:
@book{arnoldMathematicalMethodsClassical1997,
  title = {Mathematical Methods of Classical Mechanics},
  author = {Arnol'd, V. I.},
  year = {1997},
  edition = {2nd ed},
  publisher = {{Springer}},
  address = {{New York}},
  isbn = {978-0-387-96890-2},
  keywords = {Mechanics; Analytic},
  language = {English},
  lccn = {QA805 .A6813 1997},
  number = {60},
  series = {Graduate Texts in Mathematics}
}

@book{griffithsIntroductionElectrodynamics2018,
  title = {Introduction to Electrodynamics},
  author = {Griffiths, David J.},
  year = {2018},
  edition = {Fourth edition},
  publisher = {{Cambridge University Press}},
  address = {{Cambridge, United Kingdom ; New York, NY}},
  abstract = {"WHAT IS ELECTRODYNAMICS, AND HOW DOES IT FIT INTO THE GENERAL SCHEME OF PHYSICS? Four Realms of Mechanics In the diagram below, I have sketched out the four great realms of mechanics: Classical Mechanics Quantum Mechanics (Newton) (Bohr, Heisenberg, Schr\"odinger, et al.) Special Relativity Quantum Field Theory (Einstein) (Dirac, Pauli, Feynman, Schwinger, et al.) Newtonian mechanics is adequate for most purposes in "everyday life," but for objects moving at high speeds (near the speed of light) it is incorrect, and must be replaced by special relativity (introduced by Einstein in 1905); for objects that are extremely small (near the size of atoms) it fails for different reasons, and is superseded by quantum mechanics (developed by Bohr, Schr\"odinger, Heisenberg, and many others, in the 1920's, mostly). For objects that are both very fast and very small (as is common in modern particle physics), a mechanics that combines relativity and quantum principles is in order; this relativistic quantum mechanics is known as quantum field theory--it was worked out in the thirties and forties, but even today it cannot claim to be a completely satisfactory system. In this book, save for the last chapter, we shall work exclusively in the domain of classical mechanics, although electrodynamics extends with unique simplicity to the other three realms. (In fact, the theory is in most respects automatically consistent with special relativity, for which it was, historically, the main stimulus.)"--},
  isbn = {978-1-108-42041-9},
  keywords = {Electrodynamics,Textbooks},
  lccn = {QC680 .G74 2018}
}

@book{griffithsIntroductionQuantumMechanics2018,
  title = {Introduction to Quantum Mechanics},
  author = {Griffiths, David J. and Schroeter, Darrell F.},
  year = {2018},
  edition = {Third edition},
  publisher = {{Cambridge University Press}},
  address = {{Cambridge ; New York, NY}},
  isbn = {978-1-107-18963-8},
  keywords = {Quantum theory},
  lccn = {QC174.12 .G75 2018}
}

@book{ohanianModernPhysics1995,
  title = {Modern Physics},
  author = {Ohanian, Hans C.},
  year = {1995},
  edition = {2nd ed},
  publisher = {{Prentice-Hall}},
  address = {{Englewood Cliffs, N.J}},
  isbn = {978-0-13-124439-9},
  keywords = {Physics},
  lccn = {QC21.2 .O36 1995}
}

@article{priceLagrangianVsHamiltonian2018,
  title = {Lagrangian vs {{Hamiltonian}}: {{The}} Best Approach to Relativistic Orbits},
  shorttitle = {Lagrangian vs {{Hamiltonian}}},
  author = {Price, Richard H. and Thorne, Kip S.},
  year = {2018},
  month = sep,
  volume = {86},
  pages = {678--682},
  issn = {0002-9505, 1943-2909},
  doi = {10.1119/1.5047439},
  file = {/Users/jim/Zotero/storage/62E75SRT/Price and Thorne - 2018 - Lagrangian vs Hamiltonian The best approach to re.pdf},
  journal = {American Journal of Physics},
  language = {en},
  number = {9}
}

@book{schroederIntroductionThermalPhysics2000,
  title = {An Introduction to Thermal Physics},
  author = {Schroeder, Daniel V.},
  year = {2000},
  publisher = {{Addison Wesley}},
  address = {{San Francisco, CA}},
  isbn = {978-0-201-38027-9},
  keywords = {Statistical mechanics,Thermodynamics},
  lccn = {QC311.15 .S32 2000}
}

@book{thorntonClassicalDynamicsParticles2004,
  title = {Classical Dynamics of Particles and Systems},
  author = {Thornton, Stephen T. and Marion, Jerry B.},
  year = {2004},
  edition = {5th ed},
  publisher = {{Brooks/Cole}},
  address = {{Belmont, CA}},
  isbn = {978-0-534-40896-1},
  keywords = {Dynamics},
  lccn = {QA845 .T45 2004}
}

@misc{whiteheadGraduateHandbookPenn2014,
  title = {Graduate {{Handbook}} for {{Penn State}}'s {{Department}} of {{Physics}}},
  author = {Whitehead, Jamie Lynne},
  year = {2014},
  month = aug,
  publisher = {{Pennsylvania State University}},
  file = {/Users/jim/Zotero/storage/5LM67JTF/Whitehead - GRADUATE HANDBOOK.pdf},
  language = {English}
}

repository: JWKennington/QualPrepNotes

repo_name: JWKennington/QualPrepNotes


text:
@phdthesis{tarver2022nonlinearity,
 author = {Tarver, Chance Anthony},
 school = {Rice University},
 title = {Nonlinearity Correction in Massive MIMO Systems via Virtual DPD},
 year = {2022}
}


text:
// +build !ignore_autogenerated

/*
Copyright 2018 The Pharmer Authors.

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

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

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

// This file was autogenerated by deepcopy-gen. Do not edit it manually!

package discovery

import (
	runtime "k8s.io/apimachinery/pkg/runtime"
)

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Member) DeepCopyInto(out *Member) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	if in.Request != nil {
		in, out := &in.Request, &out.Request
		if *in == nil {
			*out = nil
		} else {
			*out = new(MemberRequest)
			**out = **in
		}
	}
	if in.Response != nil {
		in, out := &in.Response, &out.Response
		if *in == nil {
			*out = nil
		} else {
			*out = new(MemberResponse)
			(*in).DeepCopyInto(*out)
		}
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Member.
func (in *Member) DeepCopy() *Member {
	if in == nil {
		return nil
	}
	out := new(Member)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Member) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	} else {
		return nil
	}
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MemberRequest) DeepCopyInto(out *MemberRequest) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberRequest.
func (in *MemberRequest) DeepCopy() *MemberRequest {
	if in == nil {
		return nil
	}
	out := new(MemberRequest)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MemberResponse) DeepCopyInto(out *MemberResponse) {
	*out = *in
	if in.PeerURLs != nil {
		in, out := &in.PeerURLs, &out.PeerURLs
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemberResponse.
func (in *MemberResponse) DeepCopy() *MemberResponse {
	if in == nil {
		return nil
	}
	out := new(MemberResponse)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PeerInfo) DeepCopyInto(out *PeerInfo) {
	*out = *in
	if in.Hosts != nil {
		in, out := &in.Hosts, &out.Hosts
		*out = make([]string, len(*in))
		copy(*out, *in)
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerInfo.
func (in *PeerInfo) DeepCopy() *PeerInfo {
	if in == nil {
		return nil
	}
	out := new(PeerInfo)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Ping) DeepCopyInto(out *Ping) {
	*out = *in
	out.TypeMeta = in.TypeMeta
	if in.Request != nil {
		in, out := &in.Request, &out.Request
		if *in == nil {
			*out = nil
		} else {
			*out = new(PingRequest)
			**out = **in
		}
	}
	if in.Response != nil {
		in, out := &in.Response, &out.Response
		if *in == nil {
			*out = nil
		} else {
			*out = new(PingResponse)
			(*in).DeepCopyInto(*out)
		}
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ping.
func (in *Ping) DeepCopy() *Ping {
	if in == nil {
		return nil
	}
	out := new(Ping)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Ping) DeepCopyObject() runtime.Object {
	if c := in.DeepCopy(); c != nil {
		return c
	} else {
		return nil
	}
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PingRequest) DeepCopyInto(out *PingRequest) {
	*out = *in
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PingRequest.
func (in *PingRequest) DeepCopy() *PingRequest {
	if in == nil {
		return nil
	}
	out := new(PingRequest)
	in.DeepCopyInto(out)
	return out
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PingResponse) DeepCopyInto(out *PingResponse) {
	*out = *in
	if in.Info != nil {
		in, out := &in.Info, &out.Info
		if *in == nil {
			*out = nil
		} else {
			*out = new(PeerInfo)
			(*in).DeepCopyInto(*out)
		}
	}
	return
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PingResponse.
func (in *PingResponse) DeepCopy() *PingResponse {
	if in == nil {
		return nil
	}
	out := new(PingResponse)
	in.DeepCopyInto(out)
	return out
}

repository: etcdcluster/etcd-discovery

repo_name: etcdcluster/etcd-discovery

branch_name: refs/heads/prototype

gha_language: Python


text:
/*
Copyright Hydrusio Labs Inc. 2016 All Rights Reserved.
Written by mint.zhao.chiu@gmail.com. github.com: https://www.github.com/mintzhao

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 coin

import (
	"errors"
	"fmt"
	"strconv"
	"strings"

	"github.com/golang/protobuf/proto"
	"github.com/hyperledger/fabric/core/chaincode/shim"
)

const coinInfoKey = "HydruscoinInfo"

// Key represents the key for a transaction in storage. It has both a
// hash and index
type Key struct {
	TxHashAsHex string
	TxIndex     uint32
}

func (k *Key) String() string {
	return fmt.Sprintf("%s:%d", k.TxHashAsHex, k.TxIndex)
}

// parseKey parse key string into Key object, return error if something invalid happened
func parseKey(keyStr string) (*Key, error) {
	if !strings.Contains(keyStr, ":") {
		return nil, ErrInvalidTxKey
	}

	subKeys := strings.Split(keyStr, ":")
	if len(subKeys) != 2 {
		return nil, ErrInvalidTxKey
	}

	txIdx, err := strconv.ParseUint(subKeys[1], 10, 32)
	if err != nil {
		return nil, err
	}

	return &Key{TxHashAsHex: subKeys[0], TxIndex: uint32(txIdx)}, nil
}

func generateAccountKey(addr string) string {
	return fmt.Sprintf("account_addr_%s", addr)
}

// Store interface describes the storage used by this chaincode. The interface
// was created so either the state database store can be used or a in memory
// store can be used for unit testing.
type Store interface {
	GetTx(string) (*TX, bool, error)
	PutTx(*TX) error
	InitCoinInfo() error
	GetCoinInfo() (*HydruscoinInfo, error)
	PutCoinInfo(*HydruscoinInfo) error
	GetAccount(string) (*Account, error)
	PutAccount(*Account) error
}

// Store struct uses a chaincode stub for state access
type ChaincodeStore struct {
	stub shim.ChaincodeStubInterface
}

// MakeChaincodeStore returns a store for storing keys in the state
func MakeChaincodeStore(stub shim.ChaincodeStubInterface) Store {
	store := &ChaincodeStore{}
	store.stub = stub
	return store
}

// GetTx returns a transaction for the given hash
func (s *ChaincodeStore) GetTx(key string) (*TX, bool, error) {
	data, err := s.stub.GetState(key)
	if err != nil {
		return nil, false, fmt.Errorf("Error getting state from stub:  %s", err)
	}
	if data == nil || len(data) == 0 {
		return nil, false, nil
	}

	tx, err := ParseTXBytes(data)
	if err != nil {
		return nil, false, err
	}

	return tx, true, nil
}

// PutTx adds a transaction to the state with the hash as a key
func (s *ChaincodeStore) PutTx(tx *TX) error {
	txBytes, err := proto.Marshal(tx)
	if err != nil {
		return err
	}

	return s.stub.PutState(TxHash(tx), txBytes)
}

func (s *ChaincodeStore) InitCoinInfo() error {
	coinInfo := &HydruscoinInfo{
		CoinTotal:    0,
		AccountTotal: 0,
		TxoutTotal:   0,
		TxTotal:      0,
		Placeholder:  "placeholder",
	}

	return s.PutCoinInfo(coinInfo)
}

func (s *ChaincodeStore) GetCoinInfo() (*HydruscoinInfo, error) {
	data, err := s.stub.GetState(coinInfoKey)
	if err != nil {
		return nil, err
	}

	if data == nil || len(data) == 0 {
		return nil, ErrKeyNoData
	}

	coinfo, err := ParseHydruscoinInfoBytes(data)
	if err != nil {
		return nil, err
	}

	return coinfo, nil
}

func (s *ChaincodeStore) PutCoinInfo(coinfo *HydruscoinInfo) error {
	coinBytes, err := proto.Marshal(coinfo)
	if err != nil {
		return err
	}

	if err := s.stub.PutState(coinInfoKey, coinBytes); err != nil {
		return err
	}

	return nil
}

// GetAccount returns account from world states
func (s *ChaincodeStore) GetAccount(addr string) (*Account, error) {
	if addr == "" {
		return nil, errors.New("empty addr")
	}
	key := generateAccountKey(addr)
	data, err := s.stub.GetState(key)
	if err != nil {
		return nil, err
	}

	if data == nil || len(data) == 0 {
		return nil, fmt.Errorf("no account found")
	}

	account := new(Account)
	if err := proto.Unmarshal(data, account); err != nil {
		return nil, err
	}

	return account, nil
}

// PutAccount update or insert account into world states
func (s *ChaincodeStore) PutAccount(account *Account) error {
	key := generateAccountKey(account.Addr)

	aBytes, err := proto.Marshal(account)
	if err != nil {
		return err
	}

	return s.stub.PutState(key, aBytes)
}

repository: IOTLink/app

repo_name: IOTLink/app


text:
@InProceedings{atan15,
  supplementary = {Supplementary:atan15-supp.pdf},
  title = {{Global Multi-armed Bandits with Hölder Continuity}},
  author = {Atan, Onur and Tekin, Cem and van der Schaar, Mihaela},
  pages = {28-36},
  abstract = {Standard Multi-Armed Bandit (MAB) problems assume that the arms are independent. However, in many application scenarios, the information obtained by playing an arm provides information about the remainder of the arms. Hence, in such applications, this informativeness can and should be exploited to enable faster convergence to the optimal solution. In this paper, formalize a new class of multi-armed bandit methods, Global Multi-armed Bandit (GMAB), in which arms are globally informative through a global parameter, i.e., choosing an arm reveals information about all the arms. We propose a greedy policy for the GMAB which always selects the arm with the highest estimated expected reward, and prove that it achieves bounded parameter-dependent regret. Hence, this policy selects suboptimal arms only finitely many times, and after a finite number of initial time steps, the optimal arm is selected in all of the remaining time steps with probability one. In addition, we also study how the informativeness of the arms about each other’s rewards affects the speed of learning. Specifically, we prove that the parameter-free (worst-case) regret is sublinear in time, and decreases with the infor- mativeness of the arms. We also prove a sublinear in time Bayesian risk bound for the GMAB which reduces to the well-known Bayesian risk bound for linearly parameterized bandits when the arms are fully informa- tive. GMABs have applications ranging from drug dosage control to dynamic pricing.},
}

repository: mreid/papersite

repo_name: mreid/papersite


text:
@article{bryant_consumer_2016-1,
 abstract = {© 2016 The Author(s). Background: Population-based registries are increasingly used to recruit patient samples for research, however, they have several limitations including low consent and participation rates, and potential selection bias. To improve access to samples for research, the utility of a new model of recruitment termed the 'Consumer Register', that allows for direct patient recruitment from hospitals, was examined. This paper reports: (i) consent rates onto the register; (ii) preferred methods and frequency of contact; and (iii) the feasibility of establishing the register, including: (a) cost per person recruited to the register; (b) the differential cost and consent rates of volunteer versus paid data collectors; and (c) participant completion rates. Methods: A cross-sectional survey was conducted in five outpatient clinics in Australia. Patients were approached by volunteers or paid data collectors and asked to complete a touch-screen electronic survey. Consenting individuals were asked to indicate their willingness and preferences for enrolment onto a research register. Descriptive statistics were used to examine patient preferences and linear regression used to model the success of volunteer versus paid data collectors. The opportunity and financial costs of establishing the register were calculated. Results: A total of 1947 patients (80.6 %) consented to complete the survey, of which, 1486 (76.3 %) completed the questionnaire. Of the completers, the majority (69.4 %, or 1032 participants) were willing to be listed on the register and preferred to be contacted by email (50.3 %). Almost 39 % of completers were willing to be contacted three or more times in a 12 month period. The annual opportunity cost of resources consumed by the register was valued at \$37,187, giving an opportunity cost per person recruited to the register of \$36. After amortising fixed costs, the annual financial outlay was \$23,004 or \$22 per person recruited to the register. Use of volunteer data collectors contributed to an annual saving of \$14,183, however paid data collectors achieved significantly higher consent rates. Successful enrolment onto the register was completed for 42 % of the sample. Conclusions: A Consumer Register is a promising and feasible alternative to population-based registries, with the majority of participants willing to be contacted multiple times via low-resource methods such as email. There is an effectiveness/cost trade off in the use of paid versus volunteer data collectors.},
 author = {Bryant, J. and Sanson-Fisher, R. and Fradgley, E. and Hobden, B. and Zucca, A. and Henskens, F. and Searles, A. and Webb, B. and Oldmeadow, C.},
 doi = {10.1186/s12874-016-0238-8},
 issn = {1471-2288},
 journal = {BMC Medical Research Methodology},
 month = {October},
 number = {1},
 pages = {1--10},
 title = {A consumer register: an acceptable and cost-effective alternative for accessing patient populations},
 volume = {16},
 year = {2016}
}

repository: ChrisOldmeadow/academic-kickstart

repo_name: ChrisOldmeadow/academic-kickstart


text:
package main

/*
#include <stdio.h>
char ch = 'b';
int num = 123;
double value = 3.14;
 */
import "C"
import "fmt"

func main() {
	// 通过C.变量名称 方式访问C语言中的变量
	//fmt.Println(C.ch)
	//fmt.Println(C.num)
	//fmt.Println(C.value)

	//fmt.Printf("%T\n", C.ch)
	//fmt.Printf("%T\n", C.num)
	//fmt.Printf("%T\n", C.value)

	var ch byte
	ch = byte(C.ch)
	fmt.Println(ch)

	var num int
	num = int(C.num)
	fmt.Println(num)

	var value float64
	value = float64(C.value)
	fmt.Println(value)
}

repository: codeXiaoQiang/Go-language

repo_name: codeXiaoQiang/Go-language


text:
package main

import (
	"fmt"
	"log"
	"net/http"

	"github.com/chirino/graphql"
	"github.com/chirino/graphql/graphiql"
	"github.com/chirino/graphql/httpgql"
)

type query struct {
	Name string `json:"name"`
}

func (q *query) Hello() string { return "Hello, " + q.Name }

func main() {
	engine := graphql.New()
	engine.Root = &query{
		Name: "World!",
	}
	err := engine.Schema.Parse(`
        schema {
            query: Query
        }
        type Query {
            name: String!
            hello: String!
        }
    `)
	if err != nil {
		log.Fatal(err)
	}

	http.Handle("/graphql", &httpgql.Handler{ServeGraphQLStream: engine.ServeGraphQLStream})
	fmt.Println("GraphQL service running at http://localhost:8080/graphql")

	http.Handle("/", graphiql.New("ws://localhost:8080/graphql", true))
	fmt.Println("GraphiQL UI running at http://localhost:8080/")

	log.Fatal(http.ListenAndServe(":8080", nil))
}

repository: chirino/graphql

repo_name: chirino/graphql


text:
SECTION = "console/network"
DESCRIPTION = "tn5250 is a 5250 terminal emulator, used for connecting \
to IBM's AS/400 (now known as eServer iSeries) midrange computers."
HOMEPAGE = "http://tn5250.sourceforge.net/"
LICENSE = "LGPL"
DEPENDS = "ncurses openssl"
PR ="r2"

SRC_URI = "${SOURCEFORGE_MIRROR}/tn5250/tn5250-${PV}.tar.gz \
	   file://compile.patch"

inherit autotools

PACKAGES = "${PN}-dbg lib5250-0 tn5250-dev tn5250-doc tn5250"
FILES_${PN} = "${bindir}/tn5250"
FILES_lib5250-0 = "${libdir}/lib*.so.*"
AUTO_LIBNAME_PKGS = "lib5250"

do_stage() {
	autotools_stage_includes
        oe_libinstall -so -a -C src lib5250 ${STAGING_LIBDIR}
}

SRC_URI[md5sum] = "2f9ef4509198e96bb184577fdddfce6d"
SRC_URI[sha256sum] = "794687ae1b34aba9a3cf6f9b118d0ba91b8f83858fe92a9ded0611225db3ca0e"