text:
package golaunch

import (
	"context"
	"errors"
	"strings"
	"time"

	"github.com/go-ble/ble"
)

var (
	// Bluetooth device name of the Launch
	name = "Launch"
	// The main service UUID for the Launch
	serviceID = ble.MustParse("88f80580-0000-01e6-aace-0002a5d5c51b")
	// Command characteristic (Write)
	cmdCharID = ble.MustParse("88f80581-0000-01e6-aace-0002a5d5c51b")
	// Touch events characteristic (Notifications)
	touchCharID = ble.MustParse("88f80582-0000-01e6-aace-0002a5d5c51b")
	// Mode? characteristic (Read/Write)
	modeCharID = ble.MustParse("88f80583-0000-01e6-aace-0002a5d5c51b")
)

var (
	// ErrDisconnected is the error returned when there is no connection.
	ErrDisconnected = errors.New("disconnected")
	// ErrDiscover is the error returned when there was an issue
	// discovering the Launch.
	ErrDiscover = errors.New("could not discover launch")
	// ErrInit is the error returned when there was an issue initializing
	// the Launch.
	ErrInit = errors.New("initialization error")
	// ErrUnknownMode is the error returned when someone wants to send a
	// (yet) unknown mode.
	ErrUnknownMode = errors.New("unknown mode")
)

var (
	// Time for the device to get ready before sending data.
	readyTime = time.Second * 2
	// Minimum amount of time between write operations.
	threshold = time.Millisecond * 100
	// Amount of write events to buffer before blocking.
	writeBufferSize = 10
)

const (
	// modeReadValuesAsBytes will cause the Launch to read position/speed
	// values as bytes instead of BCD. Also seems to fix it from having
	// spasms.
	modeReadValuesAsBytes = 0x00
)

// Launch interface represents a device that can move like a Launch.
type Launch interface {
	// Connect will (re)connect to the Launch.
	Connect(ctx context.Context) error

	// Disconnect will disconnect to the Launch.
	Disconnect()

	// Move moves to position at speed in percent.
	Move(position, speed int)

	// HandleDisconnect registers a function to call when a device disconnects
	HandleDisconnect(f func())
}

// NewLaunch creates and returns a Launch client that can be used to
// communicate.
func NewLaunch() Launch {
	l := &launch{
		disconnect: make(chan bool),
		wbuffer:    make(chan [2]byte, writeBufferSize),
		limiter:    time.Tick(threshold),
	}
	return l
}

// NewLaunchWithDevice creates and returns a Launch client that can be used to
// communicate over specified Bluetooth device.
func NewLaunchWithDevice(d ble.Device) Launch {
	l, _ := NewLaunch().(*launch)
	l.device = d
	ble.SetDefaultDevice(d)
	return l

}

// launch is the structure used to manage the connection to a Launch.
type launch struct {
	device ble.Device
	client ble.Client

	cmd  *ble.Characteristic
	mode *ble.Characteristic

	disconnect chan bool
	wbuffer    chan [2]byte
	limiter    <-chan time.Time

	disconnectFunc func()
}

// Connect initializes configured Bluetooth device and creates a connection to
// a Launch.
func (l *launch) Connect(ctx context.Context) (err error) {
	// Claim a Bluetooth device
	if l.device == nil {
		l.device, err = NewDefaultDevice()
		if err != nil {
			return err
		}
		ble.SetDefaultDevice(l.device)
	}

	// Still connected
	if l.client != nil {
		return nil
	}

	// Discover the Launch and it's characteristics
	err = l.discover(ctx)
	if err != nil {
		return err
	}

	// Give the Launch a little bit of time to get ready
	<-time.After(readyTime)

	// Put the Launch into a mode that it will actually work well
	err = l.writeMode(modeReadValuesAsBytes)
	if err != nil {
		l.client.CancelConnection()
		l.cleanupClient()
		return ErrInit
	}

	// Handle disconnects
	stopWriting := make(chan bool)
	go func() {
		select {
		case <-l.client.Disconnected():
		case <-l.disconnect:
			l.client.CancelConnection()
		}
		stopWriting <- true
		l.cleanupClient()

		if l.disconnectFunc != nil {
			l.disconnectFunc()
		}
	}()
	// Start the goroutine that will write commands
	go l.writeFromBuffer(stopWriting)

	return nil
}

// discover scans, connects and discovers characteristics of a Launch.
func (l *launch) discover(ctx context.Context) error {
	// Connect to Launch
	client, err := ble.Connect(ctx, launchAdvFilter)
	if err != nil {
		return err
	}

	// Discover Service
	s, err := client.DiscoverServices([]ble.UUID{serviceID})
	if err != nil {
		return err
	}
	if len(s) != 1 {
		return ErrDiscover
	}

	// Discover Launch characteristics
	cs, err := client.DiscoverCharacteristics(
		[]ble.UUID{cmdCharID, modeCharID}, s[0])
	if err != nil {
		return err
	}
	var cmd, mode *ble.Characteristic
	for _, c := range cs {
		switch {
		case c.UUID.Equal(cmdCharID):
			cmd = c
		case c.UUID.Equal(modeCharID):
			mode = c
		}
	}
	if cmd == nil || mode == nil {
		return ErrDiscover
	}

	// Store found device characteristics
	l.client = client
	l.cmd = cmd
	l.mode = mode

	return nil
}

// launchAdvFilter implements ble.AdvFilter and filters for a Launch.
func launchAdvFilter(a ble.Advertisement) bool {
	if strings.ToUpper(a.LocalName()) == strings.ToUpper(name) {
		return true
	}
	return false
}

// cleanupClient removes all references to a disconnected client.
func (l *launch) cleanupClient() {
	if l.client != nil {
		l.client = nil
		l.mode = nil
		l.cmd = nil
	}
}

// Disconnect cancels the connection with the Launch.
func (l *launch) Disconnect() {
	select {
	case l.disconnect <- true:
	default:
	}
}

// writeMode will send specified mode to the Launch. Only support putting
// the Launch in "read values as bytes", so it interprets values on the command
// channel as bytes instead of binary coded decimals.
func (l *launch) writeMode(c byte) error {
	if l.client == nil {
		return ErrDisconnected
	}
	if c == modeReadValuesAsBytes {
		err := l.client.WriteCharacteristic(l.mode, []byte{c}, false)
		return err
	}
	return ErrUnknownMode
}

// writeFromBuffer sends commands to the Launch that are stored in the write
// buffer. To stop this function send true on the l.stopWriting channel.
func (l *launch) writeFromBuffer(stopchan <-chan bool) {
	for {
		select {
		case stop := <-stopchan:
			if stop == true {
				return
			}
		case b := <-l.wbuffer:
			// Limit amount of writes to avoid disconnects
			<-l.limiter
			l.client.WriteCharacteristic(l.cmd, b[:], true)
		}
	}
}

// Move will move to the specified position at the desired speed.
// Position and speed are specified in percent.
func (l *launch) Move(position, speed int) {
	// Make sure we remain in the limits
	if position < 0 {
		position = 0
	} else if position > 99 {
		position = 99
	}

	// Don't go below 20% as very slow speeds seem to crash the Launch
	if speed < 20 {
		speed = 20
	} else if speed > 99 {
		speed = 99
	}

	data := [2]byte{byte(position), byte(speed)}
	l.wbuffer <- data
}

// HandleDisconnect registers a function that is called when the Launch
// disconnects.
func (l *launch) HandleDisconnect(f func()) {
	l.disconnectFunc = f
}

repository: funjack/golaunch

repo_name: funjack/golaunch


text:
@TechReport{g12note,
		author = {g12 working group},
		title = {g12 Analysis Procedures, Statistics and Systematics},
		year = {2016},
}

license: Unlicense

license_type: permissive

branch_name: refs/heads/master

gha_language: PostScript

extension: bib


text:
SUMMARY = "Base console image which includes OTA Lite, Docker, and OpenSSH support"

require lmp-image-common.inc

require ${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'lmp-feature-factory.inc', '', d)}
require ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'lmp-feature-wayland.inc', '', d)}
require lmp-feature-wireguard.inc
require lmp-feature-docker.inc
require lmp-feature-bluetooth.inc
require lmp-feature-wifi.inc
require lmp-feature-ota-utils.inc
require lmp-feature-softhsm.inc
require lmp-feature-jobserv.inc

require ${@bb.utils.contains('MACHINE_FEATURES', 'xeno4', 'lmp-feature-xeno4.inc', '', d)}
require ${@bb.utils.contains('MACHINE_FEATURES', 'optee', 'lmp-feature-optee.inc', '', d)}
require ${@bb.utils.contains('MACHINE_FEATURES', 'se05x', 'lmp-feature-se05x.inc', '', d)}
require ${@bb.utils.contains('MACHINE_FEATURES', 'tpm2', 'lmp-feature-tpm2.inc', '', d)}
require ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'lmp-feature-efi.inc', '', d)}
require ${@bb.utils.contains('MACHINE_FEATURES', 'jailhouse', 'lmp-feature-jailhouse.inc', '', d)}
require ${@bb.utils.contains('DISTRO_FEATURES', 'ima', 'lmp-feature-ima.inc', '', d)}
require ${@bb.utils.contains('DISTRO_FEATURES', 'lmpdebug', 'lmp-feature-debug.inc', '', d)}

IMAGE_FEATURES += "ssh-server-openssh"

CORE_IMAGE_BASE_INSTALL += " \
    kernel-modules \
    networkmanager-nmcli \
    git \
    packagegroup-core-full-cmdline-extended \
"

license: MIT

repository: foundriesio/meta-lmp

repo_name: foundriesio/meta-lmp

branch_name: refs/heads/main

gha_license_id: MIT

gha_language: BitBake

extension: bb


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

package frontend

