text:
package filter

import (
	"bytes"
	"fmt"
	"io"
	"regexp"
	"strconv"
	"strings"

	"github.com/koron/nvgd/resource"
)

// Cut represents cut filter.
type Cut struct {
	Base
	delim     []byte
	selectors []cutSelector
	write     cutWriter
}

type cutSelector func(dst, src [][]byte) [][]byte
type cutWriter func(io.Writer, []byte) error

// NewCut creates an instance of cut filter.
func NewCut(r io.ReadCloser, delim []byte, selectors []cutSelector) *Cut {
	f := &Cut{
		delim: delim,
	}
	if len(selectors) == 0 {
		f.write = f.writeAll
	} else {
		f.selectors = selectors
		f.write = f.writeSome
	}
	f.Base.Init(r, f.readNext)
	return f
}

func (f *Cut) readNext(buf *bytes.Buffer) error {
	raw, err := f.ReadLine()
	if err != nil && (err != io.EOF || len(raw) == 0) {
		return err
	}
	return f.write(buf, raw)
}

func (f *Cut) writeAll(w io.Writer, b []byte) error {
	_, err := w.Write(b)
	return err
}

func (f *Cut) writeSome(w io.Writer, b []byte) error {
	b, lf := splitLF(b)
	src := bytes.Split(b, f.delim)
	var selected [][]byte
	for _, s := range f.selectors {
		selected = s(selected, src)
	}
	_, err := w.Write(bytes.Join(selected, f.delim))
	if err != nil {
		return err
	}
	if len(lf) > 0 {
		_, err := w.Write(lf)
		if err != nil {
			return err
		}
	}
	return nil
}

func splitLF(b []byte) (body, lf []byte) {
	l := len(b)
	if l > 0 && b[l-1] == '\n' {
		l--
		if l > 0 && b[l-1] == '\r' {
			l--
		}
	}
	return b[:l], b[l:]
}

var (
	rxCutOne        = regexp.MustCompile(`^[1-9]\d*$`)
	rxCutRange      = regexp.MustCompile(`^([1-9]\d*)-([1-9]\d*)$`)
	rxCutRangeBegin = regexp.MustCompile(`^([1-9]\d*)-$`)
	rxCutRangeEnd   = regexp.MustCompile(`^-([1-9]\d*)$`)
)

func toCutSelector(s string) ([]cutSelector, error) {
	if s == "" {
		return nil, nil
	}
	var sels []cutSelector
	for _, item := range strings.Split(s, ",") {
		var sel cutSelector
		if m := rxCutOne.FindString(item); m != "" {
			n, err := toCutIndex(m)
			if err != nil {
				return nil, err
			}
			sel = newCutOne(n)
		} else if m := rxCutRange.FindStringSubmatch(item); m != nil {
			s, err := toCutIndex(m[1])
			if err != nil {
				return nil, err
			}
			e, err := toCutIndex(m[2])
			if err != nil {
				return nil, err
			}
			sel = newCutRange(s, e)
		} else if m := rxCutRangeBegin.FindStringSubmatch(item); m != nil {
			n, err := toCutIndex(m[1])
			if err != nil {
				return nil, err
			}
			sel = newCutRangeBegin(n)
		} else if m := rxCutRangeEnd.FindStringSubmatch(item); m != nil {
			n, err := toCutIndex(m[1])
			if err != nil {
				return nil, err
			}
			sel = newCutRangeEnd(n)
		}
		if sel == nil {
			return nil, fmt.Errorf("unknown cut list item: %s", item)
		}
		sels = append(sels, sel)
	}
	return sels, nil
}

func toCutIndex(s string) (int, error) {
	n, err := strconv.Atoi(s)
	if err != nil {
		return 0, err
	}
	if n < 1 {
		return 0, fmt.Errorf("small index: %d", n)
	}
	return n - 1, err
}

func newCutOne(value int) cutSelector {
	return func(dst, src [][]byte) [][]byte {
		if value >= len(src) {
			return dst
		}
		return append(dst, src[value])
	}
}

func newCutRange(start, end int) cutSelector {
	if start <= end {
		return func(dst, src [][]byte) [][]byte {
			l := len(src)
			if start >= l {
				return dst
			}
			if end >= l {
				end = l - 1
			}
			return append(dst, src[start:end+1]...)
		}
	}
	return func(dst, src [][]byte) [][]byte {
		l := len(src)
		if end >= l {
			return dst
		}
		if start >= l {
			start = l - 1
		}
		for i := start; i >= end; i-- {
			dst = append(dst, src[i])
		}
		return dst
	}
}

func newCutRangeBegin(n int) cutSelector {
	return func(dst, src [][]byte) [][]byte {
		if n >= len(src) {
			return dst
		}
		return append(dst, src[n:]...)
	}
}

func newCutRangeEnd(n int) cutSelector {
	return func(dst, src [][]byte) [][]byte {
		l := len(src)
		if n >= l {
			n = l - 1
		}
		return append(dst, src[:n+1]...)
	}
}

func newCut(r *resource.Resource, p Params) (*resource.Resource, error) {
	delim := []byte(p.String("delim", "\t"))
	selectors, err := toCutSelector(p.String("list", ""))
	if err != nil {
		return nil, err
	}
	return r.Wrap(NewCut(r, delim, selectors)), nil
}

func init() {
	MustRegister("cut", newCut)
}

repository: koron/nvgd

repo_name: koron/nvgd

branch_name: refs/heads/main

gha_language: Go

extension: go


text:
add_library(Qt5::QMinimalIntegrationPlugin MODULE IMPORTED)

set(_Qt5QMinimalIntegrationPlugin_MODULE_DEPENDENCIES "EventDispatcherSupport;FontDatabaseSupport;Gui;Gui;Core;Core")

foreach(_module_dep ${_Qt5QMinimalIntegrationPlugin_MODULE_DEPENDENCIES})
    if(NOT Qt5${_module_dep}_FOUND)
        find_package(Qt5${_module_dep}
             ${_Qt5Gui_FIND_VERSION_EXACT}
            ${_Qt5Gui_DEPENDENCIES_FIND_QUIET}
            ${_Qt5Gui_FIND_DEPENDENCIES_REQUIRED}
            PATHS "${CMAKE_CURRENT_LIST_DIR}/.." NO_DEFAULT_PATH
        )
    endif()
endforeach()

_qt5_Gui_process_prl_file(
    "${_qt5Gui_install_prefix}/plugins/platforms/qminimal.prl" RELEASE
    _Qt5QMinimalIntegrationPlugin_STATIC_RELEASE_LIB_DEPENDENCIES
    _Qt5QMinimalIntegrationPlugin_STATIC_RELEASE_LINK_FLAGS
)

set_property(TARGET Qt5::QMinimalIntegrationPlugin PROPERTY INTERFACE_SOURCES
    "${CMAKE_CURRENT_LIST_DIR}/Qt5Gui_QMinimalIntegrationPlugin_Import.cpp"
)

_populate_Gui_plugin_properties(QMinimalIntegrationPlugin RELEASE "platforms/qminimal.lib" FALSE)

list(APPEND Qt5Gui_PLUGINS Qt5::QMinimalIntegrationPlugin)
set_property(TARGET Qt5::Gui APPEND PROPERTY QT_ALL_PLUGINS_platforms Qt5::QMinimalIntegrationPlugin)
# $<GENEX_EVAL:...> wasn't added until CMake 3.12, so put a version guard around it
if(CMAKE_VERSION VERSION_LESS "3.12")
    set(_manual_plugins_genex "$<TARGET_PROPERTY:QT_PLUGINS>")
    set(_plugin_type_genex "$<TARGET_PROPERTY:QT_PLUGINS_platforms>")
    set(_no_plugins_genex "$<TARGET_PROPERTY:QT_NO_PLUGINS>")
else()
    set(_manual_plugins_genex "$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS>>")
    set(_plugin_type_genex "$<GENEX_EVAL:$<TARGET_PROPERTY:QT_PLUGINS_platforms>>")
    set(_no_plugins_genex "$<GENEX_EVAL:$<TARGET_PROPERTY:QT_NO_PLUGINS>>")
endif()
set(_user_specified_genex
    "$<IN_LIST:Qt5::QMinimalIntegrationPlugin,${_manual_plugins_genex};${_plugin_type_genex}>"
)
set(_user_specified_genex_versionless
    "$<IN_LIST:Qt::QMinimalIntegrationPlugin,${_manual_plugins_genex};${_plugin_type_genex}>"
)
string(CONCAT _plugin_genex
    "$<$<OR:"
        # Add this plugin if it's in the list of manually specified plugins or in the list of
        # explicitly included plugin types.
        "${_user_specified_genex},"
        "${_user_specified_genex_versionless},"
        # Add this plugin if all of the following are true:
        # 1) the list of explicitly included plugin types is empty
        # 2) the QT_PLUGIN_EXTENDS property for the plugin is empty or equal to the current
        #    module name
        # 3) the user hasn't explicitly excluded the plugin.
        "$<AND:"
            "$<STREQUAL:${_plugin_type_genex},>,"
            "$<OR:"
                # FIXME: The value of CMAKE_MODULE_NAME seems to be wrong (e.g for Svg plugin
                # it should be Qt::Svg instead of Qt::Gui).
                "$<STREQUAL:$<TARGET_PROPERTY:Qt5::QMinimalIntegrationPlugin,QT_PLUGIN_EXTENDS>,Qt::Gui>,"
                "$<STREQUAL:$<TARGET_PROPERTY:Qt5::QMinimalIntegrationPlugin,QT_PLUGIN_EXTENDS>,>"
            ">,"
            "$<NOT:$<IN_LIST:Qt5::QMinimalIntegrationPlugin,${_no_plugins_genex}>>,"
            "$<NOT:$<IN_LIST:Qt::QMinimalIntegrationPlugin,${_no_plugins_genex}>>"
        ">"
    ">:Qt5::QMinimalIntegrationPlugin>"
)
set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_LINK_LIBRARIES
    ${_plugin_genex}
)
set_property(TARGET Qt5::QMinimalIntegrationPlugin APPEND PROPERTY INTERFACE_LINK_LIBRARIES
    "Qt5::EventDispatcherSupport;Qt5::FontDatabaseSupport;Qt5::Gui;Qt5::Gui;Qt5::Core;Qt5::Core"
)
set_property(TARGET Qt5::QMinimalIntegrationPlugin PROPERTY QT_PLUGIN_TYPE "platforms")
set_property(TARGET Qt5::QMinimalIntegrationPlugin PROPERTY QT_PLUGIN_EXTENDS "-")
set_property(TARGET Qt5::QMinimalIntegrationPlugin PROPERTY QT_PLUGIN_CLASS_NAME "QMinimalIntegrationPlugin")

license: MIT

license_type: permissive

branch_name: refs/heads/master

extension: cmake


text:
package flexkube

import (
	"context"
	"regexp"
	"testing"

	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"

	"github.com/flexkube/libflexkube/pkg/container"
	"github.com/flexkube/libflexkube/pkg/container/runtime/docker"
	"github.com/flexkube/libflexkube/pkg/container/types"
	"github.com/flexkube/libflexkube/pkg/host"
	"github.com/flexkube/libflexkube/pkg/host/transport/direct"
)

const controlplanePlanOnlyConfig = `
locals {
  controller_ips = ["1.1.1.1"]
  controller_names = ["controller01"]
  first_controller_ip = local.controller_ips[0]
  api_port = 6443
  bootstrap_api_bind = "0.0.0.0"
}

resource "flexkube_pki" "pki" {
  certificate {
    organization = "example"
  }

  etcd {
    peers   = zipmap(local.controller_names, local.controller_ips)
    servers = zipmap(local.controller_names, local.controller_ips)

    client_cns = [
      "root",
      "kube-apiserver",
      "prometheus",
    ]
  }

  kubernetes {
    kube_api_server {
      external_names = ["kube-apiserver.example.com"]
      server_ips     = concat(local.controller_ips, ["127.0.1.1", "11.0.0.1"])
    }
  }
}

resource "flexkube_controlplane" "bootstrap" {
  pki_yaml = flexkube_pki.pki.state_yaml

  kube_apiserver {
    service_cidr               = "11.0.0.0/24"
    etcd_servers               = formatlist("https://%s:2379", local.controller_ips)
    bind_address               = local.bootstrap_api_bind
    advertise_address          = local.first_controller_ip
    secure_port                = local.api_port
  }

  kube_controller_manager {
    flex_volume_plugin_dir      = "/var/lib/kubelet/volumeplugins"
  }

  api_server_address = local.first_controller_ip
  api_server_port    = local.api_port

  ssh {
    address            = "127.0.0.1"
    port               = 12345
    password           = "bar"
    connection_timeout = "1s"
    retry_interval     = "1s"
    retry_timeout      = "1s"
  }
}
`

func TestControlplanePlanOnly(t *testing.T) {
	t.Parallel()

	resource.UnitTest(t, resource.TestCase{
		Providers: map[string]*schema.Provider{
			"flexkube": Provider(),
		},
		Steps: []resource.TestStep{
			{
				Config:             controlplanePlanOnlyConfig,
				PlanOnly:           true,
				ExpectNonEmptyPlan: true,
			},
		},
	})
}

