text:
%%
%% Author: TobiasAcc
%% 1/7/2019
%%
@misc{NDeskAnnouncement,
 author = "Jonathan Pryor",
 title = "So you want to parse a command line...",
 year = "2008",
 url = "http://www.jprl.com/Blog/archive/development/mono/2008/Jan-07.html"
}
@misc{NDesk1stRelease,
 author = "Jonathan Pryorr",
 title = "Announcing NDesk.Options 0.1.0",
 year = "2008",
 url = "http://www.jprl.com/Blog/archive/development/ndesk.options/2008/Jan-27.html"
}
@misc{MonoGetOptions3rdBlogPost,
 author = "Jay R. Wren",
 title = ".NET Command Line Options – Mono.GetOptions",
 year = "2006",
 url = "http://jrwren.wrenfam.com/blog/2006/12/04/net-command-line-options-monogetoptions/index.html"
}
@misc{NDeskOptionSetDocumentation,
 author = "Jonathan Pryorr",
 title = "OptionSet Class",
 year = "2008",
 url = "http://www.ndesk.org/doc/ndesk-options/NDesk.Options/OptionSet.html"
}
@misc{NDeskOptionsLastRelease,
 author = "Jonathan Pryorr",
 title = "Announcing NDesk.Options 0.2.1",
 year = "2008",
 url = "http://www.jprl.com/Blog/archive/development/ndesk.options/2008/Oct-20.html"
}
@misc{MonoOptions1stCommit,
 author = "Jonathan Pryorr",
 title = "Add Mono.Options, a command-line helper library.",
 year = "2008",
 url = "https://github.com/mono/mono/commit/3e206c47dd768dc64edd5631c3f93c4888197d90"
}
@misc{MonoFutureInterview,
 author = "John K. Waters",
 title = "Interview with Miguel de Icaza: Xamarin, Attachmate Layoffs, Future of Mono, More",
 year = "2011",
 url = "https://adtmag.com/blogs/watersworks/2011/05/interview-with-miguel-de-icaza.aspx"
}
@misc{MicrosoftBlogAcquireXamarin,
 author = "Scott Guthrie",
 title = "Microsoft to acquire Xamarin and empower more developers to build apps on any device",
 year = "2016",
 url = "https://blogs.microsoft.com/blog/2016/02/24/microsoft-to-acquire-xamarin-and-empower-more-developers-to-build-apps-on-any-device/"
}
@misc{MonoOptionsNuget,
 author = "Xamarin",
 title = "Mono.Options - nuget.org",
 year = "2012",
 url = "https://www.nuget.org/packages/Mono.Options"
}
@misc{FirstCommandLineParserCommit,
 author = "Giacomo Stelluti Scala",
 title = "first git commit",
 year = "2012",
 url = "https://github.com/gsscoder/commandline/commit/499d9e054c84f7ea857c72b93bb08f40619ace822"
}
@misc{CommandLineParserNuget,
 author = "Giacomo Stelluti Scala",
 title = "CommandLineParser - nuget.org",
 year = "2019",
 url = "https://www.nuget.org/packages/CommandLineParser"
}
@misc{CommandLineParserWiki,
 author = "Eric Newton",
 title = "CommandLineParser Wiki",
 year = "2019",
 url = "https://github.com/commandlineparser/commandline/wiki"
}
@misc{RaspiConfigOfficialInfo,
 author = "Raspberry Pi Foundation",
 title = "raspi-config",
 year = "2018",
 url = "https://www.raspberrypi.org/documentation/configuration/raspi-config.md"
}
@misc{NetReleaseInfo,
 author = "Microsoft DOS net command",
 title = "Computer Hope",
 year = "2018",
 url = "https://www.computerhope.com/nethlp.htm"
}
@misc{WMIProgrammingBlogPost,
 author = "Dan Fox",
 title = "Programming with Windows Management Instrumentation",
 year = "2000",
 url = "http://www.informit.com/articles/printerfriendly/19489" }
@misc{NubiaReleaseBlogPost,
 url = "https://blog.hackersonlineclub.com/2018/09/nubia-command-line-and-interactive.html",
 title = "NUBIA- A Command-line And Interactive Shell Framework",
 author = "Priyanshu Sahay",
 year = "2018",
}
@misc{NubiaReadme,
 author = "Madelyn Eriksen",
 url = "https://github.com/facebookincubator/python-nubia/blob/master/README.md",
 title = "python-nubia/README.md",
 year = "2018",
}
@manual{JSONSpec,
    title = {The JSON Data Interchange Syntax},
 year = 2017,
  url = "https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf",
 author = "Ecma International",
}
@misc{PropOrFieldSite,
 author = "Tobias Brohl",
 year = 2018,
 title = "PropertyOrFieldInfo",
 url = "https://theminefighter.github.io/PropertyOrFieldInfo/",
}
@misc{JsonNetSite,
 author = "James Newton-King",
 url = "https://www.newtonsoft.com/json",
 title = "Json.NET - Popular high-performance JSON framework for .NET",
}
@misc{AnnotationsNuget,
 url = "https://www.nuget.org/packages/JetBrains.Annotations/",
 author = JetBrains,
 year = 2019,
 title = "JetBrains ReSharper Annotations",
}
@manual{XunitReleaseNotes,
    title = {Release Notes: October 28, 2018},
 url = "https://xunit.github.io/releases/2.4.1",
 year = 2018,
 author = ".Net Foundation",
}
@manual{BashAutoComplete,
    title = {An introduction to bash completion},
 url = "https://debian-administration.org/article/316/An_introduction_to_bash_completion_part_1",
 author = "Steve Kemp",
 year = 2005,
}
@manual{CustomCmdlet,
    title = {How to Write a Custom PowerShell Cmdlet},
 author = "ByteBlocks",
 year = 2009,
 url = "https://www.codeproject.com/Articles/32999/H",
}
@manual{LinuxUnicode,
    title = {Introduction to Unicode — Using Unicode in Linux},
 year = 2004,
 url = "https://michal.kosmulski.org/computing/articles/linux-unicode.html",
 author = "Michał Kosmulski",
}

repository: TheMinefighter/UniversalCLIProvider

repo_name: TheMinefighter/UniversalCLIProvider

gha_language: C#


text:
SUMMARY = "Add Qt5 bin dir to PATH"

LICENSE = "GPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"

SRC_URI = "file://qt5-env.sh"

S = "${WORKDIR}"

HAS_X11 = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 1, 0, d)}"
HAS_LVDS7 = "${@bb.utils.contains('VIDEO_OUTPUT', 'lvds7', 1, 0, d)}"

do_install() {
    install -d ${D}${sysconfdir}/profile.d
    install -m 0755 qt5-env.sh ${D}${sysconfdir}/profile.d

    if test ${HAS_X11} -eq 0; then
            cat >> ${D}${sysconfdir}/profile.d/qt5-env.sh <<EOF

# QT_QPA_PLATFORM There are multiple platform plugins that are
# potentially usable on Embedded Linux systems: EGLFS, LinuxFB, KMS,
# DirectFB, Wayland. The availability of these depend on the
# configuration of Qt. The default platform plugin is also device
# specific. For instance, on many boards eglfs will be chosen as the
# default one. If the default is not suitable, the QT_QPA_PLATFORM
# environment variable parameter can be used to request another plugin.
# Alternatively, for quick tests, the -platform command-line can be
# used with the same syntax.
export QT_QPA_PLATFORM=eglfs
EOF
    fi

    if test ${HAS_LVDS7} -eq 1; then
            cat >> ${D}${sysconfdir}/profile.d/qt5-env.sh <<EOF

# QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT
# - Physical screen width and height in millimeters. On platforms
# where the framebuffer device /dev/fb0 is not available or the
# query is not successful, the values are calculated based on a
# default DPI of 100. This variable can be used to override any
# such defaults.
export QT_QPA_EGLFS_PHYSICAL_HEIGHT=91
export QT_QPA_EGLFS_PHYSICAL_WIDTH=152
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1:inverty
EOF
    else
            cat >> ${D}${sysconfdir}/profile.d/qt5-env.sh <<EOF

# QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT
# - Physical screen width and height in millimeters. On platforms
# where the framebuffer device /dev/fb0 is not available or the
# query is not successful, the values are calculated based on a
# default DPI of 100. This variable can be used to override any
# such defaults.
#export QT_QPA_EGLFS_PHYSICAL_HEIGHT=91
#export QT_QPA_EGLFS_PHYSICAL_WIDTH=152
#export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS=/dev/input/event1:inverty
EOF

    fi

}

FILES_${PN} = "${sysconfdir}"

license: MIT

repository: graugans/meta-udoo

license_type: permissive

repo_name: graugans/meta-udoo

branch_name: refs/heads/morty

gha_license_id: MIT

gha_language: BitBake

extension: bb


text:
package amf

import (
	"encoding/binary"
	"fmt"
	"io"
	"reflect"
	"time"
)

type Decoder struct {
	VerboseLog bool

	TraitsMapper *TraitsMapper

	reader io.Reader

	stringRefs refTable
	objectRefs refTable
	traitsRefs refTable
}

type ExternalizeReadable interface {
	ReadExternal(d *Decoder) error
}

func NewDecoder(reader io.Reader) *Decoder {
	return &Decoder{
		reader: reader,
	}
}

func (d *Decoder) Decode(objptr interface{}) error {
	return d.ReadValue(objptr)
}

func (d *Decoder) GetReader() io.Reader {
	return d.reader
}

func (d *Decoder) ReadUInt8() (uint8, error) {
	b := []byte{0}
	_, err := d.reader.Read(b)
	return b[0], err
}

func (d *Decoder) ReadUInt29() (uint32, error) {
	var v uint32
	for j := 0; j < 3; j++ {
		b, err := d.ReadUInt8()
		if err != nil {
			return 0, err
		}
		v = (v << 7) | (uint32(b) & 0x7F)
		if (b & 0x80) != 0x80 {
			return v, nil
		}
	}
	b, err := d.ReadUInt8()
	if err != nil {
		return 0, err
	}
	v = (v << 8) | uint32(b)
	return v, err
}

func (d *Decoder) ReadString() (string, error) {
	length, err := d.ReadUInt29()
	if err != nil {
		return "", err
	}
	if (length & 1) == 0 {
		if v, err := d.stringRefs.Get(int(length >> 1)); err != nil {
			return "", nil
		} else {
			return v.(string), nil
		}
	}
	length >>= 1
	buf := make([]byte, length, length)
	if read, err := d.reader.Read(buf); err != nil || uint32(read) < length {
		return "", fmt.Errorf("Cannot read %d byte from reader", length)
	}
	str := string(buf)
	if length > 0 {
		d.stringRefs.Add(str)
	}
	return str, nil
}

func (d *Decoder) ReadValue(vptr interface{}) error {
	marker, err := d.ReadUInt8()
	if err != nil {
		return err
	}

	switch Marker(marker) {
	case MarkerArray:
		return d.ReadArray(vptr)
	case MarkerObject:
		return d.ReadObject(vptr)
	}

	v := reflect.ValueOf(vptr)
	if v.Kind() != reflect.Ptr {
		panic("Must pass a pointer")
	}
	if v.IsNil() {
		v.Set(reflect.New(v.Type().Elem()))
	}
	v = v.Elem()

	switch Marker(marker) {
	case MarkerUndefined:
		switch v.Kind() {
		case reflect.Interface, reflect.Ptr:
			return setReflectValue(v, &AMF3Undefined{})
		default:
			return fmt.Errorf("Read Undefined: Incompatible type")
		}
	case MarkerNull:
		v.Set(reflect.New(v.Type()).Elem())
		return nil
	case MarkerFalse:
		return setReflectValue(v, false)
	case MarkerTrue:
		return setReflectValue(v, true)
	case MarkerInteger:
		i, err := d.ReadUInt29()
		if err != nil {
			return err
		}
		// TODO sign extension
		return setReflectValue(v, i)
	case MarkerDouble:
		var f float64
		if err := binary.Read(d.reader, binary.BigEndian, &f); err != nil {
			return err
		}
		return setReflectValue(v, f)
	case MarkerString:
		str, err := d.ReadString()
		if err != nil {
			return err
		}
		return setReflectValue(v, str)
	case MarkerDate:
		ref, err := d.ReadUInt29()
		if err != nil {
			return err
		}
		if ref&1 == 0 {
			if val, err := d.objectRefs.Get(int(ref >> 1)); err != nil {
				return err
			} else {
				return setReflectValue(v, val)
			}
		} else {
			var f float64
			if err := binary.Read(d.reader, binary.BigEndian, &f); err != nil {
				return err
			}
			msecs := int64(f)
			nsecs := 1e6*(msecs%1000) + int64(1e6*(f-float64(msecs)))
			t := time.Unix(msecs/1000, nsecs)
			d.objectRefs.Add(t)
			return setReflectValue(v, t)
		}
	case MarkerXMLDoc:
		// TODO
	case MarkerXML:
		// TODO
	case MarkerByteArray:
		// TODO
	}

	return fmt.Errorf("Unhandled marker: %d", marker)
}