import (
	"testing"
	"time"

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

func TestFuncs(t *testing.T) {
	//t.Parallel()

	Convey("Middleware Tests", t, func() {
		Convey("humanDuration", func() {
			Convey("3 hrs", func() {
				h := humanDuration(3 * time.Hour)
				So(h, ShouldEqual, "3 hrs")
			})

			Convey("2 hrs 59 mins", func() {
				h := humanDuration(2*time.Hour + 59*time.Minute)
				So(h, ShouldEqual, "2 hrs 59 mins")
			})
		})

		Convey("Format Commit Description", func() {
			Convey("linkify https://", func() {
				So(formatCommitDesc("https://foo.com"),
					ShouldEqual,
					"https://foo.com")
				Convey("but not http://", func() {
					So(formatCommitDesc("http://foo.com"), ShouldEqual, "http://foo.com")
				})
			})
			Convey("linkify b/ and crbug/", func() {
				So(formatCommitDesc("blah blah b/123456 blah"), ShouldEqual, "blah blah b/123456 blah")
				So(formatCommitDesc("crbug:foo/123456"), ShouldEqual, "crbug:foo/123456")
			})
			Convey("linkify Bug: lines", func() {
				So(formatCommitDesc("\nBug: 12345\n"), ShouldEqual, "\nBug: 12345\n")
				So(
					formatCommitDesc(" > > BugS=  12345, butter:12345"),
					ShouldEqual,
					" > > BugS=  12345, "+
						"butter:12345")
			})
		})
	})
}

extension: go


text:
//Time-stamp: <2017-01-26 02:43:10 hamada>
package exer

import (
	"golang.org/x/tour/pic"
	"image"
	"image/color"
)

type Image struct{}

func (recv *Image) ColorModel() color.Model {
	return color.RGBAModel
}

func (recv *Image) Bounds() image.Rectangle {
	return image.Rectangle{
		image.Point{0, 0},
		image.Point{100, 100},
	}
}

func (recv *Image) At(x, y int) color.Color {
	r := ((x + y) / 2) % 256
	g := (x * y) % 256
	b := ((x + y) / 2) % 256
	a := 255
	return color.RGBA{uint8(r), uint8(g), uint8(b), uint8(a)}
}

func Images() {
	m := Image{}
	pic.ShowImage(&m)
}

repository: thamada/goHolo

repo_name: thamada/goHolo


text:
package corpus

import "testing"
import "sort"

type testpair struct{
  source []byte
  spec map[string]int
}

var countTests = []testpair{

  { []byte(" "),
    map[string]int{},
  },

  { []byte("The quick brown fox"),
    map[string]int{
      "the": 1,
      "quick": 1,
      "brown": 1,
      "fox": 1,
    },
  },

  { []byte("The"),
    map[string]int{
      "the": 1,
    },
  },

  { []byte("?The quick brown fox"),
    map[string]int{
      "the": 1,
      "quick": 1,
      "brown": 1,
      "fox": 1,
    },
  },

  { []byte("The quick brown fox?"),
    map[string]int{
      "the": 1,
      "quick": 1,
      "brown": 1,
      "fox": 1,
    },
  },

  { []byte("The quick. brown fox!"),
    map[string]int{
      "the": 1,
      "quick": 1,
      "brown": 1,
      "fox": 1,
    },
  },

  { []byte("The quick the tHE"),
    map[string]int{
      "the": 3,
      "quick": 1,
    },
  },

  { []byte(" The quick brown fox "),
    map[string]int{
      "the": 1,
      "quick": 1,
      "brown": 1,
      "fox": 1,
    },
  },

  { []byte(" The the quick the brown The fox Fox "),
    map[string]int{
      "the": 4,
      "quick": 1,
      "brown": 1,
      "fox": 2,
    },
  },

  { []byte("string with 1,000"),
    map[string]int{
      "1,000": 1,
      "string": 1,
      "with": 1,
    },
  },

  { []byte("string with 1,000."),
    map[string]int{
      "1,000": 1,
      "string": 1,
      "with": 1,
    },
  },

  { []byte("string with 1,000, cool"),
    map[string]int{
      "1,000": 1,
      "cool": 1,
      "string": 1,
      "with": 1,
    },
  },
}

func TestCountWordFreq(t *testing.T){
  for _, pair := range countTests{
    result := Analyze(pair.source)
    for word, count := range result {
      if (count != pair.spec[word]) {
        t.Error(
          "For word", word,
          "expected count", pair.spec[word],
          "got", count,
        )
      }
    }
  }
}

type toWordTestPair struct{
  mp map[string]int
  spec []wordCount
}

var toWordTests = []toWordTestPair{

  {
    map[string]int{},
    []wordCount{},
  },

  {
    map[string]int{
      "the": 1,
    },
    []wordCount{
      {"the", 1},
    },
  },

  {
    map[string]int{
      "the": 4,
      "quick": 1,
      "brown": 1,
      "fox": 2,
    },
    []wordCount{
      {"the", 4},
      {"fox", 2},
      {"brown", 1},
      {"quick", 1},
    },
  },

  {
    map[string]int{
      "the": 1,
      "quick": 1,
      "brown": 1,
      "fox": 1,
    },
    []wordCount{
      {"brown", 1},
      {"fox", 1},
      {"quick", 1},
      {"the", 1},
    },
  },
}

func TestMapToWordCount(t *testing.T){
  for i, pair := range toWordTests {
    newarr := MapToWordCount(pair.mp)
    sort.Sort(FreqArr(newarr))
    for j, word_count := range newarr {
      if (word_count != pair.spec[j]) {
        t.Error(
          "For count", i,j,
          "expected ", pair.spec[j],
          "got", count,
        )
      }
    }
  }
}

repository: crajcan/saigo

repo_name: crajcan/saigo


text:
#
# This file is the startup recipe.
#

SUMMARY = "Simple startup application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://startup \
	"

S = "${WORKDIR}"

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

inherit update-rc.d

INITSCRIPT_NAME = "startup"
INITSCRIPT_PARAMS = "start 99 S ."

do_install() {
	install -d ${D}${sysconfdir}/init.d
	install -m 0755 ${S}/startup ${D}${sysconfdir}/init.d/startup
}

FILES_${PN} += "${sysconfdir}/*"

repository: jacobfeder/xilmake

repo_name: jacobfeder/xilmake


text:
package common

import (
	"fmt"
)

type Metadata struct {
	Name          string   `json:"name"`
	Kind          string   `json:"kind"`
	Description   string   `json:"description"`
	Default       string   `json:"default"`
	Options       []string `json:"options"`
	Must          bool     `json:"must"`
	Min           int      `json:"min"`
	Max           int      `json:"max"`
	LoadedOptions string
}

func NewMetadata() *Metadata {
	return &Metadata{}
}

func (m *Metadata) SetName(value string) *Metadata {
	m.Name = value
	return m
}

func (m *Metadata) SetKind(value string) *Metadata {
	m.Kind = value
	return m
}
func (m *Metadata) SetDescription(value string) *Metadata {
	m.Description = value
	return m
}

func (m *Metadata) SetDefault(value string) *Metadata {
	m.Default = value
	return m
}
func (m *Metadata) SetLoadedOptions(value string) *Metadata {
	m.LoadedOptions = value
	return m
}
func (m *Metadata) SetOptions(value []string) *Metadata {
	m.Options = value
	return m
}
func (m *Metadata) SetMust(value bool) *Metadata {
	m.Must = value
	return m
}

func (m *Metadata) SetMin(value int) *Metadata {
	m.Min = value
	return m
}
func (m *Metadata) SetMax(value int) *Metadata {
	m.Max = value
	return m
}
func (m *Metadata) Validate() error {
	if m.Name == "" {
		return fmt.Errorf("metadata name cannot be empty")
	}
	if m.Kind == "" {
		return fmt.Errorf("metadata kind cannot be empty")
	}

	if m.Description == "" {
		return fmt.Errorf("metadata description cannot be empty")
	}

	return nil
}

repository: kubemq-hub/builder

repo_name: kubemq-hub/builder


text:
@ARTICLE{2020NumPy-Array,
  author  = {Harris, Charles R. and Millman, K. Jarrod and
            van der Walt, Stéfan J and Gommers, Ralf and
            Virtanen, Pauli and Cournapeau, David and
            Wieser, Eric and Taylor, Julian and Berg, Sebastian and
            Smith, Nathaniel J. and Kern, Robert and Picus, Matti and
            Hoyer, Stephan and van Kerkwijk, Marten H. and
            Brett, Matthew and Haldane, Allan and
            Fernández del Río, Jaime and Wiebe, Mark and
            Peterson, Pearu and Gérard-Marchant, Pierre and
            Sheppard, Kevin and Reddy, Tyler and Weckesser, Warren and
            Abbasi, Hameer and Gohlke, Christoph and
            Oliphant, Travis E.},
  title   = {Array programming with {NumPy}},
  journal = {Nature},
  year    = {2020},
  volume  = {585},
  pages   = {357–362},
  doi     = {10.1038/s41586-020-2649-2}
}

repository: numpy/numpy

repo_name: numpy/numpy

gha_language: Python


text:
package core

import (
	"bytes"
	"flag"
	"fmt"
	"go/constant"
	"io/ioutil"
	"os"
	"os/exec"
	"path"
	"path/filepath"
	"reflect"
	"runtime"
	"strings"
	"testing"

	"github.com/go-delve/delve/pkg/goversion"
	"github.com/go-delve/delve/pkg/proc"
	"github.com/go-delve/delve/pkg/proc/test"
)

var buildMode string

func TestMain(m *testing.M) {
	flag.StringVar(&buildMode, "test-buildmode", "", "selects build mode")
	flag.Parse()
	if buildMode != "" && buildMode != "pie" {
		fmt.Fprintf(os.Stderr, "unknown build mode %q", buildMode)
		os.Exit(1)
	}
	os.Exit(test.RunTestsWithFixtures(m))
}

func assertNoError(err error, t testing.TB, s string) {
	if err != nil {
		_, file, line, _ := runtime.Caller(1)
		fname := filepath.Base(file)
		t.Fatalf("failed assertion at %s:%d: %s - %s\n", fname, line, s, err)
	}
}

func TestSplicedReader(t *testing.T) {
	data := []byte{}
	data2 := []byte{}
	for i := 0; i < 100; i++ {
		data = append(data, byte(i))
		data2 = append(data2, byte(i+100))
	}

	type region struct {
		data   []byte
		off    uint64
		length uint64
	}
	tests := []struct {
		name     string
		regions  []region
		readAddr uint64
		readLen  int
		want     []byte
	}{
		{
			"Insert after",
			[]region{
				{data, 0, 1},
				{data2, 1, 1},
			},
			0,
			2,
			[]byte{0, 101},
		},
		{
			"Insert before",
			[]region{
				{data, 1, 1},
				{data2, 0, 1},
			},
			0,
			2,
			[]byte{100, 1},
		},
		{
			"Completely overwrite",
			[]region{
				{data, 1, 1},
				{data2, 0, 3},
			},
			0,
			3,
			[]byte{100, 101, 102},
		},
		{
			"Overwrite end",
			[]region{
				{data, 0, 2},
				{data2, 1, 2},
			},
			0,
			3,
			[]byte{0, 101, 102},
		},
		{
			"Overwrite start",
			[]region{
				{data, 0, 3},
				{data2, 0, 2},
			},
			0,
			3,
			[]byte{100, 101, 2},
		},
		{
			"Punch hole",
			[]region{
				{data, 0, 5},
				{data2, 1, 3},
			},
			0,
			5,
			[]byte{0, 101, 102, 103, 4},
		},
		{
			"Overlap two",
			[]region{
				{data, 10, 4},
				{data, 14, 4},
				{data2, 12, 4},
			},
			10,
			8,
			[]byte{10, 11, 112, 113, 114, 115, 16, 17},
		},
	}
	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			mem := &SplicedMemory{}
			for _, region := range test.regions {
				r := bytes.NewReader(region.data)
				mem.Add(&offsetReaderAt{r, 0}, region.off, region.length)
			}
			got := make([]byte, test.readLen)
			n, err := mem.ReadMemory(got, test.readAddr)
			if n != test.readLen || err != nil || !reflect.DeepEqual(got, test.want) {
				t.Errorf("ReadAt = %v, %v, %v, want %v, %v, %v", n, err, got, test.readLen, nil, test.want)
			}
		})
	}

	// Test some ReadMemory errors

	mem := &SplicedMemory{}
	for _, region := range []region{
		{[]byte{0xa1, 0xa2, 0xa3, 0xa4}, 0x1000, 4},
		{[]byte{0xb1, 0xb2, 0xb3, 0xb4}, 0x1004, 4},
		{[]byte{0xc1, 0xc2, 0xc3, 0xc4}, 0x1010, 4},
	} {
		r := bytes.NewReader(region.data)
		mem.Add(&offsetReaderAt{r, region.off}, region.off, region.length)
	}

	got := make([]byte, 4)

	// Read before the first mapping
	_, err := mem.ReadMemory(got, 0x900)
	if err == nil || !strings.HasPrefix(err.Error(), "error while reading spliced memory at 0x900") {
		t.Errorf("Read before the start of memory didn't fail (or wrong error): %v", err)
	}

	// Read after the last mapping
	_, err = mem.ReadMemory(got, 0x1100)
	if err == nil || (err.Error() != "offset 4352 did not match any regions") {
		t.Errorf("Read after the end of memory didn't fail (or wrong error): %v", err)
	}

	// Read at the start of the first entry
	_, err = mem.ReadMemory(got, 0x1000)
	if err != nil || !bytes.Equal(got, []byte{0xa1, 0xa2, 0xa3, 0xa4}) {
		t.Errorf("Reading at the start of the first entry: %v %#x", err, got)
	}

	// Read at the start of the second entry
	_, err = mem.ReadMemory(got, 0x1004)
	if err != nil || !bytes.Equal(got, []byte{0xb1, 0xb2, 0xb3, 0xb4}) {
		t.Errorf("Reading at the start of the second entry: %v %#x", err, got)
	}

	// Read straddling entries 1 and 2
	_, err = mem.ReadMemory(got, 0x1002)
	if err != nil || !bytes.Equal(got, []byte{0xa3, 0xa4, 0xb1, 0xb2}) {
		t.Errorf("Straddled read of the second entry: %v %#x", err, got)
	}

	// Read past the end of the second entry
	_, err = mem.ReadMemory(got, 0x1007)
	if err == nil || !strings.HasPrefix(err.Error(), "error while reading spliced memory at 0x1008") {
		t.Errorf("Read into gap: %v", err)
	}
}