const controlplaneCreateRuntimeErrorConfig = `
locals {
  controller_ips = ["1.1.1.1"]
  controller_names = ["controller01"]
  first_controller_ip = local.controller_ips[0]
  api_port = 6443
  bootstrap_api_bind = "0.0.0.0"
}

resource "flexkube_pki" "pki" {
  certificate {
    organization = "example"
  }

  etcd {
    peers   = zipmap(local.controller_names, local.controller_ips)
    servers = zipmap(local.controller_names, local.controller_ips)

    client_cns = [
      "root",
      "kube-apiserver",
      "prometheus",
    ]
  }

  kubernetes {
    kube_api_server {
      external_names = ["kube-apiserver.example.com"]
      server_ips     = concat(local.controller_ips, ["127.0.1.1", "11.0.0.1"])
    }
  }
}

resource "flexkube_controlplane" "bootstrap" {
  pki_yaml = flexkube_pki.pki.state_yaml

  kube_apiserver {
    service_cidr               = "11.0.0.0/24"
    etcd_servers               = formatlist("https://%s:2379", local.controller_ips)
    bind_address               = local.bootstrap_api_bind
    advertise_address          = local.first_controller_ip
    secure_port                = local.api_port

    host {
      ssh {
        address            = "127.0.0.1"
        port               = 12345
        password           = "bar"
        connection_timeout = "1s"
        retry_interval     = "1s"
        retry_timeout      = "1s"
      }
    }

    common {
      image = "bar"
    }
  }

  kube_controller_manager {
    flex_volume_plugin_dir      = "/var/lib/kubelet/volumeplugins"

    host {
      ssh {
        address            = "127.0.0.1"
        port               = 12345
        password           = "bar"
        connection_timeout = "1s"
        retry_interval     = "1s"
        retry_timeout      = "1s"
      }
    }

    common {
      image = "baz"
    }

  }

  kube_scheduler {
    host {
      ssh {
        address            = "127.0.0.1"
        port               = 12345
        password           = "bar"
        connection_timeout = "1s"
        retry_interval     = "1s"
        retry_timeout      = "1s"
      }
    }

    common {
      image = "doh"
    }
  }

  api_server_address = local.first_controller_ip
  api_server_port    = local.api_port

  ssh {
    address            = "127.0.0.1"
    port               = 12345
    password           = "bar"
    connection_timeout = "1s"
    retry_interval     = "1s"
    retry_timeout      = "1s"
  }
}
`

func TestControlplaneCreateRuntimeError(t *testing.T) {
	t.Parallel()

	resource.UnitTest(t, resource.TestCase{
		Providers: map[string]*schema.Provider{
			"flexkube": Provider(),
		},
		Steps: []resource.TestStep{
			{
				Config:      controlplaneCreateRuntimeErrorConfig,
				ExpectError: regexp.MustCompile(`connection refused`),
			},
		},
	})
}

const controlplaneValidateFailConfig = `
resource "flexkube_controlplane" "bootstrap" {
  common {
    kubernetes_ca_certificate  = ""
    front_proxy_ca_certificate = ""
  }

  kube_apiserver {
    api_server_certificate     = ""
    api_server_key             = ""
    front_proxy_certificate    = ""
    front_proxy_key            = ""
    kubelet_client_certificate = ""
    kubelet_client_key         = ""
    service_account_private_key = ""
    etcd_ca_certificate        = ""
    etcd_client_certificate    = ""
    etcd_client_key            = ""
    service_cidr               = "11.0.0.0/24"
    etcd_servers               = []
    bind_address               = ""
    advertise_address          = ""
    secure_port                = 6443
  }

  kube_controller_manager {
    flex_volume_plugin_dir      = ""
    kubernetes_ca_key           = ""
    service_account_private_key = ""
    root_ca_certificate         = ""

    kubeconfig {
      client_certificate = ""
      client_key         = ""
    }
  }

  kube_scheduler {
    kubeconfig {
      client_certificate = ""
      client_key         = ""
    }
  }

  api_server_address = ""
  api_server_port    = 0

  ssh {
    user        = "core"
    address     = ""
    port        = 22
    private_key = ""
  }
}
`

func TestControlplaneValidateFail(t *testing.T) {
	t.Parallel()

	resource.UnitTest(t, resource.TestCase{
		Providers: map[string]*schema.Provider{
			"flexkube": Provider(),
		},
		Steps: []resource.TestStep{
			{
				Config:      controlplaneValidateFailConfig,
				ExpectError: regexp.MustCompile(`decoding PEM format`),
			},
		},
	})
}

func TestControlplaneDecodeEmptyBlocks(t *testing.T) {
	t.Parallel()

	config := `
resource "flexkube_controlplane" "bootstrap" {
  common {}

  kube_apiserver {}

  kube_controller_manager {}

  kube_scheduler {}

  ssh {}
}
`

	resource.UnitTest(t, resource.TestCase{
		Providers: map[string]*schema.Provider{
			"flexkube": Provider(),
		},
		Steps: []resource.TestStep{
			{
				Config:      config,
				ExpectError: regexp.MustCompile(`initializing configuration`),
			},
		},
	})
}

func TestControlplaneDecodeEmptyConfig(t *testing.T) {
	t.Parallel()

	config := `
resource "flexkube_controlplane" "bootstrap" {}
`

	resource.UnitTest(t, resource.TestCase{
		Providers: map[string]*schema.Provider{
			"flexkube": Provider(),
		},
		Steps: []resource.TestStep{
			{
				Config:      config,
				ExpectError: regexp.MustCompile(`blocks are required.`),
			},
		},
	})
}

func TestControlplaneDecodeEmptyKubeconfig(t *testing.T) {
	t.Parallel()

	config := `
resource "flexkube_controlplane" "bootstrap" {
  kube_controller_manager {
    kubeconfig {}
    common {}
  }
}
`

	resource.UnitTest(t, resource.TestCase{
		Providers: map[string]*schema.Provider{
			"flexkube": Provider(),
		},
		Steps: []resource.TestStep{
			{
				Config:      config,
				ExpectError: regexp.MustCompile(`blocks are required.`),
			},
		},
	})
}

func TestControlplaneDestroy(t *testing.T) {
	t.Parallel()

	// Prepare some fake state.
	cs := container.ContainersState{
		"foo": &container.HostConfiguredContainer{
			Host: host.Host{
				DirectConfig: &direct.Config{},
			},
			Container: container.Container{
				Runtime: container.RuntimeConfig{
					Docker: &docker.Config{
						Host: "unix:///nonexistent",
					},
				},
				Config: types.ContainerConfig{
					Name:  "foo",
					Image: "busybox:latest",
				},
				Status: &types.ContainerStatus{
					ID:     "foo",
					Status: "running",
				},
			},
		},
	}

	s := map[string]interface{}{
		stateSensitiveSchemaKey: containersStateMarshal(cs, false),
		"kube_apiserver": []interface{}{
			map[string]interface{}{
				"service_account_private_key": "foo",
				"service_cidr":                "11.0.0.0/24",
				"etcd_servers": []interface{}{
					"foo",
				},
				"bind_address":      "0.0.0.0",
				"advertise_address": "1.1.1.1",
			},
		},
		"api_server_address": "1.1.1.1",
		"api_server_port":    1,
	}

	r := resourceControlplane()
	d := schema.TestResourceDataRaw(t, r.Schema, s)

	// Mark newly created object as created, so it's state is persisted.
	d.SetId("foo")

	// Create new ResourceData from the state, so it's persisted and there is no diff included.
	dn := r.Data(d.State())

	err := controlplaneDestroy(context.TODO(), dn, nil)
	if err != nil {
		t.Fatalf("destroying with unreachable container runtime should work, got: %v", err)
	}
}

func TestControlplaneDestroyValidateConfiguration(t *testing.T) {
	t.Parallel()

	// Prepare some fake state.
	cs := container.ContainersState{
		"foo": &container.HostConfiguredContainer{
			Host: host.Host{
				DirectConfig: &direct.Config{},
			},
			Container: container.Container{
				Runtime: container.RuntimeConfig{
					Docker: &docker.Config{
						Host: "unix:///nonexistent",
					},
				},
				Config: types.ContainerConfig{
					Name:  "foo",
					Image: "busybox:latest",
				},
				Status: &types.ContainerStatus{
					ID:     "foo",
					Status: "running",
				},
			},
		},
	}

	s := map[string]interface{}{
		stateSensitiveSchemaKey: containersStateMarshal(cs, false),
	}

	r := resourceControlplane()
	d := schema.TestResourceDataRaw(t, r.Schema, s)

	// Mark newly created object as created, so it's state is persisted.
	d.SetId("foo")

	// Create new ResourceData from the state, so it's persisted and there is no diff included.
	dn := r.Data(d.State())

	err := controlplaneDestroy(context.TODO(), dn, nil)
	if err != nil {
		t.Fatalf("destroying with unreachable container runtime should work, got: %v", err)
	}
}

repository: flexkube/terraform-provider-flexkube

repo_name: flexkube/terraform-provider-flexkube


text:
SUMMARY = "C library for storing RDF data in memory"
HOMEPAGE = "http://drobilla.net/software/sord"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=b698a6a2120a83eecb34a9c6f1b93989"

inherit waf pkgconfig

DEPENDS += "libpcre serd"

PV = "0.16.10"
SRC_URI = " \
    http://download.drobilla.net/${BPN}-${PV}.tar.bz2 \
    file://0001-Fix-build-for-python3-only-environments.patch \
"
SRC_URI[sha256sum] = "9c70b3fbbb0c5c7bf761ef66c3d5b939ab45ad063e055990f17f40f1f6f96572"

repository: schnitzeltony/meta-musicians

repo_name: schnitzeltony/meta-musicians

gha_license_id: MIT

gha_language: BitBake

extension: bb


text:
package parser

import (
	"go/parser"
	"go/token"
)

// ReadFile reads the file and store the information of the file inside spec
func ReadFile(file string, spec *PackageSpec) error {
	fset := token.NewFileSet()
	f, err := parser.ParseFile(fset, file, nil, 0)
	if err != nil {
		return err
	}

	err = addFileSpec(f, spec)
	if err != nil {
		return err
	}

	// TODO: load all needed interface specs out of imports (nothing more is needed!)

	return connectInterfaces(spec)
}

repository: maprost/GoPlantUML

repo_name: maprost/GoPlantUML


text:
package network

import "github.com/docker/docker/pkg/nat"

// Address represents an IP address
type Address struct {
	Addr      string
	PrefixLen int
}

// IPAM represents IP Address Management
type IPAM struct {
	Driver string
	Config []IPAMConfig
}

// IPAMConfig represents IPAM configurations
type IPAMConfig struct {
	Subnet     string            `json:",omitempty"`
	IPRange    string            `json:",omitempty"`
	Gateway    string            `json:",omitempty"`
	AuxAddress map[string]string `json:"AuxiliaryAddresses,omitempty"`
}

// Settings stores configuration details about the daemon network config
// TODO Windows. Many of these fields can be factored out.,
type Settings struct {
	Bridge                 string
	SandboxID              string
	HairpinMode            bool
	LinkLocalIPv6Address   string
	LinkLocalIPv6PrefixLen int
	Networks               map[string]*EndpointSettings
	Ports                  nat.PortMap
	SandboxKey             string
	SecondaryIPAddresses   []Address
	SecondaryIPv6Addresses []Address
	IsAnonymousEndpoint    bool
}

// EndpointSettings stores the network endpoint details
type EndpointSettings struct {
	EndpointID          string
	Gateway             string
	IPAddress           string
	IPPrefixLen         int
	IPv6Gateway         string
	GlobalIPv6Address   string
	GlobalIPv6PrefixLen int
	MacAddress          string
}

repository: circleci/docker

repo_name: circleci/docker


text:
SUMMARY = "Wraps the best available JSON implementation available in a common interface"
DESCRIPTION = "Anyjson loads whichever is the fastest JSON module installed and  \
provides a uniform API regardless of which JSON implementation is used."
HOMEPAGE = "https://bitbucket.org/runeh/anyjson"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=989aa97e73c912a83a3c873fa11deb08"

inherit pypi setuptools3 ptest

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

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

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

SRC_URI[md5sum] = "2ea28d6ec311aeeebaf993cb3008b27c"
SRC_URI[sha256sum] = "37812d863c9ad3e35c0734c42e0bf0320ce8c3bed82cd20ad54cb34d158157ba"

RDEPENDS:${PN} += "${PYTHON_PN}-simplejson"

repository: Intel-BMC/openbmc

repo_name: Intel-BMC/openbmc

gha_license_id: NOASSERTION

gha_language: Python


text:
// Code generated by entc, DO NOT EDIT.

package deletedvlanlog

import (
	"entgo.io/ent/dialect/sql"
	"entgo.io/ent/dialect/sql/sqlgraph"
	"github.com/mrzack99s/netcoco/ent/predicate"
)

// ID filters vertices based on their ID field.
func ID(id int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldID), id))
	})
}

// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldID), id))
	})
}

// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldID), id))
	})
}

// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(ids) == 0 {
			s.Where(sql.False())
			return
		}
		v := make([]interface{}, len(ids))
		for i := range v {
			v[i] = ids[i]
		}
		s.Where(sql.In(s.C(FieldID), v...))
	})
}

// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(ids) == 0 {
			s.Where(sql.False())
			return
		}
		v := make([]interface{}, len(ids))
		for i := range v {
			v[i] = ids[i]
		}
		s.Where(sql.NotIn(s.C(FieldID), v...))
	})
}

// IDGT applies the GT predicate on the ID field.
func IDGT(id int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldID), id))
	})
}

// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldID), id))
	})
}

// IDLT applies the LT predicate on the ID field.
func IDLT(id int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldID), id))
	})
}

// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldID), id))
	})
}

// VlanID applies equality check predicate on the "vlan_id" field. It's identical to VlanIDEQ.
func VlanID(v int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldVlanID), v))
	})
}

// Deleted applies equality check predicate on the "deleted" field. It's identical to DeletedEQ.
func Deleted(v bool) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldDeleted), v))
	})
}

// VlanIDEQ applies the EQ predicate on the "vlan_id" field.
func VlanIDEQ(v int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldVlanID), v))
	})
}

// VlanIDNEQ applies the NEQ predicate on the "vlan_id" field.
func VlanIDNEQ(v int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldVlanID), v))
	})
}

// VlanIDIn applies the In predicate on the "vlan_id" field.
func VlanIDIn(vs ...int) predicate.DeletedVlanLog {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.In(s.C(FieldVlanID), v...))
	})
}

