text:
SUMMARY = "ISO 8601 date/time parser"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://PKG-INFO;beginline=8;endline=8;md5=e910b35b0ef4e1f665b9a75d6afb7709"

SRC_URI[md5sum] = "0e1203fce27ce65e2d01c5f21c4d428f"
SRC_URI[sha256sum] = "2e364a3d5759479cdb2d37cce6b9376ea504db2ff90252a2e5b7cc89cc9ff2d8"

inherit pypi setuptools3

RDEPENDS_${PN} += " \
    ${PYTHON_PN}-six \
"

BBCLASSEXTEND = "native nativesdk"

repository: ni/meta-openembedded

repo_name: ni/meta-openembedded

branch_name: refs/heads/nilrt/master/hardknott


text:
// SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company and Gardener contributors
//
// SPDX-License-Identifier: Apache-2.0

package markdown

import (
	"bytes"
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"reflect"
	"strings"

	"gopkg.in/yaml.v3"
)

// ErrFrontMatterNotClosed is raised to signal
// that the rules for defining a frontmatter element
// in a markdown document have been violated
var ErrFrontMatterNotClosed error = errors.New("Missing closing frontmatter `---` found")

// StripFrontMatter splits a provided document into front-matter
// and content.
func StripFrontMatter(b []byte) ([]byte, []byte, error) {
	var (
		started      bool
		yamlBeg      int
		yamlEnd      int
		contentStart int
	)

	buf := bytes.NewBuffer(b)

	for {
		line, err := buf.ReadString('\n')

		if errors.Is(err, io.EOF) {
			// handle documents that contain only forntmatter
			// and no line ending after closing ---
			if started && yamlEnd == 0 {
				if l := strings.TrimSpace(line); l == "---" {
					yamlEnd = len(b) - buf.Len() - len([]byte(line))
					contentStart = len(b)
				}

			}
			break
		}

		if err != nil {
			return nil, nil, err
		}

		if l := strings.TrimSpace(line); l != "---" {
			// Only whitespace is acceptable before front-matter
			// Any other preceding text is interpeted as frontmater-less
			// document
			if !started && len(l) > 0 {
				return nil, b, nil
			}
			continue
		}

		if !started {
			started = true
			yamlBeg = len(b) - buf.Len()
		} else {
			yamlEnd = len(b) - buf.Len() - len([]byte(line))
			contentStart = yamlEnd + len([]byte(line))
			break
		}
	}

	if started && yamlEnd == 0 {
		return nil, nil, ErrFrontMatterNotClosed
	}

	fm := b[yamlBeg:yamlEnd]
	content := b[contentStart:]

	return fm, content, nil
}

// InsertFrontMatter prepends the content bytes with
// front matter enclosed in the standard marks ---
func InsertFrontMatter(fm []byte, content []byte) ([]byte, error) {
	var (
		data []byte
		err  error
	)
	if len(fm) < 1 {
		return content, nil
	}
	buf := bytes.NewBuffer([]byte("---\n"))
	buf.Write(fm)
	// TODO: configurable empty line after frontmatter
	buf.WriteString("---\n")
	buf.Write(content)
	if data, err = ioutil.ReadAll(buf); err != nil {
		return nil, err
	}
	return data, nil
}

// MatchFrontMatterRules inspects content `b` for compliance with `frontMatter`
// and `excludeFrontMatter`.
func MatchFrontMatterRules(b []byte, frontMatter map[string]interface{}, excludeFrontMatter map[string]interface{}) (bool, error) {
	fmBytes, _, err := StripFrontMatter(b)
	if err != nil {
		return false, err
	}
	if fmBytes == nil {
		return false, nil
	}
	fm := map[string]interface{}{}
	if err := yaml.Unmarshal(fmBytes, fm); err != nil {
		return false, err
	}
	selected := false
	for path, v := range frontMatter {
		if MatchFrontMatterRule(path, v, fm) {
			selected = true
			break
		}
	}
	for path, v := range excludeFrontMatter {
		if MatchFrontMatterRule(path, v, fm) {
			selected = false
			break
		}
	}
	return selected, nil
}

// MatchFrontMatterRule explores a parsed frontmatter object `data` to matchFMRule
// `value` at `path` pattern and return true on successfull matchFMRule or false
// otherwise.
// Path is an expression with a JSONPath-like simplified notation.
// An object in path is modeled as dot (`.`). Paths start with the root object,
// i.e. the most minimal path is `.`.
// An object element value is referenced by its name (key) in the object map:
// `.a.b.c` is path to element `c` in map `b` in map `a` in root object map.
// Element values can be scalar, object maps or arrays.
// An element in an array is referenced by its index: `.a.b[1]` references `b`
// array element with index 1.
// Paths can include up to one wildcard `**` symbol that models *any* path node.
// A `.a.**.c` models any path starting with	`.a.` and ending with `.c`.
func MatchFrontMatterRule(path string, val interface{}, data interface{}) bool {
	return matchFMRule(path, val, nil, data)
}

func matchFMRule(pathPattern string, val interface{}, path []string, data interface{}) bool {
	if path == nil {
		path = []string{"."}
	}
	p := strings.Join(path, "")
	if _matchFMPath(pathPattern, p) {
		if reflect.DeepEqual(val, data) {
			return true
		}
	}
	switch vv := data.(type) {
	case []interface{}:
		for i, u := range vv {
			_p := append(path, fmt.Sprintf("[%d]", i))
			if ok := matchFMRule(pathPattern, val, _p, u); ok {
				return true
			}
		}
	case map[string]interface{}:
		for k, u := range vv {
			if path[(len(path))-1] != "." {
				path = append(path, ".")
			}
			_p := append(path, k)
			if ok := matchFMRule(pathPattern, val, _p, u); ok {
				return true
			}
		}
	}
	return false
}

func _matchFMPath(pathPattern, path string) bool {
	if pathPattern == path {
		return true
	}
	s := strings.Split(pathPattern, "**")
	if len(s) > 1 {
		if strings.HasPrefix(path, s[0]) {
			if len(s[1]) == 0 || strings.HasSuffix(path, s[1]) {
				return true
			}
		}
	}
	return false
}

repository: swilen-iwanow/docforge

license_type: permissive

repo_name: swilen-iwanow/docforge

branch_name: refs/heads/master

extension: go


text:
package btest

import (
	"testing"

	"github.com/hortbot/hortbot/internal/bot/botfakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/extralife/extralifefakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/hltb/hltbfakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/lastfm/lastfmfakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/simple/simplefakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/steam/steamfakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/tinyurl/tinyurlfakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/twitch/twitchfakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/urban/urbanfakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/xkcd/xkcdfakes"
	"github.com/hortbot/hortbot/internal/pkg/apiclient/youtube/youtubefakes"
	"github.com/hortbot/hortbot/internal/pkg/fakex"
)