func withCoreFile(t *testing.T, name, args string) *proc.TargetGroup {
	// This is all very fragile and won't work on hosts with non-default core patterns.
	// Might be better to check in the binary and core?
	tempDir := t.TempDir()
	var buildFlags test.BuildFlags
	if buildMode == "pie" {
		buildFlags = test.BuildModePIE
	}
	fix := test.BuildFixture(name, buildFlags)
	bashCmd := fmt.Sprintf("cd %v && ulimit -c unlimited && GOTRACEBACK=crash %v %s", tempDir, fix.Path, args)
	exec.Command("bash", "-c", bashCmd).Run()
	cores, err := filepath.Glob(path.Join(tempDir, "core*"))
	switch {
	case err != nil || len(cores) > 1:
		t.Fatalf("Got %v, wanted one file named core* in %v", cores, tempDir)
	case len(cores) == 0:
		t.Skipf("core file was not produced, could not run test")
		return nil
	}
	corePath := cores[0]

	p, err := OpenCore(corePath, fix.Path, []string{})
	if err != nil {
		t.Errorf("OpenCore(%q) failed: %v", corePath, err)
		pat, err := ioutil.ReadFile("/proc/sys/kernel/core_pattern")
		t.Errorf("read core_pattern: %q, %v", pat, err)
		apport, err := ioutil.ReadFile("/var/log/apport.log")
		t.Errorf("read apport log: %q, %v", apport, err)
		t.Fatalf("previous errors")
	}
	return p
}

func logRegisters(t *testing.T, regs proc.Registers, arch *proc.Arch) {
	dregs := arch.RegistersToDwarfRegisters(0, regs)
	dregs.Reg(^uint64(0))
	for i := 0; i < dregs.CurrentSize(); i++ {
		reg := dregs.Reg(uint64(i))
		if reg == nil {
			continue
		}
		name, _, value := arch.DwarfRegisterToString(i, reg)
		t.Logf("%s = %s", name, value)
	}
}

func TestCore(t *testing.T) {
	if runtime.GOOS != "linux" || runtime.GOARCH == "386" {
		t.Skip("unsupported")
	}
	if runtime.GOOS == "linux" && os.Getenv("CI") == "true" && buildMode == "pie" {
		t.Skip("disabled on linux, Github Actions, with PIE buildmode")
	}
	grp := withCoreFile(t, "panic", "")
	p := grp.Selected

	recorded, _ := grp.Recorded()
	if !recorded {
		t.Fatalf("expecting recorded to be true")
	}

	gs, _, err := proc.GoroutinesInfo(p, 0, 0)
	if err != nil || len(gs) == 0 {
		t.Fatalf("GoroutinesInfo() = %v, %v; wanted at least one goroutine", gs, err)
	}

	var panicking *proc.G
	var panickingStack []proc.Stackframe
	for _, g := range gs {
		t.Logf("Goroutine %d", g.ID)
		stack, err := proc.GoroutineStacktrace(p, g, 10, 0)
		if err != nil {
			t.Errorf("Stacktrace() on goroutine %v = %v", g, err)
		}
		for _, frame := range stack {
			fnname := ""
			if frame.Call.Fn != nil {
				fnname = frame.Call.Fn.Name
			}
			t.Logf("\tframe %s:%d in %s %#x (systemstack: %v)", frame.Call.File, frame.Call.Line, fnname, frame.Call.PC, frame.SystemStack)
			if frame.Current.Fn != nil && strings.Contains(frame.Current.Fn.Name, "panic") {
				panicking = g
				panickingStack = stack
			}
		}
	}
	if panicking == nil {
		t.Fatalf("Didn't find a call to panic in goroutine stacks: %v", gs)
	}

	var mainFrame *proc.Stackframe
	// Walk backward, because the current function seems to be main.main
	// in the actual call to panic().
	for i := len(panickingStack) - 1; i >= 0; i-- {
		if panickingStack[i].Current.Fn != nil && panickingStack[i].Current.Fn.Name == "main.main" {
			mainFrame = &panickingStack[i]
		}
	}
	if mainFrame == nil {
		t.Fatalf("Couldn't find main in stack %v", panickingStack)
	}
	msg, err := proc.FrameToScope(p, p.Memory(), nil, p.CurrentThread().ThreadID(), *mainFrame).EvalExpression("msg", proc.LoadConfig{MaxStringLen: 64})
	if err != nil {
		t.Fatalf("Couldn't EvalVariable(msg, ...): %v", err)
	}
	if constant.StringVal(msg.Value) != "BOOM!" {
		t.Errorf("main.msg = %q, want %q", msg.Value, "BOOM!")
	}

	regs, err := p.CurrentThread().Registers()
	if err != nil {
		t.Fatalf("Couldn't get current thread registers: %v", err)
	}
	logRegisters(t, regs, p.BinInfo().Arch)
}

func TestCoreFpRegisters(t *testing.T) {
	if runtime.GOOS != "linux" || runtime.GOARCH == "386" {
		t.Skip("unsupported")
	}
	if runtime.GOARCH != "amd64" {
		t.Skip("test requires amd64")
	}
	// in go1.10 the crash is executed on a different thread and registers are
	// no longer available in the core dump.
	if ver, _ := goversion.Parse(runtime.Version()); ver.Major < 0 || ver.AfterOrEqual(goversion.GoVersion{Major: 1, Minor: 10, Rev: -1}) {
		t.Skip("not supported in go1.10 and later")
	}

	grp := withCoreFile(t, "fputest/", "panic")
	p := grp.Selected

	gs, _, err := proc.GoroutinesInfo(p, 0, 0)
	if err != nil || len(gs) == 0 {
		t.Fatalf("GoroutinesInfo() = %v, %v; wanted at least one goroutine", gs, err)
	}

	var regs proc.Registers
	for _, thread := range p.ThreadList() {
		frames, err := proc.ThreadStacktrace(p, thread, 10)
		if err != nil {
			t.Errorf("ThreadStacktrace for %x = %v", thread.ThreadID(), err)
			continue
		}
		for i := range frames {
			if frames[i].Current.Fn == nil {
				continue
			}
			if frames[i].Current.Fn.Name == "main.main" {
				regs, err = thread.Registers()
				if err != nil {
					t.Fatalf("Could not get registers for thread %x, %v", thread.ThreadID(), err)
				}
				break
			}
		}
		if regs != nil {
			break
		}
	}

	regtests := []struct{ name, value string }{
		{"ST(0)", "0x3fffe666660000000000"},
		{"ST(1)", "0x3fffd9999a0000000000"},
		{"ST(2)", "0x3fffcccccd0000000000"},
		{"ST(3)", "0x3fffc000000000000000"},
		{"ST(4)", "0x3fffb333333333333000"},
		{"ST(5)", "0x3fffa666666666666800"},
		{"ST(6)", "0x3fff9999999999999800"},
		{"ST(7)", "0x3fff8cccccccccccd000"},
		// Unlike TestClientServer_FpRegisters in service/test/integration2_test
		// we can not test the value of XMM0, it probably has been reused by
		// something between the panic and the time we get the core dump.
		{"XMM9", "0x3ff66666666666663ff4cccccccccccd"},
		{"XMM10", "0x3fe666663fd9999a3fcccccd3fc00000"},
		{"XMM3", "0x3ff199999999999a3ff3333333333333"},
		{"XMM4", "0x3ff4cccccccccccd3ff6666666666666"},
		{"XMM5", "0x3fcccccd3fc000003fe666663fd9999a"},
		{"XMM6", "0x4004cccccccccccc4003333333333334"},
		{"XMM7", "0x40026666666666664002666666666666"},
		{"XMM8", "0x4059999a404ccccd4059999a404ccccd"},
	}

	arch := p.BinInfo().Arch
	logRegisters(t, regs, arch)
	dregs := arch.RegistersToDwarfRegisters(0, regs)

	for _, regtest := range regtests {
		found := false
		dregs.Reg(^uint64(0))
		for i := 0; i < dregs.CurrentSize(); i++ {
			reg := dregs.Reg(uint64(i))
			regname, _, regval := arch.DwarfRegisterToString(i, reg)
			if reg != nil && regname == regtest.name {
				found = true
				if !strings.HasPrefix(regval, regtest.value) {
					t.Fatalf("register %s expected %q got %q", regname, regtest.value, regval)
				}
			}
		}
		if !found {
			t.Fatalf("register %s not found: %v", regtest.name, regs)
		}
	}
}

func TestCoreWithEmptyString(t *testing.T) {
	if runtime.GOOS != "linux" || runtime.GOARCH == "386" {
		t.Skip("unsupported")
	}
	if runtime.GOOS == "linux" && os.Getenv("CI") == "true" && buildMode == "pie" {
		t.Skip("disabled on linux, Github Actions, with PIE buildmode")
	}
	grp := withCoreFile(t, "coreemptystring", "")
	p := grp.Selected

	gs, _, err := proc.GoroutinesInfo(p, 0, 0)
	assertNoError(err, t, "GoroutinesInfo")

	var mainFrame *proc.Stackframe
mainSearch:
	for _, g := range gs {
		stack, err := proc.GoroutineStacktrace(p, g, 10, 0)
		assertNoError(err, t, "Stacktrace()")
		for _, frame := range stack {
			if frame.Current.Fn != nil && frame.Current.Fn.Name == "main.main" {
				mainFrame = &frame
				break mainSearch
			}
		}
	}

	if mainFrame == nil {
		t.Fatal("could not find main.main frame")
	}

	scope := proc.FrameToScope(p, p.Memory(), nil, p.CurrentThread().ThreadID(), *mainFrame)
	loadConfig := proc.LoadConfig{FollowPointers: true, MaxVariableRecurse: 1, MaxStringLen: 64, MaxArrayValues: 64, MaxStructFields: -1}
	v1, err := scope.EvalExpression("t", loadConfig)
	assertNoError(err, t, "EvalVariable(t)")
	assertNoError(v1.Unreadable, t, "unreadable variable 't'")
	t.Logf("t = %#v\n", v1)
	v2, err := scope.EvalExpression("s", loadConfig)
	assertNoError(err, t, "EvalVariable(s)")
	assertNoError(v2.Unreadable, t, "unreadable variable 's'")
	t.Logf("s = %#v\n", v2)
}

