text:
package submit

import (
	"../exploit"
	"../promStats"
	"bufio"
	//"bytes"
	"context"
	//"encoding/json"
	"fmt"
	"log"
	"net"
	"strings"
	"sync"
	"time"
)

func httpSub(submitCtx context.Context) {

	//flagChannel := submitCtx.Value("flagChannel").(chan flag)
	//gameServer := submitCtx.Value("gameServer").(string)
	//token := submitCtx.Value("token").(string)
	//alreadySubmitted := submitCtx.Value("alreadySubmitted").(*sync.Map)
	//
	//var flags []string
	//for {
	//	select {
	//	//Read the flag
	//	case flag := <-flagChannel:
	//		flags = append(flags, flag)
	//	//Create json from flag
	//	case <-time.After(5 * time.Second):
	//		if flags != nil {
	//			flagJson, err := json.Marshal(flags)
	//			if err != nil {
	//
	//				log.Fatalf("SUBMITTER\nError in json marshal with %s\nTrace: %s\n", gameServer, err)
	//			}
	//			req, err := http.NewRequest("PUT", gameServer, bytes.NewBuffer(flagJson))
	//			//Add headers
	//			req.Header.Set("X-Team-Token", token)
	//			if err != nil {
	//				log.Fatalf("SUBMITTER\tConnection Error HTTP:\t Server %s\n Trace:%s\n", gameServer, err)
	//			}
	//			//Send flag
	//			client := &http.Client{
	//				Timeout: time.Second * 5,
	//			}
	//			resp, err := client.Do(req)
	//			if err != nil {
	//				log.Fatalf("SUBMITTER\tError Send Flag:\t Server %s\nTrace: %s\n", gameServer, err)
	//			}
	//			defer resp.Body.Close()
	//			var flagResult []RuCtfFlag
	//			//Parse response
	//
	//			err = json.NewDecoder(resp.Body).Decode(&flagResult)
	//			if err != nil {
	//				log.Fatalf("SUBMITTER\tError Unmarshalling Flag:\nTrace: %s\n", err)
	//			}
	//			for _, flagStatus := range flagResult {
	//				if flagStatus.Status {
	//					alreadySubmitted.Store(flagStatus.Flag, true)
	//				} else {
	//					log.Printf("SUBMITTER\tInvalid Flag:\t %s \n", flagStatus.Flag)
	//				}
	//			}
	//			flags = nil
	//		}
	//	}
	//}

}

func ncSub(submitCtx context.Context) {

	flagChannel := submitCtx.Value("flagChannel").(chan exploit.Flag)
	gameServer := submitCtx.Value("gameServer").(string)
	acceptedFlag := submitCtx.Value("flagAccepted").(string)
	flagDuplicated := submitCtx.Value("flagDuplicated").(string)
	alreadySubmitted := submitCtx.Value("alreadySubmitted").(*sync.Map)

	//Create the tcp connection
	connection, err := net.DialTimeout("tcp", gameServer, 100*time.Second)
	if err != nil {
		log.Fatalf("SUBMITTER\tConnection Error TCP:\t Server %s\n Trace:%s\n", gameServer, err)
	}
	for {
		//Buffered reader
		reader := bufio.NewReader(connection)
		select {
		//Read the flag
		case flag := <-flagChannel:
			//Send the flag
			flagValue := flag.Flag
			_, _ = fmt.Fprintf(connection, "%s\n", flagValue)
			//Read the response
			response, _ := reader.ReadString('\n')
			// Check if it was already sent
			_, ok := alreadySubmitted.Load(flagValue)
			//If it's accepted, store it

			if strings.Contains(response, acceptedFlag) && !ok {
				fmt.Println("SENT", flagValue)
				promStats.Stats.IncrementSubmitted()

				alreadySubmitted.Store(flagValue, true)
			} else if strings.Contains(response, flagDuplicated) && !ok {
				fmt.Println("DUPLICATED", flag)
				promStats.Stats.IncrementDuplicated()
				alreadySubmitted.Store(flag, true)

			} else {
				fmt.Println("ERROR", flagValue, "response", response)
				promStats.Stats.IncrementFailed()
				alreadySubmitted.Store(flagValue, true)
			}

		//After x seconds without flag, stop
		case <-time.After(10 * time.Second):
			log.Printf("SUBMITTER\tRestarting connection with flag master")
			_ = connection.Close()
			time.Sleep(5 * time.Second)
			connection, err = net.DialTimeout("tcp", gameServer, 10*time.Second)
			if err != nil {
				log.Fatalf("SUBMITTER\tConnection Error TCP:\t Server %s\n Trace:%s\n", gameServer, err)
			}
		}
	}
}

func StartSubmitter(submitterCtx context.Context, wg *sync.WaitGroup) {
	defer wg.Done()

	toSubmit := submitterCtx.Value("submit").(chan exploit.Flag)
	workers := submitterCtx.Value("workers").(int)
	var submitted sync.Map

	//Create channel to pass filtered flags
	flagChannel := make(chan exploit.Flag, workers*5)
	submitterCtx = context.WithValue(submitterCtx, "flagChannel", flagChannel)
	submitterCtx = context.WithValue(submitterCtx, "alreadySubmitted", &submitted)

	//Start the submitter
	switch subType := submitterCtx.Value("subType").(string); subType {
	case "nc":
		go ncSub(submitterCtx)
	case "http":
		go httpSub(submitterCtx)
	default:
		log.Fatalf("SUBMITTER:\n Submission type %s doesn't exist!\n", subType)
	}
	//Check if the flags are already submitted
	for flag := range toSubmit {
		//The regex is checked via exploiter
		if _, result := submitted.Load(flag.Flag); result {
			// already submitted
			continue
		} else {
			// new flag
			flagChannel <- flag
		}
	}

}

license: MIT

branch_name: refs/heads/master

gha_license_id: MIT

gha_language: Go

extension: go


text:
DESCRIPTION = "GPU stress test"
HOMEPAGE = ""
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=87e91a92b2cc50fa43dba1a1a4ffca96"
SRC_REPO ?= "github.com/madisongh/gpu-burn;protocol=https"
SRCBRANCH ?= "master"
SRC_URI = "git://${SRC_REPO};branch=${SRCBRANCH}"
SRCREV ?= "8b4d5cfc3f01829dccf282b92e4dae03cbfb0fa1"
PV = "0.9+git${SRCPV}"

COMPATIBLE_MACHINE = "(cuda)"

S = "${WORKDIR}/git"

inherit cuda cmake pkgconfig

EXTRA_OECMAKE = "-DCMAKE_INSTALL_PREFIX=/opt/cudatests"
lcl_maybe_fortify = ""

FILES:${PN} = "/opt/cudatests"

repository: danielwangksu/meta-tegra

license_type: permissive

repo_name: danielwangksu/meta-tegra

extension: bb


text:
// Copyright 2018 JDCLOUD.COM
//
// 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.
//
// NOTE: This class is auto generated by the jdcloud code generator program.

package client

import (
    "github.com/jdcloud-api/jdcloud-sdk-go/core"
    zfs "github.com/jdcloud-api/jdcloud-sdk-go/services/zfs/apis"
    "encoding/json"
    "errors"
)

type ZfsClient struct {
    core.JDCloudClient
}

func NewZfsClient(credential *core.Credential) *ZfsClient {
    if credential == nil {
        return nil
    }

    config := core.NewConfig()
    config.SetEndpoint("zfs.jdcloud-api.com")

    return &ZfsClient{
        core.JDCloudClient{
            Credential:  *credential,
            Config:      *config,
            ServiceName: "zfs",
            Revision:    "1.0.9",
            Logger:      core.NewDefaultLogger(core.LogInfo),
        }}
}

func (c *ZfsClient) SetConfig(config *core.Config) {
    c.Config = *config
}

func (c *ZfsClient) SetLogger(logger core.Logger) {
    c.Logger = logger
}

func (c *ZfsClient) DisableLogger() {
    c.Logger = core.NewDummyLogger()
}

/* - 为一个文件系统创建一个挂载目标。通过这个挂载目标,你可以挂载将一个文件系统挂载到主机实例上。
- 创建一个挂载目标，为这个挂载目标分配一个Id
 */
