text:
package command

import (
	"fmt"
	"strconv"
	"strings"

	"github.com/dustin/go-humanize"
	"github.com/labstack/gommon/color"
	"github.com/urfave/cli/v2"

	"github.com/kohkimakimoto/hq/internal/structs"
)

var ListCommand = &cli.Command{
	Name:      "list",
	Usage:     `Lists jobs`,
	ArgsUsage: `[<job_id...>]`,
	Action:    listAction,
	Flags: []cli.Flag{
		addressFlag,
		&cli.BoolFlag{
			Name:  "quiet, q",
			Usage: "Only display IDs",
		},
		&cli.StringFlag{
			Name:  "name, n",
			Usage: "Specifies a regular expression `STRING` to filter the jobs with job's name",
		},
		&cli.StringFlag{
			Name:  "term, t",
			Usage: "Specifies a regular expression `STRING` to filter the jobs with job's name, comment, url or status",
		},
		&cli.BoolFlag{
			Name:  "reverse, r",
			Usage: "Sort by descending ID.",
		},
		&cli.Uint64Flag{
			Name:  "begin, b",
			Usage: "Load the jobs from `ID`.",
		},
		&cli.IntFlag{
			Name:  "limit, l",
			Usage: "Only display `N` job(s).",
		},
		&cli.BoolFlag{
			Name:  "detail, d",
			Usage: "Display detail info.",
		},
		&cli.StringFlag{
			Name:  "status, s",
			Usage: "Specifies `STATUS` to filter the jobs with job's status ('running|waiting|canceling|failure|success|canceled|unfinished|unknown')",
		},
	},
}

func listAction(ctx *cli.Context) error {
	c := newClient(ctx)

	ids := []string{}
	if ctx.NArg() > 0 {
		ids = ctx.Args().Slice()
	}

	quiet := ctx.Bool("quiet")
	detail := ctx.Bool("detail")

	jobs := []*structs.Job{}

	if len(ids) == 0 {
		payload := &structs.ListJobsRequest{
			Name:    ctx.String("name"),
			Term:    ctx.String("term"),
			Reverse: ctx.Bool("reverse"),
			Limit:   ctx.Int("limit"),
			Status:  ctx.String("status"),
		}

		if ctx.Uint64("begin") != 0 {
			b := ctx.Uint64("begin")
			payload.Begin = &b
		}

		list, err := c.ListJobs(payload)
		if err != nil {
			return err
		}
		jobs = list.Jobs
	} else {
		for _, idstr := range ids {
			id, err := strconv.ParseUint(idstr, 10, 64)
			if err != nil {
				return err
			}
			job, err := c.GetJob(id)
			if err != nil {
				return err
			}

			jobs = append(jobs, job)
		}
	}

	t := newTabby(ctx.App.Writer)

	if !quiet {
		if detail {
			t.AddLine("ID", "NAME", "COMMENT", "URL", "CREATED", "STARTED", "FINISHED", "DURATION", "STATUS")
		} else {
			t.AddLine("ID", "NAME", "CREATED", "DURATION", "STATUS")
		}
	}

	for _, job := range jobs {
		if quiet {
			t.AddLine(job.ID)
			continue
		}

		status := job.Status()
		switch status {
		case "failure":
			status = color.Red(status)
		case "success":
			status = color.Green(status)
		case "running":
			status = color.Cyan(status)
		case "waiting":
			status = color.Reset(status)
		case "canceled":
			status = color.Grey(status)
		case "canceling":
			status = color.Grey(status)
		case "unfinished":
			status = color.Dim(status)
		case "unknown":
			status = color.Yellow(status)
		}

		createdAt := humanize.Time(job.CreatedAt)
		finishedAt := ""
		startedAt := ""
		duration := ""
		if job.StartedAt != nil {
			startedAt = humanize.Time(*job.StartedAt)
		}
		if job.FinishedAt != nil {
			finishedAt = humanize.Time(*job.FinishedAt)
		}
		if job.StartedAt != nil && job.FinishedAt != nil {
			duration = fmt.Sprintf("%v", job.FinishedAt.Sub(*job.StartedAt))
		}

		comment := strings.Replace(job.Comment, "\n", " ", -1)
		if detail {
			t.AddLine(job.ID, job.Name, comment, job.URL, createdAt, startedAt, finishedAt, duration, status)
		} else {
			t.AddLine(job.ID, job.Name, createdAt, duration, status)
		}
	}

	t.Print()
	return nil
}

repository: kohkimakimoto/hq

repo_name: kohkimakimoto/hq


text:
#include <cstdio>
#include <vector>

long findPair(long x){
    long k(1), y(x);
    while(y){y /= 2; k *= 2;}
    return k - x - 1;
}

int main(){

    long long n; scanf("%lld\n", &n);
    std::vector<long> p(n + 1, 0);
    for(long u = n; u >= 0; u--){
        if(p[u] != 0){continue;}
        long r = findPair(u);
        p[r] = u; p[u] = r;
    }

    printf("%lld\n", n * (n + 1));
    for(long u = 0; u <= n; u++){printf("%ld ", p[u]);}
    puts("");

    return 0;
}

license: MIT

repository: adityanjr/code-DS-ALGO

license_type: permissive

repo_name: adityanjr/code-DS-ALGO

branch_name: refs/heads/master

gha_license_id: MIT

extension: cpp


text:
DESCRIPTION = "Perl module from net-snmp"
SECTION = "libs"
LICENSE = "BSD"
DEPENDS = "net-snmp"
PR = "r0"

SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz"

S = "${WORKDIR}/net-snmp-${PV}/perl"

inherit cpan

EXTRA_CPANFLAGS = "-NET-SNMP-CONFIG=\"sh ${STAGING_BINDIR}/net-snmp-config\""

SRC_URI[md5sum] = "984932520143f0c8bf7b7ce1fc9e1da1"
SRC_URI[sha256sum] = "11a8baf167f7bfff60d2590e050991400a3a082923dbcdbf85e0e0ce46eb247c"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD

extension: bb


text:
SUMMARY = "Miscellaneous files for BoxSoc initial subsystem"
DESCRIPTION = "The rc.initial files package creates the initial menu option for BoxSoc"
SECTION = "base"
LICENSE = "CLOSED"
PV = "1.0.0"
PR = "r.4"

SRC_URI = "file://rc.initial \
           file://rc.initial.toggle_ips \
           file://rc.initial.ping \
           file://rc.initial.showports \
           file://rc.initial.toggle_sshd \
           file://rc.initial.setinterfaceip \
           file://rc.initial.config \
           file://initial_run.sh \
          "

do_compile() {
}

do_install() {
    install -d ${D}${sysconfdir}
    install -c -m 0755 ${WORKDIR}/rc.initial ${D}${sysconfdir}/rc.initial
    install -c -m 0755 ${WORKDIR}/rc.initial.toggle_ips ${D}${sysconfdir}/rc.initial.toggle_ips
    install -c -m 0755 ${WORKDIR}/rc.initial.ping ${D}${sysconfdir}/rc.initial.ping
    install -c -m 0755 ${WORKDIR}/rc.initial.showports ${D}${sysconfdir}/rc.initial.showports
    install -c -m 0755 ${WORKDIR}/rc.initial.setinterfaceip ${D}${sysconfdir}/rc.initial.setinterfaceip
    install -c -m 0755 ${WORKDIR}/rc.initial.toggle_sshd ${D}${sysconfdir}/rc.initial.toggle_sshd
    install -c -m 0755 ${WORKDIR}/rc.initial.config ${D}${sysconfdir}/rc.initial.config
    install -d ${D}${sysconfdir}/profile.d
    install -c -m 0755 ${WORKDIR}/initial_run.sh ${D}${sysconfdir}/profile.d/initial_run.sh
}

INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INSANE_SKIP_${PN} += "already-stripped ldflags host-user-contaminated libdir arch"

repository: SrijanNandi/meta-boxsoc

repo_name: SrijanNandi/meta-boxsoc


text:
package handler

import (
	"fgame/fgame/common/lang"
	"fgame/fgame/game/gm/command"
	gmcommandtypes "fgame/fgame/game/gm/command/types"
	"fgame/fgame/game/player"
	playerlogic "fgame/fgame/game/player/logic"
	"fgame/fgame/game/player/types"
	"fgame/fgame/game/scene/scene"
	playershenyu "fgame/fgame/game/shenyu/player"
	"strconv"

	log "github.com/Sirupsen/logrus"
)

func init() {
	command.Register(gmcommandtypes.CommandTypeShenYuKey, command.CommandHandlerFunc(handleShenYuKey))
}

func handleShenYuKey(p scene.Player, c *command.Command) (err error) {
	pl := p.(player.Player)
	if len(c.Args) <= 0 {
		playerlogic.SendSystemMessage(pl, lang.GMFormatWrong)
		return
	}
	keyStr := c.Args[0]
	shenYuKey, err := strconv.ParseInt(keyStr, 10, 64)
	if err != nil {
		log.WithFields(
			log.Fields{
				"id":        pl.GetId(),
				"shenYuKey": shenYuKey,
				"error":     err,
			}).Warn("gm:处理设置神域钥匙,shenYuKey不是数字")
		playerlogic.SendSystemMessage(pl, lang.GMFormatWrong)
		err = nil
		return
	}

	manager := pl.GetPlayerDataManager(types.PlayerShenYuDataManagerType).(*playershenyu.PlayerShenYuDataManager)
	manager.GMSetKeyNum(int32(shenYuKey))
	return
}

repository: rebider/Fgame

repo_name: rebider/Fgame

extension: go


text:
package wantlist

import (
	"testing"

	pb "github.com/ipfs/go-bitswap/message/pb"
	cid "github.com/ipfs/go-cid"
)

var testcids []cid.Cid

func init() {
	strs := []string{
		"QmQL8LqkEgYXaDHdNYCG2mmpow7Sp8Z8Kt3QS688vyBeC7",
		"QmcBDsdjgSXU7BP4A4V8LJCXENE5xVwnhrhRGVTJr9YCVj",
		"QmQakgd2wDxc3uUF4orGdEm28zUT9Mmimp5pyPG2SFS9Gj",
	}
	for _, s := range strs {
		c, err := cid.Decode(s)
		if err != nil {
			panic(err)
		}
		testcids = append(testcids, c)
	}

}

type wli interface {
	Contains(cid.Cid) (Entry, bool)
}

func assertHasCid(t *testing.T, w wli, c cid.Cid) {
	e, ok := w.Contains(c)
	if !ok {
		t.Fatal("expected to have ", c)
	}
	if !e.Cid.Equals(c) {
		t.Fatal("returned entry had wrong cid value")
	}
}

func TestBasicWantlist(t *testing.T) {
	wl := New()

	if !wl.Add(testcids[0], 5, pb.Message_Wantlist_Block) {
		t.Fatal("expected true")
	}
	assertHasCid(t, wl, testcids[0])
	if !wl.Add(testcids[1], 4, pb.Message_Wantlist_Block) {
		t.Fatal("expected true")
	}
	assertHasCid(t, wl, testcids[0])
	assertHasCid(t, wl, testcids[1])

	if wl.Len() != 2 {
		t.Fatal("should have had two items")
	}

	if wl.Add(testcids[1], 4, pb.Message_Wantlist_Block) {
		t.Fatal("add shouldnt report success on second add")
	}
	assertHasCid(t, wl, testcids[0])
	assertHasCid(t, wl, testcids[1])

	if wl.Len() != 2 {
		t.Fatal("should have had two items")
	}

	if !wl.RemoveType(testcids[0], pb.Message_Wantlist_Block) {
		t.Fatal("should have gotten true")
	}

	assertHasCid(t, wl, testcids[1])
	if _, has := wl.Contains(testcids[0]); has {
		t.Fatal("shouldnt have this cid")
	}
}

func TestAddHaveThenBlock(t *testing.T) {
	wl := New()

	wl.Add(testcids[0], 5, pb.Message_Wantlist_Have)
	wl.Add(testcids[0], 5, pb.Message_Wantlist_Block)

	e, ok := wl.Contains(testcids[0])
	if !ok {
		t.Fatal("expected to have ", testcids[0])
	}
	if e.WantType != pb.Message_Wantlist_Block {
		t.Fatal("expected to be ", pb.Message_Wantlist_Block)
	}
}

func TestAddBlockThenHave(t *testing.T) {
	wl := New()

	wl.Add(testcids[0], 5, pb.Message_Wantlist_Block)
	wl.Add(testcids[0], 5, pb.Message_Wantlist_Have)

	e, ok := wl.Contains(testcids[0])
	if !ok {
		t.Fatal("expected to have ", testcids[0])
	}
	if e.WantType != pb.Message_Wantlist_Block {
		t.Fatal("expected to be ", pb.Message_Wantlist_Block)
	}
}

func TestAddHaveThenRemoveBlock(t *testing.T) {
	wl := New()

	wl.Add(testcids[0], 5, pb.Message_Wantlist_Have)
	wl.RemoveType(testcids[0], pb.Message_Wantlist_Block)

	_, ok := wl.Contains(testcids[0])
	if ok {
		t.Fatal("expected not to have ", testcids[0])
	}
}

func TestAddBlockThenRemoveHave(t *testing.T) {
	wl := New()

	wl.Add(testcids[0], 5, pb.Message_Wantlist_Block)
	wl.RemoveType(testcids[0], pb.Message_Wantlist_Have)

	e, ok := wl.Contains(testcids[0])
	if !ok {
		t.Fatal("expected to have ", testcids[0])
	}
	if e.WantType != pb.Message_Wantlist_Block {
		t.Fatal("expected to be ", pb.Message_Wantlist_Block)
	}
}

func TestAddHaveThenRemoveAny(t *testing.T) {
	wl := New()

	wl.Add(testcids[0], 5, pb.Message_Wantlist_Have)
	wl.Remove(testcids[0])

	_, ok := wl.Contains(testcids[0])
	if ok {
		t.Fatal("expected not to have ", testcids[0])
	}
}

func TestAddBlockThenRemoveAny(t *testing.T) {
	wl := New()

	wl.Add(testcids[0], 5, pb.Message_Wantlist_Block)
	wl.Remove(testcids[0])

	_, ok := wl.Contains(testcids[0])
	if ok {
		t.Fatal("expected not to have ", testcids[0])
	}
}

func TestAbsort(t *testing.T) {
	wl := New()
	wl.Add(testcids[0], 5, pb.Message_Wantlist_Block)
	wl.Add(testcids[1], 4, pb.Message_Wantlist_Have)
	wl.Add(testcids[2], 3, pb.Message_Wantlist_Have)

	wl2 := New()
	wl2.Add(testcids[0], 2, pb.Message_Wantlist_Have)
	wl2.Add(testcids[1], 1, pb.Message_Wantlist_Block)

	wl.Absorb(wl2)

	e, ok := wl.Contains(testcids[0])
	if !ok {
		t.Fatal("expected to have ", testcids[0])
	}
	if e.Priority != 5 {
		t.Fatal("expected priority 5")
	}
	if e.WantType != pb.Message_Wantlist_Block {
		t.Fatal("expected type ", pb.Message_Wantlist_Block)
	}

	e, ok = wl.Contains(testcids[1])
	if !ok {
		t.Fatal("expected to have ", testcids[1])
	}
	if e.Priority != 1 {
		t.Fatal("expected priority 1")
	}
	if e.WantType != pb.Message_Wantlist_Block {
		t.Fatal("expected type ", pb.Message_Wantlist_Block)
	}

	e, ok = wl.Contains(testcids[2])
	if !ok {
		t.Fatal("expected to have ", testcids[2])
	}
	if e.Priority != 3 {
		t.Fatal("expected priority 3")
	}
	if e.WantType != pb.Message_Wantlist_Have {
		t.Fatal("expected type ", pb.Message_Wantlist_Have)
	}
}

func TestSortEntries(t *testing.T) {
	wl := New()

	wl.Add(testcids[0], 3, pb.Message_Wantlist_Block)
	wl.Add(testcids[1], 5, pb.Message_Wantlist_Have)
	wl.Add(testcids[2], 4, pb.Message_Wantlist_Have)

	entries := wl.Entries()
	SortEntries(entries)

	if !entries[0].Cid.Equals(testcids[1]) ||
		!entries[1].Cid.Equals(testcids[2]) ||
		!entries[2].Cid.Equals(testcids[0]) {
		t.Fatal("wrong order")
	}
}


text:
require ../binutils/binutils.inc

PR = "r2"

RCONFLICTS_${PN} = "binutils"
RREPLACES_${PN} = "binutils"

SRC_URI = \
    "${KERNELORG_MIRROR}/pub/linux/devel/binutils/binutils-${PV}.tar.bz2 \
     file://binutils-2.16.91.0.6-objcopy-rename-errorcode.patch \
     file://binutils-uclibc-100-uclibc-conf.patch \
     file://binutils-configure-texinfo-version.patch \
     file://110-arm-eabi-conf.patch \
     file://binutils-uclibc-300-001_ld_makefile_patch.patch \
     file://binutils-uclibc-300-006_better_file_error.patch \
     file://binutils-uclibc-300-012_check_ldrunpath_length.patch \
     "

EXTRA_OECONF = "--with-sysroot=${TOOLCHAIN_PATH}/${TARGET_SYS} \
		--program-prefix=${TARGET_PREFIX} --disable-shared"

HOST_SYS = "${BUILD_SYS}"

do_configure () {
    CC=gcc AS=as LD=ld CXX=g++ AR=ar OBJCOPY=objcopy OBJDUMP=objdump RANLIB=ranlib NM=nm STRIP=strip oe_runconf
}

do_compile() {
    make configure-host
    make LDFLAGS=\"-all-static\"
}

do_stage() {
    :
}

SRC_URI[md5sum] = "00eccd47e19a9f24410a137a849aa3fc"
SRC_URI[sha256sum] = "bbfa06ee0173c5e9ae65ff14ba29502ddf4e355ac3419f88e3346299cfaf4e19"


text:
@misc{conveyor,
    title="Параллельная обработка данных",
    howpublished="Режим доступа: \url{https://parallel.ru/vvv/lec1.html} (дата обращения: 12.11.2020)"
}

@article{rabink,
    author = "Rabin M. O., Karp R. M.",
    title = "Efficient randomized pattern-matching algorithms",
    journal = "IBM Journal of Research and Development",
    pages = "249–260",
    year = "1987"
}

@misc{rusttest,
	title="Документация по ЯП Rust: бенчмарки [Электронный ресурс]",
	howpublished="Режим доступа: \url{https://doc.rust-lang.org/1.7.0/book/benchmark-tests.html} (дата обращения: 10.10.2020)"
}

@misc{manjaro,
	title="Manjaro -- enjoy the simplicity [Электронный ресурс]",
	howpublished="Режим доступа: \url{https://manjaro.org/} (дата обращения: 10.10.2020)"
}

@misc{linux,
	title="Русская информация об ОС Linux [Электронный ресурс]",
	howpublished="Режим доступа: \url{https://www.linux.org.ru/} (дата обращения: 10.10.2020)"
}

@misc{intel,
	title="Процессор Intel® Core™ i7-8550U [Электронный ресурс]",
	howpublished="Режим доступа: \url{https://ark.intel.com/content/www/ru/ru/ark/products/122589/intel-core-i7-8550u-processor-8m-cache-up-to-4-00-ghz.html} (дата обращения: 10.10.2020)"
}
@misc{
	rustlang,
	title="Rust Programming Language [Электронный ресурс].",
	howpublished="URL: \url{https://doc.rust-lang.org/std/index.html}",
}

repository: Justarone/bmstu-aa

repo_name: Justarone/bmstu-aa

extension: bib


text:
SUMMARY = "GNOME archive library"
LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"

DEPENDS = " \
    gnome-common-native \
    gtk+3 \
    libarchive \
"

inherit gnomebase gobject-introspection gtk-doc vala

SRC_URI[archive.md5sum] = "39b13fb2fc7752fa3b80616244dc4ef8"
SRC_URI[archive.sha256sum] = "5de9db0db028cd6cab7c2fec46ba90965474ecf9cd68cfd681a6488cf1fb240a"

do_compile_prepend() {
    export GIR_EXTRA_LIBS_PATH="${B}/gnome-autoar/.libs"
}

repository: hpcraink/meta-openembedded

repo_name: hpcraink/meta-openembedded


text:
package compiler

import (
	"github.com/lestrrat/go-xslate/parser/tterse"
	"github.com/lestrrat/go-xslate/test"
	"github.com/lestrrat/go-xslate/vm"
	"testing"
)

func compile(t *testing.T, tmpl string) *vm.ByteCode {
	p := tterse.New()
	ast, err := p.ParseString(tmpl, tmpl)
	if err != nil {
		t.Fatalf("Failed to parse template: %s", err)
	}

	c := New()
	bc, err := c.Compile(ast)
	if err != nil {
		t.Fatalf("Failed to compile ast: %s", err)
	}

	t.Logf("-> %+v", bc)

	return bc
}

func TestCompiler(t *testing.T) {
	c := New()
	if c == nil {
		t.Fatalf("Failed to instanticate compiler")
	}
}

func TestCompile_RawText(t *testing.T) {
	compile(t, `Hello, World!`)
}

func TestCompile_LocalVar(t *testing.T) {
	compile(t, `[% s %]`)
}

func TestCompile_Wrapper(t *testing.T) {
	c := test.NewCtx(t)
	defer c.Cleanup()

	index := c.File("index.tx")
	index.WriteString(`[% WRAPPER "wrapper.tx" %]Hello[% END %]`)
	c.File("wrapper.tx").WriteString(`Hello, [% content %], Hello`)

	p := tterse.New()
	ast, err := p.Parse("index.tx", index.Read())
	if err != nil {
		t.Fatalf("Failed to parse template: %s", err)
	}

	comp := New()
	bc, err := comp.Compile(ast)
	if err != nil {
		t.Fatalf("Failed to compile ast: %s", err)
	}

	t.Logf("-> %+v", bc)
}

repository: lestrrat/go-xslate

repo_name: lestrrat/go-xslate

gha_language: Go


text:
package zoom

import "fmt"

const (
	// UpdateRegistrantsStatusPath defines a path for updating status of meeting registrants
	UpdateRegistrantsStatusPath = "/meetings/%d/registrants/status"

	// MeetingRegistrantStatusActionApprove defines the action to approve the registrant of the meeting
	MeetingRegistrantStatusActionApprove MeetingRegistrantStatusActionType = "approve"

	// MeetingRegistrantStatusActionCancel defines the action to cancel the registrant of the meeting
	MeetingRegistrantStatusActionCancel MeetingRegistrantStatusActionType = "cancel"

	// MeetingRegistrantStatusActionDeny defines the action to deny the registrant of the meeting
	MeetingRegistrantStatusActionDeny MeetingRegistrantStatusActionType = "deny"
)

type (
	// MeetingRegistrantStatusActionType defines the type of actions on the registrant status
	MeetingRegistrantStatusActionType string

	// MeetingRegistrantDetails contains identification of the meeting registrant
	MeetingRegistrantDetails struct {
		ID    string `json:"id"`
		Email string `json:"email"`
	}

	// MeetingRegistrantsStatus contains options for updating status
	MeetingRegistrantsStatus struct {
		MeetingID     int                               `json:"-" url:"-"`
		OccurrenceIDs string                            `json:"-" url:"occurrence_id,omitempty"`
		Action        MeetingRegistrantStatusActionType `json:"action" url:"-"`
		Registrants   []MeetingRegistrantDetails        `json:"registrants" url:"-"`
	}
)

// UpdateRegistrantsStatus updates a status of meeting registrants
func (c *Client) UpdateRegistrantsStatus(opts MeetingRegistrantsStatus) error {
	return c.requestV2(requestV2Opts{
		Method:         Put,
		Path:           fmt.Sprintf(UpdateRegistrantsStatusPath, opts.MeetingID),
		URLParameters:  opts,
		DataParameters: opts,
	})
}

repository: teamexos/zoom-lib-golang

repo_name: teamexos/zoom-lib-golang


text:
//go:build windows
// +build windows

package kong_test

import (
	"os"
	"testing"

	"github.com/alecthomas/assert/v2"
)

