text:
package service

import (
	"fmt"
	"log"
	"net"
	"os"
	"os/signal"
	"syscall"

	"github.com/domainname/daemon"
	"github.com/domainname/whoisd/client"
	"github.com/domainname/whoisd/config"
	"github.com/domainname/whoisd/storage"
)

// Version of the Whois Daemon
// Date of current version release
const (
	Version = "0.1.0"
	Date    = "2014-08-02T12:01:33Z"
)

// Record - standard record (struct) for service package
type Record struct {
	Name   string
	Config *config.Record
	daemon.Daemon
}

// New - Create a new service record
func New(name, description string) (*Record, error) {
	daemonInstance, err := daemon.New(name, description)
	if err != nil {
		return nil, err
	}

	return &Record{name, config.New(), daemonInstance}, nil
}

// Run or manage the service
func (service *Record) Run() (string, error) {

	// if received any kind of command, do it
	if len(os.Args) > 1 {
		command := os.Args[1]
		switch command {
		case "install":
			return service.Install()
		case "remove":
			return service.Remove()
		case "start":
			return service.Start()
		case "stop":
			return service.Stop()
		case "status":
			return service.Status()
		}
	}

	// Load configuration and get mapping
	mapp, err := service.Config.Load()
	if err != nil {
		return "Loading mapping file was unsuccessful", err
	}

	// Logs for what is host&port used
	serviceHostPort := fmt.Sprintf("%s:%d", service.Config.Host, service.Config.Port)
	log.Printf("%s started on %s\n", service.Name, serviceHostPort)
	log.Printf("Used storage %s on %s:%d\n",
		service.Config.Storage.StorageType,
		service.Config.Storage.Host,
		service.Config.Storage.Port,
	)

	// Set up listener for defined host and port
	listener, err := net.Listen("tcp", serviceHostPort)
	if err != nil {
		return "Possibly was a problem with the port binding", err
	}

	// set up channel to collect client queries
	channel := make(chan client.Record, service.Config.Connections)

	// set up current storage
	repository := storage.New(service.Config, mapp)

	// init workers
	for i := 0; i < service.Config.Workers; i++ {
		go client.ProcessClient(channel, repository)
	}

	// This block is for testing purpose only
	if service.Config.TestMode == true {
		// make pipe connections for testing
		// connIn will ready to write into by function ProcessClient
		connIn, connOut := net.Pipe()
		defer connIn.Close()
		defer connOut.Close()
		newClient := client.Record{Conn: connIn}

		// prepare query for ProcessClient
		newClient.Query = []byte(service.Config.TestQuery)

		// send it into channel
		channel <- newClient
		// just read answer from channel pipe
		buffer := make([]byte, 4096)
		numBytes, err := connOut.Read(buffer)
		log.Println("Read bytes:", numBytes)
		return string(buffer), err
	}

	// Set up channel on which to send signal notifications.
	// We must use a buffered channel or risk missing the signal
	// if we're not ready to receive when the signal is sent.
	interrupt := make(chan os.Signal, 1)
	signal.Notify(interrupt, os.Interrupt, os.Kill, syscall.SIGTERM)

	// set up channel on which to send accepted connections
	listen := make(chan net.Conn, service.Config.Connections)
	go acceptConnection(listener, listen)

	// loop work cycle with accept connections or interrupt
	// by system signal
	for {
		select {
		case conn := <-listen:
			newClient := client.Record{Conn: conn}
			go newClient.HandleClient(channel)
		case killSignal := <-interrupt:
			log.Println("Got signal:", killSignal)
			log.Println("Stoping listening on ", listener.Addr())
			listener.Close()
			if killSignal == os.Interrupt {
				return "Daemon was interruped by system signal", nil
			}
			return "Daemon was killed", nil
		}
	}

	// never happen, but need to complete code
	return "If you see that, you are lucky bastard", nil
}

// Accept a client connection and collect it in a channel
func acceptConnection(listener net.Listener, listen chan<- net.Conn) {
	defer func() {
		if recovery := recover(); recovery != nil {
			log.Println("Recovered in ListenConnection:", recovery)
		}
	}()
	for {
		conn, err := listener.Accept()
		if err != nil {
			continue
		}
		listen <- conn
	}
}

repository: domainname/whoisd

repo_name: domainname/whoisd


text:
// Copyright 2018 SEQSENSE, 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.

/**
  Usage: go run . -host hoge-ats.iot.ap-northeast-1.amazonaws.com
*/

package main

import (
	"flag"
	"fmt"
	"os"
	"os/signal"
	"syscall"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/session"
	mqtt "github.com/eclipse/paho.mqtt.golang"
	awsiot "github.com/seqsense/aws-iot-device-sdk-go/v3"
	presigner "github.com/seqsense/aws-iot-device-sdk-go/v3/presigner"
)

func messageHandler(client mqtt.Client, msg mqtt.Message) {
	fmt.Printf("Message received\n")
	fmt.Printf("  topic: %s\n", msg.Topic())
	fmt.Printf("  payload: %s\n", msg.Payload())
}

var (
	thingName = flag.String("thing-name", "sample", "Thing name")
	region    = flag.String("region", "ap-northeast-1", "AWS region")
	host      = flag.String("host", "hoge-ats.iot.ap-northeast-1.amazonaws.com", "AWS IoT endpoint")
)

func main() {
	flag.Parse()
	sess := session.Must(session.NewSession())
	signer := presigner.New(sess, &aws.Config{Region: aws.String(*region)})
	endpoint, _ := signer.PresignWssNow(*host)

	o := &awsiot.Options{
		ClientID:                 *thingName,
		Region:                   *region,
		BaseReconnectTime:        time.Millisecond * 50,
		MaximumReconnectTime:     time.Second * 2,
		MinimumConnectionTime:    time.Second * 2,
		Keepalive:                time.Second * 2,
		URL:                      endpoint,
		Debug:                    true,
		Qos:                      1,
		Retain:                   false,
		Will:                     &awsiot.TopicPayload{Topic: "notification", Payload: "{\"status\": \"dead\"}"},
		OfflineQueueing:          true,
		OfflineQueueMaxSize:      100,
		OfflineQueueDropBehavior: "oldest",
		AutoResubscribe:          true,
		OnConnectionLost: func(opt *awsiot.Options, err error) {
			fmt.Printf("Connection lost handler function called\n")
			newEndpoint, err := signer.PresignWssNow(*host)
			if err != nil {
				panic(err)
			}
			opt.URL = newEndpoint
		},
	}
	cli := awsiot.New(o)
	cli.Connect()
	cli.Subscribe("test", 1, messageHandler)

	sig := make(chan os.Signal, 1)
	signal.Notify(sig, os.Interrupt, syscall.SIGTERM)

	tick := time.NewTicker(time.Second * 5)

	for {
		select {
		case <-sig:
			return
		case <-tick.C:
			cli.Publish("notification", 1, false, "{\"status\": \"tick\"}")
		}
	}
}

license_type: permissive

branch_name: refs/heads/master

extension: go


text:
// Copyright 2018 zxing2004 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.

package sort

// BubbleSort bubble sorting, rule parameter refers to the incoming sorting rule.
// from big to small, please pass the parameter "gt";
// from small to large, please pass the parameter "lt";
// BubbleSort 冒泡排序，rule参数指传入的排序规则
// 从大到小请传参数“gt”，从小到大请传参数“lt”.
func BubbleSort(arr *[]int, rule string) {
	for i := 0; i < len(*arr)-1; i++ {
		for j := 0; j < len(*arr)-i-1; j++ {
			if rule == "gt" && (*arr)[j] < (*arr)[j+1] {
				(*arr)[j], (*arr)[j+1] = (*arr)[j+1], (*arr)[j]
			}
			if rule == "lt" && (*arr)[j] > (*arr)[j+1] {
				(*arr)[j], (*arr)[j+1] = (*arr)[j+1], (*arr)[j]
			}
		}
	}
}

gha_language: Go


text:
# Copyright (C) 2010-2012 O.S. Systems Software Ltda. All Rights Reserved
# Released under the MIT license

DESCRIPTION = "FreeRDP RDP client & server library"
HOMEPAGE = "http://www.freerdp.com"
DEPENDS = "openssl alsa-lib libusb1"
SECTION = "net"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"

inherit pkgconfig cmake gitpkgv

PE = "1"
PKGV = "${GITPKGVTAG}"

SRCREV = "7471ae383e7b7a613f275e19f7b54958a193c891"
SRC_URI = "git://github.com/FreeRDP/FreeRDP.git;branch=stable-2.0;protocol=https \
           file://winpr-makecert-Build-with-install-RPATH.patch \
           "

S = "${WORKDIR}/git"

EXTRA_OECMAKE += " \
    -DWITH_ALSA=ON \
    -DWITH_FFMPEG=OFF \
    -DWITH_CUNIT=OFF \
    -DWITH_NEON=OFF \
    -DBUILD_STATIC_LIBS=OFF \
    -DCMAKE_POSITION_INDEPENDANT_CODE=ON \
    -DWITH_MANPAGES=OFF \
    -DPROXY_PLUGINDIR=${libdir}/freerdp/proxy/plugins \
"

PACKAGECONFIG ??= " \
    ${@bb.utils.filter('DISTRO_FEATURES', 'directfb pam pulseaudio wayland x11', d)}\
    gstreamer cups pcsc server \
"

X11_DEPS = "virtual/libx11 libxinerama libxext libxcursor libxv libxi libxrender libxfixes libxdamage libxrandr libxkbfile"
PACKAGECONFIG[x11] = "-DWITH_X11=ON -DWITH_XINERAMA=ON -DWITH_XEXT=ON -DWITH_XCURSOR=ON -DWITH_XV=ON -DWITH_XI=ON -DWITH_XRENDER=ON -DWITH_XFIXES=ON -DWITH_XDAMAGE=ON -DWITH_XRANDR=ON -DWITH_XKBFILE=ON,-DWITH_X11=OFF,${X11_DEPS}"
PACKAGECONFIG[wayland] = "-DWITH_WAYLAND=ON,-DWITH_WAYLAND=OFF,wayland wayland-native libxkbcommon"
PACKAGECONFIG[directfb] = "-DWITH_DIRECTFB=ON,-DWITH_DIRECTFB=OFF,directfb"
PACKAGECONFIG[pam] = "-DWITH_PAM=ON,-DWITH_PAM=OFF,libpam"
PACKAGECONFIG[pcsc] = "-DWITH_PCSC=ON,-DWITH_PCSC=OFF,pcsc-lite"
PACKAGECONFIG[pulseaudio] = "-DWITH_PULSEAUDIO=ON,-DWITH_PULSEAUDIO=OFF,pulseaudio"
PACKAGECONFIG[gstreamer] = "-DWITH_GSTREAMER_1_0=ON,-DWITH_GSTREAMER_1_0=OFF,gstreamer1.0 gstreamer1.0-plugins-base"
PACKAGECONFIG[cups] = "-DWITH_CUPS=ON,-DWITH_CUPS=OFF,cups"
PACKAGECONFIG[server] = "-DWITH_SERVER=ON,-DWITH_SERVER=OFF"

