text:
package system

import (
	"bytes"
	"errors"
	"os/exec"
)

func CreateBundleUser(username string) (error, error) {
	var cerr bytes.Buffer
	var err error

	adduserArgs := []string{
		"--disabled-password",
		"--gecos",
		"",
		username,
	}

	keygenArgs := []string{
		"-t",
		"rsa",
		"-N",
		"",
		"-f",
		"/home/" + username + "/.ssh/id_rsa",
	}

	// Add the user
	cmd := exec.Command("adduser", adduserArgs...)
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	// Create the .ssh folder for said user
	cmd = exec.Command("mkdir", "/home/"+username+"/.ssh")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	// Create authorized_keys file
	cmd = exec.Command("touch", "/home/"+username+"/.ssh/authorized_keys")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	// Put root public key into authorized_keys file
	cmd = exec.Command("cp", "/root/.ssh/id_rsa.pub", "/home/"+username+"/.ssh/authorized_keys")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	// Create the host key-pair for said user
	cmd = exec.Command("ssh-keygen", keygenArgs...)
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	// Create document root for said user
	cmd = exec.Command("mkdir", "/home/"+username+"/document_root")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	/* OWNERSHIP AND FILE PERMISSIONS START */
	cmd = exec.Command("chmod", "700", "/home/"+username+"/.ssh")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	cmd = exec.Command("chmod", "600", "/home/"+username+"/.ssh/id_rsa")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	cmd = exec.Command("chmod", "644", "/home/"+username+"/.ssh/id_rsa.pub")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	cmd = exec.Command("chmod", "644", "/home/"+username+"/.ssh/authorized_keys")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	cmd = exec.Command("chown", username+":", "/home/"+username+"/.ssh")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	cmd = exec.Command("chown", username+":", "/home/"+username+"/.ssh/id_rsa")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	cmd = exec.Command("chown", username+":", "/home/"+username+"/.ssh/id_rsa.pub")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	cmd = exec.Command("chown", username+":", "/home/"+username+"/.ssh/authorized_keys")
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}
	/* OWNERSHIP AND FILE PERMISSIONS END */

	return nil, nil
}

func DeleteBundleUser(username string) (error, error) {
	var cerr bytes.Buffer
	var err error

	// Delete the user and try to remove all files associated
	cmd := exec.Command("deluser", "--quiet", username)
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	// Forcefully remove the users home directory if it has not already been done
	// (sometimes deluser doesn't do its job even with the flag)
	cmd = exec.Command("rm", "-rf", "/home/"+username)
	cmd.Stderr = &cerr

	if err = cmd.Run(); err != nil {
		return err, errors.New(cerr.String())
	}

	return nil, nil
}