func newFakeRand(t testing.TB) *botfakes.FakeRand {
	f := &botfakes.FakeRand{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeLastFM(t testing.TB) *lastfmfakes.FakeAPI {
	f := &lastfmfakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeYouTube(t testing.TB) *youtubefakes.FakeAPI {
	f := &youtubefakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeXKCD(t testing.TB) *xkcdfakes.FakeAPI {
	f := &xkcdfakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeExtraLife(t testing.TB) *extralifefakes.FakeAPI {
	f := &extralifefakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeTwitch(t testing.TB) *twitchfakes.FakeAPI {
	f := &twitchfakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeSteam(t testing.TB) *steamfakes.FakeAPI {
	f := &steamfakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeTinyURL(t testing.TB) *tinyurlfakes.FakeAPI {
	f := &tinyurlfakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeUrban(t testing.TB) *urbanfakes.FakeAPI {
	f := &urbanfakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeSimple(t testing.TB) *simplefakes.FakeAPI {
	f := &simplefakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

func newFakeHLTB(t testing.TB) *hltbfakes.FakeAPI {
	f := &hltbfakes.FakeAPI{}
	fakex.StubNotImplemented(t, f)
	return f
}

license: MIT

repository: hortbot/hortbot

repo_name: hortbot/hortbot

gha_license_id: MIT

gha_language: Go


text:
package dependency

import (
	"testing"
)

func TestGraph(t *testing.T) {
	var (
		root                   = newNode("root", nil)
		rootChild1             = newNode("rootChild1", nil)
		rootChild2             = newNode("rootChild2", nil)
		rootChild3             = newNode("rootChild3", nil)
		rootChild2Child1       = newNode("rootChild2Child1", nil)
		rootChild2Child1Child1 = newNode("rootChild2Child1Child1", nil)

		testGraph = newGraph(root)
	)

	_, err := testGraph.insertNodeAt("does not exits", rootChild1.ID, nil)
	if err == nil {
		t.Fatal("insertNodeAt error expected")
	}

	testGraph.insertNodeAt(root.ID, rootChild1.ID, nil)
	testGraph.insertNodeAt(root.ID, rootChild2.ID, nil)
	testGraph.insertNodeAt(root.ID, rootChild3.ID, nil)

	testGraph.insertNodeAt(rootChild2.ID, rootChild2Child1.ID, nil)
	testGraph.insertNodeAt(rootChild2Child1.ID, rootChild2Child1Child1.ID, nil)
	testGraph.insertNodeAt(rootChild3.ID, rootChild2.ID, nil)

	// Cyclic graph error
	_, err = testGraph.insertNodeAt(rootChild2Child1Child1.ID, rootChild3.ID, nil)
	if err == nil {
		t.Fatal("Cyclic error expected")
	} else {
		errMsg := `Cyclic dependency found:
rootChild2Child1Child1
rootChild3
rootChild2
rootChild2Child1
rootChild2Child1Child1`

		if err.Error() != errMsg {
			t.Fatalf("Expected %s, got %s", errMsg, err.Error())
		}
	}

	// Find first path
	path := findFirstPath(rootChild1, rootChild2)
	if path != nil {
		t.Fatalf("Wrong path found: %#+v", path)
	}

	// Find first path
	path = findFirstPath(root, rootChild2Child1Child1)
	if len(path) != 4 || path[0].ID != root.ID || path[1].ID != rootChild2.ID || path[2].ID != rootChild2Child1.ID || path[3].ID != rootChild2Child1Child1.ID {
		t.Fatalf("Wrong path found: %#+v", path)
	}

	// Get leaf node
	leaf := testGraph.getNextLeaf(root)
	if leaf.ID != rootChild1.ID {
		t.Fatalf("GetLeaf1: Got id %s, expected %s", leaf.ID, rootChild1.ID)
	}

	err = testGraph.addEdge("NotThere", leaf.ID)
	if err == nil {
		t.Fatal("No error when adding an edge from a non-existing node")
	}

	err = testGraph.addEdge(leaf.ID, "NotThere")
	if err == nil {
		t.Fatal("No error when adding an edge to a non-existing node")
	}

	// Remove node
	err = testGraph.removeNode(leaf.ID)
	if err != nil {
		t.Fatal(err)
	}

	// Get leaf node
	leaf = testGraph.getNextLeaf(root)
	if leaf.ID != rootChild2Child1Child1.ID {
		t.Fatalf("GetLeaf2: Got id %s, expected %s", leaf.ID, rootChild2Child1Child1.ID)
	}

	// Remove node
	err = testGraph.removeNode(root.ID)
	if err == nil {
		t.Fatal("Expected error")
	}
}


text:
require libtool.inc
PR = "${INC_PR}.2"

DEFAULT_PREFERENCE = "-1"

SRC_URI_append = " file://prefix.patch \
                 "
SRC_URI[md5sum] = "b32b04148ecdd7344abc6fe8bd1bb021"
SRC_URI[sha256sum] = "13df57ab63a94e196c5d6e95d64e53262834fe780d5e82c28f177f9f71ddf62e"

DEPENDS += "libtool-native"

do_configure_prepend () {
        # Remove any existing libtool m4 since old stale versions would break
        # any upgrade
        rm -f ${STAGING_DATADIR}/aclocal/libtool.m4
        rm -f ${STAGING_DATADIR}/aclocal/lt*.m4
}

do_install () {
        install -d ${D}${bindir}/
        install -m 0755 ${HOST_SYS}-libtool ${D}${bindir}/${HOST_SYS}-libtool
        install -d ${D}${datadir}/libtool/
        install -d ${D}${datadir}/libtool/config
        install -d ${D}${datadir}/aclocal/
        install -c ${S}/libltdl/config/config.guess ${D}${datadir}/libtool/config/
        install -c ${S}/libltdl/config/config.sub ${D}${datadir}/libtool/config/
        install -c -m 0644 ${S}/libltdl/config/ltmain.sh ${D}${datadir}/libtool/config/
        install -c -m 0644 ${S}/libltdl/m4/libtool.m4 ${D}${datadir}/aclocal/
        install -c -m 0644 ${S}/libltdl/m4/ltdl.m4 ${D}${datadir}/aclocal/
}

SYSROOT_PREPROCESS_FUNCS += "libtoolcross_sysroot_preprocess"

libtoolcross_sysroot_preprocess () {
        install -d ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/
        install -m 755 ${D}${bindir}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/${HOST_SYS}-libtool
}
NATIVE_INSTALL_WORKS = "1"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD

extension: bb


text:
SECTION = "devel/chicken"
DESCRIPTION = "Limit constants for numbers"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://number-limits.meta;md5=75a78eea6c64c7274b682901037d66ed"
DEPENDS_append_class-cross = " chicken-egg-setup-helper-cross"
DEPENDS_append_class-crosssdk = " chicken-egg-setup-helper-crosssdk"
DEPENDS_append_class-nativesdk = " nativesdk-chicken-egg-setup-helper chicken-egg-setup-helper-crosssdk"
DEPENDS = " chicken-egg-setup-helper chicken-egg-setup-helper-cross"
RDEPENDS_${PN} = " chicken-egg-setup-helper"

SRC_URI = "http://code.call-cc.org/egg-tarballs/4/number-limits/number-limits-${PV}.tar.gz"

SRC_URI[md5sum] = "6666f16d54c0f0cc98825cc0d56ba895"
SRC_URI[sha256sum] = "dc8b468c8bfce578a2802c23acb9cc77b97944cead6ca90a0749b49cf4079ef9"

S = "${WORKDIR}/number-limits-${PV}"

inherit chicken_install

BBCLASSEXTEND = "cross crosssdk nativesdk"

repository: OSSystems/meta-chicken

repo_name: OSSystems/meta-chicken


text:
package logger

import (
	"io"
	"log"
	"os"
)

type defaultLogger struct {
	debug   *log.Logger
	info    *log.Logger
	warning *log.Logger
	mError  *log.Logger
}

func New(logName string) Logger {
	file, err := os.OpenFile(logName,
		os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0666)
	if err != nil {
		log.Fatalln("Failed to open error log file:", err)
	}
	return &defaultLogger{
		log.New(io.MultiWriter(file, os.Stdout), "DEBUG: ", log.Ldate|log.Lmicroseconds|log.Lshortfile),
		log.New(io.MultiWriter(file, os.Stdout), "INFO: ", log.Ldate|log.Lmicroseconds|log.Lshortfile),
		log.New(io.MultiWriter(file, os.Stdout), "WARN: ", log.Ldate|log.Lmicroseconds|log.Lshortfile),
		log.New(io.MultiWriter(file, os.Stderr), "ERROR: ", log.Ldate|log.Lmicroseconds|log.Lshortfile),
	}
}

func (m *defaultLogger) Debug(v ...interface{}) {
	m.debug.Println(v...)
}

func (m *defaultLogger) Debugf(format string, v ...interface{}) {
	m.debug.Printf(format, v...)
}

func (m *defaultLogger) Info(v ...interface{}) {
	m.info.Println(v...)
}

func (m *defaultLogger) Infof(format string, v ...interface{}) {
	m.info.Printf(format, v...)
}

func (m *defaultLogger) Warn(v ...interface{}) {
	m.warning.Println(v...)
}

func (m *defaultLogger) Warnf(format string, v ...interface{}) {
	m.warning.Printf(format, v...)
}

func (m *defaultLogger) Error(v ...interface{}) {
	m.mError.Println(v...)
}

func (m *defaultLogger) Errorf(format string, v ...interface{}) {
	m.mError.Printf(format, v...)
}

repository: itachizhu/gin-vue-samples

repo_name: itachizhu/gin-vue-samples


text:
package casbin

import (
	"fmt"
	"github.com/casbin/casbin/v2"
	gormadapter "github.com/casbin/gorm-adapter/v3"
	_ "github.com/go-sql-driver/mysql"
	"gocms/pkg/config"
	"gocms/pkg/logger"
)

func Initialize() {
	username := config.GetString("DB_USERNAME")
	password := config.GetString("DB_PASSWORD")
	host := config.GetString("DB_HOST")
	port := config.GetString("DB_PORT")
	database := config.GetString("DB_DATABASE")
	dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/", username, password, host, port)
	a, err := gormadapter.NewAdapter("mysql", dsn, database) // Your driver and data source.
	logger.PanicError(err, "new adapter", true)
	Enforcer, err := casbin.NewEnforcer("casbin.conf", a)
	logger.PanicError(err, "new adapter", true)

	config.Enforcer = Enforcer
}


text:
DESCRIPTION = "This module provides a variety of constants, structure manipulators and \
other functions related to socket-based networking. The values and \
functions provided are useful when used in conjunction with Perl core \
functions such as socket(), setsockopt() and bind(). It also provides \
several other support functions, mostly for dealing with conversions of \
network addresses between human-readable and native binary forms, and for \
hostname resolver operations."

SECTION = "libs"
LICENSE = "Artisticv1 | GPLv1+"
PR = "r0"

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

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Artistic-1.0;md5=cda03bbdc3c1951996392b872397b798 \
file://${COMMON_LICENSE_DIR}/GPL-1.0;md5=e9e36a9de734199567a4d769498f743d"

SRC_URI = "https://cpan.metacpan.org/authors/id/P/PE/PEVANS/Socket-2.027.tar.gz"

SRC_URI[md5sum] = "8741e7a55272f5db80c520be43a725a1"
SRC_URI[sha256sum] = "141c11494d171c13765d972417be731388f6372ffaad619cfc72998e972be2a8"

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

inherit cpan

do_compile() {
	export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
	cpan_do_compile
}

BBCLASSEXTEND = "native"

repository: CELLINKAB/meta-cpan

repo_name: CELLINKAB/meta-cpan


text:
DESCRIPTION = "A database migration tool for SQLAlchemy"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3023b042cb6002cb398344b51c67093"

inherit pypi setuptools3

SRC_URI[sha256sum] = "6a810a6b012c88b33458fceb869aef09ac75d6ace5291915ba7fae44de372c01"

PYPI_PACKAGE = "alembic"

RDEPENDS:${PN} += "\
    ${PYTHON_PN}-dateutil \
    ${PYTHON_PN}-editor \
    ${PYTHON_PN}-mako \
    ${PYTHON_PN}-sqlalchemy \
    ${PYTHON_PN}-misc \
"

BBCLASSEXTEND = "native nativesdk"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake


text:
package serv

import (
	"io/fs"
	"net/http"
	"path"
	"strings"

	"github.com/dosco/graphjin/internal/common"
	"github.com/dosco/graphjin/serv/internal/auth"
	"github.com/klauspost/compress/gzhttp"
	"go.opencensus.io/plugin/ochttp"
	"go.uber.org/zap"
)

const (
	apiRoute     = "/api/v1/graphql"
	actionRoute  = "/api/v1/actions"
	healthRoute  = "/health"
	metricsRoute = "/metrics"
)

func (s *service) isHealthEndpoint(r *http.Request) bool {
	p := r.URL.Path
	return p == healthRoute || p == metricsRoute ||
		(s.conf.Telemetry.Metrics.Endpoint != "" && p == s.conf.Telemetry.Metrics.Endpoint)
}

func routeHandler(s1 *Service, mux *http.ServeMux) (http.Handler, error) {
	var err error
	s := s1.Load().(*service)

	// Healthcheck API
	mux.Handle(healthRoute, healthV1Handler(s1))

	if s.conf.HotDeploy {
		// Rollback Config API
		mux.Handle(common.RollbackRoute, adminRollbackHandler(s1))
		// Deploy Config API
		mux.Handle(common.DeployRoute, adminDeployHandler(s1))
	}

	if err := setActionRoutes(s1, mux); err != nil {
		return nil, err
	}

	if s.conf.WebUI {
		if webRoot, err := fs.Sub(webBuild, "web/build"); err != nil {
			return nil, err
		} else {
			mux.Handle("/", http.FileServer(http.FS(webRoot)))
		}
	}

	// Main GraphQL API
	h := apiV1Handler(s1)

	if s.conf.rateLimiterEnable() {
		h = rateLimiter(s1, h)
	}

	if s.conf.HTTPGZip {
		if gz, err := gzhttp.NewWrapper(gzhttp.CompressionLevel(6)); err != nil {
			return nil, err
		} else {
			h = gz(h)
		}
	}

	mux.Handle(apiRoute, h)

	if s.conf.telemetryEnabled() {
		if s.closeFn, err = enableObservability(s, mux); err != nil {
			return nil, err
		}
	}

	return setServerHeader(mux), nil
}

func setActionRoutes(s1 *Service, mux *http.ServeMux) error {
	var zlog *zap.Logger
	var err error
	s := s1.Load().(*service)

	if s.conf.Core.Debug {
		zlog = s.zlog
	}

	for i, a := range s.conf.Serv.Actions {
		var fn http.Handler

		fn, err = newAction(s1, &s.conf.Serv.Actions[i])
		if err != nil {
			break
		}

		p := path.Join(actionRoute, strings.ToLower(a.Name))
		h := fn

		if s.conf.telemetryEnabled() {
			h = ochttp.WithRouteTag(h, p)
		}

		if ac := findAuth(s, a.AuthName); ac != nil {
			h, err = auth.WithAuth(h, ac, zlog)
		}

		if err != nil {
			return err
		}

		mux.Handle(p, h)
	}
	return nil
}

repository: swipswaps/graphjin

repo_name: swipswaps/graphjin


text:
/*
Copyright 2020 The Knative 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 builds

import (
	"context"
	"encoding/json"
	"fmt"
	"log"

	"github.com/google/go-containerregistry/pkg/authn"
	"github.com/google/go-containerregistry/pkg/name"
	"github.com/tektoncd/cli/pkg/options"
	tknv1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
	pipelineclient "github.com/tektoncd/pipeline/pkg/client/injection/client"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"knative.dev/pkg/apis"
	kubeclient "knative.dev/pkg/client/injection/kube/client"
)

// CancelablePipelineOption is a function option that can be used to customize a pipelinerun in
// certain ways prior to execution.  Each option may return a cancel function, which
// can be used to clean up any temporary artifacts created in support of this pipeline run.
type CancelablePipelineOption func(context.Context, *tknv1beta1.PipelineRun) (context.CancelFunc, error)

// RunPipeline executes the provided PipelineRun with the provided options applied, and returns
// the final PipelineRun state (or error) upon completion.
func RunPipeline(ctx context.Context, pr *tknv1beta1.PipelineRun, opt *options.LogOptions, opts ...CancelablePipelineOption) (*tknv1beta1.PipelineRun, error) {
	client := pipelineclient.Get(ctx)

	for _, o := range opts {
		cancel, err := o(ctx, pr)
		if err != nil {
			return nil, err
		}
		defer cancel()
	}

	pr, err := client.TektonV1beta1().PipelineRuns(pr.Namespace).Create(ctx, pr, metav1.CreateOptions{})
	if err != nil {
		return nil, err
	}

	// TODO(mattmoor): From here down assumes opt.Follow, but if we want to have
	// a --no-wait or something then we should have an early-out here.
	defer client.TektonV1beta1().PipelineRuns(pr.Namespace).Delete(context.Background(), pr.Name, metav1.DeleteOptions{})

	opt.PipelineRunName = pr.Name
	if err := streamLogs(ctx, opt); err != nil {
		return nil, err
	}

	// Spin waiting for the final status.
	for {
		// See if our context has been cancelled
		select {
		case <-ctx.Done():
			return nil, ctx.Err()
		default:
		}

		// Fetch the final state of the build.
		pr, err = client.TektonV1beta1().PipelineRuns(pr.Namespace).Get(ctx, pr.Name, metav1.GetOptions{})
		if err != nil {
			return nil, err
		}

		// Return an error if the build failed.
		cond := pr.Status.GetCondition(apis.ConditionSucceeded)
		if cond.IsFalse() {
			return nil, fmt.Errorf("%s: %s", cond.Reason, cond.Message)
		} else if !cond.IsTrue() {
			continue
		}

		return pr, nil
	}
}

// WithPipelineServiceAccount is used to adjust the PipelineRun to execute as a particular
// service account, as specified by the user.  It supports a special "me" sentinel
// which configures a temporary ServiceAccount infused with the local credentials
// for the container registry hosting the image we will publish to (and to which
// the source is published).
func WithPipelineServiceAccount(ctx context.Context, sa string, refs ...name.Reference) CancelablePipelineOption {
	client := kubeclient.Get(ctx)

	return func(ctx context.Context, pr *tknv1beta1.PipelineRun) (context.CancelFunc, error) {
		if sa != "me" {
			pr.Spec.ServiceAccountName = sa
			return func() {}, nil
		}

		cfg := struct {
			Auths map[string]*authn.AuthConfig `json:"auths"`
		}{
			Auths: make(map[string]*authn.AuthConfig, len(refs)),
		}

		for _, ref := range refs {
			// Fetch the user's auth for the provided build target
			authenticator, err := authn.DefaultKeychain.Resolve(ref.Context())
			if err != nil {
				return nil, err
			}
			auth, err := authenticator.Authorization()
			if err != nil {
				return nil, err
			}
			// Use the funny form so that it works with DockerHub.
			cfg.Auths["https://"+ref.Context().RegistryStr()+"/v1/"] = auth
		}
		b, err := json.Marshal(cfg)
		if err != nil {
			return nil, err
		}

		// Create a secret and service account for this build.
		secret := &corev1.Secret{
			ObjectMeta: metav1.ObjectMeta{
				GenerateName: pr.GenerateName,
				Namespace:    pr.Namespace,
			},
			Type: corev1.SecretTypeDockerConfigJson,
			StringData: map[string]string{
				corev1.DockerConfigJsonKey: string(b),
			},
		}
		secret, err = client.CoreV1().Secrets(secret.Namespace).Create(ctx, secret, metav1.CreateOptions{})
		if err != nil {
			return nil, err
		}
		cleansecret := func() {
			err := client.CoreV1().Secrets(secret.Namespace).Delete(context.Background(), secret.Name, metav1.DeleteOptions{})
			if err != nil {
				log.Printf("WARNING: Secret %q leaked, error cleaning up: %v", secret.Name, err)
			}
		}

		sa := &corev1.ServiceAccount{
			ObjectMeta: metav1.ObjectMeta{
				GenerateName: pr.GenerateName,
				Namespace:    pr.Namespace,
			},
			// Support pulling source using the user credentials.
			ImagePullSecrets: []corev1.LocalObjectReference{{
				Name: secret.Name,
			}},
			Secrets: []corev1.ObjectReference{{
				Name: secret.Name,
			}},
		}

		sa, err = client.CoreV1().ServiceAccounts(sa.Namespace).Create(ctx, sa, metav1.CreateOptions{})
		if err != nil {
			cleansecret()
			return nil, err
		}
		cleansa := func() {
			err := client.CoreV1().ServiceAccounts(sa.Namespace).Delete(context.Background(), sa.Name, metav1.DeleteOptions{})
			if err != nil {
				log.Printf("WARNING: ServiceAccount %q leaked, error cleaning up: %v", sa.Name, err)
			}
		}

		pr.Spec.ServiceAccountName = sa.Name

		return func() {
			cleansa()
			cleansecret()
		}, nil
	}
}

repository: mattmoor/mink

repo_name: mattmoor/mink


text:
package inmemorytracker

import (
	"container/list"
	"time"

	"github.com/botlabs-gg/yagpdb/v2/lib/dstate"
)

func (shard *ShardTracker) runGcLoop(interval time.Duration) {
	var remainingGuilds []int64

	ticker := time.NewTicker(interval)
	for {
		<-ticker.C
		remainingGuilds = shard.gcTick(time.Now(), remainingGuilds)
	}
}

func (shard *ShardTracker) gcTick(t time.Time, remainingGuilds []int64) []int64 {
	shard.mu.Lock()
	defer shard.mu.Unlock()

	if len(remainingGuilds) < 1 {
		remainingGuilds = shard.getGuildIDs()
	}

	for {
		if len(remainingGuilds) < 1 {
			return remainingGuilds
		}

		next := remainingGuilds[0]
		remainingGuilds = remainingGuilds[1:]

		if guild, ok := shard.guilds[next]; ok {
			shard.gcGuild(t, guild)
			break
		}
	}

	return remainingGuilds
}

func (shard *ShardTracker) gcGuild(t time.Time, gs *SparseGuildState) {
	limitLen := shard.conf.ChannelMessageLen
	limitAge := shard.conf.ChannelMessageDur
	if shard.conf.ChannelMessageLimitsF != nil {
		limitLen, limitAge = shard.conf.ChannelMessageLimitsF(gs.Guild.ID)
	}

	if limitLen < 1 && limitAge < 1 {
		return // nothing to do, no limits
	}

	for _, v := range gs.Channels {
		shard.gcGuildChannel(t, gs, v.ID, limitLen, limitAge)
	}

	if shard.conf.RemoveOfflineMembersAfter > 0 {
		shard.gcMembers(t, gs, shard.conf.RemoveOfflineMembersAfter)
	}
}

func (shard *ShardTracker) gcGuildChannel(t time.Time, gs *SparseGuildState, channel int64, maxLen int, maxAge time.Duration) {
	if messages, ok := shard.messages[channel]; ok {
		if maxLen > 0 {
			overflow := messages.Len() - maxLen
			for i := overflow; i > 0; i-- {
				messages.Remove(messages.Front())
			}
		}

		if maxAge > 0 {
			if oldest := messages.Front(); oldest != nil {
				v := oldest.Value.(*dstate.MessageState)
				age := t.Sub(v.ParsedCreatedAt)

				if age > maxAge {
					shard.gcMessagesAge(t, gs, channel, maxAge, messages)
				}
			}
		}
	}
}

func (shard *ShardTracker) gcMessagesAge(t time.Time, gs *SparseGuildState, channel int64, maxAge time.Duration, messages *list.List) {
	toDel := make([]*list.Element, 0, 100)
	for e := messages.Front(); e != nil; e = e.Next() {
		v := e.Value.(*dstate.MessageState)
		age := t.Sub(v.ParsedCreatedAt)

		if age > maxAge {
			toDel = append(toDel, e)
		}
	}

	for _, v := range toDel {
		messages.Remove(v)
	}
}

func (shard *ShardTracker) getGuildIDs() []int64 {
	result := make([]int64, 0, len(shard.guilds))
	for _, v := range shard.guilds {
		result = append(result, v.Guild.ID)
	}

	return result
}

func (shard *ShardTracker) gcMembers(t time.Time, gs *SparseGuildState, maxAge time.Duration) {
	members, ok := shard.members[gs.Guild.ID]
	if !ok {
		return
	}

	for k, v := range members {
		if v.User.ID == shard.conf.BotMemberID {
			continue
		}

		if t.Sub(v.lastUpdated) < maxAge || (v.Presence != nil && v.Presence.Status != dstate.StatusOffline) {
			continue
		}

		delete(members, k)
	}
}

repository: mrbentarikau/yagpdb

repo_name: mrbentarikau/yagpdb


text:
@Article{Abu-Zeid_1986,
Title = {Determination of the Thickness and Refractive Index of {Cu$_2$O} Thin Film Using Thermal and Optical
Interferometry},
Author = {Abu-Zeid, M. E. and Rakhshani, A. E. and Al-Jassar, A. A. and Youssef, Y. A.},
Journal = {Physica Status Solidi (a)},
Year = {1986},
Pages = {613--620},
Volume = {93},
Doi = {10.1002/pssa.2210930226}
}

repository: FlamingTempura/bibtex-tidy

repo_name: FlamingTempura/bibtex-tidy

gha_language: TeX

extension: bib


text:
package saml

// This is the main auth class to coordinate typical calls
// for the sp and idp. It performs the following functions:
//
//SP
//Get auth request
//Parse auth response
//Get logout request
//Parse logout response
//
//IDP
//Parse auth request
//Create auth reponse TODO
//Parse logout request
//Create logout response TODO

import (
	"crypto"
	"crypto/rand"
	"crypto/rsa"
	"crypto/sha1"
	"crypto/x509"
	"net/url"

	"github.com/bmanth60/go-saml/packager"

	"encoding/base64"
	"encoding/pem"
	"encoding/xml"
)

//Document interface for saml document methods
type Document interface {
	String() (string, error)
	SignedString(s *Settings) (string, error)
}

//GetAuthnRequestURL as SP, generate authentication request url to perform sso
func GetAuthnRequestURL(s Settings, state string) (string, error) {
	r := ApplyAuthnRequest(s, NewAuthnRequest())

	// Sign the request
	b64XML, err := packager.CompressedEncodedSignedStringFromKey(r, s.SPPrivateKey())
	if err != nil {
		return "", err
	}

	u, err := url.Parse(s.IDP.SingleSignOnURL)
	if err != nil {
		return "", err
	}

	return BuildRequestURL(s, u, state, b64XML)
}

//ParseAuthnRequest as IDP, parse incoming authentication request
func ParseAuthnRequest(s Settings, b64RequestXML string) (*AuthnRequest, error) {
	var err error
	var bytesXML []byte

	if s.Compress.Request {
		bytesXML, err = packager.DecodeAndInflateString(b64RequestXML)
	} else {
		bytesXML, err = packager.DecodeString(b64RequestXML)
	}

	if err != nil {
		return nil, err
	}

	request := new(AuthnRequest)
	err = xml.Unmarshal(bytesXML, request)
	if err != nil {
		return nil, err
	}

	// There is a bug with XML namespaces in Go that's causing XML attributes with colons to not be roundtrip
	// marshal and unmarshaled so we'll keep the original string around for validation.
	request.originalString = string(bytesXML)
	return request, nil
}

//ParseAuthnResponse as SP, parse incoming authentication response
func ParseAuthnResponse(s Settings, b64ResponseXML string) (*Response, error) {
	var err error
	var bytesXML []byte

	if s.Compress.Response {
		bytesXML, err = packager.DecodeAndInflateString(b64ResponseXML)
	} else {
		bytesXML, err = packager.DecodeString(b64ResponseXML)
	}

	if err != nil {
		return nil, ErrCannotDecode
	}

	response := NewAuthnResponse()
	err = xml.Unmarshal(bytesXML, response)
	if err != nil {
		return nil, err
	}

	// There is a bug with XML namespaces in Go that's causing XML attributes with colons to not be roundtrip
	// marshal and unmarshaled so we'll keep the original string around for validation.
	response.originalString = string(bytesXML)
	return response, nil
}

//GetLogoutRequestURL as SP, generate logout request url to perform slo
func GetLogoutRequestURL(s Settings, state string, nameID string, sessionIndex string) (string, error) {
	r := ApplyLogoutRequest(&s, NewLogoutRequest(), nameID, sessionIndex)

	// Sign the request
	b64XML, err := packager.CompressedEncodedSignedStringFromKey(r, s.SPPrivateKey())
	if err != nil {
		return "", err
	}

	u, err := url.Parse(s.IDP.SingleLogoutURL)
	if err != nil {
		return "", err
	}

	return BuildRequestURL(s, u, state, b64XML)
}

//ParseLogoutRequest as IDP, parse incoming logout request
func ParseLogoutRequest(s Settings, b64RequestXML string) (*LogoutRequest, error) {
	var err error
	var bytesXML []byte

	if s.Compress.Request {
		bytesXML, err = packager.DecodeAndInflateString(b64RequestXML)
	} else {
		bytesXML, err = packager.DecodeString(b64RequestXML)
	}

	if err != nil {
		return nil, err
	}

	request := new(LogoutRequest)
	err = xml.Unmarshal(bytesXML, request)
	if err != nil {
		return nil, err
	}

	// There is a bug with XML namespaces in Go that's causing XML attributes with colons to not be roundtrip
	// marshal and unmarshaled so we'll keep the original string around for validation.
	request.originalString = string(bytesXML)
	return request, nil
}

//ParseLogoutResponse as SP, parse incoming logout response
func ParseLogoutResponse(s Settings, b64ResponseXML string) (*Response, error) {
	var err error
	var bytesXML []byte

	if s.Compress.Response {
		bytesXML, err = packager.DecodeAndInflateString(b64ResponseXML)
	} else {
		bytesXML, err = packager.DecodeString(b64ResponseXML)
	}

	if err != nil {
		return nil, err
	}

	response := NewLogoutResponse()
	err = xml.Unmarshal(bytesXML, response)
	if err != nil {
		return nil, err
	}

	// There is a bug with XML namespaces in Go that's causing XML attributes with colons to not be roundtrip
	// marshal and unmarshaled so we'll keep the original string around for validation.
	response.originalString = string(bytesXML)
	return response, nil
}

//BuildRequestURL build request url with signature
func BuildRequestURL(s Settings, u *url.URL, state string, b64XML string) (string, error) {
	q := u.Query()
	q.Add("SAMLRequest", b64XML)
	q.Add("RelayState", state)

	if s.SP.SignRequest {
		q.Set("SigAlg", "http://www.w3.org/2000/09/xmldsig#rsa-sha1")

		//Build signature string. Digest must be in this order.
		sigstr := "SAMLRequest=" + url.QueryEscape(q.Get("SAMLRequest")) +
			"&RelayState=" + url.QueryEscape(q.Get("RelayState")) +
			"&SigAlg=" + url.QueryEscape(q.Get("SigAlg"))

		sig, err := GetRequestSignature(sigstr, s.SPPrivateKey())
		if err != nil {
			return "", err
		}

		q.Set("Signature", sig)
	}

	u.RawQuery = q.Encode()
	return u.String(), nil
}

//GetRequestSignature for the request url
func GetRequestSignature(data string, key string) (string, error) {
	block, _ := pem.Decode([]byte(key))
	if block == nil {
		return "", ErrPEMFormat
	}

	privKey, err := x509.ParsePKCS1PrivateKey(block.Bytes) //x509.ParseCertificate(block.Bytes)
	if err != nil {
		return "", err
	}

	digest := sha1.Sum([]byte(data))
	sigBytes, err := rsa.SignPKCS1v15(rand.Reader, privKey, crypto.SHA1, digest[:])
	if err != nil {
		return "", err
	}

	return base64.StdEncoding.EncodeToString(sigBytes), nil
}


text:
@InProceedings{chenb14,
  pdf = {http://jmlr.org/proceedings/papers/v32/chenb14.pdf},
  section = {cycle-1},
  title = {Boosting with Online Binary Learners for the Multiclass Bandit Problem},
  author = {Shang-Tse Chen and Hsuan-Tien Lin and Chi-Jen Lu},
  pages = {342-350},
  abstract = {We consider the problem of online multiclass prediction in the bandit setting. Compared with the full-information setting, in which the learner can receive the true label as feedback after making each prediction, the bandit setting assumes that the learner can only know the correctness of the predicted label. Because the bandit setting is more restricted, it is difficult to design good bandit learners and currently there are not many bandit learners. In this paper, we propose an approach that systematically converts existing online binary classifiers to promising bandit learners with strong theoretical guarantee. The approach matches the idea of boosting, which has been shown to be powerful for batch learning as well as online learning. In particular, we establish the weak-learning condition on the online binary classifiers, and show that the condition allows automatically constructing a bandit learner with arbitrary strength by combining several of those classifiers. Experimental results on several real-world data sets demonstrate the effectiveness of the proposed approach.},
}

repository: mreid/papersite

repo_name: mreid/papersite


text:
% Encoding: UTF-8
% Encoding utf-8

@PhdThesis{Paris2020,
  author      = {Paris, Jascha},
  title       = {Steuerungs- und Regelungsstrategien für die haptische Simulation und Synthese von Getrieben},
  type        = {Dissertation},
  date        = {2020},
  doi         = {10.18154/RWTH-2020-03049},
  institution = {RWTH Aachen University},
  location    = {Aachen},
}

@Comment{jabref-meta: databaseType:bibtex;}

@Comment{jabref-meta: fileDirectory-Haschke-wilma:.\\files;}

@Comment{jabref-meta: fileDirectoryLatex-Haschke-wilma:..;}

repository: JaschaParis/LatexVorlageDissertation

repo_name: JaschaParis/LatexVorlageDissertation


text:
require libogg.inc

PR = "${INC_PR}.0"

SRC_URI[md5sum] = "10200ec22543841d9d1c23e0aed4e5e9"
SRC_URI[sha256sum] = "9354c183fd88417c2860778b60b7896c9487d8f6e58b9fec3fdbf971142ce103"


text:
require recipes-graphics/xorg-font/xorg-font-common.inc

SUMMARY = "Adobe Utopia 100 DPI fonts"
HOMEPAGE = "http://cgit.freedesktop.org/xorg/font/adobe-utopia-100dpi/"
SECTION = "x11/font"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=fa13e704b7241f60ef9105cc041b9732"

DEPENDS = "util-macros-native font-util-native bdftopcf-native font-util"
RDEPENDS:${PN} = "encodings font-util"
RDEPENDS:${PN}:class-native = "font-util-native"

UPSTREAM_CHECK_REGEX = "font\-adobe\-utopia\-100dpi\-(?P<pver>\d+(\.\d+)+).tar.gz"

inherit features_check
# depends on bdftopcf-native -> virtual/libx11
REQUIRED_DISTRO_FEATURES = "x11"

SRC_URI[md5sum] = "66fb6de561648a6dce2755621d6aea17"
SRC_URI[sha256sum] = "d16f5e3f227cc6dd07a160a71f443559682dbc35f1c056a5385085aaec4fada5"


text:
SECTION = "devel/chicken"
DESCRIPTION = "Wrapper for the statvfs C function."
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://statvfs.meta;md5=7f23fb268daedc4b4be9e7ddfcc8caf3"
DEPENDS_append_class-cross = " chicken-egg-foreigners-cross"
DEPENDS_append_class-crosssdk = " chicken-egg-foreigners-crosssdk"
DEPENDS_append_class-nativesdk = " nativesdk-chicken-egg-foreigners chicken-egg-foreigners-crosssdk"
DEPENDS = " chicken-egg-foreigners chicken-egg-foreigners-cross"
RDEPENDS_${PN} = " chicken-egg-foreigners"

SRC_URI = "http://code.call-cc.org/egg-tarballs/4/statvfs/statvfs-${PV}.tar.gz"

SRC_URI[md5sum] = "29c89caea99b583ebf7ab13b17d015e3"
SRC_URI[sha256sum] = "44f28482359cabbdbbd1db507353621595dabc54c5285d9588ccdfa92db99a91"

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

inherit chicken_install

BBCLASSEXTEND = "cross crosssdk nativesdk"


text:
package gen

import (
	"bytes"
	"path"
	"path/filepath"

	qtpl "github.com/valyala/quicktemplate"

	"github.com/goconnectx/cdproto-gen/gen/genutil"
	"github.com/goconnectx/cdproto-gen/gen/gotpl"
	"github.com/goconnectx/cdproto-gen/pdl"
)

// GoGenerator generates Go source code for the Chrome DevTools Protocol.
type GoGenerator struct {
	files fileBuffers
}

// NewGoGenerator creates a Go source code generator for the Chrome DevTools
// Protocol domain definitions.
func NewGoGenerator(domains []*pdl.Domain, basePkg string) (Emitter, error) {
	var w *qtpl.Writer

	fb := make(fileBuffers)

	// generate shared types
	fb.generateSharedTypes(domains, basePkg)

	// generate util package
	fb.generateRootPackage(domains, basePkg)

	// generate individual domains
	for _, d := range domains {
		pkgName := genutil.PackageName(d)
		pkgOut := filepath.Join(pkgName, pkgName+".go")

		// do command template
		w = fb.get(pkgOut, pkgName, d, domains, basePkg)
		gotpl.StreamDomainTemplate(w, d, domains)
		fb.release(w)

		// generate domain types
		if len(d.Types) != 0 {
			fb.generateTypes(
				filepath.Join(pkgName, "types.go"),
				d.Types, gotpl.TypePrefix, gotpl.TypeSuffix,
				d, domains,
				basePkg,
			)
		}

		// generate domain event types
		if len(d.Events) != 0 {
			fb.generateTypes(
				filepath.Join(pkgName, "events.go"),
				d.Events, gotpl.EventTypePrefix, gotpl.EventTypeSuffix,
				d, domains,
				basePkg,
			)
		}
	}

	return &GoGenerator{
		files: fb,
	}, nil
}

// Emit returns the generated files.
func (gg *GoGenerator) Emit() map[string]*bytes.Buffer {
	return map[string]*bytes.Buffer(gg.files)
}

// fileBuffers is a type to manage buffers for file data.
type fileBuffers map[string]*bytes.Buffer

// generateSharedTypes generates the common shared types for domains.
//
// Because there are circular package dependencies, some types need to be moved
// to eliminate circular dependencies.
func (fb fileBuffers) generateSharedTypes(domains []*pdl.Domain, basePkg string) {
	// determine shared types
	var typs []*pdl.Type
	for _, d := range domains {
		for _, t := range d.Types {
			if t.IsCircularDep {
				typs = append(typs, t)
			}
		}
	}

	d := &pdl.Domain{
		Domain:      pdl.DomainType("cdp"),
		Types:       typs,
		Description: "Shared Chrome DevTools Protocol Domain types.",
	}

	w := fb.get("cdp/types.go", "cdp", d, domains, basePkg)

	// add executor
	gotpl.StreamExtraExecutorTemplate(w)

	// add types
	for _, t := range typs {
		gotpl.StreamTypeTemplate(
			w, t, gotpl.TypePrefix, gotpl.TypeSuffix,
			d, append(domains, d),
			nil, false, true,
		)
	}

	fb.release(w)
}

// generateRootPackage generates the util package.
//
// Currently only contains the low-level message unmarshaler -- if this wasn't
// in a separate package, then there would be circular dependencies.
func (fb fileBuffers) generateRootPackage(domains []*pdl.Domain, basePkg string) {
	n := path.Base(basePkg)
	d := &pdl.Domain{
		Domain:      pdl.DomainType(n),
		Description: "Chrome DevTools Protocol types.",
	}
	w := fb.get(n+".go", n, d, domains, basePkg)
	for _, t := range rootPackageTypes(domains) {
		gotpl.StreamTypeTemplate(
			w, t, "", "",
			d, domains,
			nil, false, true,
		)
	}
	fb.release(w)
}

// generateTypes generates the types for a domain.
func (fb fileBuffers) generateTypes(
	path string,
	types []*pdl.Type, prefix, suffix string,
	d *pdl.Domain, domains []*pdl.Domain,
	basePkg string,
) {
	w := fb.get(path, genutil.PackageName(d), d, domains, basePkg)

	// process type list
	for _, t := range types {
		if t.IsCircularDep {
			continue
		}
		gotpl.StreamTypeTemplate(
			w, t, prefix, suffix,
			d, domains,
			nil, false, true,
		)
	}

	fb.release(w)
}

// get retrieves the file buffer for s, or creates it if it is not yet available.
func (fb fileBuffers) get(s string, pkgName string, d *pdl.Domain, domains []*pdl.Domain, basePkg string) *qtpl.Writer {
	// check if it already exists
	if b, ok := fb[s]; ok {
		return qtpl.AcquireWriter(b)
	}

	// create buffer
	b := new(bytes.Buffer)
	fb[s] = b
	w := qtpl.AcquireWriter(b)

	v := d
	if b := path.Base(s); b != pkgName+".go" {
		v = nil
	}

	// add package header
	gotpl.StreamFileHeader(w, pkgName, v)

	// add import map
	importMap := map[string]string{
		"encoding/json":                      "",
		basePkg + "/cdp":                     "",
		"github.com/mailru/easyjson":         "",
		"github.com/mailru/easyjson/jlexer":  "",
		"github.com/mailru/easyjson/jwriter": "",
	}
	for _, d := range domains {
		importMap[basePkg+"/"+genutil.PackageName(d)] = ""
	}
	gotpl.StreamFileImportTemplate(w, importMap)

	return w
}

// release releases a template writer.
func (fb fileBuffers) release(w *qtpl.Writer) {
	qtpl.ReleaseWriter(w)
}

// rootPackageTypes returns the root package types.
func rootPackageTypes(domains []*pdl.Domain) []*pdl.Type {
	return []*pdl.Type{{
		Name:             "MethodType",
		Type:             pdl.TypeString,
		Description:      "Chrome DevTools Protocol method type (ie, event and command names).",
		EnumValueNameMap: make(map[string]string),
		Extra:            gotpl.ExtraMethodTypeTemplate(domains),
	}, {
		Name:        "Error",
		Type:        pdl.TypeObject,
		Description: "Error type.",
		Properties: []*pdl.Type{{
			Name:        "code",
			Type:        pdl.TypeInteger,
			Description: "Error code.",
		}, {
			Name:        "message",
			Type:        pdl.TypeString,
			Description: "Error message.",
		}},
		Extra: `// Error satisfies the error interface.
func (e *Error) Error() string {
	return fmt.Sprintf("%s (%d)", e.Message, e.Code)
}`,
	}, {
		Name:        "Message",
		Type:        pdl.TypeObject,
		Description: "Chrome DevTools Protocol message sent/read over websocket connection.",
		Properties: []*pdl.Type{{
			Name:        "id",
			Type:        pdl.TypeInteger,
			Description: "Unique message identifier.",
			Optional:    true,
		}, {
			Name:        "sessionId",
			Ref:         "Target.SessionID",
			Description: "Session that the message belongs to when using flat access.",
			Optional:    true,
		}, {
			Name:        "method",
			Ref:         "MethodType",
			Description: "Event or command type.",
			Optional:    true,
			NoResolve:   true,
		}, {
			Name:        "params",
			Type:        pdl.TypeAny,
			Description: "Event or command parameters.",
			Optional:    true,
		}, {
			Name:        "result",
			Type:        pdl.TypeAny,
			Description: "Command return values.",
			Optional:    true,
		}, {
			Name:        "error",
			Ref:         "*Error",
			Description: "Error message.",
			Optional:    true,
			NoResolve:   true,
		}},
		Extra: gotpl.ExtraMessageTemplate(domains),
	}}
}

repository: goconnectx/pdlgen

repo_name: goconnectx/pdlgen


text:
@thesis{Byles,
title={Fire and its consequences in the City of Rome in antiquity, 390 BC – AD 410},
author={Richard Byles},
year={2013},
university={Swansea University},
degree={Master of Philosophy},
url={https://cronfa.swan.ac.uk/Record/cronfa42629},
}

@book{Quintiere,
title={Principles of Fire Behavior, 2nd Edition},
author={James G. Quintiere},
year={2017},
month={09},
publisher={CRC Press},
isbn={ISBN-10: 1498735649},
}

@book{IcoveHaynes,
title={Kirk's Fire Investigation, 8th Edition},
author={David Icove and Gerald Haynes},
year={2017},
month={10},
publisher={Pearson},
url={https://www.researchgate.net/publication/320707890_Kirk's_Fire_Investigation_8th_Edition},
isbn={ISBN-13: 978-0134237923},
}

@article{Macchionietal,
author={Macchioni, N. and Pizzo, B. and Capretti, C. and Pecoraro, E. and Sozzi, L. and Lazzeri, S.},
title={New Wooden Archaeological Finds from Herculaneum: The State of Preservation and Hypothesis of Consolidation of the Material from the House of the Relief of Telephus},
journal={Archaeometry},
volume={58},
number={6},
pages={1024-1037},
keywords={waterlogged archaeological wood, chemical characterization, physical characterization, roman roof, ft–ir},
doi={10.1111/arcm.12213},
url={https://onlinelibrary.wiley.com/doi/abs/10.1111/arcm.12213},
eprint={https://onlinelibrary.wiley.com/doi/pdf/10.1111/arcm.12213},
}

repository: mqAncientHistory/cityOfRome

repo_name: mqAncientHistory/cityOfRome

gha_language: HTML


text:
package main

import (
	"fmt"
	"io"
	"net/http"
	"os/exec"
	"sort"
	"strings"

	"github.com/weaveworks/scope/render"
	"github.com/weaveworks/scope/report"
)

func handleTXT(r Reporter) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		w.Header().Set("Content-Type", "text/plain")

		renderer := render.LeafMap{Selector: report.SelectEndpoint, Mapper: mapFunc(req), Pseudo: nil}
		dot(w, renderer.Render(r.Report()))

		//report.Render(r.Report(), report.SelectEndpoint, mapFunc(req), report.NoPseudoNode))
	}
}

func handleSVG(r Reporter) http.HandlerFunc {
	return func(w http.ResponseWriter, req *http.Request) {
		cmd := exec.Command(engine(req), "-Tsvg")

		wc, err := cmd.StdinPipe()
		if err != nil {
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		}

		cmd.Stdout = w

		renderer := render.LeafMap{Selector: report.SelectEndpoint, Mapper: mapFunc(req), Pseudo: nil}
		dot(wc, renderer.Render(r.Report()))
		wc.Close()

		w.Header().Set("Content-Type", "image/svg+xml")
		if err := cmd.Run(); err != nil {
			http.Error(w, err.Error(), http.StatusInternalServerError)
			return
		}
	}
}

func handleHTML(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "text/html")
	fmt.Fprintf(w, "\n")
	fmt.Fprintf(w, `<meta http-equiv="refresh" content="3">`+"\n")
	fmt.Fprintf(w, "\n")
	fmt.Fprintf(w, `<center><img src="/svg?%s" width="100%%" height="95%%"></center>`+"\n", r.URL.Query().Encode())
	fmt.Fprintf(w, "\n")
}

func dot(w io.Writer, m map[string]render.RenderableNode) {
	fmt.Fprintf(w, "digraph G {\n")
	fmt.Fprintf(w, "\tgraph [ overlap=false ];\n")
	fmt.Fprintf(w, "\tnode [ shape=circle, style=filled ];\n")
	fmt.Fprintf(w, "\toutputorder=edgesfirst;\n")
	fmt.Fprintf(w, "\n")

	// Sorting the nodes seems to stop jumpiness.
	nodes := make(sort.StringSlice, 0, len(m))
	for _, node := range m {
		nodes = append(nodes, fmt.Sprintf("\t\"%s\" [label=\"%s\n%s\"];\n", node.ID, node.LabelMajor, node.LabelMinor))
	}
	sort.Sort(nodes)
	for _, s := range nodes {
		fmt.Fprint(w, s)
	}
	fmt.Fprintf(w, "\n")

	// Add ranking information by default.
	// Non-dot engines don't seem to be harmed by it.
	same := map[string][]string{}
	for _, node := range m {
		k, v := node.LabelMajor, fmt.Sprintf(`"%s"`, node.ID)
		same[k] = append(same[k], v)
	}
	for _, ids := range same {
		fmt.Fprintf(w, "\t{ rank=same; %s }\n", strings.Join(ids, " "))
	}
	fmt.Fprintf(w, "\n")

	for _, src := range m {
		for _, dstID := range src.Adjacency {
			fmt.Fprintf(w, "\t\"%s\" -> \"%s\";\n", src.ID, dstID)
		}
	}
	fmt.Fprintf(w, "}\n")
}

func engine(r *http.Request) string {
	engine := r.FormValue("engine")
	if engine == "" {
		engine = "dot"
	}
	return engine
}

func mapFunc(r *http.Request) render.LeafMapFunc {
	switch strings.ToLower(r.FormValue("map_func")) {
	case "hosts", "networkhost", "networkhostname":
		return render.MapAddressIdentity
	}
	return render.MapProcessIdentity
}

func classView(r *http.Request) bool {
	return r.FormValue("class_view") == "true"
}

repository: tomwilkie/scope

repo_name: tomwilkie/scope


text:
// Copyright (c) 2018 The MATRIX Authors
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php
package reward

import (
	"math/big"

	"github.com/MatrixAINetwork/go-matrix/common"
	"github.com/MatrixAINetwork/go-matrix/reward/cfg"
)

type Reward interface {
	CalcNodesRewards(blockReward *big.Int, Leader common.Address, num uint64, parentHash common.Hash, coinType string) map[common.Address]*big.Int
	CalcValidatorRewards(Leader common.Address, num uint64) map[common.Address]*big.Int
	CalcMinerRewards(num uint64, parentHash common.Hash) map[common.Address]*big.Int
	CalcMinerRateMount(blockReward *big.Int) (*big.Int, *big.Int, *big.Int)
	CalcValidatorRateMount(blockReward *big.Int) (*big.Int, *big.Int, *big.Int)
	GetRewardCfg() *cfg.RewardCfg
}

repository: chainopen/MatrixChainCode

repo_name: chainopen/MatrixChainCode


text:
SUMMARY = "Extra features for standard library's cmd module"
DESCRIPTION = "cmd2 is a tool for building interactive command line \
applications in Python. Its goal is to make it quick and easy for developers \
to build feature-rich and user-friendly interactive command line applications. \
It provides a simple API which is an extension of Python's built-in cmd module.\
 cmd2 provides a wealth of features on top of cmd to make your life easier and \
eliminates much of the boilerplate code which would be necessary when using cmd."
HOMEPAGE = "http://packages.python.org/cmd2/"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=60bc6842001870a418935bd84570b676"

SRC_URI[md5sum] = "878976772c305486dfbca3aff4b4e779"
SRC_URI[sha256sum] = "145cb677ebd0e3cae546ab81c30f6c25e0b08ba0f1071df854d53707ea792633"

DEPENDS += "${PYTHON_PN}-setuptools-scm-native"

inherit pypi setuptools

RDEPENDS:${PN} += "\
    ${PYTHON_PN}-argparse \
    ${PYTHON_PN}-doctest \
    ${PYTHON_PN}-pyparsing \
    ${PYTHON_PN}-pyperclip \
    ${PYTHON_PN}-shell \
    ${PYTHON_PN}-six \
    ${PYTHON_PN}-stringold \
    ${PYTHON_PN}-subprocess \
    ${PYTHON_PN}-threading \
    ${PYTHON_PN}-textutils \
    "

BBCLASSEXTEND = "native nativesdk"

SKIP_RECIPE[python-cmd2] ?= "${@bb.utils.contains('I_SWEAR_TO_MIGRATE_TO_PYTHON3', 'yes', '', 'python2 is out of support for long time, read https://www.python.org/doc/sunset-python-2/ https://python3statement.org/ and if you really have to temporarily use this, then set I_SWEAR_TO_MIGRATE_TO_PYTHON3 to "yes"', d)}"

branch_name: refs/heads/jansa/master


text:
@Article{Shannon1946,
  title =	 {{A mathematical theory of communication}},
  author =	 {Shannon, C.E.},
  journal =	 {ACM SIGMOBILE Mobile Computing and Communications
                  Review},
  volume =	 5,
  number =	 1,
  pages =	 {3--55},
  issn =	 {1559-1662},
  year =	 1946,
  publisher =	 {ACM}
}

@article{Dolev1983,
  title={{On the security of public key protocols}},
  author={Dolev, D. and Yao, A.},
  journal={Information Theory, IEEE Transactions on},
  volume={29},
  number={2},
  pages={198--208},
  issn={0018-9448},
  year={1983},
  publisher={IEEE}
}

@article{Shamir1979,
  title={{How to share a secret}},
  author={Shamir, A.},
  journal={Communications of the ACM},
  volume={22},
  number={11},
  pages={612--613},
  issn={0001-0782},
  year={1979},
  publisher={ACM}
}

@article{Needham1978,
  title={{Using encryption for authentication in large networks of computers}},
  author={Needham, R.M. and Schroeder, M.D.},
  journal={Communications of the ACM},
  volume={21},
  number={12},
  pages={993--999},
  issn={0001-0782},
  year={1978},
  publisher={ACM}
}

@article{Rivest1978,
  title={{A method for obtaining digital signatures and public-key cryptosystems}},
  author={Rivest, R.L. and Shamir, A. and Adleman, L.},
  journal={Communications of the ACM},
  volume={21},
  number={2},
  pages={120--126},
  issn={0001-0782},
  year={1978},
  publisher={ACM}
}

@article{Merkle1978,
  title={{Secure communications over insecure channels}},
  author={Merkle, R.C.},
  journal={Communications of the ACM},
  volume={21},
  number={4},
  pages={294--299},
  issn={0001-0782},
  year={1978},
  publisher={ACM}
}

@article{Diffie1976,
  title={{New directions in cryptography}},
  author={Diffie, W. and Hellman, M.},
  journal={Information Theory, IEEE Transactions on},
  volume={22},
  number={6},
  pages={644--654},
  issn={0018-9448},
  year={1976},
  publisher={IEEE}
}

@book{Shannon1949,
  title={{Communication theory of secrecy systems}},
  author={Shannon, C.E.},
  year={1949},
  publisher={AT \& T}
}

@article{Ziv1977,
  title={{A universal algorithm for sequential data compression}},
  author={Ziv, J. and Lempel, A.},
  journal={Information Theory, IEEE Transactions on},
  volume={23},
  number={3},
  pages={337--343},
  issn={0018-9448},
  year={1977},
  publisher={IEEE}
}
@article{Huffman1952,
  title={{A method for the construction of minimum-redundancy codes}},
  author={Huffman, D.A.},
  journal={Proceedings of the IRE},
  volume={40},
  number={9},
  pages={1098--1101},
  issn={0096-8390},
  year={1952},
  publisher={IEEE}
}
@article{Hamming1950,
  title={{Error detecting and error correcting codes}},
  author={Hamming, R.W.},
  journal={Bell System Technical Journal},
  volume={29},
  number={2},
  pages={147--160},
  year={1950}
}

repository: jfdm/sta-latex

repo_name: jfdm/sta-latex


text:
DESCRIPTION = "Microchip libplanes library for sama5 lcd controller"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;endline=20;md5=b884a464579c410fd1dace93db8e97b3"

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

DEPENDS = "libdrm cairo cjson lua swig-native python3"

RDEPENDS:${PN} = "python3 udev-rules-at91"

SRC_URI = "git://github.com/linux4sam/libplanes.git;protocol=https;branch=master \
           file://0001-Use-python3-by-default.patch \
          "

PV = "1.0.3+git${SRCPV}"
SRCREV = "d897de598d1acddc7d54aa656c518f763a54177d"

S = "${WORKDIR}/git"

inherit pkgconfig autotools python3-dir

EXTRA_OECONF += "--enable-shared --disable-static"

PACKAGECONFIG ??= "examples"
PACKAGECONFIG[examples] = "--enable-examples,--disable-examples"

do_configure:prepend() {
	( cd ${S};
	${S}/autogen.sh; cd -)
}

INSANE_SKIP:${PN} = "dev-so"

FILES:${PN} += " \
  /opt/planes/planes-loop.sh \
  /opt/planes/planes-loop.py \
  /opt/applications/resources/* \
  ${libdir}/* \
  ${includedir}/* \
  ${bindir}/* \
  ${datadir}/planes/* \
"
FILES:${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"

#need to delete _planes.a to avoid QA package errors
do_install:append() {
    install -Dm 0644 ${S}/scripts/planes.png  ${D}/opt/applications/resources/planes.png
    install -Dm 0644 ${S}/scripts/09-planes.xml  ${D}/opt/applications/resources/09-planes.xml
    install -Dm 0755 ${S}/scripts/planes-loop.sh ${D}/opt/planes/planes-loop.sh
    install -Dm 0755 ${S}/scripts/planes-loop.py ${D}/opt/planes/planes-loop.py
    install -Dm 0755 ${S}/python/examples/splash.py ${D}${datadir}/planes/splash.py
    install -Dm 0755 ${S}/python/examples/example.py ${D}${datadir}/planes/example.py
    rm -f ${D}/usr/lib/python*/site-packages/planes/_planes.a
    rm -f ${D}/usr/lib/libplanes.a
}

branch_name: refs/heads/kirkstone


text:
package get

import (
	"fmt"
	"github.com/jjzcru/hog/pkg/hog"
	"github.com/jjzcru/hog/pkg/utils"
	"github.com/spf13/cobra"
	"os"
)

// Command returns a cobra command for `get` sub command
func Command() *cobra.Command {
	cmd := &cobra.Command{
		Use:   "get",
		Short: "Get hog configuration values",
		Run: func(cmd *cobra.Command, args []string) {
			if len(args) == 0 {
				_ = cmd.Help()
				os.Exit(0)
			}
		},
	}

	cmd.AddCommand(
		protocol(),
		domain(),
		port(),
	)

	return cmd
}

func protocol() *cobra.Command {
	return &cobra.Command{
		Use:   "protocol",
		Short: "Get protocol value",
		Args:  cobra.NoArgs,
		Run: func(cmd *cobra.Command, args []string) {
			h, err := hog.Get()
			if err != nil {
				utils.PrintError(err)
				return
			}
			fmt.Println(h.Protocol)
		},
	}
}

func domain() *cobra.Command {
	return &cobra.Command{
		Use:   "domain",
		Short: "Get domain value",
		Args:  cobra.NoArgs,
		Run: func(cmd *cobra.Command, args []string) {
			h, err := hog.Get()
			if err != nil {
				utils.PrintError(err)
				return
			}
			fmt.Println(h.Domain)
		},
	}
}

func port() *cobra.Command {
	return &cobra.Command{
		Use:   "port",
		Short: "Get port value",
		Args:  cobra.NoArgs,
		Run: func(cmd *cobra.Command, args []string) {
			h, err := hog.Get()
			if err != nil {
				utils.PrintError(err)
				return
			}
			fmt.Println(h.Port)
		},
	}
}

repository: jjzcru/hog

repo_name: jjzcru/hog


text:
// Copyright 2022 The LUCI 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 protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.28.1
// 	protoc        v3.21.7
// source: go.chromium.org/luci/bisection/task/proto/task.proto

package proto

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// Payload of the FailedBuildIngestionTask task.
type FailedBuildIngestionTask struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// The bbid of the failed build.
	Bbid int64 `protobuf:"varint,1,opt,name=bbid,proto3" json:"bbid,omitempty"`
}

func (x *FailedBuildIngestionTask) Reset() {
	*x = FailedBuildIngestionTask{}
	if protoimpl.UnsafeEnabled {
		mi := &file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[0]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *FailedBuildIngestionTask) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*FailedBuildIngestionTask) ProtoMessage() {}

func (x *FailedBuildIngestionTask) ProtoReflect() protoreflect.Message {
	mi := &file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[0]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use FailedBuildIngestionTask.ProtoReflect.Descriptor instead.
func (*FailedBuildIngestionTask) Descriptor() ([]byte, []int) {
	return file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescGZIP(), []int{0}
}

func (x *FailedBuildIngestionTask) GetBbid() int64 {
	if x != nil {
		return x.Bbid
	}
	return 0
}

// Payload of the RevertCulpritTask
type RevertCulpritTask struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// The ID of the CompileFailureAnalysis associated with the culprit
	AnalysisId int64 `protobuf:"varint,1,opt,name=analysis_id,json=analysisId,proto3" json:"analysis_id,omitempty"`
	// The ID of the Suspect which is the culprit
	CulpritId int64 `protobuf:"varint,2,opt,name=culprit_id,json=culpritId,proto3" json:"culprit_id,omitempty"`
}

func (x *RevertCulpritTask) Reset() {
	*x = RevertCulpritTask{}
	if protoimpl.UnsafeEnabled {
		mi := &file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[1]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *RevertCulpritTask) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*RevertCulpritTask) ProtoMessage() {}

func (x *RevertCulpritTask) ProtoReflect() protoreflect.Message {
	mi := &file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[1]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use RevertCulpritTask.ProtoReflect.Descriptor instead.
func (*RevertCulpritTask) Descriptor() ([]byte, []int) {
	return file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescGZIP(), []int{1}
}

func (x *RevertCulpritTask) GetAnalysisId() int64 {
	if x != nil {
		return x.AnalysisId
	}
	return 0
}

func (x *RevertCulpritTask) GetCulpritId() int64 {
	if x != nil {
		return x.CulpritId
	}
	return 0
}

// Payload of the CancelAnalysis
type CancelAnalysisTask struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// The analysis ID that we need to cancel.
	AnalysisId int64 `protobuf:"varint,1,opt,name=analysis_id,json=analysisId,proto3" json:"analysis_id,omitempty"`
}

func (x *CancelAnalysisTask) Reset() {
	*x = CancelAnalysisTask{}
	if protoimpl.UnsafeEnabled {
		mi := &file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[2]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *CancelAnalysisTask) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*CancelAnalysisTask) ProtoMessage() {}

func (x *CancelAnalysisTask) ProtoReflect() protoreflect.Message {
	mi := &file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[2]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use CancelAnalysisTask.ProtoReflect.Descriptor instead.
func (*CancelAnalysisTask) Descriptor() ([]byte, []int) {
	return file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescGZIP(), []int{2}
}

func (x *CancelAnalysisTask) GetAnalysisId() int64 {
	if x != nil {
		return x.AnalysisId
	}
	return 0
}

// Payload for Culprit Verification
type CulpritVerificationTask struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// The analysis ID
	AnalysisId int64 `protobuf:"varint,1,opt,name=analysis_id,json=analysisId,proto3" json:"analysis_id,omitempty"`
	// The ID of the suspect for culprit verification
	SuspectId int64 `protobuf:"varint,2,opt,name=suspect_id,json=suspectId,proto3" json:"suspect_id,omitempty"`
	// The encoded datastore key of suspect parent
	ParentKey string `protobuf:"bytes,3,opt,name=parent_key,json=parentKey,proto3" json:"parent_key,omitempty"`
}

func (x *CulpritVerificationTask) Reset() {
	*x = CulpritVerificationTask{}
	if protoimpl.UnsafeEnabled {
		mi := &file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[3]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *CulpritVerificationTask) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*CulpritVerificationTask) ProtoMessage() {}

func (x *CulpritVerificationTask) ProtoReflect() protoreflect.Message {
	mi := &file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[3]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use CulpritVerificationTask.ProtoReflect.Descriptor instead.
func (*CulpritVerificationTask) Descriptor() ([]byte, []int) {
	return file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescGZIP(), []int{3}
}

func (x *CulpritVerificationTask) GetAnalysisId() int64 {
	if x != nil {
		return x.AnalysisId
	}
	return 0
}

func (x *CulpritVerificationTask) GetSuspectId() int64 {
	if x != nil {
		return x.SuspectId
	}
	return 0
}

func (x *CulpritVerificationTask) GetParentKey() string {
	if x != nil {
		return x.ParentKey
	}
	return ""
}

var File_go_chromium_org_luci_bisection_task_proto_task_proto protoreflect.FileDescriptor

var file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDesc = []byte{
	0x0a, 0x34, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72,
	0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x62, 0x69, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e,
	0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x74, 0x61, 0x73, 0x6b,
	0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2e, 0x0a,
	0x18, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x67, 0x65,
	0x73, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x62, 0x69,
	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x62, 0x62, 0x69, 0x64, 0x22, 0x53, 0x0a,
	0x11, 0x52, 0x65, 0x76, 0x65, 0x72, 0x74, 0x43, 0x75, 0x6c, 0x70, 0x72, 0x69, 0x74, 0x54, 0x61,
	0x73, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x5f, 0x69,
	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69,
	0x73, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x75, 0x6c, 0x70, 0x72, 0x69, 0x74, 0x5f, 0x69,
	0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x75, 0x6c, 0x70, 0x72, 0x69, 0x74,
	0x49, 0x64, 0x22, 0x35, 0x0a, 0x12, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x41, 0x6e, 0x61, 0x6c,
	0x79, 0x73, 0x69, 0x73, 0x54, 0x61, 0x73, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6e, 0x61, 0x6c,
	0x79, 0x73, 0x69, 0x73, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61,
	0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73, 0x49, 0x64, 0x22, 0x78, 0x0a, 0x17, 0x43, 0x75, 0x6c,
	0x70, 0x72, 0x69, 0x74, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
	0x54, 0x61, 0x73, 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6e, 0x61, 0x6c, 0x79, 0x73, 0x69, 0x73,
	0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x61, 0x6e, 0x61, 0x6c, 0x79,
	0x73, 0x69, 0x73, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x75, 0x73, 0x70, 0x65, 0x63, 0x74,
	0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x73, 0x75, 0x73, 0x70, 0x65,
	0x63, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6b,
	0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
	0x4b, 0x65, 0x79, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69,
	0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x62, 0x69, 0x73, 0x65,
	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x74, 0x61, 0x73, 0x6b, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
	0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
	file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescOnce sync.Once
	file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescData = file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDesc
)

func file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescGZIP() []byte {
	file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescOnce.Do(func() {
		file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescData)
	})
	return file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDescData
}

var file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_go_chromium_org_luci_bisection_task_proto_task_proto_goTypes = []interface{}{
	(*FailedBuildIngestionTask)(nil), // 0: proto.FailedBuildIngestionTask
	(*RevertCulpritTask)(nil),        // 1: proto.RevertCulpritTask
	(*CancelAnalysisTask)(nil),       // 2: proto.CancelAnalysisTask
	(*CulpritVerificationTask)(nil),  // 3: proto.CulpritVerificationTask
}
var file_go_chromium_org_luci_bisection_task_proto_task_proto_depIdxs = []int32{
	0, // [0:0] is the sub-list for method output_type
	0, // [0:0] is the sub-list for method input_type
	0, // [0:0] is the sub-list for extension type_name
	0, // [0:0] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() { file_go_chromium_org_luci_bisection_task_proto_task_proto_init() }
func file_go_chromium_org_luci_bisection_task_proto_task_proto_init() {
	if File_go_chromium_org_luci_bisection_task_proto_task_proto != nil {
		return
	}
	if !protoimpl.UnsafeEnabled {
		file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*FailedBuildIngestionTask); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*RevertCulpritTask); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*CancelAnalysisTask); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
		file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*CulpritVerificationTask); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_go_chromium_org_luci_bisection_task_proto_task_proto_goTypes,
		DependencyIndexes: file_go_chromium_org_luci_bisection_task_proto_task_proto_depIdxs,
		MessageInfos:      file_go_chromium_org_luci_bisection_task_proto_task_proto_msgTypes,
	}.Build()
	File_go_chromium_org_luci_bisection_task_proto_task_proto = out.File
	file_go_chromium_org_luci_bisection_task_proto_task_proto_rawDesc = nil
	file_go_chromium_org_luci_bisection_task_proto_task_proto_goTypes = nil
	file_go_chromium_org_luci_bisection_task_proto_task_proto_depIdxs = nil
}

repository: luci/luci-go

repo_name: luci/luci-go

branch_name: refs/heads/main


text:
// This is not really clean but anyway, just to keep it going
package main

import (
	"go.amplifyedge.org/sys-share-v2/sys-core/service/logging"
	"go.amplifyedge.org/sys-share-v2/sys-core/service/logging/zaplog"
	"time"

	"github.com/spf13/cobra"

	// gcn packages
	// modpkg "go.amplifyedge.org/mod-v2/main/pkg"
)

const (
	// TODO @gutterbacon: JSONNET config for mod-*
	defaultPort      = 9074
	defaultSysPort   = 9075
	defaultTimeout   = 5 * time.Second
	defaultSysHost   = "127.0.0.1"
	defaultLocal     = true
	defaultStaticDir = "./client/build/web"

	errConnectingMainSys = "error while trying to connect to mainsys: %v"
	errCreateSysService  = "error while creating mainmodv3 service: %v"
	errRunningMainMod    = "error running mainmodv3: %v"
)

var (
	rootCmd   = &cobra.Command{Use: "mainmod"}
	port      int
	sysPort   int
	sysHost   string
	local     bool
	staticDir string
)

func recoveryHandler(l logging.Logger) func(panic interface{}) error {
	return func(panic interface{}) error {
		l.Warnf("sys-account service recovered, reason: %v",
			panic)
		return nil
	}
}

func main() {
	rootCmd.PersistentFlags().IntVarP(&port, "port", "p", defaultPort, "the port to serve on")
	rootCmd.PersistentFlags().IntVarP(&sysPort, "mainsys-port", "s", defaultSysPort, "TCP port of running mainsys process")
	rootCmd.PersistentFlags().StringVarP(&sysHost, "mainsys-host", "m", defaultSysHost, "Host IP of running mainsys process")
	rootCmd.PersistentFlags().BoolVarP(&local, "local", "l", defaultLocal, "serve locally")
	rootCmd.PersistentFlags().StringVarP(&staticDir, "directory", "d", defaultStaticDir, "directory to serve flutter build")

	l := zaplog.NewZapLogger(zaplog.DEBUG, "mainmod", true, "")
	l.InitLogger(map[string]interface{}{"version": "3"})

	rootCmd.RunE = func(cmd *cobra.Command, args []string) error {
		// ctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)
		// defer cancel()
		//
		// dialConn, err := grpc.DialContext(ctx, fmt.Sprintf("%s:%d", sysHost, sysPort), grpc.WithInsecure())
		// if err != nil {
		// 	l.Fatalf(errConnectingMainSys, err)
		// }

		// modsvc, err := modpkg.NewModService(l, port, nil, nil, dialConn, nil)
		// if err != nil {
		// 	l.Fatalf(errCreateSysService, err)
		// }

		// unaryItc, streamItc := modsvc.InjectInterceptors(nil, nil)
		// recoveryOptions := []grpcRecovery.Option{
		// 	grpcRecovery.WithRecoveryHandler(recoveryHandler(l)),
		// }
		// logrusOpts := []grpcLogrus.Option{
		// 	grpcLogrus.WithLevels(grpcLogrus.DefaultCodeToLevel),
		// }
		// unaryItc = append(unaryItc, grpcRecovery.UnaryServerInterceptor(recoveryOptions...), grpcLogrus.UnaryServerInterceptor(l, logrusOpts...))
		// streamItc = append(streamItc, grpcRecovery.StreamServerInterceptor(recoveryOptions...), grpcLogrus.StreamServerInterceptor(l, logrusOpts...))

		// grpc
		// grpcServer := grpc.NewServer(
		// 	grpcMw.WithUnaryServerChain(unaryItc...),
		// 	grpcMw.WithStreamServerChain(streamItc...),
		// )
		// register service
		// modsvc.RegisterServices(grpcServer)
		// grpcWebServer := modsvc.RegisterGrpcWebServer(grpcServer)
		// if local {
		// 	fileServer := http.FileServer(http.Dir(staticDir))
		// 	httpServer := &http.Server{
		// 		Handler: h2c.NewHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		// 			w.Header().Set("Access-Control-Allow-Origin", "*")
		// 			w.Header().Set("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE")
		// 			w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, X-User-Agent, X-Grpc-Web")
		// 			l.Infof("Request Endpoint: %s", r.URL)
		// 			if strings.Contains(r.URL.Path, "v2") {
		// 				// grpcWebServer.ServeHTTP(w, r)
		// 			} else {
		// 				fileServer.ServeHTTP(w, r)
		// 			}
		// 		}), &http2.Server{}),
		// 	}
		// 	// modsvc.Run(grpcWebServer, httpServer)
		// } else {
		// 	// modsvc.Run(grpcWebServer, nil)
		// }
		return nil
	}
	if err := rootCmd.Execute(); err != nil {
		l.Fatalf(errRunningMainMod, err)
	}

}

repository: alexadhy/main

repo_name: alexadhy/main


text:
// Package cos provides common low-level types and utilities for all aistore projects
/*
 * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
 */
package cos

import (
	cryptorand "crypto/rand"
	"encoding/binary"
	"math/rand"

	"github.com/NVIDIA/aistore/cmn/mono"
)

const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

type cryptoRandSource struct{}

var strongRandSource rand.Source = &cryptoRandSource{}

func (*cryptoRandSource) Int63() int64 {
	var buf [8]byte
	// crypto/rand uses syscalls or reads from /dev/random (or /dev/urandom) to get random bytes.
	// See https://golang.org/pkg/crypto/rand/#pkg-variables for more.
	_, err := cryptorand.Read(buf[:])
	AssertNoErr(err)
	return int64(binary.LittleEndian.Uint64(buf[:]))
}
func (*cryptoRandSource) Seed(int64) {}

func RandString(n int) string {
	b := make([]byte, n)
	for i := range b {
		b[i] = letterRunes[rand.Int63()%int64(len(letterRunes))]
	}
	return string(b)
}

func RandStringWithSrc(src rand.Source, n int) string {
	const (
		letterIdxBits = 6                    // 6 bits to represent a letter index
		letterIdxMask = 1<<letterIdxBits - 1 // All 1-bits, as many as letterIdxBits
		letterIdxMax  = 63 / letterIdxBits   // # of letter indices fitting in 63 bits
	)

	b := make([]byte, n)
	// A src.Int63() generates 63 random bits, enough for letterIdxMax characters!
	for i, cache, remain := n-1, src.Int63(), letterIdxMax; i >= 0; {
		if remain == 0 {
			cache, remain = src.Int63(), letterIdxMax
		}
		if idx := int(cache & letterIdxMask); idx < len(letterRunes) {
			b[i] = letterRunes[idx]
			i--
		}
		cache >>= letterIdxBits
		remain--
	}

	return string(b)
}

func RandStringStrong(n int) string {
	return RandStringWithSrc(strongRandSource, n)
}

func NowRand() *rand.Rand {
	return rand.New(rand.NewSource(mono.NanoTime()))
}

func GenDaemonID() string {
	return RandStringStrong(8)
}

repository: ryan-beisner/aistore

repo_name: ryan-beisner/aistore


text:
DESCRIPTION = "This project is a try to write real tiny and fast XMPP/Jabber \
    client for handheld devices, supported by Enlightment Foundation Library.\
    It use Elementary widget toolkit and Iksemel library to make it possible."
LICENSE = "GPL"
DEPENDS = "edje-native elementary iksemel gnutls eet evas ecore eina"
HOMEPAGE = "http://jefliks.sourceforge.net/"
AUTHOR = "Phoenix Kayo <kayo.k11.4@gmail.com>"
PV = "0.0.2b+gitr${SRCPV}"
PR = "r6"

inherit autotools pkgconfig

SRCREV = "c4d035f4696bf8a233a54c74dd148173fdef43c2"

SRC_URI = "git://jefliks.git.sourceforge.net/gitroot/jefliks/jefliks;protocol=git;branch=master \
           file://depends.eina.patch"
S = "${WORKDIR}/git"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty


text:
#
# Google Sanitizers (https://github.com/google/sanitizers)
# --------------------------------------------------------------------------------------------------
#
# Dynamic testing tools for C/C++:
# - AddressSanitizer (ASan) is a fast memory error detector. It finds use-after-free
#   and {heap,stack,global}-buffer overflow bugs in C/C++ programs.
# - MemorySanitizer (MSan) is a fast LLVM-based tool that detects the use of uninitialized memory.
# - ThreadSanitizer (TSan) is a fast data race detector for C/C++ programs.
# These tools are based on compiler instrumentation (LLVM and GCC), which makes them very fast,
# for example ASan incurs just 2x slowdown.
#
# GCC options - https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html
#

if (WIN32)
    message(WARNING "Please note, there is no Windows support for Google Sanitizers")
    return()
endif ()

if (ENABLE_ASAN)
    # Generates debug information to be used by GDB debugger, -g - default debug information.
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
    # Sets the compiler's optimization level, -O1 - optimization for code size and execution time.
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1")
    # Specifies the gold linker, https://en.wikipedia.org/wiki/Gold_(linker).
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
    # Instructs the compiler to store the stack frame pointer in a register. If you specify
    # -fno-omit-frame-pointer, then any function which uses space on the stack creates
    # a frame record, and changes the frame pointer to point to it.
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer")
    # Enables AddressSanitizer, a fast memory error detector. Memory access instructions are
    # instrumented to detect out-of-bounds and use-after-free bugs.
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
    # Enables LeakSanitizer, a memory leak detector. This option only matters for linking
    # of executables and the executable is linked against a library that overrides malloc
    # and other allocator functions.
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=leak")
endif ()

if (ENABLE_MSAN)
    # Specifies the gold linker, https://en.wikipedia.org/wiki/Gold_(linker).
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
    # Enables UndefinedBehaviorSanitizer, a fast undefined behavior detector. Various computations
    # are instrumented to detect undefined behavior at runtime.
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
endif ()

if (ENABLE_TSAN)
    # Specifies the gold linker, https://en.wikipedia.org/wiki/Gold_(linker).
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
    # Enables ThreadSanitizer, a fast data race detector. Memory access instructions are
    # instrumented to detect data race bugs.
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
endif ()

repository: SlavaMelanko/GoogleSanitizerTest

repo_name: SlavaMelanko/GoogleSanitizerTest

extension: cmake


text:
package gruutbot

type Plugin interface {
	Register(manager *PluginManager)
	GetName() string
	GetDescription() string
	GetVersion() string
}

repository: gruutbot/gruutbot

repo_name: gruutbot/gruutbot


text:
@inproceedings{Kent2014a,
 address = {Loughborough, UK},
 author = {Kent, Thomas E. and Richards, Arthur G.},
 booktitle = {2014 UKACC International Conference on Control (CONTROL)},
 doi = {10.1109/CONTROL.2014.6915123},
 file = {:home/aetek/Documents/Mendeley Papers/Kent, Richards - 2014 - Accounting for the effect of ground delay on commercial formation flight - 2014 UKACC International Conferenc(2).pdf:pdf},
 isbn = {978-1-4799-5011-9},
 keywords = {Delay,Dynamic Programming,Formation Flight,Routing,Value Iteration},
 number = {July},
 pages = {104--109},
 title = {Accounting for the effect of ground delay on commercial formation flight},
 url = {http://ieeexplore.ieee.org/lpdocs/epic03/wrapper.htm?arnumber=6915123},
 year = {2014}
}

repository: tomekent/portfolio

repo_name: tomekent/portfolio


text:
DESCRIPTION = "PetaLinux Matchbox related Packages"
LICENSE = "NONE"

inherit packagegroup distro_features_check

REQUIRED_DISTRO_FEATURES = "x11"

MATCHBOX_PACKAGES = " \
       matchbox-config-gtk \
       matchbox-desktop \
       matchbox-keyboard \
       matchbox-keyboard-applet \
       matchbox-panel-2 \
       matchbox-session \
       matchbox-terminal \
       matchbox-theme-sato \
       matchbox-session-sato \
       matchbox-wm \
       settings-daemon \
       "

RDEPENDS_${PN} += "packagegroup-petalinux-x11 ${MATCHBOX_PACKAGES}"

repository: jrrk/meta-petalinux

repo_name: jrrk/meta-petalinux


text:
package baichuan

import (
	"github.com/bububa/opentaobao/core"
	"github.com/bububa/opentaobao/model/baichuan"
)

// TaobaoBaichuanOpenaccountResetcodeCheck 百川验证找回密码验证码
// taobao.baichuan.openaccount.resetcode.check
//
// 百川验证找回密码验证码
func TaobaoBaichuanOpenaccountResetcodeCheck(clt *core.SDKClient, req *baichuan.TaobaoBaichuanOpenaccountResetcodeCheckAPIRequest, session string) (*baichuan.TaobaoBaichuanOpenaccountResetcodeCheckAPIResponse, error) {
	var resp baichuan.TaobaoBaichuanOpenaccountResetcodeCheckAPIResponse
	err := clt.Post(req, &resp, session)
	if err != nil {
		return nil, err
	}
	return &resp, nil
}

repository: bububa/opentaobao

repo_name: bububa/opentaobao


text:
# generated from catkin/cmake/template/pkgConfig-version.cmake.in
set(PACKAGE_VERSION "0.0.0")

set(PACKAGE_VERSION_EXACT False)
set(PACKAGE_VERSION_COMPATIBLE False)

if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}")
  set(PACKAGE_VERSION_EXACT True)
  set(PACKAGE_VERSION_COMPATIBLE True)
endif()

if("${PACKAGE_FIND_VERSION}" VERSION_LESS "${PACKAGE_VERSION}")
  set(PACKAGE_VERSION_COMPATIBLE True)
endif()

repository: kubeedge/community

path: /sig-robotics/examples/Building a Robot Oriented Intelligent Monitoring System/ros/src/robot_simulation/cmake-build-debug/catkin_generated/installspace/robot_simulationConfig-version.cmake

repo_name: kubeedge/community


text:
@article{bauer2017punished,
  title={Who is punished? Conditions affecting voter evaluations of legislators who do not compromise},
  author={Bauer, Nichole M and Yong, Laurel Harbridge and Krupnikov, Yanna},
  journal={Political Behavior},
  volume={39},
  number={2},
  pages={279--300},
  year={2017},
  publisher={Springer},
  doi = {10.1007/s11109-016-9356-6}
}
@article{simonsohn2019specification,
	title={Specification curve: Descriptive and inferential statistics on all reasonable specifications},
	author={Simonsohn, Uri and Simmons, Joseph P and Nelson, Leif D},
	journal={Available at SSRN 2694998},
	year={2019},
	doi = {10.2139/ssrn.2694998}
}

@article{steegen2016increasing,
	title={Increasing transparency through a multiverse analysis},
	author={Steegen, Sara and Tuerlinckx, Francis and Gelman, Andrew and Vanpaemel, Wolf},
	journal={Perspectives on Psychological Science},
	volume={11},
	number={5},
	pages={702--712},
	year={2016},
	publisher={Sage Publications Sage CA: Los Angeles, CA},
	doi = {10.1177/1745691616658637}
}

@Misc{masur2020specr,
	title = {specr: Conducting and Visualizing Specification Curve Analyses (Version 0.2.2)},
	author = {Philipp K. Masur and Michael Scharkow},
	year = {2020},
	url = {https://CRAN.R-project.org/package=specr},
}
@article{blair2019declaring,
	title={Declaring and diagnosing research designs},
	author={Blair, Graeme and Cooper, Jasper and Coppock, Alexander and Humphreys, Macartan},
	journal={American Political Science Review},
	volume={113},
	number={3},
	pages={838--859},
	year={2019},
	publisher={Cambridge University Press},
	doi = {10.1017/S0003055419000194}
}

@article{aaldering2016political,
	title={Political leaders and the media. Can we measure political leadership images in newspapers using computer-assisted content analysis?},
	author={Aaldering, Loes and Vliegenthart, Rens},
	journal={Quality \& Quantity},
	volume={50},
	number={5},
	pages={1871--1905},
	year={2016},
	publisher={Springer},
	doi = {10.1007/s11135-015-0242-9}
}

@article{elis2010dynamics,
	title={The dynamics of candidate evaluations and vote choice in 2008: looking to the past or future?},
	author={Elis, Roy and Hillygus, D Sunshine and Nie, Norman},
	journal={Electoral Studies},
	volume={29},
	number={4},
	pages={582--593},
	year={2010},
	publisher={Elsevier},
	doi = {10.1016/j.electstud.2010.04.005}
}

@article{doherty2013whom,
	title={To whom do people think representatives should respond: Their district or the country?},
	author={Doherty, David},
	journal={Public Opinion Quarterly},
	volume={77},
	number={1},
	pages={237--255},
	year={2013},
	publisher={Oxford University Press UK},
	doi = {10.1093/poq/nfs052}
}

@article{eagly2007female,
	title={Female leadership advantage and disadvantage: Resolving the contradictions},
	author={Eagly, Alice H},
	journal={Psychology of women quarterly},
	volume={31},
	number={1},
	pages={1--12},
	year={2007},
	publisher={SAGE Publications Sage CA: Los Angeles, CA},
	doi = {10.1111/j.1471-6402.2007.00326.x}
}

@article{berinsky2014separating,
	title={Separating the shirkers from the workers? Making sure respondents pay attention on self-administered surveys},
	author={Berinsky, Adam J and Margolis, Michele F and Sances, Michael W},
	journal={American Journal of Political Science},
	volume={58},
	number={3},
	pages={739--753},
	year={2014},
	publisher={Wiley Online Library},
	doi = {10.1111/ajps.12081}
}

@Misc{greifer2021,
	title={cobalt: Covariate Balance Tables and Plots. R package version 4.3.1},
	author={Greifer, Noah},
	year={2021},
	url = {https://cran.r-project.org/web/packages/cobalt/index.html}
}

repository: MarikenvdVelden/bend-break-compromise

repo_name: MarikenvdVelden/bend-break-compromise


text:
package main

import "sort"

func sortArrayByParity(A []int) []int {
	sort.Slice(A, func(i, j int) bool {
		return A[i] % 2 < A[j] % 2
	})

	return A
}

path: /LeetCode/Sort Array By Parity/sortArrayByParity(基于比较函数).go

gha_language: Java


text:
@article{SBOLExplorerDataInfrastructure_zhang_2019,
 annotation = {00000},
 author = {Zhang, Michael and Zundel, Zach and Myers, Chris J.},
 doi = {10.1021/acssynbio.9b00089},
 issn = {2161-5063, 2161-5063},
 journal = {ACS Synthetic Biology},
 language = {en},
 month = {October},
 number = {10},
 pages = {2287--2294},
 shorttitle = {SBOLExplorer},
 title = {SBOLExplorer: Data Infrastructure and Data Mining for Genetic Design Repositories},
 volume = {8},
 year = {2019}
}


text:
package native1

// 7.1 Native Layout IDs in version 1.1.
// Deprecated/removed in version 1.2.
//
// Below is a list of the core layouts described in the introduction above.
//
// An implementing exchange may not support all asset variants or introduce new ones unique to that system.
type Layout int64

const (
	LayoutContentWall   Layout = 1 // Content Wall
	LayoutAppWall       Layout = 2 // App Wall
	LayoutNewsFeed      Layout = 3 // News Feed
	LayoutChatList      Layout = 4 // Chat List
	LayoutCarousel      Layout = 5 // Carousel
	LayoutContentStream Layout = 6 // Content Stream
	LayoutGrid          Layout = 7 // Grid adjoining the content

// 500+ Reserved for Exchange specific layouts.
)

license: Unlicense

repository: mxmCherry/openrtb

repo_name: mxmCherry/openrtb

gha_license_id: Unlicense


text:
package user

import (
	"net/http"

	"github.com/1024casts/1024casts/util"
	"github.com/gin-gonic/gin"
)

func Following(c *gin.Context) {
	c.HTML(http.StatusOK, "user/following", gin.H{
		"title":   "正在关注",
		"user_id": util.GetUserId(c),
		"add": func(a int, b int) int {
			return a + b
		},
	})
}

repository: hihiso/casts

repo_name: hihiso/casts