// VlanIDNotIn applies the NotIn predicate on the "vlan_id" field.
func VlanIDNotIn(vs ...int) predicate.DeletedVlanLog {
	v := make([]interface{}, len(vs))
	for i := range v {
		v[i] = vs[i]
	}
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		// if not arguments were provided, append the FALSE constants,
		// since we can't apply "IN ()". This will make this predicate falsy.
		if len(v) == 0 {
			s.Where(sql.False())
			return
		}
		s.Where(sql.NotIn(s.C(FieldVlanID), v...))
	})
}

// VlanIDGT applies the GT predicate on the "vlan_id" field.
func VlanIDGT(v int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.GT(s.C(FieldVlanID), v))
	})
}

// VlanIDGTE applies the GTE predicate on the "vlan_id" field.
func VlanIDGTE(v int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.GTE(s.C(FieldVlanID), v))
	})
}

// VlanIDLT applies the LT predicate on the "vlan_id" field.
func VlanIDLT(v int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.LT(s.C(FieldVlanID), v))
	})
}

// VlanIDLTE applies the LTE predicate on the "vlan_id" field.
func VlanIDLTE(v int) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.LTE(s.C(FieldVlanID), v))
	})
}

// DeletedEQ applies the EQ predicate on the "deleted" field.
func DeletedEQ(v bool) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.EQ(s.C(FieldDeleted), v))
	})
}

// DeletedNEQ applies the NEQ predicate on the "deleted" field.
func DeletedNEQ(v bool) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s.Where(sql.NEQ(s.C(FieldDeleted), v))
	})
}

// HasOnDevice applies the HasEdge predicate on the "on_device" edge.
func HasOnDevice() predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.To(OnDeviceTable, FieldID),
			sqlgraph.Edge(sqlgraph.M2O, true, OnDeviceTable, OnDeviceColumn),
		)
		sqlgraph.HasNeighbors(s, step)
	})
}

// HasOnDeviceWith applies the HasEdge predicate on the "on_device" edge with a given conditions (other predicates).
func HasOnDeviceWith(preds ...predicate.Device) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		step := sqlgraph.NewStep(
			sqlgraph.From(Table, FieldID),
			sqlgraph.To(OnDeviceInverseTable, FieldID),
			sqlgraph.Edge(sqlgraph.M2O, true, OnDeviceTable, OnDeviceColumn),
		)
		sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
			for _, p := range preds {
				p(s)
			}
		})
	})
}

// And groups predicates with the AND operator between them.
func And(predicates ...predicate.DeletedVlanLog) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s1 := s.Clone().SetP(nil)
		for _, p := range predicates {
			p(s1)
		}
		s.Where(s1.P())
	})
}

// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.DeletedVlanLog) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		s1 := s.Clone().SetP(nil)
		for i, p := range predicates {
			if i > 0 {
				s1.Or()
			}
			p(s1)
		}
		s.Where(s1.P())
	})
}

// Not applies the not operator on the given predicate.
func Not(p predicate.DeletedVlanLog) predicate.DeletedVlanLog {
	return predicate.DeletedVlanLog(func(s *sql.Selector) {
		p(s.Not())
	})
}


text:
package main

import (
  "fmt"
  "./lex"
  "./parse"
)

func main() {
  // go func() {
  //   reader := bufio.NewReader(os.Stdin)
  //   for {
  //     fmt.Print(">> ")
  //     text, err := reader.ReadString('\n')
  //     if err != nil {
  //       if err == io.EOF {
  //         close(r)
  //         return
  //       }
  //       log.Fatal(err)
  //     }
  //     for _, c := range text {
  //       r <- c
  //     }
  //   }
  // }()

  texts := []string {
    "hello",
    "hello(4,5)",
    "4*5%6+3",
    "_(f(5), 7*8)",
    "h.string",
    "().tuple.do",
    "((((6,7,8),8))).string",
    "(7*8, 6+3)",
  }

  for _, text := range texts {
    r := make(chan rune)
    l := lex.Lexer { Input: r }
    p := &parse.Parser{ Input: l.TokenGenerator() }
    go func() {
      for _, c := range text {
        r <- c
      }
      close(r)
    }()
    fmt.Printf("%s->%s\n", text, p.Parse())
  }
}

repository: cptaffe/lng

repo_name: cptaffe/lng


text:
// Package xtime acts as an intermediary for package time methods that we use
// to coördinate things in the scheduler. The idea is to allow us to swap
// (mock) out the implementations in tests.
package xtime

import (
	"time"
)

var (
	// Now wraps time.Now.
	Now = time.Now

	// After wraps time.After.
	After = time.After

	// Tick wraps time.Tick.
	Tick = time.Tick
)

repository: jmyounker/harpoon

repo_name: jmyounker/harpoon


text:
package txmgr_test

import (
	"context"
	"encoding/json"
	"fmt"
	"math/big"
	"testing"
	"time"

	gethcommon "github.com/ethereum/go-ethereum/common"
	gethtypes "github.com/ethereum/go-ethereum/core/types"
	uuid "github.com/satori/go.uuid"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/mock"
	"github.com/stretchr/testify/require"

	"github.com/smartcontractkit/chainlink/core/assets"
	"github.com/smartcontractkit/chainlink/core/chains/evm/logpoller"
	"github.com/smartcontractkit/chainlink/core/chains/evm/txmgr"
	txmmocks "github.com/smartcontractkit/chainlink/core/chains/evm/txmgr/mocks"
	"github.com/smartcontractkit/chainlink/core/config"
	"github.com/smartcontractkit/chainlink/core/internal/cltest"
	"github.com/smartcontractkit/chainlink/core/internal/testutils"
	"github.com/smartcontractkit/chainlink/core/internal/testutils/pgtest"
	"github.com/smartcontractkit/chainlink/core/logger"
	"github.com/smartcontractkit/chainlink/core/services/keystore/keys/ethkey"
	ksmocks "github.com/smartcontractkit/chainlink/core/services/keystore/mocks"
	"github.com/smartcontractkit/chainlink/core/services/pg"
	pgmocks "github.com/smartcontractkit/chainlink/core/services/pg/mocks"
	"github.com/smartcontractkit/chainlink/core/utils"
)

func TestTxm_SendEther_DoesNotSendToZero(t *testing.T) {
	t.Parallel()
	db := pgtest.NewSqlxDB(t)

	from := utils.ZeroAddress
	to := utils.ZeroAddress
	value := assets.NewEth(1)

	config := newMockConfig(t)
	config.On("EthTxResendAfterThreshold").Return(time.Duration(0))
	config.On("EthTxReaperThreshold").Return(time.Duration(0))
	config.On("GasEstimatorMode").Return("FixedPrice")
	config.On("LogSQL").Return(false)

	ethClient := cltest.NewEthClientMockWithDefaultChain(t)
	lggr := logger.TestLogger(t)
	checkerFactory := &testCheckerFactory{}
	lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.FixtureChainID, db, lggr, pgtest.NewPGCfg(true)),
		ethClient, lggr, 100*time.Millisecond, 2, 3)
	txm := txmgr.NewTxm(db, ethClient, config, nil, nil, lggr, checkerFactory, lp)

	_, err := txm.SendEther(big.NewInt(0), from, to, *value, 21000)
	require.Error(t, err)
	require.EqualError(t, err, "cannot send ether to zero address")
}

func TestTxm_CheckEthTxQueueCapacity(t *testing.T) {
	t.Parallel()

	db := pgtest.NewSqlxDB(t)
	cfg := cltest.NewTestGeneralConfig(t)
	borm := cltest.NewTxmORM(t, db, cfg)
	ethKeyStore := cltest.NewKeyStore(t, db, cfg).Eth()

	_, fromAddress := cltest.MustAddRandomKeyToKeystore(t, ethKeyStore)
	_, otherAddress := cltest.MustAddRandomKeyToKeystore(t, ethKeyStore)

	var maxUnconfirmedTransactions uint64 = 2

	t.Run("with no eth_txes returns nil", func(t *testing.T) {
		err := txmgr.CheckEthTxQueueCapacity(db, fromAddress, maxUnconfirmedTransactions, cltest.FixtureChainID)
		require.NoError(t, err)
	})

	// deliberately one extra to exceed limit
	for i := 0; i <= int(maxUnconfirmedTransactions); i++ {
		cltest.MustInsertUnstartedEthTx(t, borm, otherAddress)
	}

	t.Run("with eth_txes from another address returns nil", func(t *testing.T) {
		err := txmgr.CheckEthTxQueueCapacity(db, fromAddress, maxUnconfirmedTransactions, cltest.FixtureChainID)
		require.NoError(t, err)
	})

	for i := 0; i <= int(maxUnconfirmedTransactions); i++ {
		cltest.MustInsertFatalErrorEthTx(t, borm, otherAddress)
	}

	t.Run("ignores fatally_errored transactions", func(t *testing.T) {
		err := txmgr.CheckEthTxQueueCapacity(db, fromAddress, maxUnconfirmedTransactions, cltest.FixtureChainID)
		require.NoError(t, err)
	})

	var n int64 = 0
	cltest.MustInsertInProgressEthTxWithAttempt(t, borm, n, fromAddress)
	n++
	cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, borm, n, fromAddress)
	n++

	t.Run("unconfirmed and in_progress transactions do not count", func(t *testing.T) {
		err := txmgr.CheckEthTxQueueCapacity(db, fromAddress, 1, cltest.FixtureChainID)
		require.NoError(t, err)
	})

	// deliberately one extra to exceed limit
	for i := 0; i <= int(maxUnconfirmedTransactions); i++ {
		cltest.MustInsertConfirmedEthTxWithLegacyAttempt(t, borm, n, 42, fromAddress)
		n++
	}

	t.Run("with many confirmed eth_txes from the same address returns nil", func(t *testing.T) {
		err := txmgr.CheckEthTxQueueCapacity(db, fromAddress, maxUnconfirmedTransactions, cltest.FixtureChainID)
		require.NoError(t, err)
	})

	for i := 0; i < int(maxUnconfirmedTransactions)-1; i++ {
		cltest.MustInsertUnstartedEthTx(t, borm, fromAddress)
	}

	t.Run("with fewer unstarted eth_txes than limit returns nil", func(t *testing.T) {
		err := txmgr.CheckEthTxQueueCapacity(db, fromAddress, maxUnconfirmedTransactions, cltest.FixtureChainID)
		require.NoError(t, err)
	})

	cltest.MustInsertUnstartedEthTx(t, borm, fromAddress)

	t.Run("with equal or more unstarted eth_txes than limit returns error", func(t *testing.T) {
		err := txmgr.CheckEthTxQueueCapacity(db, fromAddress, maxUnconfirmedTransactions, cltest.FixtureChainID)
		require.Error(t, err)
		require.Contains(t, err.Error(), fmt.Sprintf("cannot create transaction; too many unstarted transactions in the queue (2/%d). WARNING: Hitting ETH_MAX_QUEUED_TRANSACTIONS", maxUnconfirmedTransactions))

		cltest.MustInsertUnstartedEthTx(t, borm, fromAddress)
		err = txmgr.CheckEthTxQueueCapacity(db, fromAddress, maxUnconfirmedTransactions, cltest.FixtureChainID)
		require.Error(t, err)
		require.Contains(t, err.Error(), fmt.Sprintf("cannot create transaction; too many unstarted transactions in the queue (3/%d). WARNING: Hitting ETH_MAX_QUEUED_TRANSACTIONS", maxUnconfirmedTransactions))
	})

	t.Run("with different chain ID ignores txes", func(t *testing.T) {
		err := txmgr.CheckEthTxQueueCapacity(db, fromAddress, maxUnconfirmedTransactions, *big.NewInt(42))
		require.NoError(t, err)
	})

	t.Run("disables check with 0 limit", func(t *testing.T) {
		err := txmgr.CheckEthTxQueueCapacity(db, fromAddress, 0, cltest.FixtureChainID)
		require.NoError(t, err)
	})
}

func TestTxm_CountUnconfirmedTransactions(t *testing.T) {
	t.Parallel()

	db := pgtest.NewSqlxDB(t)
	cfg := cltest.NewTestGeneralConfig(t)
	borm := cltest.NewTxmORM(t, db, cfg)
	ethKeyStore := cltest.NewKeyStore(t, db, cfg).Eth()

	_, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore, 0)
	_, otherAddress := cltest.MustInsertRandomKey(t, ethKeyStore, 0)

	cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, borm, 0, otherAddress)
	cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, borm, 0, fromAddress)
	cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, borm, 1, fromAddress)
	cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, borm, 2, fromAddress)

	q := pg.NewQ(db, logger.TestLogger(t), cfg)
	count, err := txmgr.CountUnconfirmedTransactions(q, fromAddress, cltest.FixtureChainID)
	require.NoError(t, err)
	assert.Equal(t, int(count), 3)
}