func (c *ZfsClient) CreateMountTarget(request *zfs.CreateMountTargetRequest) (*zfs.CreateMountTargetResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.CreateMountTargetResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

/* 查询挂载客户端IP */
func (c *ZfsClient) DescribeMountedClients(request *zfs.DescribeMountedClientsRequest) (*zfs.DescribeMountedClientsResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.DescribeMountedClientsResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

/* - 创建一个新的文件系统，为这个文件系统分配一个Id
 */
func (c *ZfsClient) CreateFileSystem(request *zfs.CreateFileSystemRequest) (*zfs.CreateFileSystemResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.CreateFileSystemResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

/* 查询文件系统详情 */
func (c *ZfsClient) DescribeFileSystem(request *zfs.DescribeFileSystemRequest) (*zfs.DescribeFileSystemResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.DescribeFileSystemResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

/* -   删除挂载目标的同时会删除相关的网络接口。
 */
func (c *ZfsClient) DeleteMountTarget(request *zfs.DeleteMountTargetRequest) (*zfs.DeleteMountTargetResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.DeleteMountTargetResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

/* -   查询文件系统列表。
-   filters多个过滤条件之间是逻辑与(AND)，每个条件内部的多个取值是逻辑或(OR)
 */
func (c *ZfsClient) DescribeFileSystems(request *zfs.DescribeFileSystemsRequest) (*zfs.DescribeFileSystemsResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.DescribeFileSystemsResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

/* -   删除一个文件系统，一旦删除，该文件系统将不存在，也无法访问已删除的文件系统里的任何内容。
 [MFA enabled] */
func (c *ZfsClient) DeleteFileSystem(request *zfs.DeleteFileSystemRequest) (*zfs.DeleteFileSystemResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.DeleteFileSystemResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

/* 修改文件系统属性(name 和 description 必须要指定一个) */
func (c *ZfsClient) ModifyFileSystemAttribute(request *zfs.ModifyFileSystemAttributeRequest) (*zfs.ModifyFileSystemAttributeResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.ModifyFileSystemAttributeResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

/* -   查询挂载目标列表。
 */
func (c *ZfsClient) DescribeMountTargets(request *zfs.DescribeMountTargetsRequest) (*zfs.DescribeMountTargetsResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.DescribeMountTargetsResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

/* 查询挂载目标详情 */
func (c *ZfsClient) DescribeMountTarget(request *zfs.DescribeMountTargetRequest) (*zfs.DescribeMountTargetResponse, error) {
    if request == nil {
        return nil, errors.New("Request object is nil. ")
    }
    resp, err := c.Send(request, c.ServiceName)
    if err != nil {
        return nil, err
    }

    jdResp := &zfs.DescribeMountTargetResponse{}
    err = json.Unmarshal(resp, jdResp)
    if err != nil {
        c.Logger.Log(core.LogError, "Unmarshal json failed, resp: %s", string(resp))
        return nil, err
    }

    return jdResp, err
}

repository: jdcloud-api/jdcloud-sdk-go

repo_name: jdcloud-api/jdcloud-sdk-go


text:
// +build !darwin

package gompress

import (
	"io"

	"github.com/cyberdelia/lzo"
)

// Lzo implements both the Compressor and Decompressor
// interfaces, facilitating the compression and decompression
// of data streams using the Lzo data format specification.
type Lzo struct{}

// NewLzo returns a new Lzo instance, ready to compress
// and decompress data streams.
func NewLzo() *Lzo {
	return &Lzo{}
}

// Compress implements the Compressor interface by wrapping
// w with Lzo.NewWriter, which is then used to copy data
// from r, compressing the data as it's copied.
func (l *Lzo) Compress(r io.Reader, w io.Writer) error {
	out := lzo.NewWriter(w)

	defer out.Close()

	_, err := io.Copy(out, r)
	return err
}

// Decompress implements the Decompressor interface by wrapping
// r with Lzo.NewReader, which is then used to copy data to w,
// decompressing the data as it's copied.
func (l *Lzo) Decompress(r io.Reader, w io.Writer) error {
	in, err := lzo.NewReader(r)
	if err != nil {
		return err
	}

	_, err = io.Copy(w, in)

	return err
}

repository: thelolagemann/gompress

repo_name: thelolagemann/gompress

branch_name: refs/heads/main


text:
package admin

import (
	"github.com/ecletus/roles"
	tag_scanner "github.com/unapu-go/tag-scanner"
)

type SectionsContext struct {
	Ctx    *Context
	Record interface{}
}

type SchemeSectionsProvider struct {
	Name           string
	sections       Sections
	setMiddlewares []func(sections Sections) Sections
	Parent         *SchemeSectionsProvider
	GetContextFunc func(ctx *SectionsContext) []*Section
	Excludes       tag_scanner.Set
}

func (s *SchemeSectionsProvider) Exclude(names ...string) {
	s.Excludes.Add(names...)
}

func (s *SchemeSectionsProvider) Update(do func(sections Sections) Sections) *SchemeSectionsProvider {
	s.sections = do(s.MustSections())
	return s
}

func (s *SchemeSectionsProvider) SetMiddleware(md ...func(sections Sections) Sections) *SchemeSectionsProvider {
	s.setMiddlewares = append(s.setMiddlewares, md...)
	return s
}

func (s *SchemeSectionsProvider) SetSections(sections Sections) *SchemeSectionsProvider {
	for _, md := range s.setMiddlewares {
		sections = md(sections)
	}
	s.sections = sections
	return s
}

func (s *SchemeSectionsProvider) GetSections() (name string, sections Sections) {
	p := s
	for p != nil {
		if p.sections != nil {
			if len(s.Excludes) > 0 {
				return p.Name, sections.Exclude(s.Excludes.Strings()...)
			}
			return p.Name, p.sections
		}
		p = p.Parent
	}
	return
}

func (s *SchemeSectionsProvider) Sections(cb func(pv *SchemeSectionsProvider, s *Section) (cont bool)) {
	p := s
	for p != nil {
		if p.sections != nil {
			if len(s.Excludes) > 0 {
				for _, s := range p.sections.Exclude(s.Excludes.Strings()...) {
					if !cb(p, s) {
						return
					}
				}
			} else {
				for _, s := range p.sections {
					if !cb(p, s) {
						return
					}
				}
			}
			return
		}
		p = p.Parent
	}
	return
}

func (s *SchemeSectionsProvider) GetSectionsCopy() (_ string, sections Sections) {
	name, secs := s.GetSections()
	sections = make(Sections, len(secs))
	copy(sections, secs)
	return name, sections
}

func (s *SchemeSectionsProvider) MustSections() (sections Sections) {
	_, sections = s.GetSections()
	return
}

func (s *SchemeSectionsProvider) MetasNames() (names []string) {
	s.Sections(func(pv *SchemeSectionsProvider, s *Section) (cont bool) {
		s.MetasNamesCb(func(name string) {
			names = append(names, name)
		})
		return true
	})
	return
}

func (s *SchemeSectionsProvider) Metas(cb func(meta *Meta) (cont bool), getter ...func(res *Resource, name string) *Meta) {
	s.Sections(func(_ *SchemeSectionsProvider, s *Section) (cont bool) {
		s.Metas(func(meta *Meta) bool {
			cont = cb(meta)
			return cont
		}, getter...)
		return cont
	})
	return
}

func (s *SchemeSectionsProvider) GetMetas(getter ...func(res *Resource, name string) *Meta) (metas []*Meta) {
	for _, s := range s.MustSections() {
		s.Metas(func(meta *Meta) bool {
			metas = append(metas, meta)
			return true
		}, getter...)
	}
	return
}

func (s *SchemeSectionsProvider) MustSectionsCopy() (sections Sections) {
	_, sections = s.GetSectionsCopy()
	return
}

func (s *SchemeSectionsProvider) GetContextSections(ctx *SectionsContext) (name string, sections Sections) {
	p := s
	for p != nil {
		if p.GetContextFunc != nil {
			return p.Name, p.GetContextFunc(ctx)
		} else if len(p.sections) > 0 {
			return p.Name, p.sections
		}
		p = p.Parent
	}
	return
}

func (s *SchemeSectionsProvider) MustContextSections(ctx *SectionsContext) (sections Sections) {
	_, sections = s.GetContextSections(ctx)
	return
}

func (s *SchemeSectionsProvider) MustContextSectionsCopy(ctx *SectionsContext) (sections Sections) {
	_, secs := s.GetContextSections(ctx)
	sections = make(Sections, len(secs))
	copy(sections, secs)
	return
}

func (s *SchemeSectionsProvider) IsSet() bool {
	if s == nil {
		return false
	}
	return s.sections != nil
}

func (s *SchemeSectionsProvider) IsSetI() bool {
	p := s
	for p != nil {
		if p.IsSet() {
			return true
		}
		p = p.Parent
	}
	return false
}

type CRUDSchemeSectionsLayout struct {
	Name string

	Index,
	New,
	Edit,
	Show *SchemeSectionsProvider

	Custom map[string]*SchemeSectionsProvider
}

func (s *CRUDSchemeSectionsLayout) Exclude(names ...string) {
	s.Index.Exclude(names...)
	s.New.Exclude(names...)
	s.Edit.Exclude(names...)
	s.Show.Exclude(names...)
	for _, c := range s.Custom {
		c.Exclude(names...)
	}
}

func (l *CRUDSchemeSectionsLayout) MetasNamesCb(cb func(name string)) {
	var names = map[string]interface{}{}
	for _, s := range l.All() {
		s.MustSections().MetasNamesCb(func(name string) {
			if _, ok := names[name]; !ok {
				cb(name)
				names[name] = nil
			}
			return
		})
	}
}

func (l *CRUDSchemeSectionsLayout) Get(name string) *SchemeSectionsProvider {
	switch name {
	case "index":
		return l.Index
	case "new":
		return l.New
	case "edit":
		return l.Edit
	case "show":
		return l.Show
	default:
		return l.Custom[name]
	}
}

func (l *CRUDSchemeSectionsLayout) Cruds() []*SchemeSectionsProvider {
	return []*SchemeSectionsProvider{
		l.Show,
		l.Edit,
		l.New,
		l.Index,
	}
}

func (l *CRUDSchemeSectionsLayout) All() (ret []*SchemeSectionsProvider) {
	ret = []*SchemeSectionsProvider{
		l.Show,
		l.Edit,
		l.New,
		l.Index,
	}
	for _, c := range l.Custom {
		ret = append(ret, c)
	}
	return
}

func NewCRUDSchemeSectionsLayout(name string, from ...*CRUDSchemeSectionsLayout) *CRUDSchemeSectionsLayout {
	l := &CRUDSchemeSectionsLayout{
		Name:   name,
		Edit:   &SchemeSectionsProvider{Name: name + "@edit"},
		Index:  &SchemeSectionsProvider{Name: name + "@index"},
		New:    &SchemeSectionsProvider{Name: name + "@new"},
		Show:   &SchemeSectionsProvider{Name: name + "@show"},
		Custom: map[string]*SchemeSectionsProvider{},
	}

	if len(from) == 1 {
		f := from[0]

		l.Edit.Parent = f.Edit
		l.Index.Parent = f.Index
		l.New.Parent = f.New
		l.Show.Parent = f.Show
		for name, prov := range f.Custom {
			l.Custom[name] = &SchemeSectionsProvider{Parent: prov}
		}
	}

	return l
}

func (this *CRUDSchemeSectionsLayout) Update(do func(sections Sections) Sections) *CRUDSchemeSectionsLayout {
	this.Index.Update(do)
	this.New.Update(do)
	this.Edit.Update(do)
	this.Show.Update(do)
	return this
}

type DefaultSchemeSectionsLayouts struct {
	Default,
	Inline *SectionsLayout

	Layouts *SchemeSectionsLayouts
}

func NewDefaultSchemeSectionsLayout(layouts *SchemeSectionsLayouts) *DefaultSchemeSectionsLayouts {
	return &DefaultSchemeSectionsLayouts{
		Layouts: layouts,
		Default: layouts.Layouts[SectionLayoutDefault],
		Inline:  layouts.Layouts[SectionLayoutDefault+"."+SectionLayoutInline],
	}
}

func (this *DefaultSchemeSectionsLayouts) Only(name string) *DefaultSchemeSectionsLayouts {
	return NewDefaultSchemeSectionsLayout(NewSchemeSectionsLayouts(name, NewSchemeSectionsLayoutsOptions{
		Default:       this.Layouts.Layouts[name],
		DefaultInline: this.Layouts.Layouts[name+"."+SectionLayoutInline],
	}))
}

func (this *DefaultSchemeSectionsLayouts) MakeChild(name string) *DefaultSchemeSectionsLayouts {
	return NewDefaultSchemeSectionsLayout(NewSchemeSectionsLayouts(name, NewSchemeSectionsLayoutsOptions{From: this.Layouts}))
}

type SectionsLayout struct {
	Name string
	Screen,
	Print *CRUDSchemeSectionsLayout
}

func (s *SectionsLayout) Get(fieldName string) *CRUDSchemeSectionsLayout {
	switch fieldName {
	case "screen", "Screen":
		return s.Screen
	case "print", "Print":
		return s.Print
	}
	return nil
}

func (s *SectionsLayout) Set(fieldName string, value *CRUDSchemeSectionsLayout) {
	switch fieldName {
	case "screen", "Screen":
		s.Screen = value
	case "print", "Print":
		s.Print = value
	}
}

func (s *SectionsLayout) Exclude(names ...string) {
	s.Screen.Exclude(names...)
	s.Print.Exclude(names...)
}

type NewSchemeSectionsLayoutsOptions struct {
	From                   *SchemeSectionsLayouts
	Default, DefaultInline *SectionsLayout
	DefaultProvider        *SchemeSectionsProvider
}

type SchemeSectionsLayouts struct {
	Layouts map[string]*SectionsLayout
}

func NewSchemeSectionsLayouts(name string, opts ...NewSchemeSectionsLayoutsOptions) (l *SchemeSectionsLayouts) {
	l = &SchemeSectionsLayouts{Layouts: map[string]*SectionsLayout{}}
	var opt NewSchemeSectionsLayoutsOptions
	for _, opt = range opts {
	}

	if opt.From == nil {
		if opt.DefaultProvider == nil {
			opt.DefaultProvider = &SchemeSectionsProvider{Name: "default_provider"}
		}

		if opt.Default == nil {
			opt.Default = &SectionsLayout{}
		}

		if opt.Default.Screen == nil {
			opt.Default.Screen = &CRUDSchemeSectionsLayout{
				Name:   name + "#default/screen",
				Index:  &SchemeSectionsProvider{Name: "#index", Parent: opt.DefaultProvider},
				New:    &SchemeSectionsProvider{Name: "#new", Parent: opt.DefaultProvider},
				Edit:   &SchemeSectionsProvider{Name: "#edit", Parent: opt.DefaultProvider},
				Show:   &SchemeSectionsProvider{Name: "#show", Parent: opt.DefaultProvider},
				Custom: map[string]*SchemeSectionsProvider{},
			}
		}

		if opt.Default.Print == nil {
			opt.Default.Print = opt.Default.Screen
		}

		if opt.DefaultInline == nil {
			opt.DefaultInline = &SectionsLayout{}
			opt.DefaultInline.Screen = &CRUDSchemeSectionsLayout{
				Name:   name + "#inline/screen",
				Index:  &SchemeSectionsProvider{Name: "#index", Parent: opt.Default.Screen.Index},
				New:    &SchemeSectionsProvider{Name: "#new", Parent: opt.Default.Screen.New},
				Edit:   &SchemeSectionsProvider{Name: "#edit", Parent: opt.Default.Screen.Edit},
				Show:   &SchemeSectionsProvider{Name: "#show", Parent: opt.Default.Screen.Show},
				Custom: map[string]*SchemeSectionsProvider{},
			}
		}

		if opt.DefaultInline.Print == nil {
			opt.DefaultInline.Print = &CRUDSchemeSectionsLayout{
				Name:   name + "#inline/print",
				Index:  &SchemeSectionsProvider{Name: "#index", Parent: opt.DefaultInline.Screen.Index},
				New:    &SchemeSectionsProvider{Name: "#new", Parent: opt.DefaultInline.Screen.New},
				Edit:   &SchemeSectionsProvider{Name: "#edit", Parent: opt.DefaultInline.Screen.Edit},
				Show:   &SchemeSectionsProvider{Name: "#show", Parent: opt.DefaultInline.Screen.Show},
				Custom: map[string]*SchemeSectionsProvider{},
			}
		}
		l.Layouts[SectionLayoutDefault] = &SectionsLayout{name + "#default", opt.Default.Screen, opt.Default.Print}
		l.Layouts[SectionLayoutDefault+"."+SectionLayoutInline] = &SectionsLayout{name + "#inline", opt.DefaultInline.Screen, opt.DefaultInline.Print}
	} else {
		for _, key := range []string{
			SectionLayoutDefault,
			SectionLayoutDefault + "." + SectionLayoutInline,
		} {
			from := opt.From.Layouts[key]
			layout := &SectionsLayout{Name: name + "#" + key}

			for _, pair := range [][2]**CRUDSchemeSectionsLayout{{&layout.Screen, &from.Screen}, {&layout.Print, &from.Print}} {
				dst, from := pair[0], *pair[1]
				*dst = NewCRUDSchemeSectionsLayout(key, &CRUDSchemeSectionsLayout{
					Name:   key,
					Index:  &SchemeSectionsProvider{Name: name + ">" + from.Index.Name, Parent: from.Index},
					New:    &SchemeSectionsProvider{Name: name + ">" + from.New.Name, Parent: from.New},
					Edit:   &SchemeSectionsProvider{Name: name + ">" + from.Edit.Name, Parent: from.Edit},
					Show:   &SchemeSectionsProvider{Name: name + ">" + from.Show.Name, Parent: from.Show},
					Custom: map[string]*SchemeSectionsProvider{},
				})
				for key, custom := range from.Custom {
					(*dst).Custom[key] = &SchemeSectionsProvider{Parent: custom, Name: key + ">" + custom.Name}
				}
			}
			l.Layouts[key] = layout
		}
	}

	return l
}

func (this *Scheme) EditSections(context *Context, record interface{}) (sections Sections) {
	sections = this.GetSectionsProvider(context, EDIT).MustContextSectionsCopy(&SectionsContext{
		Ctx:    context,
		Record: record,
	})

	if this == this.Resource.Scheme && this.Resource.Fragment != nil {
		sections = append(sections, &Section{Resource: this.Resource, Rows: [][]interface{}{{AttrFragmentEnabled}}})
	}
	return sections.Allowed(record, context, roles.Update)
}

repository: ecletus/admin

repo_name: ecletus/admin

gha_language: JavaScript


text:
file(REMOVE_RECURSE
  "CMakeFiles/zmq_sender.dir/zmq_sender.cpp.o"
  "../Debug/zmq_sender.pdb"
  "../Debug/zmq_sender"
)

# Per-language clean rules from dependency scanning.
foreach(lang CXX)
  include(CMakeFiles/zmq_sender.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()

repository: aosterthun/rgbd-calib-old

repo_name: aosterthun/rgbd-calib-old

extension: cmake


text:
SECTION = "devel/chicken"
DESCRIPTION = "advise' functionality"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://advice.meta;md5=95e1c72cb6fe38133111365d604b7e86"

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

SRC_URI[md5sum] = "5f9a02574cb042017c09a786459f8628"
SRC_URI[sha256sum] = "a0fde8bac9b95272cbd49b31689d575bbdb55cb864fab8143b6123f2dfa9e930"

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

inherit chicken_install

BBCLASSEXTEND = "cross crosssdk nativesdk"

repository: OSSystems/meta-chicken

repo_name: OSSystems/meta-chicken


text:
LICENSE = "GPL"

SRC_URI = "http://64.34.161.181/download/3.4.0/sources/${PN}-${PV}.tar.gz \
           "

SRC_URI[md5sum] = "c480abff35565bde306e3878d0e43093"
SRC_URI[sha256sum] = "9325173919b98675d1f88616f2692f4ffd6cb0ae3dd61c6015fa82065693efa8"

S = "${WORKDIR}/${PN}"

inherit autotools

do_install () {
        oe_runmake "bindir=${D}${bindir}" \
                   "man1dir=${D}${mandir}" \
                   install
}

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
@article{MR3319965,
 author = {Torralbo, Francisco and Urbano, Francisco},
 doi = {10.1007/s12220-013-9460-3},
 fjournal = {Journal of Geometric Analysis},
 issn = {1050-6926},
 journal = {J. Geom. Anal.},
 mrclass = {53C42 (53C40)},
 mrnumber = {3319965},
 mrreviewer = {P. G. Walczak},
 number = {2},
 pages = {1132--1156},
 title = {Minimal surfaces in $\BbbS^2\times\BbbS^2$},
 url = {https://doi.org/10.1007/s12220-013-9460-3},
 volume = {25},
 year = {2015}
}

repository: torralbofco/geometric-analysis-fork

repo_name: torralbofco/geometric-analysis-fork

extension: bib


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

// Package realmset provides queryable representation of LUCI Realms DB.
//
// Used internally by authdb.Snapshot.
package realmset

import (
	"context"
	"sort"
	"strings"

	"go.chromium.org/luci/common/data/stringset"
	"go.chromium.org/luci/common/errors"

	"go.chromium.org/luci/server/auth/realms"
	"go.chromium.org/luci/server/auth/service/protocol"

	"go.chromium.org/luci/server/auth/authdb/internal/conds"
	"go.chromium.org/luci/server/auth/authdb/internal/graph"
)

// ExpectedAPIVersion is the supported value of api_version field.
//
// See Build implementation for details.
const ExpectedAPIVersion = 1

// Realms is a queryable representation of realms.Realms proto.
type Realms struct {
	perms  map[string]PermissionIndex     // permission name -> its index
	names  stringset.Set                  // just names of all defined realms
	realms map[realmAndPerm]Bindings      // <realm, perm> -> who has it under which conditions
	data   map[string]*protocol.RealmData // per-realm attached RealmData

	// Used by QueryBindings: perm -> project -> [(realm, bindings)].
	bindingsIdx map[PermissionIndex]map[string][]RealmBindings
}

// PermissionIndex is used in place of permission names.
//
// Note: should match an int type used in `permissions` field in the proto.
type PermissionIndex uint32

// Binding represents a set of principals and a condition when it can be used.
//
// See Bindings(...) method for more details.
type Binding struct {
	Condition *conds.Condition // nil if the binding is unconditional
	Groups    graph.SortedNodeSet
	Idents    stringset.Set
}

// badness is an overall heuristic score of how complex this binding to
// evaluate and how likely it will apply.
//
// 0 means "easy to evaluate, high likelihood of applying". Used to sort
// bindings in Bindings array returned by Bindings(...).
func (b *Binding) badness() int {
	// TODO(vadimsh): This can be improved. For example, bindings with groups
	// that contain globs (like `user:*`) are more likely to apply and should
	// have lower badness.
	if b.Condition == nil {
		return 0
	}
	return 1
}

// Bindings is a list of bindings in a single realm for a single permission.
type Bindings []Binding

// Check returns true of any of the bindings in the list are applying.
//
// Checks conditions on `attrs` and memberships of the identity represented by
// `q`.
func (b Bindings) Check(ctx context.Context, q *graph.MembershipsQueryCache, attrs realms.Attrs) bool {
	for _, binding := range b {
		if binding.Condition == nil || binding.Condition.Eval(ctx, attrs) {
			switch {
			case binding.Idents.Has(string(q.Identity)):
				return true // was granted the permission explicitly in the ACL
			case q.IsMemberOfAny(binding.Groups):
				return true // has the permission through a group
			}
		}
	}
	return false
}

// RealmBindings is a realm name plus bindings for a single permission there.
//
// Used as part of QueryBindings return value.
type RealmBindings struct {
	// Realms is a full realm name as "<project>:<name>".
	Realm string
	// Bindings is a list of bindings for a permission passed to QueryBindings.
	Bindings Bindings
}

// realmAndPerm is used as a composite key in `realms` map.
type realmAndPerm struct {
	realm string
	perm  PermissionIndex
}

// PermissionIndex returns an index of the given permission.
//
// It can be passed to Bindings(...). Returns (0, false) if there's no such
// permission in the Realms DB.
func (r *Realms) PermissionIndex(perm realms.Permission) (idx PermissionIndex, ok bool) {
	idx, ok = r.perms[perm.Name()]
	return
}

// HasRealm returns true if the given realm exists in the DB.
func (r *Realms) HasRealm(realm string) bool {
	return r.names.Has(realm)
}

// Data returns RealmData attached to a realm or nil if none.
func (r *Realms) Data(realm string) *protocol.RealmData {
	return r.data[realm]
}

// Bindings returns representation of bindings that define who has the requested
// permission in the given realm.
//
// Each returned binding is a tuple (condition, groups, identities):
//   - Condition: a predicate over realms.Attrs map that evaluates to true if
//     this binding is "active". Inactive bindings should be skipped.
//   - Groups: a set of groups with principals that have the permission,
//     represented by a sorted slice of group indexes in a graph.QueryableGraph
//     which was passed to Build().
//   - Identities: a set of identity strings that were specified in the realm
//     ACL directly (not via a group).
//
// The permission should be specified as its index obtained via PermissionIndex.
//
// The realm name is not validated. Unknown or invalid realms are silently
// treated as empty. No fallback to @root happens.
//
// Returns nil if the requested permission is not mentioned in any binding in
// the realm at all.
func (r *Realms) Bindings(realm string, perm PermissionIndex) Bindings {
	return r.realms[realmAndPerm{realm, perm}]
}

// QueryBindings returns **all** bindings for the given permission across all
// realms and projects.
//
// The result is a map "project name => list of (realm, bindings for the
// requested permission in this realm)". It includes only projects and realms
// that have bindings for the queried permission. The order of items in the list
// is not well-defined.
//
// This information is available only for permission flagged with
// UsedInQueryRealms. Returns `ok == false` if `perm` was not flagged.
func (r *Realms) QueryBindings(perm PermissionIndex) (map[string][]RealmBindings, bool) {
	res, ok := r.bindingsIdx[perm]
	return res, ok
}

// Build constructs Realms from the proto message, the group graph and
// permissions registered by the processes.
//
// Only registered permissions will be queriable. Bindings with all other
// permissions will be ignored to save RAM.
func Build(r *protocol.Realms, qg *graph.QueryableGraph, registered map[realms.Permission]realms.PermissionFlags) (*Realms, error) {
	// Do not use realms.Realms we don't understand. Better to go offline
	// completely than mistakenly allow access to something private by
	// misinterpreting realm rules (e.g. if a new hypothetical DENY rule is
	// misinterpreted as ALLOW).
	//
	// Bumping `api_version` (if it ever happens) should be done extremely
	// carefully in multiple stages:
	//   1. Update components.auth to understand both new and old api_version.
	//   2. Redeploy *everything*.
	//   3. Update Auth Service to generate realms.Realms using the new API.
	if r.ApiVersion != ExpectedAPIVersion {
		return nil, errors.Reason(
			"Realms proto has api_version %d not compatible with this service (it expects %d)",
			r.ApiVersion, ExpectedAPIVersion).Err()
	}

	// Build map: permission name -> its index (since Binding messages operate
	// with indexes). Using ints as keys is also slightly faster than strings.
	perms := make(map[string]PermissionIndex, len(r.Permissions))
	for idx, perm := range r.Permissions {
		perms[perm.Name] = PermissionIndex(idx)
	}

	// Build a set of permission indexes the process is interested in checking.
	// All other permissions will simply be ignored to avoid wasting RAM on them
	// (they won't be checked anyway).
	activePerms := make(map[PermissionIndex]struct{}, len(registered))
	for perm := range registered {
		if idx, ok := perms[perm.Name()]; ok {
			activePerms[idx] = struct{}{}
		}
	}

	// Gather names of all realms for HasRealm check.
	names := stringset.New(len(r.Realms))
	for _, realm := range r.Realms {
		names.Add(realm.Name)
	}

	// This is the `realms` map under construction. We'll shrink its memory
	// footprint at the end.
	type bindingKey struct {
		realmAndPerm
		cond *conds.Condition
	}
	realmsToBe := map[bindingKey]principalSet{}
	counts := map[realmAndPerm]int{}

	// A caching factory of Conditions for conditional bindings.
	conds := conds.NewBuilder(r.Conditions)

	// interner is used to deduplicate memory used to store identity names.
	interner := stringInterner{}

	// Visit all bindings in all realms and update principal sets in realmsToBe.
	for _, realm := range r.Realms {
		for _, binding := range realm.Bindings {
			// Categorize 'principals' into groups and identity strings.
			groups, idents := categorizePrincipals(binding.Principals, qg, interner)
			if len(groups) == 0 && len(idents) == 0 {
				continue
			}

			// Build a condition predicate (`nil` means "no condition"). If such
			// predicate was already seen before, returns the existing condition, so
			// using Condition pointers in map keys is OK. Returns an error if
			// a condition index in binding.Conditions is out of bounds or the
			// condition is malformed. This should not happen in a valid AuthDB.
			cond, err := conds.Condition(binding.Conditions)
			if err != nil {
				return nil, errors.Annotate(err, "invalid binding %q in realm %q", binding, realm.Name).Err()
			}

			// Add principals into the corresponding principal sets in realmsToBe.
			for _, permIdx := range binding.Permissions {
				permIdx := PermissionIndex(permIdx)
				if _, yes := activePerms[permIdx]; !yes {
					continue
				}
				key := bindingKey{realmAndPerm{realm.Name, permIdx}, cond}
				if ps, ok := realmsToBe[key]; ok {
					ps.add(groups, idents)
				} else {
					realmsToBe[key] = newPrincipalSet(groups, idents)
					counts[key.realmAndPerm] += 1
				}
			}
		}
	}

	// Replace identically looking group sets with references to a single copy.
	// Collect conditional bindings for the same (realm, perm) key into an array,
	// since we'll need to evaluate them sequentially when serving HasPermission
	// checks.
	realmMap := make(map[realmAndPerm]Bindings, len(counts))
	dedupper := graph.NodeSetDedupper{}
	for key, ps := range realmsToBe {
		groups, idents := ps.finalize(dedupper)
		if realmMap[key.realmAndPerm] == nil {
			realmMap[key.realmAndPerm] = make(Bindings, 0, counts[key.realmAndPerm])
		}
		realmMap[key.realmAndPerm] = append(realmMap[key.realmAndPerm], Binding{
			Condition: key.cond,
			Groups:    groups,
			Idents:    idents,
		})
	}

	// Order bindings by "badness" of checking (easiest to check first) and
	// chances of applying. Right now this uses a very simplistic heuristic:
	// unconditional bindings are easier to check and more likely to apply than
	// conditional ones.
	for _, bindings := range realmMap {
		sort.Slice(bindings, func(l, r int) bool {
			if bl, br := bindings[l].badness(), bindings[r].badness(); bl != br {
				return bl < br
			}
			// Order bindings of equal "badness" deterministically based on index of
			// their conditions (which ultimately depends on order of data in Realms
			// proto). This simplifies tests and makes HasPermission check
			// performance more deterministic too.
			idxLeft := 0
			if bindings[l].Condition != nil {
				idxLeft = bindings[l].Condition.Index() + 1
			}
			idxRight := 0
			if bindings[r].Condition != nil {
				idxRight = bindings[r].Condition.Index() + 1
			}
			return idxLeft < idxRight
		})
	}

	// Extract attached per-realm data into a queryable map.
	count := 0
	for _, realm := range r.Realms {
		if realm.Data != nil {
			count++
		}
	}
	data := make(map[string]*protocol.RealmData, count)
	for _, realm := range r.Realms {
		if realm.Data != nil {
			data[realm.Name] = realm.Data
		}
	}

	// For all permissions with UsedInQueryRealms flag, build a data set with all
	// realms that have this permission. This allows skipping unrelated realms
	// in QueryRealms. Note that we'll reuse Bindings slices from `realmMap`, so
	// we pay extra RAM only for actual mapping.
	bindingsIdx := make(map[PermissionIndex]map[string][]RealmBindings, len(registered))
	for perm, flags := range registered {
		if flags&realms.UsedInQueryRealms != 0 {
			if permIdx, ok := perms[perm.Name()]; ok {
				bindingsIdx[permIdx] = map[string][]RealmBindings{}
			}
		}
	}
	for realmAndPerm, bindings := range realmMap {
		if projToBindings, ok := bindingsIdx[realmAndPerm.perm]; ok {
			proj, _ := realms.Split(realmAndPerm.realm)
			projToBindings[proj] = append(projToBindings[proj], RealmBindings{
				Realm:    realmAndPerm.realm,
				Bindings: bindings,
			})
		}
	}

	return &Realms{
		perms:       perms,
		names:       names,
		realms:      realmMap,
		data:        data,
		bindingsIdx: bindingsIdx,
	}, nil
}

// stringInterner implements string interning to save some memory.
type stringInterner map[string]string

// intern returns an interned copy of 's'.
func (si stringInterner) intern(s string) string {
	if existing, ok := si[s]; ok {
		return existing
	}
	si[s] = s
	return s
}

// categorizePrincipals splits a list of principals into a list of groups
// (identified by their indexes in a QueryableGraph) and list of identity names.
//
// Unknown groups are silently skipped.
func categorizePrincipals(p []string, qg *graph.QueryableGraph, interner stringInterner) (groups []graph.NodeIndex, idents []string) {
	for _, principal := range p {
		if strings.HasPrefix(principal, "group:") {
			if idx, ok := qg.GroupIndex(strings.TrimPrefix(principal, "group:")); ok {
				groups = append(groups, idx)
			}
		} else {
			idents = append(idents, interner.intern(principal))
		}
	}
	return
}

// principalSet represents a set of groups and identities.
//
// It is used transiently when constructing the final memory-optimized set in
// Build.
type principalSet struct {
	groups graph.NodeSet
	idents stringset.Set
}

func newPrincipalSet(groups []graph.NodeIndex, idents []string) principalSet {
	ps := principalSet{
		groups: make(graph.NodeSet, len(groups)),
		idents: stringset.New(len(idents)),
	}
	ps.add(groups, idents)
	return ps
}

func (ps principalSet) add(groups []graph.NodeIndex, idents []string) {
	for _, idx := range groups {
		ps.groups.Add(idx)
	}
	for _, ident := range idents {
		ps.idents.Add(ident)
	}
}

// finalize produces a memory-optimized representation of this principal set.
//
// It replace identically looking group sets with references to a single copy
// using the given dedupper. It also throws away zero-length sets replacing them
// with nils.
//
// Non-empty identity sets are kept as is without any dedupping, assuming using
// identities in Realm ACLs directly is rare and not worth optimizing for (on
// top of the string interning optimization we've already done).
func (ps principalSet) finalize(dedupper graph.NodeSetDedupper) (graph.SortedNodeSet, stringset.Set) {
	var groups graph.SortedNodeSet
	if len(ps.groups) > 0 {
		groups = dedupper.Dedup(ps.groups)
	}
	var idents stringset.Set
	if ps.idents.Len() > 0 {
		idents = ps.idents
	}
	return groups, idents
}

repository: luci/luci-go

repo_name: luci/luci-go


text:
@Manual{R-base,
  title = {R: A Language and Environment for Statistical
           Computing},
  author = {{R Core Team}},
  organization = {R Foundation for Statistical Computing},
  address = {Vienna, Austria},
  year = {2019},
  url = {https://www.R-project.org},
}

@Manual{kaggle_data,
  title = {Google Play Store Apps},
  author = {{Lavanya Gupta}},
  year = {2018},
  url = {https://www.kaggle.com/lava18/google-play-store-apps},
}
@Manual{OS,
  title = {Mobile and Desktop Operating Systems Market Share},
  author = {{Nick Galov}},
  organization = {R Foundation for Statistical Computing},
  year = {2020},
  url = {https://hostingtribunal.com/blog/operating-systems-market-share/#gref
      },
  }

 @Manual{R-knitr,
    title = {knitr: A General-Purpose Package for Dynamic
      Report Generation in R},
    author = {Yihui Xie},
    year = {2020},
    note = {R package version 1.30},
    url = {https://yihui.org/knitr/},
  }

  @Manual{R-rmarkdown,
    title = {rmarkdown: Dynamic Documents for R},
    author = {JJ Allaire and Yihui Xie and Jonathan McPherson
      and Javier Luraschi and Kevin Ushey and Aron Atkins
      and Hadley Wickham and Joe Cheng and Winston Chang and
      Richard Iannone},
    year = {2020},
    note = {R package version 2.5},
    url = {https://github.com/rstudio/rmarkdown},
  }
@Manual{rms,
    title = {rms: Regression Modeling Strategies},
    author = {Frank E {Harrell Jr}},
    year = {2020},
    note = {R package version 6.0-1},
    url = {https://CRAN.R-project.org/package=rms},
  }
@Manual{janitor,
    title = {janitor: Simple Tools for Examining and Cleaning Dirty Data},
    author = {Sam Firke},
    year = {2020},
    note = {R package version 2.0.1},
    url = {https://CRAN.R-project.org/package=janitor},
  }
@Manual{ggplot2,
    author = {Hadley Wickham},
    title = {ggplot2: Elegant Graphics for Data Analysis},
    publisher = {Springer-Verlag New York},
    year = {2016},
    isbn = {978-3-319-24277-4},
    url = {https://ggplot2.tidyverse.org},
  }

@Manual{brms,
    title = {brms: An R Package for Bayesian Multilevel Models
      Using Stan},
    author = {Paul-Christian Burkner},
    journal = {Journal of Statistical Software},
    year = {2017},
  }


text:
# Copyright 2023 Open Source Robotics Foundation, 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.

# Get the absolute path of an IDL file stored in a package's share
# directory, checking if the package's find module set a GNUInstallDirs
# pkgname_DATADIR variable pointing to a separate location from the
# default pkgname_DIR.
#
# :param var: A name of a variable to store the idl file absolute path.
# :param pkg_name: Name of the package, assumed to have already been
#   find_package'd.
# :type pkg_name: string
# :param idl_name: The filename of the idl file to look for.
# :type idl_name: string
#
# @public
#
function(rosidl_find_package_idl var pkg_name idl_file)
  set(_candidates
    "${${pkg_name}_DATADIR}/${idl_file}"
    "${${pkg_name}_DIR}/../${idl_file}"
  )
  foreach(_try ${_candidates})
    if(EXISTS "${_try}")
      normalize_path(_norm "${_try}")
      set("${var}" "${_norm}" PARENT_SCOPE)
      return()
    endif()
  endforeach()
  message(FATAL_ERROR "Unable to find ${idl_file} in any of ${_candidates} for ${pkg_name}.")
  set("${var}" "-NOTFOUND" PARENT_SCOPE)
endfunction()

branch_name: refs/heads/rolling


text:
#include <unittest-cpp/TestResults.h>

#include <unittest-cpp/ITestReporter.h>
#include <unittest-cpp/TestDetails.h>
#include <unittest-cpp/TestRunner.h>
#include <unittest-cpp/TestFixtureInfo.h>
#include <unittest-cpp/TestSuiteInfo.h>
#include <unittest-cpp/TestInfo.h>

using namespace std;

namespace UnitTestCpp
{

TestResults::TestResults(ITestReporter * testReporter)
    : reporter(testReporter)
    , totalTestCount(0)
    , failedTestCount(0)
    , failureCount(0)
    , currentTestFailed(false)
{
}

TestResults::~TestResults()
{
}

void TestResults::OnTestSuiteStart(const TestSuiteInfo & suiteInfo)
{
    if (reporter)
        reporter->ReportTestSuiteStart(suiteInfo.Name(), CountFixtures(suiteInfo));
}

void TestResults::OnTestSuiteFinish(const TestSuiteInfo & suiteInfo, int milliSecondsElapsed)
{
    if (reporter)
        reporter->ReportTestSuiteFinish(suiteInfo.Name(), CountFixtures(suiteInfo),
                                        milliSecondsElapsed);
}

void TestResults::OnTestFixtureStart(const TestFixtureInfo & fixtureInfo)
{
    if (reporter)
        reporter->ReportTestFixtureStart(fixtureInfo.Name(), CountTests(fixtureInfo));
}

void TestResults::OnTestFixtureFinish(const TestFixtureInfo & fixtureInfo, int milliSecondsElapsed)
{
    if (reporter)
        reporter->ReportTestFixtureFinish(fixtureInfo.Name(), CountTests(fixtureInfo),
                                          milliSecondsElapsed);
}

void TestResults::OnTestStart(const TestDetails & details)
{
    ++totalTestCount;
    currentTestFailed = false;
    if (reporter)
        reporter->ReportTestStart(details);
}

void TestResults::OnTestFailure(const TestDetails & details, const string & result)
{
    ++failureCount;
    if (!currentTestFailed)
    {
        ++failedTestCount;
        currentTestFailed = true;
    }
    if (reporter)
        reporter->ReportTestFailure(details, ToString(result));
}

void TestResults::OnTestFinish(const TestDetails & details, int milliSecondsElapsed)
{
    if (reporter)
        reporter->ReportTestFinish(details, !currentTestFailed, milliSecondsElapsed);
}

void TestResults::OnTestSuiteList(const TestSuiteInfo & suiteInfo)
{
    if (reporter)
        reporter->ReportTestSuiteEntry(suiteInfo.Name());
}

void TestResults::OnTestFixtureList(const TestFixtureInfo & fixtureInfo)
{
    if (reporter)
        reporter->ReportTestFixtureEntry(fixtureInfo.Name());
}

void TestResults::OnTestList(const TestDetails & details)
{
    if (reporter)
        reporter->ReportTestEntry(details.testName);
}

int TestResults::GetTotalTestCount() const
{
    return totalTestCount;
}

int TestResults::GetPassedTestCount() const
{
    return totalTestCount - failedTestCount;
}

int TestResults::GetFailedTestCount() const
{
    return failedTestCount;
}

int TestResults::GetFailureCount() const
{
    return failureCount;
}

} // namespace UnitTestCpp

repository: renebarto/unittest-cpp

repo_name: renebarto/unittest-cpp

gha_license_id: NOASSERTION

extension: cpp


text:
@inproceedings{rahman2020combating,
 author = {Rahman, Muhammad Sajidur and Tully, Philip},
 booktitle = {2020 USENIX Security},
 number = {Security and AI Networking Summit},
 organization = {https://www.usenix.org/conference/scainet20/presentation/rahman},
 title = {Combating Social Media Information Operations with Neural Language Models},
 year = {2020}
}


text:
package main

import (
	"fmt"
	"log"
	"os"
)

func main() {
	// os.Stdout.Close()
	if _, err := fmt.Fprintln(os.Stdout, "hello"); err != nil {
		log.Printf("%#v %T\n", err, err) // &fs.PathError{Op:"write", Path:"/dev/stdout", Err:(*errors.errorString)(0xc000010120)} *fs.PathError
		log.Fatal(err)
	}
}

repository: miku/gonotes

repo_name: miku/gonotes


text:
package utils

import (
	"fmt"

	"crypto/aes"
	"crypto/cipher"
	"crypto/sha256"

	"github.com/lf-edge/eve/api/go/config"
	"google.golang.org/protobuf/proto"
)

//internal encryption method
func aesEncrypt(iv, symmetricKey, plaintext []byte) ([]byte, error) {
	ciphertext := make([]byte, len(plaintext))
	aesBlockEncrypter, err := aes.NewCipher(symmetricKey)
	if err != nil {
		return nil, err
	}
	aesEncrypter := cipher.NewCFBEncrypter(aesBlockEncrypter, iv)
	aesEncrypter.XORKeyStream(ciphertext, plaintext)
	return ciphertext, nil
}

//create cipher block
func createCipherBlock(plainText []byte, cipherCtxID string, cmnCryptoCfg *CommonCryptoConfig, iv []byte) (*config.CipherBlock, error) {
	if cmnCryptoCfg.DevCertHash == nil {
		return nil, fmt.Errorf("empty device certificate in create cipher block method")
	}
	cipherBlock := &config.CipherBlock{}
	cipherBlock.CipherContextId = cipherCtxID
	shaOfPlainTextSecret := sha256.Sum256(plainText)
	cipherBlock.ClearTextSha256 = shaOfPlainTextSecret[:]
	cipherBlock.InitialValue = iv

	//encrypt paintext secret using symmetric key and initial value.
	cipherText, ecErr := aesEncrypt(iv, cmnCryptoCfg.SymmetricKey, plainText)
	if ecErr != nil {
		return nil, ecErr
	}
	cipherBlock.CipherData = cipherText

	return cipherBlock, nil
}

//CryptoConfigWrapper create cipherCtx and encrypt secrets for all the objects.
func CryptoConfigWrapper(encBlock *config.EncryptionBlock, cmnCryptoCfg *CommonCryptoConfig, cipherCtx *config.CipherContext) (*config.CipherBlock, error) {
	//Prepare initial value by appending device cert has and controller cert hash
	//and calculate sha of that.
	var concatIV []byte
	concatIV = append(concatIV, cipherCtx.ControllerCertHash[:8]...)
	concatIV = append(concatIV, cipherCtx.DeviceCertHash[:8]...)
	iv := sha256.Sum256(concatIV)

	mEncBlock, mErr := proto.Marshal(encBlock)
	if mErr != nil {
		return nil, fmt.Errorf("error marshalling user data: %v", mErr)
	}
	//Fill CipherBlock.
	cipherBlock, cbErr := createCipherBlock(mEncBlock, cipherCtx.ContextId, cmnCryptoCfg, iv[:16])
	if cbErr != nil {
		return nil, fmt.Errorf("error creating cipher block: %v", cbErr)
	}
	return cipherBlock, nil
}

repository: itmo-eve/eden

repo_name: itmo-eve/eden


text:
/*
 * LSMStatusMsgConverter.cpp
 *
 *  Created on: 11.12.2014
 *      Author: mschenk
 */

#include <string>
#include <boost/regex.hpp>
#include "taurob_laser_scanner_mount/LSMStatusMsgConverter.h"
#include <stdint.h>
#include <ros/console.h>

void LSMStatusMsgConverter::ConvertToBytes(LSMStatusFrame frame, unsigned char* dest, unsigned char seq)
{
	unsigned int timestamp = frame.timestamp;
	uint16_t current_speed = frame.current_speed;
	uint16_t current_angle = ((frame.current_angle * (180.0/M_PI)) / 0.088); 	// convert to degrees and then to steps
	unsigned char bitfield = frame.bitfield;
	unsigned char frame_id = LSM_STATUS_FRAME_ID;

	dest[0] = frame_id;
	dest[1] = seq;
	dest[2] = ((timestamp & 0xFF000000) >> 8*3);
	dest[3] = ((timestamp & 0x00FF0000) >> 8*2);
	dest[4] = ((timestamp & 0x0000FF00) >> 8*1);
	dest[5] = ((timestamp & 0x000000FF) >> 8*0);
	dest[6] = ((current_angle & 0xFF00) >> 8*1);
	dest[7] = ((current_angle & 0x00FF) >> 8*0);
	dest[8] = ((current_speed & 0xFF00) >> 8*1);
	dest[9] = ((current_speed & 0x00FF) >> 8*0);
	dest[10] = bitfield;
    }

LSMStatusFrame LSMStatusMsgConverter::ConvertToLSMStatusMsg(unsigned char* lsm_status_msg, unsigned char* seq_dest)
{
	LSMStatusFrame output_frame;

	unsigned char frame_id = 0;
	unsigned int timestamp = 0;	// transmitted as uint32, msb first (big-endian)
	unsigned int current_speed = 0; 	// transmitted as uint16, big-endian
	double current_angle = 0;	// transmitted as uint16, big-endian
	unsigned char bitfield = 0;

	// get values from frame
	frame_id = lsm_status_msg[0];
	if (frame_id == LSM_STATUS_FRAME_ID)
	{
		*seq_dest = lsm_status_msg[1];
		timestamp = ((lsm_status_msg[2] << 8*3) | (lsm_status_msg[3] << 8*2) | (lsm_status_msg[4] << 8*1) | (lsm_status_msg[5] << 8*0));
		current_angle = ((lsm_status_msg[6] << 8*1) | (lsm_status_msg[7] << 8*0));
		current_speed = ((lsm_status_msg[8] << 8*1) | (lsm_status_msg[9] << 8*0));
		bitfield = lsm_status_msg[10];

		// invert turning direction of current_angle
		current_angle = 4095 - current_angle;

		// convert current_angle from 'ticks' (4096) to degrees (360), and then to rad
		current_angle *= 0.088;
		current_angle *= (M_PI / 180.0);

		// fill frame
		output_frame.timestamp = timestamp;
		output_frame.current_angle = current_angle;
		output_frame.current_speed = current_speed;
		output_frame.bitfield = bitfield;
	}
	else
	{
		ROS_WARN("received LSM frame with unknown frame id %d -- ignoring this frame.", frame_id);
	}

        return output_frame;
    }

repository: taurob/taurobtrackerapi

repo_name: taurob/taurobtrackerapi


text:
#include "ArgumentParser.h"

#include <QCommandLineOption>
#include <QDir>
#include <QRegularExpression>
#include <QDebug>
#include <QProcess>
#include <QFile>

ArgumentParser::ArgumentParser(QCoreApplication* app,
                               CommonUtils* commonUtils,
                               ConfigHelper* configHelper,
                               QObject* parent)
    : QObject(parent) {
  this->app = app;
  this->commonUtils = commonUtils;
  this->configHelper = configHelper;

  /**** CREATE ARGUMENTS ****/
  this->parser = new QCommandLineParser();
  this->parser->setApplicationDescription(PROJECT_DESCRIPTION);
  this->downloadOption =
      new QCommandLineOption(this->argumentKeys[ArgumentEnum::DOWNLOAD],
                             "Only download the wallpaper\n");
  this->dirOption =
      new QCommandLineOption(this->argumentKeys[ArgumentEnum::DIR],
                             "Directory to download the wallpaper"
                             "\nDefault dir : .local/share/Paper/paper"
                             "\nExample : --dir ~/foo/bar"
                             "\n           -D ~/foooo/baaaar\n",
                             "directory_path");
  this->helpOption = new QCommandLineOption(
      this->argumentKeys[ArgumentEnum::HELP], "Displays this help\n");
  this->resolutionOption =
      new QCommandLineOption(this->argumentKeys[ArgumentEnum::RESOLUTION],
                             "Resolution of the wallpaper to be downloaded"
                             "\nDefault resolution : 1920x1080"
                             "\nExample : --resolution 1024x768"
                             "\n           -r 1920x1080\n",
                             "widthxheight");
  this->refreshRateOption = new QCommandLineOption(
      this->argumentKeys[ArgumentEnum::REFRESH_RATE],
      "Refreshes Wallpaper every 'n' Minutes or 'n' Hours"
      "\nExample : --refresh-rate 5M"
      "\n           -R 2H\n",
      "n[M|H]");
  this->saveOption =
      new QCommandLineOption(this->argumentKeys[ArgumentEnum::SAVE],
                             "Save the [dir, resolution, tags] to file"
                             "\nWill be used to remember user preference\n");
  this->startDaemonOption =
      new QCommandLineOption(this->argumentKeys[ArgumentEnum::START_DAEMON],
                             "Start as daemon"
                             "\nTo be used with --refresh-rate option\n");
  this->stopDaemonOption = new QCommandLineOption(
      this->argumentKeys[ArgumentEnum::STOP_DAEMON], "Stop the daemon\n");
  this->tagsOption =
      new QCommandLineOption(this->argumentKeys[ArgumentEnum::TAGS],
                             "Provide tags to filter wallpaper search results"
                             "\nExample : --tags nature"
                             "\n           -t water,mountain\n",
                             "comma seperated tags");
  this->versionOption =
      new QCommandLineOption(this->argumentKeys[ArgumentEnum::VERSION],
                             "Displays version information\n");

  this->parser->addOption(*this->downloadOption);
  this->parser->addOption(*this->dirOption);
  this->parser->addOption(*this->helpOption);
  this->parser->addOption(*this->resolutionOption);
  this->parser->addOption(*this->refreshRateOption);
  this->parser->addOption(*this->saveOption);
  this->parser->addOption(*this->startDaemonOption);
  this->parser->addOption(*this->stopDaemonOption);
  this->parser->addOption(*this->tagsOption);
  this->parser->addOption(*this->versionOption);
  /**** //// END CREATE ARGUMENTS //// ****/
}

int ArgumentParser::process() {
  QStringList arguments = this->app->arguments();
  this->parser->parse(arguments);

  return this->parseArguments();
}

bool ArgumentParser::isStartDaemon() {
  return this->parser->isSet(*this->startDaemonOption);
}

bool ArgumentParser::isStopDaemon() {
  return this->parser->isSet(*this->stopDaemonOption);
}

bool ArgumentParser::showHelp() {
  return this->parser->isSet(*this->helpOption) ||
         this->parser->isSet(*this->versionOption);
}

bool ArgumentParser::testResolution(QString resolution) {
  QRegularExpression resolutionRegex("^\\d+x\\d+$");

  return resolutionRegex.match(resolution).hasMatch();
}

bool ArgumentParser::testRefreshRate(QString refreshRate) {
  QRegularExpression refreshRateRegex("^\\d+[MH]$");

  return refreshRateRegex.match(refreshRate).hasMatch();
}

bool ArgumentParser::testTags(QString tags) {
  QRegularExpression tagsRegex("\\w*,*");

  return tagsRegex.match(tags).hasMatch();
}

bool ArgumentParser::testDir(QString dirPath) {
  QDir dir(dirPath);

  if (!dir.exists()) {
    if (!dir.mkpath(".")) {
      return false;
    }
  }

  return true;
}

int ArgumentParser::parseArguments() {
  if (this->parser->isSet(*this->dirOption)) {
    QString dirPath = this->parser->value(*this->dirOption);

    if (this->testDir(dirPath)) {
      this->configHelper->set(ConfigEnum::DIR, dirPath);
    } else {
      this->commonUtils->sayError(
          "Error accessing directory. Check if you have correct permissions");
      return 1;
    }
  }
  if (this->parser->isSet(*this->resolutionOption)) {
    QString resolution = this->parser->value(*this->resolutionOption);
    if (this->testResolution(resolution)) {
      this->configHelper->set(ConfigEnum::RESOLUTION, resolution);
    } else {
      this->commonUtils->sayError(
          "Invalid Resolution. Input Resolution in the following format : "
          "widthxheight");
      return 1;
    }
  }
  if (this->parser->isSet(*this->refreshRateOption)) {
    QString refreshRate = this->parser->value(*this->refreshRateOption);

    if (this->testRefreshRate(refreshRate)) {
      this->configHelper->set(ConfigEnum::REFRESH_RATE, refreshRate);
    } else {
      this->commonUtils->sayError(
          "Invalid Refresh Rate. Input Refresh Rate in the following format : "
          "n[M|H]");
      return 1;
    }
  }
  if (this->parser->isSet(*this->tagsOption)) {
    QString tags = this->parser->value(*this->tagsOption);

    if (this->testTags(tags)) {
      this->configHelper->set(ConfigEnum::TAGS, tags);
    } else {
      this->commonUtils->sayError(
          "Invalid Tags Format. Input Tags as comma seperated values. Eg : "
          "nature,mountain");
      return 1;
    }
  }

  if (this->parser->isSet(*this->helpOption)) {
    this->parser->showHelp();
    return 0;
  }
  if (this->parser->isSet(*this->versionOption)) {
    this->parser->showVersion();
    return 0;
  }

  if (this->parser->isSet(*this->downloadOption)) {
    this->configHelper->set(ConfigEnum::DOWNLOAD, "true");
  }
  if (this->parser->isSet(*this->saveOption)) {
    this->configHelper->save();
  }

  QFile pidFile(
      QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) +
      "/paper.pid");
  pidFile.open(QIODevice::ReadOnly);

  if (pidFile.isReadable() && !this->showHelp() && this->isStartDaemon()) {
    this->commonUtils->sayError(
        "Daemon is already Running. To stop the running daemon run "
        "`paper --stop-daemon`.");

    exit(1);
  } else if (pidFile.isReadable() && !this->showHelp() &&
             !this->isStopDaemon()) {
    this->commonUtils->sayWarning(
        "Daemon is already Running. To stop the running daemon run "
        "`paper --stop-daemon`.");
    this->commonUtils->say("");
  }

  if (this->parser->isSet(*this->startDaemonOption)) {
    if (!this->parser->isSet(*this->refreshRateOption)) {
      this->commonUtils->sayError(
          "Invalid Options. --start-daemon is to be used with --refresh-rate "
          "option");

      return 1;
    }

    QStringList arguments = this->app->arguments();
    QString program = arguments[0];
    QProcess* process = new QProcess(this);
    qint64 pid;

    arguments.removeAt(0);
    arguments.removeAt(arguments.indexOf("--start-daemon"));

    process->setStandardOutputFile(QProcess::nullDevice());
    process->setStandardErrorFile(QProcess::nullDevice());
    process->setProgram(program);
    process->setArguments(arguments);
    process->setWorkingDirectory(QDir::currentPath());
    process->startDetached(&pid);

    QFile pidFile(
        QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) +
        "/paper.pid");
    pidFile.open(QIODevice::WriteOnly);
    pidFile.write(QVariant(pid).toString().toStdString().c_str());

    this->commonUtils->say("Daemon Initialized");
  }
  if (this->parser->isSet(*this->stopDaemonOption)) {
    QFile pidFile(
        QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) +
        "/paper.pid");
    pidFile.open(QIODevice::ReadWrite);

    QProcess::startDetached(
        "kill " + QString::fromStdString(pidFile.readAll().toStdString()));
    pidFile.remove();

    return 0;
  }

  if (this->configHelper->get(ConfigEnum::DIR) == "error" ||
      this->configHelper->get(ConfigEnum::RESOLUTION) == "error" ||
      this->configHelper->get(ConfigEnum::REFRESH_RATE) == "error" ||
      this->configHelper->get(ConfigEnum::TAGS) == "error") {
    return 1;
  }

  return 0;
}

repository: anupam-git/paper

repo_name: anupam-git/paper


text:
//
// Copyright © 2021 Kris Nóva <kris@nivenly.com>
//
// 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 codify

import (
	"bytes"
	"fmt"
	"text/template"
	"time"

	"github.com/kris-nova/logger"
	apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
)

type CustomResourceDefinition struct {
	KubeObject *apiextensionsv1.CustomResourceDefinition
	GoName     string
}

func NewCustomResourceDefinition(obj *apiextensionsv1.CustomResourceDefinition) *CustomResourceDefinition {

	obj.ObjectMeta = cleanObjectMeta(obj.ObjectMeta)
	if obj.Namespace == "" {
		obj.Namespace = "default"
	}
	return &CustomResourceDefinition{
		KubeObject: obj,
		GoName:     goName(obj.Name),
	}
}

func (k CustomResourceDefinition) Install() (string, []string) {
	c, err := Literal(k.KubeObject)
	if err != nil {
		logger.Debug(err.Error())
	}
	l := c.Source
	packages := c.Packages
	install := fmt.Sprintf(`
	{{ .GoName }}CustomResourceDefinition := %s
	x.objects = append(x.objects, {{ .GoName }}CustomResourceDefinition)

	if client != nil {
		result := client.ExtensionsV1beta1().RESTClient().Post().Namespace("{{ .KubeObject.Namespace }}").Body({{ .GoName }}CustomResourceDefinition).Do(context.TODO())
		if result.Error() != nil {
			return result.Error()
		}
	}
`, l)

	tpl := template.New(fmt.Sprintf("%s", time.Now().String()))
	tpl.Parse(install)
	buf := &bytes.Buffer{}
	k.KubeObject.Name = sanitizeK8sObjectName(k.KubeObject.Name)
	err = tpl.Execute(buf, k)
	if err != nil {
		logger.Debug(err.Error())
	}
	return alias(buf.String(), "apiextensionsv1"), packages
}

func (k CustomResourceDefinition) Uninstall() string {
	uninstall := `
	if client != nil {
		result := client.ExtensionsV1beta1().RESTClient().Delete().Namespace(a.Namespace).Name(a.Name).Do(context.TODO())
		if result.Error() != nil {
			return result.Error()
		}
	}
 `

	tpl := template.New(fmt.Sprintf("%s", time.Now().String()))
	tpl.Parse(uninstall)
	buf := &bytes.Buffer{}
	err := tpl.Execute(buf, k)
	if err != nil {
		logger.Debug(err.Error())
	}
	return buf.String()
}

repository: krisnova/naml

repo_name: krisnova/naml


text:
@article{pmid29921915,
 abstract = {The human leukocyte antigen (HLA) haplotype DRB1*15:01 is the major risk factor for multiple sclerosis (MS). Here, we find that DRB1*15:01 is hypomethylated and predominantly expressed in monocytes among carriers of DRB1*15:01. A differentially methylated region (DMR) encompassing HLA-DRB1 exon 2 is particularly affected and displays methylation-sensitive regulatory properties in vitro. Causal inference and Mendelian randomization provide evidence that HLA variants mediate risk for MS via changes in the HLA-DRB1 DMR that modify HLA-DRB1 expression. Meta-analysis of 14,259 cases and 171,347 controls confirms that these variants confer risk from DRB1*15:01 and also identifies a protective variant (rs9267649, p < 3.32 × 10-8, odds ratio = 0.86) after conditioning for all MS-associated variants in the region. rs9267649 is associated with increased DNA methylation at the HLA-DRB1 DMR and reduced expression of HLA-DRB1, suggesting a modulation of the DRB1*15:01 effect. Our integrative approach provides insights into the molecular mechanisms of MS susceptibility and suggests putative therapeutic strategies targeting a methylation-mediated regulation of the major risk gene.},
 author = {Kular, L.  and Liu, Y.  and Ruhrmann, S.  and Zheleznyakova, G.  and Marabita, F.  and Gomez-Cabrero, D.  and James, T.  and Ewing, E.  and Linden, M.  and Gornikiewicz, B.  and Aeinehband, S.  and Stridh, P.  and Link, J.  and Andlauer, T. F. M.  and Gasperi, C.  and Wiendl, H.  and Zipp, F.  and Gold, R.  and Tackenberg, B.  and Weber, F.  and Hemmer, B.  and Strauch, K.  and Heilmann-Heimbach, S.  and Rawal, R.  and Schminke, U.  and Schmidt, C. O.  and Kacprowski, T.  and Franke, A.  and Laudes, M.  and Dilthey, A. T.  and Celius, E. G.  and S?ndergaard, H. B.  and Tegner, J.  and Harbo, H. F.  and Oturai, A. B.  and Olafsson, S.  and Eggertsson, H. P.  and Halldorsson, B. V.  and Hjaltason, H.  and Olafsson, E.  and Jonsdottir, I.  and Stefansson, K.  and Olsson, T.  and Piehl, F.  and Ekstrom, T. J.  and Kockum, I.  and Feinberg, A. P.  and Jagodic, M. },
 doi = {10.1038/s41467-018-04732-5},
 journal = {Nat Commun},
 month = {Jun},
 note = {[PubMed Central:\hrefhttps://www.ncbi.nlm.nih.gov/pmc/articles/PMC6008330PMC6008330] [DOI:\hrefhttps://dx.doi.org/10.1038/s41467-018-04732-510.1038/s41467-018-04732-5] [PubMed:\hrefhttps://www.ncbi.nlm.nih.gov/pubmed/2536377925363779] },
 number = {1},
 pages = {2397},
 pmid = {25363779},
 title = {DNA methylation as a mediator of HLA-DRB1*15:01 and a protective variant in multiple sclerosis},
 volume = {9},
 year = {2018}
}

repository: compsysmed/website

path: /content/publication/Kular et al. 2018/pmid-29921915.bib

repo_name: compsysmed/website


text:
...	@(#)tmac.bib	4.1.1	(2.11BSD)	1996/10/23
.ds TL BIBLIOGRAPHY
.	\" HD - header macro
.de HD
.if t .tl '--''--'
.nr PN \\n%
'sp |.5i-1
.if \\n%>1 .tl ''- \\n(PN -''
'sp |1i
.ps
.ft
.vs
.ns
..
.	\" FT - footer macro
.de FT
.ps 10
.ft 1
.vs 12p
'bp
..
.so /usr/share/ms/s.acc
.wh 0 HD
.wh -1i FT
.if n .na
.if n .nr PD 1v
.if t .nr PD .5v
.nr PI 5n
.	\" RT -  reset everything to normal state
.de RT
.in 0
.ce 0
.ul 0
.ft 1
.ta 5n 10n 15n 20n 25n 30n 35n 40n 45n 50n 55n 60n 65n 70n 75n 80n
.fi
..
.	\" XP - exdented paragraph
.de XP
.if \\nV=1 .ls 2
.RT
.ne 3.1
.sp \\n(PDu
.in +\\n(PIu
.ti -\\n(PIu
..
.	\" AP - annotation paragraph
.de AP
.if \\nV=1 .ls 1
.RT
.ne 1.1
.sp \\n(PDu
.in +\\n(PIu
..
.	\" NP - numbered paragraph
.de NP
.if \\nV=1 .ls 2
.RT
.ne 3.1
.sp \\n(PDu
.in +\\n(PIu
.ti -\\n(PIu
.ta \\n(PIu
\\n+#.\t\c
..
.	\" refer macros for citations
.de []
.][ \\$1
..
.de ][
.if \\$1>4 .tm %M (Bell Labs Memorandum) undefined
.[\\$1
..
.if n .ds [o \&"
.if n .ds [c \&"
.if t .ds [o ``
.if t .ds [c ''
.	\" [0 - other type of citation
.de [0
.XP
.nr [: 0
.if !\\*([Q \{\
.nr [: 1
\\*([Q\c
.\}
.if !\\*([A \{\
.nr [: 1
\\*([A\c
.\}
.if !\\*([T \{\
.if \\n([:>0 ,
.nr [: 1
\f2\\*([T\f1\c
.\}
.if !\\*([S , \\*([S\c
.if !\\*([V , \\*([V\c
.if !\\*([P \{\
.ie \\n([P>0 , pp. \\*([P\c
.el , p. \\*([P\c
.\}
.if !\\*([C , \\*([C\c
.if !\\*([D , \\*([D\c
.if \\n([:>0 \&.
.if !\\*([O \\*([O
..
.	\" [1 - journal article
.de [1
.XP
.if !\\*([Q \\*([Q,
.if !\\*([A \\*([A,
.if !\\*([T \\*([o\\*([T,\\*([c
\f2\\*([J\f1\c
.if !\\*([V , vol. \\*([V\c
.if !\\*([N , no. \\*([N\c
.if !\\*([P \{\
.ie \\n([P>0 , pp. \\*([P\c
.el , p. \\*([P\c
.\}
.if !\\*([I , \\*([I\c
.if !\\*([C , \\*([C\c
.if !\\*([D , \\*([D\c
\&.
.if !\\*([O \\*([O
..
.	\" [2 - book
.de [2
.XP
.if !\\*([Q \\*([Q,
.if !\\*([A \\*([A,
.if !\\*([T \f2\\*([T,\f1
.if !\\*([S \\*([S,
.if !\\*([V \\*([V,
.if !\\*([P \{\
.ie \\n([P>0 pp. \\*([P,
.el p. \\*([P,
.\}
\\*([I\c
.if !\\*([C , \\*([C\c
.if !\\*([D , \\*([D\c
\&.
.if !\\*([O \\*([O
..
.	\" [3 - article in book
.de [3
.XP
.if !\\*([Q \\*([Q,
.if !\\*([A \\*([A,
.if !\\*([T \\*([o\\*([T,\\*([c
in \f2\\*([B\f1\c
.if !\\*([E , ed. \\*([E\c
.if !\\*([S , \\*([S\c
.if !\\*([V , vol. \\*([V\c
.if !\\*([P \{\
.ie \\n([P>0 , pp. \\*([P\c
.el , p. \\*([P\c
.\}
.if !\\*([I , \\*([I\c
.if !\\*([C , \\*([C\c
.if !\\*([D , \\*([D\c
\&.
.if !\\*([O \\*([O
..
.	\" [4 - report
.de [4
.XP
.if !\\*([Q \\*([Q,
.if !\\*([A \\*([A,
.if !\\*([T \\*([o\\*([T,\\*([c
.if !\\*([R \\*([R\c
.if !\\*([G \& (\\*([G)\c
.if !\\*([P \{\
.ie \\n([P>0 , pp. \\*([P\c
.el , p. \\*([P\c
.\}
.if !\\*([I , \\*([I\c
.if !\\*([C , \\*([C\c
.if !\\*([D , \\*([D\c
\&.
.if !\\*([O \\*([O
..
.de ]<
.[<
..
.de [<
.SH
References
.LP
.rm FS FE
..
.de [>
.]>
..
.de ]>
.sp
..
.de ]-
.[-
..
.de [-
.if !\\n(TL \{\
.	br	\" pseudo-page break
.	ce
\f2\\*(TL\f1
.	sp 2
.	nr TL 1
.\}
.rm [Q [A [T [J [B [E [S [V
.rm [N [P [I [C [D [O [R [G
..
.	\" command-line registers
.if \nN .nr # \nN-1 1
.if \nN .rn NP XP
.if \nV .ls \nV
.if \nL .ll \nLu
.if \nO .po \nOu


text:
/*
Copyright 2021 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 v1alpha1

import (
	"context"
	"time"

	"knative.dev/pkg/apis"
	"knative.dev/pkg/kmp"
)

// Validate verifies the ResetOffset and returns errors for any invalid fields.
func (ro *ResetOffset) Validate(ctx context.Context) *apis.FieldError {
	errs := ro.Spec.Validate(ctx).ViaField("spec")

	if apis.IsInUpdate(ctx) {
		original := apis.GetBaseline(ctx).(*ResetOffset)
		errs = errs.Also(ro.CheckImmutableFields(ctx, original))
	}

	return errs
}

// Validate verifies the ResetOffsetSpec and returns errors for an invalid fields.
func (ros *ResetOffsetSpec) Validate(ctx context.Context) *apis.FieldError {

	var errs *apis.FieldError

	// Validate The Offset String ("earliest", "latest", or valid date string)
	if !ros.IsOffsetEarliest() && !ros.IsOffsetLatest() {
		offsetTime, err := ros.ParseOffsetTime()
		if err != nil || offsetTime.After(time.Now()) {
			errs = errs.Also(apis.ErrInvalidValue(ros.Offset.Time, "offset"))
		}
	}

	// Validate The Ref KReference Basics (Kafka Topic relation which is expected to be done in Controllers!)
	errs = errs.Also(ros.Ref.Validate(ctx))

	return errs
}

// CheckImmutableFields verifies the immutable spec fields have not been changed from the original.
func (ro *ResetOffset) CheckImmutableFields(_ context.Context, original *ResetOffset) *apis.FieldError {
	if original == nil {
		return nil
	}

	if diff, err := kmp.ShortDiff(original.Spec, ro.Spec); err != nil {
		return &apis.FieldError{
			Message: "Failed to diff ResetOffset",
			Paths:   []string{"spec"},
			Details: err.Error(),
		}
	} else if diff != "" {
		return &apis.FieldError{
			Message: "Immutable fields changed (-old +new)",
			Paths:   []string{"spec"},
			Details: diff,
		}
	}

	return nil
}

repository: psschwei/eventing-kafka

repo_name: psschwei/eventing-kafka


text:
package logout

import (
	"github.com/pkg/errors"
	"github.com/spf13/cobra"

	"tushle"
	"tushle/cli/banks"
)

// NewLogoutCommand creates a new `tushle logout` command
func NewLogoutCommand(tushleCli tushle.Cli, banks *banks.Repository) *cobra.Command {
	return &cobra.Command{
		Use:   "logout [bank]",
		Short: "Logout from your bank account. Toshl is default bank.",
		RunE: func(cmd *cobra.Command, args []string) error {
			var b string
			if len(args) > 0 {
				b = args[0]
			}

			bank, err := banks.Available(b)
			if err != nil {
				return errors.WithStack(err)
			}

			return errors.WithStack(bank.Logout())
		},
	}
}

repository: andrazk/tushle

repo_name: andrazk/tushle


text:
---
---
@article{blakeney2021simon,
  title={Simon Says: Evaluating and Mitigating Bias in Pruned Neural Networks with Knowledge Distillation},
  author={Blakeney, Cody and Huish, Nathaniel and Yan, Yan and Zong, Ziliang},
  journal={arXiv preprint arXiv:2106.07849},
  year={2021},
  selected={true}
}

@article{blakeney2020parallel,
  title={Parallel blockwise knowledge distillation for deep neural network compression},
  author={Blakeney, Cody and Li, Xiaomin and Yan, Yan and Zong, Ziliang},
  journal={IEEE Transactions on Parallel and Distributed Systems},
  volume={32},
  number={7},
  pages={1765--1776},
  year={2020},
  publisher={IEEE},
  selected={true}
}

@inproceedings{blakeney2020craft,
  title={Craft distillation: Layer-wise convolutional neural network distillation},
  author={Blakeney, Cody and Li, Xiaomin and Yan, Yan and Zong, Ziliang},
  booktitle={2020 7th IEEE International Conference on Cyber Security and Cloud Computing (CSCloud)/2020 6th IEEE International Conference on Edge Computing and Scalable Cloud (EdgeCom)},
  pages={252--257},
  year={2020},
  organization={IEEE}
}

@inproceedings{li2020transfer,
  title={Transfer Learning with Fine-grained Sparse Networks: From an Efficient Network Perspective},
  author={Li, Xiaomin and Blakeney, Cody and Zong, Ziliang},
  booktitle={The Resource-Constrained Machine Learning Workshop in conjunction with IEEE Conference on Machine Learning and Systems (MLSys’ 20)},
  year={2020}
}

@inproceedings{blakeney2020pruning,
  title={Is pruning compression?: Investigating pruning via network layer similarity},
  author={Blakeney, Cody and Yan, Yan and Zong, Ziliang},
  booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},
  pages={914--922},
  year={2020},
  selected={true}
}

@article{mahajan2019improving,
  title={Improving the energy efficiency of relational and NoSQL databases via query optimizations},
  author={Mahajan, Divya and Blakeney, Cody and Zong, Ziliang},
  journal={Sustainable Computing: Informatics and Systems},
  volume={22},
  pages={120--133},
  year={2019},
  publisher={Elsevier}
}


text:
package schedule

import (
	"encoding/json"
	"log"
	"path"
	"runtime"
	"strings"

	"github.com/eikeon/scheduler"
	"github.com/nogiushi/marvin/nog"
)

var Root = ""

func init() {
	_, filename, _, _ := runtime.Caller(0)
	Root = path.Dir(filename)
}

type Schedule struct {
	Schedule scheduler.Schedule
}

func Handler(in <-chan nog.Message, out chan<- nog.Message) {
	out <- nog.Message{What: "started"}
	s := &Schedule{}
	var scheduledEventsChannel <-chan scheduler.Event

	go func() {
		out <- nog.Template("schedule")
	}()

	for {
		select {
		case e := <-scheduledEventsChannel:
			out <- nog.Message{What: e.What}
		case m, ok := <-in:
			if !ok {
				goto done
			}
			if m.Why == "statechanged" {
				dec := json.NewDecoder(strings.NewReader(m.What))
				if err := dec.Decode(s); err != nil {
					log.Println("schedule decode err:", err)
				}
				if scheduledEventsChannel == nil {
					if c, err := s.Schedule.Run(); err == nil {
						scheduledEventsChannel = c
					} else {
						log.Println("Warning: Scheduled events off:", err)
					}
				}
			}
		}
	}
done:
	out <- nog.Message{What: "stopped"}
	close(out)
}

repository: nogiushi/marvin

repo_name: nogiushi/marvin


text:
//                           _       _
// __      _____  __ ___   ___  __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
//  \ V  V /  __/ (_| |\ V /| | (_| | ||  __/
//   \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
//  Copyright © 2016 - 2023 Weaviate B.V. All rights reserved.
//
//  CONTACT: hello@weaviate.io
//

package asm

import (
	"reflect"
	"unsafe"
)

// To generate the asm code, run:
//   go install github.com/gorse-io/goat@v0.1.0
//   go generate

//go:generate goat ../c/l2_arm64.c -O3 -e="-mfpu=neon-fp-armv8" -e="-mfloat-abi=hard" -e="--target=arm64" -e="-march=armv8-a+simd+fp"

// L2 calculates the L2 distance between two vectors
// using SIMD instructions when possible.
// Vector lengths < 16 are handled by the Go implementation
// because the overhead of using reflection is too high.
func L2(x []float32, y []float32) float32 {
	switch len(x) {
	case 2:
		return l22(x, y)
	case 4:
		return l24(x, y)
	case 6:
		// manually inlined l26(x, y)
		diff := x[5] - y[5]
		sum := diff * diff

		diff = x[4] - y[4]
		sum += diff * diff

		return l24(x, y) + sum
	case 8:
		// manually inlined l28(x, y)
		diff := x[7] - y[7]
		sum := diff * diff

		diff = x[6] - y[6]
		sum += diff * diff

		diff = x[5] - y[5]
		sum += diff * diff

		diff = x[4] - y[4]
		sum += diff * diff

		return l24(x, y) + sum
	case 10:
		return l210(x, y)
	case 12:
		return l212(x, y)
	}

	// deal with odd lengths and lengths 13, 14, 15
	if len(x) < 16 {
		var sum float32

		for i := range x {
			diff := x[i] - y[i]
			sum += diff * diff
		}

		return sum
	}

	var res float32

	// The C function expects pointers to the underlying array, not slices.
	hdrx := (*reflect.SliceHeader)(unsafe.Pointer(&x))
	hdry := (*reflect.SliceHeader)(unsafe.Pointer(&y))

	l := len(x)
	l2(
		// The slice header contains the address of the underlying array.
		// We only need to cast it to a pointer.
		unsafe.Pointer(hdrx.Data),
		unsafe.Pointer(hdry.Data),
		// The C function expects pointers to the result and the length of the arrays.
		unsafe.Pointer(&res),
		unsafe.Pointer(&l))

	return res
}

repository: weaviate/weaviate

repo_name: weaviate/weaviate


text:
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: event.proto

package poset

import (
	fmt "fmt"
	peers "github.com/Fantom-foundation/go-lachesis/src/peers"
	proto "github.com/golang/protobuf/proto"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

type TransactionType int32

const (
	TransactionType_PEER_ADD    TransactionType = 0
	TransactionType_PEER_REMOVE TransactionType = 1
)

var TransactionType_name = map[int32]string{
	0: "PEER_ADD",
	1: "PEER_REMOVE",
}

var TransactionType_value = map[string]int32{
	"PEER_ADD":    0,
	"PEER_REMOVE": 1,
}

func (x TransactionType) String() string {
	return proto.EnumName(TransactionType_name, int32(x))
}

func (TransactionType) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_2d17a9d3f0ddf27e, []int{0}
}

type InternalTransaction struct {
	Type                 TransactionType `protobuf:"varint,1,opt,name=Type,proto3,enum=poset.TransactionType" json:"Type,omitempty"`
	Peer                 *peers.Peer     `protobuf:"bytes,2,opt,name=peer,proto3" json:"peer,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (m *InternalTransaction) Reset()         { *m = InternalTransaction{} }
func (m *InternalTransaction) String() string { return proto.CompactTextString(m) }
func (*InternalTransaction) ProtoMessage()    {}
func (*InternalTransaction) Descriptor() ([]byte, []int) {
	return fileDescriptor_2d17a9d3f0ddf27e, []int{0}
}

func (m *InternalTransaction) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_InternalTransaction.Unmarshal(m, b)
}
func (m *InternalTransaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_InternalTransaction.Marshal(b, m, deterministic)
}
func (m *InternalTransaction) XXX_Merge(src proto.Message) {
	xxx_messageInfo_InternalTransaction.Merge(m, src)
}
func (m *InternalTransaction) XXX_Size() int {
	return xxx_messageInfo_InternalTransaction.Size(m)
}
func (m *InternalTransaction) XXX_DiscardUnknown() {
	xxx_messageInfo_InternalTransaction.DiscardUnknown(m)
}

var xxx_messageInfo_InternalTransaction proto.InternalMessageInfo

func (m *InternalTransaction) GetType() TransactionType {
	if m != nil {
		return m.Type
	}
	return TransactionType_PEER_ADD
}

func (m *InternalTransaction) GetPeer() *peers.Peer {
	if m != nil {
		return m.Peer
	}
	return nil
}

type BlockSignature struct {
	Validator            []byte   `protobuf:"bytes,1,opt,name=Validator,proto3" json:"Validator,omitempty"`
	Index                int64    `protobuf:"varint,2,opt,name=Index,proto3" json:"Index,omitempty"`
	Signature            string   `protobuf:"bytes,3,opt,name=Signature,proto3" json:"Signature,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *BlockSignature) Reset()         { *m = BlockSignature{} }
func (m *BlockSignature) String() string { return proto.CompactTextString(m) }
func (*BlockSignature) ProtoMessage()    {}
func (*BlockSignature) Descriptor() ([]byte, []int) {
	return fileDescriptor_2d17a9d3f0ddf27e, []int{1}
}

func (m *BlockSignature) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_BlockSignature.Unmarshal(m, b)
}
func (m *BlockSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_BlockSignature.Marshal(b, m, deterministic)
}
func (m *BlockSignature) XXX_Merge(src proto.Message) {
	xxx_messageInfo_BlockSignature.Merge(m, src)
}
func (m *BlockSignature) XXX_Size() int {
	return xxx_messageInfo_BlockSignature.Size(m)
}
func (m *BlockSignature) XXX_DiscardUnknown() {
	xxx_messageInfo_BlockSignature.DiscardUnknown(m)
}

var xxx_messageInfo_BlockSignature proto.InternalMessageInfo

func (m *BlockSignature) GetValidator() []byte {
	if m != nil {
		return m.Validator
	}
	return nil
}

func (m *BlockSignature) GetIndex() int64 {
	if m != nil {
		return m.Index
	}
	return 0
}

func (m *BlockSignature) GetSignature() string {
	if m != nil {
		return m.Signature
	}
	return ""
}

type EventBody struct {
	Transactions         [][]byte               `protobuf:"bytes,1,rep,name=Transactions,proto3" json:"Transactions,omitempty"`
	InternalTransactions []*InternalTransaction `protobuf:"bytes,2,rep,name=InternalTransactions,proto3" json:"InternalTransactions,omitempty"`
	Parents              []string               `protobuf:"bytes,3,rep,name=Parents,proto3" json:"Parents,omitempty"`
	Creator              []byte                 `protobuf:"bytes,4,opt,name=Creator,proto3" json:"Creator,omitempty"`
	Index                int64                  `protobuf:"varint,5,opt,name=Index,proto3" json:"Index,omitempty"`
	BlockSignatures      []*BlockSignature      `protobuf:"bytes,6,rep,name=BlockSignatures,proto3" json:"BlockSignatures,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

func (m *EventBody) Reset()         { *m = EventBody{} }
func (m *EventBody) String() string { return proto.CompactTextString(m) }
func (*EventBody) ProtoMessage()    {}
func (*EventBody) Descriptor() ([]byte, []int) {
	return fileDescriptor_2d17a9d3f0ddf27e, []int{2}
}

func (m *EventBody) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_EventBody.Unmarshal(m, b)
}
func (m *EventBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_EventBody.Marshal(b, m, deterministic)
}
func (m *EventBody) XXX_Merge(src proto.Message) {
	xxx_messageInfo_EventBody.Merge(m, src)
}
func (m *EventBody) XXX_Size() int {
	return xxx_messageInfo_EventBody.Size(m)
}
func (m *EventBody) XXX_DiscardUnknown() {
	xxx_messageInfo_EventBody.DiscardUnknown(m)
}

var xxx_messageInfo_EventBody proto.InternalMessageInfo

func (m *EventBody) GetTransactions() [][]byte {
	if m != nil {
		return m.Transactions
	}
	return nil
}

func (m *EventBody) GetInternalTransactions() []*InternalTransaction {
	if m != nil {
		return m.InternalTransactions
	}
	return nil
}

func (m *EventBody) GetParents() []string {
	if m != nil {
		return m.Parents
	}
	return nil
}

func (m *EventBody) GetCreator() []byte {
	if m != nil {
		return m.Creator
	}
	return nil
}

func (m *EventBody) GetIndex() int64 {
	if m != nil {
		return m.Index
	}
	return 0
}

func (m *EventBody) GetBlockSignatures() []*BlockSignature {
	if m != nil {
		return m.BlockSignatures
	}
	return nil
}

type EventMessage struct {
	Body                 *EventBody `protobuf:"bytes,1,opt,name=Body,proto3" json:"Body,omitempty"`
	Signature            string     `protobuf:"bytes,2,opt,name=Signature,proto3" json:"Signature,omitempty"`
	FlagTable            []byte     `protobuf:"bytes,3,opt,name=FlagTable,proto3" json:"FlagTable,omitempty"`
	WitnessProof         []string   `protobuf:"bytes,4,rep,name=WitnessProof,proto3" json:"WitnessProof,omitempty"`
	XXX_NoUnkeyedLiteral struct{}   `json:"-"`
	XXX_unrecognized     []byte     `json:"-"`
	XXX_sizecache        int32      `json:"-"`
}

func (m *EventMessage) Reset()         { *m = EventMessage{} }
func (m *EventMessage) String() string { return proto.CompactTextString(m) }
func (*EventMessage) ProtoMessage()    {}
func (*EventMessage) Descriptor() ([]byte, []int) {
	return fileDescriptor_2d17a9d3f0ddf27e, []int{3}
}

func (m *EventMessage) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_EventMessage.Unmarshal(m, b)
}
func (m *EventMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_EventMessage.Marshal(b, m, deterministic)
}
func (m *EventMessage) XXX_Merge(src proto.Message) {
	xxx_messageInfo_EventMessage.Merge(m, src)
}
func (m *EventMessage) XXX_Size() int {
	return xxx_messageInfo_EventMessage.Size(m)
}
func (m *EventMessage) XXX_DiscardUnknown() {
	xxx_messageInfo_EventMessage.DiscardUnknown(m)
}

var xxx_messageInfo_EventMessage proto.InternalMessageInfo

func (m *EventMessage) GetBody() *EventBody {
	if m != nil {
		return m.Body
	}
	return nil
}

func (m *EventMessage) GetSignature() string {
	if m != nil {
		return m.Signature
	}
	return ""
}

func (m *EventMessage) GetFlagTable() []byte {
	if m != nil {
		return m.FlagTable
	}
	return nil
}

func (m *EventMessage) GetWitnessProof() []string {
	if m != nil {
		return m.WitnessProof
	}
	return nil
}

func init() {
	proto.RegisterEnum("poset.TransactionType", TransactionType_name, TransactionType_value)
	proto.RegisterType((*InternalTransaction)(nil), "poset.InternalTransaction")
	proto.RegisterType((*BlockSignature)(nil), "poset.BlockSignature")
	proto.RegisterType((*EventBody)(nil), "poset.EventBody")
	proto.RegisterType((*EventMessage)(nil), "poset.EventMessage")
}

func init() { proto.RegisterFile("event.proto", fileDescriptor_2d17a9d3f0ddf27e) }

var fileDescriptor_2d17a9d3f0ddf27e = []byte{
	// 422 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcf, 0x6f, 0xd3, 0x30,
	0x14, 0xc7, 0x49, 0x93, 0x0e, 0xfa, 0x12, 0xad, 0x95, 0x19, 0xc8, 0x9a, 0x90, 0x88, 0x22, 0x0e,
	0xd1, 0x0e, 0x29, 0x2a, 0xdc, 0x11, 0x63, 0x41, 0xda, 0x61, 0x50, 0x99, 0x6a, 0x1c, 0x91, 0x93,
	0x3e, 0xba, 0x40, 0xb0, 0x2b, 0xdb, 0x43, 0xec, 0x5f, 0xe0, 0xcc, 0x1f, 0x8c, 0xfc, 0xda, 0x2d,
	0x4d, 0xd5, 0x8b, 0xa5, 0xf7, 0xbe, 0xef, 0xd7, 0xf7, 0x23, 0x43, 0x8c, 0xbf, 0x51, 0xb9, 0x62,
	0x6d, 0xb4, 0xd3, 0x6c, 0xb8, 0xd6, 0x16, 0xdd, 0xe9, 0xdb, 0x55, 0xe3, 0x6e, 0x6e, 0xab, 0xa2,
	0xd6, 0xbf, 0xa6, 0x52, 0x2d, 0x0d, 0xd6, 0x46, 0xab, 0x1f, 0x38, 0x6d, 0x65, 0x7d, 0x83, 0xb6,
	0xb1, 0x53, 0x6b, 0xea, 0xe9, 0x1a, 0xd1, 0x58, 0x7a, 0x37, 0xcd, 0x59, 0x05, 0x4f, 0x2f, 0x95,
	0x43, 0xa3, 0x64, 0xbb, 0x30, 0x52, 0x59, 0x59, 0xbb, 0x46, 0x2b, 0x76, 0x06, 0xd1, 0xe2, 0x6e,
	0x8d, 0x3c, 0x48, 0x83, 0xfc, 0x78, 0xf6, 0xbc, 0xa0, 0x15, 0xc5, 0x4e, 0x85, 0x57, 0x05, 0xd5,
	0xb0, 0x97, 0x10, 0xf9, 0x81, 0x7c, 0x90, 0x06, 0x79, 0x3c, 0x8b, 0x0b, 0xda, 0x51, 0xcc, 0x11,
	0x8d, 0x20, 0x21, 0xab, 0xe0, 0xf8, 0xbc, 0xd5, 0xf5, 0xcf, 0x2f, 0xcd, 0x4a, 0x49, 0x77, 0x6b,
	0x90, 0xbd, 0x80, 0xd1, 0xb5, 0x6c, 0x9b, 0xa5, 0x74, 0xda, 0xd0, 0x8e, 0x44, 0x74, 0x09, 0x76,
	0x02, 0xc3, 0x4b, 0xb5, 0xc4, 0x3f, 0x34, 0x31, 0x14, 0x9b, 0xc0, 0xf7, 0x3c, 0x0c, 0xe0, 0x61,
	0x1a, 0xe4, 0x23, 0xd1, 0x25, 0xb2, 0xbf, 0x03, 0x18, 0x95, 0x1e, 0xca, 0xb9, 0x5e, 0xde, 0xb1,
	0x0c, 0x92, 0x9d, 0x5b, 0x2d, 0x0f, 0xd2, 0x30, 0x4f, 0x44, 0x2f, 0xc7, 0x3e, 0xc1, 0xc9, 0x01,
	0xe7, 0x96, 0x0f, 0xd2, 0x30, 0x8f, 0x67, 0xa7, 0x5b, 0xcb, 0x07, 0x4a, 0xc4, 0xc1, 0x3e, 0xc6,
	0xe1, 0xf1, 0x5c, 0x1a, 0x54, 0xce, 0xf2, 0x30, 0x0d, 0xf3, 0x91, 0xb8, 0x0f, 0xbd, 0xf2, 0xc1,
	0x20, 0x79, 0x8d, 0xc8, 0xeb, 0x7d, 0xd8, 0x39, 0x1d, 0xee, 0x3a, 0x7d, 0x07, 0xe3, 0x3e, 0x2f,
	0xcb, 0x8f, 0xe8, 0xa8, 0x67, 0xdb, 0xa3, 0xfa, 0xaa, 0xd8, 0xaf, 0xce, 0xfe, 0x05, 0x90, 0x10,
	0x8c, 0x2b, 0xb4, 0x56, 0xae, 0x90, 0xbd, 0x82, 0xc8, 0x73, 0x21, 0xd4, 0xf1, 0x6c, 0xb2, 0x1d,
	0xf3, 0xc0, 0x4b, 0x90, 0xda, 0x27, 0x3c, 0xd8, 0x23, 0xec, 0xd5, 0x8f, 0xad, 0x5c, 0x2d, 0x64,
	0xd5, 0x6e, 0xf8, 0x27, 0xa2, 0x4b, 0x78, 0xe2, 0x5f, 0x1b, 0xa7, 0xd0, 0xda, 0xb9, 0xd1, 0xfa,
	0x3b, 0x8f, 0x08, 0x41, 0x2f, 0x77, 0xf6, 0x1a, 0xc6, 0x7b, 0x3f, 0x88, 0x25, 0xf0, 0x64, 0x5e,
	0x96, 0xe2, 0xdb, 0xfb, 0x8b, 0x8b, 0xc9, 0x23, 0x36, 0x86, 0x98, 0x22, 0x51, 0x5e, 0x7d, 0xbe,
	0x2e, 0x27, 0x41, 0x75, 0x44, 0x9f, 0xf4, 0xcd, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x4a,
	0xf2, 0xf9, 0xf0, 0x02, 0x00, 0x00,
}

repository: BrianActon/lachesis

repo_name: BrianActon/lachesis


text:
DESCRIPTION = "LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution."
LICENSE = "MIT"
HOMEPAGE = "https://github.com/keplerproject/luafilesystem"
LIC_FILES_CHKSUM = "file://LICENSE;md5=d9b7e441d51a96b17511ee3be5a75857"

DEPENDS += "lua-native lua"

SRC_URI = "git://github.com/keplerproject/luafilesystem.git;branch=master \
           file://0001-build-patch.patch"

SRCREV = "7c6e1b013caec0602ca4796df3b1d7253a2dd258"
S = "${WORKDIR}/git"
LUA_VERSION = "5.3"

EXTRA_OEMAKE = "LUA_VERSION=${LUA_VERSION} PREFIX=${RECIPE_SYSROOT}/usr DESTDIR=${D}/usr"
CFLAGS_append = " -fPIC"

do_compile() {
    cd ${S}
    oe_runmake
}

do_install() {
    cd ${S}
    oe_runmake install
}

FILES_${PN} = "${libdir}/lua/${LUA_VERSION}/lfs.so"

INSANE_SKIP_${PN} += "ldflags"


text:
# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)

SUMMARY = "the blessed package to manage your versions by scm tags"
HOMEPAGE = "https://github.com/pypa/setuptools_scm/"
# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is
# your responsibility to verify that the values are complete and correct.
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=838c366f69b72c5df05c96dff79b35f2"

SRC_URI = "https://files.pythonhosted.org/packages/cd/66/fa77e809b7cb1c2e14b48c7fc8a8cd657a27f4f9abb848df0c967b6e4e11/setuptools_scm-${PV}.tar.gz"
SRC_URI[md5sum] = "e6c9fad17c90516d640868eb833d5150"
SRC_URI[sha256sum] = "a8994582e716ec690f33fec70cca0f85bd23ec974e3f783233e4879090a7faa8"

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

inherit setuptools3

# WARNING: the following rdepends are determined through basic analysis of the
# python sources, and might not be 100% accurate.
RDEPENDS_${PN} += "python3-core"


text:
vcpkg_from_github(
  OUT_SOURCE_PATH SOURCE_PATH
  REPO jellycat-io/jelly
  REF v0.0.1
  SHA512 630afc80626368507101d1eee3213c34294f1227d8589e091e30cf68b36f6ba10e0f9489c7ac87dac3afc266e851c1b694e8bf2dd3bf1b35b6ff1904e1df9915
  HEAD_REF main
)

vcpkg_configure_cmake(
  SOURCE_PATH "${SOURCE_PATH}"
  PREFER_NINJA
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR/debug/include}")

file(
  INSTALL "${SOURCE_PATH}/LICENSE"
  DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
  RENAME copyright
)

repository: jellycat-io/vcpkg-registry

repo_name: jellycat-io/vcpkg-registry


text:
// DailyGakki - scheduler
// 2020-10-17 14:03
// Benny <benny.think@gmail.com>

package main

import (
	log "github.com/sirupsen/logrus"
	tb "gopkg.in/tucnak/telebot.v2"
	"time"
)

func scheduler() {
	log.Infoln("Start scheduler...")
	sendList := readJSON()
	log.Infof("Total count: %d", len(sendList))

	for _, v := range sendList {
		log.Infof("Send message to: %d", v.ChatId)

		m := tb.Message{
			Sender: &tb.User{ID: int(v.ChatId)},
		}
		time.Sleep(time.Second * 30)
		_ = b.Notify(m.Sender, tb.Typing)
		sendAlbum := generatePhotos()
		_ = b.Notify(m.Sender, tb.UploadingPhoto)
		_, _ = b.SendAlbum(m.Sender, sendAlbum)
	}

}