PACKAGES =+ "libfreerdp"

LEAD_SONAME = "libfreerdp.so"
FILES:libfreerdp = "${libdir}/lib*${SOLIBS}"

PACKAGES_DYNAMIC += "^libfreerdp-plugin-.*"

do_configure:append() {
    sed -i -e 's|${WORKDIR}||g' ${B}/buildflags.h
}

# we will need winpr-makecert to generate TLS certificates
do_install:append () {
    install -d ${D}${bindir}
    install -m755 winpr/tools/makecert-cli/winpr-makecert ${D}${bindir}
    rm -rf ${D}${libdir}/cmake
    rm -rf ${D}${libdir}/freerdp
}

python populate_packages:prepend () {
    freerdp_root = d.expand('${libdir}/freerdp')

    do_split_packages(d, freerdp_root, r'^(audin_.*)\.so$',
        output_pattern='libfreerdp-plugin-%s',
        description='FreeRDP plugin %s',
        prepend=True, extra_depends='libfreerdp-plugin-audin')

    do_split_packages(d, freerdp_root, r'^(rdpsnd_.*)\.so$',
        output_pattern='libfreerdp-plugin-%s',
        description='FreeRDP plugin %s',
        prepend=True, extra_depends='libfreerdp-plugin-rdpsnd')

    do_split_packages(d, freerdp_root, r'^(tsmf_.*)\.so$',
        output_pattern='libfreerdp-plugin-%s',
        description='FreeRDP plugin %s',
        prepend=True, extra_depends='libfreerdp-plugin-tsmf')

    do_split_packages(d, freerdp_root, r'^([^-]*)\.so$',
        output_pattern='libfreerdp-plugin-%s',
        description='FreeRDP plugin %s',
        prepend=True, extra_depends='')
}

license: MIT

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_license_id: MIT

gha_language: BitBake

extension: bb


text:
# packagegroup definitions to help the GNSS-SDR community build images
# they like.

LICENSE = "MIT"

inherit packagegroup

PACKAGES = " \
    packagegroup-gnss-sdr-base \
    packagegroup-gnss-sdr-base-extended \
    packagegroup-gnss-sdr-buildessential \
    packagegroup-gnss-sdr-bin \
"

PROVIDES = "${PACKAGES}"

SUMMARY_packagegroup-gnss-sdr-base = "Required packages."
RDEPENDS_packagegroup-gnss-sdr-base = " \
    gnuradio \
    gflags \
    glog \
    armadillo \
    gtest \
    gnutls \
    log4cpp \
    matio \
    python3-mako \
    python3-six \
    pugixml \
    protobuf \
    rtl-sdr \
    libpcap \
    libiio \
    libad9361-iio \
    gnss-sdr-monitor \
    gnuplot \
    gnuplot-x11 \
    gpstk \
    pm-utils \
"

SUMMARY_packagegroup-gnss-sdr-bin = "GNSS-SDR binary."
RDEPENDS_packagegroup-gnss-sdr-bin = " \
    packagegroup-gnss-sdr-base \
    gnss-sdr \
"

SUMMARY_packagegroup-gnss-sdr-base-extended = "Basic packages for an image with regular UNIX utilities."
RDEPENDS_packagegroup-gnss-sdr-base-extended = "\
    alsa-utils \
    i2c-tools \
    screen \
    vim \
    vim-vimrc \
    htop \
    iw \
    git \
    sshfs-fuse \
    libudev \
    nano \
    nfs-utils-client \
    cifs-utils \
    openssh-sftp \
    openssh-sftp-server \
    procps \
    protobuf \
    ntp \
    ntpdate \
    ntp-utils \
    linux-firmware \
    libsodium \
    sqlite3 \
    tar \
    wget \
    zip \
    unzip \
    rsync \
    gdb \
    perf \
"

SUMMARY_packagegroup-gnss-sdr-buildessential = "Essential build dependencies"
RDEPENDS_packagegroup-gnss-sdr-buildessential = "\
    autoconf \
    automake \
    binutils \
    binutils-symlinks \
    cpp \
    cpp-symlinks \
    gcc \
    gcc-symlinks \
    g++ \
    g++-symlinks \
    gettext \
    glib-2.0 \
    make \
    ninja \
    libgfortran \
    libgfortran-dev \
    libstdc++ \
    libstdc++-dev \
    libtool \
    pkgconfig \
"