func TestTxm_CountUnstartedTransactions(t *testing.T) {
	t.Parallel()

	db := pgtest.NewSqlxDB(t)
	cfg := cltest.NewTestGeneralConfig(t)
	borm := cltest.NewTxmORM(t, db, cfg)
	ethKeyStore := cltest.NewKeyStore(t, db, cfg).Eth()

	_, fromAddress := cltest.MustInsertRandomKey(t, ethKeyStore, 0)
	_, otherAddress := cltest.MustInsertRandomKey(t, ethKeyStore, 0)

	cltest.MustInsertUnstartedEthTx(t, borm, fromAddress)
	cltest.MustInsertUnstartedEthTx(t, borm, fromAddress)
	cltest.MustInsertUnstartedEthTx(t, borm, otherAddress)
	cltest.MustInsertUnconfirmedEthTxWithBroadcastLegacyAttempt(t, borm, 2, fromAddress)

	q := pg.NewQ(db, logger.TestLogger(t), cfg)
	count, err := txmgr.CountUnstartedTransactions(q, fromAddress, cltest.FixtureChainID)
	require.NoError(t, err)
	assert.Equal(t, int(count), 2)
}
func TestTxm_CreateEthTransaction(t *testing.T) {
	t.Parallel()

	db := pgtest.NewSqlxDB(t)
	cfg := cltest.NewTestGeneralConfig(t)
	borm := cltest.NewTxmORM(t, db, cfg)

	keyStore := cltest.NewKeyStore(t, db, cfg)
	_, fromAddress := cltest.MustInsertRandomKey(t, keyStore.Eth(), 0)
	toAddress := testutils.NewAddress()
	gasLimit := uint64(1000)
	payload := []byte{1, 2, 3}

	config := newMockConfig(t)
	config.On("EthTxResendAfterThreshold").Return(time.Duration(0))
	config.On("EthTxReaperThreshold").Return(time.Duration(0))
	config.On("GasEstimatorMode").Return("FixedPrice")
	config.On("LogSQL").Return(false)
	ethClient := cltest.NewEthClientMockWithDefaultChain(t)

	lggr := logger.TestLogger(t)
	checkerFactory := &testCheckerFactory{}
	lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.FixtureChainID, db, lggr, pgtest.NewPGCfg(true)),
		ethClient, lggr, 100*time.Millisecond, 2, 3)
	txm := txmgr.NewTxm(db, ethClient, config, nil, nil, lggr, checkerFactory, lp)

	t.Run("with queue under capacity inserts eth_tx", func(t *testing.T) {
		subject := uuid.NewV4()
		strategy := newMockTxStrategy(t)
		strategy.On("Subject").Return(uuid.NullUUID{UUID: subject, Valid: true})
		strategy.On("PruneQueue", mock.AnythingOfType("*sqlx.Tx")).Return(int64(0), nil)
		config.On("EvmMaxQueuedTransactions").Return(uint64(1)).Once()
		etx, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:    fromAddress,
			ToAddress:      toAddress,
			EncodedPayload: payload,
			GasLimit:       gasLimit,
			Meta:           nil,
			Strategy:       strategy,
		})
		assert.NoError(t, err)

		assert.Greater(t, etx.ID, int64(0))
		assert.Equal(t, etx.State, txmgr.EthTxUnstarted)
		assert.Equal(t, gasLimit, etx.GasLimit)
		assert.Equal(t, fromAddress, etx.FromAddress)
		assert.Equal(t, toAddress, etx.ToAddress)
		assert.Equal(t, payload, etx.EncodedPayload)
		assert.Equal(t, assets.NewEthValue(0), etx.Value)
		assert.Equal(t, subject, etx.Subject.UUID)

		cltest.AssertCount(t, db, "eth_txes", 1)

		require.NoError(t, db.Get(&etx, `SELECT * FROM eth_txes ORDER BY id ASC LIMIT 1`))

		assert.Equal(t, etx.State, txmgr.EthTxUnstarted)
		assert.Equal(t, gasLimit, etx.GasLimit)
		assert.Equal(t, fromAddress, etx.FromAddress)
		assert.Equal(t, toAddress, etx.ToAddress)
		assert.Equal(t, payload, etx.EncodedPayload)
		assert.Equal(t, assets.NewEthValue(0), etx.Value)
		assert.Equal(t, subject, etx.Subject.UUID)
	})

	cltest.MustInsertUnconfirmedEthTxWithInsufficientEthAttempt(t, borm, 0, fromAddress)

	t.Run("with queue at capacity does not insert eth_tx", func(t *testing.T) {
		config.On("EvmMaxQueuedTransactions").Return(uint64(1)).Once()
		_, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:    fromAddress,
			ToAddress:      testutils.NewAddress(),
			EncodedPayload: []byte{1, 2, 3},
			GasLimit:       21000,
			Meta:           nil,
			Strategy:       txmgr.SendEveryStrategy{},
		})
		require.Error(t, err)
		assert.Contains(t, err.Error(), "Txm#CreateEthTransaction: cannot create transaction; too many unstarted transactions in the queue (1/1). WARNING: Hitting ETH_MAX_QUEUED_TRANSACTIONS")
	})

	t.Run("doesn't insert eth_tx if a matching tx already exists for that pipeline_task_run_id", func(t *testing.T) {
		config.On("EvmMaxQueuedTransactions").Return(uint64(3)).Once()
		id := uuid.NewV4()
		tx1, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:       fromAddress,
			ToAddress:         testutils.NewAddress(),
			EncodedPayload:    []byte{1, 2, 3},
			GasLimit:          21000,
			PipelineTaskRunID: &id,
			Strategy:          txmgr.SendEveryStrategy{},
		})
		assert.NoError(t, err)

		config.On("EvmMaxQueuedTransactions").Return(uint64(3)).Once()
		tx2, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:       fromAddress,
			ToAddress:         testutils.NewAddress(),
			EncodedPayload:    []byte{1, 2, 3},
			GasLimit:          21000,
			PipelineTaskRunID: &id,
			Strategy:          txmgr.SendEveryStrategy{},
		})
		assert.NoError(t, err)

		assert.Equal(t, tx1.ID, tx2.ID)
	})

	t.Run("returns error if eth key state is missing or doesn't match chain ID", func(t *testing.T) {
		config.On("EvmMaxQueuedTransactions").Return(uint64(3)).Twice()
		rndAddr := testutils.NewAddress()
		_, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:    rndAddr,
			ToAddress:      testutils.NewAddress(),
			EncodedPayload: []byte{1, 2, 3},
			GasLimit:       21000,
			Strategy:       txmgr.SendEveryStrategy{},
		})
		require.Error(t, err)
		assert.Contains(t, err.Error(), fmt.Sprintf("no eth key exists with address %s", rndAddr.Hex()))

		_, otherAddress := cltest.MustInsertRandomKey(t, keyStore.Eth(), *utils.NewBigI(1337), 0)

		_, err = txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:    otherAddress,
			ToAddress:      testutils.NewAddress(),
			EncodedPayload: []byte{1, 2, 3},
			GasLimit:       21000,
			Strategy:       txmgr.SendEveryStrategy{},
		})
		require.Error(t, err)
		assert.Contains(t, err.Error(), fmt.Sprintf("cannot send transaction on chain ID 0; eth key with address %s is pegged to chain ID 1337", otherAddress.Hex()))
	})

	t.Run("simulate transmit checker", func(t *testing.T) {
		pgtest.MustExec(t, db, `DELETE FROM eth_txes`)

		checker := txmgr.TransmitCheckerSpec{
			CheckerType: txmgr.TransmitCheckerTypeSimulate,
		}
		config.On("EvmMaxQueuedTransactions").Return(uint64(1)).Once()
		etx, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:    fromAddress,
			ToAddress:      toAddress,
			EncodedPayload: payload,
			GasLimit:       gasLimit,
			Strategy:       txmgr.NewSendEveryStrategy(),
			Checker:        checker,
		})
		assert.NoError(t, err)
		cltest.AssertCount(t, db, "eth_txes", 1)

		require.NoError(t, db.Get(&etx, `SELECT * FROM eth_txes ORDER BY id ASC LIMIT 1`))

		var c txmgr.TransmitCheckerSpec
		require.NotNil(t, etx.TransmitChecker)
		require.NoError(t, json.Unmarshal(*etx.TransmitChecker, &c))
		require.Equal(t, checker, c)
	})

	t.Run("meta and vrf checker", func(t *testing.T) {
		pgtest.MustExec(t, db, `DELETE FROM eth_txes`)
		testDefaultSubID := uint64(2)
		testDefaultMaxLink := "1000000000000000000"
		jobID := int32(25)
		requestID := gethcommon.HexToHash("abcd")
		requestTxHash := gethcommon.HexToHash("dcba")
		meta := &txmgr.EthTxMeta{
			JobID:         jobID,
			RequestID:     requestID,
			RequestTxHash: requestTxHash,
			MaxLink:       &testDefaultMaxLink, // 1e18
			SubID:         &testDefaultSubID,
		}
		config.On("EvmMaxQueuedTransactions").Return(uint64(1)).Once()
		checker := txmgr.TransmitCheckerSpec{
			CheckerType:           txmgr.TransmitCheckerTypeVRFV2,
			VRFCoordinatorAddress: testutils.NewAddress(),
		}
		etx, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:    fromAddress,
			ToAddress:      toAddress,
			EncodedPayload: payload,
			GasLimit:       gasLimit,
			Meta:           meta,
			Strategy:       txmgr.NewSendEveryStrategy(),
			Checker:        checker,
		})
		assert.NoError(t, err)
		cltest.AssertCount(t, db, "eth_txes", 1)

		require.NoError(t, db.Get(&etx, `SELECT * FROM eth_txes ORDER BY id ASC LIMIT 1`))

		m, err := etx.GetMeta()
		require.NoError(t, err)
		require.Equal(t, meta, m)

		var c txmgr.TransmitCheckerSpec
		require.NotNil(t, etx.TransmitChecker)
		require.NoError(t, json.Unmarshal(*etx.TransmitChecker, &c))
		require.Equal(t, checker, c)
	})
}

func newMockTxStrategy(t *testing.T) *txmmocks.TxStrategy {
	strategy := new(txmmocks.TxStrategy)
	strategy.Test(t)
	return strategy
}

func newMockConfig(t *testing.T) *txmmocks.Config {
	// These are only used for logging, the exact value doesn't matter
	// It can be overridden in the test that uses it
	cfg := new(txmmocks.Config)
	cfg.Test(t)
	cfg.On("EvmGasBumpTxDepth").Return(uint16(42)).Maybe().Once()
	cfg.On("EvmMaxInFlightTransactions").Return(uint32(42)).Maybe().Once()
	cfg.On("EvmMaxQueuedTransactions").Return(uint64(42)).Maybe().Once()
	cfg.On("EvmNonceAutoSync").Return(true).Maybe()
	cfg.On("EvmGasLimitDefault").Return(uint64(42)).Maybe().Once()
	cfg.On("BlockHistoryEstimatorBatchSize").Return(uint32(42)).Maybe().Once()
	cfg.On("BlockHistoryEstimatorBlockDelay").Return(uint16(42)).Maybe().Once()
	cfg.On("BlockHistoryEstimatorBlockHistorySize").Return(uint16(42)).Maybe().Once()
	cfg.On("BlockHistoryEstimatorEIP1559FeeCapBufferBlocks").Return(uint16(42)).Maybe().Once()
	cfg.On("BlockHistoryEstimatorTransactionPercentile").Return(uint16(42)).Maybe().Once()
	cfg.On("EvmEIP1559DynamicFees").Return(false).Maybe().Once()
	cfg.On("EvmGasBumpPercent").Return(uint16(42)).Maybe().Once()
	cfg.On("EvmGasBumpThreshold").Return(uint64(42)).Maybe().Once()
	cfg.On("EvmGasBumpWei").Return(big.NewInt(42)).Maybe().Once()
	cfg.On("EvmGasFeeCapDefault").Return(big.NewInt(42)).Maybe().Once()
	cfg.On("EvmGasLimitMultiplier").Return(float32(42)).Maybe().Once()
	cfg.On("EvmGasPriceDefault").Return(big.NewInt(42)).Maybe().Once()
	cfg.On("EvmGasTipCapDefault").Return(big.NewInt(42)).Maybe().Once()
	cfg.On("EvmGasTipCapMinimum").Return(big.NewInt(42)).Maybe().Once()
	cfg.On("EvmMaxGasPriceWei").Return(big.NewInt(42)).Maybe().Once()
	cfg.On("EvmMinGasPriceWei").Return(big.NewInt(42)).Maybe().Once()
	cfg.On("EvmUseForwarders").Return(false).Maybe()
	cfg.On("LogSQL").Maybe().Return(false)

	return cfg
}

func TestTxm_CreateEthTransaction_OutOfEth(t *testing.T) {
	db := pgtest.NewSqlxDB(t)
	cfg := cltest.NewTestGeneralConfig(t)
	borm := cltest.NewTxmORM(t, db, cfg)
	etKeyStore := cltest.NewKeyStore(t, db, cfg).Eth()

	thisKey, _ := cltest.MustInsertRandomKey(t, etKeyStore, 1)
	otherKey, _ := cltest.MustInsertRandomKey(t, etKeyStore, 1)

	fromAddress := thisKey.Address.Address()
	gasLimit := uint64(1000)
	toAddress := testutils.NewAddress()

	config := newMockConfig(t)
	config.On("EthTxResendAfterThreshold").Return(time.Duration(0))
	config.On("EthTxReaperThreshold").Return(time.Duration(0))
	config.On("GasEstimatorMode").Return("FixedPrice")
	config.On("LogSQL").Return(false)

	ethClient := cltest.NewEthClientMockWithDefaultChain(t)
	lggr := logger.TestLogger(t)
	lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.FixtureChainID, db, lggr, pgtest.NewPGCfg(true)),
		ethClient, lggr, 100*time.Millisecond, 2, 3)
	txm := txmgr.NewTxm(db, ethClient, config, nil, nil, lggr, &testCheckerFactory{}, lp)

	t.Run("if another key has any transactions with insufficient eth errors, transmits as normal", func(t *testing.T) {
		payload := cltest.MustRandomBytes(t, 100)
		config.On("EvmMaxQueuedTransactions").Return(uint64(1))
		cltest.MustInsertUnconfirmedEthTxWithInsufficientEthAttempt(t, borm, 0, otherKey.Address.Address())
		strategy := newMockTxStrategy(t)
		strategy.On("Subject").Return(uuid.NullUUID{})
		strategy.On("PruneQueue", mock.AnythingOfType("*sqlx.Tx")).Return(int64(0), nil)

		etx, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:    fromAddress,
			ToAddress:      toAddress,
			EncodedPayload: payload,
			GasLimit:       gasLimit,
			Meta:           nil,
			Strategy:       strategy,
		})
		assert.NoError(t, err)

		require.Equal(t, payload, etx.EncodedPayload)
		strategy.AssertExpectations(t)
	})

	require.NoError(t, utils.JustError(db.Exec(`DELETE FROM eth_txes WHERE from_address = $1`, thisKey.Address.Address())))

	t.Run("if this key has any transactions with insufficient eth errors, inserts it anyway", func(t *testing.T) {
		payload := cltest.MustRandomBytes(t, 100)
		config.On("EvmMaxQueuedTransactions").Return(uint64(1))
		cltest.MustInsertUnconfirmedEthTxWithInsufficientEthAttempt(t, borm, 0, thisKey.Address.Address())
		strategy := newMockTxStrategy(t)
		strategy.On("Subject").Return(uuid.NullUUID{})
		strategy.On("PruneQueue", mock.AnythingOfType("*sqlx.Tx")).Return(int64(0), nil)

		etx, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:    fromAddress,
			ToAddress:      toAddress,
			EncodedPayload: payload,
			GasLimit:       gasLimit,
			Meta:           nil,
			Strategy:       strategy,
		})
		assert.NoError(t, err)

		require.Equal(t, payload, etx.EncodedPayload)
		strategy.AssertExpectations(t)
	})

	require.NoError(t, utils.JustError(db.Exec(`DELETE FROM eth_txes WHERE from_address = $1`, thisKey.Address.Address())))

	t.Run("if this key has transactions but no insufficient eth errors, transmits as normal", func(t *testing.T) {
		payload := cltest.MustRandomBytes(t, 100)
		cltest.MustInsertConfirmedEthTxWithLegacyAttempt(t, borm, 0, 42, thisKey.Address.Address())
		strategy := newMockTxStrategy(t)
		strategy.On("Subject").Return(uuid.NullUUID{})
		strategy.On("PruneQueue", mock.AnythingOfType("*sqlx.Tx")).Return(int64(0), nil)

		config.On("EvmMaxQueuedTransactions").Return(uint64(1))
		etx, err := txm.CreateEthTransaction(txmgr.NewTx{
			FromAddress:    fromAddress,
			ToAddress:      toAddress,
			EncodedPayload: payload,
			GasLimit:       gasLimit,
			Meta:           nil,
			Strategy:       strategy,
		})
		assert.NoError(t, err)

		require.Equal(t, payload, etx.EncodedPayload)
		strategy.AssertExpectations(t)
	})
}