func (d *Decoder) ReadArray(vptr interface{}) error {
	v := reflect.ValueOf(vptr)
	if v.Kind() != reflect.Ptr {
		return fmt.Errorf("vptr must be a pointer")
	}
	v = v.Elem()
	if !v.CanSet() {
		panic("ReadObject: v must be settable")
	}

	length, err := d.ReadUInt29()
	if err != nil {
		return err
	}
	if (length & 1) == 0 {
		if val, err := d.objectRefs.Get(int(length >> 1)); err != nil {
			return err
		} else {
			return setReflectValue(v, val)
		}
	}
	length >>= 1

	if v.IsNil() {
		if err := createReflectObject(v, reflect.TypeOf(TypedObject{})); err != nil {
			return err
		}
	}

	d.objectRefs.Add(v.Interface())

	tobj, isTypedObject := v.Interface().(*TypedObject)
	assocCappable, arrayCappable := false, false
	switch v.Kind() {
	case reflect.Map:
		assocCappable = true
	case reflect.Slice:
		arrayCappable = true
	}
	d.logPrintln("ReadArray to", v.Type(), "isTypedObject", isTypedObject, "assocCappable", assocCappable, "arrayCappable", arrayCappable)

readMemberLoop:
	for {
		key, err := d.ReadString()
		switch {
		case err != nil:
			return err
		case len(key) == 0:
			break readMemberLoop
		}

		if isTypedObject {
			var val interface{}
			if err := d.ReadValue(&val); err != nil {
				return err
			}
			tobj.Assoc[key] = val
		} else {
			var val interface{}
			if err := createReflectObject(reflect.ValueOf(&val).Elem(), v.Type().Elem()); err != nil {
				return err
			}
			vrefl := reflect.ValueOf(val)
			if vrefl.Kind() != reflect.Ptr {
				vrefl = vrefl.Addr()
			}
			if err := d.ReadValue(vrefl.Interface()); err != nil {
				return err
			}
			if assocCappable {
				v.SetMapIndex(reflect.ValueOf(key), reflectResolveType(v.Type().Elem().Kind(), reflect.ValueOf(val)))
			} else {
				d.logPrintln("Ignore key", key)
			}
		}
	}
	for i := 0; i < int(length); i++ {
		if isTypedObject {
			var val interface{}
			if err := d.ReadValue(&val); err != nil {
				return err
			}
			tobj.Array = append(tobj.Array, val)
		} else {
			var val interface{}
			if err := createReflectObject(reflect.ValueOf(&val).Elem(), v.Type().Elem()); err != nil {
				return err
			}
			vrefl := reflect.ValueOf(val)
			d.logPrintln("vrefl", vrefl.Interface(), "Type", vrefl.Type())
			if vrefl.Kind() != reflect.Ptr {
				vrefl = vrefl.Addr()
			}
			if err := d.ReadValue(vrefl.Interface()); err != nil {
				return err
			}
			if arrayCappable {
				v.Set(reflect.Append(v, reflectResolveType(v.Type().Elem().Kind(), reflect.ValueOf(val))))
			} else {
				d.logPrintln("Ignore index", i)
			}
		}
	}
	return nil
}

func (d *Decoder) ReadObject(vptr interface{}) error {
	v := reflect.ValueOf(vptr)
	if v.Kind() != reflect.Ptr {
		return fmt.Errorf("vptr must be a pointer")
	}
	v = v.Elem()

	ref, err := d.ReadUInt29()
	if err != nil {
		return err
	}

	// Handle reference to object
	if (ref & 1) == 0 {
		if val, err := d.objectRefs.Get(int(ref >> 1)); err != nil {
			return err
		} else {
			return setReflectValue(v, val)
		}
	}

	// Read object traits or find from reference
	var traits *Traits
	if (ref & 3) == 1 {
		if t, err := d.traitsRefs.Get(int(ref >> 2)); err != nil {
			return err
		} else {
			traits = t.(*Traits)
			d.logPrintln("Traits ref: class="+traits.ClassName, "members=", traits.Members)
		}
	} else {
		traits = &Traits{}

		if (ref & 7) == 7 {
			traits.External = true
		} else {
			traits.Dynamic = (ref>>3)&1 == 1
			traits.Nmemb = int(ref >> 4)
		}

		cls, err := d.ReadString()
		if err != nil {
			return err
		}
		traits.ClassName = cls

		for i := 0; i < traits.Nmemb; i++ {
			key, err := d.ReadString()
			if err != nil {
				return err
			}
			traits.Members = append(traits.Members, key)
		}

		d.traitsRefs.Add(traits)
	}

	switch v.Kind() {
	case reflect.Interface, reflect.Ptr:
		if v.IsNil() {
			if err := setReflectValue(v, d.createObject(traits.ClassName)); err != nil {
				return err
			}
			if v.Kind() == reflect.Interface {
				v = v.Elem()
			}
			if v.Kind() == reflect.Ptr {
				v = v.Elem()
			}
			d.logPrintln("Initialized value for object", traits.ClassName, "Type", v.Type())
		}
	default:
		v.Set(reflect.New(v.Type()).Elem())
		d.logPrintln("Set zero value for object", traits.ClassName, "Type", v.Type())
	}
	if v.Kind() == reflect.Ptr {
		panic("Must be resolved")
	}

	d.objectRefs.Add(v.Interface())

	d.logPrintln("Object Traits", traits)
	// Handle external object
	if traits.External {
		refobj := d.objectRefs.Reserve()
		if err := d.readExternalObject(traits, vptr); err != nil {
			return err
		}
		*refobj = v
		return nil
	}

	switch tobj := v.Interface().(type) {
	case TypedObject:
		d.logPrintln("ReadObject: reading into TypedObject")
		for _, key := range traits.Members {
			var val interface{}
			if err := d.ReadValue(&val); err != nil {
				return err
			}
			d.logPrintln("Read key", key, "value", val)
			tobj.Assoc[key] = val
		}
		if traits.Dynamic {
		readDyanmicLoopTO:
			for {
				var val interface{}
				key, err := d.ReadString()
				switch {
				case err != nil:
					return err
				case len(key) == 0:
					break readDyanmicLoopTO
				default:
					if err := d.ReadValue(&val); err != nil {
						return err
					}
					d.logPrintln("Read dynamic key", key, "value", val)
					tobj.Assoc[key] = val
				}
			}
		}
		d.logPrintln("Read TypedObject:", tobj)
	default:
		for _, key := range traits.Members {
			if _, err := d.readObjectField(v, key); err != nil {
				return err
			}
		}
		if traits.Dynamic {
		readDyanmicLoop:
			for {
				key, err := d.ReadString()
				switch {
				case err != nil:
					return err
				case len(key) == 0:
					break readDyanmicLoop
				default:
					if ignored, err := d.readObjectField(v, key); err != nil {
						return err
					} else if ignored {
						d.logPrintln("ignore key", key, "in class", traits.ClassName)
					}
				}
			}
		}
	}

	return nil
}

func (d *Decoder) readObjectField(v reflect.Value, key string) (ignored bool, err error) {
	if !v.CanSet() {
		panic("readObjectField: v must be settable")
	}

	var field reflect.Value

	switch v.Kind() {
	case reflect.Map:
		if v.IsNil() {
			v.Set(reflect.MakeMap(v.Type()))
		}
		elemType := v.Type().Elem()
		if elemType.Kind() == reflect.Ptr {
			field = reflect.New(elemType.Elem())
		} else {
			field = reflect.New(elemType)
		}

	default:
		field = findFieldByName(v, key)

		if !field.IsValid() {
			var tmpobj interface{}
			field = reflect.ValueOf(&tmpobj).Elem()
			d.logPrintln("Prepared dummy value for non-exist key", key)
			ignored = true
		}
		if !field.CanSet() {
			d.logPrintln("v.Type()", v.Type())
			d.logPrintln("field.Type():", field.Type())
			panic("field not settable")
		}
		d.logPrintln("Original field type", field.Type())
		if field.Kind() == reflect.Ptr {
			if field.IsNil() {
				if err = createReflectObject(field, field.Type().Elem()); err != nil {
					return
				}
			}
		} else {
			field = field.Addr()
		}
	}

	err = d.ReadValue(field.Interface())
	d.logPrintln("Read field key", key, "type", field.Type(), "value", field.Elem().Interface())

	if v.Kind() == reflect.Map {
		if v.Type().Elem().Kind() != reflect.Ptr {
			field = field.Elem()
		}
		v.SetMapIndex(reflect.ValueOf(key), field)
	}

	return
}

func (d *Decoder) readExternalObject(traits *Traits, vptr interface{}) error {
	switch traits.ClassName {
	case "flex.messaging.io.ArrayCollection":
		return d.ReadValue(vptr)
	}
	obj := d.createObject(traits.ClassName)
	if extobj, ok := obj.(ExternalizeReadable); ok {
		return extobj.ReadExternal(d)
	}
	return fmt.Errorf("External object not implemented: class=%s", traits.ClassName)
}

func (d *Decoder) createObject(className string) interface{} {
	mapper := DefaultTraitsMapper
	if d.TraitsMapper != nil {
		mapper = d.TraitsMapper
	}
	if dt := mapper.FindByClassName(className); dt != nil {
		return reflect.New(dt.Type).Interface()
	}
	return &TypedObject{
		Assoc: make(map[string]interface{}),
		Array: make([]interface{}, 0, 0),
	}
}

func (d *Decoder) logPrintln(objs ...interface{}) {
	if d.VerboseLog || Debug {
		fmt.Println(objs...)
	}
}

branch_name: refs/heads/master

extension: go


text:
package controller

import (
	"fmt"
	"io/ioutil"
	"strings"

	"github.com/anish-krishnan/Tidepod/tidepod-server/entity"
	"github.com/anish-krishnan/Tidepod/tidepod-server/store"
	"gorm.io/driver/sqlite"
	"gorm.io/gorm"
)

// MyStore is a global storage reference for all controllers
var MyStore store.Store

func init() {
	db := initGORM()
	migrateDatabases(db)

	MyStore = &store.DBStore{DB: db}
}

// Read labels from text file and output a string array
func readLabels(labelsFile string) ([]string, error) {
	fileBytes, err := ioutil.ReadFile(labelsFile)
	if err != nil {
		return nil, fmt.Errorf("Unable to read labels file: %v", err)
	}

	return strings.Split(string(fileBytes), "\n"), nil
}

func initGORM() *gorm.DB {
	db, err := gorm.Open(sqlite.Open("test.db"), &gorm.Config{})
	if err != nil {
		panic("failed to connect database")
	}
	return db
}

func migrateDatabases(db *gorm.DB) {
	db.AutoMigrate(&entity.Joke{})
	db.AutoMigrate(&entity.Photo{})

	db.Migrator().DropTable(&entity.Label{})
	db.AutoMigrate(&entity.Label{})

	db.AutoMigrate(&entity.Face{})
	db.AutoMigrate(&entity.Box{})

	labels, err := readLabels("workflow/object_detection/ssd_mobilenet_v1_coco_2018_01_28/saved_model/labels.txt")
	if err != nil {
		panic(err)
	}

	for _, s := range labels {
		db.Create(&entity.Label{LabelName: s})
	}
}

repository: anish-krishnan/Tidepod

repo_name: anish-krishnan/Tidepod

branch_name: refs/heads/main

gha_language: Go


text:
# https://github.com/xianyi/OpenBLAS.git