func TestWindowsPathMapper(t *testing.T) {
	var cli struct {
		Path  string   `short:"p" type:"path"`
		Files []string `short:"f" type:"path"`
	}
	wd, err := os.Getwd()
	assert.NoError(t, err, "Getwd failed")
	p := mustNew(t, &cli)

	_, err = p.Parse([]string{`-p`, `c:\an\absolute\path`, `-f`, `c:\second\absolute\path\`, `-f`, `relative\path\file`})
	assert.NoError(t, err)
	assert.Equal(t, `c:\an\absolute\path`, cli.Path)
	assert.Equal(t, []string{`c:\second\absolute\path\`, wd + `\relative\path\file`}, cli.Files)
}

func TestWindowsFileMapper(t *testing.T) {
	type CLI struct {
		File *os.File `arg:""`
	}
	var cli CLI
	p := mustNew(t, &cli)
	_, err := p.Parse([]string{"testdata\\file.txt"})
	assert.NoError(t, err)
	assert.NotNil(t, cli.File)
	_ = cli.File.Close()
	_, err = p.Parse([]string{"testdata\\missing.txt"})
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "missing.txt: The system cannot find the file specified.")
	_, err = p.Parse([]string{"-"})
	assert.NoError(t, err)
	assert.Equal(t, os.Stdin, cli.File)
}

repository: alecthomas/kong

repo_name: alecthomas/kong


text:
package govalid

import (
	"testing"

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

func Test_parseRules(t *testing.T) {
	for _, tc := range []struct {
		name string
		rule string
		want []*rule
	}{
		{
			name: "single rule",
			rule: "max:5",
			want: []*rule{
				{checker: "max", params: []string{"5"}},
			},
		},
		{
			name: "multiple rule",
			rule: "required;max:5;min:0",
			want: []*rule{
				{checker: "required"},
				{checker: "max", params: []string{"5"}},
				{checker: "min", params: []string{"0"}},
			},
		},
		{
			name: "no value",
			rule: "required:",
			want: []*rule{
				{checker: "required", params: []string{""}},
			},
		},
		{
			name: "nothing",
			rule: "::::",
			want: []*rule{},
		},
		{
			name: "empty",
			rule: "",
			want: []*rule{},
		},
	} {
		t.Run(tc.name, func(t *testing.T) {
			got := parseRules(tc.rule)
			assert.Equal(t, tc.want, got)
		})
	}
}


text:
package twitch

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"strings"
)

func FavoriteDota2Streams() []string {
	favorites := favoriteStreams()
	concatenated := strings.Replace(favorites, "\n", ",", -1)
	requestURL := "https://api.twitch.tv/kraken/streams?game=Dota+2&limit=10&channel=" + concatenated
	res, err := http.Get(requestURL)
	if err != nil {
		log.Fatal(err)
	}
	streams, err := ioutil.ReadAll(res.Body)
	res.Body.Close()
	if err != nil {
		log.Fatal(err)
	}

	var dat JSONResult
	if err := json.Unmarshal(streams, &dat); err != nil {
		panic(err)
	}

	sslice := make([]string, 0)
	for _, g := range dat.Streams {
		s := fmt.Sprintf("%s (%d) - %s - %s", g.Channel.Name, g.Viewers, g.Channel.Status, g.Channel.URL)
		sslice = append(sslice, s)
	}

	return sslice
}

func TopDota2Streams() []string {
	requestURL := "https://api.twitch.tv/kraken/streams?game=Dota+2&limit=10"
	res, err := http.Get(requestURL)
	if err != nil {
		log.Fatal(err)
	}
	streams, err := ioutil.ReadAll(res.Body)
	res.Body.Close()
	if err != nil {
		log.Fatal(err)
	}

	var dat JSONResult
	if err := json.Unmarshal(streams, &dat); err != nil {
		panic(err)
	}

	sslice := make([]string, 0)
	for _, g := range dat.Streams {
		if !isBlacklisted(g.Channel.Name) {
			s := fmt.Sprintf("%s (%d) - %s - %s", g.Channel.Name, g.Viewers, g.Channel.Status, g.Channel.URL)
			sslice = append(sslice, s)
		}
	}

	return sslice
}

func clientID() string {
	file, e := ioutil.ReadFile("./client.id")
	if e != nil {
		panic(e)
	}
	return string(file)
}

func favoriteStreams() string {
	file, e := ioutil.ReadFile("./favorites.txt")
	if e != nil {
		panic(e)
	}
	return string(file)
}

func blacklistStreams() []string {
	file, e := ioutil.ReadFile("./blacklist.txt")
	if e != nil {
		panic(e)
	}
	return strings.Split(string(file), "\n")
}

func isBlacklisted(stream string) bool {
	blacklist := blacklistStreams()
	for _, b := range blacklist {
		if b == stream {
			return true
		}
	}
	return false
}

// JSON structs
type JSONResult struct {
	Streams []JSONStreams `json:"streams"`
}

type JSONStreams struct {
	Channel JSONChannel `json:"channel"`
	Viewers int         `json:"viewers"`
}

type JSONChannel struct {
	Name   string `json:"display_name"`
	URL    string `json:"url"`
	Status string `json:"status"`
}

repository: yene/gobot-twitch

repo_name: yene/gobot-twitch


text:
package LinkedList

import "reflect"

func(l *linkedList) Contains(item interface{}) (state bool){

	state=false

	for e:=l.v.Front();e!=nil;e=e.Next(){
		if reflect.ValueOf(item).Interface()==e.Value{
			state=true
			return
		}
	}

	return

}

repository: MehmetEminKaymaz/Orca

repo_name: MehmetEminKaymaz/Orca


text:
#pragma once
#include <SFML\Graphics\Sprite.hpp>
#include <vector>
#include "GameObject.h"

class HealthBar
{
public:
	HealthBar();
	~HealthBar();

	void TakeHeart();
	void Recovery();
	void Draw(sf::RenderWindow& window);

private:
	std::vector<GameObject> m_hearth;
	int m_visible;
};

repository: SongToSoft/Arkanoid

repo_name: SongToSoft/Arkanoid

extension: h


text:
package snippet

import (
	"encoding/xml"
	"io/ioutil"
	"path/filepath"
	"strings"
)

type sublimeSnippet struct {
	Body        string `xml:"content"`
	Trigger     string `xml:"tabTrigger"`
	Description string `xml:"description"`
	Scope       string `xml:"scope"`
}

// ParseSublimeFile parses a Sublime Text ".sublime-snippet" file
// and returns a Snippet or an error if something goes wrong.
func ParseSublimeFile(path string) (Snippet, error) {
	var s sublimeSnippet

	bytes, err := ioutil.ReadFile(path)
	if err != nil {
		return Snippet{}, err
	}

	err = xml.Unmarshal(bytes, &s)
	if err != nil {
		return Snippet{}, err
	}

	return sublimeSnippetToSnippet(s, path), nil
}

func sublimeSnippetToSnippet(s sublimeSnippet, path string) Snippet {
	name := filepath.Base(path)
	name = strings.Replace(name, ".sublime-snippet", "", -1)

	return Snippet{
		Name:        strings.TrimSpace(name),
		Trigger:     strings.TrimSpace(s.Trigger),
		Body:        strings.Split(s.Body, "\n"),
		Description: strings.TrimSpace(s.Description),
	}
}

repository: tcd/snip

repo_name: tcd/snip


text:
@inproceedings{neves-etal-2022-findings,
    title = "Findings of the {WMT} 2022 Biomedical Translation Shared Task: Monolingual Clinical Case Reports",
    author = "Neves, Mariana  and
      Jimeno Yepes, Antonio  and
      Siu, Amy  and
      Roller, Roland  and
      Thomas, Philippe  and
      Vicente Navarro, Maika  and
      Yeganova, Lana  and
      Wiemann, Dina  and
      Di Nunzio, Giorgio Maria  and
      Vezzani, Federica  and
      Gerardin, Christel  and
      Bawden, Rachel  and
      Estrada, Darryl Johan  and
      Lima-lopez, Salvador  and
      Farre-maduel, Eulalia  and
      Krallinger, Martin  and
      Grozea, Cristian  and
      Neveol, Aurelie",
    booktitle = "Proceedings of the Seventh Conference on Machine Translation (WMT)",
    month = dec,
    year = "2022",
    address = "Abu Dhabi, United Arab Emirates (Hybrid)",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2022.wmt-1.69",
    pages = "694--723",
    abstract = "In the seventh edition of the WMT Biomedical Task, we addressed a total of seven languagepairs, namely English/German, English/French, English/Spanish, English/Portuguese, English/Chinese, English/Russian, English/Italian. This year{'}s test sets covered three types of biomedical text genre. In addition to scientific abstracts and terminology items used in previous editions, we released test sets of clinical cases. The evaluation of clinical cases translations were given special attention by involving clinicians in the preparation of reference translations and manual evaluation. For the main MEDLINE test sets, we received a total of 609 submissions from 37 teams. For the ClinSpEn sub-task, we had the participation of five teams.",
}

branch_name: refs/heads/src

gha_language: TeX


text:
LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://COPYING;md5=447b837ae57f08b7060593ac6256163f"

SRC_URI[archive.md5sum] = "c26fd21c21b9ef6533a202a73fab21db"
SRC_URI[archive.sha256sum] = "bba8ff30eea815037e53bee727bbd5f0b6a2e74d452a7711b819a7c444e78e53"

inherit autotools gnomebase gobject-introspection
DEPENDS = "glib-2.0 libcanberra"

repository: dma/citadel

repo_name: dma/citadel


branch_name: refs/heads/main

gha_language: Makefile

extension: cmake


text:
/*
 * Partitioner built on the Rose Compiler Infrastructure
 *
 * Re-factors input program to partition kernels based on user-pragmas and internal analysis.
 */

/* Rose headers - must come first for PCH to work */
#include "rose.h"
#include <CallGraph.h>

/* Standard library headers */
#include <iostream>
#include <set>

/* Partitioner headers */
#include "program_options.h"
#include "function_declaration.h"
#include "function_call.h"
#include "create_partition.h"
#include "pragma_definitions.h"

#define SUCCESS 0
#define FAILURE 1

using namespace std;
using namespace StringUtility;
using namespace SageBuilder;
using namespace SageInterface;
using namespace NodeQuery;

int main(int argc, char** argv)
{
	//Parse command-line or configuration file arguments
	//TODO configuration files
	ProgramOptions myArgs(argc, argv);

	//Print help
	if(myArgs.printHelp())
	{
		cout << "This is the help.  It will be more substantial once there is stuff to print." << endl;
		return SUCCESS;
	}

	//Build AST & check
	SgProject* project = new SgProject(argc, argv);
	ROSE_ASSERT(project != NULL);
	if(myArgs.runASTConsistencyTests())
	{
		cout << "Running consistency tests...";
		AstTests::runAllTests(project);
		cout << "finished" << endl;
	}

	//Generate call-graph
	if(myArgs.printCallGraph()) {
		if(project->get_fileList().size() >= 1) {
			CallGraphBuilder cgbuilder(project);
			cgbuilder.buildCallGraph(builtinFilter());

			AstDOTGeneration dotgen;
			SgFilePtrList file_list = project->get_fileList();
			string firstFileName = stripPathFromFileName(file_list[0]->getFileName());
			dotgen.writeIncidenceGraphToDOTFile(cgbuilder.getGraph(), firstFileName + "_callgraph.dot");
		}
	}

	//Generate AST graph
	if(myArgs.printAST())
		generateDOT(*project);

	//Generate full AST graph
	if(myArgs.printFullAST())
		generatePDF(*project);

	// TODO Create partitions for hardware specified in the configuration file
	MPIPartition::setMPIHeader(myArgs.getMPIHeader());
	Partition *tilera = new MPIPartition("Tilera");

	//Insert code to so that it is an MPI program
	insertHeader(myArgs.getMPIHeader(), PreprocessingInfo::after, true,
			getFirstGlobalScope(project));
	//TODO add any necessary MPI code

	//Partition indicated functions (i.e. functions annotated with pragmas)
	Rose_STL_Container<SgNode*> pragmas = querySubTree(project, V_SgPragmaDeclaration);
	Rose_STL_Container<SgNode*>::const_iterator pragmaIt;
	Rose_STL_Container<SgNode*> functionCallList;
	Rose_STL_Container<SgNode*>::const_iterator functionCallIt;
	for(pragmaIt = pragmas.begin(); pragmaIt != pragmas.end(); pragmaIt++)
	{
		SgPragmaDeclaration* pragma = isSgPragmaDeclaration(*pragmaIt);
		ROSE_ASSERT(pragma != NULL);

		if(extractPragmaKeyword(pragma) == POPCORN_PRAGMA)
		{
			//Check to make sure the next statement is a function declaration
			SgFunctionDeclaration* annotatedFunction = isSgFunctionDeclaration(getNextStatement(pragma));
			if(!annotatedFunction)
			{
				cerr << "Warning: found partitioning pragma before a statement that was not a function "
						<< "declaration.  Continuing to next pragma..." << endl;
				continue;
			}

			//If we cannot partition the function, continue to next pragma
			FunctionDeclaration functionToPartition(annotatedFunction, true);
			if(!functionToPartition.canPartition())
			{
				functionToPartition.printPartitioningStatus();
				continue;
			}

			//Partition the function
			if(pragma->get_pragma()->get_pragma().find("tilera") != string::npos)
				functionToPartition.partition(tilera);
			else
			{
				cout << "Unknown partition: " << pragma->get_pragma()->get_pragma() << endl;
				continue;
			}

			//Get all function calls associated with this function and update their arguments accordingly
			functionCallList = querySubTree(project, V_SgFunctionCallExp);
			for(functionCallIt = functionCallList.begin(); functionCallIt != functionCallList.end();
					functionCallIt++)
			{
				SgFunctionCallExp* functionCallExp = isSgFunctionCallExp(*functionCallIt);
				ROSE_ASSERT(functionCallExp != NULL);

				if(functionCallExp->getAssociatedFunctionDeclaration()->get_definingDeclaration() !=
						annotatedFunction)
					continue;

				FunctionCall functionCall(functionCallExp);
				functionCall.updateCallSite();
			}
		}
	}

	//Finalize and cleanup partitions
	tilera->finalize();
	delete tilera;

	//Generate source code from updated AST
	return backend(project);
}
/* vim: set noexpandtab shiftwidth=4 tabstop=4 softtabstop=4: */

license: Unlicense

repository: ssrg-vt/aira

repo_name: ssrg-vt/aira


text:
# Meta
set(AM_MULTI_CONFIG "SINGLE")
# Directories and files
set(AM_CMAKE_BINARY_DIR "/home/innate/Documents/phantomJs/phantomjs/")
set(AM_CMAKE_SOURCE_DIR "/home/innate/Documents/phantomJs/phantomjs/")
set(AM_CMAKE_CURRENT_SOURCE_DIR "/home/innate/Documents/phantomJs/phantomjs/")
set(AM_CMAKE_CURRENT_BINARY_DIR "/home/innate/Documents/phantomJs/phantomjs/")
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "")
set(AM_BUILD_DIR "/home/innate/Documents/phantomJs/phantomjs/phantomjs_autogen")
set(AM_SOURCES "/home/innate/Documents/phantomJs/phantomjs/src/callback.cpp;/home/innate/Documents/phantomJs/phantomjs/src/childprocess.cpp;/home/innate/Documents/phantomJs/phantomjs/src/config.cpp;/home/innate/Documents/phantomJs/phantomjs/src/cookiejar.cpp;/home/innate/Documents/phantomJs/phantomjs/src/crashdump.cpp;/home/innate/Documents/phantomJs/phantomjs/src/encoding.cpp;/home/innate/Documents/phantomJs/phantomjs/src/env.cpp;/home/innate/Documents/phantomJs/phantomjs/src/filesystem.cpp;/home/innate/Documents/phantomJs/phantomjs/src/main.cpp;/home/innate/Documents/phantomJs/phantomjs/src/networkaccessmanager.cpp;/home/innate/Documents/phantomJs/phantomjs/src/phantom.cpp;/home/innate/Documents/phantomJs/phantomjs/src/qcommandline/qcommandline.cpp;/home/innate/Documents/phantomJs/phantomjs/src/repl.cpp;/home/innate/Documents/phantomJs/phantomjs/src/system.cpp;/home/innate/Documents/phantomJs/phantomjs/src/terminal.cpp;/home/innate/Documents/phantomJs/phantomjs/src/utils.cpp;/home/innate/Documents/phantomJs/phantomjs/src/webpage.cpp;/home/innate/Documents/phantomJs/phantomjs/src/webserver.cpp")
set(AM_HEADERS "")
# Qt environment
set(AM_QT_VERSION_MAJOR "5")
set(AM_QT_VERSION_MINOR "9")
set(AM_QT_MOC_EXECUTABLE "/usr/lib/qt5/bin/moc")
set(AM_QT_UIC_EXECUTABLE )
set(AM_QT_RCC_EXECUTABLE "/usr/lib/qt5/bin/rcc")
# MOC settings
set(AM_MOC_SKIP "/home/innate/Documents/phantomJs/phantomjs/phantomjs_autogen/UVLADIE3JM/qrc_phantomjs.cpp;/home/innate/Documents/phantomJs/phantomjs/phantomjs_autogen/mocs_compilation.cpp")
set(AM_MOC_DEFINITIONS "QT_CORE_LIB;QT_GUI_LIB;QT_NETWORK_LIB;QT_WEBKITWIDGETS_LIB;QT_WEBKIT_LIB;QT_WIDGETS_LIB")
set(AM_MOC_INCLUDES "/home/innate/Documents/phantomJs/phantomjs;/home/innate/Documents/phantomJs/phantomjs/phantomjs_autogen/include;/home/innate/Documents/phantomJs/phantomjs/src;/home/innate/Documents/phantomJs/phantomjs/src/linenoise/src;/home/innate/Documents/phantomJs/phantomjs/src/mongoose;/home/innate/Documents/phantomJs/phantomjs/src/qcommandline;/usr/include/x86_64-linux-gnu/qt5;/usr/include/x86_64-linux-gnu/qt5/QtCore;/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++;/usr/include/x86_64-linux-gnu/qt5/QtNetwork;/usr/include/x86_64-linux-gnu/qt5/QtWebKitWidgets;/usr/include/x86_64-linux-gnu/qt5/QtWidgets;/usr/include/x86_64-linux-gnu/qt5/QtGui;/usr/include/x86_64-linux-gnu/qt5/QtWebKit;/usr/include")
set(AM_MOC_OPTIONS "")
set(AM_MOC_RELAXED_MODE "FALSE")
set(AM_MOC_MACRO_NAMES "Q_OBJECT;Q_GADGET;Q_NAMESPACE")
set(AM_MOC_DEPEND_FILTERS "")
set(AM_MOC_PREDEFS_CMD "/usr/bin/c++;-dM;-E;-c;/usr/share/cmake-3.10/Modules/CMakeCXXCompilerABI.cpp")
# UIC settings
set(AM_UIC_SKIP )
set(AM_UIC_TARGET_OPTIONS )
set(AM_UIC_OPTIONS_FILES )
set(AM_UIC_OPTIONS_OPTIONS )
set(AM_UIC_SEARCH_PATHS )
# RCC settings
set(AM_RCC_SOURCES "/home/innate/Documents/phantomJs/phantomjs/src/phantomjs.qrc")
set(AM_RCC_BUILDS "/home/innate/Documents/phantomJs/phantomjs/phantomjs_autogen/UVLADIE3JM/qrc_phantomjs.cpp")
set(AM_RCC_OPTIONS "{-name;phantomjs}")
set(AM_RCC_INPUTS "{/home/innate/Documents/phantomJs/phantomjs/src/phantomjs-icon.png;/home/innate/Documents/phantomJs/phantomjs/src/repl.js;/home/innate/Documents/phantomJs/phantomjs/src/configurator.js;/home/innate/Documents/phantomJs/phantomjs/src/bootstrap.js;/home/innate/Documents/phantomJs/phantomjs/src/modules/webserver.js;/home/innate/Documents/phantomJs/phantomjs/src/modules/system.js;/home/innate/Documents/phantomJs/phantomjs/src/modules/cookiejar.js;/home/innate/Documents/phantomJs/phantomjs/src/modules/fs.js;/home/innate/Documents/phantomJs/phantomjs/src/modules/webpage.js;/home/innate/Documents/phantomJs/phantomjs/src/modules/child_process.js}")
# Configurations options
set(AM_CONFIG_SUFFIX_Debug "_Debug")

repository: indover/phantom

repo_name: indover/phantom


text:
#======================================#
#           SUMMARY/LICENCE            #
#--------------------------------------#
SUMMARY = "Some files for systemd"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://licenses/COPYING.MIT;md5=838c366f69b72c5df05c96dff79b35f2"

#======================================#
#           REQUIRE/INHERIT            #
#--------------------------------------#

#======================================#
#                SOURCE                #
#--------------------------------------#
SRC_URI = "file://80-dhcp.network                   \
           file://60-persistent-storage-ide.rules   \
           file://legacy.lock.conf                  \
           file://licenses/COPYING.MIT              \
           "
S = "${WORKDIR}"

#======================================#
#           DEPENDS/PROVIDES           #
#--------------------------------------#
RDEPENDS_${PN} = " systemd "

#======================================#
#         BUILD CONFIGURATIONS         #
#--------------------------------------#

#======================================#
#                TASKS                 #
#--------------------------------------#
do_install() {
    install -d ${D}${systemd_unitdir}/network
    install -m 0644 ${WORKDIR}/80-dhcp.network ${D}${systemd_unitdir}/network/80-dhcp.network

    install -d ${D}${libdir}/udev/rules.d
    install -m 0644 ${WORKDIR}/60-persistent-storage-ide.rules ${D}${libdir}/udev/rules.d/60-persistent-storage-ide.rules

    install -d ${D}${libdir}/tmpfiles.d
    install -m 0644 ${WORKDIR}/legacy.lock.conf ${D}${libdir}/tmpfiles.d/legacy.lock.conf
}

#======================================#
#            PACKAGES/FILES            #
#--------------------------------------#
FILES_${PN} = "/"

#======================================#
#            INSTALL SCRIPT            #
#--------------------------------------#

#======================================#
#             ALTERNATIVES             #
#--------------------------------------#

#======================================#
#           USERADD/SYSTEMD            #
#--------------------------------------#

#======================================#
#                 TEST                 #
#--------------------------------------#


text:
package executor

import (
	"fmt"

	qcservice "github.com/yunify/qingcloud-sdk-go/service"
)

func (i *QingCloudClient) InstancesExist(ids []string) error {
	status := []*string{qcservice.String("pending"), qcservice.String("running"), qcservice.String("stopped")}
	input := &qcservice.DescribeInstancesInput{
		Instances: qcservice.StringSlice(ids),
		Status:    status,
		Verbose:   qcservice.Int(1),
	}
	if i.Config.IsAPP {
		input.IsClusterNode = qcservice.Int(1)
	}
	output, err := i.InstanceService.DescribeInstances(input)
	if err != nil {
		return err
	}
	if len(output.InstanceSet) != len(ids) {
		return fmt.Errorf("cannot find instances by node ids= %v", ids)
	}

	return nil
}


text:
SUMMARY = "A library for collecting system monitoring data"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"

inherit gnomebase lib_package gtk-doc gobject-introspection gettext upstream-version-is-even features_check

ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"

SRC_URI[archive.sha256sum] = "43ea9ad13f7caf98303e64172b191be9b96bab340b019deeec72251ee140fe3b"

DEPENDS = "glib-2.0 libxau"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake


text:
@misc{10665-362241,
	author = {{World Health Organization}},
	title = {{COVID-19 weekly epidemiological update, edition 107, 31 August 2022}},
	year = {2022},
	pages = {11 p.},
	publisher = {World Health Organization},
	type = {Technical documents}
}

@misc{Italy,
author = {},
title = {Eventi e Covid-19},
year = {2020},
howpublished = "(accessed September 8, 2022) \url{https://covid19eventi.datainterfaces.org/}"}

@misc{Spain,
author = {},
title = {Eventos y Covid-19},
year = {2020},
howpublished = "(accessed September 8, 2022) \url{https://eventosycovid19.es/}"}

@misc{Mexico,
author = {},
title = {COVID-19 M\'exico},
year = {2020},
howpublished = "(accessed September 8, 2022) \url{https://adrian-acuna.shinyapps.io/Dashboard-MX-v3/_w_33ffcba1/#shiny-tab-Riesgo}"}

@misc{Argentina,
author = {Cassese, Nicol\'as},
title = {Fiestas de fin de a\~no. Calcul\'a el riesgo de cruzarte un infectado seg\'un tu lugar de festejo y la cantidad de invitados},
year = {2020},
howpublished = "(accessed September 8, 2022) \url{https://www.lanacion.com.ar/sociedad/fiestas-fin-ano-calcula-riesgo-coronavirus-infectado-nid2548498/#/}"}

@misc{WHO,
author = {},
title = {WHO-EURO COVID19 Subnational Explorer},
year = {2020},
howpublished = "(accessed September 8, 2022) \url{https://experience.arcgis.com/experience/3a056fc8839d47969ef59949e9984a71}"}

@misc{Ireland,
author = {McNamee, Michael Sheils},
title = {CHSE cyber-attack: Irish health service still recovering months after hack},
year = {2021},
howpublished = "(accessed September 8, 2022) \url{https://www.bbc.com/news/world-europe-58413448}"}

@article{bavel2020using,
  title={Using social and behavioural science to support COVID-19 pandemic response},
  author={Bavel, Jay J Van and Baicker, Katherine and Boggio, Paulo S and Capraro, Valerio and Cichocka, Aleksandra and Cikara, Mina and Crockett, Molly J and Crum, Alia J and Douglas, Karen M and Druckman, James N and others},
  journal={Nature human behaviour},
  volume={4},
  number={5},
  pages={460--471},
  year={2020},
  doi={10.1038/s41562-020-0884-z},
  publisher={Nature Publishing Group}
}

@article{funk2010modelling,
  title={Modelling the influence of human behaviour on the spread of infectious diseases: a review},
  author={Funk, Sebastian and Salath{\'e}, Marcel and Jansen, Vincent AA},
  journal={Journal of the Royal Society Interface},
  volume={7},
  number={50},
  pages={1247--1256},
  year={2010},
  doi={10.1098/rsif.2010.0142},
  publisher={The Royal Society}
}

@article{barber2022estimating,
  title={Estimating global, regional, and national daily and cumulative infections with SARS-CoV-2 through Nov 14, 2021: a statistical analysis},
  author={Barber, Ryan M and Sorensen, Reed JD and Pigott, David M and Bisignano, Catherine and Carter, Austin and Amlag, Joanne O and Collins, James K and Abbafati, Cristiana and Adolph, Christopher and Allorant, Adrien and others},
  journal={The Lancet},
  year={2022},
  doi={10.1016/S0140-6736(22)00484-6},
  publisher={Elsevier}
}

@article{berry2021sub,
  title={A sub-national real-time epidemiological and vaccination database for the COVID-19 pandemic in Canada},
  author={Berry, Isha and O’Neill, Meghan and Sturrock, Shelby L and Wright, James E and Acharya, Kamal and Brankston, Gabrielle and Harish, Vinyas and Kornas, Kathy and Maani, Nika and Naganathan, Thivya and others},
  journal={Scientific Data},
  volume={8},
  number={1},
  pages={1--10},
  year={2021},
  doi={10.1038/s41597-021-00955-2},
  publisher={Nature Publishing Group}
}

@article{weitz2020awareness,
  title={Awareness-driven behavior changes can shift the shape of epidemics away from peaks and toward plateaus, shoulders, and oscillations},
  author={Weitz, Joshua S and Park, Sang Woo and Eksin, Ceyhun and Dushoff, Jonathan},
  journal={Proceedings of the National Academy of Sciences},
  volume={117},
  number={51},
  pages={32764--32771},
  year={2020},
  doi={10.1073/pnas.2009911117},
  publisher={National Acad Sciences}
}

#Contextualization

@article{chande2020real,
  title={{Real-time, interactive website for US-county-level COVID-19 event risk assessment}},
  author={Chande, Aroon and Lee, Seolha and Harris, Mallory and Nguyen, Quan and Beckett, Stephen J and Hilley, Troy and Andris, Clio and Weitz, Joshua S},
  journal={Nature Human Behaviour},
  volume={4},
  number={12},
  pages={1313--1319},
  year={2020},
  doi={10.1038/s41562-020-01000-9},
  publisher={Nature Publishing Group}
}

@article{palmer2021covidregionaldata,
  title={covidregionaldata: Subnational data for COVID-19 epidemiology},
  author={Palmer, Joseph and Sherratt, Katharine and Martin-Nielsen, Richard and Bevan, Jonnie and Gibbs, Hamish and Funk, Sebastian and Abbott, Sam and Cmmid COVID-19 Working Group and others},
  journal={Journal of Open Source Software},
  volume={6},
  number={63},
  pages={3290},
  year={2021},
  doi={10.21105/joss.03290}
}

@article{Sinclaire2100970118,
	author = {Sinclair, Alyssa H and Hakimi, Shabnam and Stanley, Matthew L and Adcock, R Alison and Samanez-Larkin, Gregory R},
	title = {Pairing facts with imagined consequences improves pandemic-related risk perception},
	volume = {118},
	number = {32},
	elocation-id = {e2100970118},
	year = {2021},
	doi = {10.1073/pnas.2100970118},
	publisher = {National Academy of Sciences},
	issn = {0027-8424},
	journal = {Proceedings of the National Academy of Sciences}
}

@article{sinclair2021imagining,
  title={Imagining a personalized scenario selectively increases perceived risk of viral transmission for older adults},
  author={Sinclair, Alyssa H and Stanley, Matthew L and Hakimi, Shabnam and Cabeza, Roberto and Adcock, R Alison and Samanez-Larkin, Gregory R},
  journal={Nature Aging},
  volume={1},
  number={8},
  pages={677--683},
  year={2021},
  doi={10.1038/s43587-021-00095-7},
  publisher={Nature Publishing Group}
}

@article{sinclair2022counteracting,
  title={{Real-time interventions counteract COVID-19 risk misestimation in the United States}},
  author={Sinclair, Alyssa H and Taylor, Morgan and Brandel-Tanis, Freyja and Davidson, Audra and Chande, Aroon T and Rishishwar, Lavanya and Andris, Clio Maria and Adcock, R Alison and Weitz, Joshua S and Samanez-Larkin, Gregory and Beckett, Stephen J},
  year={2022},
  publisher={PsyArXiv},
  journal={PsyArXiv},
  URL ={https://doi.org/10.31234/osf.io/v8tdf},
  doi={10.31234/osf.io/v8tdf}
}

#Data sources

@Article{guidotti2022,
    title = {{A worldwide epidemiological database for COVID-19 at fine-grained spatial resolution}},
    year = {2022},
    doi = {10.1038/s41597-022-01245-1},
    author = {Emanuele Guidotti},
    journal = {Scientific Data},
    volume = {9},
    number = {1},
    pages = {112}
}

@article{dong2020interactive,
  title={{An interactive web-based dashboard to track COVID-19 in real time}},
  author={Dong, Ensheng and Du, Hongru and Gardner, Lauren},
  journal={The Lancet infectious diseases},
  volume={20},
  number={5},
  pages={533--534},
  year={2020},
  doi={10.1016/S1473-3099(20)30120-1},
  publisher={Elsevier}
}

@article{cota2020monitoring,
  title={{Monitoring the number of COVID-19 cases and deaths in Brazil at municipal and federative units level}},
  author={Cota, Wesley},
  year={2020},
  journal={SciELO Preprints},
  URL = {https://doi.org/10.1590/SciELOPreprints.362},
  doi={10.1590/SciELOPreprints.362}
}

@article{berry2020open,
  title={{Open access epidemiologic data and an interactive dashboard to monitor the COVID-19 outbreak in Canada}},
  author={Berry, Isha and Soucy, Jean-Paul R and Tuite, Ashleigh and Fisman, David},
  journal={Cmaj},
  volume={192},
  number={15},
  pages={E420--E420},
  year={2020},
  doi={10.1503/cmaj.75262},
  publisher={Can Med Assoc}
}

@article{jefferies2020covid,
  title={{COVID-19 in New Zealand and the impact of the national response: a descriptive epidemiological study}},
  author={Jefferies, Sarah and French, Nigel and Gilkison, Charlotte and Graham, Giles and Hope, Virginia and Marshall, Jonathan and McElnay, Caroline and McNeill, Andrea and Muellner, Petra and Paine, Shevaun and others},
  journal={The Lancet Public Health},
  volume={5},
  number={11},
  pages={e612--e623},
  year={2020},
  doi={10.1016/S2468-2667(20)30225-5},
  publisher={Elsevier}
}

@article{Wahltinez2020,
  author = "O. Wahltinez and others",
  year = 2020,
  title = {{COVID-19 Open-Data: curating a fine-grained, global-scale data repository for SARS-CoV-2}},
  note = "Work in progress",
  url = {https://goo.gle/covid-19-open-data},
}

@misc{Czechia,
  author ={Komenda, M. and Panoška, P. and Bulhart, V. and Žofka, J. and Brauner, T. and Hak, J. and Jarkovský, J. and Mužík, J. and Blaha, M. and Kubát, J. and Klimeš, D. and Langhammer, P. and Daňková, Š. and Májek, O. and Bartůňková, M. and Dušek, L.},
  title={COVID‑19: Přehled aktuální situace v ČR. Onemocnění aktuálně [online]. Praha: Ministerstvo zdravotnictví ČR, 2020 [cit. 09.05.2022].},
  year={2020},
  url={https://onemocneni-aktualne.mzcr.cz/covid-19},
  note={Vývoj: společné pracoviště ÚZIS ČR a IBA LF MU. ISSN 2694-9423.}
}

#packages

@Article{COVID19,
    title = {{COVID-19 Data Hub}},
    year = {2020},
    doi = {10.21105/joss.02376},
    author = {Emanuele Guidotti and David Ardia},
    journal = {Journal of Open Source Software},
    volume = {5},
    number = {51},
    pages = {2376},
  }

@Manual{leaflet,
    title = {leaflet: Create Interactive Web Maps with the JavaScript 'Leaflet'
Library},
    author = {Joe Cheng and Bhaskar Karambelkar and Yihui Xie},
    year = {2021},
    note = {R package version 2.0.4.1},
    url = {https://CRAN.R-project.org/package=leaflet},
  }

@Article{tmap,
    title = {{tmap}: Thematic Maps in {R}},
    author = {Martijn Tennekes},
    journal = {Journal of Statistical Software},
    year = {2018},
    volume = {84},
    number = {6},
    pages = {1--39},
    doi = {10.18637/jss.v084.i06},
  }

gha_language: R


text:
package monday

// ============================================================
// Format rules for "pl_PL" locale: Polish (Poland)
// ============================================================

var longDayNamesPlPL = map[string]string{
	"Sunday":    "Niedziela",
	"Monday":    "Poniedziałek",
	"Tuesday":   "Wtorek",
	"Wednesday": "Środa",
	"Thursday":  "Czwartek",
	"Friday":    "Piątek",
	"Saturday":  "Sobota",
}

// http://sjp.pwn.pl/poradnia/haslo/skracanie-nazw-dni-tygodnia-i-miesiecy;8124.html
var shortDayNamesPlPL = map[string]string{
	"Sun": "Nie",
	"Mon": "Pon",
	"Tue": "Wto",
	"Wed": "Śro",
	"Thu": "Czw",
	"Fri": "Pią",
	"Sat": "Sob",
}

var longMonthNamesPlPL = map[string]string{
	"January":   "Styczeń",
	"February":  "Luty",
	"March":     "Marzec",
	"April":     "Kwiecień",
	"May":       "Maj",
	"June":      "Czerwiec",
	"July":      "Lipiec",
	"August":    "Sierpień",
	"September": "Wrzesień",
	"October":   "Październik",
	"November":  "Listopad",
	"December":  "Grudzień",
}

var shortMonthNamesPlPL = map[string]string{
	"Jan": "Sty",
	"Feb": "Lut",
	"Mar": "Mar",
	"Apr": "Kwi",
	"May": "Maj",
	"Jun": "Cze",
	"Jul": "Lip",
	"Aug": "Sie",
	"Sep": "Wrz",
	"Oct": "Paź",
	"Nov": "Lis",
	"Dec": "Gru",
}

repository: goodsign/monday

repo_name: goodsign/monday


text:
@article{Baudron2014b,
 abstract = {Cereal residues represent a major resource for livestock feeding during the dry season in southern Africa. When kept on the soil surface instead of feeding them to livestock, crop residues can contribute to increasing soil fertility and maintaining crop productivity in the short- and the long-term. We explored these trade-offs for smallholder cotton-sorghum farming systems in the semi-arid Zambezi Valley, northern Zimbabwe. The analysis was done using simulation models at three scales, the plot, the farm and the territory, to simulate the effects of different sorghum residue allocations to livestock feeding vs. soil mulching, in combination with different application rates of mineral nitrogen fertilizer on crop productivity. The plot-scale simulations suggest that without N fertilization soil mulching has a positive effect on cotton yields only if small quantities of sorghum residues are used as mulch (average cotton yields of 2.24 ± 0.41 kg ha-1 with a mulch of 100 kg ha-1 vs. 1.91 ± 0.29 kg ha-1 without mulch). Greater quantities of mulch have a negative effect on cotton yield without N fertilization due to N immobilization in the soil microbial biomass. With applications of 100 kg N ha-1, quantities of mulch up to 3 t ha-1 have no negative effect on cotton yield. Results at farm-scale highlight the fundamental role of livestock as a source of traction, and the need to feed a greater proportion of sorghum residues to livestock as herd and farm sizes increase. Farmers with no livestock attained maximum crop production when 100% of their sorghum residue remained in the field, as they do not have access to cattle manure. The optimum fraction of crop residue to be retained in the fields for maximum farm crop production varied for farmers with 2 or less heads of cattle (80% retention), with 2-3 heads (60-80%), with 4 or more heads (40-60%). At the scale of the entire territory, total cotton and sorghum production increased with the density of cattle, at the expense of soil mulching with crop residues. The results of our simulations suggest that (i) the optimum level of residue retention depends on the scale at which trade-offs are analyzed; (ii) the retention of all of the crop residue as mulch appears unrealistic and undesirable in farming systems that rely on livestock for traction; and (iii) crop residue mulching could be made more attractive to farmers by paying due attention to balancing C to N ratios in the soil and by promoting small-scale mechanization to replace animal traction. © 2014 Elsevier Ltd. All rights reserved.},
 author = {Baudron, Frédéric and Delmotte, Sylvestre and Corbeels, Marc and Herrera, Juan M and Tittonell, Pablo A},
 doi = {10.1016/j.agsy.2014.03.002},
 file = {:C$\backslash$:/Users/FBaudron/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/Baudron et al. - 2014 - Multi-scale trade-off analysis of cereal residue use for livestock feeding vs. soil mulching in the Mid-Zambezi.pdf:pdf},
 isbn = {0308-521X},
 issn = {0308521X},
 journal = {Agricultural Systems},
 keywords = {APSIM,conservation agriculture,equity,simulation model},
 pages = {97--106},
 title = {Multi-scale trade-off analysis of cereal residue use for livestock feeding vs. soil mulching in the Mid-Zambezi Valley, Zimbabwe},
 volume = {134},
 year = {2014}
}

repository: FBaudron/starter-academic

repo_name: FBaudron/starter-academic


text:
# Copyright (c) 2017, Lukas Solanka
# All rights reserved.

# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
    PACKAGE_NAME
    ros-rospack
    VERSION
    2.4.4-p2
    URL
    "https://github.com/lsolanka/rospack/archive/2.4.4-p2.tar.gz"
    SHA1
    "429fc7a56997c52570b16c5bcc19f2d4e1354811"
)

hunter_add_version(
    PACKAGE_NAME
    ros-rospack
    VERSION
    2.4.4-p1
    URL
    "https://github.com/lsolanka/rospack/archive/2.4.4-p1.tar.gz"
    SHA1
    8af5ed1de99778d7af76550a3eaaef650f3591b7
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(ros-rospack)
hunter_download(PACKAGE_NAME ros-rospack)

repository: lsolanka/hunter

repo_name: lsolanka/hunter


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

package peer

import (
	"context"
	"io"
	"strings"

	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/stats"
	"google.golang.org/grpc/status"
)

type ctxKey struct{}

type (
	serviceKey    ctxKey
	methodKey     ctxKey
	remoteAddrKey ctxKey
	localAddrKey  ctxKey
)

// StatsHandler is for gRPC stats
type statsHandler struct {
	reporter *reporter
}

func newStatsHandler(r *reporter) stats.Handler {
	return &statsHandler{
		reporter: r,
	}
}

// TagConn implements per-Connection context tagging.
func (s *statsHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) context.Context {
	ctx = context.WithValue(ctx, remoteAddrKey{}, info.RemoteAddr.String())
	ctx = context.WithValue(ctx, localAddrKey{}, info.LocalAddr.String())
	return ctx
}

// HandleConn implements per-Connection stats reporting.
func (s *statsHandler) HandleConn(ctx context.Context, connStats stats.ConnStats) {
	// client connection stats are monitored by the monitor() function in client.go
	if connStats.IsClient() {
		return
	}

	remoteAddr, _ := ctx.Value(remoteAddrKey{}).(string)
	localAddr, _ := ctx.Value(localAddrKey{}).(string)

	switch connStats.(type) {
	case *stats.ConnBegin:
		s.reporter.incConnection(localAddr, remoteAddr, "SERVER_CONN")
	case *stats.ConnEnd:
		s.reporter.decConnection(localAddr, remoteAddr, "SERVER_CONN")
	}
}

// TagRPC implements per-RPC context tagging.
func (s *statsHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) context.Context {
	service, method := split(info.FullMethodName)
	ctx = context.WithValue(ctx, serviceKey{}, service)
	ctx = context.WithValue(ctx, methodKey{}, method)
	return ctx
}

// HandleRPC implements per-RPC stats reporting.
func (s *statsHandler) HandleRPC(ctx context.Context, rpcStats stats.RPCStats) {
	service, _ := ctx.Value(serviceKey{}).(string)
	method, _ := ctx.Value(methodKey{}).(string)

	switch rs := rpcStats.(type) {
	case *stats.InPayload:
		s.reporter.measureMessageReceived(service, method, float64(rs.WireLength))
	case *stats.OutPayload:
		s.reporter.measureMessageSent(service, method, float64(rs.WireLength))
	case *stats.Begin:
		s.reporter.incRPC(service, method)
	case *stats.End:
		code := codes.OK.String()
		if isError(rs.Error) {
			code = status.Code(rs.Error).String()
		}
		s.reporter.decRPC(service, method)
		s.reporter.countRPC(service, method, code)
		s.reporter.timeRPC(service, method, code, rs.EndTime.Sub(rs.BeginTime))
	}
}

// split splits a grpc request path into service and method strings
// request format /%s/%s
func split(request string) (string, string) {
	if i := strings.LastIndex(request, "/"); i >= 0 {
		return request[1:i], request[i+1:]
	}
	return "unknown", "unknown"
}

// isError returns false if the supplied error
// - is nil
// - has a codes.OK code
// - is io.EOF
func isError(err error) bool {
	if err == nil {
		return false
	}

	grpcErr := status.Convert(err)
	code := grpcErr.Code()
	if code == codes.OK {
		return false
	}

	eof := status.Convert(io.EOF)
	return code != eof.Code() || grpcErr.Message() != eof.Message()
}

repository: gravitational/teleport

repo_name: gravitational/teleport


text:
SUMMARY = "KDE Plasma Desktop"
LICENSE = "BSD-3-Clause & CC0-1.0 & GFDL-1.2-or-later & GPL-2.0-only & GPL-2.0-or-later & GPL-3.0-only & LGPL-2.0-only & LGPL-2.0-or-later & LGPL-2.1-only & LGPL-2.1-or-later & LGPL-3.0-only"
LIC_FILES_CHKSUM = " \
    file://LICENSES/BSD-3-Clause.txt;md5=954f4d71a37096249f837652a7f586c0 \
    file://LICENSES/CC0-1.0.txt;md5=65d3616852dbf7b1a6d4b53b00626032 \
    file://LICENSES/GFDL-1.2-or-later.txt;md5=9f58808219e9a42ff1228309d6f83dc6 \
    file://LICENSES/GPL-2.0-only.txt;md5=9e2385fe012386d34dcc5c9863070881 \
    file://LICENSES/GPL-2.0-or-later.txt;md5=9e2385fe012386d34dcc5c9863070881 \
    file://LICENSES/GPL-3.0-only.txt;md5=49fc03046e56a282c0c743b5d3a55b7c \
    file://LICENSES/LGPL-2.0-only.txt;md5=da48810c4ddf8e49efa031294a26b98c \
    file://LICENSES/LGPL-2.0-or-later.txt;md5=da48810c4ddf8e49efa031294a26b98c \
    file://LICENSES/LGPL-2.1-only.txt;md5=147a320ed8b16b036829a0c71d424153 \
    file://LICENSES/LGPL-2.1-or-later.txt;md5=147a320ed8b16b036829a0c71d424153 \
    file://LICENSES/LGPL-3.0-only.txt;md5=8d51f5b5fd447f7a1040c3dc9f0a8de6 \
"

inherit kde-plasma gettext mime-xdg

DEPENDS += " \
    wayland-native \
    qtwayland-native \
    kcoreaddons-native \
    kpackage-native \
    sonnet-native \
    kdoctools-native kdoctools \
    kauth-native \
    kdesignerplugin-native \
    kcmutils-native \
    kdelibs4support-native \
    \
    libcanberra \
    \
    qtsvg \
    qtdeclarative \
    \
    plasma-framework \
    ki18n \
    kcmutils \
    kdelibs4support \
    knewstuff \
    knotifyconfig \
    attica \
    kwallet \
    krunner \
    plasma-workspace \
    kwin \
    kitemmodels \
    kemoticons \
    baloo \
    kpeople \
    kactivities-stats \
    \
    ${@bb.utils.contains("DISTRO_FEATURES", "x11", "virtual/libx11 libxcb libxkbfile qtx11extras", "", d)} \
"

# REVISIT optionals: find_package(PackageKitQt5 0.9)
DEPENDS += " \
    kactivities \
    libusb1 \
    fontconfig \
"

PV = "${PLASMA_VERSION}"
SRC_URI[sha256sum] = "7f4cfe291f3c41b5d046a196c787854ba368c40020019171d5e26a2d1635c201"

FILES_SOLIBSDEV = "${libdir}/libkfont*${SOLIBSDEV}"

FILES:${PN} += " \
    ${datadir}/k* \
    ${datadir}/appdata \
    ${datadir}/config.kcfg \
    ${datadir}/color-schemes \
    ${datadir}/plasma \
    ${datadir}/dbus-1 \
    ${datadir}/icons \
    ${datadir}/polkit-1 \
    ${datadir}/solid \
    \
    ${libdir}/libkdeinit5_kaccess.so \
    ${OE_QMAKE_PATH_QML} \
    ${OE_QMAKE_PATH_PLUGINS} \
    ${libdir}/kconf_update_bin \
"

RDEPENDS:${PN} += " \
    qtgraphicaleffects \
    qtquickcontrols-qmlplugins \
    gawk \
"


text:
DESCRIPTION = "Controls CD/DVD drive speed"
LICENSE = "GPLv2"
SRC_URI = "file://*"

S = "${WORKDIR}"

do_compile() {
	${CC} speedcontrol.c -o ${PN}
}

do_install() {
	install -d ${D}/usr/bin
	install -m 755 ${PN} ${D}/usr/bin/${PN}
}

gha_language: C


text:
#
#   Copyright (C) 2015 Pelagicore AB
#
DESCRIPTION = "Python Qt5 Bindings"
HOMEPAGE = "http://riverbankcomputing.co.uk"
AUTHOR = "Phil Thomson @ riverbank.co.uk"
SECTION = "devel/python"
LICENSE = "GPLv2 & GPLv3 & GPL_EXCEPTION"
LIC_FILES_CHKSUM = "file://LICENSE;md5=40f9996e677b16c4cc0bc1886c8af247"

DEPENDS = "sip-native5 python-sip5"
RDEPENDS_${PN} = "python-core"

PYQT_OE_VERSION = "Qt_5_0_1"
PR = "r5"

SRC_URI = "http://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.0/PyQt-gpl-5.0.tar.gz"
SRC_URI[md5sum] = "771b3d680a905ab5b6a13fa8707dc70a"
SRC_URI[sha256sum] = "1357216021e16f147d76d7ad618756cbdc7fc45e5a13de3cc540920b31da693d"
SRC_URI += "file://pyqt-pkgconfig-python.patch"
S = "${WORKDIR}/PyQt-gpl-5.0/"

inherit sip5 distutils-base qmake5
OE_QMAKE_PATH_HEADERS = "${OE_QMAKE_PATH_QT_HEADERS}"
B = "${S}"

PARALLEL_MAKE = ""

QMAKE_PROFILES = "pyqt.pro"
# NOTE: has to match with MIN(qt version we have in OE, last known Qt version by SIP/PyQt)
EXTRA_SIPTAGS = "-tWS_X11 -t${PYQT_OE_VERSION} -xVendorID -xPyQt_SessionManager -xPyQt_Accessibility"
###EXTRA_OEMAKE = " MAKEFLAGS= "

# arm and mips need extra params for the qreal issue
EXTRA_SIPTAGS_append_arm = " -x PyQt_qreal_double"
EXTRA_SIPTAGS_append_mipsel = " -x PyQt_qreal_double"

SIP_MODULES = "QtCore QtDBus"
MAKE_MODULES = "qpy ${SIP_MODULES}"

EXTRA_QMAKEVARS_POST += "\
    INCLUDEPATH+=${OE_QMAKE_PATH_HEADERS}/Qt \
    INCLUDEPATH+=${STAGING_INCDIR}/${PYTHON_DIR} \
    INCLUDEPATH+=../qpy/QtCore \
    INCLUDEPATH+=../qpy/QtGui \
    INCLUDEPATH+=../qpy/QtDBus \
    INCLUDEPATH+=../qpy/QtOpenGL \
    INCLUDEPATH+=${STAGING_INCDIR}/${QT_DIR_NAME}/QtCore \
    INCLUDEPATH+=${STAGING_INCDIR}/${QT_DIR_NAME}/QtGui \
    INCLUDEPATH+=${STAGING_INCDIR}/${QT_DIR_NAME}/QtDBus \
    INCLUDEPATH+=${STAGING_INCDIR}/${QT_DIR_NAME}/QtWebKit \
    INCLUDEPATH+=${STAGING_INCDIR}/${QT_DIR_NAME}/QtNetwork \
    INCLUDEPATH+=${STAGING_INCDIR}/${QT_DIR_NAME}/QtOpenGL \
"
FIX_QREAL = "\
"

do_generate_prepend() {
    for i in ${FIX_QREAL}; do
        sed -i -e s,qreal,float,g sip/$i
    done
}

do_configure_prepend() {
    printf "TEMPLATE=subdirs\nSUBDIRS=${MAKE_MODULES}\n" >pyqt.pro
    printf "TEMPLATE=subdirs\nSUBDIRS=QtCore QtDBus\n" >qpy/qpy.pro
    ln -sf ./qpycore.pro qpy/QtCore/QtCore.pro
    ln -sf ./qpydbus.pro qpy/QtDBus/QtDBus.pro
#    ln -sf ./qpygui.pro qpy/QtGui/QtGui.pro
#    ln -sf ./qpopengl.pro qpy/QtOpenGL/QtOpenGL.pro
    echo "INCLUDEPATH+=${S}/QtCore" >>qpy/QtCore/QtCore.pro
    echo "INCLUDEPATH+=${S}/QtDBus" >>qpy/QtDBus/QtDBus.pro
#    echo "INCLUDEPATH+=${S}/QtGui" >>qpy/QtCore/QtGui.pro
#    echo "INCLUDEPATH+=${S}/QtOpenGL" >>qpy/QtCore/QtOpenGL.pro
    echo "LIBS+=-L../qpy/QtCore/ -lqpycore" >>QtCore/QtCore.pro
    echo "CONFIG += link_pkgconfig" >>QtCore/QtCore.pro
    echo "PKGCONFIG += python" >>QtCore/QtCore.pro
#    echo "LIBS+=-L../qpy/QtDBus/ -lqpydbus" >>QtDBus/QtDBus.pro
#    echo "LIBS+=-L../qpy/QtGui/ -lqpygui" >>QtGui/QtGui.pro
#    echo "LIBS+=-L../qpy/QtOpenGL/ -lqpyopengl" >>QtOpenGL/QtOpenGL.pro
    # hack for broken generated code (duplicated sipCpp declaration).
    patch -p1 < ${WORKDIR}/pyqt-generated.patch || echo "pyqt-generated.patch failed to apply, probably reexecuting do_configure, ignoring that"
    sed 's#@@PYQT_SIP_FLAGS@@#${EXTRA_SIPTAGS}#g' qpy/QtCore/qpycore_post_init.cpp.in > qpy/QtCore/qpycore_post_init.cpp
}

do_install() {
    install -d ${D}${libdir}/${PYTHON_DIR}/site-packages/PyQt5
    install -d ${D}${datadir}/sip/qt/
    for module in ${SIP_MODULES}
    do
        install -m 0644 ${S}/sip/${module}/*.sip ${D}${datadir}/sip/qt/
        echo "from PyQt5.${module} import *\n" >> ${D}${libdir}/${PYTHON_DIR}/site-packages/PyQt5/Qt.py
        install -m 0755 ${module}/lib${module}.so ${D}${libdir}/${PYTHON_DIR}/site-packages/PyQt5/${module}.so
    done
    cp __init__.py ${D}${libdir}/${PYTHON_DIR}/site-packages/PyQt5/
}

FILES_${PN} = "${libdir}/${PYTHON_DIR}/site-packages ${datadir}/sip/qt/"

repository: socec/meta-bistro

repo_name: socec/meta-bistro


text:
inherit esw deploy

ESW_COMPONENT_SRC = "/lib/sw_apps/peripheral_tests/src/"

DEPENDS += "libxil xiltimer"

inherit python3native

do_configure:prepend() {
    (
    cd ${S}
    lopper ${DTS_FILE} -- baremetallinker_xlnx.py ${ESW_MACHINE} ${S}/${ESW_COMPONENT_SRC}
    install -m 0755 *.cmake ${S}/${ESW_COMPONENT_SRC}/
    cp -rf ${S}/scripts/linker_files/ ${S}/${ESW_COMPONENT_SRC}/linker_files
    install -m 0644 ${S}/cmake/UserConfig.cmake ${S}/${ESW_COMPONENT_SRC}
    )
}

python do_generate_app_data() {
    import glob, subprocess, os

    system_dt = glob.glob(d.getVar('DTS_FILE'))
    srcdir = glob.glob(d.getVar('S'))
    src_dir = glob.glob(d.getVar('OECMAKE_SOURCEPATH'))
    machine = d.getVar('ESW_MACHINE')

    if len(system_dt) == 0:
        bb.error("Couldn't find device tree %s" % d.getVar('DTS_FILE'))

    if len(src_dir) == 0:
        bb.error("Couldn't find source dir %s" % d.getVar('OECMAKE_SOURCEPATH'))

    driver_name = d.getVar('REQUIRED_MACHINE_FEATURES')
    command = ["lopper"] + ["-f"] + ["-O"] + [src_dir[0]] + [system_dt[0]] + ["--"] + ["baremetal_gentestapp_xlnx"] + [machine] + [srcdir[0]]
    subprocess.run(command, check = True)
}
addtask do_generate_app_data before do_configure after do_prepare_recipe_sysroot
do_prepare_recipe_sysroot[rdeptask] = "do_unpack"

PERIPHERAL_TEST_APP_IMAGE_NAME ??= "${BPN}"

inherit image-artifact-names

PERIPHERAL_TEST_BASE_NAME ?= "${PERIPHERAL_TEST_APP_IMAGE_NAME}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}${IMAGE_VERSION_SUFFIX}"

ESW_COMPONENT ??= "peripheral_tests.elf"

do_compile:append() {
    ${OBJCOPY} -O binary ${B}/${ESW_COMPONENT} ${B}/peripheral_tests.bin
}

do_install() {
    :
}

do_deploy() {
    install -Dm 0644 ${B}/${ESW_COMPONENT} ${DEPLOYDIR}/${PERIPHERAL_TEST_BASE_NAME}.elf
    ln -sf ${PERIPHERAL_TEST_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf
    install -m 0644 ${B}/peripheral_tests.bin ${DEPLOYDIR}/${PERIPHERAL_TEST_BASE_NAME}.bin
    ln -sf ${PERIPHERAL_TEST_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin
}
addtask deploy before do_build after do_install

repository: Xilinx/meta-xilinx

repo_name: Xilinx/meta-xilinx


text:
//
// +build small

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

Copyright 2015 Intel Corporation

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

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

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

package osv

import (
	"testing"

	"github.com/intelsdi-x/snap-plugin-collector-osv/osv/httpmock"

	"github.com/intelsdi-x/snap/core"

	. "github.com/smartystreets/goconvey/convey"
)

func TestCpuPlugin(t *testing.T) {
	httpmock.Mock = true

	Convey("getcpuTime Should return cputime value", t, func() {

		defer httpmock.ResetResponders()
		httpmock.RegisterResponder("GET", "http://192.168.192.200:8000/trace/count", `{"time_ms": 144123232, "list": []}`, 200)

		cpuTime, err := getCPUTime("http://192.168.192.200:8000")
		So(err, ShouldBeNil)
		So(cpuTime, ShouldEqual, 144123232)

	})
	Convey("CpuStat Should return pluginMetricType Data", t, func() {

		defer httpmock.ResetResponders()
		httpmock.RegisterResponder("GET", "http://192.168.192.200:8000/trace/count", `{"time_ms": 144123232, "list": []}`, 200)

		ns := core.NewNamespace("intel", "osv", "cpu", "cputime")
		cpuTime, err := cpuStat(ns, "http://192.168.192.200:8000")
		So(err, ShouldBeNil)
		So(cpuTime.Namespace(), ShouldResemble, ns)
		So(cpuTime.Data_, ShouldEqual, 144123232)

	})
}

repository: intelsdi-x/snap-plugin-collector-osv

repo_name: intelsdi-x/snap-plugin-collector-osv


text:
set(CMAKE_AR                        llvm-ar-10${CMAKE_EXECUTABLE_SUFFIX})
set(CMAKE_ASM_COMPILER              clang-10${CMAKE_EXECUTABLE_SUFFIX})
set(CMAKE_C_COMPILER                clang-10${CMAKE_EXECUTABLE_SUFFIX})
set(CMAKE_CXX_COMPILER              clang++-10${CMAKE_EXECUTABLE_SUFFIX})
set(CMAKE_LINKER                    lld-10${CMAKE_EXECUTABLE_SUFFIX})
set(CMAKE_OBJCOPY                   llvm-objcopy-10${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "")
set(CMAKE_RANLIB                    llvm-ranlib-10${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "")
set(CMAKE_SIZE                      llvm-size-10${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "")
set(CMAKE_STRIP                     llvm-strip-10${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "")
set(CMAKE_GCOV                      llvm-cov-10${CMAKE_EXECUTABLE_SUFFIX} CACHE INTERNAL "")

set(CMAKE_C_FLAGS                   "${APP_C_FLAGS}" CACHE INTERNAL "")
set(CMAKE_CXX_FLAGS                 "${APP_CXX_FLAGS} ${CMAKE_C_FLAGS}" CACHE INTERNAL "")

set(CMAKE_C_FLAGS_DEBUG             "-O0 -g" CACHE INTERNAL "")
set(CMAKE_C_FLAGS_RELEASE           "-O3 -DNDEBUG" CACHE INTERNAL "")
set(CMAKE_CXX_FLAGS_DEBUG           "${CMAKE_C_FLAGS_DEBUG}" CACHE INTERNAL "")
set(CMAKE_CXX_FLAGS_RELEASE         "${CMAKE_C_FLAGS_RELEASE}" CACHE INTERNAL "")

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

repository: kubasejdak/platform

repo_name: kubasejdak/platform


text:
/*
Copyright The Kubernetes Authors.

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

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

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

// Code generated by applyconfiguration-gen. DO NOT EDIT.

package v1

import (
	v1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)

// CustomResourceSubresourcesApplyConfiguration represents an declarative configuration of the CustomResourceSubresources type for use
// with apply.
type CustomResourceSubresourcesApplyConfiguration struct {
	Status *v1.CustomResourceSubresourceStatus               `json:"status,omitempty"`
	Scale  *CustomResourceSubresourceScaleApplyConfiguration `json:"scale,omitempty"`
}

// CustomResourceSubresourcesApplyConfiguration constructs an declarative configuration of the CustomResourceSubresources type for use with
// apply.
func CustomResourceSubresources() *CustomResourceSubresourcesApplyConfiguration {
	return &CustomResourceSubresourcesApplyConfiguration{}
}

// WithStatus sets the Status field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Status field is set to the value of the last call.
func (b *CustomResourceSubresourcesApplyConfiguration) WithStatus(value v1.CustomResourceSubresourceStatus) *CustomResourceSubresourcesApplyConfiguration {
	b.Status = &value
	return b
}

// WithScale sets the Scale field in the declarative configuration to the given value
// and returns the receiver, so that objects can be built by chaining "With" function invocations.
// If called multiple times, the Scale field is set to the value of the last call.
func (b *CustomResourceSubresourcesApplyConfiguration) WithScale(value *CustomResourceSubresourceScaleApplyConfiguration) *CustomResourceSubresourcesApplyConfiguration {
	b.Scale = value
	return b
}

repository: kubernetes/apiextensions-apiserver

repo_name: kubernetes/apiextensions-apiserver


text:
@MASTERSTHESIS{KEYG,
  author = {A, B and C, D and E, F and G, H},
  title = {xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxx xx xxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxx
	xxxxxxxxxxxxxxx xxx xxxxxxxxxxxxxxxxxx},
  school = {xxxxxxxxxx xxxxxxx},
  type = {Masterarbeit},
  year = {2020},
}

@MASTERSTHESIS{KEYH,
   author = {A, B and C, D and E, F},
   title = {xxxxxxxxxxx xxx xxxxxxxxx xxxxx xxxxxxxx xxx xxxxxxxxxx xxx xxxxxxxxxxxxxxxxxxxxxxxxxxx
      xx xxxxxx xxx xxxxxxxxxxxx xxxxxxxxxxx xx xxxxxxxxxxxx xxxxxxxxxxxxxxxx},
   school = {xxxxxxxxxx xxxxxxxx xxxxxxxx xxx xxxxxxxxxxxxx xxxxxxxxxxxxxxx
      xxx xxxxxxxxxxxxxxx},
   type = {Diplomarbeit},
   year = {2019},
}

gha_license_id: NOASSERTION


text:
package vcs

import (
	"io"
)

type no struct {
	CommonVCS
}

func (v no) Identify(dir string, out io.Writer) bool {
	v.CurrentCommit = ""
	v.CurrentBranch = ""

	return true
}

func (v no) Name() string {
	return "none"
}

var _ VCS = &no{}

repository: fossabot/build-tools

repo_name: fossabot/build-tools


text:
#include <Arduino.h>
#include "flipDotNanoGFX.h"
#include <TimerOne.h>

FlipDotNanoGFX display(28, 24, 1, StackMode::kRow);

const int debugPin1 = 8;
const int debugPin2 = 8;

void setup() {
   Serial.begin(115200);

  display.clearScreen();
  display.endWrite();

  pinMode(debugPin1, OUTPUT);
  pinMode(debugPin2, OUTPUT);
  digitalWrite(debugPin1, LOW);
  digitalWrite(debugPin2, HIGH);

//    Timer1.initialize();
//    Timer1.attachInterrupt(timerCallback);
//    Timer1.stop();
  display.fillScreen(0);
  display.endWrite();

}

void loop() {

  digitalWrite(debugPin1, HIGH);

  //delay(5);
  while(!display.updateNext()) {
    //delayMicroseconds(1);
  }

  digitalWrite(debugPin1, LOW);
  delay(1);
  return;

/*

  display.fillScreen(1);
  display.endWrite();
  delay(3000);
  display.fillScreen(0);
  display.endWrite();
  delay(3000);
  */
}

repository: cazacov/FlipDot

repo_name: cazacov/FlipDot


text:
DESCRIPTION = "Poptop is the PPTP server solution for Linux Using Poptop, \
Linux servers can now function seamlessly in a PPTP VPN environment. This \
enables administrators to leverage the considerable benefits of both \
Microsoft and Linux operating systems The current release version supports \
Windows 95/98/Me/NT/2000/XP PPTP clients and Linux PPTP clients"
HOMEPAGE = "http://www.poptop.org/"
SECTION = "network"
LICENSE = "GPL"
RDEPENDS_${PN} = "ppp"
RDEPENDS_${PN}-logwtmp-plugin = "${PN}"
PR = "r5"

SRC_URI = "${SOURCEFORGE_MIRROR}/poptop/pptpd-${PV}.tar.gz \
           file://fix-plugins-install.patch \
           file://pptpd.init"

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

inherit autotools update-rc.d

do_install_append() {
        # Install init script
        install -m 0755 -d ${D}${sysconfdir}/init.d
        install -m 0755 ${WORKDIR}/pptpd.init ${D}${sysconfdir}/init.d/pptpd
        # Install
        install -d ${D}${sbindir} ${D}/${sysconfdir} ${D}/${sysconfdir}/ppp
        install -m 0644 samples/options.pptpd ${D}/${sysconfdir}/ppp/
        install -m 0644 samples/pptpd.conf ${D}/${sysconfdir}/

        # broken
	sed -ri "s,^[:space:]*logwtmp[:space:]*,# logwtmp," ${D}/${sysconfdir}/pptpd.conf
        rm -f ${D}${libdir}/pptpd/pptpd-logwtmp.so
	# Use mppe option in OE style
	sed -ri "s|^[[:space:]]*require-mppe-128[[:space:]]*$|mppe required,no40,no56|" ${D}/${sysconfdir}/ppp/options.pptpd
	echo "# don't expose open port by default" >> ${D}/${sysconfdir}/pptpd.conf
	echo "listen  127.0.0.1" >> ${D}/${sysconfdir}/pptpd.conf
}

PACKAGES = "${PN}-dbg ${PN}-bcrelay ${PN} ${PN}-doc"

FILES_${PN}-bcrelay = "${sbindir}/bcrelay"

CONFFILES_${PN} = "${sysconfdir}/pptpd.conf \
                   ${sysconfdir}/ppp/options.pptpd"

INITSCRIPT_NAME = "pptpd"
INITSCRIPT_PARAMS = "defaults 92 8"

SRC_URI[md5sum] = "b38df9c431041922c997c1148bedf591"
SRC_URI[sha256sum] = "c23a9bdd219a0a36ae7ca20e7c9749f2efdcdbf108aabeeeb5066ba442ec88b6"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty


text:
@article{Jun2011,
 abstract = {ROBO1 is a strong candidate gene for age-related macular degeneration (AMD) based upon its location under a linkage peak on chromosome 3p12, its expression pattern, and its purported function in a pathway that includes RORA, a gene previously associated with risk for neovascular AMD. Previously, we observed that expression of ROBO1 and RORA is down-regulated among wet AMD cases, as compared to their unaffected siblings. Thus, we hypothesized that contribution of association signals in ROBO1, and interaction between these two genes may be important for both wet and dry AMD. We evaluated association of 19 single nucleotide polymorphisms (SNPs) in ROBO1 with wet and dry stages of AMD in a sibling cohort and a Greek case-control cohort containing 491 wet AMD cases, 174 dry AMD cases and 411 controls. Association signals and interaction results were replicated in an independent prospective cohort (1070 controls, 164 wet AMD cases, 293 dry AMD cases). The most significantly associated ROBO1 SNPs were rs1387665 under an additive model (meta P = 0.028) for wet AMD and rs9309833 under a recessive model (meta P = 6×10 -4) for dry AMD. Further analyses revealed interaction between ROBO1 rs9309833 and RORA rs8034864 for both wet and dry AMD (interaction P\textless0.05). These studies were further supported by whole transcriptome expression profile studies from 66 human donor eyes and chromatin immunoprecipitation assays from mouse retinas. These findings suggest that distinct ROBO1 variants may influence the risk of wet and dry AMD, and the effects of ROBO1 on AMD risk may be modulated by RORA variants. \textcopyright 2011 Jun et al.},
 author = {Jun, G. and Nicolaou, M. and Morrison, M.A. and Buros, J. and Morgan, D.J. and Radeke, M.J. and Yonekawa, Y. and Tsironi, E.E. and Kotoula, M.G. and Zacharaki, F. and Mollema, N. and Yuan, Y. and Miller, J.W. and Haider, N.B. and Hageman, G.S. and Kim, I.K. and Schaumberg, D.A. and Farrer, L.A. and DeAngelis, M.M.},
 doi = {10.1371/journal.pone.0025775},
 issn = {19326203},
 journal = {PLoS ONE},
 number = {10},
 title = {Influence of ROBO1 and RORA on risk of age-related macular degeneration reveals genetically distinct phenotypes in disease pathophysiology},
 volume = {6},
 year = {2011}
}

repository: jburos/another-biostats-blog

repo_name: jburos/another-biostats-blog


text:
inherit task

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"

DEPENDS += "libusb1 fftw python alsa-lib jack boost cppunit swig \
            python python-numpy git util-linux gsl python-cheetah git \
            pkgconfig \
            "

RDEPENDS_${PN} += "task-sdk-target libusb1-dev fftwf-dev \
             alsa-dev alsa-lib-dev jack-dev \
             cppunit-dev swig python-dev python-numpy-dev python-textutils \
             python-distutils python-re python-stringold python-lang \
             python-threading python-unittest python-shell python-pickle \
             python-pprint python-compiler python-pkgutil python-pydoc \
             python-mmap python-netclient python-difflib python-compile \
             python-cheetah python-netserver python-xml cmake \
             boost boost-dev gsl-dev git pkgconfig-dev \
             util-linux util-linux-swaponoff \
             "

ALLOW_EMPTY = "1"
PACKAGES = "${PN}"

repository: mmoselhy/meta-ettus

repo_name: mmoselhy/meta-ettus


text:
package tool

import (
	"fmt"
	"strings"
)

type WhereQuery struct {
	Filter      bool
	QuerySql    string        // where sql
	Queries     []string      // where 条件
	QueryParams []interface{} // ? 的参数
}

// GenerateWhere 生成 where 条件的 SQL
// filterEmpty 是否排除空参数
/*wheres := map[string]interface{}{
	"username": []string{"like", "admin%|editor"}, // or查询 不加任何 % 为默认 %admin%
	"username": []string{"like", "admin%"}, // 不加任何 % 为默认 %admin%
	"email":    []string{"in", "admin,dd,gg,ee"},
	"or": map[string]interface{}{
		"username": []string{"like", "admin"},
		"age":      8,
	},
	"age": 6,
	"updated_at": "null",
	"created_at": "not null",
}*/
func (w *WhereQuery) GenerateWhere(wheres map[string]interface{}) *WhereQuery {
	if len(wheres) == 0 {
		return nil
	}
	//sqlParams := make([]string, 0)
	for field, val := range wheres {
		switch val.(type) {
		case string:
			if w.Filter && len(val.(string)) == 0 {
				continue
			}
			w.stringWhere(field, val.(string))
		case int, int8, int16, int32, int64, float64, float32:
			w.Queries = append(w.Queries, fmt.Sprintf("`%s`=?", field))
			w.QueryParams = append(w.QueryParams, val)
		case []string:
			w.mapWhere(field, val.([]string))
		case []interface{}:
			w.mapInWhere(field, val.([]interface{}))
		case map[string]interface{}:
			w.orWhere(val.(map[string]interface{}))
		default:
			panic("unknown where type, key: " + field)
		}
	}
	w.QuerySql = strings.Join(w.Queries, " AND ")
	return w
}

// mapInWhere
func (w *WhereQuery) mapInWhere(field string, whereSlice []interface{}) {
	if len(whereSlice) != 2 {
		panic("WHERE 子条件组装有误")
	}
	w.Queries = append(w.Queries, fmt.Sprintf("`%s` IN ?", field))
	w.QueryParams = append(w.QueryParams, whereSlice[1])
	return
}

func (w *WhereQuery) mapWhere(field string, whereSlice []string) {
	if len(whereSlice) != 2 && len(whereSlice) != 3 {
		panic("WHERE 子条件组装有误")
	}
	if w.Filter && len(whereSlice[1]) == 0 {
		return
	}
	switch strings.ToLower(whereSlice[0]) {
	case "like":
		if strings.Contains(whereSlice[1], "|") {
			w.orValWhere(field, whereSlice[1], "like")
		} else {
			w.Queries = append(w.Queries, fmt.Sprintf("`%s` LIKE ?", field))
			w.QueryParams = append(w.QueryParams, w.likeFormat(whereSlice[1]))
		}
	case "lt", "<":
		w.Queries = append(w.Queries, fmt.Sprintf("`%s` < ?", field))
		w.QueryParams = append(w.QueryParams, whereSlice[1])
	case "elt", "<=":
		w.Queries = append(w.Queries, fmt.Sprintf("`%s` <= ?", field))
		w.QueryParams = append(w.QueryParams, whereSlice[1])
	case "gt", ">":
		w.Queries = append(w.Queries, fmt.Sprintf("`%s` > ?", field))
		w.QueryParams = append(w.QueryParams, whereSlice[1])
	case "egt", ">=":
		w.Queries = append(w.Queries, fmt.Sprintf("`%s` >= ?", field))
		w.QueryParams = append(w.QueryParams, whereSlice[1])
	case "neq", "!=", "<>":
		w.Queries = append(w.Queries, fmt.Sprintf("`%s` != ?", field))
		w.QueryParams = append(w.QueryParams, whereSlice[1])
	case "between":
		w.Queries = append(w.Queries, fmt.Sprintf("`%s` BETWEEN ? AND ?", field))
		w.QueryParams = append(w.QueryParams, whereSlice[1], whereSlice[2])
	default:
		panic("unknown key type: " + whereSlice[0])
	}

	return
}

// orWhere
func (w *WhereQuery) orWhere(wheres map[string]interface{}) {
	whereMap := make([]string, 0)
	for field, val := range wheres {
		switch val.(type) {
		case string:
			if w.Filter && len(val.(string)) == 0 {
				continue
			}
			whereMap = append(whereMap, fmt.Sprintf("`%s`=?", field))
			w.QueryParams = append(w.QueryParams, val)
		case int, int8, int16, int32, int64, float64, float32:
			whereMap = append(whereMap, fmt.Sprintf("`%s`=?", field))
			w.QueryParams = append(w.QueryParams, val)
		case []string:
			whereField, whereVals := w.mapOrWhere(field, val.([]string))
			whereMap = append(whereMap, whereField...)
			w.QueryParams = append(w.QueryParams, whereVals...)
		default:
			panic("unknown where type, key: " + field)
		}
	}
	if len(whereMap) > 0 {
		w.Queries = append(w.Queries, "("+strings.Join(whereMap, " OR ")+")")
	}
	return
}

func (w *WhereQuery) mapOrWhere(field string, whereSlice []string) (whereMap []string, vals []interface{}) {
	if len(whereSlice) != 2 && len(whereSlice) != 3 {
		panic("WHERE 子条件组装有误")
	}
	if w.Filter && len(whereSlice[1]) == 0 {
		return
	}
	switch strings.ToLower(whereSlice[0]) {
	case "like":
		whereMap = append(whereMap, fmt.Sprintf("`%s` LIKE ?", field))
		vals = append(vals, w.likeFormat(whereSlice[1]))
	case "lt", "<":
		whereMap = append(whereMap, fmt.Sprintf("`%s` < ?", field))
		vals = append(vals, whereSlice[1])
	case "elt", "<=":
		whereMap = append(whereMap, fmt.Sprintf("`%s` <= ?", field))
		vals = append(vals, whereSlice[1])
	case "gt", ">":
		whereMap = append(whereMap, fmt.Sprintf("`%s` > ?", field))
		vals = append(vals, whereSlice[1])
	case "egt", ">=":
		whereMap = append(whereMap, fmt.Sprintf("`%s` >= ?", field))
		vals = append(vals, whereSlice[1])
	case "neq", "!=", "<>":
		whereMap = append(whereMap, fmt.Sprintf("`%s` != ?", field))
		vals = append(vals, whereSlice[1])
	case "between":
		whereMap = append(whereMap, fmt.Sprintf("`%s` BETWEEN ? AND ?", field))
		vals = append(vals, whereSlice[1], whereSlice[2])
	default:
		panic("unknown key type: " + whereSlice[0])
	}

	return
}

// orValWhere
func (w *WhereQuery) orValWhere(field, val, calc string) {
	values := strings.Split(val, "|")
	whereMap := make([]string, len(values))
	for k, v := range values {
		if strings.ToLower(calc) == "like" {
			v = w.likeFormat(v)
		}
		whereMap[k] = fmt.Sprintf("`%s` %s ?", field, calc)
		w.QueryParams = append(w.QueryParams, v)
	}
	w.Queries = append(w.Queries, "("+strings.Join(whereMap, " OR ")+")")
	return
}

// likeFormat
func (w *WhereQuery) likeFormat(s string) string {
	if hasBuf := strings.Contains(s, "%"); !hasBuf {
		s = "%" + s + "%"
	}
	return s
}

// stringWhere 字符串类型的值 = 号赋值情况
func (w *WhereQuery) stringWhere(field, val string) {
	if strings.Contains(val, "|") {
		w.orValWhere(field, val, "=")
	} else if strings.ToLower(val) == "null" {
		w.Queries = append(w.Queries, fmt.Sprintf("`%s` IS NULL", field))
	} else if strings.ToLower(val) == "not null" {
		w.Queries = append(w.Queries, fmt.Sprintf("`%s` IS NOT NULL", field))
	} else {
		w.Queries = append(w.Queries, fmt.Sprintf("`%s`=?", field))
		w.QueryParams = append(w.QueryParams, val)
	}
	return
}

repository: cxlcxl/go-test

repo_name: cxlcxl/go-test


text:
package common

import (
	"github.com/yuchanns/bullets/internal"
)

var Logger internal.ILogger

func init() {
	Logger = internal.NewBuiltinLogger()
}

repository: yuchanns/bullets

repo_name: yuchanns/bullets


text:
#----------------------------------------------------------------
# Generated CMake target import file for configuration "Debug".
#----------------------------------------------------------------

# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)

# Import target "unofficial::date::tz" for configuration "Debug"
set_property(TARGET unofficial::date::tz APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(unofficial::date::tz PROPERTIES
  IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
  IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/debug/lib/libtz.a"
  )

list(APPEND _IMPORT_CHECK_TARGETS unofficial::date::tz )
list(APPEND _IMPORT_CHECK_FILES_FOR_unofficial::date::tz "${_IMPORT_PREFIX}/debug/lib/libtz.a" )

# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)

repository: studoot/licenser-cpp

repo_name: studoot/licenser-cpp


text:
/*
Copyright (c) 2015, Scott Zuyderduyn
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the FreeBSD Project.
*/

//----------------------------------------------------------------------------
// algo/fill.hpp
//
// Extension of std::fill that recognizes device memory and can be called from
// host or device code.
//
// Author: Scott D. Zuyderduyn, Ph.D. (scott.zuyderduyn@utoronto.ca)
//----------------------------------------------------------------------------

#pragma once
#ifndef ECUDA_ALGO_FILL_HPP
#define ECUDA_ALGO_FILL_HPP

#include <iterator>
#include <vector>

#include "../global.hpp"
#include "../iterator.hpp"
//#include "../utility.hpp"

namespace ecuda {

// forward declaration
template<class ForwardIterator,typename T> __HOST__ __DEVICE__ inline void fill( ForwardIterator first, ForwardIterator last, const T& val );

/// \cond DEVELOPER_DOCUMENTATION
namespace impl {

namespace fill_device {

template<class ForwardIterator,typename T>
__HOST__ __DEVICE__ inline void fill(
	ForwardIterator first, ForwardIterator last,
	const T& val
)
{
	#ifdef __CUDA_ARCH__
	while( first != last ) { *first = val; ++first; }
	#else
	typedef typename ecuda::iterator_traits<ForwardIterator>::is_contiguous iterator_contiguity;
	{
		const bool isContiguous = ecuda::is_same<iterator_contiguity,ecuda::true_type>::value;
		ECUDA_STATIC_ASSERT(isContiguous,CANNOT_FILL_RANGE_REPRESENTED_BY_NONCONTIGUOUS_DEVICE_ITERATOR);
	}
	typename ecuda::iterator_traits<ForwardIterator>::difference_type n = ecuda::distance( first, last );
	typedef typename ecuda::iterator_traits<ForwardIterator>::value_type value_type;
	CUDA_CALL( cudaMemset<value_type>( first.operator->(), val, static_cast<std::size_t>(n) ) );
	#endif
}

template<typename T,typename P>
__HOST__ __DEVICE__ inline void fill(
	device_contiguous_block_iterator<T,P> first, device_contiguous_block_iterator<T,P> last,
	const T& val
)
{
	#ifdef __CUDA_ARCH__
	while( first != last ) { *first = val; ++first; }
	#else
	typedef device_contiguous_block_iterator<T,P> input_iterator_type;
	typename ecuda::iterator_traits<input_iterator_type>::difference_type n = std::distance( first, last );
	if( first.get_offset() ) {
		const int leading = first.get_width() - first.get_offset();
		::ecuda::fill( first.contiguous_begin(), first.contiguous_begin()+leading, val );
		first += leading;
		n -= leading;
	}
	const int rows = n / first.get_width();
	typedef typename ecuda::iterator_traits< device_contiguous_block_iterator<T,P> >::value_type value_type;
	typedef typename ecuda::add_pointer<value_type>::type pointer_type;
	CUDA_CALL( cudaMemset2D<value_type>( naked_cast<pointer_type>(first.operator->()), first.operator->().get_pitch(), val, first.get_width(), rows ) );
	n -= rows * first.get_width();
	if( n ) ::ecuda::fill( first.contiguous_begin(), first.contiguous_begin()+n, val );
	#endif
}

} // namespace fill_device

ECUDA_SUPPRESS_HD_WARNINGS
template<class ForwardIterator,typename T>
__HOST__ __DEVICE__ inline void fill(
	ForwardIterator first, ForwardIterator last,
	const T& val,
	ecuda::true_type // device memory
)
{
	#ifdef __CUDA_ARCH__
	while( first != last ) { *first = val; ++first; }
	#else
	typedef typename ecuda::iterator_traits<ForwardIterator>::is_contiguous iterator_contiguity;
	typedef typename ecuda::iterator_traits<ForwardIterator>::iterator_category iterator_category;
	{
		const bool isSomeKindOfContiguous =
			ecuda::is_same<iterator_contiguity,ecuda::true_type>::value ||
			ecuda::is_same<iterator_category,device_contiguous_block_iterator_tag>::value;
		ECUDA_STATIC_ASSERT(isSomeKindOfContiguous,CANNOT_FILL_RANGE_REPRESENTED_BY_NONCONTIGUOUS_DEVICE_ITERATOR);
	}
	if( ecuda::is_same<typename ecuda::iterator_traits<ForwardIterator>::value_type,T>::value ) {
		fill_device::fill( first, last, val );
	} else {
		typedef typename ecuda::iterator_traits<ForwardIterator>::value_type value_type;
		const value_type val2( val );
		fill_device::fill( first, last, val2 );
	}
	#endif
}

template<class ForwardIterator,typename T>
__HOST__ __DEVICE__ inline void fill(
	ForwardIterator first, ForwardIterator last,
	const T& val,
	ecuda::false_type // host memory
)
{
	#ifdef __CUDA_ARCH__
	// never called from device code
	#else
	std::fill( first, last, val );
	#endif
}

} // namespace impl
/// \endcond

ECUDA_SUPPRESS_HD_WARNINGS
template<class ForwardIterator,typename T>
__HOST__ __DEVICE__ inline void fill( ForwardIterator first, ForwardIterator last, const T& val )
{
	impl::fill(
		first, last,
		val,
		typename ecuda::iterator_traits<ForwardIterator>::is_device_iterator()
	);
}

} // namespace ecuda

#endif

repository: chncwang/ecuda

repo_name: chncwang/ecuda

extension: hpp


text:
@ARTICLE{Gordon1984,
  author = {Dan Gordon and Israel Koren and Gabriel M. Silberman},
  title = {Embedding Tree Structures in {VLSI} Hexagonal Arrays},
  journal = {IEEE Transactions on Computers},
  year = {1984},
  volume = {C-33},
  pages = {104--107},
  number = {1},
  abstract = {Tree structures have been proposed for special-purpose and general-purpose multiprocessors due to their desirable property of logarithmic path from the root to any leaf element. Since only local communication among processors is needed in tree structures, they are well suited for the VLSI technology. Such an implementation requires an area-economical mapping of a tree on a plane. Novel mapping schemes for trees onto hexagonal arrays (or grids) and appropriate algorithms are proposed here and shown to be superior over known mappings on square arrays (or grids).},
  doi = {10.1109/TC.1984.5009319}
}

repository: vis-au/treevisnet

repo_name: vis-au/treevisnet