func TestTxm_Lifecycle(t *testing.T) {
	db := pgtest.NewSqlxDB(t)

	ethClient := cltest.NewEthClientMockWithDefaultChain(t)
	config := newMockConfig(t)
	kst := new(ksmocks.Eth)
	kst.Test(t)
	eventBroadcaster := new(pgmocks.EventBroadcaster)
	eventBroadcaster.Test(t)

	config.On("EthTxResendAfterThreshold").Return(1 * time.Hour)
	config.On("EthTxReaperThreshold").Return(1 * time.Hour)
	config.On("EthTxReaperInterval").Return(1 * time.Hour)
	config.On("EvmMaxInFlightTransactions").Return(uint32(42))
	config.On("EvmFinalityDepth").Maybe().Return(uint32(42))
	config.On("GasEstimatorMode").Return("FixedPrice")
	config.On("LogSQL").Return(false).Maybe()
	config.On("EvmRPCDefaultBatchSize").Return(uint32(4)).Maybe()
	kst.On("GetStatesForChain", &cltest.FixtureChainID).Return([]ethkey.State{}, nil).Once()

	keyChangeCh := make(chan struct{})
	unsub := cltest.NewAwaiter()
	kst.On("SubscribeToKeyChanges").Return(keyChangeCh, unsub.ItHappened)
	lggr := logger.TestLogger(t)
	checkerFactory := &testCheckerFactory{}

	lp := logpoller.NewLogPoller(logpoller.NewORM(testutils.FixtureChainID, db, lggr, pgtest.NewPGCfg(true)),
		ethClient, lggr, 100*time.Millisecond, 2, 3)
	txm := txmgr.NewTxm(db, ethClient, config, kst, eventBroadcaster, lggr, checkerFactory, lp)

	head := cltest.Head(42)
	// It should not hang or panic
	txm.OnNewLongestChain(context.Background(), head)

	sub := new(pgmocks.Subscription)
	sub.On("Events").Return(make(<-chan pg.Event))
	eventBroadcaster.On("Subscribe", "insert_on_eth_txes", "").Return(sub, nil)
	config.On("EvmGasBumpThreshold").Return(uint64(1))

	require.NoError(t, txm.Start(testutils.Context(t)))

	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	t.Cleanup(cancel)
	txm.OnNewLongestChain(ctx, head)
	require.NoError(t, ctx.Err())

	keyState := cltest.MustGenerateRandomKeyState(t)

	kst.On("GetStatesForChain", &cltest.FixtureChainID).Return([]ethkey.State{keyState}, nil).Once()
	sub.On("Close").Return()
	ethClient.On("PendingNonceAt", mock.AnythingOfType("*context.cancelCtx"), keyState.Address.Address()).Return(uint64(0), nil).Maybe()
	config.On("TriggerFallbackDBPollInterval").Return(1 * time.Hour).Maybe()
	keyChangeCh <- struct{}{}

	require.NoError(t, txm.Close())

	ethClient.AssertExpectations(t)
	config.AssertExpectations(t)
	kst.AssertExpectations(t)
	eventBroadcaster.AssertExpectations(t)
	unsub.AwaitOrFail(t, 1*time.Second)
}

func TestTxm_SignTx(t *testing.T) {
	t.Parallel()

	addr := gethcommon.HexToAddress("0xb921F7763960b296B9cbAD586ff066A18D749724")
	to := gethcommon.HexToAddress("0xb921F7763960b296B9cbAD586ff066A18D749724")
	tx := gethtypes.NewTx(&gethtypes.LegacyTx{
		Nonce:    42,
		To:       &to,
		Value:    big.NewInt(142),
		Gas:      242,
		GasPrice: big.NewInt(342),
		Data:     []byte{1, 2, 3},
	})

	t.Run("returns correct hash for non-okex chains", func(t *testing.T) {
		chainID := big.NewInt(1)
		cfg := new(txmmocks.Config)
		cfg.Test(t)
		cfg.On("ChainType").Return(config.ChainType(""))
		kst := new(ksmocks.Eth)
		kst.Test(t)
		kst.On("SignTx", to, tx, chainID).Return(tx, nil).Once()
		cks := txmgr.NewChainKeyStore(*chainID, cfg, kst)
		hash, rawBytes, err := cks.SignTx(addr, tx)
		require.NoError(t, err)
		require.NotNil(t, rawBytes)
		require.Equal(t, "0xdd68f554373fdea7ec6713a6e437e7646465d553a6aa0b43233093366cc87ef0", hash.Hex())
	})
	t.Run("returns correct hash for okex chains", func(t *testing.T) {
		chainID := big.NewInt(1)
		cfg := new(txmmocks.Config)
		cfg.Test(t)
		cfg.On("ChainType").Return(config.ChainExChain)
		kst := new(ksmocks.Eth)
		kst.Test(t)
		kst.On("SignTx", to, tx, chainID).Return(tx, nil).Once()
		cks := txmgr.NewChainKeyStore(*chainID, cfg, kst)
		hash, rawBytes, err := cks.SignTx(addr, tx)
		require.NoError(t, err)
		require.NotNil(t, rawBytes)
		require.NotEqual(t, "0xdd68f554373fdea7ec6713a6e437e7646465d553a6aa0b43233093366cc87ef0", hash.Hex(), "expected okex chain hash to be different from non-okex-chain hash")
		require.Equal(t, "0x1458742e3ba53316481eb18237ced517a536c1cdef61e7b7fb2a9569d84e41a6", hash.Hex())
	})
}

branch_name: refs/heads/develop


text:
DESCRIPTION = "Dreambox second stage bootloader"
SECTION = "base"
PRIORITY = "required"
MAINTAINER = "Felix Domke <tmbinc@elitedvb.net>"
PV_dm7020 = "35"
PV_dm7025 = "81"
PV_dm600pvr = "66"
PV_dm500plus = "66"
PV_dm8000 = "81"
PV_dm800 = "81"
PV_dm500hd = "81"
PV_dm800se = "81"
PV_dm7020hd = "80"
PR_dm7020hd = "r1"
PR = "r0"

RDEPENDS_dm8000 = "dreambox-bootlogo (>=5.1-r3)"

SRC_URI = "http://sources.dreamboxupdate.com/download/7020/secondstage-${MACHINE}-${PV}.bin"

WRITENFI = "writenfi-mipsel-2.6.18-r2"

SECONDSTAGE_UPDATE_SRC = "http://sources.dreamboxupdate.com/download/7020/secondstage-${MACHINE}-${PV}.nfi \
	http://sources.dreamboxupdate.com/download/7020/${WRITENFI}"

SRC_URI_append_dm8000 = " ${SECONDSTAGE_UPDATE_SRC}"
SRC_URI_append_dm800 = " ${SECONDSTAGE_UPDATE_SRC}"
SRC_URI_append_dm500hd = " ${SECONDSTAGE_UPDATE_SRC}"
SRC_URI_append_dm800se = " ${SECONDSTAGE_UPDATE_SRC}"
SRC_URI_append_dm7020hd = " ${SECONDSTAGE_UPDATE_SRC}"
SRC_URI_append_dm7025 = " ${SECONDSTAGE_UPDATE_SRC}"

S = "${WORKDIR}"

do_stage() {
	install -d ${STAGING_LIBDIR}/dreambox-secondstage
	gzip -c ${S}/secondstage-${MACHINE}-${PV}.bin > ${STAGING_LIBDIR}/dreambox-secondstage/main.bin.gz
}

# the dm{800,8000,500hd,800se,7020hd} secondstage is already compressed (and encrypted)

do_stage_dm800() {
	install -d ${STAGING_LIBDIR}/dreambox-secondstage
	cp ${S}/secondstage-${MACHINE}-${PV}.bin ${STAGING_LIBDIR}/dreambox-secondstage/main.bin.gz
}

do_install_dm800() {
	install -d ${D}/tmp
	install ${WORKDIR}/secondstage-${MACHINE}-${PV}.nfi ${D}/tmp/secondstage.nfi
	install -m 0755 ${WORKDIR}/${WRITENFI} ${D}/tmp/writenfi
}

do_stage_dm8000() {
	do_stage_dm800
}

do_install_dm8000() {
	do_install_dm800
}

do_stage_dm500hd() {
	do_stage_dm800
}

do_install_dm500hd() {
	do_install_dm800
}

do_stage_dm800se() {
	do_stage_dm8000
}

do_install_dm800se() {
	do_install_dm800
}

do_stage_dm7020hd() {
	do_stage_dm8000
}

do_install_dm7020hd() {
	do_install_dm800
}

do_install_dm7025() {
	do_install_dm800
}

FILES_${PN} = "/tmp"
PACKAGE_ARCH := "${MACHINE_ARCH}"

pkg_postinst() {
	if [ -d /proc/stb ]; then
		if [ -f /tmp/writenfi ]; then
			/tmp/writenfi /tmp/secondstage.nfi;
			rm /tmp/writenfi /tmp/secondstage.nfi;
		fi
	fi
}

repository: demsey/openembedded

repo_name: demsey/openembedded

branch_name: HEAD


text:
DESCRIPTION = "Node binding udev"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"

inherit pkgconfig gitpkgv npm-base npm-install

PV = "1.0+git${SRCPV}"
PKGV = "1.0+git${GITPKGV}"
PR = "r1"

SRCREV = "02c29ec4fe39884928946ee13650feb233dea4b1"
SRC_URI="git://git@github.com/armPelionEdge/node-hotplug.git;protocol=ssh"

S = "${WORKDIR}/git"

BBCLASSEXTEND = "native"
DEPENDS = "libcap nodejs node-native udev"
RDEPENDS_${PN} += "nodejs libcap"
FILES_${PN} = "/wigwag/devicejs-core-modules/*"

INHIBIT_PACKAGE_STRIP = "1"

do_configure(){
	oe_runnpm_native install -g node-gyp@5.1.1
}

do_compile() {
  cd ${S}
  # Obtain and export the Architecture for NPM / node-gyp
  export ARCH=`echo $AR | awk -F '-' '{print $1}'`
  export PLATFORM=`echo $AR | awk -F '-' '{print $3}'`
  export npm_config_arch=$ARCH
  export GYPFLAGS="-Dv8_can_use_fpu_instructions=false -Darm_version=7 -Darm_float_abi=hardfp"
  NGYP_OPTIONS="--without-snapshot --dest-cpu=arm --dest-os=linux --with-arm-float-abi=hardfp"
  CONFIG_OPTIONS="--host=arm-poky-linux-gnueabihf --target=arm-poky-linux-gnueabihf"

  cd ${S}
  npm install nan --production
  node-gyp configure
  node-gyp build
}

do_package_qa() {
 echo "done"
}

