text:
package main

// ser.go : serialization

import (
	"bytes"
	"fmt"
	"io"
	"time"

	"github.com/glycerine/go-capnproto"
	schema "github.com/glycerine/goq/schema"
)

func (js *JobServ) ServerToCapnp() (bytes.Buffer, *capn.Segment) {
	seg := capn.NewBuffer(nil)
	z := schema.NewRootZ(seg)

	zjs := schema.NewZgoqserver(seg)
	z.SetGoqserver(zjs)

	// nextjobid
	zjs.SetNextjobid(js.NextJobId)

	var i int
	var j *Job

	// runq
	if len(js.RunQ) > 0 {
		//fmt.Printf("len of Runq: %d, %#v\n", len(js.RunQ), js.RunQ)
		runq := schema.NewZjobList(seg, len(js.RunQ))
		plistRunq := capn.PointerList(runq)
		i = 0
		for _, j = range js.RunQ {
			zjob := JobToCapnpSegment(j, seg)
			plistRunq.Set(i, capn.Object(zjob))
			i++
		}
		zjs.SetRunq(runq)
	}

	// waitingjobs
	if len(js.WaitingJobs) > 0 {
		//fmt.Printf("len of WaitingJobs: %d, %#v\n", len(js.WaitingJobs), js.WaitingJobs)
		waitingjobs := schema.NewZjobList(seg, len(js.WaitingJobs))
		plistWaitingjobs := capn.PointerList(waitingjobs)
		i = 0
		for _, j = range js.WaitingJobs {
			zjob := JobToCapnpSegment(j, seg)
			plistWaitingjobs.Set(i, capn.Object(zjob))
			i++
		}
		zjs.SetWaitingjobs(waitingjobs)
	}
	// counters
	zjs.SetFinishedjobscount(js.FinishedJobsCount)
	zjs.SetBadsgtcount(js.BadSgtCount)
	zjs.SetCancelledjobcount(js.CancelledJobCount)
	zjs.SetBadnoncecount(js.BadNonceCount)

	// FinishedRing -> finishedjobs
	if len(js.FinishedRing) > 0 {
		finishedjobs := schema.NewZjobList(seg, len(js.FinishedRing))
		plistFinishedjobs := capn.PointerList(finishedjobs)
		i = 0
		for _, j = range js.FinishedRing {
			zjob := JobToCapnpSegment(j, seg)
			plistFinishedjobs.Set(i, capn.Object(zjob))
			i++
		}
		zjs.SetFinishedjobs(finishedjobs)
	}

	buf := bytes.Buffer{}
	seg.WriteTo(&buf)

	return buf, seg
}

func (js *JobServ) SetStateFromCapnp(r io.Reader, fn string) {
	capMsg, err := capn.ReadFromStream(r, nil)
	if err != nil {
		panic(fmt.Errorf("capnp problem reading from file '%s': %s", fn, err))
	}

	z := schema.ReadRootZ(capMsg)
	d3 := z.Which()
	if d3 != schema.Z_GOQSERVER {
		panic(fmt.Sprintf("expected schema.Z_GOQSERVER, got %d", d3))
	}

	zjs := z.Goqserver()
	js.NextJobId = zjs.Nextjobid()

	runqlist := zjs.Runq().ToArray()
	for _, zjob := range runqlist {
		j := CapnpZjobToJob(zjob)

		// don't kill jobs prematurely just because we the server
		// just started back up!
		j.Unansweredping = 0
		j.Lastpingtm = time.Now().UnixNano()

		js.RunQ[j.Id] = j
		js.KnownJobHash[j.Id] = j
		js.RegisterWho(j)
	}

	waitlist := zjs.Waitingjobs().ToArray()
	for _, zjob := range waitlist {
		j := CapnpZjobToJob(zjob)
		js.WaitingJobs = append(js.WaitingJobs, j)
		js.KnownJobHash[j.Id] = j
		// getting too many open files errors, try doing
		// this on demand instead of all at once: comment it out.
		// js.RegisterWho(j)
	}

	js.FinishedJobsCount = zjs.Finishedjobscount()
	js.BadSgtCount = zjs.Badsgtcount()
	js.CancelledJobCount = zjs.Cancelledjobcount()
	js.BadNonceCount = zjs.Badnoncecount()

	finishedlist := zjs.Finishedjobs().ToArray()
	for _, zjob := range finishedlist {
		j := CapnpZjobToJob(zjob)
		js.FinishedRing = append(js.FinishedRing, j)
	}

}

func CapnpZjobToJob(zj schema.Zjob) *Job {

	return &Job{
		Id:       zj.Id(),
		Msg:      zj.Msg(),
		Aboutjid: zj.Aboutjid(),

		Cmd:  zj.Cmd(),
		Args: zj.Args().ToArray(),
		Out:  zj.Out().ToArray(),
		Env:  zj.Env().ToArray(),

		// err and failed
		Err:      zj.Err(),
		HadError: zj.Haderror(),

		Host: zj.Host(),
		Stm:  zj.Stm(),
		Etm:  zj.Etm(),

		Elapsec: zj.Elapsec(),
		Status:  zj.Status(),
		Subtime: zj.Subtime(),

		Pid: zj.Pid(),
		Dir: zj.Dir(),

		HomeOnSubmitter: zj.HomeOnSubmitter(),

		Submitaddr: zj.Submitaddr(),
		Serveraddr: zj.Serveraddr(),
		Workeraddr: zj.Workeraddr(),
		Finishaddr: zj.Finishaddr().ToArray(),

		Signature: zj.Signature(),
		IsLocal:   zj.Islocal(),
		Cancelled: zj.Cancelled(),

		ArrayId:        zj.Arrayid(),
		GroupId:        zj.Groupid(),
		Delegatetm:     zj.Delegatetm(),
		Lastpingtm:     zj.Lastpingtm(),
		Unansweredping: zj.Unansweredping(),
		Sendernonce:    zj.Sendernonce(),
		Sendtime:       zj.Sendtime(),
		MaxShow:        zj.Maxshow(),
		CmdOpts:        zj.Cmdopts(),
	}
}

func CapnpToJob(buf *bytes.Buffer) (*Job, error) {
	capMsg, err := capn.ReadFromStream(buf, nil)
	if err != nil {
		return nil, err
	}

	z := schema.ReadRootZ(capMsg)
	d3 := z.Which()
	if d3 != schema.Z_JOB {
		panic(fmt.Sprintf("expected schema.Z_JOB, got %d", d3))
	}

	zj := z.Job()
	job := CapnpZjobToJob(zj)

	return job, nil
}

// once you've already allocated a segment
func JobToCapnpSegment(j *Job, seg *capn.Segment) schema.Zjob {

	zjob := schema.NewZjob(seg)

	zjob.SetId(j.Id)

	zjob.SetAboutjid(j.Aboutjid)
	zjob.SetMsg(j.Msg)

	zjob.SetCmd(j.Cmd)

	if tl := StringSliceToCapnp(j.Out, seg); tl != nil {
		zjob.SetOut(*tl)
	}

	if tl := StringSliceToCapnp(j.Args, seg); tl != nil {
		zjob.SetArgs(*tl)
	}

	if tl := StringSliceToCapnp(j.Env, seg); tl != nil {
		zjob.SetEnv(*tl)
	}

	// err and failed
	zjob.SetErr(j.Err)
	zjob.SetHaderror(j.HadError)

	zjob.SetHost(j.Host)

	zjob.SetStm(int64(j.Stm))
	zjob.SetEtm(int64(j.Etm))
	zjob.SetElapsec(j.Elapsec)

	zjob.SetStatus(j.Status)
	zjob.SetSubtime(int64(j.Subtime))
	zjob.SetPid(j.Pid)

	zjob.SetDir(j.Dir)
	zjob.SetHomeOnSubmitter(j.HomeOnSubmitter)

	zjob.SetSubmitaddr(j.Submitaddr)
	zjob.SetServeraddr(j.Serveraddr)
	zjob.SetWorkeraddr(j.Workeraddr)

	if tl := StringSliceToCapnp(j.Finishaddr, seg); tl != nil {
		zjob.SetFinishaddr(*tl)
	}

	zjob.SetSignature(j.Signature)
	zjob.SetIslocal(j.IsLocal)
	zjob.SetCancelled(j.Cancelled)

	zjob.SetArrayid(j.ArrayId)
	zjob.SetGroupid(j.GroupId)
	zjob.SetDelegatetm(j.Delegatetm)
	zjob.SetLastpingtm(j.Lastpingtm)
	zjob.SetUnansweredping(j.Unansweredping)
	zjob.SetSendernonce(j.Sendernonce)
	zjob.SetSendtime(j.Sendtime)
	zjob.SetMaxshow(j.MaxShow)
	zjob.SetCmdopts(j.CmdOpts)

	return zjob
}

func JobToCapnp(j *Job) (bytes.Buffer, *capn.Segment) {
	seg := capn.NewBuffer(nil)
	z := schema.NewRootZ(seg)

	zjob := JobToCapnpSegment(j, seg)
	z.SetJob(zjob)

	buf := bytes.Buffer{}
	seg.WriteTo(&buf)

	return buf, seg
}

func StringSliceToCapnp(a []string, seg *capn.Segment) *capn.TextList {
	if a == nil {
		panic("string slice can't be nil")
	}
	// looks like we need a size zero textlist for complete initialization,
	// so do this even if len(a) == 0
	tl := seg.NewTextList(len(a))
	for i := range a {
		tl.Set(i, a[i])
	}
	return &tl
}

repository: glycerine/goq

repo_name: glycerine/goq


text:
SUMMARY = "Alljoyn framework unit tests."
DESCRIPTION = "Alljoyn is an Open Source framework that makes it easy for devices and apps to discover and securely communicate with each other."
AUTHOR = "Herve Jourdain <herve.jourdain@beechwoods.com>"
HOMEPAGE = "https://www.allseenalliance.org/"
SECTION = "libs"
LICENSE = "ISC"
DEPENDS = "openssl libxml2 libcap"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/ISC;md5=f3b90e78ea0cffb20bf5cca7947a896d"

S = "${WORKDIR}/alljoyn"
SRC_URI = "git://git.allseenalliance.org/gerrit/core/alljoyn.git;protocol=https;branch=RB${PV};destsuffix=alljoyn/core/alljoyn"
SRCREV = "${AUTOREV}"

ALLJOYN_BINDINGS ?= "cpp"
ALLJOYN_TSTDIR ?= "/opt/alljoyn/test"

ALLJOYN_BUILD_OPTIONS += "GTEST_DIR=${STAGING_DIR_HOST}/${prefix}/src/gtest"
ALLJOYN_BUILD_OPTIONS_NATIVE += "GTEST_DIR=${STAGING_DIR_NATIVE}/${prefix}/src/gtest"

inherit scons

PACKAGES = " \
             ${PN}-dbg \
             ${PN} \
           "

do_compile() {
# For _class-target and _class-nativesdk
    export TARGET_CC="${CC}"
    export TARGET_CXX="${CXX}"
    export TARGET_CFLAGS="${CFLAGS}"
    export TARGET_CPPFLAGS="${CPPFLAGS}"
# Path to toolchain already in the PATH variable!
    export TARGET_PATH="${PATH}"
    export TARGET_LINKFLAGS="${LDFLAGS}"
    export TARGET_LINK="${CCLD}"
    export TARGET_AR="${AR}"
    export TARGET_RANLIB="${RANLIB}"
    export STAGING_DIR="${STAGING_DIR_TARGET}"
    cd ${S}/core/alljoyn
    scons OS=openwrt CPU=openwrt CRYPTO=openssl BINDINGS=${ALLJOYN_BINDINGS} ${ALLJOYN_BUILD_OPTIONS} OE_BASE=/usr WS=off VARIANT=debug
    unset TARGET_CC
    unset TARGET_CXX
    unset TARGET_CFLAGS
    unset TARGET_CPPFLAGS
    unset TARGET_PATH
    unset TARGET_LINKFLAGS
    unset TARGET_LINK
    unset TARGET_AR
    unset TARGET_RANLIB
    unset STAGING_DIR
}

do_compile_class-native() {
    cd ${S}/core/alljoyn
    scons CRYPTO=openssl BINDINGS=${ALLJOYN_BINDINGS} ${ALLJOYN_BUILD_OPTIONS_NATIVE} OE_BASE=/usr WS=off VARIANT=debug
}