func TestMinidump(t *testing.T) {
	if runtime.GOOS != "windows" || runtime.GOARCH != "amd64" {
		t.Skip("minidumps can only be produced on windows/amd64")
	}
	var buildFlags test.BuildFlags
	if buildMode == "pie" {
		buildFlags = test.BuildModePIE
	}
	fix := test.BuildFixture("sleep", buildFlags)
	mdmpPath := procdump(t, fix.Path)

	grp, err := OpenCore(mdmpPath, fix.Path, []string{})
	if err != nil {
		t.Fatalf("OpenCore: %v", err)
	}
	p := grp.Selected
	gs, _, err := proc.GoroutinesInfo(p, 0, 0)
	if err != nil || len(gs) == 0 {
		t.Fatalf("GoroutinesInfo() = %v, %v; wanted at least one goroutine", gs, err)
	}
	t.Logf("%d goroutines", len(gs))
	foundMain, foundTime := false, false
	for _, g := range gs {
		stack, err := proc.GoroutineStacktrace(p, g, 10, 0)
		if err != nil {
			t.Errorf("Stacktrace() on goroutine %v = %v", g, err)
		}
		t.Logf("goroutine %d", g.ID)
		for _, frame := range stack {
			name := "?"
			if frame.Current.Fn != nil {
				name = frame.Current.Fn.Name
			}
			t.Logf("\t%s:%d in %s %#x", frame.Current.File, frame.Current.Line, name, frame.Current.PC)
			if frame.Current.Fn == nil {
				continue
			}
			switch frame.Current.Fn.Name {
			case "main.main":
				foundMain = true
			case "time.Sleep":
				foundTime = true
			}
		}
		if foundMain != foundTime {
			t.Errorf("found main.main but no time.Sleep (or viceversa) %v %v", foundMain, foundTime)
		}
	}
	if !foundMain {
		t.Fatalf("could not find main goroutine")
	}
}

func procdump(t *testing.T, exePath string) string {
	exeDir := filepath.Dir(exePath)
	cmd := exec.Command("procdump64", "-accepteula", "-ma", "-n", "1", "-s", "3", "-x", exeDir, exePath, "quit")
	out, err := cmd.CombinedOutput() // procdump exits with non-zero status on success, so we have to ignore the error here
	if !strings.Contains(string(out), "Dump count reached.") {
		t.Fatalf("possible error running procdump64, output: %q, error: %v", string(out), err)
	}

	fis, err := os.ReadDir(exeDir)
	if err != nil {
		t.Fatalf("could not read executable file directory %q: %v", exeDir, err)
	}
	t.Logf("looking for dump file")
	exeName := filepath.Base(exePath)
	for _, fi := range fis {
		name := fi.Name()
		t.Logf("\t%s", name)
		if strings.HasPrefix(name, exeName) && strings.HasSuffix(name, ".dmp") {
			mdmpPath := filepath.Join(exeDir, name)
			test.PathsToRemove = append(test.PathsToRemove, mdmpPath)
			return mdmpPath
		}
	}

	t.Fatalf("could not find dump file")
	return ""
}

repository: go-delve/delve

repo_name: go-delve/delve

gha_language: Go


text:
@BOOK{Afanasyev92,
  author       = {Афанасьев, В. В. and Василевский, О. Н.},
  title        = {Расчеты электрических цепей
                  на программируемых микрокалькуляторах},
  address      = {М.},
  publisher    = {Энергоиздат},
  year         = {1992},
  pagetotal    = {190},
  language     = {russian},
}

gha_language: TeX


text:
package pictures

import (
	"bytes"

	"github.com/rwcarlsen/goexif/exif"
)

type ExifFilter struct {
}

func (ef *ExifFilter) Process(info *ImageInfo) (*ImageInfo, error) {
	ex, err := exif.Decode(bytes.NewReader(info.Buf))
	if err == nil {
		t, err := ex.DateTime()
		if err == nil {
			info.Time = t
			return info, nil
		}
	}

	if err != nil {
		err = &NonFatalError{err.Error(), true}
	}
	return info, err
}

repository: abates/pictures

repo_name: abates/pictures


text:
// Copyright 2020 Drone.IO Inc. All rights reserved.
// Use of this source code is governed by the Blue Oak Model License
// that can be found in the LICENSE file.

package linter

import (
	"errors"

	"{{ Module }}/engine/resource"
	"github.com/drone/drone-go/drone"
	"github.com/drone/runner-go/manifest"
)

// Linter evaluates the pipeline against a set of
// rules and returns an error if one or more of the
// rules are broken.
type Linter struct{}

// New returns a new Linter.
func New() *Linter {
	return new(Linter)
}

// Lint executes the linting rules for the pipeline
// configuration.
func (l *Linter) Lint(pipeline manifest.Resource, repo *drone.Repo) error {
	return checkPipeline(pipeline.(*resource.Pipeline), repo.Trusted)
}

func checkPipeline(pipeline *resource.Pipeline, trusted bool) error {
	if err := checkSteps(pipeline, trusted); err != nil {
		return err
	}
	return nil
}

func checkSteps(pipeline *resource.Pipeline, trusted bool) error {
	for _, step := range pipeline.Steps {
		if step == nil {
			return errors.New("Linter: nil step")
		}
		if err := checkStep(step, trusted); err != nil {
			return err
		}
	}
	return nil
}

func checkStep(step *resource.Step, trusted bool) error {
	// TODO optionally add per-step pipeline rules or remove
	return nil
}

repository: drone/boilr-runner

repo_name: drone/boilr-runner


text:
DESCRIPTION = "Data package for kolibre sample client"
HOMEPAGE = "https://github.com/kolibre/libkolibre-clientcore"
LICENSE = "LGPLv2.1"
SECTION = "media"

LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING;md5=4b54a1fd55a448865a0b32d41598759d"

PV = "1.0"

SRC_URI = "file://COPYING"

DEPENDS = "libkolibre-clientcore libkolibre-narrator-utils"

PACKAGES = "${PN}"

client = "kolibre-sample-client"

do_compile() {
    prompts=${PKG_CONFIG_SYSROOT_DIR}${datadir}/libkolibre-clientcore/prompts/prompts.csv
    messages=${PKG_CONFIG_SYSROOT_DIR}${datadir}/libkolibre-clientcore/prompts/messages.csv
    translations_en=${PKG_CONFIG_SYSROOT_DIR}${datadir}/libkolibre-clientcore/prompts/en/translations.csv
    translations_sv=${PKG_CONFIG_SYSROOT_DIR}${datadir}/libkolibre-clientcore/prompts/sv/translations.csv
    translations_fi=${PKG_CONFIG_SYSROOT_DIR}${datadir}/libkolibre-clientcore/prompts/fi/translations.csv
    output=${S}/messages.db

# build database with narrator-utils
    ${STAGING_BINDIR_NATIVE}/narrator-utils -p ${prompts} -m ${messages} -t ${translations_en} -l en -o ${output}
    ${STAGING_BINDIR_NATIVE}/narrator-utils -p ${prompts} -m ${messages} -t ${translations_sv} -l sv -o ${output} -a
    ${STAGING_BINDIR_NATIVE}/narrator-utils -p ${prompts} -m ${messages} -t ${translations_fi} -l fi -o ${output} -a
}

do_install() {
	install -m 0755 -d ${D}${datadir}/${client}
	install -m 0644 ${S}/messages.db ${D}${datadir}/${client}/messages.db
}

FILES_${PN} = "${datadir}/${client}/*"

repository: kolibre/meta-kolibre

repo_name: kolibre/meta-kolibre


text:
require libsdl-ttf_${PV}.bb
inherit native

DEPENDS = "libsdl-native"

EXTRA_OECONF = "--disable-sdltest --with-sdl-prefix=${STAGING_LIBDIR}/.."

export SDL_CONFIG = "${STAGING_BINDIR}/sdl-config"

SRC_URI[md5sum] = "29d12d1b883bf834c291c93f52ba8dc5"
SRC_URI[sha256sum] = "7e2e7b46088a7b9594b255b58123598d49c5c3d11bcc3c9a8f80969cd9caa6c5"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
@inproceedings{kuwahara_production-passage-time_2007,
 abstract = {Given the substantial computational requirements of stochastic simulation, approximation is essential for efficient analysis of any realistic biochemical system. This paper introduces a new approximation method to reduce the computational cost of stochastic simulations of an enzymatic reaction scheme which in biochemical systems often includes rapidly changing fast reactions with enzyme and enzyme-substrate complex molecules present in very small counts. Our new method removes the substrate dissociation reaction by approximating the passage time of the formation of each enzyme-substrate complex molecule which is destined to a production reaction. This approach skips the firings of unimportant yet expensive reaction events, resulting in a substantial acceleration in the stochastic simulations of enzymatic reactions. Additionally, since all the parameters used in our new approach can be derived by the Michaelis-Menten parameters which can actually be measured from experimental data, applications of this approximation can be practical even without having full knowledge of the underlying enzymatic reaction. Furthermore, since our approach does not require a customized simulation procedure for enzymatic reactions, it allows biochemical systems that include such reactions to still take advantage of standard stochastic simulation tools. Here, we apply this new method to various enzymatic reaction systems, resulting in a speedup of orders of magnitude in temporal behavior analysis without any significant loss in accuracy.},
 author = {Kuwahara, Hiroyuki and Myers, Chris},
 booktitle = {Research in Computational Molecular Biology},
 date = {2007-04},
 doi = {10.1007/978-3-540-71681-5_12},
 editor = {Speed, Terry and Huang, Haiyan},
 file = {Kuwahara_Myers-2007-Production-Passage-Time Approximation.pdf:/Users/lukas/Lab/Zotero/storage/AH56R6WI/Kuwahara_Myers-2007-Production-Passage-Time Approximation.pdf:application/pdf},
 isbn = {978-3-540-71681-5},
 keywords = {stochastic logic, search},
 langid = {english},
 location = {Berlin, Heidelberg},
 note = {00000},
 pages = {166--180},
 publisher = {Springer},
 series = {Lecture Notes in Computer Science},
 shorttitle = {Production-Passage-Time Approximation},
 title = {Production-Passage-Time Approximation: A New Approximation Method to Accelerate the Simulation Process of Enzymatic Reactions}
}


text:
DEPENDS = "${MACHINE_TASK_PROVIDER} bootchart"

IMAGE_LINGUAS = ""
IMAGE_INSTALL = "${MACHINE_TASK_PROVIDER} bootchart acct"

inherit image


text:
% Encoding: UTF-8