do_install() {
  install -d ${D}/wigwag
  install -d ${D}/wigwag/devicejs-core-modules
  install -d ${D}/wigwag/devicejs-core-modules/node_modules
  install -d ${D}/wigwag/devicejs-core-modules/node_modules/node-udev
  cp -r ${S}/* ${D}/wigwag/devicejs-core-modules/node_modules/node-udev

  # These files require /usr/local/bin/perl and need to be removed or yocto will not complete the build
  # without having /usr/local/bin/perl installed
  if [ -e ${D}/wigwag/devicejs-core-modules/node_modules/isc-dhclient/deps ]; then
  rm -rf  ${D}/wigwag/devicejs-core-modules/node_modules/isc-dhclient/deps
  fi
}

repository: esajaa/meta-pelion-edge

repo_name: esajaa/meta-pelion-edge


text:
@InProceedings{Koolen15a,
  author = {Koolen, Wouter M. and Van Erven, Tim},
  title = {Second-order Quantile Methods for Experts and Combinatorial Games},
  pages = {1155-1175},
  abstract = {We aim to design strategies for sequential decision making that
adjust to the difficulty of the learning problem. We study this
question both in the setting of prediction with expert advice,
and for more general combinatorial decision tasks. We are not
satisfied with just guaranteeing minimax regret rates, but we
want our algorithms to perform significantly better on easy
data. Two popular ways to formalize such adaptivity are
second-order regret bounds and quantile bounds. The underlying
notions of `easy data', which may be paraphrased as ``the
learning problem has small variance'' and ``multiple decisions
are useful'', are synergetic. But even though there are
sophisticated algorithms that exploit one of the two, no
existing algorithm is able to adapt to both.

The difficulty in combining the two notions lies in tuning a
parameter called the learning rate, whose optimal value behaves
non-monotonically.  We introduce a potential function for
which (very surprisingly!) it is sufficient to simply put a
prior on learning rates; an approach that does not work for any
previous method. By choosing the right prior we construct
efficient algorithms and show that they reap both benefits by
proving the first bounds that are both second-order and
incorporate quantiles.},
}

repository: mreid/papersite

repo_name: mreid/papersite

gha_language: TeX

extension: bib


text:
@article{anglemyer2014healthcare,
  title={Healthcare outcomes assessed with observational study designs compared with those assessed in randomized trials},
  author={Anglemyer, Andrew and Horvath, Hacsi T and Bero, Lisa},
  journal={Cochrane Database of Systematic Reviews},
  number={4},
  year={2014},
  publisher={John Wiley \& Sons, Ltd}
}

@article{arkes2012psychological,
  title={Psychological research and the prostate-cancer screening controversy},
  author={Arkes, Hal R and Gaissmaier, Wolfgang},
  journal={Psychological science},
  volume={23},
  number={6},
  pages={547--553},
  year={2012},
  publisher={Sage Publications Sage CA: Los Angeles, CA}
}

@article{barbarawi2019aspirin,
  title={Aspirin efficacy in primary prevention: a meta-analysis of randomized controlled trials},
  author={Barbarawi, Mahmoud and Kheiri, Babikir and Zayed, Yazan and Gakhal, Inderdeep and Al-Abdouh, Ahmad and Barbarawi, Owais and Rashdan, Laith and Rizk, Fatima and Bachuwa, Ghassan and Alkotob, Mohammad Luay},
  journal={High Blood Pressure \& Cardiovascular Prevention},
  volume={26},
  number={4},
  pages={283--291},
  year={2019},
  publisher={Springer}
}

@article{bingham2004john,
  title={John Snow, William Farr and the 1849 outbreak of cholera that affected London: a reworking of the data highlights the importance of the water supply},
  author={Bingham, Paul and Verlander, Neville Q and Cheal, MJ},
  journal={Public health},
  volume={118},
  number={6},
  pages={387--394},
  year={2004},
  publisher={Elsevier}
}

@article{boot2008new,
  title={New estimates of age-and sex-specific earnings and the male--female earnings gap in the British cotton industry, 1833--1906 1},
  author={Boot, HM and Maindonald, JH},
  journal={The Economic History Review},
  volume={61},
  number={2},
  pages={380--408},
  year={2008},
  publisher={Wiley Online Library}
}

@misc{brawley2018prostate,
  title={Prostate cancer screening: And the pendulum swings},
  author={Brawley, Otis W},
  year={2018},
  publisher={Wiley Online Library}
}

@article {Buchanan,
	author = {Buchanan, Roderick, D},
	title = {Rapid response to {R}ichard {S}mith: "{H}ans {E}ysenck: controversialist or worse?""},
	volume = {365},
	elocation-id = {l1897},
	year = {2019},
	doi = {10.1136/bmj.l1897/rr},
	publisher = {BMJ Publishing Group Ltd},
	issn = {0959-8138},
	URL = {https://www.bmj.com/content/365/bmj.l1897/rr},
	eprint = {https://www.bmj.com/content/365/bmj.l1897.full.pdf},
	journal = {BMJ}
}

@book{cairo_2016,
	Author = {Cairo, Alberto},
	Edition = {1},
	Publisher = {New Riders},
	Title = {The truthful art: data, charts, and maps for communication},
	Year={2016}}

@book{cairo_2013,
	Author = {Cairo, Alberto},
	Edition = {1},
	Publisher = {New Riders},
	Title = {The functional art: an introduction to information
	graphics and vizualisation},
	Year={2013}}

@article{chalmers2009avoidable,
  title={Avoidable waste in the production and reporting of research evidence},
  author={Chalmers, Iain and Glasziou, Paul},
  journal={The Lancet},
  volume={374},
  number={9683},
  pages={86--89},
  year={2009},
  doi={https://doi.org/10.1016/S0140-6736(09)60329-9},
  publisher={Elsevier}
}

@article{chisholm_2016,
	author = {Chisholm, Donna},
  Title = {Birth Control},
  Journal = {The NZ Listener, October 8 - 14},
  note = {October 8 - 14},
  year ={2016},
  pages = {18-24}},

@misc{cohen1996,
  title={Pain discriminates between the sexes},
  author={Cohen, P.},
  year={1996},
  publisher={New Scientist, 2 November 1996}
}

@article{coleman2019causality,
  title={Causality in the time of cholera: John {S}now as a prototype for causal inference},
  author={Coleman, Thomas},
  journal={Available at SSRN 3262234},
  year={2019}
}

@article{CraigEtAl,
author = {Russell Craig and Anthony Pelosi and Dennis Tourish},
title ={Research misconduct complaints and institutional logics: The case of Hans Eysenck and the British Psychological Society},
journal = {Journal of Health Psychology},
volume = {26},
number = {2},
pages = {296-311},
year = {2021},
doi = {10.1177/1359105320963542},
    note ={PMID: 33111570},

URL = {
        https://doi.org/10.1177/1359105320963542

},
eprint = {
        https://doi.org/10.1177/1359105320963542
}
}

@article{du2015randomized,
  title={Randomized trial of peanut consumption in infants at risk for peanut allergy},
  author={Du Toit, George and Roberts, Graham and Sayre, Peter H and Bahnson, Henry T and Radulovic, Suzana and Santos, Alexandra F and Brough, Helen A and Phippard, Deborah and Basting, Monica and Feeney, Mary and others},
  journal={N Engl J Med},
  volume={372},
  pages={803--813},
  year={2015},
  publisher={Mass Medical Soc}
}

@article{erik2007strengthening,
  title={The Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) statement: guidelines for reporting observational studies},
  author={Erik von Elm, MD and Altman, Douglas G and Egger, Matthias and Pocock, Stuart J and G{\o}tzsche, Peter C and Vandenbroucke, Jan P},
  journal={Ann Intern Med},
  volume={147},
  number={8},
  pages={573e7},
  year={2007}
}

@book{ellenberg_2015,
	Author = {Ellenberg, Jordan},
	Edition = {1},
	Place = {New York, New York},
	Publisher = {Penguin Books},
	Title = {How not to be wrong},
	Year = {2015}}

@article{elliott2021react,
  title={REACT-1 round 13 final report: exponential growth, high prevalence of SARS-CoV-2 and vaccine effectiveness associated with Delta variant in England during May to July 2021},
  author={Elliott, Paul and Haw, David and Wang, Haowei and Eales, Oliver and Walters, C and Ainslie, K and Atchison, C and Fronterre, C and Diggle, P and Page, A and others},
  year={2021}
}

@book{eysenck1995genius,
  title={Genius: The natural history of creativity},
  author={Eysenck, Hans J{\"u}rgen},
  number={12},
  year={1995},
  publisher={Cambridge University Press}
}

@article{farquhar2016letter,
  title={Letter to the editor of PloSMedicine},
  author={Farquhar, Cynthia and McCowan, Lesley and Fleming, S},
  year={2016},
  publisher={Public Library of Science (PLoS)}
}

@book{fung2020cancer,
  title={The Cancer Code: A Revolutionary New Understanding of a Medical Mystery},
  author={Fung, Jason},
  year={2020},
  publisher={Harper Wave}
}

@article{gaziano2018use,
  title={Use of aspirin to reduce risk of initial vascular events in patients at moderate risk of cardiovascular disease (ARRIVE): a randomised, double-blind, placebo-controlled trial},
  author={Gaziano, J Michael and Brotons, Carlos and Coppolecchia, Rosa and Cricelli, Claudio and Darius, Harald and Gorelick, Philip B and Howard, George and Pearson, Thomas A and Rothwell, Peter M and Ruilope, Luis Miguel and others},
  journal={The Lancet},
  volume={392},
  number={10152},
  pages={1036--1046},
  year={2018},
  publisher={Elsevier}
}

@book{gelman2020regression,
  title={Regression and other stories},
  author={Gelman, Andrew and Hill, Jennifer and Vehtari, Aki},
  year={2020},
  publisher={Cambridge University Press}
}

	@article{gotzsche2013screening,
  title={Screening for breast cancer with mammography},
  author={G{\o}tzsche, Peter C and J{\o}rgensen, Karsten Juhl},
  journal={Cochrane database of systematic reviews},
  number={6},
  year={2013},
  publisher={John Wiley \& Sons, Ltd}
}

@book{harris2016book,
  title={Surgery, the ultimate placebo: a surgeon cuts through the evidence},
  author={Harris, Ian},
  year={2016},
  publisher={NewSouth},
  place={Sydney, NSW}
}

@article{hassall1850memoir,
  title={Memoir ON THE ORGANIC ANALYSIS OR MICROSCOPIC EXAMINATION OF WATER: Supplied to the Inhabitants of London and the Suburban Districts},
  author={Hassall, Arthur Hill},
  journal={The Lancet},
  volume={55},
  number={1382},
  pages={230--235},
  year={1850},
  publisher={Elsevier}
}

@misc{herndon2014does,
  title={Does high public debt consistently stifle economic growth? A critique of Reinhart and Rogoff},
  author={Herndon, Thomas and Ash, Michael and Pollin, Robert},
  journal={Cambridge journal of economics},
  volume={38},
  number={2},
  pages={257--279},
  year={2014},
  url={http://www.peri.umass.edu/fileadmin/pdf/working_papers/working_papers_301-350/WP322.pdf},
  publisher={Oxford University Press}
}

@article{hu2013resolved,
  title={Resolved: there is sufficient scientific evidence that decreasing sugar-sweetened beverage consumption will reduce the prevalence of obesity and obesity-related diseases},
  author={Hu, Frank B},
  journal={Obesity reviews},
  volume={14},
  number={8},
  pages={606--619},
  year={2013},
  publisher={Wiley Online Library}
}

@article{jung2014female,
  title={Female hurricanes are deadlier than male hurricanes},
  author={Jung, Kiju and Shavitt, Sharon and Viswanathan, Madhu and Hilbe, Joseph M},
  journal={Proceedings of the National Academy of Sciences},
  volume={111},
  url = {http://www.pnas.org/cgi/doi/10.1073/pnas.1402786111},
  number={24},
  pages={8782--8787},
  year={2014},
  publisher={National Acad Sciences}
}

@article{juni2004risk,
  title={Risk of cardiovascular events and rofecoxib: cumulative meta-analysis},
  author={J{\"u}ni, Peter and Nartey, Linda and Reichenbach, Stephan and Sterchi, Rebekka and Dieppe, Paul A and Egger, Matthias},
  journal={The lancet},
  volume={364},
  number={9450},
  pages={2021--2029},
  year={2004},
  publisher={Elsevier}
}

@book{kahneman_2013,
author={Kahneman, Daniel},
title={Thinking, fast and slow},
place={New York},
edition={1},
publisher={Farrar, Straus and Giroux},
year={2013}
}

@book{levitin_2016,
	Author = {Levitin, Daniel J},
	Edition = {1},
	Publisher = {Penguin Random House},
	Title = {A field guide to lies and statistics},
	Year = {2016}}

@book{levitin_2015,
	Author = {Levitin, Daniel J},
	Edition = {1},
	Publisher = {Penguin},
	Title = {The organized mind},
	Year = {2015}}

@article{loberg2015benefits,
  title={Benefits and harms of mammography screening},
  author={L{\o}berg, Magnus and Lousdal, Mette Lise and Bretthauer, Michael and Kalager, Mette},
  journal={Breast Cancer Research},
  volume={17},
  number={1},
  pages={1--12},
  year={2015},
  publisher={BioMed Central}
}

@article{lord1967paradox,
  title={A paradox in the interpretation of group comparisons.},
  author={Lord, Frederic M},
  journal={Psychological bulletin},
  volume={68},
  number={5},
  pages={304},
  year={1967},
  publisher={American Psychological Association}
}

@article{MainCox,
	Author = {Maindonald, J. H. and Cox, N. R.},
	Journal = {New Zealand Journal of Agricultural Research},
	Pages = {597-- 610},
	Title = {Use of statistical evidence in some recent issues of {DSIR} agricultural journals},
	Volume = 27,
	Year = 1984}

@misc{marks2020king,
  title={King’s College London’s enquiry into Hans J Eysenck’s ‘Unsafe’publications must be properly completed},
  author={Marks, David F and Buchanan, Roderick D},
  year={2020},
  publisher={SAGE Publications Sage UK: London, England}
}

@article{martin2018effect,
  title={Effect of a low-intensity PSA-based screening intervention on prostate cancer mortality: the CAP randomized clinical trial},
  author={Martin, Richard M and Donovan, Jenny L and Turner, Emma L and Metcalfe, Chris and Young, Grace J and Walsh, Eleanor I and Lane, J Athene and Noble, Sian and Oliver, Steven E and Evans, Simon and others},
  journal={JAMA},
  volume={319},
  number={9},
  pages={883--895},
  year={2018},
  publisher={American Medical Association}
}

@article {Murphygutjnl-2021-325001,
	author = {Murphy, Caitlin C and Cirillo, Piera M and Krigbaum, Nickilou Y and Singal, Amit G and Lee, MinJae and Zaki, Timothy and Burstein, Ezra and Cohn, Barbara A},
	title = {Maternal obesity, pregnancy weight gain, and birth weight and risk of colorectal cancer},
	elocation-id = {gutjnl-2021-325001},
	year = {2021},
	doi = {10.1136/gutjnl-2021-325001},
	publisher = {BMJ Publishing Group},
	abstract = {Objective Colorectal cancer (CRC) is a leading cause of cancer-related death worldwide. Obesity is a well-established risk factor for CRC, and fetal or developmental origins of obesity may underlie its effect on cancer in adulthood. We examined associations of maternal obesity, pregnancy weight gain, and birth weight and CRC in adult offspring.Design The Child Health and Development Studies is a prospective cohort of women receiving prenatal care between 1959 and 1966 in Oakland, California (N=18 751 live births among 14 507 mothers). Clinical information was abstracted from mothers{\textquoteright} medical records 6 months prior to pregnancy through delivery. Diagnoses of CRC in adult (age >=18 years) offspring were ascertained through 2019 by linkage with the California Cancer Registry. We used Cox proportional hazards models to estimate adjusted HR (aHR); we examined effect measure modification using single-referent models to estimate the relative excess risk due to interaction (RERI).Results 68 offspring were diagnosed with CRC over 738 048 person-years of follow-up, and half (48.5\%) were diagnosed younger than age 50 years. Maternal obesity (>=30 kg/m2) increased the risk of CRC in offspring (aHR 2.51, 95\% CI 1.05 to 6.02). Total weight gain modified the association of rate of early weight gain (RERI -4.37, 95\% CI -9.49 to 0.76), suggesting discordant growth from early to late pregnancy increases risk. There was an elevated association with birth weight (>=4000 g: aHR 1.95, 95\% CI 0.8 to 4.38).Conclusion Our results suggest that in utero events are important risk factors for CRC and may contribute to increasing incidence rates in younger adults.Data are available on reasonable request. Deidentified (anonymised) data are available on request from Barbara Cohn, PhD, Director of the Child Health and Development Studies. Requests will be reviewed by Dr Cohn, research staff and the Institutional Review Board at the Public Health Institute. Approval of requests for deidentified (anonymised) data requires execution of a data use agreement.},
	issn = {0017-5749},
	URL = {https://gut.bmj.com/content/early/2021/08/12/gutjnl-2021-325001},
	eprint = {https://gut.bmj.com/content/early/2021/08/12/gutjnl-2021-325001.full.pdf},
	journal = {Gut}
}

@book{national1975science,
  title={Science Indicators, 1974},
  author={National Science Foundation, Washington, {DC}. National Science Board},
  year={1975},
  publisher={Superintendent of Documents}
}

@book{nisbett,
	Author = {Nisbett, Richard E},
	Edition = {1},
        Publisher = {Penguin Books},
	Title = {Mindware. Tools for smart thinking.},
	Year = {2016}}

@book{pearl2018book,
  title={The book of why: the new science of cause and effect},
  author={Pearl, Judea and Mackenzie, Dana},
  year={2018},
  publisher={Basic Books}
}

@article{pearson1903laws,
  title={On the laws of inheritance in man: I. Inheritance of physical characters},
  author={Pearson, Karl and Lee, Alice},
  journal={Biometrika},
  volume={2},
  number={4},
  pages={357--462},
  year={1903},
  publisher={JSTOR}
}

@article{pelosi2019personality,
  title={Personality and fatal diseases: Revisiting a scientific scandal},
  author={Pelosi, Anthony J},
  journal={Journal of health psychology},
  volume={24},
  number={4},
  pages={421--439},
  year={2019},
  publisher={Sage Publications Sage UK: London, England}
}

@article{popper_1963,
	title={Science: Problems, aims, responsibilities},
	author={Popper, Karl Raimund},
	journal={Federation of American Societies for Experimental Biology},
	volume=22,
	pages = {961-972},
	year  = {1963},
	note={Reprinted in Popper, K. (1994). {\em The Myth of the Framework:
	  In Defense of Science and Rationality, 82-111.}
        (ed. M. A. Notturno). London and New York: Routledge.}
}

@article{reinhart2010growth,
  title={Growth in a Time of Debt},
  author={Reinhart, Carmen M and Rogoff, Kenneth S},
  journal={American economic review},
  volume={100},
  number={2},
  pages={573--78},
  year={2010}
}

@article{raichand2017conclusions,
  title={Conclusions in systematic reviews of mammography for breast cancer screening and associations with review design and author characteristics},
  author={Raichand, Smriti and Dunn, Adam G and Ong, Mei-Sing and Bourgeois, Florence T and Coiera, Enrico and Mandl, Kenneth D},
  journal={Systematic reviews},
  volume={6},
  number={1},
  pages={1--8},
  url={https://www.ncbi.nlm.nih.gov/pubmed/28532422},
  year={2017},
  publisher={Springer}
}

@article{rangachari1997evidence,
  title={Evidence-based medicine: old French wine with a new Canadian label?},
  author={Rangachari, Patangi K},
  journal={Journal of the Royal Society of Medicine},
  volume={90},
  number={5},
  pages={280--284},
  year={1997},
  publisher={SAGE Publications Sage UK: London, England}
}

@book{ritchie2020science,
  title={Science fictions: Exposing fraud, bias, negligence and hype in science},
  author={Ritchie, Stuart},
  year={2020},
  publisher={Random House}
}

@article{roberts2021common,
  title={Common pitfalls and recommendations for using machine learning to detect and prognosticate for COVID-19 using chest radiographs and CT scans},
  author={Roberts, Michael and Driggs, Derek and Thorpe, Matthew and Gilbey, Julian and Yeung, Michael and Ursprung, Stephan and Aviles-Rivero, Angelica I and Etmann, Christian and McCague, Cathal and Beer, Lucian and others},
  journal={Nature Machine Intelligence},
  number={3335},
  pages={199--217},
  year={2021},
  publisher={Nature Publishing Group}
}

@misc{roberts2021AIcovid19,
  title={Artificial intelligence has been of little use for diagnosing covid-19},
  author={Roberts, Michael},
  number={3335},
  year={2021},
  publisher={New Scientist, 22 May 2021}
}

@article{seigworth1980bloodletting,
  title={Bloodletting over the centuries.},
  author={Seigworth, Gilbert R},
  journal={New York State journal of medicine},
  volume={80},
  number={13},
  pages={2022--2028},
  year={1980}
}

@article {Smithl1897,
	author = {Smith, Richard},
	title = {Hans Eysenck: controversialist or worse?},
	volume = {365},
	elocation-id = {l1897},
	year = {2019},
	doi = {10.1136/bmj.l1897},
	publisher = {BMJ Publishing Group Ltd},
	issn = {0959-8138},
	URL = {https://www.bmj.com/content/365/bmj.l1897},
	eprint = {https://www.bmj.com/content/365/bmj.l1897.full.pdf},
	journal = {BMJ}
}

@Book{smith-sd,
  title     = {Standard Deviations: Flawed Assumptions, Tortured Data, and Other Ways to Lie with Statistics},
  publisher = {Duckworth Overlook},
  Year      = {2014},
  author    = {Smith, G.},
  ean       = {9781468311020},
  isbn      = {1468311026},
  pagetotal = {304}
}

@article{soni2019comparison,
  title={Comparison of population-based observational studies with randomized trials in oncology},
  author={Soni, Payal D and Hartman, Holly E and Dess, Robert T and Abugharib, Ahmed and Allen, Steven G and Feng, Felix Y and Zietman, Anthony L and Jagsi, Reshma and Schipper, Matthew J and Spratt, Daniel E},
  journal={Journal of Clinical Oncology},
  volume={37},
  number={14},
  pages={1209},
  year={2019},
  publisher={American Society of Clinical Oncology}
}

@article{soriano2021has,
  title={Has the Prevalence of Peanut Allergy Changed Following Earlier Introduction of Peanut? The EarlyNuts Study},
  author={Soriano, Victoria and Peters, Rachel and Ponsonby, Anne-Louise and Perrett, Kirsten and Dharmage, Shyamali and Gurrin, Lyle and Koplin, Jennifer},
  journal={Journal of Allergy and Clinical Immunology},
  volume={147},
  number={2},
  pages={AB236},
  year={2021},
  publisher={Elsevier}
}

@article{osc_EstRep2015,
author={OSC},
title={Estimating the reproducibility of psychological science},
volume={349},
DOI={10.1126/science.aac4716},
number={6251},
journal={Science},
year={2015},
pages={aac4716-aac4716},
url={https://osf.io/ezcuj/wiki/home/},
note={Open Science Collaboration (Nosek, B A and others)}
},

@book{oneil_2016,
	Author = {O'Neil, Cathy},
	Edition = {1},
	Publisher = {Crown},
	Title = {Weapons of math destruction},
	Year = {2016}}

@book{tu2011statistical,
  title={Statistical thinking in epidemiology},
  author={Tu, Yu-Kang and Gilthorpe, Mark S},
  year={2011},
  publisher={CRC Press}
}

@article{r2_begley_2013,
author={Begley, C. G.},
title={Reproducibility: Six red flags for suspect work},
volume={497},
DOI={10.1038/497433a},
number={7450},
journal={Nature},
year={2013},
pages={433-434}
},

@article{cokely2012measuring,
  title={Measuring risk literacy: the berlin numeracy test.},
  author={Cokely, Edward T and Galesic, Mirta and Schulz, Eric and Ghazal, Saima and Garcia-Retamero, Rocio},
  journal={Judgment and Decision making},
  year={2012},
  publisher={Society for Judgment and Decision Making}
}

@book{collins_2001, place={London}, title={Good to great: why some companies make the leap ... and others dont}, publisher={Random House}, author={Collins, Jim}, year={2001}}

@article{r3_mcdermott_2013,
author={McDermott, Jason E.},
title={Reproducibility: Two more red flags for suspect work},
volume={499},
DOI={10.1038/499284b},
number={7458},
journal={Nature},
year={2013},
pages={284-284}
},

@misc{o2020famous,
  title={Famous psychologist faces posthumous reckoning},
  author={O'Grady, Cathleen},
  year={2020},
  publisher={American Association for the Advancement of Science}
}

@article{r4_tukey_1997,
author={Tukey, John},
title={More honest foundations for data analysis},
volume={57},
DOI={10.1016/s0378-3758(96)00032-8},
number={1},
journal={Journal of Statistical Planning and Inference},
year={1997},
pages={21-28}
},

@article{r5_kaiser_2015,
author={Kaiser, Jocelyn},
title={The cancer test},
volume={348},
number={6242},
journal={Science},
year={2015},
pages={1411-1413}
},

@article{r6_sellke_bayarri_berger_2001,
author={Sellke, Thomas and Bayarri, M. J and Berger, James O},
title={Calibration of p-Values for Testing Precise Null Hypotheses},
volume={55},
DOI={10.1198/000313001300339950},
number={1},
journal={The American Statistician},
year={2001},
pages={62-71}
},

@article{r7_klein_others_2014,
author={Klein, Richard A and Ratliff, Kate A and Vianello, Michelangelo and Adams Jr, Reginald B and Bahn{\'\i}k, {\v{S}}t{\v{e}}p{\'a}n and Bernstein, Michael J and Bocian, Konrad and Brandt, Mark J and Brooks, Beach and Brumbaugh, Claudia Chloe and others},
title={Investigating Variation in Replicability},
volume={45},
DOI={10.1027/1864-9335/a000178},
number={3},
journal={Social Psychology},
year={2014},
pages={142-152},
url={https://osf.io/ebmf8/}
},

@article{r8_kriegeskorte_simmons_bellgowan_baker_2009,
author={Kriegeskorte, Nikolaus and Simmons, W Kyle and Bellgowan, Patrick S F and Baker, Chris I},
title={Circular analysis in systems neuroscience: the dangers of double dipping},
volume={12},
DOI={10.1038/nn.2303},
number={5},
journal={Nature Neuroscience},
year={2009},
pages={535-540}
},

@article{r9_prinz_schlange_asadullah_2011,
author={Prinz, Florian and Schlange, Thomas and Asadullah, Khusru},
title={Believe it or not: how much can we rely on published data on potential drug targets?},
volume={10},
DOI={10.1038/nrd3439-c1},
number={9},
journal={Nature Reviews Drug Discovery},
year={2011},
pages={712-712}
},

@article{r10_pfeiffer_bertram_ioannidis_2011,
author={Pfeiffer, Thomas and Bertram, Lars and Ioannidis, John P. A.},
title={Quantifying Selective Reporting and the Proteus Phenomenon for Multiple Datasets with Similar Bias},
volume={6},
DOI={10.1371/journal.pone.0018362},
number={3},
journal={PLoS ONE},
year={2011},
pages={e18362}
},

@article{r11_bruning_EtAl_2015,
author={Bruning, Oskar and others},
title={Valuable lessons-learned in transcriptomics experimentation},
volume={6},
DOI={10.1080/21541264.2015.1064195},
number={3},
journal={Transcription},
year={2015},
pages={51-55}
},

@article{r12_couzin-frankel_2013,
author={Couzin-Frankel, J.},
title={When Mice Mislead},
volume={342},
DOI={10.1126/science.342.6161.922},
number={6161},
journal={Science},
year={2013},
pages={922-925}
},

@article{r13_nuzzo_2014,
author={Nuzzo, Regina},
title={Scientific method: Statistical errors},
volume={506},
DOI={10.1038/506150a},
number={7487},
journal={Nature},
year={2014},
pages={150-152}
},

@article{r14_king_2013,
author={King, Gary},
title={Restructuring the Social Sciences: Reflections from Harvard's Institute for Quantitative Social Science},
volume={47},
DOI={10.1017/s1049096513001534},
number={01},
journal={PS: Political Science & Politics},
year={2013},
pages={165-172}
},

@article{r15_collins_tabak_2014,
author={Collins, Francis S. and Tabak, Lawrence A.},
title={Policy: NIH plans to enhance reproducibility},
volume={505},
DOI={10.1038/505612a},
number={7485},
journal={Nature},
year={2014},
pages={612-613}
},

@book{r16_fisher_1956,
author={Fisher, Ronald Aylmer},
title={Statistical methods and scientific inference},
place={New York},
publisher={Hafner},
year={1956}
},

@article{r17_fisher_1926,
author={Fisher, Ronald Aylmer},
title={The arrangement of field experiments},
volume={33},
journal={Journal of the Ministry of Agriculture GB},
year={1926},
pages={503-513}
},

@book{fisher_1937,
author={Fisher, Ronald Aylmer},
title={The Design of Experiments},
place={Edinburgh},
publisher={Oliver and Boyd},
edition={2},
year={1937},
pages={16}
},

@article{r19_ioannidis_2005,
author={Ioannidis, John P. A.},
title={Why Most Published Research Findings Are False},
volume={18},
DOI={10.1080/09332480.2005.10722754},
number={4},
journal={CHANCE},
year={2005},
pages={40-47}
},

@article{r20_bai_2014,
author={Bai, Chunli},
title={Promoting research and innovation with open access},
volume={1},
DOI={10.1093/nsr/nwu042},
number={3},
journal={Nat. Sci. Rev.},
year={2014},
pages={323-323}
},

@article{r21_nosek_others_2015,
author={Nosek, B A and others,},
title={Promoting an open research culture},
volume={348},
urldate={2015-10-26},
number={3242},
journal={Science},
year={2015},
pages={1422-1425}
},

@article{r22_alberts_others_2015,
author={Alberts, Bruce and others,},
title={Self-correction in science at work},
volume={348},
urldate={2015-10-26},
number={6242},
journal={Science},
year={2015},
pages={1420-1422}
},

@article{r23_begley_ellis_2012,
author={Begley, C. G. and Ellis, L. M.},
title={Drug development: Raise standards for preclinical cancer research},
volume={483},
DOI={10.1038/483531a},
number={7391},
journal={Nature},
year={2012},
pages={531-533}
},

@book{r24_pentland,
author={Pentland, Alex},
title={Social physics},
publisher={Scribe},
year={2014}
},

@article{r25_errington_iorns_gunn_tan_lomax_nosek_2014,
author={Errington, Timothy M and Iorns, Elizabeth and Gunn, William and Tan, Fraser Elisabeth and Lomax, Joelle and Nosek, Brian A},
title={An open investigation of the reproducibility of cancer biology research},
volume={3},
urldate={2015-10-26},
DOI={10.7554/elife.04333},
journal={eLife},
year={2014}
},

@article{r26_mcshane_EtAl_2005,
author={McShane, Lisa M and Altman, Douglas G and Sauerbrei, Willi and Taube, Sheila E and Gion, Massimo and Clark, Gary M},
title={Reporting recommendations for tumor MARKer prognostic studies (REMARK)},
volume={2},
urldate={2015-10-26},
DOI={10.1038/ncponc0252},
number={8},
journal={Nature Clinical Practice Oncology},
year={2005},
pages={416-422}
},

@article{stark2018cargo,
  title={Cargo-cult statistics and scientific crisis},
  author={Stark, Philip B and Saltelli, Andrea},
  journal={Significance},
  volume={15},
  number={4},
  pages={40--43},
  year={2018},
  publisher={Wiley Online Library}
}

@article{r27_yong_2012,
author={Yong, Ed},
title={Replication studies: Bad copy},
volume={485},
DOI={10.1038/485298a},
number={7398},
journal={Nature},
year={2012},
pages={298-300}
},

@article{young2014improving,
  title={Improving library user experience with A/B testing: Principles and process},
  author={Young, Scott WH},
  journal={Weave: Journal of Library User Experience},
  volume={1},
  number={1},
  year={2014},
  publisher={Michigan Publishing, University of Michigan Library}
}

@book{r28_scherr_1983,
author={Scherr, George},
title={The Best of the Journal of Irreproducible Results: Improbable Investigations and Unfounded Findings},
publisher={Workman Publishing Company},
year={1983}
},

@article{r29_economist_editorial_2013,
author={Economist},
title={Unreliable research. Trouble at the lab.},
url={http://www.economist.com/news/leaders/21588069-scientific-research-has-changed-world-now-it-needs-change-itself-how-science-goes-wrong},
urldate={2015-10-26},
journal={Economist},
year={2013}
},

@misc{r31_cohoon_2015,
author={Cohoon, Johanna},
title={COS | Open Science Communities},
url={https://cos.io/communities/#tab_2},
urldate={2015-10-28},
journal={Cos.io},
year={2015}
},

@misc{r32_todd_others_2015,
author={Todd, Mat and others,},
title={OSM - Open Source Malaria},
url={http://opensourcemalaria.org/},
urldate={2015-10-28},
journal={Opensourcemalaria.org},
year={2015}
},

@misc{r33_osbr_2015,
author={OSBR,},
title={The Synaptic Leap: Open Source Biomedical Research},
url={http://www.thesynapticleap.org/},
urldate={2015-10-28},
year={2015}
},

@misc{r34_iorns_others_2015,
author={Iorns, Elizabeth and others,},
title={Validation by Science Exchange - Identifying and rewarding high-quality research},
url={http://validation.scienceexchange.com/\#},
urldate={2015-10-28},
journal={Validation.scienceexchange.com},
year={2015}
}

@book{RosBook,
	Author = {Rosenbaum, P R},
	Ean = {9780387989679},
	Edition = {2},
	Isbn = {0387989676},
	Pagetotal = {377},
	Publisher = {Springer},
	Title = {Observational Studies},
	Year = {2002}}

@article {Schulzc332,
	author = {Schulz, Kenneth F and Altman, Douglas G and Moher, David},
	title = {CONSORT 2010 Statement: updated guidelines for reporting parallel group randomised trials},
	volume = {340},
	elocation-id = {c332},
	year = {2010},
	doi = {10.1136/bmj.c332},
	publisher = {BMJ Publishing Group Ltd},
	issn = {0959-8138},
	URL = {https://www.bmj.com/content/340/bmj.c332},
	eprint = {https://www.bmj.com/content},
	journal = {BMJ}
}

@book{secrist1933triumph,
  title={The Triumph of Mediocrity in Business},
  author={Secrist, H.},
  lccn={34005572},
  series={Business studies},
  url={https://books.google.co.nz/books?id=n8RAAAAAIAAJ},
  year={1933},
  publisher={Bureau of Business Research, Northwestern University}
}

@article{simon1992explanation,
  title={What is an “explanation” of behavior?},
  author={Simon, Herbert A},
  journal={Psychological science},
  volume={3},
  number={3},
  pages={150--161},
  year={1992},
  publisher={SAGE Publications Sage CA: Los Angeles, CA}
}

@misc{snow1849mode,
  title={On the mode of communication of cholera},
  author={Snow, John},
  year={1855},
  publisher={John Churchill}
}

@book{snow1855mode,
  title={On the mode of communication of cholera},
  author={Snow, John},
  year={1855},
  publisher={John Churchill}
}

@book{thaler2015misbehaving,
  title={Misbehaving: The making of behavioral economics},
  author={Thaler, Richard H and Ganser, LJ},
  year={2015},
  publisher={WW Norton New York}
}

@book{us1989guide,
  title={Guide to clinical preventive services: report of the US Preventive Services Task Force},
  author={{US Preventive Services Task Force}},
  year={1989},
  publisher={Diane Publishing Company}
}

@article{valentine2007timeline,
  title={Timeline: The Rise and Fall of Vioxx},
  author={Valentine, Vikki and Prakash, Snigdha},
  journal={NPR (National Public Radio)},
  volume={10},
  year={2007}
}

@article{wainerRegress,
author = {Wainer, Howard},
title = {Visual Revelations},
journal = {CHANCE},
volume = {13},
number = {1},
pages = {47-48},
year  = {2000},
publisher = {Taylor & Francis},
doi = {10.1080/09332480.2000.10542192},

URL = {
        https://doi.org/10.1080/09332480.2000.10542192

},
eprint = {
        https://doi.org/10.1080/09332480.2000.10542192
}
}

@book{waterman1982search,
  title={In search of excellence: Lessons from America's best-run companies},
  author={Waterman, Robert H and Peters, Thomas J},
  year={1982},
  publisher={New York: Harper \& Row}
}

@misc{watkins2000conviction,
  title={Conviction by mathematical error?: Doctors and lawyers should get probability theory right},
  author={Watkins, Stephen J},
  year={2000},
  publisher={British Medical Journal Publishing Group}
}

@article{watson2020open,
  title={Open letter to MR Mehra, SS Desai, F Ruschitzka, and AN Patel, authors of “Hydroxychloroquine or chloroquine with or without a macrolide for treatment of COVID-19: a multinational registry analysis”},
  author={Watson, J and Adler, A and Agweyu, A and others},
  journal={Lancet},
  pages={31180--6},
  year={2020}
}

@article{wegwarth2018european,
  title={What do European women know about their female cancer risks and cancer screening? A cross-sectional online intervention survey in five European countries},
  author={Wegwarth, Odette and Widschwendter, Martin and Cibula, David and Sundstr{\"o}m, Karin and Portuesi, Rosalba and Lein, Ines and Rebitschek, Felix G},
  journal={BMJ open},
  volume={8},
  number={12},
  pages={e023789},
  year={2018},
  publisher={British Medical Journal Publishing Group}
}

@article{wernham_EtAl_2016,
title={A Comparison of Midwife-Led and Medical-Led Models of Care and Their Relationship to Adverse Fetal and Neonatal Outcomes: A Retrospective Cohort Study in New Zealand},
volume={13},
DOI={10.1371/journal.pmed.1002134},
number={9},
journal={PLOS Medicine},
author={Wernham, Ellie and Gurney, Jason and Stanley, James and Ellison-Loschmann, Lis and Sarfati, Diana},
year={2016},
pages={e1002134},
url={https://journals.plos.org/plosmedicine/article?id=10.1371/journal.pmed.1002134#sec023}
}

repository: jhmaindonald/dataThoughts

repo_name: jhmaindonald/dataThoughts


text:
@Article{cisneros:ar:2020,
  author    = {Cisneros-Limon, Rafael and Morisawa, Mitsuharu and Benallegue, Mehdi and Escande, Adrien and Kanehiro, Fumio},
  title     = {An inverse dynamics-based multi-contact locomotion control framework without joint torque feedback},
  journal   = {Advanced Robotics},
  year      = {2020},
  volume    = {34},
  number    = {21--22},
  pages     = {1398--1419},
  month     = {November},
  doi       = {10.1080/01691864.2020.1842140},
  url       = {https://raw.githubusercontent.com/aescande/website/master/papers/2020\_AR\_Cisneros.pdf},
  publisher = {TAYLOR \& FRANCIS LTD},
  address   = {2-4 PARK SQUARE, MILTON PARK, ABINGDON OR14 4RN, OXON, ENGLAND}
}


text:
SUMMARY = "Set of utilities/functionalities which can be used for easier build of sysrepo plugins."
DESCRIPTION = ""
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=f91d5dfaae99cc1943a8eca222cafa5c"

SRC_URI = "gitsm://github.com/telekom/sysrepo-plugins-common.git;protocol=https;branch=devel "
SRC_URI += " file://0001-so-version.patch "
FILESEXTRAPATHS:prepend := "${THISDIR}:"

PV = "dev+git${SRCPV}"
SRCREV = "20885de0d3bb95a05610fdb3a0f83d8f7c370fad"

S = "${WORKDIR}/git"

DEPENDS = "libyang sysrepo"

FILES:${PN} += ""

inherit cmake pkgconfig

# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = " -DCMAKE_INSTALL_PREFIX:PATH=/usr "

do_install:append () {
    true
}

repository: rcn-ee/meta-arago

repo_name: rcn-ee/meta-arago


text:
@inproceedings{hung_helping_2022,
	address = {Cham},
	series = {Lecture {Notes} of the {Institute} for {Computer} {Sciences}, {Social} {Informatics} and {Telecommunications} {Engineering}},
	title = {Helping {People} to {Control} {Their} {Everyday} {Data} for {Care}: {A} {Scenario}-{Based} {Study}},
	isbn = {978-3-030-99194-4},
	shorttitle = {Helping {People} to {Control} {Their} {Everyday} {Data} for {Care}},
	doi = {10.1007/978-3-030-99194-4_18},
	abstract = {With the advent of pervasive sensing devices, data captured about one’s everyday life (e.g., heart rate, sleep quality, emotion, or social activity) offers enormous possibilities for promoting in-home health care for severe chronic care, such as can be found in Spinal Cord Injury or Disorders or the like. Sharing these Everyday Data for Care (EDC) allows care team personnel (e.g., caregivers and clinicians) to assist with health monitoring and decision-making, but will also create tension and concerns (e.g., privacy) for people with health conditions due to the detailed nature of the data. Resolving these tensions and concerns is critical for the adoption and use of a pervasive healthcare environment.We examine data sharing of EDC to determine how we can better manage the tradeoffs between privacy on one hand and the pro-active sharing of data that one needs for better care. In this paper, we target one critical aspect of using EDC, the problem of sharing an overwhelming number of sensor outputs with numerous care team recipients. We report the results of a scenario-based study that examined ways to reduce the burden of setting policies or rules to manage both the pro-active data sharing and the privacy aspects of care with EDC. In summary, we found that our participants were able to use self-generated groupings of EDC data, and more importantly, largely kept those groupings when creating to share data with potential recipients and when dealing with changes in their health trajectory. These findings offer hope that we can reduce the burden of authoring and maintaining data sharing and privacy policies through semi-automatic mechanisms, where the system suggests policies that are consistent with the users’ preferences - especially as health changes.},
	language = {en},
	booktitle = {Pervasive {Computing} {Technologies} for {Healthcare}},
	publisher = {Springer International Publishing},
	author = {Hung, Pei-Yao and Ackerman, Mark S.},
	editor = {Lewy, Hadas and Barkan, Refael},
	year = {2022},
	keywords = {Care network, Care team, Chronic care, Control, Data sharing, Patient-generated health data, Privacy, Self-care},
	pages = {272--301}
}