text:
enable_language(CXX)
add_library(foo empty.cpp)
set_target_properties(foo PROPERTIES
  JUST_A_PROPERTY "$<C_COMPILER_VERSION:0>"
  EXPORT_PROPERTIES "JUST_A_PROPERTY"
)
export(TARGETS foo FILE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake")
install(TARGETS foo EXPORT fooExport
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
)

license_type: permissive

branch_name: refs/heads/main

gha_license_id: MIT

extension: cmake


text:
package utilities

import (
	"fmt"
	"time"
	"os"
)

type LogFile struct {

}

func (lf *LogFile) CurrentFile()(*os.File){
	fileName := fmt.Sprintf("log.%s.txt", time.Now().Format("2006_01_02"))
	cur, _ := os.Getwd()
	logDir := cur + "/log"
	if b, _ := lf.PathExists(logDir); !b {
		os.Mkdir(logDir, os.ModePerm)
	}
	file,_ := os.OpenFile(logDir + "/" + fileName, os.O_RDWR|os.O_APPEND|os.O_CREATE,0666)
	return file
}

func (lf *LogFile) Write(p []byte) (n int, err error) {
	file := lf.CurrentFile()
	return file.Write(p)
}

func (lf *LogFile) PathExists(path string) (bool, error) {
	_, err := os.Stat(path)
	if err == nil {
		return true, nil
	}
	if os.IsNotExist(err) {
		return false, nil
	}
	return false, err
}

repository: seed-builder/umbrella-go

repo_name: seed-builder/umbrella-go

branch_name: refs/heads/master

extension: go


text:
SUMMARY = "Poppler is a PDF rendering library based on the xpdf-3.0 code base"
HOMEPAGE = "https://poppler.freedesktop.org/"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"

SRC_URI = "http://poppler.freedesktop.org/${BP}.tar.xz \
           file://0001-Do-not-overwrite-all-our-build-flags.patch \
           file://basename-include.patch \
           file://0001-cmake-Do-not-use-isystem.patch \
           file://jpeg-stdio.patch \
           "
SRC_URI[sha256sum] = "b6d893dc7dcd4138b9e9df59a13c59695e50e80dc5c2cacee0674670693951a1"

DEPENDS = "fontconfig zlib cairo lcms glib-2.0 glib-2.0-native"

inherit cmake pkgconfig gobject-introspection

PACKAGECONFIG ??= "jpeg openjpeg png tiff nss splash"
PACKAGECONFIG[jpeg] = "-DWITH_JPEG=ON -DENABLE_DCTDECODER=libjpeg,-DWITH_JPEG=OFF -DENABLE_DCTDECODER=none,jpeg"
PACKAGECONFIG[png] = "-DWITH_PNG=ON,-DWITH_PNG=OFF,libpng"
PACKAGECONFIG[tiff] = "-DWITH_TIFF=ON,-DWITH_TIFF=OFF,tiff"
PACKAGECONFIG[curl] = "-DENABLE_LIBCURL=ON,-DENABLE_LIBCURL=OFF,curl"
PACKAGECONFIG[openjpeg] = "-DENABLE_LIBOPENJPEG=openjpeg2,-DENABLE_LIBOPENJPEG=none,openjpeg"
PACKAGECONFIG[qt5] = "-DENABLE_QT5=ON,-DENABLE_QT5=OFF,qtbase qttools-native"
PACKAGECONFIG[nss] = "-DWITH_NSS3=ON,-DWITH_NSS3=OFF,nss"
PACKAGECONFIG[splash] = "-DENABLE_SPLASH=ON -DENABLE_BOOST=ON,-DENABLE_SPLASH=OFF -DENABLE_BOOST=OFF,boost"

# surprise - did not expect this to work :)
inherit ${@bb.utils.contains('PACKAGECONFIG', 'qt5', 'cmake_qt5', '', d)}

SECURITY_CFLAGS = "${SECURITY_NO_PIE_CFLAGS}"

EXTRA_OECMAKE += " \
    -DENABLE_CMS=lcms2 \
    -DENABLE_UNSTABLE_API_ABI_HEADERS=ON \
    -DBUILD_GTK_TESTS=OFF \
    -DENABLE_ZLIB=ON \
    -DRUN_GPERF_IF_PRESENT=OFF \
    -DCMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES:PATH='${STAGING_INCDIR}' \
    ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_GOBJECT_INTROSPECTION=ON', '-DENABLE_GOBJECT_INTROSPECTION=OFF', d)} \
"
EXTRA_OECMAKE:append:class-native = " -DENABLE_CPP=OFF"

do_configure:append() {
    # poppler macro uses pkg-config to check for g-ir runtimes. Something
    # makes them point to /usr/bin. Align them to sysroot - that's where the
    # gir-wrappers are:
    sed -i 's: ${bindir}/g-ir: ${STAGING_BINDIR}/g-ir:' ${B}/build.ninja
}

PACKAGES =+ "libpoppler libpoppler-glib"
FILES:libpoppler = "${libdir}/libpoppler.so.*"
FILES:libpoppler-glib = "${libdir}/libpoppler-glib.so.*"

RDEPENDS:libpoppler = "poppler-data"

BBCLASSEXTEND = "native"

license: MIT

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake

extension: bb


text:
SUMMARY = "Perl interface to the PC/SC smart card library"
DESCRIPTION = "Perl wrapper to the PC/SC smartcard library (pcsc-lite) \
together with some small examples. \
The provided modules are Chipcard::PCSC and Chipcard::PCSC::Card."
HOMEPAGE = "https://metacpan.org/dist/pcsc-perl"
SECTION = "libs"
LICENSE = "Artistic-1.0 | GPL-1.0-or-later"
LIC_FILES_CHKSUM = "file://LICENCE;md5=b234ee4d69f5fce4486a80fdaf4a4263"

SRC_URI = "https://cpan.metacpan.org/authors/id/W/WH/WHOM/pcsc-perl-${PV}.tar.bz2"
SRC_URI[md5sum] = "45601505dbb7b27329811ac9bad35fab"
SRC_URI[sha256sum] = "2722b7e5543e4faf3ba1ec6b29a7dfec6d92be1edec09d0a3191992d4d88c69d"

S = "${WORKDIR}/pcsc-perl-${PV}"

inherit cpan pkgconfig

DEPENDS += "pcsc-lite"

RDEPENDS:${PN} += "perl-module-carp"

BBCLASSEXTEND="native"


text:
package learn

import (
	"github.com/tsinghua-io/api-server/util"
	"net/http"
	"testing"
)

func TestSemesters(t *testing.T) {
	thisSem, nextSem, status, err := ada.Semesters()

	if err != nil {
		t.Fatalf("Failed to get semesters: %s", err)
	}

	util.ExpectStatus(t, status, http.StatusOK)

	util.ExpectDeepEqual(t, thisSem.Id, "2015-2016-2")
	util.ExpectDeepEqual(t, nextSem.Id, "2015-2016-3")
}

repository: tsinghua-io/api-server

repo_name: tsinghua-io/api-server


text:
package cmd

import (
	"github.com/emirpasic/gods/maps/linkedhashmap"
	cmdutil "github.com/puppetlabs/wash/cmd/util"
	"github.com/spf13/cobra"
	goyaml "gopkg.in/yaml.v2"
)

func infoCommand() *cobra.Command {
	use, aliases := generateShellAlias("info")
	infoCmd := &cobra.Command{
		Use:     use + " <path>",
		Aliases: aliases,
		Short:   "Prints the entry's info at the specified path",
		Long:    `Print all info Wash has about the specified path.`,
		Args:    cobra.ExactArgs(1),
		RunE:    toRunE(infoMain),
	}
	infoCmd.Flags().StringP("output", "o", "yaml", "Set the output format (json, yaml, or text)")
	return infoCmd
}

func infoMain(cmd *cobra.Command, args []string) exitCode {
	path := args[0]
	output, err := cmd.Flags().GetString("output")
	if err != nil {
		panic(err.Error())
	}

	marshaller, err := cmdutil.NewMarshaller(output)
	if err != nil {
		cmdutil.ErrPrintf(err.Error())
		return exitCode{1}
	}

	conn := cmdutil.NewClient()

	entry, err := conn.Info(path)
	if err != nil {
		cmdutil.ErrPrintf("%v\n", err)
		return exitCode{1}
	}

	// Use a sorted map so that we can control how the information's displayed.
	entryMap := orderedMap{linkedhashmap.New()}
	entryMap.Put("Path", entry.Path)
	entryMap.Put("Name", entry.Name)
	entryMap.Put("CName", entry.CName)
	entryMap.Put("Actions", entry.Actions)
	entryMap.Put("Attributes", entry.Attributes.ToMap(false))

	marshalledEntry, err := marshaller.Marshal(entryMap)
	if err != nil {
		cmdutil.ErrPrintf("%v\n", err)
		return exitCode{1}
	}

	cmdutil.Print(marshalledEntry)

	return exitCode{0}
}

// This wrapped type's here because linkedhashmap doesn't implement the
// json.Marshaler and yaml.Marshaler interfaces.
type orderedMap struct {
	*linkedhashmap.Map
}

func (mp orderedMap) MarshalJSON() ([]byte, error) {
	return mp.ToJSON()
}

// We implement MarshalYAML to preserve each key's ordering.
func (mp orderedMap) MarshalYAML() (interface{}, error) {
	var yamlMap goyaml.MapSlice
	mp.Each(func(key interface{}, value interface{}) {
		yamlMap = append(yamlMap, goyaml.MapItem{
			Key:   key,
			Value: value,
		})
	})
	return yamlMap, nil
}

repository: grimradical/wash

repo_name: grimradical/wash

gha_language: Go


text:
// Copyright 2018 Kuei-chun Chen. All rights reserved.

package sim

import (
	"bytes"
	"compress/gzip"
	"encoding/json"
	"fmt"
	"log"
	"os"
	"sort"
	"strconv"
	"strings"
	"time"

	"github.com/simagix/keyhole/mdb"
	anly "github.com/simagix/mongo-ftdc/analytics"
	"go.mongodb.org/mongo-driver/bson"
	"go.mongodb.org/mongo-driver/mongo"
	"go.mongodb.org/mongo-driver/x/mongo/driver/connstring"
)

var fileTimestamp = strings.Replace(time.Now().Format(time.RFC3339)[:19], ":", "", -1)
var keyholeStatsDataFile = "./keyhole_stats." + fileTimestamp

var mb = 1024.0 * 1024
var serverInfoDocs = map[string]anly.ServerInfoDoc{}
var serverStatusDocs = map[string][]anly.ServerStatusDoc{}
var replSetStatusDocs = map[string][]anly.ReplSetStatusDoc{}

func getServerInfoDocs(key string) anly.ServerInfoDoc         { return serverInfoDocs[key] }
func getServerStatusDocs(key string) []anly.ServerStatusDoc   { return serverStatusDocs[key] }
func getReplSetStatusDocs(key string) []anly.ReplSetStatusDoc { return replSetStatusDocs[key] }

// Frequency stores wait time
type Frequency struct {
	replset      int
	serverStatus int
}

// ServerStats stores server stats struct
type ServerStats struct {
	channel chan string
	mkey    string
	peek    bool
	freq    Frequency
	uri     string
	verbose bool
}

// NewServerStats gets server status
func NewServerStats(uri string, channel chan string) *ServerStats {
	connStr, _ := connstring.Parse(uri)
	mkey := connStr.ReplicaSet
	if mkey == "" {
		mkey = mdb.STANDALONE
	}
	freq := Frequency{serverStatus: 5, replset: 10}
	return &ServerStats{channel: channel, uri: uri, mkey: mkey, freq: freq}
}

// SetVerbose sets verbose
func (st *ServerStats) SetVerbose(verbose bool) { st.verbose = verbose }

// SetPeekingMode sets peeking mode
func (st *ServerStats) SetPeekingMode(peek bool) {
	st.peek = peek
	if st.peek == true {
		st.freq.serverStatus = 1
		st.freq.replset = 5
	}
}

// getServerStatus gets db.serverStatus() every minute
func (st *ServerStats) getServerStatus(client *mongo.Client) error {
	defer func() {
		if r := recover(); r != nil {
		}
	}()
	var pstat = anly.ServerStatusDoc{}
	var stat = anly.ServerStatusDoc{}
	var iop int
	var piop int
	var r, w, c float64
	if st.verbose {
		rstr := fmt.Sprintf("getServerStatus gets every %d seconds(s)\n", st.freq.serverStatus)
		st.channel <- rstr
	}
	st.channel <- "[" + st.mkey + "] getServerStatus begins\n"
	for {
		serverStatus, _ := mdb.RunAdminCommand(client, "serverStatus")
		buf, _ := bson.Marshal(serverStatus)
		bson.Unmarshal(buf, &stat)
		serverStatusDocs[st.uri] = append(serverStatusDocs[st.uri], stat)
		if len(serverStatusDocs[st.uri]) > 600 {
			st.saveServerStatusDocsToFile(st.uri)
		}

		var msg1, msg2 string
		str := fmt.Sprintf("[%s] Memory - resident: %d, virtual: %d",
			st.mkey, stat.Mem.Resident, stat.Mem.Virtual)
		iop = stat.Metrics.Document.Inserted + stat.Metrics.Document.Returned +
			stat.Metrics.Document.Updated + stat.Metrics.Document.Deleted
		iops := float64(iop-piop) / 60
		if len(serverStatusDocs[st.uri]) > 6 && len(serverStatusDocs[st.uri])%6 == 1 {
			pstat = serverStatusDocs[st.uri][len(serverStatusDocs[st.uri])-7]
			if stat.Host == pstat.Host {
				str += fmt.Sprintf(", page faults: %d, iops: %.1f\n",
					(stat.ExtraInfo.PageFaults - pstat.ExtraInfo.PageFaults), iops)
				msg1 = fmt.Sprintf("[%s] CRUD+  - insert: %d, find: %d, update: %d, delete: %d, getmore: %d, command: %d\n",
					st.mkey, stat.OpCounters.Insert-pstat.OpCounters.Insert,
					stat.OpCounters.Query-pstat.OpCounters.Query,
					stat.OpCounters.Update-pstat.OpCounters.Update,
					stat.OpCounters.Delete-pstat.OpCounters.Delete,
					stat.OpCounters.Getmore-pstat.OpCounters.Getmore,
					stat.OpCounters.Command-pstat.OpCounters.Command)
				r = 0
				if stat.OpLatencies.Reads.Ops > 0 {
					r = float64(stat.OpLatencies.Reads.Latency) / float64(stat.OpLatencies.Reads.Ops) / 1000
				}
				w = 0
				if stat.OpLatencies.Writes.Ops > 0 {
					w = float64(stat.OpLatencies.Writes.Latency) / float64(stat.OpLatencies.Writes.Ops) / 1000
				}
				c = 0
				if stat.OpLatencies.Commands.Ops > 0 {
					c = float64(stat.OpLatencies.Commands.Latency) / float64(stat.OpLatencies.Commands.Ops) / 1000
				}
				msg2 = fmt.Sprintf("[%s] Latency- read: %.1f, write: %.1f, command: %.1f (ms)\n",
					st.mkey, r, w, c)
			} else {
				str += "\n"
			}
		} else {
			str += "\n"
		}
		if len(serverStatusDocs[st.uri])%6 == 1 {
			st.channel <- str
			if msg1 != "" {
				st.channel <- msg1
			}
			if msg2 != "" {
				st.channel <- msg2
			}
		}
		piop = iop
		time.Sleep(time.Duration(st.freq.serverStatus) * time.Second)
	}
}

// getReplSetGetStatus gets {replSetGetStatus: 1} every minute
func (st *ServerStats) getReplSetGetStatus(client *mongo.Client) error {
	defer func() {
		if r := recover(); r != nil {
		}
	}()
	var err error
	var replSetStatus = anly.ReplSetStatusDoc{}
	var doc bson.M
	if st.verbose {
		rstr := fmt.Sprintf("ReplSetGetStatus gets every minute\n")
		st.channel <- rstr
	}
	st.channel <- "[" + st.mkey + "] ReplSetGetStatus begins\n"

	for {
		doc, err = mdb.RunAdminCommand(client, "replSetGetStatus")
		if err == nil {
			buf, _ := bson.Marshal(doc)
			bson.Unmarshal(buf, &replSetStatus)
			replSetStatusDocs[st.uri] = append(replSetStatusDocs[st.uri], replSetStatus)
			sort.Slice(replSetStatus.Members, func(i, j int) bool { return replSetStatus.Members[i].Name < replSetStatus.Members[j].Name })
			var ts int64
			for _, mb := range replSetStatus.Members {
				if mb.State == 1 {
					ts = anly.GetOptime(mb.Optime)
					break
				}
			}

			str := fmt.Sprintf("[%s] replication lags: ", st.mkey)
			for _, mb := range replSetStatus.Members {
				if mb.State == 2 {
					str += " - " + mb.Name + ": " + strconv.Itoa(int(ts-anly.GetOptime(mb.Optime)))
				}
			}
			st.channel <- str
		}
		time.Sleep(time.Duration(st.freq.replset) * time.Second)
	}
}

// getDBStats gets dbStats every 10 seconds
func (st *ServerStats) getDBStats(client *mongo.Client, dbName string) error {
	defer func() {
		if r := recover(); r != nil {
		}
	}()
	var err error
	var docs map[string]interface{}
	var prevDataSize float64
	var dataSize float64
	prevTime := time.Now()
	now := prevTime
	st.channel <- "[" + st.mkey + "] getDBStats begins\n"
	for i := 0; i < 30; i++ { // no need to get after 5 minutes
		if err == nil {
			stat, _ := mdb.RunCommandOnDB(client, "dbStats", dbName)
			buf, _ := json.Marshal(stat)
			json.Unmarshal(buf, &docs)
			if docs["dataSize"] != nil {
				dataSize = docs["dataSize"].(float64)
			}
			sec := now.Sub(prevTime).Seconds()
			delta := (dataSize - prevDataSize) / mb / sec
			if sec > 5 && delta >= 0 {
				str := fmt.Sprintf("[%s] Storage: %.1f -> %.1f, rate: %.1f MB/sec\n",
					st.mkey, prevDataSize/mb, dataSize/mb, delta)
				st.channel <- str
			}
			prevDataSize = dataSize
			prevTime = now
			now = time.Now()
		}
		time.Sleep(10 * time.Second)
	}
	st.channel <- "[" + st.mkey + "] getDBStats exiting...\n"
	return err
}

// getMongoConfig gets mongo configs
func (st *ServerStats) getMongoConfig(client *mongo.Client) error {
	defer func() {
		if r := recover(); r != nil {
		}
	}()
	var err error
	st.channel <- "[" + st.mkey + "] getMongoConfig begins\n"
	serverInfoDocs[st.uri] = anly.ServerInfoDoc{}
	var config = bson.M{}
	// hostInfo
	var hostInfo bson.M
	if hostInfo, err = mdb.RunAdminCommand(client, "hostInfo"); err == nil {
		config["hostInfo"] = hostInfo
	}

	// buildInfo
	var buildInfo bson.M
	if buildInfo, err = mdb.RunAdminCommand(client, "buildInfo"); err == nil {
		config["buildInfo"] = buildInfo
	}
	buf, _ := bson.Marshal(config)
	cfg := serverInfoDocs[st.uri]
	bson.Unmarshal(buf, &cfg)
	serverInfoDocs[st.uri] = cfg
	st.channel <- "[" + st.mkey + "] mongo version: " + serverInfoDocs[st.uri].BuildInfo.Version + "\n"
	return err
}

// printServerStatus prints serverStatusDocs summary for the duration
func (st *ServerStats) printServerStatus(client *mongo.Client, span int) (string, error) {
	var err error
	var stat anly.ServerStatusDoc
	var filename string
	var str string
	serverStatus, _ := mdb.RunAdminCommand(client, "serverStatus")
	buf, _ := bson.Marshal(serverStatus)
	bson.Unmarshal(buf, &stat)
	serverStatusDocs[st.uri] = append(serverStatusDocs[st.uri], stat)
	if filename, err = st.saveServerStatusDocsToFile(st.uri); err != nil {
		return filename, err
	}
	var filenames = []string{filename}
	d := anly.NewDiagnosticData(span)
	if str, err = d.PrintDiagnosticData(filenames); err != nil {
		return filename, err
	}
	fmt.Println(str)
	return filename, err
}

// saveServerStatusDocsToFile appends []ServerStatusDoc to a file
func (st *ServerStats) saveServerStatusDocsToFile(uri string) (string, error) {
	var file *os.File
	var err error
	var filename string
	filename = keyholeStatsDataFile + "-" + st.mkey + ".gz"
	sbuf, _ := json.Marshal(serverStatusDocs[uri])
	serverStatusDocs[uri] = []anly.ServerStatusDoc{}
	rbuf, _ := json.Marshal(replSetStatusDocs[uri])
	replSetStatusDocs[uri] = []anly.ReplSetStatusDoc{}
	cbuf, _ := json.Marshal(serverInfoDocs[uri])
	var zbuf bytes.Buffer
	gz := gzip.NewWriter(&zbuf)
	gz.Write(sbuf)
	gz.Write([]byte{'\n'})
	gz.Write(rbuf)
	gz.Write([]byte{'\n'})
	gz.Write(cbuf)
	gz.Write([]byte{'\n'})
	gz.Close() // close this before flushing the bytes to the buffer.

	if file, err = os.OpenFile(filename, os.O_WRONLY|os.O_APPEND, 0644); err != nil {
		if file, err = os.Create(filename); err != nil {
			return filename, err
		}
	}
	defer file.Close()
	file.Write(zbuf.Bytes())
	file.Sync()
	return filename, err
}

func (st *ServerStats) collectMetrics(client *mongo.Client, key string) {
	wtc := mdb.NewWiredTigerCache(client)
	metrics := anly.NewMetrics()
	metrics.ProcessFiles([]string{})
	for {
		if err := wtc.GetAllDatabasesInfo(); err != nil {
			log.Println(err)
		}
		diag := anly.DiagnosticData{}
		diag.ServerInfo = getServerInfoDocs(key)
		diag.ServerStatusList = getServerStatusDocs(key)
		diag.ReplSetStatusList = getReplSetStatusDocs(key)
		metrics.AddFTDCDetailStats(&diag)
		time.Sleep(5 * time.Second)
	}
}

repository: khanhney/keyhole

repo_name: khanhney/keyhole


text:
require mingw-binutils.inc

SRC_URI[md5sum] = "ad3f2b5fdcd599a772ad75fec2c384d8"
SRC_URI[sha256sum] = "2df529b1ac0a621efb87b5b53dbc0167c566f8bebbd6a8ce19964b05845fd2e7"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
DESCRIPTION = "github.com/lunny/log"

GO_IMPORT = "github.com/lunny/log"

inherit go

SRC_URI = "git://github.com/lunny/log;protocol=https;destsuffix=${PN}-${PV}/src/${GO_IMPORT}"
SRCREV = "7887c61bf0de75586961948b286be6f7d05d9f58"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=a45b3c31ba2fa18ad1834084a30c4918"

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

branch_name: refs/heads/develop


text:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFileDialog>
#include <QMouseEvent>
#include <QtCore/qmath.h>
#include <QPainter>
#include <QMessageBox>
#include <QDialog>
#include <QtGui>  //SS

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>

#define FORCE 0 //force threshold
#define A 1/*Flow Angle = tan-inv(1/A)

                    1 - 45   deg
                    2 - 26.6
                    3 - 18.4
                    4 - 14
                    5 - 11.3
                    6 - 9.5
*/
#define MAX 1000//maximum nummber of spines in an image

struct spine_struct
{
    unsigned short spine_flag;
    unsigned int sp_id,pCGx,pCGy,pArea,bCGx,bCGy,bCnt;
    unsigned short seedX,seedY,x1,y1,x2,y2,w,h,headX,headY,majA,minA;
    unsigned char **data,type;
    float length, headW,headWmax, neck_length,avg_neckW,min_neckW,tA;

};

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void        mousePressEvent( QMouseEvent * );
    void        keyPressEvent(QKeyEvent *);

private slots:

    void on_Load_Image_clicked();

    void on_bth_valueChanged(int value);

    void on_binarize_clicked();

    void on_flow_to_right_clicked();

    void on_flow_to_left_clicked();

    void on_reset_flow_clicked();

    void on_segment_clicked();

    void on_segment27_clicked();

    void on_save_image_clicked();

    void on_mark_spines_clicked(bool checked);

    void on_pushButton_Reset_ROI_clicked();

    void on_checkBox_zoom_clicked();

     void on_pushButton_change_label_clicked();

     void on_pushButton_show_all_marked_sp_clicked();

     void on_checkBox_delSp_clicked(bool checked);

     void on_lineEdit_new_editingFinished();

     void on_checkBox_delSp_clicked();

     void on_pushButton_load_spine_annotation_clicked();

     void on_pushButton_delete_by_spine_number_clicked();

     void on_lineEdit_current_editingFinished();

     void on_pushButton_set_spid_clicked();

     void on_checkBox_manualSeg_clicked();

     void on_checkBox_joinSeg_clicked();

     void on_checkBox_clicked();

     void on_lneZoom_lostFocus();

     void on_lneZoom_returnPressed();

     void on_hsbZoom_valueChanged(int value);

     void on_bth_sliderReleased();

     void on_spinBox_valueChanged(int arg1);

     void on_bth_sliderPressed();

     void on_lineEdit_sp_no_returnPressed();

private:
    Ui::MainWindow *ui;

    unsigned char **symbol;
    unsigned char **symbol_bak;

    unsigned char **nodemat;
    unsigned int **intorg;
    unsigned int **orgmat;
    unsigned int **hmat;
    int **DT, **DT1, **DT2;

    QString filepath;
    QByteArray filename,only_filename;

    QPoint startP, endP, segStart, segEnd;
    QPoint  spineP,startROI, endROI,zoomROIs,zoomROIe,scrollPOS;
    QMessageBox msgBox;
    QImage save_img;

    struct spine_struct spine[MAX];
    unsigned int pID, trace_cnt;
    unsigned short maxpID;
    unsigned short usedPID[500];
    unsigned int delCGx,delCGy,delArea;
    unsigned short M,N, sM, sN;
    unsigned char SEflag,saveFlag, ROIflag,badSpine,step, manual_segment;
    short BinTh;
    int flow_angle;
    unsigned int flow_cnt;
    float scaleX,scaleY;
    float scaleSS, lastscaleSS;

    QString str;

    void draw_image();
    void writeinfile(int);
    void spine_analysis(int,int);
    void delete_spine(int,int);
    void draw_ROI();
    void FloodFill(int,int);
    void FloodFill1(int,int);
    void delFloodFill(int,int);
    int Bresenham(int,int,int,int,char);

    void flow_right(int,int,int);
    void flow_left(int,int,int);
    void flow_up(int,int,int);
    void flow_down(int,int,int);
    void flow_Dright(int,int,int);
    void flow_Dleft(int,int,int);

    void flow_right27(int,int,int);
    void flow_left27(int,int,int);
    void flow_up27(int,int,int);
    void flow_down27(int,int,int);
    void flow_Dright27(int,int,int);
    void flow_Dleft27(int,int,int);
    void flow_D1right27(int,int,int);
    void flow_D1left27(int,int,int);
    void flow_D2right27(int,int,int);
    void flow_D2left27(int,int,int);

    void polynomial_regression();

    void skel_main(int);
    void outline();
    void peeling();
    void gethor();
    void getver();
    void write_skel(int);
    int link_break(int,int);
    int connectivity(int, int);
    void create_node();

    void spine_DT(int);
    void compute_DT(int **, int);
    void compute_DT1(int);
    void trace_back(int, int, int,int, int);

};