@inproceedings{vf-two,
  Author = {Cordella, Luigi Pietro and Foggia, Pasquale and Sansone, Carlo and Vento, Mario},
  Booktitle = {3rd IAPR-TC15 workshop on graph-based representations in pattern recognition},
  Date-Added = {2018-09-14 11:56:38 +0000},
  Date-Modified = {2018-09-14 12:03:17 +0000},
  Pages = {149--159},
  Title = {An improved algorithm for matching large graphs},
  Year = {2001}
}
@article{efd,
  title={Elliptic Fourier features of a closed contour},
  author={Kuhl, Frank P and Giardina, Charles R},
  journal={Computer graphics and image processing},
  volume={18},
  number={3},
  pages={236--258},
  year={1982},
  publisher={Elsevier}
}
@incollection{ga,
  title={Genetic algorithms},
  author={Sivanandam, SN and Deepa, SN},
  booktitle={Introduction to genetic algorithms},
  pages={15--37},
  year={2008},
  publisher={Springer}
}
@inproceedings{pso,
  title={Particle swarm optimization},
  author={Kennedy, James and Eberhart, Russell},
  booktitle={Proceedings of ICNN'95-international conference on neural networks},
  volume={4},
  pages={1942--1948},
  year={1995},
  organization={IEEE}
}
@incollection{de,
  title={Differential evolution},
  author={Price, Kenneth V},
  booktitle={Handbook of optimization},
  pages={187--214},
  year={2013},
  publisher={Springer}
}

@article{hertz1882ueber,
  title={Ueber die Ber{\"u}hrung fester elastischer K{\"o}rper.},
  author={Hertz, Heinrich},
  journal={Journal f{\"u}r die reine und angewandte Mathematik},
  volume={1882},
  number={92},
  pages={156--171},
  year={1882},
  publisher={De Gruyter}
}
@book{rosheim1994robot,
  title={Robot evolution: the development of anthrobotics},
  author={Rosheim, Mark E},
  pages={110--121},
  year={1994},
  publisher={John Wiley \& Sons}
}
@inproceedings{lane1998advanced,
  title={Advanced manipulation for deep underwater sampling: the amadeus research project},
  author={Lane, DM and Bartolini, G and Cannata, G and Casalino, G and Davies, JBC and Veruggio, G and Canals, M and Smith, C},
  booktitle={Proceedings of the 1998 IEEE International Conference on Control Applications (Cat. No. 98CH36104)},
  volume={2},
  pages={1068--1073},
  year={1998},
  organization={IEEE}
}
@incollection{sapietova2016analysis,
  title={Analysis of the influence of input function contact parameters of the impact force process in the MSC. ADAMS},
  author={Sapietov{\'a}, Al{\v{z}}beta and Gajdo{\v{s}}, Luk{\'a}{\v{s}} and Dek{\`y}{\v{s}}, Vladim{\'\i}r and Sapieta, Milan},
  booktitle={Advanced mechatronics solutions},
  pages={243--253},
  year={2016},
  publisher={Springer}
}
@misc{essay62109,
    month = {July},
    year = {2012},
    title = {Contact mechanics in MSC Adams - A technical evaluation of the contact models in multibody dynamics software MSC Adams},
    author = {Jochem {Giesbers}},
    url = {http://essay.utwente.nl/62109/},
    abstract = {The goal of this study is to gain insight in the modelling of (physical) contact in Adams, a product by MSC Software. Adams is the most widely used multibody dynamics and motion analysis software in the world. The aim is to establish an understanding of contact in Adams and the relation to the laws of physics. First, the algorithms and formulas used by Adams are analysed. Second, a variety of models is simulated and the effects of the corresponding variables are analysed. After this study the acquired knowledge can be used to model more complex systems in Adams.}
}
@phdthesis{gravagne2002phd-thesis,
  title={Design, Analysis and Experimentation: the Fundamentals of Continuum Robotic Manipulators.},
  author={Gravagne, I. A.},
  year={2002},
  school={Clemson University}
}

repository: mdecourse/report

repo_name: mdecourse/report


text:
SUMMARY = "Host Arago SDK package for cross canadian toolchain"
PN = "packagegroup-arago-cross-canadian-${MACHINE}"
PR = "r7"

inherit cross-canadian packagegroup

PACKAGEGROUP_DISABLE_COMPLEMENTARY = "1"

# Use indirection to stop these being expanded prematurely
BINUTILS = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
GCC = "gcc-cross-canadian-${TRANSLATED_TARGET_ARCH}"
GDB = "gdb-cross-canadian-${TRANSLATED_TARGET_ARCH}"

RDEPENDS_${PN} = "\
    ${@all_multilib_tune_values(d, 'BINUTILS')} \
    ${@all_multilib_tune_values(d, 'GCC')} \
    ${@all_multilib_tune_values(d, 'GDB')} \
    "

#    meta-environment-${MACHINE}


text:
require chromium-gn.inc

REQUIRED_DISTRO_FEATURES = "wayland"

DEPENDS += "\
        at-spi2-atk \
        libxkbcommon \
        virtual/egl \
        wayland \
        wayland-native \
"

SRC_URI += "\
        file://0001-ozone-add-va-api-support-to-wayland.patch \
"

GN_ARGS += "\
        ${PACKAGECONFIG_CONFARGS} \
        use_ozone=true \
        ozone_auto_platforms=false \
        ozone_platform_headless=true \
        ozone_platform_wayland=true \
        ozone_platform_x11=false \
        system_wayland_scanner_path="${STAGING_BINDIR_NATIVE}/wayland-scanner" \
        use_system_wayland_scanner=true \
        use_xkbcommon=true \
        use_system_libwayland=true \
        use_system_minigbm=true \
        use_system_libdrm=true \
        use_gtk=false \
"

# Since M87, Chromium builds Ozone by default, but continues to use X11.
# However, the goal of two recipes - Ozone/Wayland and non-Ozone/X11 is
# to provide either Wayland or X11 and avoid pulling dependencies of each
# on environments where Wayland or X11 is not actually required.
# See https://crrev.com/c/2382834
GN_ARGS += "use_x11=false"

# The chromium binary must always be started with those arguments.
CHROMIUM_EXTRA_ARGS:append = " --ozone-platform=wayland"

repository: schnitzeltony/meta-browser

repo_name: schnitzeltony/meta-browser


text:
import React, { PureComponent } from 'react';
import { Form, Button, Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faPaperPlane, faCamera, faImage, faVideo, faPaste } from '@fortawesome/free-solid-svg-icons';
import imageCompression from 'browser-image-compression';

class MessageBox extends PureComponent {

    constructor(props) {
        super(props);
        this.state = {
            message: '',
            mediaDropdown: false,
            render: false,
            chatId: null
        }
        this.toggleMediaDropdown = this.toggleMediaDropdown.bind(this);
        this.handleSubmit = this.handleSubmit.bind(this);
        this.toggleMessageBox = this.toggleMessageBox.bind(this);
        this.handleSendFile = this.handleSendFile.bind(this);
        this.handleUploadFile = this.handleUploadFile.bind(this);
    }

    toggleMessageBox(render, chatId) {
        if(render!==this.state.render || chatId!==this.state.chatId){
            this.setState({
            render: render,
            chatId: chatId
            });
        }
      }

    handleSubmit(event) {
        event.preventDefault();
        if(!this.state.message) return;
        this.props.sendMessage(this.state.message,this.state.chatId);
        this.setState({message: ''});
    }

    toggleMediaDropdown = () => {
        this.setState({mediaDropdown: !this.state.mediaDropdown});
    }

    handleSendFile(type) {
        this[type].click();
    }

    async handleUploadFile(event) {
        let file = event.target.files[0];
        const type = event.target.id;
        if(type === 'image') {
            file = await imageCompression(file, {
                maxSizeMB: 1,
                maxWidthOrHeight: 600,
                useWebWorker: true
            });
        }
        const name = file.name;
        var reader = new FileReader();
        reader.readAsDataURL(file);
        // reader.readAsText(file, "UTF-8");
        const index = String(Date.now()-0);
        reader.onload = (event) => {
            this.props.sendMessage(event.target.result, this.state.chatId, type, name, index);
        }
    }

    render() {
        return(
            <>
                {this.state.render
                ? <Form inline className="fixed-bottom" onSubmit={this.handleSubmit}>
                    <textarea name="message" id="message" value={this.state.message}
                        onChange={event => this.setState({message: event.target.value})}
                        placeholder="Enter Message Here" style={{height: 60,
                        width: '100%',
                        zIndex:"-100",
                        borderRadius: 30,
                        padding: 10,
                        paddingRight: 65,
                        paddingLeft: 60,
                        borderColor: 'grey',
                        fontSize: 20,
                        resize: 'none'}}>
                    </textarea>
                    <Dropdown direction="up"
                        isOpen={this.state.mediaDropdown}
                        toggle={this.toggleMediaDropdown}
                        style={{marginTop: -60}}>
                        <DropdownToggle style={{marginLeft: 5, width: 50, height: 50, borderRadius: '50%'}}>
                            <FontAwesomeIcon icon={faCamera} size="lg" />
                        </DropdownToggle>
                        <DropdownMenu>
                            <DropdownItem onClick={event => this.handleSendFile("doc")}>
                                <FontAwesomeIcon icon={faPaste} />{'  '}Document
                            </DropdownItem>
                            <DropdownItem divider></DropdownItem>
                            <DropdownItem onClick={event => this.handleSendFile("image")}>
                                <FontAwesomeIcon icon={faImage} />{'  '}Image
                            </DropdownItem>
                            <DropdownItem divider></DropdownItem>
                            <DropdownItem onClick={event => this.handleSendFile("video")}>
                                <FontAwesomeIcon icon={faVideo} />{'  '}Video
                            </DropdownItem>
                        </DropdownMenu>
                    </Dropdown>
                    <Button color="primary"
                        style={{height: 60, width: 60, marginTop: -60, marginLeft: 'auto', borderRadius: '50%'}}>
                        <FontAwesomeIcon icon={faPaperPlane} size="lg" />
                    </Button>
                    <input type="file" id="doc" ref={ref => this.doc=ref} style={{display: "none"}}
                        accept=".xlsx,.xls,image/*,.doc, .docx,.ppt, .pptx,.txt,.pdf"
                        onChange={this.handleUploadFile} />
                    <input type="file" id="image" ref={ref => this.image=ref} style={{display: "none"}}
                        accept="image/*" onChange={this.handleUploadFile} />
                    <input type="file" id="video" ref={ref => this.video=ref} style={{display: "none"}}
                        acccept="video/mp4,video/x-m4v,video/*" capture="camcorder;fileupload"
                        onChange={this.handleUploadFile} />

                </Form>
                : null}
            </>
        );
    }
}

export default MessageBox;

repository: ansh-ptel/messanger-web

repo_name: ansh-ptel/messanger-web

extension: js


text:
require acpid.inc
SRC_URI += "file://gcc40.patch"
PR = "${INC_PR}.0"
SRC_URI[md5sum] = "8513c19d0f14ff396ea73caaea7f2ef8"
SRC_URI[sha256sum] = "b36d6e83ecee4748cc3b8fa3cdbc8c59e620428ce77e22e241faa19c2e0e7dad"


text:
package shellwords

import (
	"regexp"
)

var rexShellChars = regexp.MustCompile(`([\\'" \*\?\[\$\(\)\!\@\&\{])`)

func Escape(str string) string {
	return rexShellChars.ReplaceAllString(str, `\$1`)
}

repository: mowings/imago

repo_name: mowings/imago


text:
SUMMARY = "A console image that runs pianobar"
HOMEPAGE = "http://www.jumpnowtek.com"
LICENSE = "MIT"

require console-image.bb

ALSA += " \
    alsa-dev \
    alsa-lib \
    alsa-utils \
    alsa-utils-scripts \
 "

IMAGE_INSTALL += " \
    ${ALSA} \
    iqaudio-mute \
    pianobar \
 "

export IMAGE_BASENAME = "audio-image"


text:
@article{Abe2017a,
abstract = {In recent years, manufacturing using digital machine tools called digital fabrication has spread rapidly. Unlike concentrated mass production by existing manufacturers, a flaw in which each individual produces a small amount in a dispersed manner is also being developed. The 3D model to be the design drawing is used by those made by individuals or those made by duplicating or modifying things published on the Internet.

However, it is difficult to clarify the location of production or intellectual property unless information such as the design drawing of the product and the manufacturer is preserved. In order to clarify the location of manufacturing responsibility and intellectual property right, it is necessary to clarify "Openness" that anyone can refer to data, "Traceability" of information linked to products, "Integrity" which is not tampered is required. Fujiyoshi et al. Achieved the linking of information and products by embedding RFID in the product for product management, The above problem is still unresolved.

Therefore, in this research, I thought that by using Blockchain technology, by saving manufacturing information on the open ledger, it is possible to satisfy the necessary conditions and clarify the location of manufacturing responsibility and intellectual property right. The Blockchain technology is a system that secures the integrity of data by forming a distributed open ledger on the P2P network and mutually verifying input data and preserving it.

In order to verify this method, I implemented the system save manufacturing information on Blockchain by making a single board computer control a 3D printer a Blockchain node.Using this system, we verified the above items of "Openness", "Traceability", and "Integrity", so that the system tracks manufacturing information on products and, It is possible to clarify the manufacturing responsibility and the location of the intellectual property right when the manufacturer himself is the producer of the design drawing.

Based on the results of this research, it is possible to clarify the manufacturing responsibility and the location of the right also in personal manufacturing. This system is a disincentive not to manufacture at a quality that does not cause accidents that the manufacturer is responsible for. Moreover, by applying this method and managing the distribution of the design drawing on Blockchain, it is possible to manage the product manufactured by the 3D printer as intellectual property.},
author = {Ryosuke Abe},
month = {feb},
year = {2017},
title = {Manufacturing information management system using Blockchain in 3D printing},
booktitle = {Bachelor Thesis of Keio Univesity Faculty of Policy Management},
url = {http://web.sfc.wide.ad.jp/~chike/thesis/thesis.pdf}
}
@article{Abe2019,
abstract = {In Bitcoin, to independently verify whether new transactions are correct or not, a type of a node called "Full Node" has to hold the whole of historical transactions. The transactions are stored in ledger called "Blockchain. " Blockchain is an append-only data structure. Thus, to operate Full Nodes, the required storage capacity would grow too large for resource-constrained devices. Due to the limitation, the existing lightweight node scheme is that a node relies on other Full Nodes. In this thesis, to reduce storage capacity with keeping the independence of each node, we propose a storage load balancing scheme "KARAKASA" using Distributed Hash Table (DHT). In KARAKASA, nodes distributedly keep the whole blockchain among DHT networked nodes. We evaluated KARAKASA from the view of storage capacity and independence. As a result, a node in a cluster does not need to trust other nodes. We concluded that nodes in a DHT cluster can behave like Full Nodes without holding the whole blockchain.},
archivePrefix = {arXiv},
arxivId = {1902.02174},
author = {Abe, Ryosuke},
eprint = {1902.02174},
month = {feb},
title = {{Blockchain Storage Load Balancing Among DHT Clustered Nodes}},
booktitle = {Master Thesis of Keio Univesity Graduate School of Media and Governance},
url = {http://arxiv.org/abs/1902.02174},
year = {2019}
}
@inproceedings{Abe2018,
abstract = {A type of Bitcoin node called" Full Node" has to hold the entire of historical transaction data called" Blockchain" to verify that new transactions are correct or not. To operate nodes as Full Nodes, the required storage size will be too large for resource-constrained devices. In this paper, to mitigate storage size, we propose a storage load balancing scheme by distributed storage based on Distributed Hash Table (DHT). By our scheme, nodes in a DHT cluster can behave like Full Nodes without holding the entire of the blockchain.},
address = {New York, New York, USA},
author = {Abe, Ryosuke and Suzuki, Shigeya and Murai, Jun},
doi = {10.1145/3289166.3289169},
isbn = {9781450361316},
journal = {Proceedings of the Asian Internet Engineering Conference on   - AINTEC '18},
pages = {17--23},
publisher = {ACM Press},
title = {{Mitigating Bitcoin Node Storage Size By DHT}},
url = {http://dl.acm.org/citation.cfm?doid=3289166.3289169},
year = {2018},
month = {Nov}
}
@inproceedings{Abe2018a,
abstract = {In a consensus algorithm based on Proof-of-Work, miners are motivated by crypto rewards. Furthermore, security is guaranteed because a cost of a 50% attack chance is higher than the potential rewards. However, because of the sudden price jump of cryptocurrencies and cheap prices of mining machines like ASICs, the cost and profit were on equilibrium for Bitcoin in 2017. In this situation, attackers are motivated by the balance between hash power and profits. In this paper, we describe that there is relevance between mining power on the network and price of tokens that can be taken securely on a blockchain. Users who exchange tokens on the PoW blockchain should monitor mining power and exchange tokens cheaper than the attack cost so that profit and cost of the attacker are not in equilibrium.},
address = {New York, New York, USA},
author = {Abe, Ryosuke and Nakamura, Keita and Teramoto, Kentaro and Takahashi, Misato},
doi = {10.1145/3289166.3289171},
isbn = {9781450361316},
journal = {Proceedings of the Asian Internet Engineering Conference on   - AINTEC '18},
pages = {32--37},
publisher = {ACM Press},
title = {{Attack Incentive and Security of Exchanging Tokens on Proof-of-Work Blockchain}},
url = {http://dl.acm.org/citation.cfm?doid=3289166.3289171},
year = {2018},
month = {Nov}
}
@inproceedings{Abe2018b,
abstract = {There are several studies that propose identity management that utilizes blockchain technology. In Ethereum, the main programmable blockchain system, data on a blockchain are saved as encoded binaries for executing automatic verification. To decode a binary, users need to know the application binary interfaces (ABI) that describes the data structure of the registered information. However, the manner by which ABI are shared in the current blockchain protocol is opaque. To resolve this problem, we describe a new protocol for embedding the ABI on a blockchain transaction when a registrant registers information. Our method enables users to read registered data with information on the blockchain alone, and it guarantees transparency without requiring users to trust third parties.},
author = {Abe, Ryosuke and Watanabe, Hiroki and Ohashi, Shigenori and Fujimura, Shigeru and Nakadaira, Atsushi},
booktitle = {2018 IEEE 42nd Annual Computer Software and Applications Conference (COMPSAC)},
doi = {10.1109/COMPSAC.2018.10298},
isbn = {978-1-5386-2666-5},
title = {{Storage Protocol for Securing Blockchain Transparency}},
year = {2018},
month = {Jul}
}


text:
package parser_test

import (
	"fmt"
	"testing"

	"github.com/elliotchance/ok/ast"
	"github.com/elliotchance/ok/ast/asttest"
	"github.com/elliotchance/ok/parser"
)

func TestReturn(t *testing.T) {
	for testName, test := range map[string]struct {
		str      string
		expected ast.Node
		errs     []error
	}{
		"return-zero": {
			str:      "return\n",
			expected: &ast.Return{},
		},
		"return-number": {
			str: "return 123\n",
			expected: &ast.Return{
				Exprs: []ast.Node{
					asttest.NewLiteralNumber("123"),
				},
			},
		},
		"return-two-values": {
			str: "return 123, 'a'\n",
			expected: &ast.Return{
				Exprs: []ast.Node{
					asttest.NewLiteralNumber("123"),
					asttest.NewLiteralChar('a'),
				},
			},
		},
	} {
		t.Run(testName, func(t *testing.T) {
			str := fmt.Sprintf("func main() { %s }", test.str)
			p := parser.NewParser(0)
			p.ParseString(str, "a.ok")

			assertEqualErrors(t, test.errs, p.Errors())
			asttest.AssertEqual(t, map[string]*ast.Func{
				"1": newFunc(test.expected),
			}, p.Funcs())
		})
	}
}

repository: elliotchance/ok

repo_name: elliotchance/ok


text:
@article{doi:10.1002/solr.201900283,
 abstract = {The tunability of the optoelectrical properties upon compositional modification is a key characteristic of metal halide perovskites. In particular, bandgaps narrower than those in conventional lead-based perovskites are essential to achieve the theoretical efficiency limit of single-absorber solar cells, as well as develop multijunction tandem devices. Herein, the solvent-free vacuum deposition of a narrow bandgap perovskite based on tin–lead metal and formamidinium cation is reported. Pinhole-free films with 1.28 eV bandgap are obtained by thermal codeposition of precursors. The optoelectrical quality of these films is demonstrated by their use in solar cells with a power conversion efficiency of 13.98%.},
 author = {Igual-Muñoz, Ana M and Ávila, Jorge and Boix, Pablo P and Bolink, Henk J},
 doi = {10.1002/solr.201900283},
 journal = {Solar RRL},
 keywords = {lead,perovskites,photovoltaics,tin,vacuum deposition},
 number = {0},
 title = {FAPb0.5Sn0.5I3: A Narrow Bandgap Perovskite Synthesized through Evaporation Methods for Solar Cell Applications},
 url = {https://onlinelibrary.wiley.com/doi/abs/10.1002/solr.201900283},
 volume = {0},
 year = {2019}
}

repository: JorgeAvilaG/academic-kickstart

repo_name: JorgeAvilaG/academic-kickstart


text:
@article{Quintana2017,
 author = {Quintana, D. S. and Westlye, L. T. and Hope, Sigrun and Nærland, Terje and Elvsåshagen, T. and Dørum, E. and Rustan, Ø and Valstad, M. and Rezvaya, L. and Lishaugen, H.},
 issn = {2158-3188},
 journal = {Translational Psychiatry},
 pages = {e1136},
 title = {Dose-dependent social-cognitive effects of intranasal oxytocin delivered with novel Breath Powered device in adults with autism spectrum disorder: a randomized placebo-controlled double-blind crossover trial},
 volume = {7},
 year = {2017}
}


text:
@ONLINE{nos_weeralarm_2009,
  title        = {Weeralarm en verkeeralarm ingetrokken},
  url          = {http://nos.nl/l/124074},
  urldate      = {2014-02-12},
  author       = {{NOS}},
  date         = {2009-12-20},
  keywords     = {gladheid, ijs, ongeluk, openbaar vervoer, schiphol, sneeuw},
  titleaddon   = {{NOS.nl}},
}


text:
@InProceedings{liue14,
  supplementary = {Supplementary:liue14-supp.zip},
  title = {Multiple Testing under Dependence via Semiparametric Graphical Models},
  author = {Jie Liu and Chunming Zhang and Elizabeth Burnside and David Page},
  pages = {955-963},
  abstract = {It has been shown that graphical models can be used to leverage the dependence in large-scale multiple testing problems with significantly improved performance (Sun & Cai, 2009; Liu et al., 2012). These graphical models are fully parametric and require that we know the parameterization of f1, the density function of the test statistic under the alternative hypothesis. However in practice, f1 is often heterogeneous, and cannot be estimated with a simple parametric distribution. We propose a novel semiparametric approach for multiple testing under dependence, which estimates f1 adaptively. This semiparametric approach exactly generalizes the local FDR procedure (Efron et al., 2001) and connects with the BH procedure (Benjamini & Hochberg, 1995). A variety of simulations show that our semiparametric approach outperforms classical procedures which assume independence and the parametric approaches which capture dependence.},
  section = {cycle-2},
}

repository: mreid/papersite

repo_name: mreid/papersite


text:
DESCRIPTION = "Luna-service2 provides a bus-based IPC mechanism used between components in webOS."
AUTHOR = "Hewlett-Packard Development Company, L.P"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://README.md;md5=0805e6a5927b13bf0f0738f011936c0c"
PV = "3.0.0+gitr${SRCPV}"
PR = "r4"

SRC_URI = " \
  git://github.com/openwebos/luna-service2.git;protocol=http;branch=master \
  file://dont-use-custom-memcpy.patch \
  file://ls-hubd-public.service \
  file://ls-hubd-private.service"
S = "${WORKDIR}/git"

SRCREV = "fdc264f844533eafeb2d3cd6675314c13a15fd67"

DEPENDS = "glib-2.0 cjson-openwebos pmloglib"

inherit cmake systemd

SYSTEMD_PACKAGES = "${PN}-systemd"
SYSTEMD_SERVICE = " \
  ls-hubd-public.service \
  ls-hubd-private.service"

EXTRA_OECMAKE = "-DTARGET_CORE_OS=rockhopper"

do_install_append() {
  install -d ${D}${datadir}/ls2/roles/prv
  install -d ${D}${datadir}/ls2/roles/pub

  install -m 0644 ${S}/service/com.palm.lunasend.json.pub \
    ${D}${datadir}/ls2/roles/pub/com.palm.lunasend.json
  install -m 0644 ${S}/service/com.palm.lunasend.json.prv \
    ${D}${datadir}/ls2/roles/prv/com.palm.lunasend.json

  install -m 0644 ${S}/service/ls-monitor.json.pub \
    ${D}${datadir}/ls2/roles/pub/ls-monitor.json
  install -m 0644 ${S}/service/ls-monitor.json.prv \
    ${D}${datadir}/ls2/roles/prv/ls-monitor.json
}

FILES_${PN} += "${datadir}/ls2/roles/"

pkg_postinst_${PN} () {
  # create system service and roles directories necessary for ls-hub start
  for p in "prv pub" ; do
    mkdir -p ${localstatedir}/palm/ls2/roles/$p
    mkdir -p ${localstatedir}/palm/ls2/services/$p
    mkdir -p ${localstatedir}/mft/palm/ls2/roles/$p
    mkdir -p ${localstatedir}/mft/palm/ls2/system-services/$p
  done
}


text:
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: tendermint/types/events.proto

package types

import (
	fmt "fmt"
	proto "github.com/gogo/protobuf/proto"
	io "io"
	math "math"
	math_bits "math/bits"
)

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

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

type EventDataRoundState struct {
	Height int64  `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	Round  int32  `protobuf:"varint,2,opt,name=round,proto3" json:"round,omitempty"`
	Step   string `protobuf:"bytes,3,opt,name=step,proto3" json:"step,omitempty"`
}

func (m *EventDataRoundState) Reset()         { *m = EventDataRoundState{} }
func (m *EventDataRoundState) String() string { return proto.CompactTextString(m) }
func (*EventDataRoundState) ProtoMessage()    {}
func (*EventDataRoundState) Descriptor() ([]byte, []int) {
	return fileDescriptor_72cfafd446dedf7c, []int{0}
}
func (m *EventDataRoundState) XXX_Unmarshal(b []byte) error {
	return m.Unmarshal(b)
}
func (m *EventDataRoundState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	if deterministic {
		return xxx_messageInfo_EventDataRoundState.Marshal(b, m, deterministic)
	} else {
		b = b[:cap(b)]
		n, err := m.MarshalToSizedBuffer(b)
		if err != nil {
			return nil, err
		}
		return b[:n], nil
	}
}
func (m *EventDataRoundState) XXX_Merge(src proto.Message) {
	xxx_messageInfo_EventDataRoundState.Merge(m, src)
}
func (m *EventDataRoundState) XXX_Size() int {
	return m.Size()
}
func (m *EventDataRoundState) XXX_DiscardUnknown() {
	xxx_messageInfo_EventDataRoundState.DiscardUnknown(m)
}

var xxx_messageInfo_EventDataRoundState proto.InternalMessageInfo

func (m *EventDataRoundState) GetHeight() int64 {
	if m != nil {
		return m.Height
	}
	return 0
}

func (m *EventDataRoundState) GetRound() int32 {
	if m != nil {
		return m.Round
	}
	return 0
}

func (m *EventDataRoundState) GetStep() string {
	if m != nil {
		return m.Step
	}
	return ""
}

func init() {
	proto.RegisterType((*EventDataRoundState)(nil), "tendermint.types.EventDataRoundState")
}

func init() { proto.RegisterFile("tendermint/types/events.proto", fileDescriptor_72cfafd446dedf7c) }

var fileDescriptor_72cfafd446dedf7c = []byte{
	// 189 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2d, 0x49, 0xcd, 0x4b,
	0x49, 0x2d, 0xca, 0xcd, 0xcc, 0x2b, 0xd1, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x4f, 0x2d, 0x4b,
	0xcd, 0x2b, 0x29, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x40, 0x48, 0xeb, 0x81, 0xa5,
	0x95, 0xc2, 0xb9, 0x84, 0x5d, 0x41, 0x2a, 0x5c, 0x12, 0x4b, 0x12, 0x83, 0xf2, 0x4b, 0xf3, 0x52,
	0x82, 0x4b, 0x12, 0x4b, 0x52, 0x85, 0xc4, 0xb8, 0xd8, 0x32, 0x52, 0x33, 0xd3, 0x33, 0x4a, 0x24,
	0x18, 0x15, 0x18, 0x35, 0x98, 0x83, 0xa0, 0x3c, 0x21, 0x11, 0x2e, 0xd6, 0x22, 0x90, 0x2a, 0x09,
	0x26, 0x05, 0x46, 0x0d, 0xd6, 0x20, 0x08, 0x47, 0x48, 0x88, 0x8b, 0xa5, 0xb8, 0x24, 0xb5, 0x40,
	0x82, 0x59, 0x81, 0x51, 0x83, 0x33, 0x08, 0xcc, 0x76, 0x0a, 0x3c, 0xf1, 0x48, 0x8e, 0xf1, 0xc2,
	0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1,
	0xc6, 0x63, 0x39, 0x86, 0x28, 0xf3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c,
	0x7d, 0x64, 0xe7, 0x22, 0x98, 0x60, 0xc7, 0xea, 0xa3, 0x7b, 0x25, 0x89, 0x0d, 0x2c, 0x6e, 0x0c,
	0x08, 0x00, 0x00, 0xff, 0xff, 0xc3, 0xe9, 0x14, 0x02, 0xe5, 0x00, 0x00, 0x00,
}

func (m *EventDataRoundState) Marshal() (dAtA []byte, err error) {
	size := m.Size()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBuffer(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *EventDataRoundState) MarshalTo(dAtA []byte) (int, error) {
	size := m.Size()
	return m.MarshalToSizedBuffer(dAtA[:size])
}

func (m *EventDataRoundState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if len(m.Step) > 0 {
		i -= len(m.Step)
		copy(dAtA[i:], m.Step)
		i = encodeVarintEvents(dAtA, i, uint64(len(m.Step)))
		i--
		dAtA[i] = 0x1a
	}
	if m.Round != 0 {
		i = encodeVarintEvents(dAtA, i, uint64(m.Round))
		i--
		dAtA[i] = 0x10
	}
	if m.Height != 0 {
		i = encodeVarintEvents(dAtA, i, uint64(m.Height))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

func encodeVarintEvents(dAtA []byte, offset int, v uint64) int {
	offset -= sovEvents(v)
	base := offset
	for v >= 1<<7 {
		dAtA[offset] = uint8(v&0x7f | 0x80)
		v >>= 7
		offset++
	}
	dAtA[offset] = uint8(v)
	return base
}
func (m *EventDataRoundState) Size() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Height != 0 {
		n += 1 + sovEvents(uint64(m.Height))
	}
	if m.Round != 0 {
		n += 1 + sovEvents(uint64(m.Round))
	}
	l = len(m.Step)
	if l > 0 {
		n += 1 + l + sovEvents(uint64(l))
	}
	return n
}

func sovEvents(x uint64) (n int) {
	return (math_bits.Len64(x|1) + 6) / 7
}
func sozEvents(x uint64) (n int) {
	return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (m *EventDataRoundState) Unmarshal(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return ErrIntOverflowEvents
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: EventDataRoundState: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: EventDataRoundState: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType)
			}
			m.Height = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEvents
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Height |= int64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Round", wireType)
			}
			m.Round = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEvents
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Round |= int32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Step", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return ErrIntOverflowEvents
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return ErrInvalidLengthEvents
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return ErrInvalidLengthEvents
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Step = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := skipEvents(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return ErrInvalidLengthEvents
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func skipEvents(dAtA []byte) (n int, err error) {
	l := len(dAtA)
	iNdEx := 0
	depth := 0
	for iNdEx < l {
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return 0, ErrIntOverflowEvents
			}
			if iNdEx >= l {
				return 0, io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= (uint64(b) & 0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		wireType := int(wire & 0x7)
		switch wireType {
		case 0:
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowEvents
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				iNdEx++
				if dAtA[iNdEx-1] < 0x80 {
					break
				}
			}
		case 1:
			iNdEx += 8
		case 2:
			var length int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return 0, ErrIntOverflowEvents
				}
				if iNdEx >= l {
					return 0, io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				length |= (int(b) & 0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if length < 0 {
				return 0, ErrInvalidLengthEvents
			}
			iNdEx += length
		case 3:
			depth++
		case 4:
			if depth == 0 {
				return 0, ErrUnexpectedEndOfGroupEvents
			}
			depth--
		case 5:
			iNdEx += 4
		default:
			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
		}
		if iNdEx < 0 {
			return 0, ErrInvalidLengthEvents
		}
		if depth == 0 {
			return iNdEx, nil
		}
	}
	return 0, io.ErrUnexpectedEOF
}

var (
	ErrInvalidLengthEvents        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowEvents          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group")
)

repository: tendermint/tendermint

repo_name: tendermint/tendermint


text:
file(REMOVE_RECURSE
  "CMakeFiles/OccurenceofStringXinStringY.dir/main.cpp.obj"
  "OccurenceofStringXinStringY.pdb"
  "OccurenceofStringXinStringY.exe"
  "OccurenceofStringXinStringY.exe.manifest"
  "libOccurenceofStringXinStringY.dll.a"
)

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

extension: cmake


text:
@article{Watts-2022-Monthly,
    title = "Monthly variations of unregulated brominated disinfection by-products in chlorinated water are correlated with total bromine",
    author = "Watts, Christena  and
      Sun, Jianxian  and
      Jones, Paul D.  and
      Peng, Hui  and
      Giesy, John P.",
    journal = "Eco-Environment {\&} Health, Volume 1, Issue 3",
    volume = "1",
    number = "3",
    year = "2022",
    publisher = "Elsevier BV",
    url = "https://aclanthology.org/G22-1001",
    doi = "10.1016/j.eehl.2022.06.002",
    pages = "147--155",
}

repository: gwf-uwaterloo/gwf-publications

repo_name: gwf-uwaterloo/gwf-publications


text:
DESCRIPTION = "create Azboxhd patch.e2 images"
SECTION = "console/utils"
LICENSE = "GPL"

PV="1.3"
SRC_URI = "file://pack_e2.c \
			file://Makefile.am \
			file://configure.ac"

S = "${WORKDIR}/pack_e2"

inherit autotools native

do_configure_prepend() {
	install -m 0644 ${WORKDIR}/pack_e2.c ${S}
	install -m 0644 ${WORKDIR}/configure.ac ${S}
	install -m 0644 ${WORKDIR}/Makefile.am ${S}
}

repository: edwarekuo/openembedded

repo_name: edwarekuo/openembedded


text:
package problem1399

func countLargestGroup(n int) int {
	group := make(map[int]int)
	for i := 1; i <= n; i++ {
		s := 0
		for x := i; x > 0; x /= 10 {
			s += x % 10
		}
		group[s]++
	}
	ans, max := 0, 0
	for _, v := range group {
		if v == max {
			ans++
		} else if v > max {
			ans, max = 1, v
		}
	}
	return ans
}

repository: rohini-raja/leetcode

repo_name: rohini-raja/leetcode


text:
@inproceedings{Anke.2016b,
 abstract = {Hersteller technischer Geräte können durch Angebot datengetriebener Dienstleistungen auf Basis vernetzter Produkte – so genannte „Smart Services“ – ihre Wettbewerbsfähigkeit verbessern und neue Umsatzquellen erschließen. Die Konzeption und Bewertung von Smart Services auf Basis digital vernetzter Produkte ist von hoher Komplexität und Unsicherheit geprägt. Eine Vielzahl von Parametern und deren Abhängigkeiten müssen berücksichtigt werden und beeinflussen die Wirtschaftlichkeit der Dienstleistungen. Wir schlagen eine interaktive, tool-basierte Modellierung von Smart Services als Lösungsansatz vor, um während des iterativen Prozesses die wirtschaftlichen Auswirkungen von Gestaltungsentscheidungen abzuschätzen. Die Evaluierung zeigt, dass eine Verbesserung durch den Einsatz des Tools erreicht wird.},
 author = {Anke, Jürgen and Krenge, Julian},
 booktitle = {Multikonferenz Wirtschaftsinformatik},
 doi = {10.13140/RG.2.1.4209.6402},
 editor = {Nissen, Volker and Stelzer, Dirk and Straßburger, Steffen and Daniel, Fischer},
 file = {https://doi.org/10.13140/RG.2.1.4209.6402},
 isbn = {3863601327},
 title = {Prototyp eines Tools zur Abschätzung der Wirtschaftlichkeit von Smart Services für vernetzte Produkte},
 year = {2016}
}


text:
% This file was created with JabRef 2.10.
% Encoding: UTF-8

@Article{tolu2012,
  Title                    = {Bio-inspired adaptive feedback error learning architecture for motor control},
  Author                   = {Tolu, Silvia and Vanegas, Mauricio and Luque, Niceto R and Garrido, Jes{\'u}s A and Ros, Eduardo},
  Journal                  = {Biological cybernetics},
  Year                     = {2012},
  Number                   = {8-9},
  Pages                    = {507--522},
  Volume                   = {106},

  Publisher                = {Springer}
}

repository: EduardoRosLab/neurorobotics-website

repo_name: EduardoRosLab/neurorobotics-website


text:
---
---

@string{aps = {American Physical Society,}}

@misc{chan2020sampling,
        title={Sampling from the complement of a polyhedron: An MCMC algorithm for data augmentation},
        author={Chan, Timothy CY and Diamant, Adam and Mahmood, Rafid},
        code={https://github.com/rafidrm/mcmc-complement},
        pdf={MCMC_Sampling_Complement.pdf},
        year={2020}
}

@misc{babier2018ensemble,
        title={An ensemble learning framework for model fitting and evaluation in inverse linear optimization},
        author={Babier, Aaron and Chan, Timothy CY and Lee, Taewoo and Mahmood, Rafid and Terekhov, Daria},
        arxiv={1804.04576},
        year={2019},
}

@misc{babier2018learning,
        title={Learning to optimize with hidden constraints},
        author={Babier, Aaron and Chan, Timothy CY and Diamant, Adam and Mahmood, Rafid},
        arxiv={1805.09293},
        year={2019}
}

repository: rafidrm/al-folio

repo_name: rafidrm/al-folio


text:
@ARTICLE{TOOOL1,
    AUTHOR = "TOOOL",
    TITLE = "Introduction to Lockpicking",
    YEAR = {2014}
}
@ARTICLE{TOOOL2,
    AUTHOR = "TOOOL",
    TITLE = "ASSA Twin Systems (Part 1) The Unparalleled Security System",
    MONTH = {April},
    YEAR = {2008}
}
@ARTICLE{LAXTON,
    AUTHOR = "B. Laxton and K. Wang and S. Savage",
    TITLE = "Reconsidering Physical Key Secrecy: Teleduplication via Optical Decoding",
    MONTH = {October},
    DAY = {27-31},
    YEAR = {2008}
}
@PATENT{VALAVAARA,
    AUTHOR = {V. Valavaara},
    TITLE = "Topology Fabrication Apparatus",
    NUMBER = {US 4749347 A},
    MONTH = {June},
    DAY = {7},
    YEAR = {1988}
}
@PATENT{HULL,
    AUTHOR = {C. Hull},
    TITLE = "Apparatus for Production of Three-Dimensional Objects by Stereolithography",
    NUMBER = {US 4575330 A},
    MONTH = {March},
    DAY = {11},
    YEAR = {1986}
}
@PATENT{DAS,
    AUTHOR = "S. Das and J. Beaman",
    TITLE = "Direct Selective Laser Sintering of Metals",
    NUMBER = {US 6676892},
    MONTH = {January},
    DAY = {13},
    YEAR = {2004}
}


text:
// Copyright © 2019 Christian Rolly <mail@chromium-solutions.de>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

package create

import (
	"errors"
	"io/ioutil"
	"os"
	"path/filepath"
	"runtime"
	"strings"

	"github.com/crolly/dynQL/cmd/helpers"
	"github.com/crolly/dynQL/cmd/models"
	"github.com/spf13/cobra"
)

var (
	// CreateCmd represents the create command
	CreateCmd = &cobra.Command{
		Use:   "create",
		Short: "Creates the boilerplate for dynQL project.",
		Args:  cobra.ExactArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			p, err := createProjectStructure(args[0], force)
			err = os.Chdir(p)
			if err != nil {
				return err
			}
			_, err = helpers.ExecuteCommand(cmd.Root(), "add", "schema", schema)
			return err
		},
	}

	region, schema string
	force          bool

	gopkg = `[[constraint]]
	name = "github.com/aws/aws-lambda-go"
	version = "^1.0.1"`

	gitignore = `# dynQL
	bin/
	vendor/`
)

func init() {
	CreateCmd.SetHelpCommand(&cobra.Command{
		Use:    "no-help",
		Hidden: true,
	})
	CreateCmd.Flags().StringVarP(&region, "region", "r", "eu-central-1", "Region the Project will be deployed to (e.g. us-east-1 or eu-central-1)")
	CreateCmd.Flags().StringVarP(&schema, "schema", "s", "graphql", "Schema generated together with the create command to save one step")
	CreateCmd.Flags().BoolVarP(&force, "force", "f", false, "Force overwrite of the Directory in case it exists already")
}

// createsProjectStructure creates the project structure with serverless.yml and mug.config.json
func createProjectStructure(projectName string, force bool) (string, error) {
	// create new config from project name
	config, err := newConfig(projectName)
	if err != nil {
		return "", err
	}

	projPath := helpers.GetProjectPath(config.ProjectPath)
	if force {
		os.RemoveAll(projPath)
	} else if _, err := os.Stat(projPath); !os.IsNotExist(err) {
		// projectPath exists already
		return "", errors.New("folder already exists - raising error: " + err.Error())
	}
	os.MkdirAll(projPath, 0755)

	// write Gopkg.toml
	if err := ioutil.WriteFile(filepath.Join(projPath, "Gopkg.toml"), []byte(gopkg), 0644); err != nil {
		return "", err
	}

	// write .gitignore
	if err := ioutil.WriteFile(filepath.Join(projPath, ".gitignore"), []byte(gitignore), 0644); err != nil {
		return "", err
	}

	// persist config
	return projPath, config.Write()
}

func newConfig(projectName string) (*models.DQLConfig, error) {
	pName, path, err := getPath(projectName)
	if err != nil {
		return nil, err
	}

	config := &models.DQLConfig{
		ProjectName: pName,
		ProjectPath: path,
		Region:      region,
	}

	return config, nil
}

func getPath(projectName string) (string, string, error) {
	path := ""

	// environments GOPATH
	goPath := os.Getenv("GOPATH")
	if len(goPath) == 0 {
		return "", "", errors.New("$GOPATH is not set")
	}
	srcPath := filepath.Join(goPath, "src")

	if strings.Contains(projectName, "/") {
		// project is created with full path to GOPATH src e.g. github.com/crolly/dynQL-example
		path = projectName

		i := strings.LastIndex(projectName, "/")
		projectName = projectName[i+1 : len(projectName)]
	} else {
		// project is created with project name only
		wd, err := helpers.GetWorkingDir()
		if err != nil {
			return "", "", err
		}
		if filepathHasPrefix(wd, srcPath) {
			path = filepath.Join(wd, projectName)
			path = strings.TrimPrefix(strings.Replace(path, srcPath, "", 1), "/")
		} else {
			return "", "", errors.New("You must either create the project inside of $GOPATH or provide the full path (e.g. github.com/crolly/dynQL-example")
		}
	}

	return projectName, path, nil
}

func filepathHasPrefix(path string, prefix string) bool {
	if len(path) <= len(prefix) {
		return false
	}
	if runtime.GOOS == "windows" {
		// Paths in windows are case-insensitive.
		return strings.EqualFold(path[0:len(prefix)], prefix)
	}
	return path[0:len(prefix)] == prefix

}

repository: crolly/dynQL

repo_name: crolly/dynQL


text:
@article{McKenzie-2018-Influence,
    title = "Influence of seasonal temperature on tree-ring δ13C in different-aged temperate pine forests",
    author = "McKenzie, Shawn M.  and
      Slater, Greg  and
      Kim, Sang-Tae  and
      Pisaric, Michael F.J.  and
      Arain, M. Altaf",
    journal = "Forest Ecology and Management, Volume 419-420",
    volume = "419",
    year = "2018",
    publisher = "Elsevier BV",
    url = "https://aclanthology.org/G18-83001",
    doi = "10.1016/j.foreco.2018.03.042",
    pages = "197--205",
}


text:
#
# Copyright (C) 2014 Eric Mauser
#

SUMMARY = "Wifi package groups"
LICENSE = "MIT"

inherit packagegroup

RDEPENDS_${PN} = "\
    wpa-supplicant \
    wireless-tools \
    "

repository: shagu/meta-teapot

repo_name: shagu/meta-teapot