do_install() {
    install -d ${D}/${ALLJOYN_TSTDIR}
    cp -r ${S}/core/alljoyn/build/openwrt/openwrt/debug/test/cpp/bin/* ${D}/${ALLJOYN_TSTDIR}
}

FILES_${PN} = " \
                ${ALLJOYN_TSTDIR}/* \
              "

RDEPENDS_${PN} += "alljoyn alljoyn-services bash"
DEPENDS += "gtest"

BBCLASSEXTEND = "native nativesdk"

repository: jwinarske/meta-alljoyn

license_type: permissive

repo_name: jwinarske/meta-alljoyn

branch_name: refs/heads/master

extension: bb


text:
package main

import (
	"context"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"os/exec"
	"strings"
	"time"

	"krashanoff.com/parallel/pkg/pattern"
)

//
// parallel
//
// clean-room adaptation of gnu's parallel
// with no external deps.
//
// krashanoff
//

const ABOUT = `parallel - run a command on many threads

Usage:
parallel [flags] [command+flags] \; [list of files]

Example:
parallel -j 4 -t 6000 sed -i '$ a\New line' {} \; ./folder/*.md

Use "parallel ... \; -" to read newline-delimited file paths from stdin.

Flags:`

type JobStatus struct {
	id  uint64
	err error
}

func main() {
	deadline := flag.Uint64("t", 0, "Set the maximum runtime in `milliseconds` for each execution. Defaults to no deadline (zero).")
	threads := flag.Uint64("j", 1, "Set the number of `routines` to use.")
	quiet := flag.Bool("q", false, "Suppress output from subprocesses' stdout.")
	flag.Usage = func() {
		fmt.Println(ABOUT)
		flag.PrintDefaults()
	}
	flag.Parse()

	argStart := len(os.Args) - flag.NArg()
	fileOffset := -1
	for i, arg := range os.Args[argStart:] {
		if arg == ";" {
			fileOffset = argStart + i
		}
	}

	// Check args
	switch {
	case fileOffset == -1:
		log.Fatalln("Missing ';' from input.")
	case *threads == 0:
		log.Fatalln("Incorrect thread count!")
	}

	program := strings.Join(os.Args[argStart:fileOffset], " ")
	files := os.Args[fileOffset+1:]
	numFiles := len(files)
	if numFiles == 1 && files[0] == "-" {
		log.Println("Using stdin for input.")
		if buf, err := ioutil.ReadAll(os.Stdin); err != nil {
			log.Println("Failed to read stdin.")
		} else {
			files = strings.Split(string(buf), "\n")
		}
	}

	if len(program) == 0 {
		log.Fatalln("No program supplied.")
	}

	startTime := time.Now()
	log.Printf("Started execution at %v", startTime)

	// Spawn workers
	work, done := make(chan []string, numFiles), make(chan JobStatus, numFiles)
	for i := uint64(0); i < *threads; i++ {
		id := i
		go func() {
			for cmdArgs := range work {
				// Create timeout context
				ctx, cancel := context.Background(), func() {}
				if *deadline != 0 {
					ctx, cancel = context.WithTimeout(context.Background(), time.Duration(*deadline)*time.Millisecond)
				}
				defer cancel()

				// Setup command, redirect pipes
				cmd := exec.CommandContext(ctx, cmdArgs[0])
				if len(program) > 1 {
					cmd = exec.CommandContext(ctx, cmdArgs[0], cmdArgs[1:]...)
				}
				if !*quiet {
					cmd.Stdout = os.Stdout
					cmd.Stderr = os.Stderr
				}

				log.Printf("Thread ID %d assigned job \"%v\"", id, strings.Join(cmdArgs, " "))
				done <- JobStatus{
					id,
					cmd.Run(),
				}
			}
		}()
	}

	// Create work, transforming input pattern.
	cmdArgs, err := pattern.GeneratePatterns(program, files)
	if err != nil {
		log.Fatalf("Failed to parse input string: %v", err)
	}
	for _, c := range cmdArgs {
		work <- strings.Split(c, " ")
	}
	close(work)

	// Wait for jobs to complete, exit.
	successful, culled := 0, 0
	for range files {
		job := <-done
		if job.err != nil {
			log.Printf("ERROR: Thread %d reported error: %v", job.id, job.err)
			culled++
		} else {
			successful++
		}
	}

	endTime := time.Now()
	log.Printf("Operation terminated at %v.", endTime)
	log.Printf("Total Time: %v", endTime.Sub(startTime))
	log.Printf("Successful Jobs: %d", numFiles-culled)
	log.Printf("Culled Jobs: %d", culled)

	os.Exit(0)
}

license: ISC

repository: krashanoff/parallel

repo_name: krashanoff/parallel

branch_name: refs/heads/main

extension: go


text:
@article{Zhou2012,
author = {Zhou, Mingyuan and Chen, Haojun and Paisley, John and Ren, Lu and Li, Lingbo and Xing, Zhengming and Dunson, David B. and Sapiro, Guillermo and Carin, Lawrence and Member, Senior},
journal = {Image (Rochester, N.Y.)},
number = {1},
pages = {130--144},
title = {{Nonparametric Bayesian Dictionary Learning for Analysis of Noisy and Incomplete Images}},
volume = {21},
year = {2012}
}
@article{Spielman2012,
abstract = {We consider the problem of learning sparsely used dictionaries with an arbitrary square dictionary and a random, sparse coefficient matrix. We prove that \$O (n \backslash log n)\$ samples are sufficient to uniquely determine the coefficient matrix. Based on this proof, we design a polynomial-time algorithm, called Exact Recovery of Sparsely-Used Dictionaries (ER-SpUD), and prove that it probably recovers the dictionary and coefficient matrix when the coefficient matrix is sufficiently sparse. Simulation results show that ER-SpUD reveals the true dictionary as well as the coefficients with probability higher than many state-of-the-art algorithms.},
archivePrefix = {arXiv},
arxivId = {1206.5882},
author = {Spielman, Daniel A. and Wang, Huan and Wright, John},
eprint = {1206.5882},
file = {::},
month = jun,
title = {{Exact Recovery of Sparsely-Used Dictionaries}},
url = {http://arxiv.org/abs/1206.5882},
year = {2012}
}

@article{Wheeler1991,
abstract = {For over half a century neuroscientists have distinguished extracellularly recorded action potentials on the basis of distinguishing features of their waveforms, notably spike height and width. The improvements first in electronics and now in inexpensive computers have made possible automated spike sorting using a variety of sophisticated algorithms, both off-line and in real-time. As multiple element electrode arrays come into widespread use, practical spike sorting technology will be necessary in order to avoid the need to 'employ one graduate student for each channel' in order to make sense of the volume of incoming data. This talk will review basic spike sorting algorithms, including autoclassifying and adaptive approaches. The discussion will also include the processing requirements for realtime applications and observations on the limits of accurate sorting.},
author = {Wheeler, Bruce C},
journal = {Annals of Biomedical Engineering},
number = {5},
title = {{Multi-unit neural spike sorting}},
volume = {19},
year = {1991}
}
@book{Rieke1997,
abstract = {What does it mean to say that a certain set of spikes is the right answer to a computational problem? In what sense does a spike train convey information about the sensory world? Spikes begins by providing precise formulations of these and related questions about the representation of sensory signals in neural spike trains. The answers to these questions are then pursued in experiments on sensory neurons.Intended for neurobiologists with an interest in mathematical analysis of neural data as well as the growing number of physicists and mathematicians interested in information processing by "real" nervous systems, Spikes provides a self-contained review of relevant concepts in information theory and statistical decision theory.},
author = {Rieke, F and Warland, D and {De Ruyter Van Steveninck}, R and Bialek, W},
booktitle = {Computational Neuroscience},
editor = {Sejnowski, T J and Poggio, T A},
isbn = {0262181746},
number = {10},
pages = {xvi, 395 p.},
pmid = {2562525},
publisher = {MIT Press},
title = {{Spikes: Exploring the Neural Code}},
url = {http://scholar.google.com/scholar?hl=en\&btnG=Search\&q=intitle:Spikes\#0},
volume = {20},
year = {1997}
}
@article{Nicolelis2009,
abstract = {Research on brain-machine interfaces has been ongoing for at least a decade. During this period, simultaneous recordings of the extracellular electrical activity of hundreds of individual neurons have been used for direct, real-time control of various artificial devices. Brain-machine interfaces have also added greatly to our knowledge of the fundamental physiological principles governing the operation of large neural ensembles. Further understanding of these principles is likely to have a key role in the future development of neuroprosthetics for restoring mobility in severely paralysed patients.},
author = {Nicolelis, Miguel A L and Lebedev, Mikhail A},
institution = {Duke University Center for Neuroengineering and the Department of Neurobiology, Duke University, Durham, North Carolina 27710, USA. nicoleli@neuro.duke.edu},
journal = {Nature Reviews Neuroscience},
keywords = {animal,animal physiology,animals,behavior,brain,brain cytology,brain physiology,electric stimulation,electrodes,humans,implanted,motor activity,motor activity physiology,neuronal plasticity,neuronal plasticity physiology,neurons,neurons cytology,neurons physiology,paralysis,paralysis therapy,prostheses implants,user computer interface},
number = {7},
pages = {530--540},
pmid = {19543222},
publisher = {Nature Publishing Group},
title = {{Principles of neural ensemble physiology underlying the operation of brain-machine interfaces.}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/19543222},
volume = {10},
year = {2009}
}
@article{Einevoll2012,
abstract = {The new generation of silicon-based multielectrodes comprising hundreds or more electrode contacts offers unprecedented possibilities for simultaneous recordings of spike trains from thousands of neurons. Such data will not only be invaluable for finding out how neural networks in the brain work, but will likely be important also for neural prosthesis applications. This opportunity can only be realized if efficient, accurate and validated methods for automatic spike sorting are provided. In this review we describe some of the challenges that must be met to achieve this goal, and in particular argue for the critical need of realistic model data to be used as ground truth in the validation of spike-sorting algorithms.},
author = {Einevoll, Gaute T and Franke, Felix and Hagen, Espen and Pouzat, Christophe and Harris, Kenneth D},
doi = {10.1016/j.conb.2011.10.001},
file = {:Users/jovo/Articles/EinvollHarris11.pdf:pdf},
issn = {1873-6882},
journal = {Current opinion in neurobiology},
month = feb,
number = {1},
pages = {11--7},
pmid = {22023727},
publisher = {Elsevier Ltd},
title = {{Towards reliable spike-train recordings from thousands of neurons with multielectrodes.}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/22023727},
volume = {22},
year = {2012}
}

repository: jovo/spike-sorting

repo_name: jovo/spike-sorting

gha_language: Matlab

extension: bib


text:
@article{tang2022detecting,
 author = {Tang, Shuanghong and Zheng, Congcong and Wang, Kun},
 journal = {arXiv preprint arXiv:2206.13743},
 title = {Detecting and Eliminating Quantum Noise of Quantum Measurements},
 year = {2022}
}

license: MIT


text:
require gstreamer1.0-omx.inc

LIC_FILES_CHKSUM = "\
    file://COPYING;md5=4fbd65380cdd255951079008b364516c \
    file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f \
"

SRC_URI = "\
    http://gstreamer.freedesktop.org/src/gst-omx/gst-omx-${PV}.tar.xz \
    file://0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch \
    file://0002-fix-decoder-flushing.patch \
    file://0003-no-timeout-on-get-state.patch \
    file://0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch \
    file://0006-omxvideodec-fix-deadlock-on-downstream-EOS.patch \
"

SRC_URI[md5sum] = "cedb230f1c47d0cf4b575d70dff66ff2"
SRC_URI[sha256sum] = "45072925cf262f0fd528fab78f0de52734e46a5a88aa802fae51c67c09c81aa2"

S = "${WORKDIR}/gst-omx-${PV}"

repository: WebPlatformForEmbedded/meta-wpe

repo_name: WebPlatformForEmbedded/meta-wpe

gha_language: BitBake


text:
DESCRIPTION = "tuxbox libtuxtxt"
DEPENDS = "dreambox-dvbincludes libpng freetype"

inherit gitpkgv

SRC_URI = "git://openpli.git.sourceforge.net/gitroot/openpli/tuxtxt;protocol=git"

S = "${WORKDIR}/git/libtuxtxt"

PV = "2.0+git${SRCPV}"
PKGV = "2.0+git${GITPKGV}"
PR = "r0"

PROVIDES += "libtuxtxt-enigma2"
RPROVIDES_${PN} += "libtuxtxt-enigma2"

EXTRA_OECONF = "--with-boxtype=generic"

inherit autotools pkgconfig

FILES_libtuxtxt_append = " /usr/lib/libtuxtxt.so"

FILES_${PN}-dev = "/usr/lib/libtuxtxt.la /usr/lib/pkgconfig/tuxbox-tuxtxt.pc"

gha_language: C


text:
package ca

import (
	"fmt"
	"os"

	"github.com/smallstep/certificates/api"
	"github.com/smallstep/certificates/pki"
	"github.com/smallstep/cli/flags"
	"github.com/smallstep/cli/utils"
	"github.com/smallstep/cli/utils/cautils"
	"github.com/urfave/cli"
	"go.step.sm/cli-utils/command"
	"go.step.sm/cli-utils/errs"
)

func tokenCommand() cli.Command {
	return cli.Command{
		Name:   "token",
		Action: command.ActionFunc(tokenAction),
		Usage:  "generate an OTT granting access to the CA",
		UsageText: `**step ca token** <subject>
[--**kid**=<kid>] [--**issuer**=<name>]
[**--cert-not-before**=<time|duration>] [**--cert-not-after**=<time|duration>]
[**--not-before**=<time|duration>] [**--not-after**=<time|duration>]
[**--password-file**=<file>] [**--provisioner-password-file**=<file>]
[**--output-file**=<file>] [**--kms**=uri] [**--key**=<file>] [**--san**=<SAN>] [**--offline**]
[**--revoke**] [**--x5c-cert**=<file>] [**--x5c-key**=<file>] [**--x5c-insecure**]
[**--sshpop-cert**=<file>] [**--sshpop-key**=<file>]
[**--ssh**] [**--host**] [**--principal**=<name>] [**--k8ssa-token-path**=<file>]
[**--ca-url**=<uri>] [**--root**=<file>] [**--context**=<name>]`,
		Description: `**step ca token** command generates a one-time token granting access to the
certificates authority.

## POSITIONAL ARGUMENTS

<subject>
:  The Common Name, DNS Name, or IP address that will be set by the certificate authority.
When there are no additional Subject Alternative Names configured (via the
--san flag), the subject will be added as the only element of the 'sans' claim
on the token.

## EXAMPLES

 Most of the following examples assumes that **--ca-url** and **--root** are
 set using environment variables or the default configuration file in
 <$STEPPATH/config/defaults.json>.

Get a new token for a DNS. Because there are no Subject Alternative Names
configured (via the '--san' flag), the 'sans' claim of the token will have a
default value of ['internal.example.com']:
'''
$ step ca token internal.example.com
'''

Get a new token for a 'Revoke' request:
'''
$ step ca token --revoke 146103349666685108195655980390445292315
'''

Get a new token for an IP address. Because there are no Subject Alternative Names
configured (via the '--san' flag), the 'sans' claim of the token will have a
default value of ['192.168.10.10']:
'''
$ step ca token 192.168.10.10
'''

Get a new token with custom Subject Alternative Names. The value of the 'sans'
claim of the token will be ['1.1.1.1', 'hello.example.com'] - 'foobar' will not
be in the 'sans' claim unless explicitly configured via the '--san' flag:
'''
$ step ca token foobar --san 1.1.1.1 --san hello.example.com
'''

Get a new token that expires in 30 minutes:
'''
$ step ca token --not-after 30m internal.example.com
'''

Get a new token that becomes valid in 30 minutes and expires 5 minutes after that:
'''
$ step ca token --not-before 30m --not-after 35m internal.example.com
'''

Get a new token signed with the given private key, the public key must be
configured in the certificate authority:
'''
$ step ca token internal.smallstep.com --key token.key
'''

Get a new token for a specific provisioner kid, ca-url and root:
'''
$ step ca token internal.example.com \
    --kid 4vn46fbZT68Uxfs9LBwHkTvrjEvxQqx-W8nnE-qDjts \
    --ca-url https://ca.example.com \
    --root /path/to/root_ca.crt
'''

Get a new token using the simple offline mode, requires the configuration
files, certificates, and keys created with **step ca init**:
'''
$ step ca token internal.example.com --offline
'''

Get a new token using the offline mode with all the parameters:
'''
$ step ca token internal.example.com \
    --offline \
    --kid 4vn46fbZT68Uxfs9LBwHkTvrjEvxQqx-W8nnE-qDjts \
    --issuer you@example.com \
    --key provisioner.key \
    --ca-url https://ca.example.com \
    --root /path/to/root_ca.crt
'''

Get a new token for a 'Revoke' request:
'''
$ step ca token --revoke 146103349666685108195655980390445292315
'''

Get a new token in offline mode for a 'Revoke' request:
'''
$ step ca token --offline --revoke 146103349666685108195655980390445292315
'''

Get a new token for an SSH user certificate:
'''
$ step ca token max@smallstep.com --ssh
'''

Get a new token for an SSH host certificate:
'''
$ step ca token my-remote.hostname --ssh --host
'''

Generate a renew token and use it in a renew after expiry request:
'''
$ TOKEN=$(step ca token --x5c-cert internal.crt --x5c-key internal.key --renew internal.example.com)
$ curl -X POST -H "Authorization: Bearer $TOKEN" https://ca.example.com/1.0/renew
'''

Generate a JWK provisioner token using a key in a YubiKey:
'''
$ step ca token --kms yubikey:pin-value=123456 --key yubikey:slot-id=82 internal.example.com
'''

Generate an X5C provisioner token using a certificate in a YubiKey. Note that a
YubiKey does not support storing a certificate bundle. To make it work, you must
add the intermediate and the root in the provisioner configuration:
'''
$ step ca token --kms yubikey:pin-value=123456 \
  --x5c-cert yubikey:slot-id=82 --x5c-key yubikey:slot-id=82 \
  internal.example.com
'''`,
		Flags: []cli.Flag{
			provisionerKidFlag,
			cli.StringSliceFlag{
				Name: "san",
				Usage: `Add <dns|ip|email|uri> Subject Alternative Name(s) (SANs)
that should be authorized. A certificate signing request using this token must
match the complete set of SANs in the token 1:1. Use the '--san' flag multiple
times to configure multiple SANs.`,
			},
			cli.StringSliceFlag{
				Name: "principal,n",
				Usage: `Add the principals (user or host <name>s) that the token is authorized to
request. The signing request using this token won't be able to add
extra names. Use the '--principal' flag multiple times to configure
multiple principals.`,
			},
			sshHostFlag,
			flags.CaConfig,
			flags.Force,
			flags.NotAfter,
			flags.NotBefore,
			flags.CertNotAfter,
			flags.CertNotBefore,
			flags.Provisioner,
			flags.PasswordFile,
			flags.ProvisionerPasswordFile,
			flags.KMSUri,
			flags.X5cCert,
			flags.X5cKey,
			flags.X5cInsecure,
			flags.SSHPOPCert,
			flags.SSHPOPKey,
			flags.NebulaCert,
			flags.NebulaKey,
			cli.StringFlag{
				Name: "key",
				Usage: `The private key <file> used to sign the JWT. This is usually downloaded from
the certificate authority.`,
			},
			cli.StringFlag{
				Name:  "output-file",
				Usage: "The destination <file> of the generated one-time token.",
			},
			cli.BoolFlag{
				Name: "revoke",
				Usage: `Create a token for authorizing 'Revoke' requests. The audience will
be invalid for any other API request.`,
			},
			cli.BoolFlag{
				Name: "renew",
				Usage: `Create a token for authorizing 'renew' requests. The audience will
be invalid for any other API request.`,
			},
			cli.BoolFlag{
				Name: "rekey",
				Usage: `Create a token for authorizing 'rekey' requests. The audience will
be invalid for any other API request.`,
			},
			cli.BoolFlag{
				Name:  "ssh",
				Usage: `Create a token for authorizing an SSH certificate signing request.`,
			},
			flags.K8sSATokenPathFlag,
			flags.Offline,
			flags.CaURL,
			flags.Root,
			flags.Context,
		},
	}
}

func tokenAction(ctx *cli.Context) error {
	if err := errs.NumberOfArguments(ctx, 1); err != nil {
		return err
	}

	subject := ctx.Args().Get(0)
	outputFile := ctx.String("output-file")
	offline := ctx.Bool("offline")
	// x.509 flags
	sans := ctx.StringSlice("san")
	isRevoke := ctx.Bool("revoke")
	isRenew := ctx.Bool("renew")
	isRekey := ctx.Bool("rekey")
	// ssh flags
	isSSH := ctx.Bool("ssh")
	isHost := ctx.Bool("host")
	principals := ctx.StringSlice("principal")

	switch {
	case isSSH && len(sans) > 0:
		return errs.IncompatibleFlagWithFlag(ctx, "ssh", "san")
	case isHost && len(sans) > 0:
		return errs.IncompatibleFlagWithFlag(ctx, "host", "san")
	case len(principals) > 0 && len(sans) > 0:
		return errs.IncompatibleFlagWithFlag(ctx, "principal", "san")
	case !isSSH && isHost:
		return errs.RequiredWithFlag(ctx, "host", "ssh")
	case !isSSH && len(principals) > 0:
		return errs.RequiredWithFlag(ctx, "principal", "ssh")
	}

	// Default token type is always a 'Sign' token.
	var typ int
	if isSSH {
		switch {
		case isRevoke:
			typ = cautils.SSHRevokeType
		case isRenew:
			typ = cautils.SSHRenewType
		case isRekey:
			typ = cautils.SSHRekeyType
		case isHost:
			typ = cautils.SSHHostSignType
			sans = principals
		default:
			typ = cautils.SSHUserSignType
			sans = principals
		}
	} else {
		switch {
		case isRevoke:
			typ = cautils.RevokeType
		case isRenew:
			typ = cautils.RenewType
		default:
			typ = cautils.SignType
		}
	}

	caURL, err := flags.ParseCaURL(ctx)
	if err != nil {
		return err
	}

	root := ctx.String("root")
	if root == "" {
		root = pki.GetRootCAPath()
		if _, err := os.Stat(root); err != nil {
			return errs.RequiredFlag(ctx, "root")
		}
	}

	// --san and --type revoke are incompatible. Revocation tokens do not support SANs.
	if typ == cautils.RevokeType && len(sans) > 0 {
		return errs.IncompatibleFlagWithFlag(ctx, "san", "revoke")
	}

	// parse times or durations
	notBefore, ok := flags.ParseTimeOrDuration(ctx.String("not-before"))
	if !ok {
		return errs.InvalidFlagValue(ctx, "not-before", ctx.String("not-before"), "")
	}
	notAfter, ok := flags.ParseTimeOrDuration(ctx.String("not-after"))
	if !ok {
		return errs.InvalidFlagValue(ctx, "not-after", ctx.String("not-after"), "")
	}

	// parse certificates durations
	certNotBefore, err := api.ParseTimeDuration(ctx.String("cert-not-before"))
	if err != nil {
		return errs.InvalidFlagValue(ctx, "cert-not-before", ctx.String("cert-not-before"), "")
	}
	certNotAfter, err := api.ParseTimeDuration(ctx.String("cert-not-after"))
	if err != nil {
		return errs.InvalidFlagValue(ctx, "cert-not-after", ctx.String("cert-not-after"), "")
	}

	var token string
	if offline {
		token, err = cautils.OfflineTokenFlow(ctx, typ, subject, sans, notBefore, notAfter, certNotBefore, certNotAfter)
		if err != nil {
			return err
		}
	} else {
		token, err = cautils.NewTokenFlow(ctx, typ, subject, sans, caURL, root, notBefore, notAfter, certNotBefore, certNotAfter)
		if err != nil {
			return err
		}
	}
	if len(outputFile) > 0 {
		return utils.WriteFile(outputFile, []byte(token), 0600)
	}
	fmt.Println(token)
	return nil
}

repository: smallstep/cli

repo_name: smallstep/cli

gha_language: Go


text:
@article{RN24,
   title = {<Borsboom-2011-The-small-world-of-psychopathology.pdf>},
   DOI = {10.1371/
10.1371/journal.pone.0027407.g001},
   type = {Journal Article}
}

@article{RN20,
   author = {Bianciardi, M. and Sirabella, P. and Hagberg, G. E. and Giuliani, A. and Zbilut, J. P. and Colosimo, A.},
   title = {Model-free analysis of brain fMRI data by recurrence quantification},
   journal = {Neuroimage},
   volume = {37},
   number = {2},
   pages = {489-503},
   ISSN = {1053-8119 (Print)
1053-8119 (Linking)},
   DOI = {10.1016/j.neuroimage.2007.05.025},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/17600730},
   year = {2007},
   type = {Journal Article}
}

@article{RN19,
   author = {Bringmann, L. F. and Hamaker, E. L. and Vigo, D. E. and Aubert, A. and Borsboom, D. and Tuerlinckx, F.},
   title = {Changing dynamics: Time-varying autoregressive models using generalized additive modeling},
   journal = {Psychol Methods},
   volume = {22},
   number = {3},
   pages = {409-425},
   ISSN = {1939-1463 (Electronic)
1082-989X (Linking)},
   DOI = {10.1037/met0000085},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/27668421},
   year = {2017},
   type = {Journal Article}
}

@article{RN12,
   author = {Bruza, Peter and Busemeyer, Jerome R. and Gabora, Liane},
   title = {Introduction to the special issue on quantum cognition},
   journal = {Journal of Mathematical Psychology},
   volume = {53},
   number = {5},
   pages = {303-305},
   ISSN = {00222496},
   DOI = {10.1016/j.jmp.2009.06.002},
   year = {2009},
   type = {Journal Article}
}

@article{RN3,
   author = {Conner, T. S. and Tennen, H. and Fleeson, W. and Barrett, L. F.},
   title = {Experience Sampling Methods: A Modern Idiographic Approach to Personality Research},
   journal = {Soc Personal Psychol Compass},
   volume = {3},
   number = {3},
   pages = {292-313},
   ISSN = {1751-9004 (Print)
1751-9004 (Linking)},
   DOI = {10.1111/j.1751-9004.2009.00170.x},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/19898679},
   year = {2009},
   type = {Journal Article}
}

@inproceedings{RN10,
   author = {Cox, Ralf F. A. and Hasselman, Fred and Seevinck, Michael P.},
   title = {A Process Approach to Psychological Measurement: Lessons from Quantum Mechanics},
   year = {2011},
   booktitle = {16th International Conference on Perception–Action},
   type = {Conference Proceedings}
}

@article{RN23,
   author = {Cramer, A. O. and van Borkulo, C. D. and Giltay, E. J. and van der Maas, H. L. and Kendler, K. S. and Scheffer, M. and Borsboom, D.},
   title = {Major Depression as a Complex Dynamic System},
   journal = {PLoS One},
   volume = {11},
   number = {12},
   pages = {e0167490},
   ISSN = {1932-6203 (Electronic)
1932-6203 (Linking)},
   DOI = {10.1371/journal.pone.0167490},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/27930698},
   year = {2016},
   type = {Journal Article}
}

@article{RN18,
   author = {Epskamp, S. and Cramer, A. O. J. and Waldorp, L. J. and Schmittmann, V. D. and Borsboom, D.},
   title = {qgraph: Network Visualizations of Relationships in Psychometric Data},
   journal = {Journal of Statistical Software},
   volume = {48},
   number = {4},
   pages = {1-18},
   ISSN = {1548-7660},
   url = {<Go to ISI>://WOS:000305117400001},
   year = {2012},
   type = {Journal Article}
}

@article{RN8,
   author = {Fisher, A. J. and Medaglia, J. D. and Jeronimus, B. F.},
   title = {Lack of group-to-individual generalizability is a threat to human subjects research},
   journal = {Proc Natl Acad Sci U S A},
   volume = {115},
   number = {27},
   pages = {E6106-E6115},
   ISSN = {1091-6490 (Electronic)
0027-8424 (Linking)},
   DOI = {10.1073/pnas.1711978115},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/29915059
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6142277/pdf/pnas.201711978.pdf},
   year = {2018},
   type = {Journal Article}
}

@article{RN5,
   author = {Luce, R.D. and Narens, L},
   title = {Symmetry, Scale, Types, and Generalizations of Classical Physical Measurment},
   journal = {Journal of Mathematical Psychology},
   volume = {27},
   pages = {44-85},
   year = {1983},
   type = {Journal Article}
}

@article{RN17,
   author = {Marwan, N. and Carmenromano, M. and Thiel, M. and Kurths, J.},
   title = {Recurrence plots for the analysis of complex systems},
   journal = {Physics Reports},
   volume = {438},
   number = {5-6},
   pages = {237-329},
   ISSN = {03701573},
   DOI = {10.1016/j.physrep.2006.11.001},
   year = {2007},
   type = {Journal Article}
}

@article{RN15,
   author = {Metzler, R. and Jeon, J. H. and Cherstvy, A. G. and Barkai, E.},
   title = {Anomalous diffusion models and their properties: non-stationarity, non-ergodicity, and ageing at the centenary of single particle tracking},
   journal = {Phys Chem Chem Phys},
   volume = {16},
   number = {44},
   pages = {24128-64},
   ISSN = {1463-9084 (Electronic)
1463-9076 (Linking)},
   DOI = {10.1039/c4cp03465a},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/25297814},
   year = {2014},
   type = {Journal Article}
}

@article{RN4,
   author = {Molenaar, P. C.},
   title = {On the implications of the classical ergodic theorems: analysis of developmental processes has to focus on intra-individual variation},
   journal = {Dev Psychobiol},
   volume = {50},
   number = {1},
   pages = {60-9},
   ISSN = {1098-2302 (Electronic)
0012-1630 (Linking)},
   DOI = {10.1002/dev.20262},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/18085558},
   year = {2008},
   type = {Journal Article}
}

@article{RN2,
   author = {Nezlek, JB},
   title = {Ecological momentary assessment: Statistical issues},
   journal = {European Psychiatry},
   volume = {30},
   pages = {121},
   ISSN = {0924-9338},
   year = {2015},
   type = {Journal Article}
}

@misc{RN6,
   author = {Press, William H},
   title = {Reproducibility now at risk?},
   month = {30-05-2014},
   url = {https://www.simonsfoundation.org/event/symposium-on-evidence-in-the-natural-sciences/},
   year = {2014},
   type = {Conference Paper}
}

@article{RN13,
   author = {Ramachandran, B},
   title = {On the "Strong Memorylessness Property" of the Exponential and Geometric Probability Laws},
   journal = {Sankhyā: The Indian Journal of Statistics},
   volume = {41},
   number = {Series A, Pts. 3 and 4},
   pages = {244-251},
   url = {https://www.jstor.org/stable/25050199},
   year = {1979},
   type = {Journal Article}
}

@article{RN1,
   author = {Shiffman, S.},
   title = {Conceptualizing analyses of ecological momentary assessment data},
   journal = {Nicotine Tob Res},
   volume = {16 Suppl 2},
   pages = {S76-87},
   ISSN = {1469-994X (Electronic)
1462-2203 (Linking)},
   DOI = {10.1093/ntr/ntt195},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/24323571},
   year = {2014},
   type = {Journal Article}
}

@article{RN11,
   author = {Tversky, A.},
   title = {A General Theory of Polynomial Conjoint Measurement},
   journal = {Journal of Mathematical Psychology},
   volume = {4},
   number = {1},
   pages = {1-&},
   ISSN = {0022-2496},
   DOI = {Doi 10.1016/0022-2496(67)90039-9},
   url = {<Go to ISI>://WOS:A19679046100001},
   year = {1967},
   type = {Journal Article}
}

@article{RN7,
   author = {Wallot, Sebastian and Kelty-Stephen, Damian G.},
   title = {Interaction-Dominant Causation in Mind and Brain, and Its Implication for Questions of Generalization and Replication},
   journal = {Minds and Machines},
   volume = {28},
   number = {2},
   pages = {353-374},
   ISSN = {0924-6495
1572-8641},
   DOI = {10.1007/s11023-017-9455-0},
   year = {2017},
   type = {Journal Article}
}

@article{RN22,
   author = {Wichers, M. and Groot, P. C. and Psychosystems, E. S. M. Group E. W. S. Group},
   title = {Critical Slowing Down as a Personalized Early Warning Signal for Depression},
   journal = {Psychother Psychosom},
   volume = {85},
   number = {2},
   pages = {114-6},
   ISSN = {1423-0348 (Electronic)
0033-3190 (Linking)},
   DOI = {10.1159/000441458},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/26821231},
   year = {2016},
   type = {Journal Article}
}

@article{RN14,
   author = {Wijnants, M. L. and Hasselman, F. and Cox, R. F. A. and Bosman, A. M. T. and Van Orden, G.},
   title = {An interaction-dominant perspective on reading fluency and dyslexia},
   journal = {Annals of dyslexia},
   DOI = {10.1007/s11881-012-0067-3},
   url = {http://www.ncbi.nlm.nih.gov/pubmed/22460607},
   year = {2012},
   type = {Journal Article}
}

@article{RN9,
   author = {Wolfers, T. and Doan, N. T. and Kaufmann, T. and Alnaes, D. and Moberget, T. and Agartz, I. and Buitelaar, J. K. and Ueland, T. and Melle, I. and Franke, B. and Andreassen, O. A. and Beckmann, C. F. and Westlye, L. T. and Marquand, A. F.},
   title = {Mapping the Heterogeneous Phenotype of Schizophrenia and Bipolar Disorder Using Normative Models},
   journal = {JAMA Psychiatry},
   volume = {75},
   number = {11},
   pages = {1146-1155},
   ISSN = {2168-6238 (Electronic)
2168-622X (Linking)},
   DOI = {10.1001/jamapsychiatry.2018.2467},
   url = {https://www.ncbi.nlm.nih.gov/pubmed/30304337},
   year = {2018},
   type = {Journal Article}
}

@article{RN21,
   author = {Zbilut, J. P. and Giuliani, A. and Webber, C. L.},
   title = {Detecting deterministic signals in exceptionally noisy environments using cross-recurrence quantification},
   journal = {Physics Letters A},
   volume = {246},
   number = {1-2},
   pages = {122-128},
   ISSN = {0375-9601},
   DOI = {Doi 10.1016/S0375-9601(98)00457-5},
   url = {<Go to ISI>://WOS:000075725500019},
   year = {1998},
   type = {Journal Article}
}

@article{RN16,
   author = {Zou, Yong and Donner, Reik V. and Marwan, Norbert and Donges, Jonathan F. and Kurths, Jürgen},
   title = {Complex network approaches to nonlinear time series analysis},
   journal = {Physics Reports},
   volume = {787},
   pages = {1-97},
   ISSN = {03701573},
   DOI = {10.1016/j.physrep.2018.10.005},
   year = {2019},
   type = {Journal Article}
}

repository: complexity-methods/CSA-Book

repo_name: complexity-methods/CSA-Book


text:
package tile

import (
	"github.com/unchartedsoftware/veldt/util/json"
)

// MacroEdge represents a tile that returns individual data edges with optional
// included attributes.
type MacroEdge struct {
	LOD int
}

// Parse parses the provided JSON object and populates the structs attributes.
func (e *MacroEdge) Parse(params map[string]interface{}) error {
	// parse LOD
	e.LOD = json.GetIntDefault(params, 0, "lod")
	return nil
}

// ParseIncludes parses the included attributes to ensure they include the raw
// data coordinates.
func (e *MacroEdge) ParseIncludes(includes []string, srcXField string, srcYField string, dstXField string, dstYField string, weightField string) []string {
	// src includes
	if !existsIn(srcXField, includes) {
		includes = append(includes, srcXField)
	}
	if !existsIn(srcYField, includes) {
		includes = append(includes, srcYField)
	}
	// dst includes
	if !existsIn(dstXField, includes) {
		includes = append(includes, dstXField)
	}
	if !existsIn(dstYField, includes) {
		includes = append(includes, dstYField)
	}
	// weight includes
	if !existsIn(weightField, includes) {
		includes = append(includes, weightField)
	}
	return includes
}

// Encode will encode the tile results
func (e *MacroEdge) Encode(edges []float32) ([]byte, error) {
	// encode the results
	if e.LOD > 0 {
		return EncodeEdgeLOD(edges, e.LOD), nil
	}
	return EncodeFloat32(edges), nil
}

repository: zeroviscosity/veldt

repo_name: zeroviscosity/veldt


text:
%------------------------------------
% LIVROS

@misc{locationSystems2008,
  note =
    {
        Anthony LaMarca, Eyal de Lara.
        Location Systems: An Introduction to the Technology Behind Location Awareness. Morgan \& Claypool, 2008
    }
}

@misc{handbookPositionLocation2012,
  note =
    {
        Reza Zekavat, R. Michael Buehrer
        Handbook of Position Location Theory, Practice, and Advances. John Wiley \& Sons, 2012
    }
}

@misc{machineLearning1997,
  note =
    {
        Tom M. Mitchell
        Machine Learning. McGraw-Hill Science/Engineering/Math, 1997
    }
}

@misc{patternRecognition1997,
  note =
    {
        Christopher M. Bishop
        Pattern Recognition and Machine Learning. Springer, 2006
    }
}

%------------------------------------
% ARTIGOS

@misc{surveyFingerprinting2016,
  note =
    {
        Quoc Duy Vo, De. Pradipta.
        A Survey of Fingerprint-Based Outdoor Localization.
        IEEE Communications Surveys \& Tutorials, vol. 18, 2016
    }
}

@misc{taxonomyLocationServices2003,
  note =
    {
        Vasileios Zeimpekis, George Giaglis, George Lekakos.
        A Taxonomy of Indoor and Outdoor Positioning Techniques for Mobile Location Services.
        SIGecom Exchanges, vol. 3, 2003
    }
}

@misc{instanceBasedLearning1991,
  note =
    {
        D.W. Aha, D. Kibler, M.K. Albert.
        Instance-based learning algorithms.
        Mach Learn, vol. 6, 37, 1991
    }
}

@misc{wknn2004,
  note =
    {
        Klaus Hechenbichler, Klaus Schliep.
        Weighted k-Nearest-Neighbor Techniques and Ordinal Classification.
        Sonderforschungsbereich, vol. 386, 2004
    }
}

@misc{svm1992,
  note =
    {
        Bernhard E. Boser, Isabelle M. Guyon, Vladimir N. Vapnik.
        A Training Algorithm for Optimal Margin Classifiers.
        Proceedings of the fifth annual workshop on Computational learning theory, 1992
    }
}

@misc{unevenGridFingerprinting2015,
  note =
    {
        Yanan Han, Huan Ma, Lijun Zhang.
        An Efficient RF Fingerprint Positioning Algorithm Based on Uneven Grid Layout.
        6th International Conference on Wireless, Mobile and Multi-Media (ICWMMN), 2015
    }
}

@misc{wardriving2010,
  note =
    {
        Arvin Wen Tsui, Wei-Cheng Lin, Wei-Ju Chen, Polly Huang, Hao-Hua Chu.
        Accuracy Performance Analysis between War Driving and War Walking in Metropolitan Wi-Fi Localization.
        IEEE Transactions on Mobile Computing, vol. 9, 2010
    }
}

@misc{svr1997,
  note =
    {
        Harris Drucker, Chris J. C. Burges, Linda Kaufman, Alex Smola, Vladimir Vapnik.
        Support Vector Regression Machines.
        ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS 9, Pags. 155--161, MIT Press, 1997
    }
}

@misc{gridResolutionImpact2011,
  note =
    {
        Marina Vuckovic, Ivan Petrovic, Deni Vidovic.
        Space Grid Resolution Impact on Accuracy of the Indoor Localization Fingerprinting.
        19th Telecommunications Forum (TELFOR), 2011
    }
}

@misc{svmSolvers2007,
  note =
    {
        Léon Bottou, Chih-jen Lin.
        Support vector machine solvers.
        Department of Computer Science - National Taiwan University, 2007
    }
}

@misc{scikitLearn,
  note =
    {
        F. Pedregosa,  G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Veerplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, E. Duchesnay.
        Scikit-learn: Machine Learning in Python.
        Journal of Machine Learning Research, vol. 12, 2011
    }
}

%------------------------------------
% TESES

@misc{teseRobson2014,
  note =
    {
        Robson Dias Alves Timoteo. Uma Avaliação do Uso de Máquinas de Vetores de Suporte na Predição de Sinais de Rádio	Frequência em Redes Celulares. Tese de Mestrado, Centro de Informática - Universidade Federal de Pernambuco, 2014
    }
}

%------------------------------------
% SITES

@misc{applicationsSVM,
  note =
    {
        SVM Application List. Disponível em http://www.clopinet.com/SVM.applications.html. Acessado em 25-06-2017
    }
}

repository: urbanoanderson/ufpe-graduation-thesis

repo_name: urbanoanderson/ufpe-graduation-thesis


text:
#include "Texture.hpp"

Texture::Texture()
:_type(GL_RGB)
,_format(GL_RGB)
,_warpr(GL_CLAMP_TO_EDGE)
,_warps(GL_REPEAT)
,_warpt(GL_REPEAT)
,_filter_min(GL_LINEAR_MIPMAP_LINEAR)
,_filter_max(GL_LINEAR_MIPMAP_LINEAR)
,_texture_type(TEX_TYPE::DEFAULT) { }

void Texture::destroy() {
    glDeleteTextures(1, &_id);
}

const Texture& Texture::bind() const {
    if(_texture_type == TEX_TYPE::CUBEMAP) {
        glBindTexture(GL_TEXTURE_CUBE_MAP, _id);
        return *this;
    }
    glBindTexture(GL_TEXTURE_2D, _id);
    return *this;
}

void Texture::GenRandomMap1D(unsigned int size) {
    this->_width = size;
    this->_format =  GL_RGB;
    this->_type   =  GL_RGB;
    this->_filter_max = this->_filter_min = GL_LINEAR;
    this->_texture_type = TEX_TYPE::DEFAULT;
    this->_warps = GL_REPEAT;

    const imap1d data = randomx::rand(size * 3);

    glGenTextures(1, &_id);
    glBindTexture(GL_TEXTURE_1D, _id);
    glTexImage1D(GL_TEXTURE_1D, 0, GL_RGB, size, 0.0f, GL_RGB, GL_FLOAT, data.data());
    glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_REPEAT);
}

void Texture::LoadTexture2D(unsigned int width, unsigned int height, const unsigned char *data) {
    this->_width = width; this->_height = height;
    glGenTextures(1, &_id);
    glBindTexture(GL_TEXTURE_2D, _id);
    glTexImage2D(GL_TEXTURE_2D, 0, _type, this->_width, this->_height, 0, _format, GL_UNSIGNED_BYTE, data);
    glGenerateMipmap(GL_TEXTURE_2D);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, this->_warps);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, this->_warpt);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, this->_filter_min);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, this->_filter_max);
}

void Texture::LoadTexture2DGamma(unsigned int width, unsigned int height, const unsigned char *data) {
    this->_width = width; this->_height = height;
    if (_format == GL_RGB) {
        this->_type = GL_SRGB;
    } else if (_format == GL_RGBA) {
        this->_type = GL_SRGB_ALPHA;
    }
    glGenTextures(1, &_id);
    glBindTexture(GL_TEXTURE_2D, _id);
    glTexImage2D(GL_TEXTURE_2D, 0, _type, this->_width, this->_height, 0, _format, GL_UNSIGNED_BYTE, data);
    glGenerateMipmap(GL_TEXTURE_2D);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, this->_warps);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, this->_warpt);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, this->_filter_min);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, this->_filter_max);
}

void Texture::LoadTexture2DFloat(unsigned int width, unsigned int height, const float *data) {
    this->_width = width; this->_height = height;
    glGenTextures(1, &_id);
    glBindTexture(GL_TEXTURE_2D, _id);
    glTexImage2D(GL_TEXTURE_2D, 0, this->_type, this->_width, this->_height, 0, this->_format, GL_FLOAT, data);
    glGenerateMipmap(GL_TEXTURE_2D);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, this->_warps);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, this->_warpt);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, this->_filter_min);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, this->_filter_max);
}

void Texture::LoadTexture3D(unsigned int width, unsigned int height, unsigned char **data) {
    this->_width = width; this->_height = height;
    glGenTextures(1, &_id);
    glBindTexture(GL_TEXTURE_CUBE_MAP, _id);
    for(auto i = 0; i < 6; ++i) {
        glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, this->_type,
            this->_width, this->_height, 0, this->_format, GL_UNSIGNED_BYTE, data[i]);
    }
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, this->_filter_min);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, this->_filter_max);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, this->_warpr);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, this->_warps);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, this->_warpt);
}

void Texture::GenShadowMap(unsigned int width, unsigned int height) {

}

void Texture::GenPostProcessMap(unsigned int width, unsigned int height) {
    this->_width = width; this->_height = height;
    this->_format =  GL_RGB;
    this->_type   =  GL_RGB;
    this->_filter_max = this->_filter_min = GL_LINEAR;
    this->_texture_type = TEX_TYPE::COLORBUF;
    this->_warpr = this->_warps = this->_warpt = GL_CLAMP_TO_EDGE;

    glGenTextures(1, &_id);
    glBindTexture(GL_TEXTURE_2D, _id);
    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, this->_width, this->_height, 0, GL_RGB, GL_FLOAT, NULL);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
}

repository: Nayaco/OpenGLBoilerplate

repo_name: Nayaco/OpenGLBoilerplate

extension: cpp


text:
package grpc

import (
	"context"

	sdkquery "github.com/cosmos/cosmos-sdk/types/query"

	liquiditytypes "github.com/tendermint/liquidity/x/liquidity/types"
)

// GetLiquidityQueryClient returns a object of queryClient
func (c *Client) GetLiquidityQueryClient() liquiditytypes.QueryClient {
	return liquiditytypes.NewQueryClient(c)
}

// GetPool returns pool information.
func (c *Client) GetPool(ctx context.Context, poolId uint64) (liquiditytypes.Pool, error) {
	client := c.GetLiquidityQueryClient()

	req := liquiditytypes.QueryLiquidityPoolRequest{
		PoolId: poolId,
	}

	resp, err := client.LiquidityPool(ctx, &req)
	if err != nil {
		return liquiditytypes.Pool{}, err
	}

	return resp.GetPool(), nil
}

// GetAllPools returns all existing pools.
func (c *Client) GetAllPools(ctx context.Context) (liquiditytypes.Pools, error) {
	client := c.GetLiquidityQueryClient()

	req := liquiditytypes.QueryLiquidityPoolsRequest{
		Pagination: &sdkquery.PageRequest{},
	}

	resp, err := client.LiquidityPools(ctx, &req)
	if err != nil {
		return liquiditytypes.Pools{}, err
	}

	return resp.GetPools(), nil
}

repository: b-harvest/cosmos-module-stress-test

repo_name: b-harvest/cosmos-module-stress-test


text:
package testutil

import (
	"context"
	"fmt"
	"math/rand"
	"sync"
	"time"

	"github.com/filecoin-project/dealbot/controller/client"
	"github.com/filecoin-project/dealbot/tasks"
	logging "github.com/ipfs/go-log/v2"
	"github.com/urfave/cli/v2"

	"github.com/google/uuid"
)

var log = logging.Logger("mock_daemon")

// MockDaemon mimics a running daemon by pulling tasks of the queue and returning
// results
type MockDaemon struct {
	doneCh           chan struct{}
	forceClose       chan struct{}
	closed           chan struct{}
	successRate      float64
	failureAvg       time.Duration
	failureDeviation time.Duration
	successAvg       time.Duration
	successDeviation time.Duration
	client           *client.Client
	host             string
	workers          int
}

// NewMockDaemon initializes a new mocked out daemon
func NewMockDaemon(ctx context.Context, cliCtx *cli.Context) (srv *MockDaemon) {
	srv = new(MockDaemon)
	srv.client = client.New(cliCtx)
	srv.doneCh = make(chan struct{})
	srv.forceClose = make(chan struct{})
	srv.closed = make(chan struct{})
	srv.successRate = cliCtx.Float64("success_rate")
	srv.successAvg = cliCtx.Duration("success_avg")
	srv.successDeviation = cliCtx.Duration("success_deviation")
	srv.failureAvg = cliCtx.Duration("failure_avg")
	srv.failureDeviation = cliCtx.Duration("failure_deviation")
	srv.host = uuid.New().String()[:8]
	srv.workers = cliCtx.Int("workers")
	return srv
}

func (md *MockDaemon) worker(n int) {
	log.Infow("mock worker started", "worker_id", n)

	for {
		// add delay to avoid querying the controller many times if there are no available tasks
		time.Sleep(5 * time.Second)

		// pop a task
		ctx := context.Background()
		task, err := md.client.PopTask(ctx, &client.PopTaskRequest{WorkedBy: md.host})
		if err != nil {
			log.Warnw("pop-task returned error", "err", err)
			continue
		}

		if task == nil {
			continue // no task available
		}

		if task.WorkedBy != md.host {
			log.Warnw("pop-task returned a non-available task", "err", err)
			continue
		}

		log.Infow("successfully acquired task", "uuid", task.UUID)
		isSuccess := rand.Float64() <= md.successRate
		var taskDuration time.Duration
		if isSuccess {
			taskDuration = md.successAvg + time.Duration(rand.NormFloat64()*float64(md.successDeviation))
		} else {
			taskDuration = md.failureAvg + time.Duration(rand.NormFloat64()*float64(md.failureDeviation))
		}
		if taskDuration < 0 {
			taskDuration = 0
		}
		timer := time.NewTimer(taskDuration)
		select {
		case <-md.doneCh:
			return
		case <-timer.C:
			result := tasks.Successful
			if !isSuccess {
				result = tasks.Failed
			}
			req := &client.UpdateTaskRequest{
				Status:   result,
				WorkedBy: md.host,
			}

			task, err = md.client.UpdateTask(ctx, task.UUID, req)
			if err != nil {
				log.Warnw("update task returned error", "err", err)
				continue
			}
		}
	}
}

func (md *MockDaemon) Serve() error {
	select {
	case <-md.doneCh:
		return fmt.Errorf("tried to reuse a stopped server")
	default:
	}

	var wg sync.WaitGroup
	for i := 0; i < md.workers; i++ {
		wg.Add(1)
		go func(i int) {
			defer wg.Done()
			md.worker(i)
		}(i)
	}
	finished := make(chan struct{})
	go func() {
		wg.Wait()
		close(finished)
	}()
	select {
	case <-finished:
		close(md.closed)
	case <-md.forceClose:
		return fmt.Errorf("did not shutdown gracefully")
	}
	return nil
}

// Shutdown all workers
func (md *MockDaemon) Shutdown(ctx context.Context) error {
	close(md.doneCh)
	select {
	case <-md.closed:
	case <-ctx.Done():
		close(md.forceClose)
		return ctx.Err()
	}
	return nil
}

repository: PineappleClout/dealbot

repo_name: PineappleClout/dealbot

gha_license_id: NOASSERTION


text:
require bug-app.inc

DESCRIPTION = "This deploys a servlet so that the CameraModuleControl is tweakable from a web interface."
HOMEPAGE = "http://buglabs.net/applications/ICameraModuleControlWS"

DEPENDS += "service-tracker com.buglabs.osgi.http com.buglabs.bug.module.camera com.sun.javax.servlet com.buglabs.common com.buglabs.osgi "

PV = "1"

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

APIVERSION = ""

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
package main

import (
	"context"
	"io/ioutil"
	"log"

	s420con "github.com/bregydoc/S420/proto"
	"google.golang.org/grpc"

	"google.golang.org/grpc/credentials"
)

func main() {
	creds, err := credentials.NewClientTLSFromFile("./server.crt", "")
	if err != nil {
		panic(err)
	}
	conn, err := grpc.Dial("localhost:24000", grpc.WithTransportCredentials(creds))
	if err != nil {
		panic(err)
	}

	client := s420con.NewS420Client(conn)
	if err != nil {
		panic(err)
	}
	data, err := ioutil.ReadFile("./ghost.jpg")
	if err != nil {
		panic(err)
	}
	resp, err := client.SaveNewObject(context.TODO(), &s420con.NewObjectParams{
		Data: data,
		Options: &s420con.ObjectOptions{
			ContentType: "image/jpg",
		},
		Path: "covers/ghost.jpg",
	})

	if err != nil {
		panic(err)
	}

	// You can access to localhost:3300/public/covers/ghost.jpg

	log.Println(resp)
}


text:
@article{Harper2010fo,
 abstract = {Previous studies have defined a new type of impairment in which an able-bodied user's behaviour is impaired by both the characteristics of a device and the environment in which it is used. This behavioural change is defined as a situationally-induced impairment and is often associated with small devices used in a mobile setting or constrained environment. Relatively little is known of its extent or the magnitude of the problems faced by the user. Here, we place the work that has been undertaken into a comparative framework of impairment in the context of data input. Our survey finds that 12 problems exist which define all impaired input and we look to understand the similarities and possible solutions in the new impairment group of small device users. For instance, from the literature, we find that users who are both situationally and motor impaired: press keys more than once, do not use enough force and so a key is not activated, and accidentally type keys in reverse order. A wealth of other errors exist in the motor impaired domain but work does not exist to support their existence in the situational domain. However, if commonalities exist for some -- it seems work should be enacted to uncover the commonalities of all. Establishing these possible commonalities is important because solutions from one domain can be leveraged into another thereby saving the need to reinvent interventions which already exist elsewhere.},
 author = {Harper, Simon and Yesilada, Yeliz and Chen, Tianyi},
 doi = {http://dx.doi.org/10.1080/01449291003801943},
 journal = {Behaviour & Information Technology},
 keywords = {Accessibility,Human Centred Web,Mobile Web,RIAM,Web Accessibility},
 month = {aug},
 publisher = {Taylor & Francis},
 title = {Mobile device impairment \łdots\ similar problems, similar solutions?},
 url = {http://www.simonharper.info/publications/Harper2010fk.pdf},
 year = {2010}
}

repository: sharpic/academic-kickstart

repo_name: sharpic/academic-kickstart


text:
DESCRIPTION = "Gnome keyring library"
LICENSE = "LGPLv2 & GPLv2"
LIC_FILES_CHKSUM = "file://COPYING.GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
                    file://COPYING;md5=0914b9d3ebaba41ef2e3e0ae16f296cf"

SECTION = "x11/gnome"

inherit gnome lib_package perlnative

SRC_URI[archive.md5sum] = "c42b2ca66204835d901d3dbfc1fa5ae6"
SRC_URI[archive.sha256sum] = "56388c0d81ddfdb57d30e4963c83ecc1c18498aab99395420e0fff69929a0f0c"

repository: linkessence/Galileo

repo_name: linkessence/Galileo


text:
#
# This file was derived from the 'Hello World!' example recipe in the
# Yocto Project Development Manual.
#

SUMMARY = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://helloworld.c"

S = "${WORKDIR}"
S1 = "/home/mxd/fsl-release-yocto/sources/meta-test/recipes-example/example/example-0.1"

do_compile() {
	     ${CC} helloworld.c -o helloworld
}

do_install() {
	     install -d ${D}${bindir}
	     install -d ${D}${sysconfdir}
		 mkdir -p ${D}${sysconfdir}/boa/
	     install -d ${D}/var
	     install -d ${D}/var/www/
	     install -d ${D}/var/www/cgi-bin
		 install -d ${D}${sysconfdir}/boa/
	     install -m 0755 helloworld ${D}${bindir}
	     install -m 0755 ${S1}/boa ${D}${sysconfdir}/boa/
	     install -m 0755 ${S1}/boa.conf ${D}${sysconfdir}/boa/
		 install -m 0755 ${S1}/mime.types ${D}${sysconfdir}
		 install -m 0755 ${S1}/capture ${D}/var/www/cgi-bin
		 install -m 0755 ${S1}/cgictest.cgi ${D}/var/www/cgi-bin
}

FILES_${PN} += "\
/etc/boa \
/ect/boa/boa \
/etc/boa/boa.conf \
/etc/mime.types \
/var/www \
/var/www/cgi-bin \
/var/www/cgi-bin/capture \
/var/www/cgi-bin/cgictest.cgi \
"

repository: skawu/meta-test

repo_name: skawu/meta-test


text:
SUMMARY = "Build tools package group for MagOS"
LICENSE = "MIT"
PR = "r0"

PACKAGE_ARCH = "${MACHINE_ARCH}"

inherit packagegroup

RDEPENDS_${PN} = "\
    packagegroup-core-buildessential \
    coreutils \
    diffutils \
    intltool \
    perl-module-re \
    perl-module-text-wrap \
    findutils \
    quilt \
    less \
    ldd \
    file \
"

repository: madisongh/magos-distro

repo_name: madisongh/magos-distro


text:
# Copyright : ETH Zurich
# License   : three-clause BSD license
# Authors   : Witold Wolski
# for full text refer to files: LICENSE, AUTHORS and COPYRIGHT

FIND_PATH(VIGRA_INCLUDE_DIR vigra/accessor.hxx)
FIND_LIBRARY(VIGRA_LIBRARY NAMES vigraimpex)

IF (VIGRA_INCLUDE_DIR AND VIGRA_LIBRARY)
   MESSAGE(STATUS "XXXXXXXXXXXXX ${VIGRA_LIBRARY} XXXXXXXXXXXXXXX")
   SET(VIGRA_FOUND TRUE)
ENDIF (VIGRA_INCLUDE_DIR AND VIGRA_LIBRARY)

IF (VIGRA_FOUND)
   # show which CppUnit was found only if not quiet
   IF (NOT VIGRA_FIND_QUIETLY)
      MESSAGE(STATUS "Found VIGRA: ${VIGRA_LIBRARY}")
   ENDIF (NOT VIGRA_FIND_QUIETLY)
ELSE (VIGRA_FOUND)
   # fatal error if CppUnit is required but not found
   IF (VIGRA_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find VIGRA")
   ENDIF (VIGRA_FIND_REQUIRED)
ENDIF (VIGRA_FOUND)

repository: findMF/findMFHCS

repo_name: findMF/findMFHCS

extension: cmake


text:
package cmd

import (
	"regexp"
	"strconv"
	"testing"

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

type RunTestSuite struct {
	suite.Suite
}

func (suite *RunTestSuite) SetupTest() {
}

func (suite *RunTestSuite) TestCommandPrice() {
	tests := map[string]struct {
		contains string
		error    bool
	}{
		"btc": {
			contains: "Bitcoin",
			error:    false,
		},
		"Bitcoin": {
			contains: "Bitcoin",
			error:    false,
		},
		"Invalid_coin": {
			contains: "",
			error:    true,
		},
	}

	for s, r := range tests {
		result, err := commandPrice(s)

		if !r.error {
			suite.NoError(err)
		} else {
			suite.Error(err)
		}

		if r.contains != "" {
			suite.Contains(result, r.contains)
		}
	}
}

func (suite *RunTestSuite) TestCommandSupply() {
	tests := map[string]struct {
		error bool
	}{
		"btc": {
			error: false,
		},
		"Bitcoin": {
			error: false,
		},
		"Invalid_coin": {
			error: true,
		},
	}

	for s, r := range tests {
		response, err := commandSupply(s)

		if !r.error {
			suite.NoError(err)

			supplyRe := regexp.MustCompile(`(\d+)`)
			supplyStrings := supplyRe.FindStringSubmatch(response)
			suite.NotEmpty(supplyStrings)

			supplyInt, err := strconv.Atoi(supplyStrings[0])
			suite.NoError(err)
			suite.True(supplyInt > 100, "should be more than 100")
		} else {
			suite.Error(err)
		}
	}
}

func (suite *RunTestSuite) TestCommandVolume() {
	tests := map[string]struct {
		error bool
	}{
		"btc": {
			error: false,
		},
		"Bitcoin": {
			error: false,
		},
		"Invalid_coin": {
			error: true,
		},
	}

	for s, r := range tests {
		response, err := commandVolume(s)

		if !r.error {
			suite.NoError(err)

			volumeRe := regexp.MustCompile(`[0-9]*[.][0-9]+`)
			volumeStrings := volumeRe.FindStringSubmatch(response)
			suite.NotEmpty(volumeStrings)

			volumeFloat, err := strconv.ParseFloat(volumeStrings[0], 64)
			suite.NoError(err)
			suite.True(volumeFloat > 100, "should be more than 100")
		} else {
			suite.Error(err)
		}
	}
}

func TestRunTestSuite(t *testing.T) {
	suite.Run(t, new(RunTestSuite))
}

repository: sauceisgood/botttt

repo_name: sauceisgood/botttt


text:
@article{agnarsson2008,
  title={Is {ACCTRAN} better than {DELTRAN}?},
  author={Agnarsson, Ingi and Miller, Jeremy A},
  journal={Cladistics},
  volume={24},
  number={6},
  pages={1032-1038},
  year={2008},
  publisher={Wiley Online Library},
}

@book{alonso1999,
  title={A world catalogue of families and genera of {C}urculionoidea ({I}nsecta: {C}oleoptera)},
  author={Alonso-Zarazaga, M. A. and Lyal, C. H. C.},
  year={1999},
  publisher={Entomopraxis},
  address={Barcelona, Spain},
}

@incollection{anderson2002,
  author={Anderson, R S},
  title={Curculionidae},
  editor={Arnett~Jr., R H and Thomas, M C and Skelley, P E and Frank, J H},
  booktitle={American Beetles, Volume 2, Polyphaga: Scarabaeoidea to Curculionoidea},
  publisher={CRC Press},
  address={Boca Raton, FL},
  year={2002},
  pages={722–815},
  chapter={131},
}

@book{arnett1993,
  title={The insect and spider collections of the world.},
  author={Arnett~Jr., Ross H and Samuelson, G Allan and Nishida, Gordon M},
  edition={2},
  year={1993},
  publisher={Sandhill Crane Press, Inc.},
  address={Gainesville, Florida},
}

@article{bouchard2011,
  title={Family-group names in {C}oleoptera ({I}nsecta)},
  author={Bouchard, Patrice and Bousquet, Yves and Davies, Anthony E and Alonso-Zarazaga, Miguel A and Lawrence, John F and Lyal, Chris HC and Newton, Alfred F and Reid, Chris AM and Schmitt, Michael and {\'S}lipi{\'n}ski, S Adam and Smith, Andrew},
  journal={ZooKeys},
  volume={88},
  pages={1-972},
  year={2011},
  publisher={Pensoft Publishers},
}

@article{bremer1994,
  title={Branch support and tree stability},
  author={Bremer, K A},
  journal={Cladistics},
  volume={10},
  number={3},
  pages={295-304},
  year={1994},
  publisher={Wiley Online Library},
}

@book{brown1956,
  title={Composition of scientific words},
  author={Brown, Roland Wilbur},
  year={1956},
  publisher={Smithsonian Institution Press},
  address={Washington, DC},
}

@article{elith2011,
  title={A statistical explanation of {MaxEnt} for ecologists},
  author={Elith, Jane and Phillips, Steven J and Hastie, Trevor and Dud{\'\i}k, Miroslav and Chee, Yung En and Yates, Colin J},
  journal={Diversity and distributions},
  volume={17},
  number={1},
  pages={43-57},
  year={2011},
  publisher={Wiley Online Library},
}

@article{farris1989,
  title={The retention index and the rescaled consistency index},
  author={Farris, James S},
  journal={Cladistics},
  volume={5},
  number={4},
  pages={417-419},
  year={1989},
  publisher={Wiley Online Library},
}

@article{franz2010a,
  title={Redescriptions of critical type species in the \textit{{E}ustylini} {L}acordaire ({C}oleoptera: {C}urculionidae: {E}ntiminae)},
  author={Franz, Nico M},
  journal={Journal of Natural History},
  volume={44},
  number={1-2},
  pages={41-80},
  year={2010},
  publisher={Taylor \& Francis},
}

@article{franz2010b,
  title={Revision and phylogeny of the {C}aribbean weevil genus \textit{{A}potomoderes} {D}ejean, 1834 ({C}oleoptera, {C}urculionidae, {E}ntiminae).},
  author={Franz, Nico M},
  journal={ZooKeys},
  volume={49},
  year={2010},
}

@article{franz2012,
  title={Phylogenetic reassessment of the \textit{{E}xophthalmus} genus complex ({C}urculionidae: {E}ntiminae: {E}ustylini, {G}eonemini)},
  author={Franz, Nico M},
  journal={Zoological Journal of the Linnean Society},
  volume={164},
  number={3},
  pages={510-557},
  year={2012},
  publisher={Oxford University Press},
}

@article{franz2014,
  title={Anatomy of a cladistic analysis},
  author={Franz, Nico M},
  journal={Cladistics},
  volume={30},
  number={3},
  pages={294-321},
  year={2014},
  publisher={Wiley Online Library},
}

@manual{goloboff1999,
  title={NONA - {V}ersion 2.0 (for {W}indows)},
  author={Goloboff, P A},
  year={1999},
  note={http://www.cladistics.com},
}

@article{goloboff2001,
  title={Methods for quick consensus estimation},
  author={Goloboff, Pablo A and Farris, James S},
  journal={Cladistics},
  volume={17},
  number={1},
  pages={S26-S34},
  year={2001},
  publisher={Wiley Online Library},
}

@article{goloboff2008,
  title={TNT, a free program for phylogenetic analysis},
  author={Goloboff, Pablo A and Farris, James S and Nixon, Kevin C},
  journal={Cladistics},
  volume={24},
  number={5},
  pages={774-786},
  year={2008},
  publisher={Wiley Online Library},
}

@manual{google2018,
	title={Google {E}arth {P}ro - {V}ersion 7.3.1.4507},
	year={2018},
	author={{Google~Inc.}},
	note={https://www.google.com/earth/},
}

@article{hijmans2005,
  title={Very high resolution interpolated climate surfaces for global land areas},
  author={Hijmans, Robert J and Cameron, Susan E and Parra, Juan L and Jones, Peter G and Jarvis, Andy},
  journal={International journal of climatology},
  volume={25},
  number={15},
  pages={1965-1978},
  year={2005},
  publisher={Wiley Online Library},
}

@book{hijmans2012,
  title={Global administrative areas (boundaries)},
  author={Hijmans, R J and Garcia, N and Kapoor, J and Rala, A and Maunahan, A and Wieczorek, J},
  journal={International journal of climatology},
  year={2012},
  publisher={Museum of Vertebrate Zoology and the International Rice Research Institute},
  note={http://www.gadm.org/},
  address={University of California, Berkeley, California},
}

@article{howden1959,
  title={A revision of the species of \textit{{P}andeleteius} {S}ch{\"o}nherr and \textit{{P}andeleteinus} {C}hampion of {A}merica north of {M}exico: ({C}oleoptera: {C}urculionidae)},
  author={Howden, Anne T},
  year={1959},
  journal={Proceedings of the California Academy of Sciences},
  volume={29},
  pages={361-421},
}

@article{howden1970,
  title={The {T}anymecini of the {W}est {I}ndies ({C}oleoptera: {C}urculionidae)},
  author={Howden, Anne T},
  year={1970},
  journal={Contributions of the American Entomological Institute},
  volume={5},
  numer={5},
  pages={1-73},
}

@article{howden1982,
  title={Revision of the {N}ew {W}orld genus \textit{{H}adromeropsis} {P}ierce ({C}oleoptera, {C}urculionidae, {T}anymecini)},
  author={Howden, Anne T},
  year={1982},
  journal={Contributions of the American Entomological Institute},
  volume={19},
  numer={6},
  pages={1-180},
}

@article{howden1995,
  title={Structures related to oviposition in {C}urculionoidea},
  author={Howden, Anne T},
  journal={Memoirs of the Entomological Society of Washington},
  volume={14},
  pages={53-100},
  year={1995},
}

@article{jansen2015,
	author={Michael Andrew Jansen and Nico M. Franz},
	title={Phylogenetic revision of \textit{Minyomerus} {H}orn, 1876 sec. {J}ansen and {F}ranz, 2015 ({C}oleoptera: {C}urculionidae) using taxonomic concept annotations and alignments},
	volume={528},
	number={},
	year={2015},
	doi={10.3897/zookeys.528.6001},
	pages={1-133},
	journal={ZooKeys},
}

@article{marvaldi1997,
  title={Higher level phylogeny of {C}urculionidae ({C}oleoptera: {C}urculionoidea) based mainly on larval characters, with special reference to broad-nosed weevils},
  author={Marvaldi, Adriana E},
  journal={Cladistics},
  volume={13},
  number={4},
  pages={285-312},
  year={1997},
  publisher={Wiley Online Library},
}

@incollection{marvaldi2014,
  title={Entiminae {S}choenherr, 1823},
  author={Marvaldi, A E and Lanteri, A A and del~Río, M G and Oberprieler, R G},
  pages={503–522},
  year={2014},
  editor={Leschen, R A B and Beutel, R G},
  booktitle={Handbook of Zoology: Arthropoda: Insecta: Coleoptera Volume 3: Morphology and Systematics (Phytophaga)},
  publisher={De Gruyter},
  address={Berling, Germany},
  chapter={3.7.5},
}

@article{morimoto2003,
  title={Morphologic characters of the weevil head and phylogenetic implications ({C}oleoptera, {C}urculionoidea)},
  author={Morimoto, Katsura and Kojima, Hiroaki},
  journal={Esakia},
  volume={43},
  pages={133-169},
  year={2003},
}

@book{munz1973,
  title={A {C}alifornian flora (with supplement)},
  author={Munz, P A and Keck, D D},
  year={1973},
  publisher={University of California Press},
  address={Berkeley, California},
}

@article{nixon1993,
  title={On outgroups},
  author={Nixon, Kevin C and Carpenter, James M},
  journal={Cladistics},
  volume={9},
  number={4},
  pages={413-426},
  year={1993},
  publisher={Wiley Online Library},
}

@manual{nixon2002,
  title={WinClada - {V}ersion 1.00. 08},
  author={Nixon, Kevin C},
  year={2002},
  note={http://www.diversityoflife.org/winclada/},
}

@article{oberprieler2007,
  title={Weevils, weevils, weevils everywhere},
  author={Oberprieler, Rolf G and Marvaldi, Adriana E and Anderson, Robert S},
  journal={Zootaxa},
  volume={1668},
  number={1},
  pages={491-520},
  year={2007},
}

@incollection{oberprieler2014,
  title={Curculionoidea {L}atreille, 1802: {I}ntroduction, {P}hylogeny},
  author={Oberprieler, Rolf G and Anderson, Robert S and Marvaldi, Adriana E},
  pages={285-300},
  year={2014},
  editor={Leschen, R A B and Beutel, R G},
  booktitle={Handbook of Zoology: Arthropoda: Insecta: Coleoptera Volume 3: Morphology and Systematics (Phytophaga)},
  publisher={De Gruyter},
  address={Berlin, Germany},
  chapter={3},
}

@book{obrien1982,
  title={Annotated checklist of the weevils ({C}urculionidae sensu lato) of North America, Central America, and the West Indies ({C}oleoptera: {C}urculionoidea)},
  author={O'Brien, Charles W and Wibmer, Guillermo J},
  year={1982},
  publisher={American Entomological Institute},
  address={Ann Arbor, Michigan},
}

@inproceedings{phillips2004,
  title={A maximum entropy approach to species distribution modeling},
  author={Phillips, Steven J and Dud{\'\i}k, Miroslav and Schapire, Robert E},
  booktitle={Proceedings of the 21st International Conference on Machine Learning},
  pages={83-90},
  year={2004},
  organization={ACM},
}

@article{phillips2006,
  title={Maximum entropy modeling of species geographic distributions},
  author={Phillips, Steven J and Anderson, Robert P and Schapire, Robert E},
  journal={Ecological modelling},
  volume={190},
  number={3-4},
  pages={231-259},
  year={2006},
  publisher={Elsevier},
}

@article{qgis2018,
	title={{Quantum GIS Geographic Information System}},
	year={2018},
	author={{Quantum GIS Development Team}},
	journal={Open Source Geospatial Foundation Project},
	note={http://qgis.osgeo.org},
}

@article{rieppel2007,
  title={The performance of morphological characters in broad-scale phylogenetic analyses},
  author={Rieppel, Olivier},
  journal={Biological Journal of the Linnean Society},
  volume={92},
  number={2},
  pages={297-308},
  year={2007},
  publisher={Wiley Online Library},
}

@manual{seinet2018,
	title={{Southwest Environmental Information Network}},
	year={2018},
	author={{SEINet}},
	note={http://swbiodiversity.org/seinet/index.php},
}

@article{thompson1992,
  title={Observations on the morphology and classification of weevils ({C}oleoptera, {C}urculionoidea) with a key to major groups},
  author={Thompson, Richard Thomas},
  journal={Journal of Natural History},
  volume={26},
  number={4},
  pages={835-891},
  year={1992},
  publisher={Taylor \& Francis},
}

@article{ting1936,
  title={The mouth parts of the coleopterous group {R}hynchophora},
  author={Ting, Peter C},
  year={1936},
  journal={Microentomology},
	volume={1},
	pages={93-114},
}

@book{torre1989,
  title={Torre-Bueno glossary of entomology},
  author={de la Torre-Bueno, Jos{\'e} Rollin and Nichols, Stephen W and Tulloch, George S},
  year={1989},
  publisher={New York Entomological Society in cooperation with the American Museum of Natural History},
  address={New York City, New York},
}

@incollection{wheeler2000,
  title={The phylogenetic species concept (\textit{sensu} {W}heeler and {P}latnick)},
  author={Wheeler, Q D and Platnick, N I},
  pages={55-69},
  year={2000},
  editor={Wheeler, Q D and Meier, R},
  booktitle={Species Concepts and Phylogenetic Theory: a Debate},
  publisher={Columbia University Press},
  address={New York City, New York},
}

@article{wilson2010,
  title={Illuminating the lack of consensus among descriptions of earth history data in the North American deserts: a resource for biologists},
  author={Wilson, Joseph S and Pitts, James P},
  journal={Progress in Physical Geography},
  volume={34},
  number={4},
  pages={419-441},
  year={2010},
  publisher={SAGE Publications Sage UK: London, England},
}

@article{fea2016a,
	Author={Franz, Nico M. and Pier, Naomi M. and Reeder, Deeann M. and Chen, Mingmin and Yu, Shizhuo and Kianmajd, Parisa and Bowers, Shawn and Lud{\"a}scher, Bertram},
	Journal={Systematic Biology},
	Number={4},
	Pages={561-582},
	Title={Two influential primate classifications logically aligned},
	Volume={65},
	Year={2016a}
}

@article{fea2016b,
	Author = {Franz, Nico M and Chen, Mingmin and Kianmajd, Parisa and Yu, Shizhuo and Bowers, Shawn and Weakley, Alan S. and Lud{\"a}scher, Bertram},
	Journal = {Semantic Web (IOS)},
	Number = {6},
	Pages = {645-667},
	Title = {Names are not good enough: Reasoning over taxonomic change in the Andropogon complex},
	Volume = {7},
	Year = {2016b}
}

@article{fp2009,
	Author = {Franz, Nico M and Peet, Robert K},
	Journal = {Systematics and Biodiversity},
	Number = {1},
	Pages = {5-20},
	Title = {Towards a language for mapping relationships among taxonomic concepts},
	Volume = {7},
	Year = {2009}
}

@article{chen2014,
	Author = {Chen, Mingmin and Yu, Shizhuo and Franz, Nico and Bowers, Shawn and Lud{\"a}scher, Bertram},
	Journal = {arXiv},
	Number = {1992},
	Pages = {1-8},
	Title = {Euler/X: A toolkit for logic-based taxonomy integration},
	Volume = {1402},
	Year = {2014}
}

@article{fea2018,
	Author = {Franz, Nico M and Musher, Lukas J and Brown, Joseph W and Yu, Shizhuo and hen, Mingmin and Yu, Shizhuo and Lud{\"a}scher, Bertram},
	Journal = {bioRxiv},
	Pages = {1-52},
	Title = {Verbalizing phylogenomic conflict: Representation of node congruence across competing reconstructions of the neoavian explosion},
	Note = {https://doi.org/10.1101/233973},
	Year = {2018}
}

@article{casey1888,
  title={On Some New North American Rhynchophora},
  author={Casey, Thomas L},
  journal={Annals of the New York Academy of Sciences},
  volume={4},
  number={1},
  pages={229--296},
  year={1889},
  publisher={Press of Stettiner, Lambert \& Company}
}

@incollection{horn1876,
  title={{Family V. OTIORHYNCHID{\AE}}},
  author={Horn, George H},
  editor={LeConte, John L and Horn, George H},
  booktitle={The Rhynchophora of America, north of Mexico},
  publisher={Proceedings of the American Philosophical Society},
  volume={15},
  number={96},
  pages={13--112},
  year={1876},
  address={New York City, New York},
}

@article{sleeper1960,
  title={{Notes on the Curculionoidea II: 20. a contribution to the knowledge of the Curculionoidea}},
  author={Sleeper, Elbert L},
  journal={Ohio Journal of Science},
  volume={60},
  number={2},
  pages={83--88},
  year={1960}
}

@book{kissinger1964,
  title={{C}urculionidae of {A}merica North of {M}exico. A Key to the Genera},
  author={Kissinger, D G},
  year={1964},
  publisher={Taxonomic Publications},
  address={South Lancaster, Massachusetts}
}

@article{pierce1909,
  title={Studies of {N}orth {A}merican weevils},
  author={Pierce, W D},
  journal={Proceedings of the United States National Museum},
  volume={37},
  number={1708},
  pages={325--364},
  year={1909}
}

@article{pierce1913,
  title={Miscellaneous contributions to the knowledge of the weevils of the families {A}ttelabidae and {B}rachyrhinidae},
  author={Pierce, W D},
  journal={Proceedings of the United States National Museum},
  volume={45},
  number={1988},
  pages={365--426},
  year={1913}
}

@incollection{say1831,
  title={Descriptions of {N}orth {A}merican {C}urculionides and an arrangement of some of our known species agreeably to the method of {S}choenherr},
  author={Say, Thomas},
  editor={LeConte, John L},
  booktitle={The Complete Writings of Thomas Say on the Entomology of North America},
  publisher={Bailli{\`{e}}re Brothers},
  volume={1},
  pages={1--30},
  year={1831},
  address={London, England},
}

@book{blackwelder1948,
  title={Fifth Supplement, 1939 to 1947 (Inclusive) to the Leng Catalogue of Coleoptera of America, North of Mexico},
  author={Blackwelder, R E and Blackwelder, R M},
  editor={Sherman Jr., John D},
  year={1948},
  address={Mount Vernon, Virginia}
}

@incollection{boheman1833,
  title={{12. T. Microsus}},
  author={Boheman, Carl H},
  editor={Schoenherr, C J},
  booktitle={Genera et species curculionidum, cum synonymia hujus familiae},
  volume={1:2},
  pages={523--524},
  year={1833},
  publisher={Nicolas-Edme Roret},
  address={Paris, France}
}

@book{leconte1859,
  title={The Complete Writings of Thomas Say on the Entomology of North America},
  author={LeConte, John L},
  editor={LeConte, John L and Ord, George},
  year={1859},
  publisher={Bailli{\`{e}}re Brothers},
  address={London, England}
}

@article{leconte1876,
  title={The {R}hynchophora of {A}merica, north of {M}exico},
  author={LeConte, John L, and Horn, George H},
  journal={Proceedings of the American Philosophical Society},
  volume={15},
  number={96},
  pages={1--455},
  year={1876}
}

@incollection{sharp1891,
  title={{Coleoptera. Rhynchophora. Curculionidae. Attelabinae, Pterocolinae, Allocoryninae, Apioninae, Thecesterninae, Otiorhynchinae [part, ``Apterae'']}},
  author={Sharp, D},
  editor={Sharp, D and Champion, George C},
  booktitle={Biologia Centrali-Americana},
  volume={4:3},
  pages={87--177},
  year={1891},
  address={London, England}
}

@article{green1920,
  title={{Notes on American Rhynchophora (Col.)}},
  author={Green, J W},
  journal={Entomological News},
  volume={31},
  pages={193--201},
  year={1920}
}

repository: entojansen/minyomerus

repo_name: entojansen/minyomerus


text:
DESCRIPTION = "7-zip is a commandline utility handling 7z archives."

PR = "r0"

LICENSE = "LGPL-2.1+"
LIC_FILES_CHKSUM = "file://DOCS/copying.txt;md5=ecfc54c9e37b63ac58900061ce2eab5a \
                    file://DOCS/License.txt;md5=87cd66bd5ea9bff75753c9fbbecc5073 \
                    "

inherit debian-package

# The default makefile sets compiler to gcc and g++.
# We need change them to ${CXX} and ${CC} for cross-compiling
SRC_URI += "file://do-not-override-compiler.patch"

DEBIAN_PATCH_TYPE = "quilt"

# all3: to build bin/7za, bin/7z (with its plugins), bin/7zr and bin/7zCon.sfx
EXTRA_OEMAKE = "all3"

do_compile_prepend() {
	sed -i -e "s@##CXX##@${CXX}@g" \
	       -e "s@##CC##@${CC}@g" \
	       ${S}/makefile.machine
}

do_install() {
        install -d ${D}${bindir}
        install -d ${D}${libdir}/p7zip

	install -m 0755 ${S}/bin/7zr ${D}${libdir}/p7zip
	install -m 0755 ${S}/debian/scripts/p7zip ${D}${bindir}
	install -m 0755 ${S}/debian/scripts/7zr ${D}${bindir}

        install -m 0755 ${S}/bin/7z ${D}${libdir}/p7zip
        install -m 0755 ${S}/bin/7zCon.sfx ${D}${libdir}/p7zip
        install -m 0755 ${S}/bin/7za ${D}${libdir}/p7zip
        install -m 0755 ${S}/bin/7z.so ${D}${libdir}/p7zip
        install -m 0755 ${S}/debian/scripts/7z ${D}${bindir}
        install -m 0755 ${S}/debian/scripts/7za ${D}${bindir}
}

PACKAGES =+ "${PN}-full"
FILES_${PN} += "${libdir}/p7zip/7zr"
FILES_${PN}-full = "${libdir}/p7zip/7z \
                    ${libdir}/p7zip/7zCon.sfx \
                    ${libdir}/p7zip/7za \
                    ${libdir}/p7zip/7z.so \
                    ${bindir}/7z \
                    ${bindir}/7za \
                    "

RRECOMMENDS_${PN} += "${PN}-full"

repository: nghiaht-tsdv/meta-debian

repo_name: nghiaht-tsdv/meta-debian

branch_name: refs/heads/jethro


text:
package main

import (
	"fmt"
)

type A interface {
	Run()
}

type B struct {
	A `json:"-"`
	Name string
}

func (this *B) Run() {

}

func main() {
	var a byte = 100

	s := fmt.Sprintf("%d", a)
	fmt.Println([]byte(s))
	fmt.Println(s)
}

repository: app-projects/modbus-all-about

repo_name: app-projects/modbus-all-about


text:
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SUMMARY = "Stratum binary install from provided .deb files"
LICENSE = "CLOSED"

SRC_URI = "https://github.com/stratum/stratum/releases/download/2021-03-31/stratum-bfrt-21.03-9.4.0-amd64.deb \
file://stratum.conf"

SRC_URI[sha256sum] = "1901a13c8c68d990bd7392a8adf5626fef61b91f71f569fe5163c579ab352eb9"

do_compile[noexec] = "1"
do_configure[nostamp] += "1"

INSANE_SKIP_${PN} = "already-stripped file-rdeps libdir dev-so"
INSANE_SKIP_${PN}-dev += "dev-elf dev-so"

RDEPENDS_${PN} = " \
    barefoot-bsp \
    bf-drivers \
    bf-kdrv \
    bf-syslibs \
    bf-utils \
    boost \
    boost-thread \
    bzip2 \
    grpc \
    judy \
    kmod \
    libedit \
    openssl \
    pi \
    procps \
    python3 \
    systemd \
"

do_configure () {
    [ -d ${S} ] || mkdir -p ${S}
    cd ${S}
    ar x ${DL_DIR}/stratum-bfrt-21.03-9.4.0-amd64.deb
    tar xf data.tar.bz2
}

do_install () {
    install -d ${D}${bindir}
    cp -r ${S}/usr/bin/* ${D}${bindir}

    install -d ${D}${sysconfdir}/stratum/
    cp -r ${S}/etc/stratum/* ${D}${sysconfdir}/stratum/

    install -d ${D}${libdir}/systemd/system/
    cp -r ${S}/usr/lib/systemd/system/* ${D}${libdir}/systemd/system/

    install -d ${D}/opt/usr/lib/
    cp -r ${S}/usr/lib/* ${D}/opt/usr/lib/

    install -d ${D}${datadir}/tofino_sds_fw/
    cp -r ${S}/usr/share/tofino_sds_fw ${D}${datadir}/tofino_sds_fw/
    install -d ${D}${datadir}/stratum
    cp -r ${S}/usr/share/stratum ${D}${datadir}

    install -d ${D}/lib64
    cd ${D}/lib64
    ln -s ../lib/ld-linux-x86-64.so.2 ld-linux-x86-64.so.2
    install -d ${D}/etc/ld.so.conf.d/
    install -m 0755 ${WORKDIR}/stratum.conf ${D}/etc/ld.so.conf.d/
}

FILES_${PN} += " \
    ${bindir} \
    ${sysconfdir}/stratum \
    ${sysconfdir}/ld.so.conf.d/stratum.conf \
    ${libdir}/systemd/system \
    ${datadir}/tofino_sds_fw \
    ${datadir}/stratum \
    /opt \
    /lib64 \
"

repository: NetworkGradeLinux/meta-mion

repo_name: NetworkGradeLinux/meta-mion

branch_name: refs/heads/dunfell

gha_license_id: MIT


text:
package main

import (
	"flag"
	"os"

	"github.com/ecator/gomeeting/fun"
	"github.com/ecator/gomeeting/server"
)

var (
	flagAddr     string
	flagPort     uint
	flagHelp     bool
	flagConfig   string
	flagFrontend string
	flagLog      string
)

func init() {
	flag.StringVar(&flagAddr, "a", "localhost", "The listen address")
	flag.UintVar(&flagPort, "p", 7728, "The listen port")
	flag.BoolVar(&flagHelp, "h", false, "Show usage")
	flag.StringVar(&flagConfig, "c", "config.yml", "The config file")
	flag.StringVar(&flagFrontend, "f", "assets", "The assets folder includes html/css/js")
	flag.StringVar(&flagLog, "l", "server.log", "The log file")
}

func main() {
	flag.Parse()
	if flagHelp {
		flag.Usage()
		os.Exit(0)
	}

	flagFrontend = fun.ToAbs(flagFrontend)
	// frontend folder must exsit
	if _, err := os.Stat(flagFrontend); err != nil {
		panic(err)
	}
	flagLog = fun.ToAbs(flagLog)
	server.StartServer(flagAddr, flagPort, flagFrontend, flagConfig, flagLog)
}

repository: ecator/gomeeting

repo_name: ecator/gomeeting


text:
@INPROCEEDINGS{8743174,
	author={Iskender, Neslihan and Gabryszak, Aleksandra and Polzehl, Tim and Hennig, Leonhard and Möller, Sebastian},
	booktitle={2019 Eleventh International Conference on Quality of Multimedia Experience (QoMEX)},
	title={A Crowdsourcing Approach to Evaluate the Quality of Query-based Extractive Text Summaries},
	year={2019},
	volume={},
	number={},
	pages={1-3},
	doi={10.1109/QoMEX.2019.8743174}
}

branch_name: refs/heads/src

gha_language: TeX


text:
@incollection{liu2007distraction,
year={2007},
isbn={978-3-540-73330-0},
booktitle={Engineering Psychology and Cognitive Ergonomics},
volume={4562},
series={Lecture Notes in Computer Science},
editor={Harris, Don},
doi={10.1007/978-3-540-73331-7\_40},
title={How Does Distraction Task Influence the Interaction of Working Memory and Long-Term Memory?},
url={http://dx.doi.org/10.1007/978-3-540-73331-7\_40},
publisher={Springer Berlin Heidelberg},
keywords={working memory; availability of long-term memory; semantic activation; semantic priming},
author={Liu, Ye and Fu, Xiaolan},
pages={366-374},
language={English}
}

@inproceedings{ratner1986finding,
  title={Finding a Shortest Solution for the {$N \times N$} Extension of the 15-PUZZLE Is Intractable.},
  author={Ratner, Daniel and Warmuth, Manfred K},
  booktitle={AAAI},
  pages={168--172},
  year={1986}
}


text:
package models

import (
	"fmt"
	"time"

	"github.com/jinzhu/gorm"
	"github.com/qor/transition"
	"github.com/sunwukonga/paypal-qor-admin/config"
	//	"github.com/sunwukonga/paypal-qor-admin/app/models"
)

const (
	stateDraft      string = "draft"
	stateActive     string = "active"
	stateCancelled  string = "cancelled"
	stateUnpaid     string = "unpaid"
	stateEOT        string = "eot"
	EventSignup     string = "signup"
	EventSignunpaid string = "signunpaid"
	EventPayment    string = "payment"
	EventReverse    string = "reverse"
	EventFail       string = "fail"
	EventCancel     string = "cancel"
	EventEOT        string = "endterm"
)

type Subscription struct {
	gorm.Model
	UserID       uint
	User         User `gorm:"save_associations:false"`
	InfluencerID uint
	Influencer   User `gorm:"save_associations:false"`

	//SubscrPayments []PaypalPayment `gorm:"foreignkey:SubscrID;AssociationForeignKey:SubscrID"`
	SubscrPayments []PaypalPayment `gorm:"ForeignKey:SubscrID"`

	SubscrID   string
	RecurTimes int
	Period     string
	SubscrDate time.Time

	CancelledAt time.Time
	EotAt       time.Time
	transition.Transition
}

type PaypalPayment struct {
	gorm.Model
	UserID       uint
	User         User `gorm:"save_associations:false"`
	InfluencerID uint
	Influencer   User `gorm:"save_associations:false"`

	TxnID         string
	SubscrID      string
	McCurrency    string
	McGross       float32
	McFee         float32
	PaymentStatus string
}

type PaypalPayer struct {
	gorm.Model
	PayerID string `sql:"size:13" gorm:"not null;unique;"`
	UserID  uint
	User    User
}

func (payment PaypalPayment) Net() float32 {
	return payment.McGross - payment.McFee
}

// NewPaypalPayer Create new PaypalPayer with PayerID, or fetch existing PaypalPayer
func NewPaypalPayer(payer string, db *gorm.DB) *PaypalPayer {
	// Check if PayerID exists in db "paypal_payment"
	paypalPayer := &PaypalPayer{}
	if err := db.Where("payer_id = ?", payer).First(paypalPayer).Error; err != nil {
		if err.Error() == "record not found" {
			// Populate a new one
			paypalPayer.PayerID = payer
			//		paypalPayer.User = User{}
		} else {
			// We have a real error...
			fmt.Printf("While creating New PaypalPayer: %v\n", err.Error())
			return nil
		}
	} else {
		//We found a PaypalPayer with this PayerID, he or she already exists in our database.
	}
	return paypalPayer

}

// NewSubscription Creat Subscription based on coupon and PaypalPayer
func NewSubscription(coupon string, paypalPayer *PaypalPayer, db *gorm.DB) *Subscription {
	var influencerCoupon InfluencerCoupon
	subscription := Subscription{}
	if len(coupon) == 6 {
		if err := db.First(&influencerCoupon, "code = ?", coupon).Error; err != nil {
			if err.Error() == "record not found" {
				// We have a problem. The coupon was not found, which should be impossible.
				fmt.Printf("While creating New Subscription, coupon not found: %v\n", err.Error())
			} else {
				// We have a real error...
				fmt.Printf("While creating New Subscription: %v\n", err.Error())
			}
		} else {
			// found it! Set InfluencerID
			subscription.InfluencerID = influencerCoupon.UserID
		}
	} else {
		// Not a valid coupon, leave the InfluencerID empty.
	}

	subscription.UserID = paypalPayer.UserID
	SubscriptionState.Trigger(EventSignunpaid, &subscription, db)
	return &subscription
}

// NewPaypalPayment Creat PaypalPayment based on coupon and PaypalPayer
func NewPaypalPayment(coupon string, paypalPayer *PaypalPayer, db *gorm.DB) *PaypalPayment {
	var influencerCoupon InfluencerCoupon
	paypalPayment := PaypalPayment{}
	if len(coupon) == 6 {
		if err := db.First(&influencerCoupon, "code = ?", coupon).Error; err != nil {
			if err.Error() == "record not found" {
				// We have a problem. The coupon was not found, which should be impossible.
				fmt.Printf("While creating New Subscription, coupon not found: %v\n", err.Error())
			} else {
				// We have a real error...
				fmt.Printf("While creating New Subscription: %v\n", err.Error())
			}
		} else {
			// found it! Set InfluencerID
			paypalPayment.InfluencerID = influencerCoupon.UserID
		}
	} else {
		// Not a valid coupon, leave the InfluencerID empty.
	}

	paypalPayment.UserID = paypalPayer.UserID
	return &paypalPayment
}

var (
	SubscriptionState = transition.New(&Subscription{})
)

func init() {
	// Define Subscription's States
	SubscriptionState.Initial(stateDraft)
	SubscriptionState.State(stateActive)
	SubscriptionState.State(stateCancelled).Enter(func(value interface{}, tx *gorm.DB) error {
		// Need to move EotAt calculation in here.
		subscription := Subscription{CancelledAt: time.Now().In(config.SGT)}
		subscription.SetState(stateCancelled)
		return tx.Model(value).UpdateColumns(subscription).Error
	})
	SubscriptionState.State(stateUnpaid)
	SubscriptionState.State(stateEOT)

	// Define Subscription's Events
	SubscriptionState.Event(EventSignup).To(stateActive).From(stateUnpaid).After(func(value interface{}, tx *gorm.DB) error {
		subscription := value.(*Subscription)
		subscription.SetState(stateActive)
		return tx.Model(value).UpdateColumns(subscription).Error
	})
	signUnpaidEvent := SubscriptionState.Event(EventSignunpaid)
	signUnpaidEvent.To(stateUnpaid).From(stateUnpaid).After(func(value interface{}, tx *gorm.DB) error {
		subscription := value.(*Subscription)
		subscription.SetState(stateUnpaid)
		return tx.Model(value).UpdateColumns(subscription).Error
	})
	signUnpaidEvent.To(stateUnpaid).From(stateDraft).After(func(value interface{}, tx *gorm.DB) error {
		subscription := value.(*Subscription)
		subscription.SetState(stateUnpaid)
		return tx.Create(subscription).Error
	})

	paymentEvent := SubscriptionState.Event(EventPayment)
	paymentEvent.To(stateActive).From(stateDraft)
	paymentEvent.To(stateActive).From(stateActive)
	paymentEvent.To(stateActive).From(stateUnpaid)

	SubscriptionState.Event(EventCancel).To(stateCancelled).From(stateActive) // Don't include `From("unpaid")`, as I don't want to lose that info.
	SubscriptionState.Event(EventFail).To(stateUnpaid).From(stateActive, stateUnpaid)
	SubscriptionState.Event(EventEOT).To(stateEOT).From(stateActive, stateUnpaid, stateCancelled)

}

repository: sunwukonga/paypal-qor-admin

repo_name: sunwukonga/paypal-qor-admin


text:
//File  : demo07_struct_anonymous.go
//Author: duanhaobin
//Date  : 2020/4/29

package main

import "fmt"

func main() {
	/*
		匿名结构体和匿名字段：

			匿名结构体：没有名字的结构体，
				在创建匿名结构体时，同时创建对象
				变量名 := struct{
					定义字段Field
				}{
					字段进行赋值
				}

			匿名字段：一个结构体的字段没有字段名

	*/
	s1 := Student{name: "张三", age: 18}
	fmt.Println(s1.name, s1.age)

	// 创建一个匿名函数
	func() {
		fmt.Println("hello world...")
	}()

	// 创建一个匿名结构体，在创建时就会初始化，一般作用不大。了解这个语法即可
	s2 := struct {
		name string
		age  int
	}{}
	fmt.Println(s2.name, s2.age)

	bob := Worker{"Bob", 22}
	fmt.Println(bob)
	fmt.Println(bob.string)
	fmt.Println(bob.int)
}

type Worker struct {
	string //匿名字段
	int    //匿名字段，默认使用数据类型作为名字，那么匿名字段的类型就不能重复，否则会冲突
	//string
}

type Student struct {
	name string
	age  int
}

repository: hbinr/Golang-Learning

repo_name: hbinr/Golang-Learning


text:
// Problem 9.8

package chapter9

type TreeNode struct {
	Value string
	Left  *TreeNode
	Right *TreeNode
}

func ReconstructBinaryTreePreInOrders(pre, in []string) *TreeNode {
	indexInSlice := func(val string, slice []string) int {
		for i, v := range slice {
			if v == val {
				return i
			}
		}
		return -1
	}

	if len(pre) == 0 {
		return nil
	} else {
		mid := indexInSlice(pre[0], in)

		n := new(TreeNode)
		n.Value = pre[0]
		n.Left = ReconstructBinaryTreePreInOrders(pre[1:mid+1], in[:mid])
		n.Right = ReconstructBinaryTreePreInOrders(pre[mid+1:], in[mid+1:])
		return n
	}
}