text:
@article{pop00004,
abstract = {Agent-based simulations are becoming widespread among scientists from different areas, who use them to model increasingly complex problems. To cope with the growing computational complexity, parallel and distributed implementations have been developed for a wide range of platforms. However, it is difficult to have simulations that are portable to different platforms while still achieving high performance. We present OpenABL, a domain-specific language for portable, high-performance, parallel agent modeling. It comprises an easy-to-program language that relies on high-level abstractions for programmability and explicitly exploits agent parallelism to deliver high performance. A source-to-source compiler translates the input code to a high-level intermediate representation exposing parallelism, locality and synchronization, and, thanks to an architecture based on pluggable backends, generates target code for multi-core CPUs, GPUs, large clusters and cloud systems. OpenABL has been evaluated on six applications from various fields such as ecology, animation, and social sciences. The generated code scales to large clusters and performs similarly to hand-written target-specific code, while requiring significantly fewer lines of codes.},
annote = {Query date: 2020-09-08 12:44:09},
author = {Cosenza, Biagio and Popov, Nikita and Juurlink, Ben and Richmond, Paul and Chimeh, Mozhgan Kabiri and Spagnuolo, Carmine and Cordasco, Gennaro and Scarano, Vittorio},
doi = {10.1007/978-3-319-96983-1_36},
isbn = {9783319969824},
issn = {16113349},
journal = {Proceedings European Conference on Parallel Processing (EuorPar)},
pages = {505--518},
publisher = {Springer},
title = {{OpenABL: A Domain-Specific Language for Parallel and Distributed Agent-Based Simulations}},
url = {https://link.springer.com/chapter/10.1007/978-3-319-96983-1{\_}36},
volume = {11014 LNCS},
year = {2018}
}

gha_language: HTML

extension: bib


text:
package reflect

import (
	"fmt"
	"reflect"
)

// AsIsMarshaller reads data as-is, without any conversion
func AsIsMarshaller(source interface{}, target interface{}) error {
	if k := reflect.TypeOf(target).Kind(); k != reflect.Ptr {
		return fmt.Errorf("Pointer target expected, but %s provided", k)
	}

	if k := reflect.TypeOf(source).Kind(); k == reflect.Ptr {
		return fmt.Errorf("Not-pointer source expected")
	}

	sk := reflect.TypeOf(source).Kind()
	tk := reflect.TypeOf(target).Elem().Kind()
	if sk == tk {
		// Same type
		reflect.ValueOf(target).Elem().Set(reflect.ValueOf(source))
		return nil
	}

	return fmt.Errorf("%s != %s", sk, tk)
}

repository: gorigin/config

repo_name: gorigin/config


text:
require swupdate-check.inc

PR = "${INC_PR}.0"

DISTRO_UPDATE_URL = "${DISTRO_UPDATE_URL_BASE}/gardena-update-image-bnw-${MACHINE}.swu"

branch_name: refs/heads/main


text:
cmake_policy(SET CMP0078 NEW)

find_package(Python REQUIRED COMPONENTS Development)
find_package (SWIG REQUIRED)
include(UseSWIG)

set_property (SOURCE example.i PROPERTY SWIG_MODULE_NAME "new_example")

swig_add_library(example LANGUAGE python TYPE MODULE SOURCES example.i)
target_link_libraries(example PRIVATE Python::Module)

extension: cmake


text:
require docker-disk.inc

# Resin supervisor supported CPU archtectures
SUPERVISOR_REPOSITORY_armv5 = "resin/armel-supervisor"
SUPERVISOR_REPOSITORY_armv6 = "resin/rpi-supervisor"
SUPERVISOR_REPOSITORY_armv7a = "resin/armv7hf-supervisor"
SUPERVISOR_REPOSITORY_armv7ve = "resin/armv7hf-supervisor"
SUPERVISOR_REPOSITORY_aarch64 = "resin/armv7hf-supervisor"
SUPERVISOR_REPOSITORY_x86 = "resin/i386-supervisor"
SUPERVISOR_REPOSITORY_x86-64 = "resin/amd64-supervisor"

SUPERVISOR_TAG ?= "v4.1.2"
TARGET_REPOSITORY ?= "${SUPERVISOR_REPOSITORY}"
TARGET_TAG ?= "${SUPERVISOR_TAG}"
LED_FILE ?= "/dev/null"

inherit systemd

SRC_URI += " \
    file://resin-data.mount \
    file://start-resin-supervisor \
    file://supervisor.conf \
    file://resin-supervisor.service \
    file://update-resin-supervisor \
    file://update-resin-supervisor.service \
    file://update-resin-supervisor.timer \
    "

SYSTEMD_SERVICE_${PN} = " \
    resin-supervisor.service \
    update-resin-supervisor.service \
    update-resin-supervisor.timer \
    "

FILES_${PN} += " \
    /resin-data \
    ${systemd_unitdir} \
    ${sysconfdir} \
    "

RDEPENDS_${PN} = " \
    bash \
    docker \
    coreutils \
    resin-vars \
    systemd \
    curl \
    resin-device-uuid \
    "

python () {
    # Get the recipe version from supervisor
    import subprocess

    target_repository = d.getVar('TARGET_REPOSITORY', True)
    supervisor_repository = d.getVar('SUPERVISOR_REPOSITORY', True)
    tag_repository = d.getVar('TARGET_TAG', True)

    if not supervisor_repository:
        bb.fatal("resin-supervisor-disk: There is no support for this architecture.")

    # Version 0.0.0 means that the supervisor image was either not preloaded or a custom image was preloaded
    if target_repository == "" or target_repository != supervisor_repository:
        d.setVar('SUPERVISOR_VERSION','0.0.0')
        d.setVar('PV','0.0.0')
        return

    # Only pull if connectivity - to avoid warnings and delay
    if connected(d) == "yes":
        pull_cmd = "docker pull %s:%s" % (target_repository, tag_repository)
        pull_output = subprocess.Popen(pull_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
    else:
        bb.warn("resin-supervisor-disk: No connectivity, skipped pulling supervisor image.")

    # Inspect for fetching the version only if image exists
    # on Fedora 23 at least, docker has suffered slight changes (https://bugzilla.redhat.com/show_bug.cgi?id=1312934)
    # hence we need the following workaround until the above bug is fixed:
    imagechk_cmd = "docker images | grep '^\S*%s\s*%s'" % (target_repository, tag_repository)
    imagechk_output = subprocess.Popen(imagechk_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
    if imagechk_output == "":
        bb.fatal("resin-supervisor-disk: No local supervisor images found.")
    version_cmd = "echo -n $(docker inspect %s:%s | jq --raw-output '.[0].Config.Env[] | select(startswith(\"VERSION=\")) | split(\"VERSION=\") | .[1]')" % (target_repository, tag_repository)
    version_output = subprocess.Popen(version_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
    if sys.version_info.major >= 3 :
        version_output = version_output.decode()
    if version_output == "" or version_output == None:
        bb.fatal("resin-supervisor-disk: Cannot fetch version.")
    image_id_cmd = "echo -n $(docker inspect -f '{{.Id}}' %s:%s)" % (target_repository, tag_repository)
    image_id_output = subprocess.Popen(image_id_cmd, shell=True, stdout=subprocess.PIPE).communicate()[0]
    if sys.version_info.major >= 3 :
        image_id_output = image_id_output.decode()
    if image_id_output == "" or image_id_output == None:
        bb.fatal("resin-supervisor-disk: Cannot fetch image id.")
    d.setVar('SUPERVISOR_VERSION', "%s-%s" % (version_output, image_id_output.split(':',1)[-1][:12]))
    d.setVar('PV', "%s+%s" % (version_output, image_id_output.split(':',1)[-1]))
}

do_install () {
    # Generate supervisor conf
    install -d ${D}${sysconfdir}/resin-supervisor/
    install -m 0755 ${WORKDIR}/supervisor.conf ${D}${sysconfdir}/resin-supervisor/
    sed -i -e 's:@SUPERVISOR_REPOSITORY@:${SUPERVISOR_REPOSITORY}:g' ${D}${sysconfdir}/resin-supervisor/supervisor.conf
    sed -i -e 's:@LED_FILE@:${LED_FILE}:g' ${D}${sysconfdir}/resin-supervisor/supervisor.conf
    sed -i -e 's:@SUPERVISOR_TAG@:${SUPERVISOR_TAG}:g' ${D}${sysconfdir}/resin-supervisor/supervisor.conf

    install -d ${D}/resin-data

    install -d ${D}${bindir}
    install -m 0755 ${WORKDIR}/update-resin-supervisor ${D}${bindir}
    install -m 0755 ${WORKDIR}/start-resin-supervisor ${D}${bindir}

    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
        install -d ${D}${systemd_unitdir}/system

        # Yocto gets confused if we use strange file names - so we rename it here
        # https://bugzilla.yoctoproject.org/show_bug.cgi?id=8161
        install -c -m 0644 ${WORKDIR}/resin-data.mount ${D}${systemd_unitdir}/system/resin\\x2ddata.mount

        install -c -m 0644 ${WORKDIR}/resin-supervisor.service ${D}${systemd_unitdir}/system
        install -c -m 0644 ${WORKDIR}/update-resin-supervisor.service ${D}${systemd_unitdir}/system
        install -c -m 0644 ${WORKDIR}/update-resin-supervisor.timer ${D}${systemd_unitdir}/system
        sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
            -e 's,@SBINDIR@,${sbindir},g' \
            -e 's,@BINDIR@,${bindir},g' \
            ${D}${systemd_unitdir}/system/*.service
    fi
}
do_install[vardeps] += "DISTRO_FEATURES TARGET_REPOSITORY LED_FILE"

do_deploy_append () {
    echo ${SUPERVISOR_VERSION} > ${DEPLOYDIR}/VERSION
}


text:
package rolling

import "github.com/metronlab/bow"

// Window represents an interval-based window of data with:
// Bow: data
// FirstIndex: index (across all windows) of first row in this window (-1 if none)
// IntervalColIndex: index of the interval column
// FirstValue: Window first value
// LastValue: Window last value
// IsInclusive: Window is inclusive, i.e. includes the last point at the end of the interval
type Window struct {
	Bow              bow.Bow
	FirstIndex       int
	IntervalColIndex int
	FirstValue       int64
	LastValue        int64
	IsInclusive      bool
}

// UnsetInclusive returns a copy of the Window with the IsInclusive parameter set to false and with the last row sliced off.
// Returns the unchanged Window if the IsInclusive parameter is not set.
func (w Window) UnsetInclusive() Window {
	if !w.IsInclusive {
		return w
	}
	wCopy := w
	wCopy.IsInclusive = false
	wCopy.Bow = wCopy.Bow.NewSlice(0, wCopy.Bow.NumRows()-1)
	return wCopy
}

repository: Metronlab/bow

repo_name: Metronlab/bow


text:
DESCRIPTION = "Networking extension library for Lua"
HOMEPAGE = "https://github.com/diegonehab/luasocket"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=ab6706baf6d39a6b0fa2613a3b0831e7"

DEPENDS += " lua5.1"

SRCREV = "d1ec29be7f982db75864155dd61a058902e1cae2"
SRC_URI = "git://github.com/diegonehab/luasocket.git \
           file://0001-allow-overrides-for-DESTDIR-CC_linux-LD_linux-LDFLAG.patch \
           file://0002-serial-LUASOCKET_API-fix.patch \
           file://0003-build-unix-and-serial-with-compatibility-fixes.patch \
          "

TARGET_CC_ARCH += "${LDFLAGS}"
TARGET_CFLAGS += "-fpic"
CFLAGS += "-fpic"

S = "${WORKDIR}/git"

CFLAGS += "-I${STAGING_INCDIR}/lua5.1"
EXTRA_OEMAKE += "PLAT=linux CFLAGS+='-I${STAGING_INCDIR}/lua5.1' LUAINC_linux_base=${STAGING_INCDIR} LUAPREFIX_linux=${prefix} DESTDIR=${D} \
CC_linux='${CC}' LD_linux='${CC}' LUAV=5.1"

do_install() {
	oe_runmake install-unix
}

FILES_SOLIBSDEV = ""

FILES_${PN}  += "${libdir}/* ${datadir}/lua/5.*/"
FILES_${PN}-dbg  += "${libdir}/lua/5.*/.debug ${libdir}/lua/5.*/*/.debug"

repository: chandu-tmba/MORF-OpenBMC

repo_name: chandu-tmba/MORF-OpenBMC


text:
package kafka

import (
	"fmt"
	confluentkafka "github.com/confluentinc/confluent-kafka-go/kafka"
)

type Consumer struct {
	Broker  string
	Group   string
	Topics  []string
	timeout int
}

func (c *Consumer) Initialize(Broker string, Group string, Topics []string, Timeout int) {
	c.Broker = Broker
	c.Group = Group
	c.Topics = Topics
	c.timeout = Timeout
}

func (c *Consumer) GetConsumer() (*confluentkafka.Consumer, error) {
	consumer, err := confluentkafka.NewConsumer(&confluentkafka.ConfigMap{
		"bootstrap.servers": c.Broker,
		"group.id":          c.Group,
		"auto.offset.reset": "earliest",
	})

	if err != nil {
		return consumer, err
	}

	consumer.SubscribeTopics(c.Topics, nil)

	return consumer, err
}

func (c *Consumer) Listen(messageChan chan *confluentkafka.Message) error {
	consumer, err := c.GetConsumer()

	if err != nil {
		panic(err)
	}

	for {
		msg, err := consumer.ReadMessage(-1)
		if err == nil {
			fmt.Printf("Message on %s: %s\n", msg.TopicPartition, string(msg.Value))
			messageChan <- msg
		} else {
			// The client will automatically try to recover from all errors.
			fmt.Printf("Consumer error: %v (%v)\n", err, msg)
		}
	}

	consumer.Close()

	return nil
}

repository: im-so-sorry/streaming-vk

repo_name: im-so-sorry/streaming-vk


text:
require tegra-binaries-${PV}.inc
require tegra-shared-binaries.inc

do_configure() {
    tar -C ${B} -x -f ${S}/nv_tegra/nvidia_drivers.tbz2 lib/firmware
}

do_compile[noexec] = "1"

do_install() {
    install -d ${D}${nonarch_base_libdir}
    cp -R -f ${B}/lib/firmware ${D}${nonarch_base_libdir}
}

do_install_append_tegra210() {
    install -d ${D}${nonarch_base_libdir}/firmware/gm20b
    oldwd="$PWD"
    cd ${D}${nonarch_base_libdir}/firmware/gm20b
    for f in acr_ucode.bin fecs.bin fecs_sig.bin gpccs.bin gpmu_ucode.bin \
		   gpmu_ucode_desc.bin gpmu_ucode_image.bin gpu2cde.bin \
		   NETB_img.bin pmu_bl.bin pmu_sig.bin; do
	ln -s ../tegra21x/$f .
    done
    cd "$oldwd"
}

FWPREFIX_tegra186 = "tegra18x"
FWPREFIX_tegra210 = "tegra21x"
EXTRA_FIRMWARE = ""
EXTRA_FIRMWARE_tegra210 = "${nonarch_base_libdir}/firmware/gm20b"
EXTRA_FIRMWARE_tegra186 = "${nonarch_base_libdir}/firmware/gp10b"
PACKAGES = "${PN}-brcm ${PN}-xusb ${PN}"
FILES_${PN}-brcm = "${nonarch_base_libdir}/firmware/brcm ${nonarch_base_libdir}/firmware/bcm4354.hcd ${nonarch_base_libdir}/firmware/nv-BT-Version"
FILES_${PN}-xusb = "${nonarch_base_libdir}/firmware/${FWPREFIX}_xusb_firmware"
FILES_${PN} = "${nonarch_base_libdir}/firmware/${FWPREFIX} ${EXTRA_FIRMWARE}"
RDEPENDS_${PN} = "${PN}-xusb"

repository: XevoInc/meta-tegra

repo_name: XevoInc/meta-tegra


text:
@article{Julia,
  author = {Bezanson, Jeff and Edelman, Alan and Karpinski, Stefan and Shah, Viral B.},
  title = {Julia: A Fresh Approach to Numerical Computing},
  journal = {SIAM Review},
  volume = {59},
  number = {1},
  pages = {65-98},
  year = {2017},
  doi = {10.1137/141000671},
  URL = { https://doi.org/10.1137/141000671},
  eprint = {https://doi.org/10.1137/141000671}
}

@article{JuliaPerformance,
  title={Performance of {J}ulia for high energy physics analyses},
  author={Stanitzki, Marcel and Strube, Jan},
  journal={Computing and Software for Big Science},
  volume={5},
  number={1},
  doi = {10.1007/s41781-021-00053-3},
  pages={1--11},
  year={2021},
  publisher={Springer}
}

@software{jim_pivarski_2021_5539722,
  author       = {Jim Pivarski and
                  Henry Schreiner and
                  Nicholas Smith and
                  Chris Burr and
                  Dmitry Kalinkin and
                  Giordon Stark and
                  Nikolai Hartmann and
                  Doug Davis and
                  Ryunosuke O'Neil and
                  Andrzej Novak and
                  Ben Greiner and
                  Beojan Stanislaus and
                  ChristopheRappold and
                  Cosmin Deaconu and
                  Daniel Cervenkov and
                  Jonas Rübenach and
                  Josh Bendavid and
                  Kilian Lieret and
                  Michele Peresano and
                  Raymond Ehlers and
                  Ruggero Turra and
                  Tamas Gal and
                  Alexander Held},
  title        = {scikit-hep/uproot4: 4.1.3},
  month        = sep,
  year         = 2021,
  publisher    = {Zenodo},
  version      = {4.1.3},
  doi          = {10.5281/zenodo.5539722},
  url          = {https://doi.org/10.5281/zenodo.5539722}
}
@software{pivarski_jim_2018_6522027,
  author       = {Pivarski, Jim and
                  Osborne, Ianna and
                  Ifrim, Ioana and
                  Schreiner, Henry and
                  Hollands, Angus and
                  Biswas, Anish and
                  Das, Pratyush and
                  Roy Choudhury, Santam and
                  Smith, Nicholas},
  title        = {Awkward Array},
  month        = oct,
  year         = 2018,
  note         = {If you use this software, please cite it as below.},
  publisher    = {Zenodo},
  version      = {1.9.0rc4},
  doi          = {10.5281/zenodo.6522027},
  url          = {https://doi.org/10.5281/zenodo.6522027}
}
@Article{harris2020array,
 title         = {Array programming with {NumPy}},
 author        = {Charles R. Harris and K. Jarrod Millman and St{\'{e}}fan J.
                 van der Walt and Ralf Gommers and Pauli Virtanen and David
                 Cournapeau and Eric Wieser and Julian Taylor and Sebastian
                 Berg and Nathaniel J. Smith and Robert Kern and Matti Picus
                 and Stephan Hoyer and Marten H. van Kerkwijk and Matthew
                 Brett and Allan Haldane and Jaime Fern{\'{a}}ndez del
                 R{\'{i}}o and Mark Wiebe and Pearu Peterson and Pierre
                 G{\'{e}}rard-Marchant and Kevin Sheppard and Tyler Reddy and
                 Warren Weckesser and Hameer Abbasi and Christoph Gohlke and
                 Travis E. Oliphant},
 year          = {2020},
 month         = sep,
 journal       = {Nature},
 volume        = {585},
 number        = {7825},
 pages         = {357--362},
 doi           = {10.1038/s41586-020-2649-2},
 publisher     = {Springer Science and Business Media {LLC}},
 url           = {https://doi.org/10.1038/s41586-020-2649-2}
}
@software{reback2020pandas,
    author       = {{The pandas development team}},
    title        = {Pandas},
    month        = feb,
    year         = 2020,
    publisher    = {Zenodo},
    version      = {latest},
    doi          = {10.5281/zenodo.3509134},
    url          = {https://doi.org/10.5281/zenodo.3509134}
}
@article{Brun:1997pa,
    author = "Brun, R. and Rademakers, F.",
    editor = "Werlen, M. and Perret-Gallix, D.",
    title = {ROOT: An object oriented data analysis framework},
    doi = "10.1016/S0168-9002(97)00048-X",
    journal = "Nucl. Instrum. Meth. A",
    volume = "389",
    pages = "81--86",
    year = "1997"
}

@article{Adri_n_Mart_nez_2016,
	doi = {10.1088/0954-3899/43/8/084001},
	url = {https://doi.org/10.1088%2F0954-3899%2F43%2F8%2F084001},
	year = 2016,
	month = {jun},
	publisher = {{IOP} Publishing},
	volume = {43},
	number = {8},
	pages = {084001},
	author = {S Adri{\'{a}
}n-Mart{\'{\i}}nez and M Ageron and F Aharonian and S Aiello and A Albert and F Ameli and E Anassontzis and M Andre and G Androulakis and M Anghinolfi and G Anton and M Ardid and T Avgitas and G Barbarino and E Barbarito and B Baret and J Barrios-Mart{\'{\i}} and B Belhorma and A Belias and E Berbee and A van den Berg and V Bertin and S Beurthey and V van Beveren and N Beverini and S Biagi and A Biagioni and M Billault and M Bond{\`{\i}} and R Bormuth and B Bouhadef and G Bourlis and S Bourret and C Boutonnet and M Bouwhuis and C Bozza and R Bruijn and J Brunner and E Buis and J Busto and G Cacopardo and L Caillat and M Calamai and D Calvo and A Capone and L Caramete and S Cecchini and S Celli and C Champion and R Cherkaoui El Moursli and S Cherubini and T Chiarusi and M Circella and L Classen and R Cocimano and J A B Coelho and A Coleiro and S Colonges and R Coniglione and M Cordelli and A Cosquer and P Coyle and A Creusot and G Cuttone and A D'Amico and G De Bonis and G De Rosa and C De Sio and F Di Capua and I Di Palma and A F D{\'{\i}}az Garc{\'{\i}}a and C Distefano and C Donzaud and D Dornic and Q Dorosti-Hasankiadeh and E Drakopoulou and D Drouhin and L Drury and M Durocher and T Eberl and S Eichie and D van Eijk and I El Bojaddaini and N El Khayati and D Elsaesser and A Enzenhöfer and F Fassi and P Favali and P Fermani and G Ferrara and C Filippidis and G Frascadore and L A Fusco and T Gal and S Galat{\`{a}} and F Garufi and P Gay and M Gebyehu and V Giordano and N Gizani and R Gracia and K Graf and T Gr{\'{e}}goire and G Grella and R Habel and S Hallmann and H van Haren and S Harissopulos and T Heid and A Heijboer and E Heine and S Henry and J J Hern{\'{a}}ndez-Rey and M Hevinga and J Hofestädt and C M F Hugon and G Illuminati and C W James and P Jansweijer and M Jongen and M de Jong and M Kadler and O Kalekin and A Kappes and U F Katz and P Keller and G Kieft and D Kie{\ss}ling and E N Koffeman and P Kooijman and A Kouchner and V Kulikovskiy and R Lahmann and P Lamare and A Leisos and E Leonora and M Lindsey Clark and A Liolios and C D Llorens Alvarez and D Lo Presti and H Löhner and A Lonardo and M Lotze and S Loucatos and E Maccioni and K Mannheim and A Margiotta and A Marinelli and O Mari{\c{s}} and C Markou and J A Mart{\'{\i}}nez-Mora and A Martini and R Mele and K W Melis and T Michael and P Migliozzi and E Migneco and P Mijakowski and A Miraglia and C M Mollo and M Mongelli and M Morganti and A Moussa and P Musico and M Musumeci and S Navas and C A Nicolau and I Olcina and C Olivetto and A Orlando and A Papaikonomou and R Papaleo and G E P{\u{a}}v{\u{a}}la{\c{s}} and H Peek and C Pellegrino and C Perrina and M Pfutzner and P Piattelli and K Pikounis and G E Poma and V Popa and T Pradier and F Pratolongo and G Pühlhofer and S Pulvirenti and L Quinn and C Racca and F Raffaelli and N Randazzo and P Rapidis and P Razis and D Real and L Resvanis and J Reubelt and G Riccobene and C Rossi and A Rovelli and M Salda{\~{n}}a and I Salvadori and D F E Samtleben and A S{\'{a}}nchez Garc{\'{\i}}a and A S{\'{a}}nchez Losa and M Sanguineti and A Santangelo and D Santonocito and P Sapienza and F Schimmel and J Schmelling and V Sciacca and M Sedita and T Seitz and I Sgura and F Simeone and I Siotis and V Sipala and B Spisso and M Spurio and G Stavropoulos and J Steijger and S M Stellacci and D Stransky and M Taiuti and Y Tayalati and D T{\'{e}}zier and S Theraube and L Thompson and P Timmer and C Tönnis and L Trasatti and A Trovato and A Tsirigotis and S Tzamarias and E Tzamariudaki and B Vallage and V Van Elewyck and J Vermeulen and P Vicini and S Viola and D Vivolo and M Volkert and G Voulgaris and L Wiggers and J Wilms and E de Wolf and K Zachariadou and J D Zornoza and J Z{\'{u}}{\~{n}}iga},
	title = {Letter of intent for {KM}3NeT 2.0},
	journal = {Journal of Physics G: Nuclear and Particle Physics}
}
@article{Ehataht:2020ebp,
    author = {Ehat\"aht, Karl},
    editor = "Doglioni, C. and Kim, D. and Stewart, G. A. and Silvestris, L. and Jackson, P. and Kamleh, W.",
    collaboration = "CMS",
    title = "{NANOAOD: a new compact event data format in CMS}",
    doi = "10.1051/epjconf/202024506002",
    journal = "EPJ Web Conf.",
    volume = "245",
    pages = "06002",
    year = "2020"
}

gha_language: Julia


text:
/*
 * Tests for PwdGen
 */

package pwdgen

import (
	"pwdgen/symbol"
	"testing"
)

func TestStringLength(t *testing.T) {
	const testlen = 30
	sym, _ := symbol.NewSymbolSetFromString("a")
	gen, _ := NewPwdGen(sym, testlen)
	if gen == nil {
		t.Errorf("failed to create PwdGen instance")
	}

	pwd := gen.String()
	if len(pwd) != testlen {
		t.Errorf("expected password length %d, but got %d (%s)", testlen, len(pwd), pwd)
	}
}

// --- BENCHMARKS ---------------------------------------------------

func BenchmarkGeneratePassword(b *testing.B) {
	length := 10
	for i := 0; i < b.N; i++ {
		if s, err := GeneratePassword(length); err != nil || len(s) != length {
			b.Errorf("Generating password failed: Password is \"%s\" (expected %d characters), error is %s",
				s, length, err)
		}
	}
}

func BenchmarkPwdGenString(b *testing.B) {
	length := 10
	b.StopTimer()
	var gen *PwdGen
	var symset *symbol.MultiSet
	var err error

	if symset, err = symbol.NewMultiSetFromDefaults([]string{"alpha", "ALPHA", "num"}); err != nil {
		b.Fatalf("Unable to create default MultiSet: %s", err)
	}

	if gen, err = NewPwdGen(symset, length); err != nil {
		b.Fatalf("Unable to create generator: %s", err)
	}
	b.StartTimer()

	for i := 0; i < b.N; i++ {
		if s := gen.String(); len(s) != length {
			b.Errorf("generated password \"%s\" does not have the expected length of %d", s, length)
		}
	}
}

repository: tsalzer/pwmake

repo_name: tsalzer/pwmake


text:
@InProceedings{hulden12a,
  title = {Treba: Efficient Numerically Stable EM for PFA},
  author = {Mans Hulden},
  pages = {249--253},
  abstract = {Training probabilistic finite automata with the EM/Baum-Welch algorithm is computationally very intensive, especially if random ergodic automata are used initially, and additional strategies such as deterministic annealing are used. In this paper we present some optimization and parallelization strategies to the Baum-Welch algorithm that often allow for training of much larger automata with a larger number of observations. The tool, \emph{treba}, which implements the optimizations, is available open-source and its results were used to participate in the PAutomaC PFA/HMM competition.},
  pdf = {http://jmlr.org/proceedings/papers/v21/hulden12a/hulden12a.pdf},
}

repository: mreid/papersite

repo_name: mreid/papersite

gha_language: TeX


text:
@article{nuzzo2017introduction,
 author = {Nuzzo, Regina L},
 publisher = {Elsevier},
 title = {An Introduction to Bayesian Data Analysis for Correlations},
 year = {2017}
}

repository: ReginaNuzzo/academic-kickstart

repo_name: ReginaNuzzo/academic-kickstart


text:
const check = require("is-url")
const fetch = require("node-fetch")
module.exports = {
  name: "uptime",
  run: async (client, message, args, db) => {
  let link = args[0];
  if (!link) return message.channel.send(":x: | **No link provided**")
  if (link.match(/https?:\/\/[a-z]+\.glitch\.me\/?/gi)) return message.channel.send(":x: | **You cannot uptime glitch projects**")
  if (check(link) === false) return message.channel.send(":x: | **That isnt a valid URL!**")
  let database = db.get("links")
  if (database) {
  let pog = database.map(l => l.url)
  if (pog.includes(link)) {
    message.delete().catch(err => undefined)
    return message.channel.send(":x: | **The link is already uptimed!**")
  }
  }
  fetch(link).then(() => {
    let data = {
    author: message.author.id,
    url: link
    }
    message.delete().catch(err => undefined)
    db.push("links", data)
    let embed = new client.embed()
    .setColor(client.color)
    .setAuthor(message.author.tag, message.author.displayAvatarURL({ dynamic: true }))
    .setThumbnail(message.author.displayAvatarURL({ dynamic: true }))
    .setURL("https://github.com/legend-js-dev/uptimer")
    .setDescription("**The URL is now uptimed**")
    .setFooter(message.guild.name + " | made by legend-js, https://github.com/legend-js-dev/uptimer", message.guild.iconURL())
    .setTimestamp()
    return message.channel.send({ embed: embed })
  }).catch(err => {
    return message.channel.send(":x: | **Error: The link is not valid**")
  })
  }
}

extension: js


text:
@misc{annau_downgan_2023,
 author = {Annau, Nicolaas J},
 doi = {10.5281/zenodo.7604242},
 month = {February},
 publisher = {Zenodo},
 title = {DoWnGAN},
 url = {https://doi.org/10.5281/zenodo.7604242},
 year = {2023}
}


text:
package ringbuffer

import (
	"fmt"
	"sync"
)

// ErrClosed is used to indicate the ringbuffer has been closed.
var ErrClosed = fmt.Errorf("closed")

const defaultSize = 1024

// RingBuffer implements a fixed-size buffer which will drop oldest data if full.
type RingBuffer struct {
	mu   sync.Mutex
	wait *sync.Cond

	cap    int
	closed bool
	q      *queue
}

// New creates new RingBuffer.
func New(cap int) *RingBuffer {
	if cap <= 0 {
		cap = defaultSize
	}

	rb := &RingBuffer{
		cap:    cap,
		closed: false,
		q:      newQueue(),
	}
	rb.wait = sync.NewCond(&rb.mu)
	return rb
}

// Push pushes value into buffer and return whether it covers the oldest data
// or not.
func (rb *RingBuffer) Push(val interface{}) (bool, error) {
	rb.mu.Lock()
	defer rb.mu.Unlock()

	if rb.closed {
		return false, ErrClosed
	}

	if val == nil {
		return false, nil
	}

	// drop the oldest element if covered
	covered := (rb.q.size() == rb.cap)
	if covered {
		rb.q.dequeue()
	}

	rb.q.enqueue(val)
	rb.wait.Broadcast()
	return covered, nil
}

// Pop pops the value in the buffer.
//
// NOTE: it returns ErrClosed if the buffer has been closed.
func (rb *RingBuffer) Pop() (interface{}, error) {
	rb.mu.Lock()
	for rb.q.size() == 0 && !rb.closed {
		rb.wait.Wait()
	}

	if rb.closed {
		rb.mu.Unlock()
		return nil, ErrClosed
	}

	val := rb.q.dequeue()
	rb.mu.Unlock()
	return val, nil
}

// Drain returns all the data in the buffer.
//
// NOTE: it can be used after closed to make sure the data have been consumed.
func (rb *RingBuffer) Drain() []interface{} {
	rb.mu.Lock()
	defer rb.mu.Unlock()

	size := rb.q.size()
	vals := make([]interface{}, 0, size)

	for i := 0; i < size; i++ {
		vals = append(vals, rb.q.dequeue())
	}
	return vals
}

// Close closes the ringbuffer.
func (rb *RingBuffer) Close() error {
	rb.mu.Lock()
	if rb.closed {
		rb.mu.Unlock()
		return nil
	}

	rb.closed = true
	rb.wait.Broadcast()
	rb.mu.Unlock()
	return nil
}

repository: Titanssword/pouch

repo_name: Titanssword/pouch


text:
package gogcs

import (
	"cloud.google.com/go/storage"
	"io"
)

type File struct {
	Path     string
	Name     string
	Body     io.Reader
	IsPublic bool
}

type UploadedFile struct {
	Name        string
	MD5         string
	IsPublic    bool
	Url         string
	Size        int64
	ObjectAttrs *storage.ObjectAttrs
}

// DownloadedFile is used when downloading file from Google Could Storage (GCS).
// Object is the object path that provided from GCS.
// Name is the file name that you wanted to save locally.
// Path is where do you want to have your file stored. It should be a full path.
// Data is raw bytes.
type DownloadedFile struct {
	Object string
	Name   string
	Path   string
	Data   *[]byte
}

repository: hawow/go-gcs

repo_name: hawow/go-gcs


text:
require samba.inc
require samba-basic.inc

SRC_URI += "file://configure.patch \
            file://kernel-oplocks.patch \
            "
SRC_URI_append_linux-uclibc        = "file://uclibc-strlcpy-strlcat.patch;patch=1"
SRC_URI_append_linux-uclibceabi = "file://uclibc-strlcpy-strlcat.patch;patch=1"

PR = "r0"

EXTRA_OECONF += "\
	SMB_BUILD_CC_NEGATIVE_ENUM_VALUES=yes \
	"

SRC_URI[src.md5sum] = "11ed2bfef4090bd5736b194b43f67289"
SRC_URI[src.sha256sum] = "bb67c0e13d4ccbd84b9200c8739393fdd9b3145b5aad216934dc670f0fcea266"

gha_language: C


text:
@inproceedings{PlancherAppliedApproxMM,
	author={Plancher, Brian and Brumar, Camelia D and Brumar, Iulian and Pentecost, Lillian and Rama, Saketh and Brooks, David},
	booktitle={2019 IEEE High Performance Extreme Computing Conference (HPEC)},
	title={Application of Approximate Matrix Multiplication to Neural Networks and Distributed SLAM},
	pages={1--7},
	year={2019},
	address = {Waltham, MA, USA},
	month={September}
}


text:
DESCRIPTION = "A tool for transfer files to/from any OBEX enabled device"
LICENSE = "GPL-2.0-only & PD & LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://LGPL-2.1.txt;md5=4fbd65380cdd255951079008b364516c \
                    file://GPL-2.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
                    file://License.txt;md5=fcbddc3c1debed80dd80da2d3e5f0dc1 \
                   "

DEPENDS += "openobex obexftp-native"
SRC_URI = "http://downloads.sourceforge.net/openobex/${BP}-Source.tar.gz \
           file://Remove_some_printf_in_obexftpd.patch \
           file://0001-apps-CMakeLists.txt-Explicitly-link-libbfb-and-libmu.patch \
           file://make_fuse_swig_optional.patch \
"
SRC_URI[md5sum] = "157a9d1b2ed220203f7084db906de73c"
SRC_URI[sha256sum] = "d40fb48e0a0eea997b3e582774b29f793919a625d54b87182e31a3f3d1c989a3"

inherit cmake pkgconfig

OECMAKE_GENERATOR = "Unix Makefiles"

PACKAGECONFIG ?= ""
# fuse support will need meta-filesystems layer
PACKAGECONFIG[fuse] = "-DENABLE_FUSE=ON,-DENABLE_FUSE=OFF,fuse"
PACKAGECONFIG[swig] = "-DENABLE_SWIG=ON,-DENABLE_SWIG=OFF,swig"

DEPENDS:remove:class-native = "fuse-native"

S = "${WORKDIR}/${BP}-Source"

EXTRA_OECMAKE += "-DCMAKE_SKIP_RPATH=ON \
                  -DENABLE_PERL=OFF -DENABLE_PYTHON=OFF \
                  -DENABLE_RUBY=OFF -DENABLE_TCL=OFF \
"

do_compile:class-native () {
    oe_runmake crctable
}

do_install:class-native () {
    install -D -m 0755 ${B}/bfb/crctable ${D}${bindir}/crctable
}

BBCLASSEXTEND = "native"


text:
package alfred

import (
	"fmt"
	"net/http"
	"testing"
)

func TestServeComponent(t *testing.T) {

	/* I think travis-ci.org isn't allowing ports anymore?
	Needs investgating ... and this test needs fixing if that's the case.
	For now, lets limit it to just my username /cringe
	*/

	if evaluate("whoami", "./") != "kcmerrill" {
		return
	}

	tasks := make(map[string]Task)
	tasks["http.serve"] = Task{
		Serve: "8088",
	}
	context := InitialContext([]string{})
	context.Text.DisableFormatting = true

	go serve(tasks["http.serve"], context, tasks)
	response, err := http.Get("http://localhost:8088/serve_test.go")
	if err != nil {
		fmt.Println(err.Error())
		t.Fatalf("Expected a proper 200 response from localhost")
	}
	if response.StatusCode != 200 {
		t.Fatalf("Status code 200 expected")
	}
}

repository: kcmerrill/alfred

repo_name: kcmerrill/alfred


text:
// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/influxdata/influx-cli/v2/api (interfaces: BackupApi)

// Package mock is a generated GoMock package.
package mock

import (
	context "context"
	http "net/http"
	reflect "reflect"

	gomock "github.com/golang/mock/gomock"
	api "github.com/influxdata/influx-cli/v2/api"
)

// MockBackupApi is a mock of BackupApi interface.
type MockBackupApi struct {
	ctrl     *gomock.Controller
	recorder *MockBackupApiMockRecorder
}

// MockBackupApiMockRecorder is the mock recorder for MockBackupApi.
type MockBackupApiMockRecorder struct {
	mock *MockBackupApi
}

// NewMockBackupApi creates a new mock instance.
func NewMockBackupApi(ctrl *gomock.Controller) *MockBackupApi {
	mock := &MockBackupApi{ctrl: ctrl}
	mock.recorder = &MockBackupApiMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockBackupApi) EXPECT() *MockBackupApiMockRecorder {
	return m.recorder
}

// GetBackupKV mocks base method.
func (m *MockBackupApi) GetBackupKV(arg0 context.Context) api.ApiGetBackupKVRequest {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetBackupKV", arg0)
	ret0, _ := ret[0].(api.ApiGetBackupKVRequest)
	return ret0
}

// GetBackupKV indicates an expected call of GetBackupKV.
func (mr *MockBackupApiMockRecorder) GetBackupKV(arg0 interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackupKV", reflect.TypeOf((*MockBackupApi)(nil).GetBackupKV), arg0)
}

// GetBackupKVExecute mocks base method.
func (m *MockBackupApi) GetBackupKVExecute(arg0 api.ApiGetBackupKVRequest) (*http.Response, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetBackupKVExecute", arg0)
	ret0, _ := ret[0].(*http.Response)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetBackupKVExecute indicates an expected call of GetBackupKVExecute.
func (mr *MockBackupApiMockRecorder) GetBackupKVExecute(arg0 interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackupKVExecute", reflect.TypeOf((*MockBackupApi)(nil).GetBackupKVExecute), arg0)
}

// GetBackupMetadata mocks base method.
func (m *MockBackupApi) GetBackupMetadata(arg0 context.Context) api.ApiGetBackupMetadataRequest {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetBackupMetadata", arg0)
	ret0, _ := ret[0].(api.ApiGetBackupMetadataRequest)
	return ret0
}

// GetBackupMetadata indicates an expected call of GetBackupMetadata.
func (mr *MockBackupApiMockRecorder) GetBackupMetadata(arg0 interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackupMetadata", reflect.TypeOf((*MockBackupApi)(nil).GetBackupMetadata), arg0)
}

// GetBackupMetadataExecute mocks base method.
func (m *MockBackupApi) GetBackupMetadataExecute(arg0 api.ApiGetBackupMetadataRequest) (*http.Response, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetBackupMetadataExecute", arg0)
	ret0, _ := ret[0].(*http.Response)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetBackupMetadataExecute indicates an expected call of GetBackupMetadataExecute.
func (mr *MockBackupApiMockRecorder) GetBackupMetadataExecute(arg0 interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackupMetadataExecute", reflect.TypeOf((*MockBackupApi)(nil).GetBackupMetadataExecute), arg0)
}

// GetBackupShardId mocks base method.
func (m *MockBackupApi) GetBackupShardId(arg0 context.Context, arg1 int64) api.ApiGetBackupShardIdRequest {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetBackupShardId", arg0, arg1)
	ret0, _ := ret[0].(api.ApiGetBackupShardIdRequest)
	return ret0
}

// GetBackupShardId indicates an expected call of GetBackupShardId.
func (mr *MockBackupApiMockRecorder) GetBackupShardId(arg0, arg1 interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackupShardId", reflect.TypeOf((*MockBackupApi)(nil).GetBackupShardId), arg0, arg1)
}

// GetBackupShardIdExecute mocks base method.
func (m *MockBackupApi) GetBackupShardIdExecute(arg0 api.ApiGetBackupShardIdRequest) (*http.Response, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetBackupShardIdExecute", arg0)
	ret0, _ := ret[0].(*http.Response)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetBackupShardIdExecute indicates an expected call of GetBackupShardIdExecute.
func (mr *MockBackupApiMockRecorder) GetBackupShardIdExecute(arg0 interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBackupShardIdExecute", reflect.TypeOf((*MockBackupApi)(nil).GetBackupShardIdExecute), arg0)
}

// OnlyCloud mocks base method.
func (m *MockBackupApi) OnlyCloud() api.BackupApi {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "OnlyCloud")
	ret0, _ := ret[0].(api.BackupApi)
	return ret0
}

// OnlyCloud indicates an expected call of OnlyCloud.
func (mr *MockBackupApiMockRecorder) OnlyCloud() *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnlyCloud", reflect.TypeOf((*MockBackupApi)(nil).OnlyCloud))
}

// OnlyOSS mocks base method.
func (m *MockBackupApi) OnlyOSS() api.BackupApi {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "OnlyOSS")
	ret0, _ := ret[0].(api.BackupApi)
	return ret0
}

// OnlyOSS indicates an expected call of OnlyOSS.
func (mr *MockBackupApiMockRecorder) OnlyOSS() *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OnlyOSS", reflect.TypeOf((*MockBackupApi)(nil).OnlyOSS))
}


text:
package nomadic

import (
	_ "embed"
	"sort"
	"strings"
)

func Image(repo, tagOrDigest string) string {
	if tagOrDigest == "latest" {
		if uri, ok := digestMap[repo]; ok {
			return uri
		}

		repoWithRegistry := "index.docker.io/" + repo
		if uri, ok := digestMap[repoWithRegistry]; ok {
			return uri
		}
	}

	if strings.HasPrefix(tagOrDigest, "sha256:") {
		return repo + "@" + tagOrDigest
	} else {
		return repo + ":" + tagOrDigest
	}
}

func RegisteredImageURIs() []string {
	var uris []string
	for _, imageURI := range digestMap {
		uris = append(uris, imageURI)
	}
	sort.Strings(uris)
	return uris
}

//go:embed digests
var allDigests string

var digestMap map[string]string

func init() {
	digestMap = map[string]string{}
	for _, imageURI := range strings.Split(allDigests, "\n") {
		if imageURI == "" {
			continue
		}

		uriParts := strings.Split(imageURI, "@")
		digestMap[uriParts[0]] = imageURI
	}
}


text:
package services

import (
	"fmt"
	"log"
	"net/url"
	"os"

	openApiRt "github.com/go-openapi/runtime"
	openApiRtClient "github.com/go-openapi/runtime/client"
	strfmt "github.com/go-openapi/strfmt"
	apiClient "github.com/kathra-project/kathra-resourcemanager-client-go/client"
	apiClientBR "github.com/kathra-project/kathra-resourcemanager-client-go/client/binary_repositories"
	apiClientGroup "github.com/kathra-project/kathra-resourcemanager-client-go/client/groups"
	apiClientUser "github.com/kathra-project/kathra-resourcemanager-client-go/client/users"
	models "github.com/kathra-project/kathra-resourcemanager-client-go/models"
)

type ResourceManagerService struct {
	AuthInfo             *openApiRtClient.Runtime
	ClientAuthInfoWriter openApiRt.ClientAuthInfoWriter
	Formats              strfmt.Registry
	Config               *apiClient.TransportConfig
	KeycloakService      *KeycloakAuthService
}

func NewResourceManagerService() ResourceManagerService {
	var token, errToken = GetKeycloakAuthServiceInstance().GetToken()
	if errToken != nil {
		panic(errToken)
	}
	var formats = strfmt.NewFormats()
	var config = apiClient.DefaultTransportConfig()

	resourceManagerURL, _ := url.Parse(os.Getenv("RESOURCE_MANAGER_URL"))
	schemes := []string{resourceManagerURL.Scheme}
	config.Host = resourceManagerURL.Host
	config.BasePath = resourceManagerURL.Path
	config.Schemes = schemes
	var authInfo = openApiRtClient.New(config.Host, config.BasePath, schemes)
	var ClientAuthInfoWriter = openApiRtClient.BearerToken(token)
	return ResourceManagerService{AuthInfo: authInfo, Formats: formats, Config: config, ClientAuthInfoWriter: ClientAuthInfoWriter, KeycloakService: GetKeycloakAuthServiceInstance()}
}

func (svc ResourceManagerService) initToken() {
	var token, errToken = GetKeycloakAuthServiceInstance().GetToken()
	if errToken != nil {
		panic(errToken)
	}
	svc.ClientAuthInfoWriter = openApiRtClient.BearerToken(token)
}

func (svc ResourceManagerService) getBinaryRepositories() []*models.BinaryRepository {
	svc.initToken()
	var cli = apiClient.NewHTTPClientWithConfig(svc.Formats, svc.Config)

	var params = apiClientBR.NewGetBinaryRepositoriesParams()
	var response, err = cli.BinaryRepositories.GetBinaryRepositories(params, svc.ClientAuthInfoWriter)
	if err != nil {
		fmt.Printf("%+v\n", response)
		log.Println(err)
		return nil
	}
	return response.Payload
}

func (svc ResourceManagerService) getGroupById(id string) *models.Group {
	svc.initToken()
	var cli = apiClient.NewHTTPClientWithConfig(svc.Formats, svc.Config)

	var params = apiClientGroup.NewGetGroupParams()
	params.ResourceID = id
	var response, err = cli.Groups.GetGroup(params, svc.ClientAuthInfoWriter)
	if err != nil {
		fmt.Printf("%+v\n", response)
		log.Println(err)
		return nil
	}
	return response.Payload
}

func (svc ResourceManagerService) getUserById(id string) *models.User {
	svc.initToken()
	var cli = apiClient.NewHTTPClientWithConfig(svc.Formats, svc.Config)

	var params = apiClientUser.NewGetUserParams()
	params.ResourceID = id
	var response, err = cli.Users.GetUser(params, svc.ClientAuthInfoWriter)
	if err != nil {
		fmt.Printf("%+v\n", response)
		log.Println(err)
		return nil
	}
	return response.Payload
}


text:
SUMMARY = "Portable network interface information for Python"
HOMEPAGE = "https://bitbucket.org/al45tair/netifaces"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=a53cbc7cb75660694e138ba973c148df"

SRC_URI[md5sum] = "5b4d1f1310ed279e6df27ef3a9b71519"
SRC_URI[sha256sum] = "59d8ad52dd3116fcb6635e175751b250dc783fb011adba539558bd764e5d628b"

inherit pypi setuptools3

repository: urnenfeld/meta-widde

repo_name: urnenfeld/meta-widde


text:
package newrelicotlp_test

import (
	"bytes"
	"testing"

	"github.com/fastly/cli/pkg/app"
	"github.com/fastly/cli/pkg/mock"
	"github.com/fastly/cli/pkg/testutil"
	"github.com/fastly/go-fastly/v8/fastly"
)

func TestNewRelicOTLPCreate(t *testing.T) {
	args := testutil.Args
	scenarios := []testutil.TestScenario{
		{
			Name:      "validate missing --service-id flag",
			Args:      args("logging newrelicotlp create --key abc --name foo --version 3"),
			WantError: "error reading service: no service ID found",
		},
		{
			Name: "validate missing --autoclone flag",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
			},
			Args:      args("logging newrelicotlp create --key abc --name foo --service-id 123 --version 1"),
			WantError: "service version 1 is not editable",
		},
		{
			Name: "validate CreateNewRelicOTLP API error",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				CreateNewRelicOTLPFn: func(i *fastly.CreateNewRelicOTLPInput) (*fastly.NewRelicOTLP, error) {
					return nil, testutil.Err
				},
			},
			Args:      args("logging newrelicotlp create --key abc --name foo --service-id 123 --version 3"),
			WantError: testutil.Err.Error(),
		},
		{
			Name: "validate CreateNewRelicOTLP API success",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				CreateNewRelicOTLPFn: func(i *fastly.CreateNewRelicOTLPInput) (*fastly.NewRelicOTLP, error) {
					return &fastly.NewRelicOTLP{
						Name:           *i.Name,
						ServiceID:      i.ServiceID,
						ServiceVersion: i.ServiceVersion,
					}, nil
				},
			},
			Args:       args("logging newrelicotlp create --key abc --name foo --service-id 123 --version 3"),
			WantOutput: "Created New Relic OTLP logging endpoint 'foo' (service: 123, version: 3)",
		},
		{
			Name: "validate --autoclone results in cloned service version",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				CloneVersionFn: testutil.CloneVersionResult(4),
				CreateNewRelicOTLPFn: func(i *fastly.CreateNewRelicOTLPInput) (*fastly.NewRelicOTLP, error) {
					return &fastly.NewRelicOTLP{
						Name:           *i.Name,
						ServiceID:      i.ServiceID,
						ServiceVersion: i.ServiceVersion,
					}, nil
				},
			},
			Args:       args("logging newrelicotlp create --autoclone --key abc --name foo --service-id 123 --version 1"),
			WantOutput: "Created New Relic OTLP logging endpoint 'foo' (service: 123, version: 4)",
		},
	}

	for testcaseIdx := range scenarios {
		testcase := &scenarios[testcaseIdx]
		t.Run(testcase.Name, func(t *testing.T) {
			var stdout bytes.Buffer
			opts := testutil.NewRunOpts(testcase.Args, &stdout)
			opts.APIClient = mock.APIClient(testcase.API)
			err := app.Run(opts)
			testutil.AssertErrorContains(t, err, testcase.WantError)
			testutil.AssertStringContains(t, stdout.String(), testcase.WantOutput)
		})
	}
}

func TestNewRelicOTLPDelete(t *testing.T) {
	args := testutil.Args
	scenarios := []testutil.TestScenario{
		{
			Name:      "validate missing --name flag",
			Args:      args("logging newrelicotlp delete --version 3"),
			WantError: "error parsing arguments: required flag --name not provided",
		},
		{
			Name:      "validate missing --version flag",
			Args:      args("logging newrelicotlp delete --name foobar"),
			WantError: "error parsing arguments: required flag --version not provided",
		},
		{
			Name:      "validate missing --service-id flag",
			Args:      args("logging newrelicotlp delete --name foobar --version 3"),
			WantError: "error reading service: no service ID found",
		},
		{
			Name: "validate missing --autoclone flag",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
			},
			Args:      args("logging newrelicotlp delete --name foobar --service-id 123 --version 1"),
			WantError: "service version 1 is not editable",
		},
		{
			Name: "validate DeleteNewRelic API error",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				DeleteNewRelicOTLPFn: func(i *fastly.DeleteNewRelicOTLPInput) error {
					return testutil.Err
				},
			},
			Args:      args("logging newrelicotlp delete --name foobar --service-id 123 --version 3"),
			WantError: testutil.Err.Error(),
		},
		{
			Name: "validate DeleteNewRelic API success",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				DeleteNewRelicOTLPFn: func(i *fastly.DeleteNewRelicOTLPInput) error {
					return nil
				},
			},
			Args:       args("logging newrelicotlp delete --name foobar --service-id 123 --version 3"),
			WantOutput: "Deleted New Relic OTLP logging endpoint 'foobar' (service: 123, version: 3)",
		},
		{
			Name: "validate --autoclone results in cloned service version",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				CloneVersionFn: testutil.CloneVersionResult(4),
				DeleteNewRelicOTLPFn: func(i *fastly.DeleteNewRelicOTLPInput) error {
					return nil
				},
			},
			Args:       args("logging newrelicotlp delete --autoclone --name foo --service-id 123 --version 1"),
			WantOutput: "Deleted New Relic OTLP logging endpoint 'foo' (service: 123, version: 4)",
		},
	}

	for testcaseIdx := range scenarios {
		testcase := &scenarios[testcaseIdx]
		t.Run(testcase.Name, func(t *testing.T) {
			var stdout bytes.Buffer
			opts := testutil.NewRunOpts(testcase.Args, &stdout)
			opts.APIClient = mock.APIClient(testcase.API)
			err := app.Run(opts)
			testutil.AssertErrorContains(t, err, testcase.WantError)
			testutil.AssertStringContains(t, stdout.String(), testcase.WantOutput)
		})
	}
}

func TestNewRelicDescribe(t *testing.T) {
	args := testutil.Args
	scenarios := []testutil.TestScenario{
		{
			Name:      "validate missing --name flag",
			Args:      args("logging newrelicotlp describe --version 3"),
			WantError: "error parsing arguments: required flag --name not provided",
		},
		{
			Name:      "validate missing --version flag",
			Args:      args("logging newrelicotlp describe --name foobar"),
			WantError: "error parsing arguments: required flag --version not provided",
		},
		{
			Name:      "validate missing --service-id flag",
			Args:      args("logging newrelicotlp describe --name foobar --version 3"),
			WantError: "error reading service: no service ID found",
		},
		{
			Name: "validate GetNewRelic API error",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				GetNewRelicOTLPFn: func(i *fastly.GetNewRelicOTLPInput) (*fastly.NewRelicOTLP, error) {
					return nil, testutil.Err
				},
			},
			Args:      args("logging newrelicotlp describe --name foobar --service-id 123 --version 3"),
			WantError: testutil.Err.Error(),
		},
		{
			Name: "validate GetNewRelic API success",
			API: mock.API{
				ListVersionsFn:    testutil.ListVersions,
				GetNewRelicOTLPFn: getNewRelic,
			},
			Args:       args("logging newrelicotlp describe --name foobar --service-id 123 --version 3"),
			WantOutput: "\nCreated at: 2021-06-15 23:00:00 +0000 UTC\nDeleted at: 2021-06-15 23:00:00 +0000 UTC\nFormat: \nFormat Version: 0\nName: foobar\nPlacement: \nRegion: \nResponse Condition: \nService ID: 123\nService Version: 3\nToken: abc\nURL: \nUpdated at: 2021-06-15 23:00:00 +0000 UTC\n",
		},
		{
			Name: "validate missing --autoclone flag is OK",
			API: mock.API{
				ListVersionsFn:    testutil.ListVersions,
				GetNewRelicOTLPFn: getNewRelic,
			},
			Args:       args("logging newrelicotlp describe --name foobar --service-id 123 --version 1"),
			WantOutput: "\nCreated at: 2021-06-15 23:00:00 +0000 UTC\nDeleted at: 2021-06-15 23:00:00 +0000 UTC\nFormat: \nFormat Version: 0\nName: foobar\nPlacement: \nRegion: \nResponse Condition: \nService ID: 123\nService Version: 1\nToken: abc\nURL: \nUpdated at: 2021-06-15 23:00:00 +0000 UTC\n",
		},
	}

	for testcaseIdx := range scenarios {
		testcase := &scenarios[testcaseIdx]
		t.Run(testcase.Name, func(t *testing.T) {
			var stdout bytes.Buffer
			opts := testutil.NewRunOpts(testcase.Args, &stdout)
			opts.APIClient = mock.APIClient(testcase.API)
			err := app.Run(opts)
			testutil.AssertErrorContains(t, err, testcase.WantError)
			testutil.AssertStringContains(t, stdout.String(), testcase.WantOutput)
		})
	}
}

func TestNewRelicList(t *testing.T) {
	args := testutil.Args
	scenarios := []testutil.TestScenario{
		{
			Name:      "validate missing --version flag",
			Args:      args("logging newrelicotlp list"),
			WantError: "error parsing arguments: required flag --version not provided",
		},
		{
			Name:      "validate missing --service-id flag",
			Args:      args("logging newrelicotlp list --version 3"),
			WantError: "error reading service: no service ID found",
		},
		{
			Name: "validate ListNewRelics API error",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				ListNewRelicOTLPFn: func(i *fastly.ListNewRelicOTLPInput) ([]*fastly.NewRelicOTLP, error) {
					return nil, testutil.Err
				},
			},
			Args:      args("logging newrelicotlp list --service-id 123 --version 3"),
			WantError: testutil.Err.Error(),
		},
		{
			Name: "validate ListNewRelics API success",
			API: mock.API{
				ListVersionsFn:     testutil.ListVersions,
				ListNewRelicOTLPFn: listNewRelic,
			},
			Args:       args("logging newrelicotlp list --service-id 123 --version 3"),
			WantOutput: "SERVICE ID  VERSION  NAME\n123         3        foo\n123         3        bar\n",
		},
		{
			Name: "validate missing --autoclone flag is OK",
			API: mock.API{
				ListVersionsFn:     testutil.ListVersions,
				ListNewRelicOTLPFn: listNewRelic,
			},
			Args:       args("logging newrelicotlp list --service-id 123 --version 1"),
			WantOutput: "SERVICE ID  VERSION  NAME\n123         1        foo\n123         1        bar\n",
		},
		{
			Name: "validate missing --verbose flag",
			API: mock.API{
				ListVersionsFn:     testutil.ListVersions,
				ListNewRelicOTLPFn: listNewRelic,
			},
			Args:       args("logging newrelicotlp list --service-id 123 --verbose --version 1"),
			WantOutput: "Fastly API token not provided\nFastly API endpoint: https://api.fastly.com\n\nService ID (via --service-id): 123\n\nService Version: 1\n\nName: foo\n\nToken: \n\nFormat: \n\nFormat Version: 0\n\nPlacement: \n\nRegion: \n\nResponse Condition: \n\nCreated at: 2021-06-15 23:00:00 +0000 UTC\nUpdated at: 2021-06-15 23:00:00 +0000 UTC\nDeleted at: 2021-06-15 23:00:00 +0000 UTC\n\nName: bar\n\nToken: \n\nFormat: \n\nFormat Version: 0\n\nPlacement: \n\nRegion: \n\nResponse Condition: \n\nCreated at: 2021-06-15 23:00:00 +0000 UTC\nUpdated at: 2021-06-15 23:00:00 +0000 UTC\nDeleted at: 2021-06-15 23:00:00 +0000 UTC\n",
		},
	}

	for testcaseIdx := range scenarios {
		testcase := &scenarios[testcaseIdx]
		t.Run(testcase.Name, func(t *testing.T) {
			var stdout bytes.Buffer
			opts := testutil.NewRunOpts(testcase.Args, &stdout)
			opts.APIClient = mock.APIClient(testcase.API)
			err := app.Run(opts)
			testutil.AssertErrorContains(t, err, testcase.WantError)
			testutil.AssertStringContains(t, stdout.String(), testcase.WantOutput)
		})
	}
}

func TestNewRelicUpdate(t *testing.T) {
	args := testutil.Args
	scenarios := []testutil.TestScenario{
		{
			Name:      "validate missing --name flag",
			Args:      args("logging newrelicotlp update --service-id 123 --version 3"),
			WantError: "error parsing arguments: required flag --name not provided",
		},
		{
			Name:      "validate missing --version flag",
			Args:      args("logging newrelicotlp update --name foobar --service-id 123"),
			WantError: "error parsing arguments: required flag --version not provided",
		},
		{
			Name:      "validate missing --service-id flag",
			Args:      args("logging newrelicotlp update --name foobar --version 3"),
			WantError: "error reading service: no service ID found",
		},
		{
			Name: "validate missing --autoclone flag",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
			},
			Args:      args("logging newrelicotlp update --name foobar --service-id 123 --version 1"),
			WantError: "service version 1 is not editable",
		},
		{
			Name: "validate UpdateNewRelic API error",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				UpdateNewRelicOTLPFn: func(i *fastly.UpdateNewRelicOTLPInput) (*fastly.NewRelicOTLP, error) {
					return nil, testutil.Err
				},
			},
			Args:      args("logging newrelicotlp update --name foobar --new-name beepboop --service-id 123 --version 3"),
			WantError: testutil.Err.Error(),
		},
		{
			Name: "validate UpdateNewRelic API success",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				UpdateNewRelicOTLPFn: func(i *fastly.UpdateNewRelicOTLPInput) (*fastly.NewRelicOTLP, error) {
					return &fastly.NewRelicOTLP{
						Name:           *i.NewName,
						ServiceID:      i.ServiceID,
						ServiceVersion: i.ServiceVersion,
					}, nil
				},
			},
			Args:       args("logging newrelicotlp update --name foobar --new-name beepboop --service-id 123 --version 3"),
			WantOutput: "Updated New Relic OTLP logging endpoint 'beepboop' (previously: foobar, service: 123, version: 3)",
		},
		{
			Name: "validate --autoclone results in cloned service version",
			API: mock.API{
				ListVersionsFn: testutil.ListVersions,
				CloneVersionFn: testutil.CloneVersionResult(4),
				UpdateNewRelicOTLPFn: func(i *fastly.UpdateNewRelicOTLPInput) (*fastly.NewRelicOTLP, error) {
					return &fastly.NewRelicOTLP{
						Name:           *i.NewName,
						ServiceID:      i.ServiceID,
						ServiceVersion: i.ServiceVersion,
					}, nil
				},
			},
			Args:       args("logging newrelicotlp update --autoclone --name foobar --new-name beepboop --service-id 123 --version 1"),
			WantOutput: "Updated New Relic OTLP logging endpoint 'beepboop' (previously: foobar, service: 123, version: 4)",
		},
	}

	for testcaseIdx := range scenarios {
		testcase := &scenarios[testcaseIdx]
		t.Run(testcase.Name, func(t *testing.T) {
			var stdout bytes.Buffer
			opts := testutil.NewRunOpts(testcase.Args, &stdout)
			opts.APIClient = mock.APIClient(testcase.API)
			err := app.Run(opts)
			testutil.AssertErrorContains(t, err, testcase.WantError)
			testutil.AssertStringContains(t, stdout.String(), testcase.WantOutput)
		})
	}
}

func getNewRelic(i *fastly.GetNewRelicOTLPInput) (*fastly.NewRelicOTLP, error) {
	t := testutil.Date

	return &fastly.NewRelicOTLP{
		Name:           i.Name,
		Token:          "abc",
		ServiceID:      i.ServiceID,
		ServiceVersion: i.ServiceVersion,

		CreatedAt: &t,
		DeletedAt: &t,
		UpdatedAt: &t,
	}, nil
}

func listNewRelic(i *fastly.ListNewRelicOTLPInput) ([]*fastly.NewRelicOTLP, error) {
	t := testutil.Date
	vs := []*fastly.NewRelicOTLP{
		{
			Name:           "foo",
			ServiceID:      i.ServiceID,
			ServiceVersion: i.ServiceVersion,

			CreatedAt: &t,
			DeletedAt: &t,
			UpdatedAt: &t,
		},
		{
			Name:           "bar",
			ServiceID:      i.ServiceID,
			ServiceVersion: i.ServiceVersion,

			CreatedAt: &t,
			DeletedAt: &t,
			UpdatedAt: &t,
		},
	}
	return vs, nil
}

repository: fastly/cli

repo_name: fastly/cli


text:
@string{BiophysicalJ="Biophys. J."}
@string{JMB="J. Mol. Biol."}
@string{CarboResearch="Carbohydr. Res."}
@string{JCC="J. Comput. Chem."}
@string{JPCB="J. Phys. Chem. B"}
@string{JCompPhys="J. Comput. Phys."}
@string{JBC="J. Biol. Chem."}
@string{PNAS="Proc. Natl. Acad. Sci. USA"}
@string{JCompPhys="J. Comp. Phys."}
@string{JACS="J. Am. Chem. Soc."}
@string{JCTC="J. Chem. Theory Comput."}
@string{JChemPhys="J. Chem. Phys."}
@string{JSB="J. Struct. Biol."}
@string{JNeuro="J. Neurochem."}
@string{AnnRevBiochem="Annu. Rev. Biochem."}
@string{MethodsEnzy="Methods Enzymol."}
@string{ExperimentalNeurology="Exp. Neurol."}
@string{JMolGraphics="J. Mol. Graph."}
@string{AnnRevPhysChem="Annu. Rev. Phys. Chem."}
@string{FEBS="FEBS J."}
@string{DrugDevRes="Drug Dev. Res."}
@string{NatRevMol="Nat. Rev. Mol. Cell. Biol."}
@string{NMRBiomed="NMR Biomed."}
@string{BiochimicaActa="Biochim. Biophys."}
@string{NatRevDrug="Nat. Rev. Mol. Drug. Discov."}
@string{AngewChemInt="Angew. Chem. Int. Ed. Engl."}
@string{AdvExpMedBiol="Adv. Exp. Med. Biol."}
@string{FEBSLett="FEBS Lett."}
@string{NatMed="Nat. Med."}
@string{NatChem="Nat. Chem."}
@string{Neuropharmacol="Neuropharmacol."}
@string{BiophysChem="Biophys. Chem."}
@string{NatStructMol="Nat. Struct. Mol. Biol."}
@string{JMolMed="J. Mol. Med."}
@string{BiochemCellBiol="Biochem. Cell. Biol."}
@string{PLoSComputBiol="PLoS Comput. Biol."}
@string{BioorgMedChem="Bioorg. Med. Chem."}
@string{ChemBiolDrugDes="Chem. Biol. Drug. Des."}
@string{ProteinEng="Protein Eng."}
@string{NatRevDrugDiscov="Nat. Rev. Drug. Discov."}
@string{ChemCommun="Chem. Commun."}
@string{BiochemBiophysResCommun="Biochem. Biophys. Res. Commun."}
@string{AccChemRes="Acc. Chem. Res."}
@string{JCP="J. Chem. Phys."}
@string{ACSNeuro="ACS Chem. Neurosci."}
@string{plos1="PLoS ONE"}

repository: graceli/thesis

repo_name: graceli/thesis


text:
@inproceedings{wang2019learning,
 author = {Wang, Ziwei and Lu, Jiwen and Tao, Chenxin and Zhou, Jie and Tian, Qi},
 booktitle = {CVPR},
 pages = {568--577},
 title = {Learning channel-wise interactions for binary convolutional neural networks},
 year = {2019}
}

repository: ZiweiWangTHU/academic-kickstart

repo_name: ZiweiWangTHU/academic-kickstart


text:
@article{bryning2005thermal,
 author = {Bryning, MB and Milkie, DE and Islam, MF and Kikkawa, JM and Yodh, AG},
 journal = {Applied Physics Letters},
 number = {16},
 pages = {161909},
 publisher = {American Institute of Physics},
 title = {Thermal conductivity and interfacial resistance in single-wall carbon nanotube epoxy composites},
 volume = {87},
 year = {2005}
}

repository: dmilkie/starter-academic

repo_name: dmilkie/starter-academic


text:
package app

import (
	"github.com/hailongz/golang/db"
	"github.com/hailongz/golang/micro"
)

func (S *Service) VerCount(app micro.IContext, task *VerCountTask) (*CountData, error) {

	v := Ver{}

	conn, prefix, err := app.GetDB("rd")

	if err != nil {
		return nil, err
	}

	prefix = Prefix(app, prefix, task.Appid)

	n, err := db.Count(conn, &v, prefix, "WHERE appid=?", task.Appid)

	if err != nil {
		return nil, err
	}

	return &CountData{Total: int32(n)}, nil
}


text:
SUMMARY = "Microchip WILC devices firmware files for use with Linux kernel"
SECTION = "kernel"
LICENSE = "MICROCHIP_FW"

LIC_FILES_CHKSUM = "file://LICENSE.wilc_fw;beginline=6;md5=e1a0446d046c966a27276cf8e728f687"

SRCREV = "86f68c2a8fc07d1acc0b74ef28a4b2af86602289"
SRC_URI = "git://github.com/linux4wilc/firmware.git;protocol=https;branch=master"
S = "${WORKDIR}/git"

inherit allarch

do_install() {
	install -d ${D}${nonarch_base_libdir}/firmware/mchp/
	cp -r ${S}/* ${D}${nonarch_base_libdir}/firmware/mchp/

	# remove unneeded file
	rm -f ${D}${nonarch_base_libdir}/firmware/mchp/README.md
	rm -f ${D}${nonarch_base_libdir}/firmware/mchp/LICENSE.wilc_fw
	chmod -x ${D}${nonarch_base_libdir}/firmware/mchp/*
}

FILES:${PN} += " \
	${nonarch_base_libdir}/firmware/mchp/wilc*.bin \
	"

# TODO: use ALTERNATIVE like in "linux-firmware" package

branch_name: refs/heads/kirkstone


text:
if(NOT TARGET gRPC::grpc_cpp_plugin)
    if(CMAKE_CROSSCOMPILING)
        find_program(GRPC_CPP_PLUGIN_PROGRAM
            NAMES grpc_cpp_plugin
            PATHS ENV
            PATH NO_DEFAULT_PATH)
    else()
        find_program(GRPC_CPP_PLUGIN_PROGRAM
            NAMES grpc_cpp_plugin
            PATHS "${CMAKE_CURRENT_LIST_DIR}/../../bin/"
            NO_DEFAULT_PATH)
    endif()

    get_filename_component(GRPC_CPP_PLUGIN_PROGRAM "${GRPC_CPP_PLUGIN_PROGRAM}" ABSOLUTE)

    add_executable(gRPC::grpc_cpp_plugin IMPORTED)
    set_property(TARGET gRPC::grpc_cpp_plugin PROPERTY IMPORTED_LOCATION ${GRPC_CPP_PLUGIN_PROGRAM})
endif()

repository: CAMOBAP/conan-center-index

repo_name: CAMOBAP/conan-center-index

gha_language: Python


text:
DESCRIPTION = "Mounts and populates a tmpfs over /media"
LICENSE = "GPL"

PV="1.1"

SRC_URI = "file://*"

PACKAGES = "${PN}"

FILES_${PN} = "/etc"

do_compile() {
}

do_install() {
	install -d ${D}${sysconfdir}/init.d
	install -m 0755 ${WORKDIR}/volatile-media.sh ${D}${sysconfdir}/init.d
	install -d ${D}${sysconfdir}/rcS.d
	ln -sf ../init.d/volatile-media.sh ${D}${sysconfdir}/rcS.d/S03volatile-media.sh
}


text:
SUMMARY = "WPEFramework Plugins RDK"
DESCRIPTION = "WPEFramework/Thunder Plugins RDK"
HOMEPAGE = "https://github.com:/WebPlatformForEmbedded/ThunderNanoServicesRDK"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=39fb5e7bc6aded7b6d2a5f5aa553425f"

PR = "r1"
PV = "3.0+git${SRCPV}"
RECIPE_BRANCH ?= "master"
SRC_URI = "git://git@github.com:/WebPlatformForEmbedded/ThunderNanoServicesRDK.git;protocol=ssh;branch=${RECIPE_BRANCH}"
SRCREV ?= "65f575337fff817a06cdc0ad53958f9f1c30eb77"

require include/wpeframework-plugins-rdk.inc

ASNEEDED = ""

repository: WebPlatformForEmbedded/meta-wpe

repo_name: WebPlatformForEmbedded/meta-wpe