#endif // MAINWINDOW_H

extension: h


text:
/*
Copyright 2020 The pdfcpu 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 test

import (
	"path/filepath"
	"testing"

	"github.com/pdfcpu/pdfcpu/pkg/cli"
	"github.com/pdfcpu/pdfcpu/pkg/pdfcpu/model"
)

// Split a test PDF file up into single page PDFs (using a split span of 1).
func TestSplitCommand(t *testing.T) {
	msg := "TestSplitCommand"
	fileName := "Acroforms2.pdf"
	inFile := filepath.Join(inDir, fileName)
	span := 1

	// Skip validation to boost processing.
	conf := model.NewDefaultConfiguration()
	conf.ValidationMode = model.ValidationNone

	cmd := cli.SplitCommand(inFile, outDir, span, conf)
	if _, err := cli.Process(cmd); err != nil {
		t.Fatalf("%s span=%d %s: %v\n", msg, span, inFile, err)
	}
}

// Split a test PDF file up into PDFs with 2 pages each (using a split span of 2).
func TestSplitBySpanCommand(t *testing.T) {
	msg := "TestSplitBySpanCommand"
	fileName := "CenterOfWhy.pdf"
	inFile := filepath.Join(inDir, fileName)
	span := 2

	cmd := cli.SplitCommand(inFile, outDir, span, conf)
	if _, err := cli.Process(cmd); err != nil {
		t.Fatalf("%s span=%d %s: %v\n", msg, span, inFile, err)
	}
}

// Split a PDF along its defined bookmarks on level 1 or 2
func TestSplitByBookmarkCommand(t *testing.T) {
	msg := "TestSplitByBookmarkCommand"
	fileName := "5116.DCT_Filter.pdf"
	inFile := filepath.Join(inDir, fileName)
	span := 0 // This means we are going to split by bookmarks.

	cmd := cli.SplitCommand(inFile, outDir, span, conf)
	if _, err := cli.Process(cmd); err != nil {
		t.Fatalf("%s %s: %v\n", msg, inFile, err)
	}
}

repository: pdfcpu/pdfcpu

repo_name: pdfcpu/pdfcpu


text:
SUMMARY = "Xfce configuration daemon and utilities"
SECTION = "x11/wm"
LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552"
DEPENDS = "libxfce4util perl intltool-native xfce4-dev-tools-native"

inherit xfce gtk-doc gobject-introspection bash-completion vala

EXTRA_OECONF += "PERL=${STAGING_DIR_TARGET}/usr/bin/perl"

SRC_URI[sha256sum] = "2e8c50160bf800a807aea094fc9dad81f9f361f42db56607508ed5b4855d2906"

FILES:${PN} += "${libdir}/xfce4/xfconf/xfconfd \
                ${libdir}/gio/modules/libxfconfgsettingsbackend.so \
                ${datadir}/dbus-1/services/org.xfce.Xfconf.service"

FILES:${PN}-dev += "${libdir}/gio/modules/libxfconfgsettingsbackend.la"

PACKAGECONFIG[gsettings-backend] = "--enable-gsettings-backend,--disable-gsettings-backend,"


text:
/*
 * qubit.h
 *
 *  Created on: 30 Jan 2019
 *      Author: jobinrjohnson
 */

#ifndef IMPLEMENTATION_QUBIT_H_
#define IMPLEMENTATION_QUBIT_H_

#include <gsl/gsl_matrix.h>
#include <gsl/gsl_complex.h>
#include <gsl/gsl_complex_math.h>
#include <gsl/gsl_rng.h>
#include <iostream>

class Qubit
{

  protected:
	gsl_vector_complex *v_state;

  public:
	Qubit();
	Qubit(double, double, double, double);
	virtual ~Qubit();
	void print_state();
	gsl_vector_complex *get_state();
	bool set_state(gsl_vector_complex *);
};

#endif /* IMPLEMENTATION_QUBIT_H_ */

repository: sanooptp/QSim

repo_name: sanooptp/QSim


text:
% Experimental Economics

%% General

@book{kagel_handbook_2004,
    author = {Kagel, J.H.},
    publisher = {Princeton University Press},
    title = {The Handbook of Experimental Economics},
    year = {2004}
}

@book{bardsley_rethinking_2009,
    author = {Bardsley, N. and Cubitt, R. and Loomes, G. and Moffatt, P. and Starmer, C. and  Sugden, R.},
    title = {Experimental Economics: Rethinking the Rules},
    publisher = {Princeton University Press},
    address = {Princeton, NJ},
    year = 2009
}

@book{friedman_intensive_lab_2004,
  title = {Economics Lab: An Intensive Course in Experimental Economics},
  author = {Friedman, D. and Cassar, A.},
  year = 2004,
  publisher = {Routledge},
  location = {London and New York}
}

@book{friedman_primer_1994,
    author = {Friedman, D. and Sunder, S.},
    publisher = {Cambridge University Press},
    title = {{Experimental Methods: A Primer for Economists}},
    year = {1994}
}

@book{guala_exp_eco_2005,
  author={Guala, F.},
  title={The Methodology of Experimental Economics},
  publisher={Cambridge University Press},
  year=2005,
  number={9780521618618},
  series={Cambridge Books}
}

@book{camerer_strategic_2003,
  title={Behavioral Game Theory: Experiments in Strategic Interaction},
  author={Camerer, C.},
  year={2003},
  publisher={Princeton University Press},
  address={Princeton NJ}
}

% Sorting

@article{lazear_sorting_exp_2012,
  title={Sorting in Experiments with Application to Social Preferences},
  author={Lazear, E.P. and Malmendier, U. and Weber, R.A.},
  journal={American Economic Journal: Applied Economics},
  volume={4},
  number={1},
  pages={136--163},
  year={2012}
}

@article{dohmen_multid_sorting_2011,
  title={Performance Pay and Multidimensional Sorting: Productivity, Preferences, and Gender},
  author={Dohmen, T. and Falk, A.},
  journal={The American Economic Review},
  volume={101},
  number={2},
  pages={556--590},
  year={2011}
}

%% SVO

@article{murphy_svo_2011,
  title={Measuring Social Value Orientation},
  author={Murphy, R.O. and Ackermann, K. A and Handgraaf, M.},
  journal={Judgment and Decision Making},
  volume={6},
  pages={771--781},
  year={2011}
}

%% Social Preferences

@article{charness_simple_tests_2002,
  title={Understanding Social Preferences with Simple Tests},
  author={Charness, G. and Rabin, M.},
  journal={The Quarterly Journal of Economics},
  volume={117},
  number={3},
  pages={817--869},
  year={2002}
}

@misc{fisman_distinguishing_2005,
  title={Distinguishing Social Preferences from Preferences for Altruism},
  author={Fisman, R.J. and Kariv, S. and Markovits, D.},
  year={2005},
  journal={Available at SSRN 795006}
}

@article{burton_prosocial_pref_2013,
  title={Prosocial Preferences Do Not Explain Human Cooperation in Public-Goods Games},
  author={Burton-Chellew, M.N. and West, S.A.},
  journal={Proceedings of the National Academy of Sciences},
  volume={110},
  number={1},
  pages={216--221},
  year={2013}
}

%% Real-Effort vs Chosen Effort

@article{bruggen_real-chosen_2007,
  title={Real Effort Versus Chosen Effort in Experiments},
  author={Br{\"u}ggen, A. and Strobel, M.},
  journal={Economics Letters},
  volume={96},
  number={2},
  pages={232--236},
  year={2007}
}

%% Public Good, Welfare

@article{isaac_85,
  author={Isaac, M.R. and McCue, K.F. and Plott, C.R.},
  title={Public Goods Provision in an Experimental Environment},
  journal={Journal of Public Economics},
  year=1985,
  volume={26},
  pages={51--74}
}

@article{marwell_i_1979,
 author = {Marwell, G. and Ames, R.E.},
 journal = {American Journal of Sociology},
 number = {6},
 pages = {1335--1360},
 title = {Experiments on the Provision of Public Goods. I. Resources, Interest, Group Size, and the Free-Rider Problem},
 volume = {84},
 year = {1979}
}

@article{marwell_ii_1980,
 author = {Marwell, G. and Ames, R.E.},
 journal = {American Journal of Sociology},
 number = {4},
 pages = {926--937},
 title = {Experiments on the Provision of Public Goods. II. Provision Points, Stakes, Experience, and the Free-Rider Problem},
 volume = {85},
 year = {1980}
}

@article{Bohm_13,
  author={Bohm, R. and Rockenbach, B.},
  title={The Inter-Group Comparison -- Intra-Group Cooperation Hypothesis},
  journal={PLoS ONE},
  year=2013,
  volume={8},
  pages={56152}
}

@article{buckleyandcroson2006,
  author={Buckley, E. and Croson, R.},
  title={{Income and Wealth Heterogeneity in the Voluntary Provision of Linear Public Goods}},
  journal={Journal of Public Economics},
  year=2006,
  volume={90},
  number={4-5},
  pages={935--955}
}

@book{cowell_measuring_inequality_2011,
  title={Measuring Inequality},
  author={Cowell, F.},
  year={2011},
  publisher={Oxford University Press}
}

@article{Fischbacheretal2014,
  author={Fischbacher, U. and Schudy, S. and Teyssier, S.},
  title={{Heterogeneous Reactions to Heterogeneity in Returns From Public Goods}},
  journal={Social Choice and Welfare},
  year=2014,
  volume={43},
  number={1},
  pages={195--217}
}

@incollection{ledyard_public_goods_1995,
  author  = {Ledyard, J.O.},
  title   = {Public Goods: A Survey of Experimental Research},
  year    = {1995},
  pages   = {111--194},
  editor  = {J. H. Kagel and A. E. Roth},
  address = {Princeton, NJ},
  publisher = {Princeton University Press},
  booktitle = {The Handbook of Experimental Economics}
}

@article{hardin_g_s68,
  author  = {Hardin, H.},
  title   = {The Tragedy of the Commons},
  journal = {Science},
  year    = {1968},
  volume  = {162},
  pages   = {1243--1248}
}

@article{fehr_aer00,
  author  = {Fehr, E. and {G\"a}chter, S.},
  title   = {Cooperation and Punishment in Public Goods Experiments},
  journal = {American Economic Review},
  year    = {2000},
  volume  = {90},
  pages   = {980--994}
}

@article{fehr_altruistic_2002,
  author = {Fehr, E. and G{\"a}chter, S.},
  journal = {Nature},
  pages = {137-140},
  title = {Altruistic Punishment in Humans},
  volume = {415},
  year = {2002}
}

@article{weng_id_punish_endowment_2015,
  title={Cooperation in Teams: The Role of Identity, Punishment, and Endowment Distribution},
  author={Weng, Q. and Carlsson, F.},
  journal={Journal of Public Economics},
  volume={126},
  pages={25--38},
  year={2015}
}

@book{harsanyi_88,
  author  = {Harsanyi, J.C. and Selten, R.},
  title   = {A General Theory of Equilibrium Selection in Games},
  year    = {1988},
  address = {Cambridge, MA},
  publisher = {MIT Press},
}

@article{harsanyi_review_1987,
  author={Harsanyi, J.C.},
  title={{Morals by Agreement, David Gauthier, Oxford: Clarendon Press, 1986, 297 pages}},
  journal={Economics and Philosophy},
  year=1987,
  volume={3},
  number={02},
  pages={339--351},
  note = {Book Review}
}

@book{gauthier_morals_1986,
  title={Morals by Agreement},
  author={Gauthier, D.P.},
  year={1986},
  address={New York},
  publisher={Oxford University Press}
}

@article{chaudhuri_11,
  title={Sustaining Cooperation in Laboratory Public Goods Experiments: a Selective Survey of the Literature},
  author={Chaudhuri, A.},
  journal={Experimental Economics},
  volume={14},
  pages={47--83},
  year={2011}
}

@book{ostrom_90,
  author  = {E. Ostrom},
  title   = {Governing the Commons: The Evolution of Institutions for Collective Action},
  year    = {1990},
  address = {Cambridge, U.K.},
  publisher = {Cambridge University Press},
}

@article{ostrom_arps99,
  author  = {Ostrom, E.},
  title   = {Coping with Tragedies of the Commons},
  journal = {Annual Review Political Science},
  year    = {1999},
  volume  = {2},
  pages   = {493--535},
}

@article{nash_am51,
  author  = {Nash, J.},
  title   = {Non-Cooperative Games},
  journal = {Annals of Mathematics},
  year    = {1951},
  volume  = {54},
  pages   = {286--295},
}

@book{mises_22,
  author  = {von Mises, L.},
  title   = {Die Gemeinwirtschaft: Untersuchungen {\"u}ber den Sozialismus},
  year    = 1922,
  address = {Jena, Germany},
  publisher = {Gustav Fischer Verlag},
}

@inbook{hayek_35,
  author  = {von Hayek, F.A.},
  editor  = {von Hayek, F.A.},
  chapter = {The Nature and History of the Problem},
  title   = {Collectivist Economic Planning},
  year    = {1935},
  pages   = {1--40},
}

@book{okun_75,
  author  = {Okun, A.M.},
  title   = {The Big Tradeoff},
  year    = {1975},
  address = {Washington D.C.},
  publisher = {Brookings Institution Press},
}

@article{Gun10,
  author="Gunnthorsdottir, A. and Vragov, R. and Seifert, S. and McCabe, K.",
  title="Near-Efficient Equilibria in Contribution-Based Competitive Grouping",
  journal="Journal of Public Economics",
  volume={94},
  number={11},
  pages={987--994},
  year={2010}
}

@techreport{KingandRebelo1990,
  author={King, R.G. and Rebelo, S.},
  title={{Public Policy and Economic Growth: Developing Neoclassical Implications}},
  year={1990},
  institution={National Bureau of Economic Research}
}

@article{Rebelo1991,
  author={Rebelo, S.},
  title={{Long-Run Policy Analysis and Long-Run Growth}},
  journal={Journal of Political Economy},
  year=1991,
  volume={99},
  number={3},
  pages={500--521}
}

@misc{nax_14,
  author = "Nax, H.H. and Murphy, R.O. and Helbing, D.",
  title  = "Stability and Welfare of `Merit-Based' Group-Matching Mechanisms in Voluntary Contribution Games",
  year   = 2014,
  note   = "Submitted"
}

@article{nax_merit_2017,
  author = {Nax, H.H. and Balietti, S. and Murphy, R.O. and Helbing, D.},
  title  = {Adding Noise to the Institution: An Experimental Welfare
                  Investigation of the Contribution-Based Grouping
                  Mechanism},
  year   = 2017,
  journal = {Social Choice and Welfare},
  note   = {(forthcoming)}
}

@article{Gun10a,
  author="Gunnthorsdottir, A. and Thorsteinsson, P.",
  title="Tacit Coordination and Equilibrium Selection in a Merit-Based Grouping Mechanism: A Cross-Cultural Validation Study",
  journal={Available at SSRN 1883465},
  year=2011
}

@article{Gun10b,
  author="Gunnthorsdottir, A. and Vragov, R. and Shen, J.",
  title={Tacit Coordination in Contribution-Based Grouping with Two Endowment Levels},
  journal={Research in Experimental Economics},
  volume={13},
  pages={13--75},
  year={2010}
}

@book{young_58,
  author = {Young, M.},
  title = {The Rise of the Meritocracy, 1870-2033: An Essay on Education and Equality},
  publisher={Transaction Publishers},
  year={1958}
}

@article{Erev_08,
  author = {Erev, I. and Ert, E. and Yechiam, E.},
  title = {Loss Aversion, Diminishing Sensitivity, and the Effect of Experience on Repeated Decisions},
  journal = {Journal of Behavioral Decision Making},
  volume = {21},
  number = {5},
  pages = {575--597},
  keywords = {myopic loss aversion, prospect theory, learning, reflection effect, explorative sampler},
  year = {2008},
}

@article{Tamai2010,
  author={Tamai, T.},
  title={{Public Goods Provision, Redistributive Taxation, and Wealth Accumulation}},
  journal={Journal of Public Economics},
  year=2010,
  volume={94},
  number={11-12},
  pages={1067--1072}
}

@article{Rab14,
  author="Rabanal, J.P. and Rabanal, O.A.",
  title="Efficient Investment via Assortative Matching: a Laboratory Experiment",
  journal={Available at SSRN 2565196},
  year={2015}
}

@book{Raw71,
  author="Rawls, J.",
  title="A Theory of Justice",
  publisher="Belknap Press",
  year=1971
}

@book{Ben1776,
  author="Bentham, J.",
  title="An Introduction to the Principles of Morals and Legislation",
  publisher="Clarendon Press",
  year=1907
}

@article{Atk70,
  author="Atkinson, A.B.",
  title="On the Measurement of Inequality",
  journal="Journal of Economic Theory",
  volume=2,
  number="3",
  pages={244--263},
  year=1970
}

@book{Arrow_00,
  author="Arrow, K. and Bowles, S. and Durlauf, S.",
  title="Meritocracy and Economic Inequality",
  publisher="Princeton University Press",
  year=2000
}

@article{fehr_qje99,
  author  = {Fehr, E. and Schmidt, K.M.},
  title   = {A Theory of Fairness, Competition, and Cooperation},
  journal = {Quarterly Journal of Economics},
  year    = {1999},
  volume  = {114},
  pages   = {817--868},
}

@book{feldman_1980,
  author  = {A. Feldman},
  title   = {Welfare Economics and Social Choice Theory},
  year    = {1980},
  address = {Boston, USA},
  publisher = {Martinus Nijhoff Publishing},
}

@article{Atkinson_2012,
  author={A. B. Atkinson},
  title={{Public Economics after the Idea of Justice}},
  journal={Journal of Human Development and Capabilities},
  year=2012,
  volume={13},
  number={4},
  pages={521--536}
}

@article{Bre11,
  author="Brekke, K. and Hauge, K. and Lind, J.T. and Nyborg, K.",
  title="Playing with the Good Guys. A Public Good Game with Endogenous Group Formation",
  journal="Journal of Public Economics",
  volume=95,
  number="9",
  pages="1111--1118",
  year="2011"
}

@inbook{Adams_65,
  author="Adams, J.S.",
  chapter="Inequity in Social Exchange",
  title="Advances in Experimental Social Psychology",
  editor = {Berkowitz, L.},
  publisher={Academic Press},
  address={New York},
  volume={2},
  pages={267--299},
  year={1965}
}

@article{greenberg_87,
  title={A Taxonomy of Organizational Justice Theories},
  author={Greenberg, J.},
  journal={Academy of Management review},
  volume={12},
  number={1},
  pages={9--22},
  year={1987}
}

@book{Samuelson_1947,
  author  = {Samuelson, P.A.},
  title   = {Foundations of Economic Analysis},
  year    = {1980},
  address = {Cambridge, USA},
  publisher = {Harvard University Press},
}

@book{arrow_1951,
  author  = {Arrow, K.J.},
  title   = {Social Choice and Individual Values},
  year    = {1951},
  address = {Yale, USA},
  publisher = {Yale University Press},
}

@article{Sen_1970,
  author={Sen, A.},
  title={{The Impossibility of a Paretian Liberal}},
  journal={Journal of Political Economy},
  year=1970,
  volume={78},
  number={1},
  pages={152--57}
}

@article{bolton_00,
  author={Bolton, G.E. and Ockenfels, A.},
  title={{ERC: A Theory of Equity, Reciprocity, and Competition}},
  journal={American Economic Review},
  year={2000},
  volume={90},
  number={1},
  pages={166--193}
}

@article{nash_pnas50,
  author  = {Nash, J.},
  title   = {Equilibrium Points in N-Person Games},
  journal = {Proceedings of the National Academy of Sciences (PNAS)},
  year    = {1950},
  volume  = {36},
  pages   = {48--49},
}

@article{Cor04,
  author="Coricelli, G. and Fehr, D. and Fellner, G.",
  title="Partner Selection in Public Goods Experiments",
  journal="Economics Series",
  volume={48},
  number={3},
  pages={356--378},
  year="2004"
}

@article{andreoni_why_free_ride_1988,
  author={Andreoni, J.},
  title={Why Free Ride? Strategies and Learning in Public Goods Experiments},
  journal={Journal of Public Economics},
  volume={37},
  number={3},
  pages={291--304},
  year={1988}
}

@article{charness_voting_public_goods_2014,
  title={Starting Small Toward Voluntary Formation of Efficient Large Groups in Public Goods Provision},
  author={Charness, G.B. and Yang, C.-L.},
  journal={Journal of Economic Behavior \& Organization},
  volume={102},
  pages={119--132},
  year={2014}
}

@article{Cin05,
  author="Cinyabuguma, M. and Page, T. and Putterman, L.",
  title="Cooperation Under the Threat of Expulsion in a Public Goods Experiment",
  journal="Journal of Public Economics",
  volume=89,
  number="8",
  pages="1421--1435",
  year="2005"
}

@techreport{Ehr99,
  author= {Ehrhart, K. and Keser, C.},
  title={Mobility and Cooperation: On the Run},
  institution={Cirano},
  volume={99},
  number={s-24},
  year={1999}
}

@article{Ahn08,
  author="Ahn, T. and Isaac, R.M. and Salmon, T.C.",
  title="Endogenous Group Formation",
  journal="Journal of Public Economic Theory",
  volume= 10,
  number="2",
  pages="171--194",
  year="2008"
}

@article{Sam14,
  author={Samek, S. and Sheremeta, R.},
  title={Recognizing Contributors: an Experiment on Public Goods},
  journal={Experimental Economics},
  volume={17},
  number={4},
  pages={673--690},
  year={2014}
}

@article{Bre07,
  author="Brekke, K. and Nyborg, K. and Rege, M.",
  title="The Fear of Exclusion: Individual Effort when Group Formation is Endogenous",
  journal="Scandinavian Journal of Economics",
  volume=109,
  number="3",
  pages="531--550",
  year="2007"
}

@article{Pag05,
  author="Page, T. and Putterman, L. and Unel, B.",
  title="Voluntary Association in Public Goods Experiments: Reciprocity, Mimicry and Efficiency",
  journal="The Economic Journal",
  volume={115},
  number="506",
  pages="1032--1053",
  year="2005"
}

@article{erev_igc_field_1993,
  title={Constructive Intergroup Competition as a Solution to the Free Rider Problem: A Field Experiment},
  author={Erev, I. and Bornstein, G. and Galili, R.},
  journal={Journal of Experimental Social Psychology},
  volume={29},
  number={6},
  pages={463--478},
  year={1993}
}

@article{bornstein_igc_enhancing_1994,
  title={The Enhancing Effect of Intergroup Competition on Group Performance},
  author={Bornstein, G. and Erev, I.},
  journal={International Journal of Conflict Management},
  volume={5},
  number={3},
  pages={271--283},
  year={1994}
}

@article{bornstein_igc_social_dilemmas_1990,
  title={Intergroup Competition as a Structural Solution to Social Dilemmas},
  author={Bornstein, G. and Erev, I. and Rosen, O.},
  journal={Social Behaviour},
  pages={247--260},
  volume={5},
  year={1990}
}

@article{bornstein_igc_coordination_2002,
  title={The Effect of Intergroup Competition on Group Coordination: An Experimental Study},
  author={Bornstein, G. and Gneezy, U. and Nagel, R.},
  journal={Games and Economic Behavior},
  volume={41},
  number={1},
  pages={1--25},
  year={2002}
}

% Group Size

@article{isaac_group_size_1994,
  title={Group Size and the Voluntary Provision of Public Goods: Experimental Evidence Utilizing Large Groups},
  author={Isaac, R.M. and Walker, J.M. and Williams, A.W.},
  journal={Journal of Public Economics},
  volume={54},
  number={1},
  pages={1--36},
  year={1994}
}

@article{nosenzo_coop_small_groups_2013,
  title={Cooperation in Small Groups: the Effect of Group Size},
  author={Nosenzo, D. and Quercia, S. and Sefton, M.},
  journal={Experimental Economics},
  volume = {18},
  issue = {1},
  pages={4--14},
  year={2013}
}

@article{henrich_tasmania_2004,
  title={Demography and Cultural Evolution: How Adaptive Cultural Processes Can Produce Maladaptive Losses: the Tasmanian Case},
  author={Henrich, J.},
  journal={American Antiquity},
  pages={197--214},
  year={2004}
}

@article{derex_group-size_cultural_2013,
  title={Experimental Evidence for the Influence of Group Size on Cultural Complexity},
  author={Derex, M. and Beugin, M.-P. and Godelle, B. and Raymond, M.},
  journal={Nature},
  volume={503},
  number={7476},
  pages={389--391},
  year={2013}
}

@article{andersson_derex_comment_2014,
  title={Group Size and Cultural Complexity},
  author={Andersson, C. and Read, D.},
  journal={Nature},
  volume={511},
  number={7507},
  pages={E1},
  year={2014},
  doi={doi:10.1038/nature13411}
}

@article{derex_derex_reply_2014,
  title={Derex et al. Reply},
  author={Derex, M. and Beugin, M.-P. and Godelle, B. and Raymond, M.},
  journal={Nature},
  volume={511},
  number={7507},
  pages={E2},
  year={2014},
  doi={doi:10.1038/nature13412}
}

@misc{duca_inequality_2016,
  author = {Duca, S. and Nax, H.H.},
  title = {Assortative Matching with Inequality in Voluntary Contribution Games},
  year = {2016},
  note = {mimeo}
}

%% Paid vs Volunteering

@article{ashraf_nomargin_zambia_2014,
  title={No Margin, no Mission? A Field Experiment on Incentives for Public Service Delivery},
  author={Ashraf, N. and Bandiera, O. and Jack, B.K.},
  journal={Journal of Public Economics},
  volume={120},
  pages={1--17},
  year={2014}
}

@misc{dube_cause_marketing_2015,
  title={Self-Signalling and Prosocial Behavior: A Cause Marketing Mobile Field Experiment},
  author={Dube, J.P. and Luo, X. and Fang, Z.},
  note = {NBER working paper 21475},
  year={2015}
}

@article{gneezy_pay_enough_2000,
  title={Pay Enough or Don't Pay at All},
  author={Gneezy, U. and Rustichini, A.},
  journal={Quarterly Journal of Economics},
  pages={791--810},
  volume={115},
  number={3},
  year={2000}
}

@inproceedings{mao_volunteering_vs_paid_2013,
  title={Volunteering vs. Work for Pay: Incentives and Tradeoffs in Crowdsourcing},
  author={Mao, A. and Kamar, E. and Chen, Y. and Horvitz, E. and Schwamb, M. E and Lintott, C.J. and Smith, A.M.},
  booktitle={HCOMP Conference on Human Computation},
  year={2013}
}

@inproceedings{mao_engagement_crowdsourcing_2013,
  title={Why Stop Now? Predicting Worker Engagement in Online Crowdsourcing},
  author={Mao, A. and Kamar, E. and Horvitz, E.},
  booktitle={First AAAI Conference on Human Computation and Crowdsourcing},
  year={2013}
}

@article{ciampaglia_power_2014,
    author = {Ciampaglia, G.L. and Lozano, S. and Helbing, D.},
    journal = {PLoS ONE},
    title = {Power and Fairness in a Generalized Ultimatum Game},
    year = {2014},
    month = {06},
    volume = {9},
    pages = {e99039},
    number = {6}
}

@article{gneezy_fine_price_2000,
  title={A Fine Is a Price},
  author={Gneezy, U. and Rustichini, A.},
  journal={Journal of Legal Studies},
  volume={29},
  number={1},
  pages={1--17},
  year={2000}
}

% Time

@article{noussair_time_reward_2015,
  year={2015},
  journal={Experimental Economics},
  volume={18},
  number={3},
  title={Time as a Medium of Reward in Three Social Preference Experiments},
  author={Noussair, C. N. and Stoop, J.},
  pages={442--456}
}

@article{goldhammer_time_skill_2014,
  title={The Time on Task Effect in Reading and Problem Solving is Moderated by Task Difficulty and Skill: Insights from a Computer-Based Large-Scale Assessment},
  author={Goldhammer, F. and Naumann, J. and Stelter, A. and T{\'o}th, K. and R{\"o}lke, H. and Klieme, E.},
  journal={Journal of Educational Psychology},
  volume={106},
  number={3},
  pages={608--626},
  year={2014}
}

%% Large scale

@article{grujic_mesoscale_2010,
  title={Social Experiments in the Mesoscale: Humans Playing a Spatial Prisoner's Dilemma},
  author={Gruji{\'c}, J. and Fosco, C. and Araujo, Lourdes and Cuesta, Jos{\'e} A and S{\'a}nchez, Angel and others},
  journal={PloS ONE},
  volume={5},
  number={11},
  pages={e13749--e13749},
  year={2010},
  publisher={Public Library of Science}
}

% in preparation

@misc{balietti_congestion_2016,
  title = {Efficiency Gains in Coordination in Information-Poor Environments},
  author = {Balietti, S. and J\"{a}ggi, B. and Axhausen, K.},
  note = {Available at SSRN 2802049},
  year = {2016}
}

% Market Entry Games

@article{camerer_1999,
    author = {Camerer, C. and Lovallo, D.},
    journal = {The American Economic Review},
    keywords = {entry-barriers},
    number = {1},
    title = {Overconfidence and Excess Entry: An Experimental Approach},
    volume = {89},
    year = {1999}
}

% Real-time

@article{simon_real-time_1989,
  title={Extensive Form Games in Continuous Time: Pure Strategies},
  author={Simon, L.K. and Stinchcombe, M.B.},
  journal={Econometrica: Journal of the Econometric Society},
  pages={1171--1214},
  year={1989}
}

@article{friedman_continuous_dilemma_2012,
  title={A Continuous Dilemma},
  author={Friedman, D. and Oprea, R.},
  journal={The American Economic Review},
  pages={337--363},
  year={2012}
}

@misc{moussaid_3D_escape_2015,
  title = {Crowd Dynamics and Emergency Escape in Immersive Virtual Environments},
  author = {Moussa\"{i}d, M. and Kapadia, M. and Thrash, T. and
                  Sumner, R. W. and Gross, M. and Helbing, D. and
                  H\"{o}lscher, C.},
  year = {2015},
  note = {In preparation}
}

@phdthesis{mao_phd_2015,
  title = {Experimental Studies of Human Behavior in Social Computing
                  Systems},
  school   = {Harvard},
  author   = {Mao, Q.},
  year     = {2015}
}

% Risk

@article{holt_risk_aversion_2002,
  title={Risk Aversion and Incentive Effects},
  author={Holt, C.A. and Laury, S.},
  journal={American Economic Review},
  volume={92},
  number={5},
  pages={1644--1655},
  year={2002}
}

@article{Kahneman_79,
  author={Kahneman, D. and Tversky, A.},
  title={{Prospect Theory: An Analysis of Decision under Risk}},
  journal={Econometrica},
  year=1979,
  volume={47},
  number={2},
  pages={263--291}
}

@article{Kahneman_91,
  author={Tversky, A. and Kahneman, D. },
  title={{Loss Aversion in Riskless Choice: A Reference Dependent Model}},
  journal={Quarterly Journal of Economics},
  year=1991,
  volume={106},
  number={4},
  pages={1039--1061}
}

@article{crosetto_4_risks_2015,
  title={A Theoretical and Experimental Appraisal of Four Risk Elicitation Methods},
  author={Crosetto, P. and Filippin, A.},
  journal={Experimental Economics},
  pages={1--29},
  year={2015}
}

% Field

@article{al-ubaydli_field_markets_2016,
  title={Field Experiments in Markets},
  author={Al-Ubaydli, O. and List, J.A.},
  year={2016},
  journal={National Bureau of Economic Research (NBER)},
  note={Working paper 22113}
}

@misc{algan_wiki_exp_2013,
  title={Cooperation in a Peer Production Economy Experimental Evidence from Wikipedia},
  author={Algan, Y. and Benkler, Y. and Morell, M.F. and Hergueux, J.},
  note={unpublished},
  year={2013}
}

@article{andreoni_polio_2016,
  title={Using Preference Estimates to Customize Incentives: An Application to Polio Vaccination Drives in Pakistan},
  author={Andreoni, J. and Callen, M. and Khan, Y. and Jaffar, K. and Sprenger, C.},
  year={2016},
  journal={National Bureau of Economic Research (NBER)},
  note={Working paper 22019}
}

@article{cappelli_high-performance_2001,
  title={Do "High-Performance" Work Practices Improve Establishment-Level Outcomes?},
  author={Cappelli, P. and Neumark, D.},
  journal={ILR Review},
  volume={54},
  number={4},
  pages={737--775},
  year={2001}
}

%% Voting / Endogenous things.

@article{smith_investing_vcm_2017,
  title={Investing in institutions for cooperation},
  author={Smith, A. and Wen, X.},
  journal={Journal of the Economic Science Association},
  pages={75--87},
  year={2017},
  volume={3}
}

@article{mellizo_ceding_control_2017,
  title={Ceding Control: An Experimental Analysis of Participatory Management},
  author={Mellizo, P. and Carpenter, J. and Matthews, P.H.},
  journal={Journal of the Economic Science Association},
  pages={62--74},
  year={2017},
  volume={3}
}

@article{dal-bo_effects_democracy_2010,
  title={Institutions and Behavior: Experimental Evidence on the Effects of Democracy},
  author={Dal Bo, P. and Foster, A. and Putterman, L.},
  journal={The American Economic Review},
  volume={100},
  number={5},
  pages={2205--2229},
  year={2010}
}

@article{mellizo_workplace_democracy_2014,
  title={Workplace Democracy in the Lab},
  author={Mellizo, P. and Carpenter, J. and Matthews, P.H.},
  journal={Industrial Relations Journal},
  volume={45},
  number={4},
  pages={313--328},
  year={2014}
}

% Delegation

@article{falk_hidden_costs_control_2006,
  title={The Hidden Costs of Control},
  author={Falk, A. and Kosfeld, M.},
  journal={The American Economic Review},
  volume={96},
  number={5},
  pages={1611--1630},
  year={2006}
}

@article{charness_advantage_delegation_2012,
  title={The Hidden Advantage of Delegation: Pareto Improvements in a Gift Exchange Game},
  author={Charness, G. and Cobo-Reyes, R. and Jim{\'e}nez, N. and Lacomba, J. A and Lagos, F.},
  journal={The American Economic Review},
  volume={102},
  number={5},
  pages={2358--2379},
  year={2012}
}

%% Payment.

@article{jamal_money_gaming_1991,
  title={Money vs Gaming: Effects of Salient Monetary Payments in Double Oral Auctions},
  author={Jamal, K. and Sunder, S.},
  journal={Organizational Behavior and Human Decision Processes},
  volume={49},
  number={1},
  pages={151--166},
  year={1991}
}

@article{hertwig_econ_vs_psych_2001,
  title={Experimental Practices in Economics: A Methodological Challenge for Psychologists?},
  author={Hertwig, R. and Ortmann, A.},
  journal={Behavioral and Brain Sciences},
  volume={24},
  number={3},
  pages={383--403},
  year={2001}
}

@article{kachelmeier_fail_replicate_2005,
  title={The Limitations of Experimental Design: A Case Study Involving Monetary Incentive Effects in Laboratory Markets},
  author={Kachelmeier, S.J. and Towry, K.L.},
  journal={Experimental Economics},
  volume={8},
  number={1},
  pages={21--33},
  year={2005}
}

%% TODO: classify

@article{Aoy09,
  author = {Aoyagi, M. and Fr\'{e}chette, G.},
  title = {Collusion as Public Monitoring Becomes Noisy: Experimental Evidence},
  journal = {Journal of Economic Theory},
  volume = {144},
  number = {3},
  pages = {1135--1165},
  year = {2009},
  keywords = {Collusion,Cooperation,Imperfect public monitoring,Repeated games}
}

@article{Amb12,
  author = {Ambrus, Attila and Greiner, Ben},
  title = {Imperfect Public Monitoring with Costly Punishment: An Experimental Study},
  journal = {The American Economic Review},
  volume = {102},
  number = {7},
  year = {2012},
  pages = {3317--3332}
}

@article{Abr90,
  author = {Abreu, D. and Pearce, D. and Stacchetti, E.},
  journal = {Econometrica},
  number = {5},
  pages = {1041--1063},
  title = {Toward a Theory of Discounted Repeated Games with Imperfect Monitoring},
  volume = {58},
  year = {1990}
}

@article{Fud94,
  author = {Fudenberg, D. and Levine, D. and Maskin, E.},
  journal = {Econometrica},
  number = {5},
  pages = {997--1039},
  title = {The Folk Theorem with Imperfect Public Information},
  volume = {62},
  year = {1994}
}

@article{Gre84,
  author = {Green, E.J. and Porter, R.H.},
  journal = {Econometrica},
  number = {1},
  pages = {87--100},
  title = {Noncooperative Collusion under Imperfect Price Information},
  volume = {52},
  year = {1984}
}

@article{Lev03,
  author = {Levin, J.},
  journal = {The American Economic Review},
  number = {3},
  pages = {835--857},
  title = {Relational Incentive Contracts},
  volume = {93},
  year = {2003}
}

@article{Wu95,
  author = {Wu, J. and Axelrod, R.},
  title = {How to Cope with Noise in the Iterated Prisoner's Dilemma},
  journal = {Journal of Conflict Resolution},
  volume = {39},
  number = {1},
  pages = {183--189},
  year = {1995}
}

@article{Alc72,
  author = {Alchian, A.A. and Demsetz, H.},
  journal = {The American Economic Review},
  number = {5},
  pages = {777--795},
  publisher = {American Economic Association},
  title = {Production, Information Costs, and Economic Organization},
  volume = {62},
  year = {1972}
}

@article{benndorf_experienced_participants_2017,
  title={Experienced Vs. Inexperienced Participants in the Lab: Do They Behave Differently?},
  author={Benndorf, V. and Moellers, C. and Normann, H.-T.},
  journal={Journal of the Economic Science Association},
  pages={12--25},
  volume={3},
  issue={1},
  year={2017}
}

% Something on tournaments too.
@article{palan_bubbles_experimental_markets_2013,
  title={A Review of Bubbles and Crashes in Experimental Asset Markets},
  author={Palan, S.},
  journal={Journal of Economic Surveys},
  volume={27},
  number={3},
  pages={570--588},
  year={2013}
}

@article{leibbrandt_communication_integroup_conflict_2012,
  title={Communication in Intergroup Conflicts},
  author={Leibbrandt, A. and S{\"a}{\"a}ksvuori, L.},
  journal={European Economic Review},
  volume={56},
  number={6},
  pages={1136--1147},
  year={2012}
}

% Change behavior

@article{hoxby_targeted_college_2015,
  title={What High-Achieving Low-Income Students Know About College},
  author={Hoxby, C.M. and Turner, S.},
  journal={American Economic Review},
  volume={105},
  number={5},
  pages={514--17},
  year={2015}
}

repository: shakty/socialbib

repo_name: shakty/socialbib

extension: bib


text:
DESCRIPTION = "GNU's free implementation of the JavaMail API specification"
AUTHOR = "GNU ClasspathX"
LICENSE = "GPL-2.0-with-GCC-exception"
PR = "r1"
LIC_FILES_CHKSUM = "file://COPYING;md5=14bc6ee8b2e2b409be599212867d126e"

SRC_URI = "http://ftp.gnu.org/gnu/classpathx/mail-${PV}.tar.gz \
           file://datadir_java.patch \
           file://fix_makefile_race_condition.patch \
          "

inherit java-library autotools

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

DEPENDS += "gnujaf inetlib"

export JAVAC = "${STAGING_BINDIR_NATIVE}/javac"
export JAVA = "${STAGING_BINDIR_NATIVE}/java"

# Fake javadoc
export JAVADOC = "true"

EXTRA_OECONF = " \
                --with-inetlib-jar=${STAGING_DATADIR_JAVA} \
                --with-activation-jar=${STAGING_DATADIR_JAVA} \
               "

do_compile() {
  oe_runmake \
    JARDIR=${datadir_java} \
    gnumail_jar=${JARFILENAME} \
    providers_jar=${P}-providers.jar
}

SRC_URI[md5sum] = "0a94ff4328ceb6a4131be96946976a33"
SRC_URI[sha256sum] = "5eb09597a8f81bfc943206e3e0f45b963ba605a646051c353374f1b475bb9f04"

BBCLASSEXTEND = "native"

repository: ni/meta-java

repo_name: ni/meta-java

branch_name: refs/heads/nilrt/master/sumo


text:
file(REMOVE_RECURSE
  "CMakeFiles/none_shell_valgrind"
)

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

repository: jasonisnotmyrealname/Firmware

repo_name: jasonisnotmyrealname/Firmware


text:
require wpebackend-fdo.inc

# https://github.com/Igalia/WPEBackend-fdo/pull/19

# This version of WPEBackend-fdo is not selected by default on this layer,
# as the released versions is preferred.
# To select it, add on your local.conf conf file the line below:
#
# PREFERRED_VERSION_wpebackend-fdo = "0.1~git%"

SRCREV = "da746af2dff6b972c5c4903a132edcafdb768926"
SRC_URI = "git://github.com/Igalia/WPEBackend-fdo.git;protocol=https;branch=master"

S = "${WORKDIR}/git"

DEPENDS += " wpebackend"

repository: cadubentzen/meta-webkit

repo_name: cadubentzen/meta-webkit


text:
DESCRIPTION = "Tools to provide a way to get Platform Reliability, Availability and Serviceability (RAS) reports made via the Kernel tracing events"
HOMEPAGE = "http://git.infradead.org/users/mchehab/rasdaemon.git"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=d3070efe0afa3dc41608bd82c00bb0dc"

SRC_URI = "git://github.com/mchehab/rasdaemon.git;branch=master;protocol=https \
           file://rasdaemon.service \
           file://init"

SRCREV = "4e83b848e7961af25028f3a2cecf37a63279a2bf"

S = "${WORKDIR}/git"

DEPENDS = "libtraceevent"
RDEPENDS:${BPN} = "perl perl-module-file-basename perl-module-file-find perl-module-file-spec perl-module-getopt-long \
	perl-module-posix perl-module-file-glob libdbi-perl libdbd-sqlite-perl"

inherit autotools pkgconfig update-rc.d systemd

PACKAGECONFIG ??= "sqlite3 mce aer extlog devlink diskerror"
PACKAGECONFIG[sqlite3] = "--enable-sqlite3,--disable-sqlite3,sqlite3"
PACKAGECONFIG[mce] = "--enable-mce,--disable-mce"
PACKAGECONFIG[aer] = "--enable-aer,--disable-aer"
PACKAGECONFIG[extlog] = "--enable-extlog,--disable-extlog"
PACKAGECONFIG[devlink] = "--enable-devlink,--disable-devlink"
PACKAGECONFIG[diskerror] = "--enable-diskerror,--disable-diskerror"
PACKAGECONFIG[arm] = "--enable-arm,--disable-arm"
PACKAGECONFIG[hisi-ns-decode] = "--enable-hisi-ns-decode,--disable-hisi-ns-decode"
PACKAGECONFIG[non-standard] = "--enable-non-standard,--disable-non-standard"
PACKAGECONFIG[abrt-report] = "--enable-abrt-report,--disable-abrt-report"

DEPENDS:append:libc-musl = " argp-standalone"
LDFLAGS:append:libc-musl = " -largp"

do_install:append() {
	install -d ${D}${sysconfdir}/init.d
	install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/rasdaemon
	install -d ${D}${systemd_unitdir}/system
	install -m 0644 ${WORKDIR}/rasdaemon.service ${D}${systemd_unitdir}/system
}

FILES:${PN} += "${sbindir}/rasdaemon \
		${sysconfdir}/init.d \
		${systemd_unitdir}/system/rasdaemon.service"

SYSTEMD_SERVICE:${PN} = "rasdaemon.service"
SYSTEMD_AUTO_ENABLE = "enable"

INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_NAME:${PN} = "rasdaemon"
INITSCRIPT_PARAMS:${PN} = "defaults 89"


text:
//go:build integration
// +build integration

package vaulttransit

import (
	"fmt"
	"github.com/libopenstorage/secrets/vaulttransit/client/transit"
	"os"
	"testing"

	"github.com/hashicorp/vault/api"
	"github.com/libopenstorage/secrets"
	"github.com/libopenstorage/secrets/test"
	"github.com/pborman/uuid"
	"github.com/portworx/kvdb"
	"github.com/portworx/kvdb/mem"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
)

const (
	testSecretIdWithPassphrase = "openstorage_secret_with_passphrase"
	testSecretId               = "openstorage_secret"
	testSecretIdWithPublic     = "openstorage_secret_with_public"
)

func setupVaultClient() (*api.Client, error) {
	client, err := api.NewClient(api.DefaultConfig())
	if err != nil {
		return nil, err
	}
	token := os.Getenv("VAULT_TOKEN")
	if token == "" {
		return nil, fmt.Errorf("VAULT_TOKEN should be provided")
	}
	client.SetToken(token)
	return client, nil
}

func setupVaultTransitSecrets() (secrets.Secrets, error) {
	secretConfig := make(map[string]interface{})

	// With kvdbPersistenceStore
	kv, err := kvdb.New(mem.Name, "openstorage/", nil, nil, nil)
	if err != nil {
		return nil, fmt.Errorf("Unable to create a Vault Transit Secret instance: %v", err)
	}
	secretConfig[TransitKvdbKey] = kv
	kp, err := New(secretConfig)
	if err != nil {
		return nil, fmt.Errorf("Unable to create a Vault Transit Secret instance: %v", err)
	}

	return kp, nil
}

func TestAll(t *testing.T) {
	vs, err := setupVaultTransitSecrets()
	if err != nil {
		t.Fatal(err)
		return
	}
	vt := &vaultTransitSecretTest{
		s:          vs,
		passphrase: "",
		totalPuts:  0,
	}
	test.Run(vt, t)

}

type vaultTransitSecretTest struct {
	s           secrets.Secrets
	vaultClient *api.Client
	passphrase  string
	totalPuts   int
}

func (v *vaultTransitSecretTest) TestPutSecret(t *testing.T) error {
	secretData := make(map[string]interface{})
	v.passphrase = uuid.New()
	secretData[testSecretIdWithPassphrase] = v.passphrase

	// PutSecret with non-nil secretData and no key context
	_, err := v.s.PutSecret(testSecretIdWithPassphrase, secretData, nil)
	assert.Error(t, err, "Expected error on PutSecret")
	errInvalidContext, ok := err.(*secrets.ErrInvalidKeyContext)
	assert.True(t, ok, "Unexpected error on PutSecret")
	assert.Contains(t, errInvalidContext.Error(), "when none of", "Unexpected error on PutSecret")

	keyContext := make(map[string]string)
	keyContext[secrets.CustomSecretData] = "true"

	// PutSecret with nil secretData and key context
	_, err = v.s.PutSecret(testSecretIdWithPassphrase, nil, keyContext)
	errInvalidContext, ok = err.(*secrets.ErrInvalidKeyContext)
	assert.True(t, ok, "Unexpected error on PutSecret")
	assert.Contains(t, errInvalidContext.Error(), "secret data needs to be provided", "Unexpected error on PutSecret")

	// Successful PutSecret with custom secret data
	_, err = v.s.PutSecret(testSecretIdWithPassphrase, secretData, keyContext)
	assert.NoError(t, err, "Unexpected error on PutSecret")
	v.totalPuts++

	// PutSecret with nil secretData
	_, err = v.s.PutSecret(testSecretId, nil, nil)
	assert.NoError(t, err, "Unexpected error on PutSecret")
	v.totalPuts++

	// Both CustomSecretData and PublicSecretData cannot be set
	keyContext[secrets.PublicSecretData] = "true"
	_, err = v.s.PutSecret(testSecretIdWithPublic, nil, keyContext)
	errInvalidContext, ok = err.(*secrets.ErrInvalidKeyContext)
	assert.True(t, ok, "Unexpected error on PutSecret")
	assert.Contains(t, errInvalidContext.Error(), "both", "Unexpected error on PutSecret")

	delete(keyContext, secrets.CustomSecretData)

	// PublicSecretData with no data
	_, err = v.s.PutSecret(testSecretIdWithPublic, nil, keyContext)
	errInvalidContext, ok = err.(*secrets.ErrInvalidKeyContext)
	assert.True(t, ok, "Unexpected error on PutSecret")
	assert.Contains(t, errInvalidContext.Error(), "secret data needs to be provided", "Unexpected error on PutSecret")

	// Successful PutSecret with PublicSecretData
	getKC := make(map[string]string)
	getKC[secrets.PublicSecretData] = "true"
	secretData, _, err = v.s.GetSecret(testSecretId, getKC)
	assert.NoError(t, err, "Get %s secret", testSecretId)
	dek := secretData[testSecretId]
	putSecretData := make(map[string]interface{})
	putSecretData[testSecretIdWithPublic] = dek
	_, err = v.s.PutSecret(testSecretIdWithPublic, putSecretData, keyContext)
	assert.NoError(t, err, "Unexpected error on PutSecret")
	v.totalPuts++
	return nil
}

func (v *vaultTransitSecretTest) TestGetSecret(t *testing.T) error {
	// GetSecret with non-existant id
	_, _, err := v.s.GetSecret("dummy", nil)
	assert.Error(t, err, "Expected GetSecret to fail")

	// GetSecret using a secretId with data
	keyContext := make(map[string]string)
	keyContext[secrets.CustomSecretData] = "true"
	plainText1, _, err := v.s.GetSecret(testSecretIdWithPassphrase, keyContext)
	assert.NoError(t, err, "Unexpected error on GetSecret")
	// We have got secretData
	assert.NotNil(t, plainText1, "Invalid plainText was returned")
	value, ok := plainText1[testSecretIdWithPassphrase]
	assert.True(t, ok, "Unexpected plainText")
	str, ok := value.(string)
	assert.True(t, ok, "Unexpected plainText")
	assert.Equal(t, str, v.passphrase, "Unexpected passphrase")

	// GetSecret using a secretId without data
	_, _, err = v.s.GetSecret(testSecretId, nil)
	assert.NoError(t, err, "Unexpected error on GetSecret")

	// Both the flags are set
	keyContext[secrets.PublicSecretData] = "true"
	_, _, err = v.s.GetSecret(testSecretIdWithPublic, keyContext)
	errInvalidContext, ok := err.(*secrets.ErrInvalidKeyContext)
	assert.True(t, ok, "Unexpected error on PutSecret")
	assert.Contains(t, errInvalidContext.Error(), "both", "Unexpected error on PutSecret")

	// GetSecret using the secretID for public
	delete(keyContext, secrets.CustomSecretData)

	// deks for both secrets should match
	sec1, _, err := v.s.GetSecret(testSecretId, keyContext)
	assert.NoError(t, err, "Unexpected error on GetSecret")
	dek1, ok := sec1[testSecretId]
	assert.True(t, ok, "Unexpected secret returned")

	sec2, _, err := v.s.GetSecret(testSecretIdWithPublic, keyContext)
	assert.NoError(t, err, "Unexpected error on GetSecret")
	dek2, ok := sec2[testSecretIdWithPublic]
	assert.True(t, ok, "Unexpected secret returned")

	assert.Equal(t, dek1, dek2, "Unequal secrets returned.")
	return nil
}

func (v *vaultTransitSecretTest) TestDeleteSecret(t *testing.T) error {
	// Delete of a key that exists should succeed
	err := v.s.DeleteSecret(testSecretId, nil)
	assert.NoError(t, err, "Unexpected error on DeleteSecret")

	// Get of a deleted key should fail
	_, _, err = v.s.GetSecret(testSecretId, nil)
	assert.EqualError(t, secrets.ErrInvalidSecretId, err.Error(), "Expected an error on GetSecret after the key is deleted")

	// Delete of a non-existent key should also succeed
	err = v.s.DeleteSecret("dummy", nil)
	assert.NoError(t, err, "Unepxected error on DeleteSecret")
	return nil
}

func (v *vaultTransitSecretTest) TestListSecrets(t *testing.T) error {
	ids, err := v.s.ListSecrets()
	assert.NoError(t, err, "Unexpected error on ListSecrets")
	assert.Equal(t, len(ids), v.totalPuts, "Unexpected number of secrets listed")
	return nil
}

func TestEnsureEncryptinKey(t *testing.T) {
	vaultClient, err := setupVaultClient()
	require.Nil(t, err)

	vaultTransit, err := transit.New(vaultClient.Logical())
	require.Nil(t, err)

	// create an encryption key if not provided
	encryptionKey, err := ensureEncryptionKey(vaultClient, "", "")
	require.Nil(t, err)
	require.Equal(t, defaultPxEncryptionKey, encryptionKey)

	s, err := vaultTransit.Read(transit.SecretKey{Name: defaultPxEncryptionKey})
	require.Nil(t, err)
	require.NotNil(t, s)

	err = vaultTransit.Delete(transit.SecretKey{Name: defaultPxEncryptionKey})
	require.Nil(t, err)

	// check existing key key
	testKey := "test-encryption-key"
	_, err = vaultTransit.Create(transit.SecretKey{Name: testKey}, "")
	require.Nil(t, err)

	encryptionKey, err = ensureEncryptionKey(vaultClient, testKey, "")
	require.Nil(t, err)
	require.Equal(t, testKey, encryptionKey)

	s, err = vaultTransit.Read(transit.SecretKey{Name: testKey})
	require.Nil(t, err)
	require.NotNil(t, s)

	err = vaultTransit.Delete(transit.SecretKey{Name: testKey})
	require.Nil(t, err)

	// check existing key key: not found
	testKey1 := "test-encryption-key1"

	s, err = vaultTransit.Read(transit.SecretKey{Name: testKey1})
	require.Nil(t, s)
	require.NotNil(t, err)

	encryptionKey, err = ensureEncryptionKey(vaultClient, testKey1, "")
	require.NotNil(t, err)
	require.Equal(t, encryptionKey, "")
}

repository: libopenstorage/secrets

repo_name: libopenstorage/secrets


text:
package vlclient

type Stats struct {
	DecodedAudio        int     `json:"decodedaudio"`
	InputBitrate        float64 `json:"inputbitrate"`
	LostABuffers        int     `json:"lostabuffers"`
	ReadBytes           int     `json:"readbytes"`
	AverageDemuxBitware float64 `json:"averagedemuxbitrate"`
	DemuxReadBytes      int     `json:"demuxreadbytes"`
	PlayedABuffers      int     `json:"playedabuffers"`
	DemuxCorrupted      int     `json:"demuxcorrupted"`
	DisplayedPictures   int     `json:"displayedpictures"`
	LostPictures        int     `json:"lostpictures"`
	SentPackets         int     `json:"sentpackets"`
	DemuxDiscontinuity  int     `json:"demuxdiscontinuity"`
	DecodedVideo        int     `json:"decodedvideo"`
	SendBitrate         float64 `json:"sendbitrate"`
	SentBytes           int     `json:"sentbytes"`
	DemuxReadPackets    int     `json:"demuxreadpackets"`
	DemuxBitrate        float64 `json:"demuxbitrate"`
	AverageInputBitrate float64 `json:"averageinputbitrate"`
	ReadPackets         int     `json:"readpackets"`
}

repository: superloach/vlclient

repo_name: superloach/vlclient