### IMPORT ###
dk_import(https://github.com/xianyi/OpenBLAS.git BRANCH develop)

### LINK ###
dk_include				(${OPENBLAS})
UNIX_dk_libDebug		(${OPENBLAS}/${OS}/${DEBUG_DIR}/libopenblas.a)
UNIX_dk_libRelease		(${OPENBLAS}/${OS}/${RELEASE_DIR}/libopenblas.a)
WIN_dk_libDebug			(${OPENBLAS}/${OS}/lib/DEBUG/openblas.lib)
WIN_dk_libRelease		(${OPENBLAS}/${OS}/lib/RELEASE/openblas.lib)

### 3RDPARTY LINK ###
#dk_set(OPENBLAS_CMAKE ???) # TODO

### GENERATE ###
dk_queueCommand(${DKCMAKE_BUILD} ${OPENBLAS})

### COMPILE ###
dk_build(${OPENBLAS})

repository: aquawicket/DigitalKnob

repo_name: aquawicket/DigitalKnob

extension: cmake


text:
#
# Copyright 2017-2018 Dynatrace LLC
#
# 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.
#

cmake_policy(PUSH)
cmake_policy(VERSION 2.8.12)
cmake_minimum_required(VERSION 2.8.12)

include(CheckLibraryExists)
include(CheckSymbolExists)

include("${CMAKE_CURRENT_LIST_DIR}/onesdk-version.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/onesdk-platform.cmake")

get_filename_component(onesdk_path "${CMAKE_CURRENT_LIST_FILE}" PATH)

# define platform dependent strings
if (onesdk_platform MATCHES "windows")
    set(onesdk_lib_prefix "")
    set(onesdk_linklib_suffix ".lib")
    set(onesdk_shlib_suffix ".dll")
    set(onesdk_implib_suffix ".lib")
elseif (onesdk_platform MATCHES "linux" OR onesdk_platform MATCHES "sunos")
    set(onesdk_lib_prefix "lib")
    set(onesdk_linklib_suffix ".a")
    set(onesdk_shlib_suffix ".so")
    set(onesdk_implib_suffix OFF)
else ()
    message(FATAL_ERROR "ONESDK: Unsupported onesdk_platform (${onesdk_platform})")
endif ()

set(onesdk_shlib_name "${onesdk_lib_prefix}onesdk_shared${onesdk_shlib_suffix}")
if (UNIX)
    set(onesdk_shlib_soname "${onesdk_shlib_name}")
endif ()

set(onesdk_lib_path "${onesdk_path}/${onesdk_lib_subdir}")

# find out what we need to link for pthreads functions

if (UNIX)
    set(ONESDK_SAVE_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
    set(ONESDK_SAVE_CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS})
    set(ONESDK_SAVE_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
    set(ONESDK_SAVE_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})

    # pthreads can be implemented in libc...
    if (NOT DEFINED onesdk_thread_libs)
        CHECK_SYMBOL_EXISTS(pthread_create pthread.h onesdk_libc_has_pthreads)
        if (onesdk_libc_has_pthreads)
            set(onesdk_thread_libs "")
        endif ()
    endif ()
    # ... or in (lib)pthreads ...
    if (NOT DEFINED onesdk_thread_libs)
        CHECK_LIBRARY_EXISTS(pthreads pthread_create "" onesdk_have_libpthreads)
        if (onesdk_have_libpthreads)
            set(onesdk_thread_libs "-lpthreads")
        endif ()
    endif ()
    # ... or in (lib)pthread.
    if (NOT DEFINED onesdk_thread_libs)
        CHECK_LIBRARY_EXISTS(pthread pthread_create "" onesdk_have_libpthread)
        if (onesdk_have_libpthread)
            set(onesdk_thread_libs "-lpthread")
        endif ()
    endif ()
    # otherwise we give up and leave it to the user to link whatever is required (or set `onesdk_thread_libs` before including this file).

    set(CMAKE_REQUIRED_FLAGS ${ONESDK_SAVE_CMAKE_REQUIRED_FLAGS})
    set(CMAKE_REQUIRED_DEFINITIONS ${ONESDK_SAVE_CMAKE_REQUIRED_DEFINITIONS})
    set(CMAKE_REQUIRED_INCLUDES ${ONESDK_SAVE_CMAKE_REQUIRED_INCLUDES})
    set(CMAKE_REQUIRED_LIBRARIES ${ONESDK_SAVE_CMAKE_REQUIRED_LIBRARIES})
    unset(ONESDK_SAVE_CMAKE_REQUIRED_FLAGS)
    unset(ONESDK_SAVE_CMAKE_REQUIRED_DEFINITIONS)
    unset(ONESDK_SAVE_CMAKE_REQUIRED_INCLUDES)
    unset(ONESDK_SAVE_CMAKE_REQUIRED_LIBRARIES)
endif ()

# TARGET onesdk_static

add_library(onesdk_static STATIC IMPORTED)
set_property(TARGET onesdk_static PROPERTY VERSION "${onesdk_VERSION}")
set_property(TARGET onesdk_static PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${onesdk_path}/include")
set_property(TARGET onesdk_static PROPERTY IMPORTED_LOCATION "${onesdk_lib_path}/${onesdk_lib_prefix}onesdk_static${onesdk_linklib_suffix}")
if (onesdk_static_extra_libs)
    set_property(TARGET onesdk_static APPEND PROPERTY INTERFACE_LINK_LIBRARIES
        ${onesdk_static_extra_libs})
endif ()
if (CMAKE_DL_LIBS)
    set_property(TARGET onesdk_static APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}")
endif ()
if (onesdk_thread_libs)
    set_property(TARGET onesdk_static APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${onesdk_thread_libs}")
endif ()

# TARGET onesdk_shared

add_library(onesdk_shared SHARED IMPORTED)
set_property(TARGET onesdk_shared PROPERTY VERSION "${onesdk_VERSION}")
set_property(TARGET onesdk_shared PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${onesdk_path}/include")
set_property(TARGET onesdk_shared PROPERTY IMPORTED_LOCATION "${onesdk_lib_path}/${onesdk_shlib_name}")
if (onesdk_shlib_soname)
    set_property(TARGET onesdk_shared PROPERTY IMPORTED_SONAME "${onesdk_shlib_soname}")
endif()
set_property(TARGET onesdk_shared APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "ONESDK_SHARED")
if (onesdk_implib_suffix)
    set_property(TARGET onesdk_shared APPEND PROPERTY IMPORTED_IMPLIB "${onesdk_lib_path}/${onesdk_lib_prefix}onesdk_shared${onesdk_implib_suffix}")
endif ()

cmake_policy(POP)


text:
// Copyright 2020 The grok_exporter 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 v3

import (
	"fmt"
	"strings"
	"testing"
	"time"
)

const counter_config = `
global:
    config_version: 3
input:
    type: file
    path: x/x/x
    fail_on_missing_logfile: false
    readall: true
metrics:
    - type: counter
      name: test_count_total
      help: Dummy help message.
      match: Some text here, then a %{DATE}.
      labels:
          label_a: '{{.some_grok_field_a}}'
          label_b: '{{.some_grok_field_b}}'
server:
    protocol: https
    port: 1111
`

const gauge_config = `
global:
    config_version: 3
input:
    type: file
    path: x/x/x
metrics:
    - type: gauge
      name: test_histogram
      help: Dummy help message.
      match: Some %{NUMBER:val} here, then a %{DATE}.
      value: '{{.val}}'
      cumulative: true
server:
    protocol: http
    host: localhost
    port: 9144
`

const histogram_config = `
global:
    config_version: 3
input:
    type: stdin
metrics:
    - type: histogram
      name: test_histogram
      help: Dummy help message.
      match: Some %{NUMBER:val} here, then a %{DATE}.
      value: '{{.val}}'
      buckets: $BUCKETS
server:
    protocol: http
    port: 9144
`

const summary_config = `
global:
    config_version: 3
input:
    type: stdin
metrics:
    - type: summary
      name: test_summary
      help: Dummy help message.
      match: Some %{NUMBER:val} here, then a %{DATE}.
      value: '{{.val}}'
      quantiles: $QUANTILES
server:
    protocol: http
    port: 9144
`

const delete_labels_config = `
global:
    config_version: 3
input:
    type: stdin
metrics:
    - type: counter
      name: test_count_total
      help: Dummy help message.
      match: Some text here, then a %{DATE}.
      labels:
          label_a: '{{.some_grok_field_a}}'
          label_b: '{{.some_grok_field_b}}'
      delete_match: Some shutdown message
      delete_labels:
          label_a: '{{.some_grok_field_a}}'
server:
    protocol: http
    port: 9144
`

const retention_config = `
global:
    config_version: 3
input:
    type: stdin
metrics:
    - type: counter
      name: test_count_total
      help: Dummy help message.
      match: Some text here, then a %{DATE:date}.
      retention: 2h45m0s
      labels:
          date: '{{.date}}'
server:
    protocol: http
    port: 9144
`

const multiple_paths_config = `
global:
    config_version: 3
input:
    type: file
    paths:
    - /tmp/dir1/*.log
    - /tmp/dir2/*.log
    fail_on_missing_logfile: false
    readall: true
metrics:
    - type: counter
      name: test_count_total
      help: Dummy help message.
      paths:
      - /tmp/dir1/*.log
      - /tmp/dir2/*.log
      match: Some text here, then a %{DATE}.
      labels:
          label_a: '{{.some_grok_field_a}}'
          label_b: '{{.some_grok_field_b}}'
server:
    protocol: https
    port: 1111
`

const empty_grok_section = `
global:
    config_version: 3
input:
    type: file
    path: /tmp/test/*.log
metrics:
    - type: counter
      name: errors_total
      help: Dummy help message.
      match: ERROR
server:
    protocol: http
    port: 9144
`

const config_with_imports = `
global:
    config_version: 3
input:
    type: stdin
imports:
    - type: metrics
      file: /etc/grok/metrics.d/*.yaml
      defaults:
          path: /var/log/syslog/*
          retention: 2h30m0s
          buckets: [0, 1, 2, 3]
          quantiles: {0.5: 0.05, 0.9: 0.02, 0.99: 0.002}
          labels:
              logfile: '{{base .logfile}}'
grok_patterns:
    - WARN WARN
    - ERROR ERROR
metrics:
    - type: counter
      name: errors_total
      help: Dummy help message.
      match: ERROR
server:
    protocol: http
    port: 9144
`

const import_1 = `
    - type: histogram
      name: test_histogram_1
      help: Dummy help message.
      match: Some %{NUMBER:val} here, then a %{DATE}.
      value: '{{.val}}'
      paths:
        - /var/log/syslog/2021-*.log
        - /var/log/syslog/2022-*.log
    - type: summary
      name: test_summary_1
      help: Dummy help message.
      match: Some %{NUMBER:val} here, then a %{DATE}.
      value: '{{.val}}'
      retention: 4h30m0s
`

const import_2 = `
    - type: histogram
      name: test_histogram_2
      help: Dummy help message.
      match: Some %{NUMBER:val} here, then a %{DATE}.
      value: '{{.val}}'
      buckets: [0, 1, 2, 3, 4]
      retention: 5h30m0s
    - type: summary
      name: test_summary_2
      help: Dummy help message.
      match: Some %{NUMBER:val} here, then a %{DATE}.
      quantiles: {0.5: 0.05, 0.9: 0.02, 0.99: 0.002, 0.999: 0.0002}
      value: '{{.val}}'
`

type mockLoader struct {
	files []*ConfigFile
}

func (f *mockLoader) LoadDir(dir string) ([]*ConfigFile, error) {
	return f.files, nil
}

func (f *mockLoader) LoadGlob(globString string) ([]*ConfigFile, error) {
	return f.files, nil
}

func TestCounterValidConfig(t *testing.T) {
	loadOrFail(t, counter_config)
}

func TestGaugeValidConfig(t *testing.T) {
	loadOrFail(t, gauge_config)
}

func TestGaugeInvalidConfig(t *testing.T) {
	invalidCfg := strings.Replace(gauge_config, "      value: '{{.val}}'\n", "", 1)
	_, err := Unmarshal([]byte(invalidCfg))
	if err == nil || !strings.Contains(err.Error(), "'metrics.value' must not be empty") {
		t.Fatal("Expected error message saying that value is missing.")
	}
}

func TestGaugeCumulativeConfig(t *testing.T) {
	cfg := loadOrFail(t, gauge_config)
	if cfg.AllMetrics[0].Cumulative != true {
		t.Fatal("Expected 'true' as gauge cumulative option.")
	}
}

func TestGaugeDefaultCumulativeConfig(t *testing.T) {
	cfgString := strings.Replace(gauge_config, "      cumulative: true\n", "", 1)
	cfg := loadOrFail(t, cfgString)
	if cfg.AllMetrics[0].Cumulative != false {
		t.Fatal("Expected 'false' as default for gauge cumulative option.")
	}
}

func TestGaugeInvalidCumulativeConfig(t *testing.T) {
	invalidCfg := strings.Replace(gauge_config, "      cumulative: true\n", "      cumulative: dontknow\n", 1)
	_, err := Unmarshal([]byte(invalidCfg))
	if err == nil || !strings.Contains(err.Error(), "dontknow") {
		t.Fatal("Expected error message saying that 'dontknow' is invalid.", err)
	}
}

func TestHistogramValidConfig(t *testing.T) {
	validCfg := strings.Replace(histogram_config, "$BUCKETS", "[0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]", 1)
	cfg := loadOrFail(t, validCfg)
	metric := cfg.AllMetrics[0]
	if len(metric.Buckets) != 11 || metric.Buckets[0] != 0.005 || metric.Buckets[10] != 10 {
		t.Fatalf("Error parsing bucket list: Got %v", metric.Buckets)
	}
}

func TestHistogramInvalidConfig(t *testing.T) {
	invalidCfg := strings.Replace(histogram_config, "$BUCKETS", "[0.005, oops, 10]", 1)
	_, err := Unmarshal([]byte(invalidCfg))
	if err == nil || !strings.Contains(err.Error(), "oops") {
		t.Fatal("Expected error saying that 'oops' is not a valid number.")
	}
}

func TestSummaryValidConfig(t *testing.T) {
	validCfg := strings.Replace(summary_config, "$QUANTILES", "{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}", 1)
	cfg := loadOrFail(t, validCfg)
	metric := cfg.AllMetrics[0]
	if len(metric.Quantiles) != 3 || metric.Quantiles[0.5] != 0.05 || metric.Quantiles[0.99] != 0.001 {
		t.Fatalf("Error parsing bucket list: Got %v", metric.Buckets)
	}
}

func TestSummaryInvalidConfig(t *testing.T) {
	invalidCfg := strings.Replace(summary_config, "$QUANTILES", "[0.005, 0.2, 10]", 1)
	_, err := Unmarshal([]byte(invalidCfg))
	if err == nil {
		t.Fatal("Expected error, because quantiles are a list and not a map.")
	}
}

func TestValueInvalidTemplate(t *testing.T) {
	invalidCfg := strings.Replace(gauge_config, "value: '{{.val}}'", "value: '{{val}}'", 1)
	_, err := Unmarshal([]byte(invalidCfg))
	if err == nil {
		t.Fatal("Expected error, because using {{val}} instead of {{.val}}.")
	}
}

func TestDeleteLabelConfig(t *testing.T) {
	cfg := loadOrFail(t, delete_labels_config)
	if len(cfg.AllMetrics) != 1 {
		t.Fatalf("Expected 1 metric, but found %v.", len(cfg.AllMetrics))
	}
	metric := cfg.AllMetrics[0]
	if len(metric.LabelTemplates) != 2 {
		t.Fatalf("Expected 2 label templates, but found %v.", len(metric.LabelTemplates))
	}
	if len(metric.DeleteLabelTemplates) != 1 {
		t.Fatalf("Expected 1 delete label template, but found %v.", len(metric.DeleteLabelTemplates))
	}
}

func TestRetentionValidConfig(t *testing.T) {
	cfg := loadOrFail(t, retention_config)
	if cfg.AllMetrics[0].Retention != 2*time.Hour+45*time.Minute {
		t.Fatalf("Error parsing retention, got %v", (cfg.AllMetrics)[0].Retention)
	}
}

func TestRetentionInvalidConfig(t *testing.T) {
	invalidCfg := strings.Replace(retention_config, "2h45m0s", "abc", 1)
	_, err := Unmarshal([]byte(invalidCfg))
	if err == nil || !strings.Contains(err.Error(), "abc") {
		t.Fatal("Expected error saying that 'abc' is not a valid duration.")
	}
}

func TestPathsValidConfig(t *testing.T) {
	loadOrFail(t, multiple_paths_config)
}

func TestDuplicateInputPaths(t *testing.T) {
	var s = `type: file
    path: /some/path/file.log`
	invalidCfg := strings.Replace(multiple_paths_config, "type: file", s, 1)
	_, err := Unmarshal([]byte(invalidCfg))
	if err == nil {
		t.Fatal("Expected error, but unmarshalling was successful.")
	}
	// Make sure it's the right error and not an error accidentally caused by incorrect indentation of the injected 'path' field.
	if !strings.Contains(err.Error(), "use either 'path' or 'paths' but not both") {
		t.Fatalf("Expected error message about path and paths being mutually exclusive, but got %v", err)
	}
}

func TestDuplicateMetricPaths(t *testing.T) {
	var s = `help: Dummy help message.
      path: /some/path/file.log`
	invalidCfg := strings.Replace(multiple_paths_config, "help: Dummy help message.", s, 1)
	_, err := Unmarshal([]byte(invalidCfg))
	if err == nil {
		t.Fatal("Expected error, but unmarshalling was successful.")
	}
	// Make sure it's the right error and not an error accidentally caused by incorrect indentation of the injected 'path' field.
	if !strings.Contains(err.Error(), "use either 'path' or 'paths' but not both") {
		t.Fatalf("Expected error message about path and paths being mutually exclusive, but got %v", err)
	}
}

func TestGlobsAreGenerated(t *testing.T) {
	cfg, err := Unmarshal([]byte(multiple_paths_config))
	if err != nil {
		t.Fatalf("unexpected error: %v", err)
	}
	if len(cfg.Input.Globs) != 2 {
		t.Fatalf("expected 2 Globs in input config, but found %v", len(cfg.Input.Globs))
	}
	if len(cfg.AllMetrics[0].Globs) != 2 {
		t.Fatalf("expected 2 Globs in metric config, but found %v", len(cfg.AllMetrics[0].Globs))
	}
}

func TestEmptyGrokSection(t *testing.T) {
	loadOrFail(t, empty_grok_section)
}

func TestImportSuccess(t *testing.T) {
	fileLoader := &mockLoader{
		files: []*ConfigFile{
			{Path: "file1.yaml", Contents: import_1},
			{Path: "file2.yaml", Contents: import_2},
		},
	}
	cfg, err := unmarshal([]byte(config_with_imports), fileLoader)
	if err != nil {
		t.Fatalf("Failed to read config: %v", err.Error())
	}
	err = equalsIgnoreIndentation(cfg.String(), config_with_imports)
	if err != nil {
		t.Fatalf("Expected:\n%v\nActual:\n%v\n%v", config_with_imports, cfg, err)
	}
	if len(cfg.AllMetrics) != 5 {
		t.Fatalf("expected 5 metrics, but found %v", len(cfg.AllMetrics))
	}
	expectMetric(t, cfg.AllMetrics[1], "test_histogram_1", []string{"/var/log/syslog/2021-*.log", "/var/log/syslog/2022-*.log"}, 4, 0, 2*time.Hour+30*time.Minute)
	expectMetric(t, cfg.AllMetrics[2], "test_summary_1", []string{"/var/log/syslog/*"}, 0, 3, 4*time.Hour+30*time.Minute)
	expectMetric(t, cfg.AllMetrics[3], "test_histogram_2", []string{"/var/log/syslog/*"}, 5, 0, 5*time.Hour+30*time.Minute)
	expectMetric(t, cfg.AllMetrics[4], "test_summary_2", []string{"/var/log/syslog/*"}, 0, 4, 2*time.Hour+30*time.Minute)
}

func expectMetric(t *testing.T, metric MetricConfig, name string, paths []string, bucketLen, quantilesLen int, retention time.Duration) {
	if metric.Name != name {
		t.Fatalf("expected metric %v but found %v", name, metric.Name)
	}
	if len(metric.Paths) != len(paths) {
		t.Fatalf("expected len(paths)=%v for metric %v, but found len(paths)=%v", len(paths), name, len(metric.Paths))
	}
	for i := range paths {
		if metric.Paths[i] != paths[i] {
			t.Fatalf("expected paths[%v]=%v for metric %v, but found paths[%v]=%v", i, paths[i], name, i, metric.Paths[i])
		}
	}
	if len(metric.Buckets) != bucketLen {
		t.Fatalf("expected %v buckets for metric %v, but found %v buckets", bucketLen, name, len(metric.Buckets))
	}
	if len(metric.Quantiles) != quantilesLen {
		t.Fatalf("expected %v quantiles for metric %v, but found %v quantiles", quantilesLen, name, len(metric.Quantiles))
	}
	if metric.Retention != retention {
		t.Fatalf("expected retention %v for metric %v, but found %v", retention, name, metric.Retention)
	}
}

func TestImportDuplicateMetric(t *testing.T) {
	fileLoader := &mockLoader{
		files: []*ConfigFile{
			{Path: "file1.yaml", Contents: import_1},
			{Path: "file2.yaml", Contents: strings.Replace(import_2, "name: test_histogram_2", "name: errors_total", 1)},
		},
	}
	_, err := unmarshal([]byte(config_with_imports), fileLoader)
	if err == nil {
		t.Fatalf("expected error about duplicate metric name, but got no error")
	}
	if !strings.Contains(err.Error(), "errors_total") {
		t.Fatalf("expected error message to contain the name of the duplicate metric")
	}
}

func loadOrFail(t *testing.T, cfgString string) *Config {
	cfg, err := Unmarshal([]byte(cfgString))
	if err != nil {
		t.Fatalf("Failed to read config: %v", err.Error())
	}
	err = equalsIgnoreIndentation(cfg.String(), cfgString)
	if err != nil {
		t.Fatalf("Expected:\n%v\nActual:\n%v\n%v", cfgString, cfg, err)
	}
	return cfg
}

func equalsIgnoreIndentation(actual, expected string) error {
	actualLines := stripEmptyLines(strings.Split(actual, "\n"))
	expectedLines := stripEmptyLines(strings.Split(expected, "\n"))
	length := len(actualLines)
	if len(expectedLines) < length {
		length = len(expectedLines)
	}
	for i := 0; i < length; i++ {
		if strings.TrimSpace(actualLines[i]) != strings.TrimSpace(expectedLines[i]) {
			return fmt.Errorf("line %v: expected '%v' but got '%v'", i, expectedLines[i], actualLines[i])
		}
	}
	if len(actualLines) != len(expectedLines) {
		return fmt.Errorf("expected %v non-empty lines, but got %v non-empty lines", len(expectedLines), len(actualLines))
	}
	return nil
}

func stripEmptyLines(lines []string) []string {
	result := make([]string, 0, len(lines))
	for _, line := range lines {
		if line != "" {
			result = append(result, line)
		}
	}
	return result
}


text:
@inproceedings{10.1007/978-3-030-45442-5_65,
 abstract = {We describe the third edition of the CheckThat! Lab, which is part of the 2020 Cross-Language Evaluation Forum (CLEF). CheckThat! proposes four complementary tasks and a related task from previous lab editions, offered in English, Arabic, and Spanish. Task 1 asks to predict which tweets in a Twitter stream are worth fact-checking. Task 2 asks to determine whether a claim posted in a tweet can be verified using a set of previously fact-checked claims. Task 3 asks to retrieve text snippets from a given set of Web pages that would be useful for verifying a target tweet's claim. Task 4 asks to predict the veracity of a target tweet's claim using a set of potentially-relevant Web pages. Finally, the lab offers a fifth task that asks to predict the check-worthiness of the claims made in English political debates and speeches. CheckThat! features a full evaluation framework. The evaluation is carried out using mean average precision or precision at rank k for ranking tasks, and F1 for classification tasks.},
 address = {Cham},
 author = {Barrón-Cedeño, Alberto
and Elsayed, Tamer
and Nakov, Preslav
and Da San Martino, Giovanni
and Hasanain, Maram
and Suwaileh, Reem
and Haouari, Fatima},
 booktitle = {Advances in Information Retrieval},
 editor = {Jose, Joemon M.
and Yilmaz, Emine
and Magalhães, João
and Castells, Pablo
and Ferro, Nicola
and Silva, Mário J.
and Martins, Flávio},
 isbn = {978-3-030-45442-5},
 pages = {499--507},
 publisher = {Springer International Publishing},
 title = {CheckThat! at CLEF 2020: Enabling the Automatic Identification and Verification of Claims in Social Media},
 year = {2020}
}

repository: albarron/academic-kickstart

repo_name: albarron/academic-kickstart

extension: bib


text:
DESCRIPTION = "RidgeRun Gstreamer Daemon 1.0"
SECTION = "multimedia"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad gstreamer1.0-rtsp-server json-glib libdaemon"

SRCBRANCH ?= "master"
SRCREV = "097a086a8606dcb368c7d38c7ec4fefc2497401b"
SRC_URI = "git://git@github.com/RidgeRun/gstd-1.x.git;protocol=ssh;branch=${SRCBRANCH} \
	   file://0001-gstd-yocto-compatibility.patch"

S = "${WORKDIR}/git"

PACKAGECONFIG_CONFARGS = " \
	--disable-gtk-doc \
"

inherit autotools pkgconfig gettext

do_configure() {
${S}/autogen.sh
oe_runconf
}

repository: devarsht/meta-ridgerun

repo_name: devarsht/meta-ridgerun


text:
set(CMAKE_SYSTEM_NAME Generic)

set(CMAKE_C_COMPILER riscv32-esp-elf-gcc)
set(CMAKE_CXX_COMPILER riscv32-esp-elf-g++)
set(CMAKE_ASM_COMPILER riscv32-esp-elf-gcc)

set(CMAKE_C_FLAGS "-march=rv32imc_zicsr_zifencei" CACHE STRING "C Compiler Base Flags")
set(CMAKE_CXX_FLAGS "-march=rv32imc_zicsr_zifencei" CACHE STRING "C++ Compiler Base Flags")
set(CMAKE_EXE_LINKER_FLAGS "-nostartfiles -march=rv32imc_zicsr_zifencei --specs=nosys.specs" CACHE STRING "Linker Base Flags")

repository: mcu-tools/mcuboot

repo_name: mcu-tools/mcuboot

gha_language: C


text:
class Solution {
public:
    int findLength(vector<int>& A, vector<int>& B) {
        vector<vector<int>>opt(A.size() + 1, vector<int>(B.size() + 1, 0));
		int res = 0;
		for (int i = 0; i < A.size(); ++i) {
			for (int j = 0; j < B.size(); ++j) {
				if (A[i] == B[j]) {
					opt[i + 1][j + 1] = 1 + opt[i][j];
					res = std::max(res, opt[i + 1][j + 1]);
				}
			}
		}
		return res;
    }
};

url: https://raw.githubusercontent.com/KailinLi/LeetCode-Solutions/bad6aa401b290a203a572362e63e0b1085f7fc36/718. Maximum Length of Repeated Subarray/solution.cpp

repository: KailinLi/LeetCode-Solutions

repo_name: KailinLi/LeetCode-Solutions

extension: cpp


text:
package main

import(
	"github.com/nowind/uis"
	"github.com/andlabs/ui"
	_ "github.com/andlabs/ui/winmanifest"
)

func SetUi(w *ui.Window ) ui.Control{
	main:=uis.NewVBox()
	return main.
		AppendForm("你好").
		AppendBtn("OK","OK", func(button *ui.Button) {
		nh,_:=main.GetChild("你好")
		ui.MsgBox(w,"",nh.(*ui.Entry).Text())
	})
}
func main(){
	uis.MainWindow(800,200,SetUi)
}

repository: nowind/uis

repo_name: nowind/uis


text:
#
# Base recipe: meta/recipes-graphics/xorg-lib/libice_1.0.8.bb
# Base branch: daisy
#

SUMMARY = "ICE: Inter-Client Exchange library"

DESCRIPTION = "The Inter-Client Exchange (ICE) protocol provides a \
generic framework for building protocols on top of reliable, byte-stream \
transport connections. It provides basic mechanisms for setting up and \
shutting down connections, for performing authentication, for \
negotiating versions, and for reporting errors. "

require xorg-lib-common.inc

PR = "${INC_PR}.0"

LICENSE = "MIT-style"
LIC_FILES_CHKSUM = "file://COPYING;md5=d162b1b3c6fa812da9d804dcf8584a93"

DEPENDS += "xproto xtrans"
PROVIDES = "ice"

BBCLASSEXTEND = "native"

# There is no debian patch
DEBIAN_PATCH_TYPE = "nopatch"

# Correct the package name follow Debian
DEBIANNAME_${PN}-dbg = "${PN}6-dbg"

repository: nghiaht-tsdv/meta-debian

repo_name: nghiaht-tsdv/meta-debian

branch_name: refs/heads/jethro


text:
#include "buttons_panel.hpp"
#include "sdl_gui_constants.hpp"
#include <utility>

//<f> Constructors & operator=
ButtonsPanel::ButtonsPanel(sdl_gui::GuiManager* manager) : m_gui_manager{manager}
{
    // most of these variables will be reused through the constructor
    float x{0}, y{0}, prev_w{0}, prev_h{0};
    sdl_gui::Label* label_ptr{ nullptr };

    //<f> Buttons demo
    //parent element for all button demo elements
    m_panel = m_gui_manager->CreateElement<sdl_gui::GuiElement>({25,25}, {0,0});
    std::vector<sdl_gui::Image*> lines;

    //Area bg image
    auto img = m_gui_manager->CreateElement<sdl_gui::Image>({0,0}, {700,650});
    img->ColourModulation({12,34,56,200});
    img->Parent(m_panel);
    x = 0; y = 0;
    img->LocalPosition({x, y});
    img->RenderIndex(1);

    //base buttons
    label_ptr = m_gui_manager->CreateElement<sdl_gui::Label>({5,0}, {0,0});
    label_ptr->Text("sdl_gui::BaseButton - the base for a button, \ncan have one of three types of transition", sdl_gui::Colour::White);
    label_ptr->Parent(m_panel);
    x = 5; y += 5;
    label_ptr->LocalPosition({x, y});
    prev_h = label_ptr->Size().h;

    //<f> Colour
    label_ptr = m_gui_manager->CreateElement<sdl_gui::Label>({0,0}, {0,0});
    label_ptr->Text("Colour transition -> Button made of a single white image\nwhere you choose its colour for every state\n(left:active | right:inactive) - Default colours", sdl_gui::Colour::White);
    label_ptr->Parent(m_panel);
    y += prev_h + 5;
    label_ptr->LocalPosition({x, y});
    prev_h = label_ptr->Size().h;

    //LEFT colour example button (default transition)
    auto btn = m_gui_manager->CreateElement<sdl_gui::BaseButton>({0,0}, {100, 25});
    btn->Parent(m_panel);
    y += prev_h + 5;
    btn->LocalPosition({x, y});
    prev_w = btn->Size().w;
    //RIGHT
    btn = m_gui_manager->CreateElement<sdl_gui::Button>({0,0}, {100, 25});
    btn->IsActive(false);
    btn->Parent(m_panel);
    btn->LocalPosition({x + prev_w + 5, y});//same y and to the right
    prev_h = btn->Size().h;
    //</f>//Colour

    //---------------------------------------------------------------------------------------------------------
    lines.push_back( m_gui_manager->CreateElement<sdl_gui::Image>({0,0}, {10, 2}) );
    lines.back()->ColourModulation({0,0,0,255});
    lines.back()->Parent(m_panel);
    y += prev_h + 5;
    lines.back()->LocalPosition({img->LocalPosition().x, y});
    prev_h = lines.back()->Size().h;
    //---------------------------------------------------------------------------------------------------------

    //<f> Single
    label_ptr = m_gui_manager->CreateElement<sdl_gui::Label>({0,0}, {0,0});
    label_ptr->Text("Single image transition -> Button made of a section(SDL_Rect) of a single image\n(left:active | right:inactive) - Default image", sdl_gui::Colour::White);
    label_ptr->Parent(m_panel);
    y += prev_h + 5;
    label_ptr->LocalPosition({x, y});
    prev_h = label_ptr->Size().h;

    //single image example button
    btn = m_gui_manager->CreateElement<sdl_gui::BaseButton>({0,0}, {100, 25});
    btn->Parent(m_panel);
    y += prev_h + 5;
    btn->LocalPosition({x, y});
    prev_h = btn->Size().h;
    //set single image
    btn->TransitionType(sdl_gui::ButtonTransitionType::SINGLE_IMAGE);
    btn->TransitionSingleImagePtr()->SetStateTextureSrcRect({0,0,1,1}, {0,1,1,1}, {0,2,1,1}, {0,3,1,1});
    prev_w = btn->Size().w;
    //RIGHT
    btn = m_gui_manager->CreateElement<sdl_gui::Button>({0,0}, {100, 25});
    btn->IsActive(false);
    btn->Parent(m_panel);
    btn->LocalPosition({x + prev_w + 5, y});//same y and to the right
    prev_h = btn->Size().h;
    //set single image
    btn->TransitionType(sdl_gui::ButtonTransitionType::SINGLE_IMAGE);
    btn->TransitionSingleImagePtr()->SetStateTextureSrcRect({0,0,1,1}, {0,1,1,1}, {0,2,1,1}, {0,3,1,1});
    //</f>//Single

    //---------------------------------------------------------------------------------------------------------
    lines.push_back( m_gui_manager->CreateElement<sdl_gui::Image>({0,0}, {10, 2}) );
    lines.back()->ColourModulation({0,0,0,255});
    lines.back()->Parent(m_panel);
    y += prev_h + 5;
    lines.back()->LocalPosition({img->LocalPosition().x, y});
    prev_h = lines.back()->Size().h;
    //---------------------------------------------------------------------------------------------------------

    //<f> Multi
    label_ptr = m_gui_manager->CreateElement<sdl_gui::Label>({0,0}, {0,0});
    label_ptr->Text("Multiple image transition -> Button made of an image per transition state\n(left:active | right:inactive) - Default images", sdl_gui::Colour::White);
    label_ptr->Parent(m_panel);
    y += prev_h + 5;
    label_ptr->LocalPosition({x, y});
    prev_h = label_ptr->Size().h;

    //single image example button
    btn = m_gui_manager->CreateElement<sdl_gui::BaseButton>({0,0}, {100, 25});
    btn->Parent(m_panel);
    y += prev_h + 5;
    btn->LocalPosition({x, y});
    prev_h = btn->Size().h;
    //set multi image
    btn->TransitionType(sdl_gui::ButtonTransitionType::MULTI_IMAGE);
    prev_w = btn->Size().w;
    //RIGHT
    btn = m_gui_manager->CreateElement<sdl_gui::BaseButton>({0,0}, {100, 25});
    btn->IsActive(false);
    btn->Parent(m_panel);
    btn->LocalPosition({x + prev_w + 5, y});//same y and to the right
    prev_h = btn->Size().h;
    //set multi image
    btn->TransitionType(sdl_gui::ButtonTransitionType::MULTI_IMAGE);
    //</f>//Multi

    //---------------------------------------------------------------------------------------------------------
    lines.push_back( m_gui_manager->CreateElement<sdl_gui::Image>({0,0}, {10, 2}) );
    lines.back()->ColourModulation({0,0,0,255});
    lines.back()->Parent(m_panel);
    y += prev_h + 5;
    lines.back()->LocalPosition({img->LocalPosition().x, y});
    prev_h = lines.back()->Size().h;
    //---------------------------------------------------------------------------------------------------------

    //<f> Button with Text
    label_ptr = m_gui_manager->CreateElement<sdl_gui::Label>({0,0}, {0,0});
    label_ptr->Text("Button with label -> Basic button (has previous transitions) and with a built-in label\n(This button class exists for convenience as it can be built by attaching a label to basic button)", sdl_gui::Colour::White);
    label_ptr->Parent(m_panel);
    y += prev_h + 5;
    label_ptr->LocalPosition({x, y});
    prev_h = label_ptr->Size().h;
    //button
    auto btn_with_text = m_gui_manager->CreateElement<sdl_gui::Button>({0,0}, {150,25});
    btn_with_text->Parent(m_panel);
    y += prev_h + 5;
    btn_with_text->LocalPosition({x, y});
    btn_with_text->CreateLabel("Button with text", sdl_gui::c_default_font_path, 15, sdl_gui::Colour::Black, {0,0});
    btn_with_text->CentreLabel();
    //</f>//Button with Text

    lines.push_back( m_gui_manager->CreateElement<sdl_gui::Image>({0,0}, {10, 2}) );
    lines.back()->ColourModulation({0,0,0,255});
    lines.back()->Parent(m_panel);
    y += prev_h + 5;
    lines.back()->LocalPosition({img->LocalPosition().x, y});
    prev_h = lines.back()->Size().h;

    //<f> Selectables
    label_ptr = m_gui_manager->CreateElement<sdl_gui::Label>({0,0}, {0,0});
    label_ptr->Text("Selectable Button -> Basic button (has previous transitions) that can be selected.\nUsed as the base for checkboxes", sdl_gui::Colour::White);
    label_ptr->Parent(m_panel);
    y += prev_h + 5;
    label_ptr->LocalPosition({x, y});
    prev_h = label_ptr->Size().h;

    auto selectable = m_gui_manager->CreateElement<sdl_gui::SelectableButton>({0,0}, {100,25});
    selectable->TransitionColourPtr()->SetStateColour(sdl_gui::ButtonState::SELECTED, {128,128,128,255});
    selectable->Parent(m_panel);
    y += prev_h + 5;
    selectable->LocalPosition({x,y});
    prev_h = selectable->Size().h;

    lines.push_back( m_gui_manager->CreateElement<sdl_gui::Image>({0,0}, {10, 2}) );
    lines.back()->ColourModulation({0,0,0,255});
    lines.back()->Parent(m_panel);
    y += prev_h + 5;
    lines.back()->LocalPosition({img->LocalPosition().x, y});
    prev_h = lines.back()->Size().h;

    //<f> CheckBox
    label_ptr = m_gui_manager->CreateElement<sdl_gui::Label>({0,0}, {0,0});
    label_ptr->Text("Selectable Button -> Basic button (has previous transitions) that can be selected.\nUsed as the base for checkboxes", sdl_gui::Colour::White);
    label_ptr->LineLength(300);
    label_ptr->Parent(m_panel);
    y += prev_h + 5;
    label_ptr->LocalPosition({x, y});
    prev_h = label_ptr->Size().h;

    auto selectable_group = m_gui_manager->CreateElement<sdl_gui::SelectableGroup>({0,0}, {0,0});
    for(auto i{0}; i < 5;++i)
    {
        auto checkbox{m_gui_manager->CreateElement<sdl_gui::CheckBox>({0,0}, {15,15})};
        selectable_group->AddSelectable(checkbox);
        checkbox->LocalPosition({0, 15.f * i + 5 * i});
        checkbox->Value(i);

        auto check_mark{m_gui_manager->CreateElement<sdl_gui::Image>({0,0}, {11,11})};
        checkbox->CheckMarkElement(check_mark);//add to checkbox
        check_mark->AlignWithParentPoint(sdl_gui::AnchorType::MIDDLE_CENTRE);
        check_mark->ColourModulation({0,0,0,255});
    }
    // selectable_group->ValuesChanged = std::bind(&Check, std::placeholders::_1);

    selectable_group->Parent(m_panel);
    selectable_group->ResizeToBounds();
    y += prev_h + 5;
    selectable_group->LocalPosition({x,y});

    //Second group
    auto selectable_radio_group = m_gui_manager->CreateElement<sdl_gui::SelectableGroup>({0,0}, {0,0});
    for(auto i{0}; i < 5;++i)
    {
        auto checkbox{m_gui_manager->CreateElement<sdl_gui::CheckBox>({0,0}, {15,15})};
        selectable_radio_group->AddSelectable(checkbox);
        checkbox->TransitionColourPtr()->ChangeBaseTexture(sdl_gui::c_img_white_circle);
        checkbox->LocalPosition({0, 15.f * i + 5 * i});
        checkbox->Value(i);

        auto check_mark{m_gui_manager->CreateElement<sdl_gui::Image>({0,0}, {11,11})};
        checkbox->CheckMarkElement(check_mark);//add to checkbox
        //switch image to circle
        check_mark->ChangeTexture(sdl_gui::c_img_white_circle);
        check_mark->AlignWithParentPoint(sdl_gui::AnchorType::MIDDLE_CENTRE);
        check_mark->ColourModulation({0,0,0,255});
    }
    // selectable_radio_group->ValuesChanged = std::bind(&Check, std::placeholders::_1);
    selectable_radio_group->GroupType(sdl_gui::SelectableGroupType::RADIO);

    selectable_radio_group->Parent(m_panel);
    selectable_radio_group->ResizeToBounds();
    selectable_radio_group->LocalPosition({x + 50,y});//move this group 50px to the right
    prev_h = selectable_radio_group->Size().h;
    //</f>//checkbox

    lines.push_back( m_gui_manager->CreateElement<sdl_gui::Image>({0,0}, {10, 2}) );
    lines.back()->ColourModulation({0,0,0,255});
    lines.back()->Parent(m_panel);
    y += prev_h + 5;
    lines.back()->LocalPosition({img->LocalPosition().x, y});
    // prev_h = lines.back()->Size().h;
    //</f>//selectables

    //resize image & lines
    auto bounds = m_panel->Bounds(); //auto margin{10};
    // img->Size( sdl_gui::SizeFromInts(bounds.w + margin, bounds.h) );
    for(auto& line : lines)
        line->Size(sdl_gui::SizeFromInts(bounds.w, 2));
    // std::cout<<bounds.w<<" - "<<bounds.h<<std::endl;
    //</f>//buttons
}

ButtonsPanel::~ButtonsPanel() noexcept
{

}

ButtonsPanel::ButtonsPanel(const ButtonsPanel& other)
{

}

ButtonsPanel::ButtonsPanel(ButtonsPanel&& other) noexcept
{

}

ButtonsPanel& ButtonsPanel::operator=(const ButtonsPanel& other)
{
    if(this != &other)//not same ref
    {
        auto tmp(other);
        *this = std::move(tmp);
    }

    return *this;
}

ButtonsPanel& ButtonsPanel::operator=(ButtonsPanel&& other) noexcept
{
    if(this != &other)//not same ref
    {
        //move here
    }
    return *this;
}
//</f>


text:
# Install script for directory: /Users/felix/source_view/cmake-3.12.20181002-g18d20

# Set the install prefix
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
  set(CMAKE_INSTALL_PREFIX "/usr/local")
endif()
string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")

# Set the install configuration name.
if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
  if(BUILD_TYPE)
    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
  else()
    set(CMAKE_INSTALL_CONFIG_NAME "")
  endif()
  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
endif()

# Set the component getting installed.
if(NOT CMAKE_INSTALL_COMPONENT)
  if(COMPONENT)
    message(STATUS "Install component: \"${COMPONENT}\"")
    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
  else()
    set(CMAKE_INSTALL_COMPONENT)
  endif()
endif()

# Is this installation the result of a crosscompile?
if(NOT DEFINED CMAKE_CROSSCOMPILING)
  set(CMAKE_CROSSCOMPILING "FALSE")
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/doc/cmake-3.12" TYPE FILE FILES "/Users/felix/source_view/cmake-3.12.20181002-g18d20/Copyright.txt")
endif()

if("x${CMAKE_INSTALL_COMPONENT}x" STREQUAL "xUnspecifiedx" OR NOT CMAKE_INSTALL_COMPONENT)
  file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/share/cmake-3.12" TYPE DIRECTORY PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ DIR_PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE FILES
    "/Users/felix/source_view/cmake-3.12.20181002-g18d20/Help"
    "/Users/felix/source_view/cmake-3.12.20181002-g18d20/Modules"
    "/Users/felix/source_view/cmake-3.12.20181002-g18d20/Templates"
    REGEX "/[^/]*\\.sh[^/]*$" PERMISSIONS OWNER_READ OWNER_EXECUTE OWNER_WRITE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE REGEX "help/dev($|/)" EXCLUDE)
endif()

if(NOT CMAKE_INSTALL_LOCAL_ONLY)
  # Include the install script for each subdirectory.
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Source/kwsys/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/KWIML/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmlibrhash/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmzlib/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmcurl/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmcompress/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmexpat/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmbzip2/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmliblzma/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmlibarchive/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmjsoncpp/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmlibuv/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Source/CursesDialog/form/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Source/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Utilities/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Tests/cmake_install.cmake")
  include("/Users/felix/source_view/cmake-3.12.20181002-g18d20/Auxiliary/cmake_install.cmake")

endif()

if(CMAKE_INSTALL_COMPONENT)
  set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
else()
  set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
endif()

string(REPLACE ";" "\n" CMAKE_INSTALL_MANIFEST_CONTENT
       "${CMAKE_INSTALL_MANIFEST_FILES}")
file(WRITE "/Users/felix/source_view/cmake-3.12.20181002-g18d20/${CMAKE_INSTALL_MANIFEST}"
     "${CMAKE_INSTALL_MANIFEST_CONTENT}")


text:
@article{wu2013inequivalence,
 abstract = {Resonant direct and converse magnetoelectric (ME) effects have been investigated experimentally and theoretically in FeGa/PZT/FeGa sandwich laminate composites under the same electric and magnetic bias conditions. Resonant direct ME effect (DME) occurs at antiresonance frequency while resonant converse ME effect (CME) occurs at resonance frequency. The antiresonance and resonance frequencies have close but different values under identical bias conditions. The magnitudes of resonant effective ME coefficients for direct and converse ME effects are also not equal. A model was developed to describe the frequency response of DME and CME in laminate composite, which was in good agreement with experimental results. © 2013 AIP Publishing LLC.},
 author = {Wu, Gaojian and Nan, Tianxiang and Zhang, Ru and Zhang, Ning and Li, Shandong and Sun, Nian X.},
 doi = {10.1063/1.4827875},
 issn = {00036951},
 journal = {Appl. Phys. Lett.},
 number = {18},
 pages = {182905},
 publisher = {AIP},
 title = {Inequivalence of direct and converse magnetoelectric coupling at electromechanical resonance},
 volume = {103},
 year = {2013}
}


text:
package main

import (
	"leetcode/algorithms/1220.CountVowelsPermutation/countVowelPermutation"
	"testing"
)

func TestCountVowelPermutation(t *testing.T) {
	tests := []struct {
		n      int
		output int
	}{
		{1, 5},
		{2, 10},
	}

	for _, test := range tests {
		ret := countVowelPermutation.CountVowelPermutation(test.n)
		if ret != test.output {
			t.Errorf("Got %d for input %d; expected %d", ret, test.n, test.output)
		}
	}
}

repository: trumanwong/leetcode

repo_name: trumanwong/leetcode


text:
// Copyright (c) Improbable Worlds Ltd, All Rights Reserved

#include "GDKTestGyms.h"
#include "Modules/ModuleManager.h"

IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, GDKTestGyms, "GDKTestGyms" );

repository: spatialos/UnrealGDKTestGyms

repo_name: spatialos/UnrealGDKTestGyms


text:
@Article{Martin_2014,
  doi = {10.1016/j.gloenvcha.2014.07.003},
  url = {https://doi.org/10.1016/j.gloenvcha.2014.07.003},
  year = {2014},
  month = {sep},
  publisher = {Elsevier {BV}},
  volume = {28},
  pages = {216--226},
  author = {Adrian Martin and Nicole Gross-Camp and Bereket Kebede and Shawn McGuire},
  title = {Measuring effectiveness, efficiency and equity in an experimental Payments for Ecosystem Services trial},
  journal = {Global Environmental Change},
}

@Article{Yang_2013,
  doi = {10.1016/j.jenvman.2013.04.019},
  url = {https://doi.org/10.1016/j.jenvman.2013.04.019},
  year = {2013},
  month = {sep},
  publisher = {Elsevier {BV}},
  volume = {127},
  pages = {86--95},
  author = {Wu Yang and Wei Liu and Andr{\a'e}s Vi{\~n}a and Junyan Luo and Guangming He and Zhiyun Ouyang and Hemin Zhang and Jianguo Liu},
  title = {Performance and prospects of payments for ecosystem services programs: Evidence from China},
  journal = {Journal of Environmental Management},
}

@Article{Kalame_2011,
  doi = {10.1016/j.envsci.2011.03.011},
  url = {https://doi.org/10.1016/j.envsci.2011.03.011},
  year = {2011},
  month = {aug},
  publisher = {Elsevier {BV}},
  volume = {14},
  number = {5},
  pages = {519--530},
  author = {Fobissie B. Kalame and Robert Aidoo and Johnson Nkem and Oluyede C. Ajayie and Markku Kanninen and Olavi Luukkanen and Monica Idinoba},
  title = {Modified taungya system in Ghana: a win{\textendash}win practice for forestry and adaptation to climate change?},
  journal = {Environmental Science {\&} Policy},
}

@Article{Hobbs_1998,
  doi = {10.2307/3674035},
  url = {https://doi.org/10.2307/3674035},
  year = {1998},
  month = {aug},
  publisher = {{JSTOR}},
  volume = {18},
  number = {3},
  pages = {235},
  author = {Joseph J. Hobbs and John Grainger and Iman Y. El-Bastawisi},
  title = {Inception of the Bedouin Support Programme in the St. Katherine Natural Protectorate, Sinai, Egypt},
  journal = {Mountain Research and Development},
}

repository: marty-downs/evidence-based-heatmap

repo_name: marty-downs/evidence-based-heatmap


text:
% comparison and benchmarking

@article{Kozhirbayev2017APC,
  title={A performance comparison of container-based technologies for the Cloud},
  author={Zhanibek Kozhirbayev and Richard O. Sinnott},
  journal={Future Generation Comp. Syst.},
  year={2017},
  volume={68},
  pages={175-182}
}

@INPROCEEDINGS{5708625,
author={J. Che and C. Shi and Y. Yu and W. Lin},
booktitle={2010 IEEE Asia-Pacific Services Computing Conference},
title={A Synthetical Performance Evaluation of OpenVZ, Xen and KVM},
year={2010},
volume={},
number={},
pages={587-594},
keywords={operating systems (computers);virtual machines;KVM;OpenVZ;VMM;Xen;container-based virtualization;full-virtualization;open source virtual machine monitor;para-virtualization;Bandwidth;Kernel;Linux;Random access memory;Virtual machine monitors;Virtual machining;evaluation;performance;virtual machine;virtual machine monitor;virtualization},
doi={10.1109/APSCC.2010.83},
ISSN={},
month={Dec}}

% containerisation

@inproceedings{Scheepers2014VirtualizationAC,
  title={Virtualization and Containerization of Application Infrastructure: A Comparison},
  author={Mathijs Jeroen Scheepers},
  year={2014}
}

@article{Merkel:2014:DLL:2600239.2600241,
 author = {Merkel, Dirk},
 title = {Docker: Lightweight Linux Containers for Consistent Development and Deployment},
 journal = {Linux J.},
 issue_date = {March 2014},
 volume = {2014},
 number = {239},
 month = mar,
 year = {2014},
 issn = {1075-3583},
 articleno = {2},
 acmid = {2600241},
 publisher = {Belltown Media},
 address = {Houston, TX}
}
% url = {http://dl.acm.org.ezp.lib.unimelb.edu.au/citation.cfm?id=2600239.2600241},

% cloud computing

@article{Armbrust:2010:VCC:1721654.1721672,
 author = {Armbrust, Michael and Fox, Armando and Griffith, Rean and Joseph, Anthony D. and Katz, Randy and Konwinski, Andy and Lee, Gunho and Patterson, David and Rabkin, Ariel and Stoica, Ion and Zaharia, Matei},
 title = {A View of Cloud Computing},
 journal = {Commun. ACM},
 issue_date = {April 2010},
 volume = {53},
 number = {4},
 month = apr,
 year = {2010},
 issn = {0001-0782},
 pages = {50--58},
 numpages = {9},
 doi = {10.1145/1721654.1721672},
 acmid = {1721672},
 publisher = {ACM},
 address = {New York, NY, USA}
}
% url = {http://doi.acm.org.ezp.lib.unimelb.edu.au/10.1145/1721654.1721672},

% distributed computing

@book{Coulouris:2011:DSC:2029110,
 author = {Coulouris, George and Dollimore, Jean and Kindberg, Tim and Blair, Gordon},
 title = {Distributed Systems: Concepts and Design},
 year = {2011},
 isbn = {0132143011, 9780132143011},
 edition = {5th},
 publisher = {Addison-Wesley Publishing Company},
 address = {USA}
}

% autonomic computing

@ARTICLE{1160055,
author={J. O. Kephart and D. M. Chess},
journal={Computer},
title={The vision of autonomic computing},
year={2003},
volume={36},
number={1},
pages={41-50},
keywords={DP industry;autonomic computing;corporate-wide computing systems;self-managing computing systems;software complexity crisis;Biology computing;Computer industry;Computer vision;Crisis management;Environmental management;Humans;Internet;LAN interconnection;Pervasive computing;Technological innovation},
doi={10.1109/MC.2003.1160055},
ISSN={0018-9162},
month={Jan},}

@article{Huebscher:2008:SAC:1380584.1380585,
 author = {Huebscher, Markus C. and McCann, Julie A.},
 title = {A Survey of Autonomic Computing\&Mdash;Degrees, Models, and Applications},
 journal = {ACM Comput. Surv.},
 issue_date = {August 2008},
 volume = {40},
 number = {3},
 month = aug,
 year = {2008},
 issn = {0360-0300},
 pages = {7:1--7:28},
 articleno = {7},
 numpages = {28},
 url = {http://doi.acm.org.ezp.lib.unimelb.edu.au/10.1145/1380584.1380585},
 doi = {10.1145/1380584.1380585},
 acmid = {1380585},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {Autonomic computing, self-adaptive, self-healing systems}
}

% auto-scaling

@article{Chenhao,
  author    = {Chenhao Qu and
               Rodrigo N. Calheiros and
               Rajkumar Buyya},
  title     = {Auto-scaling Web Applications in Clouds: {A} Taxonomy and Survey},
  journal   = {CoRR},
  volume    = {abs/1609.09224},
  year      = {2016},
  archivePrefix = {arXiv},
  eprint    = {1609.09224},
  timestamp = {Wed, 07 Jun 2017 14:42:09 +0200},
  biburl    = {https://dblp.org/rec/bib/journals/corr/QuCB16},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
% url       = {http://arxiv.org/abs/1609.09224},

@inproceedings{Arabnejad,
 author = {Arabnejad, Hamid and Pahl, Claus and Jamshidi, Pooyan and Estrada, Giovani},
 title = {A Comparison of Reinforcement Learning Techniques for Fuzzy Cloud Auto-Scaling},
 booktitle = {Proceedings of the 17th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing},
 series = {CCGrid '17},
 year = {2017},
 isbn = {978-1-5090-6610-0},
 location = {Madrid, Spain},
 pages = {64--73},
 numpages = {10},
 doi = {10.1109/CCGRID.2017.15},
 acmid = {3101121},
 publisher = {IEEE Press},
 address = {Piscataway, NJ, USA},
 keywords = {Cloud Computing, Controller, Fuzzy Logic, OpenStack, Orchestration, Q-Learning, SARSA}
}
% url = {https://doi-org.ezp.lib.unimelb.edu.au/10.1109/CCGRID.2017.15},

@article{LoridoBotran,
 author = {Lorido-Botran, Tania and Miguel-Alonso, Jose and Lozano, Jose A.},
 title = {A Review of Auto-scaling Techniques for Elastic Applications in Cloud Environments},
 journal = {J. Grid Comput.},
 issue_date = {December  2014},
 volume = {12},
 number = {4},
 month = dec,
 year = {2014},
 issn = {1570-7873},
 pages = {559--592},
 numpages = {34},
 doi = {10.1007/s10723-014-9314-7},
 acmid = {2693559},
 publisher = {Springer-Verlag New York, Inc.},
 address = {Secaucus, NJ, USA},
 keywords = {Auto-scaling, Cloud computing, Scalable applications, Service level agreement},
}
%  url = {http://dx.doi.org.ezp.lib.unimelb.edu.au/10.1007/s10723-014-9314-7},

% BoT

@article{Thai,
  author    = {Long Thai and
               Blesson Varghese and
               Adam Barker},
  title     = {A Survey and Taxonomy of Resource Optimisation for Executing Bag-of-Task
               Applications on Public Clouds},
  journal   = {CoRR},
  volume    = {abs/1711.08973},
  year      = {2017},
  url       = {http://arxiv.org/abs/1711.08973},
  archivePrefix = {arXiv},
  eprint    = {1711.08973},
  timestamp = {Sun, 03 Dec 2017 12:38:15 +0100},
  biburl    = {https://dblp.org/rec/bib/journals/corr/abs-1711-08973},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

% DevOps

@book{httermann2012devops,
  title={DevOps for Developers},
  author={Httermann, M.},
  isbn={9781430245704},
  lccn={2012472223},
  series={Expert's voice in Web development},
  url={https://books.google.com.au/books?id=JfUAkB8AA7EC},
  year={2012},
  publisher={Apress}
}

% ATHENA

@INPROCEEDINGS{HATC,
author={V. Nguyen and M. Shokr and A. Novak and T. Caelli},
booktitle={Proceedings of the 2016 ISMOR Conference},
title={A Reconfigurable Agent-Based Discrete Event Simulator for Helicopter Aircrew Training},
year={2016},}

@INPROCEEDINGS{8248116,
author={V. Nguyen and A. Novak and M. Shokr and K. Pash},
booktitle={2017 Winter Simulation Conference (WSC)},
title={Aircrew manpower supply modeling under change: An agent-based discrete event simulation approach},
year={2017},
volume={},
number={},
pages={4070-4081},
keywords={discrete event simulation;human resource management;labour resources;military computing;multi-agent systems;strategic planning;AB constraints;ADF;Australian Defence Force;DES;agent policies;agent-based constraints;aircrew manpower supply;aircrew training pipeline simulation;authentic representation;current hybrid modelling paradigm;discrete event simulation approach;discrete event simulation methodology;dynamic simulation system;interactive simulation system;simulation architecture;strategic manpower planning;Object oriented modeling;Runtime},
doi={10.1109/WSC.2017.8248116},
ISSN={},
month={Dec},}

@techreport{athenaAllDoc,
  title={ATHENA v1.0 Technical Documentation, User Guide, Administration Guide, Deployment Guide},
  author={ATHENA Developers},
  year={June 2018},
  institution={Melbourne eResearch Group, University of Melbourne}
}

@techreport{athenaTechDoc,
  title={ATHENA Technical Documentation v1.0},
  author={ATHENA Developers},
  year={June 2018},
  institution={Melbourne eResearch Group, University of Melbourne}
}

@techreport{athenaUserDoc,
  title={ATHENA User Guide v1.0},
  author={ATHENA Developers},
  year={June 2018},
  institution={Melbourne eResearch Group, University of Melbourne}
}

@techreport{athenaAdminDoc,
  title={ATHENA Administration Guide  v1.0},
  author={ATHENA Developers},
  year={June 2018},
  institution={Melbourne eResearch Group, University of Melbourne}
}

@techreport{athenaDeployDoc,
  title={ATHENA Deployment Guide v1.0},
  author={ATHENA Developers},
  year={June 2018},
  institution={Melbourne eResearch Group, University of Melbourne}
}

% examples

@article{ToosiSB18,
  author    = {Adel Nadjaran Toosi and
               Richard O. Sinnott and
               Rajkumar Buyya},
  title     = {Resource provisioning for data-intensive applications with deadline
               constraints on hybrid clouds using Aneka},
  journal   = {Future Generation Comp. Syst.},
  volume    = {79},
  pages     = {765--775},
  year      = {2018},
  doi       = {10.1016/j.future.2017.05.042},
  timestamp = {Tue, 28 Nov 2017 16:10:54 +0100},
  biburl    = {https://dblp.org/rec/bib/journals/fgcs/ToosiSB18},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
%   url       = {https://doi.org/10.1016/j.future.2017.05.042},

@article{Sinnott:2016:SCS:3008079.3008128,
 author = {Sinnott, R. O. and Voorsluys, W.},
 title = {A Scalable Cloud-based System for Data-intensive Spatial Analysis},
 journal = {Int. J. Softw. Tools Technol. Transf.},
 issue_date = {November  2016},
 volume = {18},
 number = {6},
 month = nov,
 year = {2016},
 issn = {1433-2779},
 pages = {587--605},
 numpages = {19},
 doi = {10.1007/s10009-015-0398-6},
 acmid = {3008128},
 publisher = {Springer-Verlag},
 address = {Berlin, Heidelberg},
 keywords = {Cloud computing, Geospatial systems, Spatial analysis, Urban research, e-Infrastructure}
}
%  url = {http://dx.doi.org.ezp.lib.unimelb.edu.au/10.1007/s10009-015-0398-6},

@techreport{swarmKubeBench,
  title={Comparison and Benchmarking of Cloud-based Container Orchestration Technologies},
  author={Yao Pan and Min-ying Chen},
  year={Nov 2017},
  institution={Melbourne eResearch Group, University of Melbourne}
}

@article{swarmKubeBench2,
  title={A Performance Comparison of Cloud-based Container Orchestration Tools},
  author={Yao Pan
  		and Min-ying Chen
  		and Richard O. Sinnott
  		and Francisco Brasileiro},
  year={December 2017},
  journal = {submitted to Journal of Concurrency and Computation: Practice and Experience},
}

% kube

@techreport{kubeDoc,
  title={Kubernetes Documentation},
  author={Kubernetes Developers},
  url={https://kubernetes.io/docs/},
  note={v1.10, access June 2018}
}

@article{Burns:2016:BOK:2898442.2898444,
 author = {Burns, Brendan and Grant, Brian and Oppenheimer, David and Brewer, Eric and Wilkes, John},
 title = {Borg, Omega, and Kubernetes},
 journal = {Queue},
 issue_date = {January-February 2016},
 volume = {14},
 number = {1},
 month = jan,
 year = {2016},
 issn = {1542-7730},
 pages = {10:70--10:93},
 articleno = {10},
 numpages = {24},
 url = {http://doi.acm.org.ezp.lib.unimelb.edu.au/10.1145/2898442.2898444},
 doi = {10.1145/2898442.2898444},
 acmid = {2898444},
 publisher = {ACM},
 address = {New York, NY, USA}
}

@article{44843,
title	= {Borg, Omega, and   Kubernetes},
author	= {Brendan Burns and Brian Grant and David Oppenheimer and Eric Brewer and John Wilkes},
year	= {2016},
URL	= {http://queue.acm.org/detail.cfm?id=2898444},
journal	= {ACM Queue},
pages	= {70--93},
volume	= {14}
}

@inproceedings{43438,
title	= {Large-scale cluster management at {Google} with {Borg}},
author	= {Abhishek Verma and Luis Pedrosa and Madhukar R. Korupolu and David Oppenheimer and Eric Tune and John Wilkes},
year	= {2015},
booktitle	= {Proceedings of the European Conference on Computer Systems (EuroSys)},
address	= {Bordeaux, France}
}

@book{Hightower:2017:KUR:3175917,
 author = {Hightower, Kelsey and Burns, Brendan and Beda, Joe},
 title = {Kubernetes: Up and Running Dive into the Future of Infrastructure},
 year = {2017},
 isbn = {1491935677, 9781491935675},
 edition = {1st},
 publisher = {O'Reilly Media, Inc.},
}

repository: victorskl/auto-scaling-thesis

repo_name: victorskl/auto-scaling-thesis


text:
package model

import (
	"meshalka/database"
	"database/sql"
	"fmt"
)

const (
	maxNameLength = 255
	drinkType     = 0
	cocktailType  = 1
)

type Drink struct {
	Id         uint64  `json:"id"`
	Name       string  `json:"name"`
	Type       int     `json:"type"`
	Components []Drink `json:"components"`
}

type DrinkRepository interface {
	IsNameValid(name string) bool
	Add(name string, t int) (int, error)
	List() (map[uint64]Drink, error)
	Remove(id int) (bool, error)
	Edit(id uint64, newName string) (int, error)
	AddCocktailElement(cocktailId uint64, drinkId uint64, quantity uint64) (int, error)
	RemoveWithExclusion(cocktailId uint64, excludedKeys string) error
}

type drinkRepository struct {
	db database.Database
}

func NewDrinkRepository(db database.Database) DrinkRepository {
	return &drinkRepository{db}
}

func (dr *drinkRepository) IsNameValid(name string) bool {
	l := len(name)
	return l > 0 && l <= maxNameLength
}

func (dr *drinkRepository) RemoveWithExclusion(cocktailId uint64, excludedKeys string) error {
	con, err := dr.db.Connection()
	if err != nil {
		return err
	}

	_, err = con.Query(`DELETE FROM cocktail_element WHERE cocktail_id = ? AND drink_id NOT IN (?)`, cocktailId, excludedKeys)
	return err
}

func (dr *drinkRepository) AddCocktailElement(cocktailId uint64, drinkId uint64, quantity uint64) (int, error) {
	return getIntFunctionResult(dr.db, func(con *sql.DB) (*sql.Rows, error) {
		return con.Query(`SELECT add_cocktail_element(?, ?, ?)`, cocktailId, drinkId, quantity)
	})
}

func (dr *drinkRepository) Add(name string, t int) (int, error) {
	if !dr.IsNameValid(name) {
		return 0, fmt.Errorf("incorrect name")
	}

	if t != cocktailType {
		t = drinkType
	}

	res, err := getIntFunctionResult(dr.db, func(con *sql.DB) (*sql.Rows, error) {
		return con.Query(`SELECT add_drink(?, ?)`, name, t)
	})

	if err != nil {
		return 0, err
	} else if res == -1 {
		return 0, fmt.Errorf("error while adding user with name %s and type %d", name, t)
	}

	return res, nil
}

func (dr *drinkRepository) Remove(id int) (bool, error) {
	return getBoolResult(getIntFunctionResult(dr.db, func(con *sql.DB) (*sql.Rows, error) {
		return con.Query(`SELECT remove_drink(?)`, id)
	}))
}

func (dr *drinkRepository) List() (map[uint64]Drink, error) {
	return dr.selectDrinks(func(con *sql.DB) (*sql.Rows, error) {
		return con.Query(`
			SELECT
			  d.drink_id,
			  d.drink_name,
			  d.drink_type,
			  COALESCE(subD.drink_id, 0),
			  COALESCE(subD.drink_name, '')
			FROM
			  drink d
			  LEFT JOIN cocktail_element ce ON d.drink_id = ce.cocktail_id
			  LEFT JOIN drink subD ON ce.drink_id = subD.drink_id
			ORDER BY
			  d.drink_type ASC
		`)
	})
}

func (dr *drinkRepository) Edit(id uint64, newName string) (int, error) {
	if !dr.IsNameValid(newName) {
		return 0, fmt.Errorf("incorrect new name")
	}

	res, err := getIntFunctionResult(dr.db, func(con *sql.DB) (*sql.Rows, error) {
		return con.Query(`SELECT edit_drink(?, ?)`, id, newName)
	})

	if err != nil {
		return 0, err
	} else if res == -1 {
		return 0, fmt.Errorf("error while update user with new name %s and id %d", newName, id)
	}

	return res, nil
}

func (dr *drinkRepository) selectDrinks(q querier) (map[uint64]Drink, error) {
	con, err := dr.db.Connection()
	if err != nil {
		return nil, err
	}

	rows, err := q(con)
	if err != nil {
		return nil, err
	}
	defer rows.Close()

	return fetchDrinks(rows)
}

func fetchDrinks(rows *sql.Rows) (map[uint64]Drink, error) {
	drink := Drink{Components:[]Drink{}}
	var subDrink Drink
	drinks := make(map[uint64]Drink)

	for rows.Next() {
		err := rows.Scan(&drink.Id, &drink.Name, &drink.Type, &subDrink.Id, &subDrink.Name)
		if err != nil {
			return nil, err
		}

		if drink.Type == cocktailType && subDrink.Id > 0 {
			drink.Components = append(drink.Components, subDrink)
		}
		drinks[drink.Id] = drink
	}

	return drinks, nil
}

repository: ivan-uskov/meshalka

repo_name: ivan-uskov/meshalka


text:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
FindPerlLibs
------------

Find Perl libraries

This module finds if PERL is installed and determines where the
include files and libraries are.  It also determines what the name of
the library is.  This code sets the following variables:

::

  PERLLIBS_FOUND    = True if perl.h & libperl were found
  PERL_INCLUDE_PATH = path to where perl.h is found
  PERL_LIBRARY      = path to libperl
  PERL_EXECUTABLE   = full path to the perl binary

The minimum required version of Perl can be specified using the
standard syntax, e.g.  find_package(PerlLibs 6.0)

::

  The following variables are also available if needed
  (introduced after CMake 2.6.4)

::

  PERL_SITESEARCH     = path to the sitesearch install dir (-V:installsitesearch)
  PERL_SITEARCH       = path to the sitelib install directory (-V:installsitearch)
  PERL_SITELIB        = path to the sitelib install directory (-V:installsitelib)
  PERL_VENDORARCH     = path to the vendor arch install directory (-V:installvendorarch)
  PERL_VENDORLIB      = path to the vendor lib install directory (-V:installvendorlib)
  PERL_ARCHLIB        = path to the core arch lib install directory (-V:archlib)
  PERL_PRIVLIB        = path to the core priv lib install directory (-V:privlib)
  PERL_UPDATE_ARCHLIB = path to the update arch lib install directory (-V:installarchlib)
  PERL_UPDATE_PRIVLIB = path to the update priv lib install directory (-V:installprivlib)
  PERL_EXTRA_C_FLAGS = Compilation flags used to build perl
#]=======================================================================]

# find the perl executable
include(${CMAKE_CURRENT_LIST_DIR}/FindPerl.cmake)

if (PERL_EXECUTABLE)

  function (perl_get_info _pgi_info tag)
    cmake_parse_arguments(_PGI "IS_PATH" "" "" ${ARGN})

    set (${_pgi_info} NOTFOUND PARENT_SCOPE)

    execute_process(COMMAND "${PERL_EXECUTABLE}" -V:${tag}
      OUTPUT_VARIABLE result
      RESULT_VARIABLE status)

    if (NOT status)
      string(REGEX REPLACE "${tag}='([^']*)'.*" "\\1" result "${result}")
      if (_PGI_IS_PATH)
        file(TO_CMAKE_PATH "${result}" result)
      endif()
      set (${_pgi_info} "${result}" PARENT_SCOPE)
    endif ()
  endfunction()

  ### PERL_PREFIX
  perl_get_info(PERL_PREFIX prefix IS_PATH)

  ### PERL_ARCHNAME
  perl_get_info(PERL_ARCHNAME archname)

  ### PERL_EXTRA_C_FLAGS
  perl_get_info(PERL_EXTRA_C_FLAGS cppflags)

  ### PERL_SITESEARCH
  perl_get_info(PERL_SITESEARCH installsitesearch IS_PATH)

  ### PERL_SITEARCH
  perl_get_info(PERL_SITEARCH installsitearch IS_PATH)

  ### PERL_SITELIB
  perl_get_info(PERL_SITELIB installsitelib IS_PATH)

  ### PERL_VENDORARCH
  perl_get_info(PERL_VENDORARCH installvendorarch IS_PATH)

  ### PERL_VENDORLIB
  perl_get_info(PERL_VENDORLIB installvendorlib IS_PATH)

  ### PERL_ARCHLIB
  perl_get_info(PERL_ARCHLIB archlib IS_PATH)

  ### PERL_PRIVLIB
  perl_get_info(PERL_PRIVLIB privlib IS_PATH)

  ### PERL_UPDATE_ARCHLIB
  perl_get_info(PERL_UPDATE_ARCHLIB installarchlib IS_PATH)

  ### PERL_UPDATE_PRIVLIB
  perl_get_info(PERL_UPDATE_PRIVLIB installprivlib IS_PATH)

  ### PERL_POSSIBLE_LIBRARY_NAMES
  perl_get_info(PERL_POSSIBLE_LIBRARY_NAMES libperl)
  if (NOT PERL_POSSIBLE_LIBRARY_NAMES)
    set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
  endif()
  if (CMAKE_SYSTEM_NAME MATCHES "MSYS|CYGWIN")
    # on MSYS and CYGWIN environments, current perl -V:libperl gives shared library name
    # rather than the import library. So, extends possible library names
    list (APPEND PERL_POSSIBLE_LIBRARY_NAMES perl)
  endif()

  ### PERL_INCLUDE_PATH
  find_path(PERL_INCLUDE_PATH
    NAMES
      perl.h
    PATHS
      "${PERL_UPDATE_ARCHLIB}/CORE"
      "${PERL_ARCHLIB}/CORE"
      /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
      /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
      /usr/lib/perl5/${PERL_VERSION_STRING}/CORE
      /usr/lib/perl/${PERL_VERSION_STRING}/CORE
  )

  ### PERL_LIBRARY
  find_library(PERL_LIBRARY
    NAMES
      ${PERL_POSSIBLE_LIBRARY_NAMES}
    PATHS
      "${PERL_UPDATE_ARCHLIB}/CORE"
      "${PERL_ARCHLIB}/CORE"
      /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
      /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
      /usr/lib/perl5/${PERL_VERSION_STRING}/CORE
      /usr/lib/perl/${PERL_VERSION_STRING}/CORE
  )

endif ()

include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
                                           VERSION_VAR PERL_VERSION_STRING)

# Introduced after CMake 2.6.4 to bring module into compliance
set(PERL_INCLUDE_DIR  ${PERL_INCLUDE_PATH})
set(PERL_INCLUDE_DIRS ${PERL_INCLUDE_PATH})
set(PERL_LIBRARIES    ${PERL_LIBRARY})
# For backward compatibility with CMake before 2.8.8
set(PERL_VERSION ${PERL_VERSION_STRING})

mark_as_advanced(
  PERL_INCLUDE_PATH
  PERL_LIBRARY
)


text:
package users

import (
	"encoding/json"
	"log"
	"net/http"

	usersService "github.com/applinh/kaepora/services/users"
	utilserrors "github.com/applinh/kaepora/utils/errors"
)

// SignIn is the route handler to sign a user up
func GetUsernames(w http.ResponseWriter, r *http.Request) {
	w.Header().Set("Content-Type", "application/json")

	res, err := usersService.GetUsernames()

	if err != nil {
		log.Println(err)
		utilserrors.SendHTTPError(w, http.StatusInternalServerError, "Internal error occured while reading DB : "+err.Error())
	}

	responseJSON, _ := json.Marshal(res)

	w.WriteHeader(http.StatusOK)
	w.Write(responseJSON)

}

repository: AppliNH/Kaepora

repo_name: AppliNH/Kaepora


text:
package shell

import (
	"io"
	"os"

	"github.com/tsaikd/KDGoLib/errutil"
)

// errors
var (
	ErrorNoOutputInBrocaster  = errutil.NewFactory("no output in brocaster")
	ErrorOutputCountMismatch2 = errutil.NewFactory("output count expect %d but got %d")
)

func newBrocaster() *brocaster {
	return &brocaster{
		outputs:    []io.Writer{},
		closeFuncs: []closeFunc{},
	}
}

type brocaster struct {
	outputs    []io.Writer
	closeFuncs []closeFunc
}

type closeFunc func() (err error)

var _ io.WriteCloser = brocaster{}

func (t brocaster) Write(p []byte) (n int, err error) {
	var errs = []error{}
	var ns = []int{}

	if len(t.outputs) < 1 {
		return 0, ErrorNoOutputInBrocaster.New(nil)
	}

	for _, output := range t.outputs {
		bn, berr := output.Write(p)
		if berr != nil {
			errs = append(errs, berr)
		} else {
			ns = append(ns, bn)
		}
	}

	// check output result
	if len(ns) > 0 {
		n = ns[0]
		for _, bn := range ns[1:] {
			if n != bn {
				return 0, ErrorOutputCountMismatch2.New(nil, n, bn)
			}
		}
	}

	if len(errs) > 0 {
		return n, errutil.NewErrors(errs...)
	}

	return n, nil
}

func (t brocaster) Close() error {
	var errs = []error{}

	for _, closer := range t.closeFuncs {
		if err := closer(); err != nil {
			errs = append(errs, err)
		}
	}

	if len(errs) > 0 {
		return errutil.NewErrors(errs...)
	}

	return nil
}

func (t *brocaster) AddOutput(output io.Writer) {
	t.outputs = append(t.outputs, output)
}

func (t *brocaster) AddCloseFunc(closer closeFunc) {
	t.closeFuncs = append(t.closeFuncs, closer)
}

func (t *brocaster) AddFile(name string, flag int, perm os.FileMode) (err error) {
	cache := brocasterFileCache[name]
	if cache != nil {
		t.AddOutput(cache)
		return nil
	}

	file := newLazyFileWriter(name, flag, perm)
	t.AddOutput(file)
	t.AddCloseFunc(file.Close)
	brocasterFileCache[name] = file
	return nil
}

var brocasterFileCache = map[string]*lazyFileWriter{}

repository: tsaikd/godson

repo_name: tsaikd/godson


text:
package main

import (
	"fmt"
	"log"
	"sync"

	common "github.com/MuggleWei/babel-trader/src/babeltrader-common-go"
	okex "github.com/MuggleWei/babel-trader/src/babeltrader-okex-v3"
	"github.com/MuggleWei/cascade"
)

type OkexTradeService struct {
	Api           *okex.TradeApi
	ClientService *ClientService
	config        *okex.Config
	channels      map[string]bool
	channelMtx    sync.RWMutex
}

func NewOkexTradeService(config *OkexTradeConfig) *OkexTradeService {
	service := &OkexTradeService{
		Api:           okex.NewTradeApi(config.OkexConfig),
		ClientService: nil,
		config:        config.OkexConfig,
		channels:      make(map[string]bool),
	}

	service.Api.SetSpi(service)

	return service
}

func (this *OkexTradeService) Run() {
	err := this.Api.Run()
	if err != nil {
		panic(err)
	}
}

///////////////// req /////////////////
func (this *OkexTradeService) InsertOrder(peer *cascade.Peer, order *common.MessageOrder) (string, error) {
	if order.ProductType == "future" {
		// TODO:
	} else if order.ProductType == "spot" {
		okexOrder := okex.Order{
			InstrumentId: order.Symbol,
			OrderType:    order.OrderType,
			Side:         order.Dir,
		}
		if order.OrderType == "limit" {
			okexOrder.Price = fmt.Sprintf("%v", order.Price)
			okexOrder.Size = fmt.Sprintf("%v", order.Amount)
		} else if order.OrderType == "market" {
			if order.Dir == "buy" {
				okexOrder.Notional = fmt.Sprintf("%v", order.TotalPrice)
			} else {
				okexOrder.Size = fmt.Sprintf("%v", order.Amount)
			}
		}
		var ret okex.SpotOrderRet
		_, err := this.Api.InsertOrder(&okexOrder, "spot", &ret)
		if err != nil {
			return "", err
		}

		return ret.OrderId, nil
	} else {
		// TODO:
	}

	return "", nil
}

func (this *OkexTradeService) CancelOrder(peer *cascade.Peer, order *common.MessageOrder) (string, error) {
	if order.ProductType == "future" {
		// TODO:
	} else if order.ProductType == "spot" {
		okexOrder := okex.Order{
			InstrumentId: order.Symbol,
		}

		var ret okex.SpotOrderRet
		_, err := this.Api.CancelOrder(&okexOrder, "spot", order.OutsideId, &ret)
		if err != nil {
			return "", err
		}

		return ret.OrderId, nil
	} else {
		// TODO:
	}

	return "", nil
}

///////////////// trade spi /////////////////
func (this *OkexTradeService) OnConnected(peer *cascade.Peer) {
	log.Printf("[Info] okex trade connected: %v\n", peer.Conn.RemoteAddr().String())

	err := this.Api.Login()
	if err != nil {
		log.Printf("[Error] failed invoke trade api login: %v\n", err.Error())
		panic(err)
	}
}
func (this *OkexTradeService) OnDisconnected(peer *cascade.Peer) {
	log.Printf("[Warning] okex trade disconnected: %v\n", peer.Conn.RemoteAddr().String())

	this.channelMtx.Lock()
	defer this.channelMtx.Unlock()
	for channel, _ := range this.channels {
		this.channels[channel] = false
	}
}

func (this *OkexTradeService) OnLogin(msg *okex.RspCommon) {
	log.Printf("[Info] OnLogin: %+v\n", *msg)

	this.channelMtx.Lock()
	defer this.channelMtx.Unlock()
	if len(this.channels) == 0 {
		for _, channel := range this.config.TradeSubTopics {
			this.channels[channel] = false
		}
		this.Api.Subscribe(this.config.TradeSubTopics)
	} else {
		channels := []string{}
		for channel, _ := range this.channels {
			channels = append(channels, channel)
		}
		this.Api.Subscribe(channels)
	}
}
func (this *OkexTradeService) OnError(msg *okex.RspCommon) {
	log.Printf("[Warning] OnError: %+v\n", msg)
}

func (this *OkexTradeService) OnSub(msg *okex.RspCommon) {
	log.Printf("[Info] success sub channel: %v\n", msg.Channel)

	this.channelMtx.Lock()
	defer this.channelMtx.Unlock()
	this.channels[msg.Channel] = true
}
func (this *OkexTradeService) OnUnsub(msg *okex.RspCommon) {
	log.Printf("[Info] success unsub channel: %v\n", msg.Channel)

	this.channelMtx.Lock()
	defer this.channelMtx.Unlock()
	delete(this.channels, msg.Channel)
}

func (this *OkexTradeService) OnOrder(msg *okex.RspCommon) {
	// TODO:
}
func (this *OkexTradeService) OnPosition(msg *okex.RspCommon) {
	// TODO:
}
func (this *OkexTradeService) OnAccount(msg *okex.RspCommon) {
	// TODO:
}

repository: kinkocho/babel-trader

repo_name: kinkocho/babel-trader


text:
SUMMARY = "Tools to generate block map (AKA bmap) and flash images using bmap"
DESCRIPTION = "Bmap-tools - tools to generate block map (AKA bmap) and flash images using \
bmap. Bmaptool is a generic tool for creating the block map (bmap) for a file, \
and copying files using the block map. The idea is that large file containing \
unused blocks, like raw system image files, can be copied or flashed a lot \
faster with bmaptool than with traditional tools like "dd" or "cp"."
HOMEPAGE = "http://git.infradead.org/users/dedekind/bmap-tools.git"
SECTION = "devel/python"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

SRC_URI = "ftp://ftp.infradead.org/pub/bmap-tools/bmap-tools-${PV}.tgz"
SRC_URI[md5sum] = "92cdad1cb4dfa0cca7176c8e22752616"
SRC_URI[sha256sum] = "cc6c7f7dc0a37e2a32deb127308e24e6c4b80bfb54f3803c308efab02bf2d434"

inherit setuptools deploy

RDEPENDS_${PN} += "python-compression python-core python-unittest"

BBCLASSEXTEND = "nativesdk native"

do_install_append_class-native() {
    sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' ${D}${bindir}/bmaptool
}

do_deploy[sstate-outputdirs] = "${DEPLOY_DIR_TOOLS}"
do_deploy_class-native() {
    cp bmaptool __main__.py
    python -m zipfile -c bmaptool.zip bmaptools __main__.py
    echo '#!/usr/bin/env python' | cat - bmaptool.zip > bmaptool-standalone
    install -d ${DEPLOYDIR}
    install -m 0755 bmaptool-standalone ${DEPLOYDIR}/bmaptool-${PV}
    rm -f ${DEPLOYDIR}/bmaptool
    ln -sf ./bmaptool-${PV} ${DEPLOYDIR}/bmaptool
}

do_deploy() {
        :
}

addtask deploy before do_package after do_install

repository: bokibi/meta-ostro

repo_name: bokibi/meta-ostro


text:
package task

import (
	"encoding/json"
	"fmt"
	"github.com/ohsu-comp-bio/funnel/cmd/client"
	"io"
	"io/ioutil"
)

// Create runs the "task create" CLI command, connecting to the server,
// calling CreateTask, and writing output to the given writer.
// Tasks are loaded from the "messages" arg. "messages" may contain either
// file paths or JSON objects.
func Create(server string, messages []string, writer io.Writer) error {
	cli := client.NewClient(server)
	res := []string{}

	for _, task := range messages {
		var err error
		var taskMessage []byte

		if isJSON(task) {
			taskMessage = []byte(task)
		} else {
			taskMessage, err = ioutil.ReadFile(task)
			if err != nil {
				return err
			}
		}

		r, err := cli.CreateTask(taskMessage)
		if err != nil {
			return err
		}
		res = append(res, r.Id)
	}

	for _, x := range res {
		fmt.Fprintln(writer, x)
	}

	return nil
}

func isJSON(s string) bool {
	var js map[string]interface{}
	return json.Unmarshal([]byte(s), &js) == nil
}

repository: jeremiahsavage/funnel

repo_name: jeremiahsavage/funnel


text:
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0

HOMEPAGE = "https://booting.oniroproject.org/distro/components/pim435"
SUMMARY = "A userspace driver application for PIM435 written in C"
DESCRIPTION = "A userspace driver application for PIM435 (Pimoroni LED matrix) \
written in C"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSES/MIT.txt;md5=7dda4e90ded66ab88b86f76169f28663"

SRC_URI = "git://gitlab.eclipse.org/eclipse/oniro-blueprints/core/pim435;protocol=https;branch=main"
SRCREV = "445ed623ec8d3ecbb1d566900b4ef3fb3031d689"
S = "${WORKDIR}/git"

DEPENDS = "i2c-tools"

EXTRA_OEMAKE += "DESTDIR=${D}"

do_install() {
    oe_runmake install
}

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded