text:
@article{刘童童离散选择实验用于癌症筛查偏好的国际研究进展,
  title={离散选择实验用于癌症筛查偏好的国际研究进展},
  author={刘童童 and 李顺平 and 陈钢},
  journal={中国卫生经济},
  number={5},
}

@article{milte2014cognitive,
  title={Cognitive overload? An exploration of the potential impact of cognitive functioning in discrete choice experiments with older people in health care},
  author={Milte, Rachel and Ratcliffe, Julie and Chen, Gang and Lancsar, Emily and Miller, Michelle and Crotty, Maria},
  journal={Value in health},
  volume={17},
  number={5},
  pages={655--659},
  year={2014},
  publisher={Elsevier}
}

@article{kjaer2008preference,
  title={Preference heterogeneity and choice of cardiac rehabilitation program: results from a discrete choice experiment},
  author={Kj{\ae}r, Trine and Gyrd-Hansen, Dorte},
  journal={Health policy},
  volume={85},
  number={1},
  pages={124--132},
  year={2008},
  publisher={Elsevier}
}

@article{eberth2009does,
  title={Does one size fit all? Investigating heterogeneity in men’s preferences for benign prostatic hyperplasia treatment using mixed logit analysis},
  author={Eberth, Barbara and Watson, Verity and Ryan, Mandy and Hughes, Jenny and Barnett, Gillian},
  journal={Medical Decision Making},
  volume={29},
  number={6},
  pages={707--715},
  year={2009},
  publisher={Sage Publications Sage CA: Los Angeles, CA}
}

@article{宋奎勐利用离散选择实验研究卫生服务人员工作偏好的国际研究进展,
  title={利用离散选择实验研究卫生服务人员工作偏好的国际研究进展},
  author={宋奎勐 and 孟庆跃 and Anthony Scott and Peter Sivey},
  journal={中国卫生经济},
  number={10},
  pages={93-95},
}

@article{杨欣2016基于潜在分类模型的农田生态补偿标准测算,
  title={基于潜在分类模型的农田生态补偿标准测算——一个离散选择实验模型的实证},
  author={杨欣 and Burton, Michael and 张安录},
  journal={中国人口{\textperiodcentered} 资源与环境},
  volume={26},
  number={7},
  pages={27--36},
  year={2016}
}

repository: JinhuaSu/DCE

repo_name: JinhuaSu/DCE

branch_name: refs/heads/master


text:
# Copyright (C) 2014 Linaro
# Released under the MIT license (see COPYING.MIT for the terms)

DESCRIPTION = "Linaro Qualcomm Landing team 4.4 Kernel"

require recipes-kernel/linux/linux-linaro-qcom.inc
require recipes-kernel/linux/linux-dtb.inc
require recipes-kernel/linux/linux-qcom-bootimg.inc

LOCALVERSION ?= "-linaro-lt-qcom"
SRCBRANCH ?= "integration-linux-qcomlt"
SRCREV ?= "5574089362de2fb0ebbc0c4d9bd48203b59b7b1b"
SRC_URI = "${LINUX_LINARO_QCOM_GIT};nobranch=1"

COMPATIBLE_MACHINE = "(apq8064|apq8016|apq8096)"

KERNEL_DEFCONFIG_aarch64 ?= "${S}/arch/arm64/configs/defconfig"
KERNEL_DEFCONFIG_apq8064 ?= "${S}/arch/arm/configs/qcom_defconfig"
KERNEL_CONFIG_FRAGMENTS += "${S}/kernel/configs/distro.config"

# append DTB, since bootloader doesn't support DTB
do_compile_append_apq8064() {
    if ! [ -e ${B}/arch/${ARCH}/boot/dts/${KERNEL_DEVICETREE} ] ; then
        oe_runmake ${KERNEL_DEVICETREE}
    fi
    cp arch/${ARCH}/boot/zImage arch/${ARCH}/boot/zImage.backup
    cat arch/${ARCH}/boot/zImage.backup arch/${ARCH}/boot/dts/${KERNEL_DEVICETREE} > arch/${ARCH}/boot/zImage
    rm -f arch/${ARCH}/boot/zImage.backup
}

# Wifi firmware has a recognizable arch :(
ERROR_QA_remove = "arch"

QCOM_BOOTIMG_ROOTFS_dragonboard-410c = "mmcblk0p10"
QCOM_BOOTIMG_ROOTFS_dragonboard-820c = "sde18"
QCOM_BOOTIMG_ROOTFS_ifc6410 = "mmcblk0p12"
QCOM_BOOTIMG_ROOTFS_sd-600eval = "mmcblk0p12"

license: MIT

repository: hexmajor/meta-qcom

license_type: permissive

repo_name: hexmajor/meta-qcom

extension: bb


text:
package crawler

import (
	"context"
	"net/http/cookiejar"
)

// Crawl asks the necessary crawlers for collecting links for building the web page
func Crawl(ctx context.Context, site string, projectPath string, cookieJar *cookiejar.Jar, proxyString string, userAgent string) error {
	// searches for css, js, and images within a given link
	return Collector(ctx, site, projectPath, cookieJar, proxyString, userAgent)
}

repository: imthaghost/goclone

repo_name: imthaghost/goclone

gha_license_id: MIT

gha_language: Go

extension: go


text:
@article{Fisher1936,
  author = {Fisher, R. A.},
  journal = {Annals of Eugenics},
  keywords = {classic classification linear-classification linear-discriminant-analysis},
  number = 7,
  pages = {179-188},
  title = {The Use of Multiple Measurements in Taxonomic Problems},
  volume = 7,
  year = 1936
}

extension: bib


text:
@misc{www-apache1,
	title = {Apache {Storm}},
	url = {http://storm.apache.org/},
	urldate = {2017-04-16},
	file = {Apache Storm:/home/vasanth/.mozilla/firefox/9wmfc1j3.default/zotero/storage/X5722DQP/storm.apache.org.html:text/html}
}

@misc{www-wiki-storm,
	title = {Storm (event processor) - {Wikipedia}},
	url = {https://en.wikipedia.org/wiki/Storm_(event_processor)},
	urldate = {2017-04-16},
	file = {Storm (event processor) - Wikipedia:/home/vasanth/.mozilla/firefox/9wmfc1j3.default/zotero/storage/7X56JME7/Storm_(event_processor).html:text/html}
}

@misc{www-storm-apache,
	title = {Apache {Storm}},
	url = {http://storm.apache.org/},
	urldate = {2017-04-16},
	file = {Apache Storm:/home/vasanth/.mozilla/firefox/9wmfc1j3.default/zotero/storage/7X77VJAK/storm.apache.org.html:text/html}
}

@misc{www-storm-zookeeper,
	title = {Apache {ZooKeeper} - {Releases}},
	url = {http://zookeeper.apache.org/releases.html},
	urldate = {2017-04-16},
	file = {Apache ZooKeeper - Releases:/home/vasanth/.mozilla/firefox/9wmfc1j3.default/zotero/storage/XVJ5X2VG/releases.html:text/html}
}

gha_language: TeX


text:
package upgradestatus_test

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

	"github.com/greenplum-db/gpupgrade/hub/upgradestatus"
	"github.com/greenplum-db/gpupgrade/hub/upgradestatus/file"
	"github.com/greenplum-db/gpupgrade/idl"
	"github.com/greenplum-db/gpupgrade/utils"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("upgradestatus/ChecklistManager", func() {
	AfterEach(func() {
		utils.System = utils.InitializeSystemFunctions()
	})

	Describe("MarkInProgress", func() {
		var (
			tempdir string
			cm      *upgradestatus.ChecklistManager
		)

		BeforeEach(func() {
			var err error
			tempdir, err = ioutil.TempDir("", "")
			Expect(err).NotTo(HaveOccurred())

			cm = upgradestatus.NewChecklistManager(filepath.Join(tempdir, ".gpupgrade"))
		})

		AfterEach(func() {
			os.RemoveAll(tempdir)
		})

		It("Leaves an in-progress file in the state dir", func() {
			step := cm.GetStepWriter("fancy_step")
			step.ResetStateDir()
			err := step.MarkInProgress()
			Expect(err).ToNot(HaveOccurred())
			expectedFile := filepath.Join(tempdir, ".gpupgrade", "fancy_step", file.InProgress)
			_, err = os.Stat(expectedFile)
			Expect(err).ToNot(HaveOccurred())
		})

		It("still succeeds if file already exists", func() {
			step := cm.GetStepWriter("fancy_step")
			step.ResetStateDir()
			step.MarkInProgress() // lay the file down once
			err := step.MarkInProgress()
			Expect(err).ToNot(HaveOccurred())
			expectedFile := filepath.Join(tempdir, ".gpupgrade", "fancy_step", file.InProgress)
			_, err = os.Stat(expectedFile)
			Expect(err).ToNot(HaveOccurred())
		})

		It("errors if file opening fails, e.g. disk full", func() {
			utils.System.OpenFile = func(_ string, _ int, _ os.FileMode) (*os.File, error) {
				return nil, errors.New("Disk full or something")
			}

			step := cm.GetStepWriter("fancy_step")
			step.ResetStateDir()
			err := step.MarkInProgress()
			Expect(err).To(HaveOccurred())
		})
	})

	Describe("ResetStateDir", func() {
		It("errors if existing files cant be deleted", func() {
			utils.System.RemoveAll = func(name string) error {
				return errors.New("cant remove all")
			}
			cm := upgradestatus.NewChecklistManager("/some/random/dir")
			step := cm.GetStepWriter("fancy_step")
			err := step.ResetStateDir()
			Expect(err).To(HaveOccurred())
		})

		It("errors if making the directory fails", func() {
			utils.System.RemoveAll = func(name string) error {
				return nil
			}
			utils.System.MkdirAll = func(string, os.FileMode) error {
				return errors.New("cant make dir")
			}
			cm := upgradestatus.NewChecklistManager("/some/random/dir")
			step := cm.GetStepWriter("fancy_step")
			err := step.ResetStateDir()
			Expect(err).To(HaveOccurred())
		})
		It("succeeds as long as we assume the file system calls do their job", func() {
			utils.System.RemoveAll = func(name string) error {
				return nil
			}
			utils.System.MkdirAll = func(string, os.FileMode) error {
				return nil
			}
			cm := upgradestatus.NewChecklistManager("/some/random/dir")
			step := cm.GetStepWriter("fancy_step")
			err := step.ResetStateDir()
			Expect(err).ToNot(HaveOccurred())
		})
	})

	Describe("MarkFailed", func() {
		It("errors if in.progress file can't be removed", func() {
			utils.System.Remove = func(string) error {
				return errors.New("remove failed")
			}
			cm := upgradestatus.NewChecklistManager("/some/random/dir")
			step := cm.GetStepWriter("step")
			err := step.MarkFailed()
			Expect(err.Error()).To(ContainSubstring("remove failed"))
		})
		It("errors if failed file can't be created", func() {
			utils.System.Remove = func(string) error {
				return nil
			}
			utils.System.OpenFile = func(string, int, os.FileMode) (*os.File, error) {
				return nil, errors.New("open file failed")
			}
			cm := upgradestatus.NewChecklistManager("/some/random/dir")
			step := cm.GetStepWriter("step")
			err := step.MarkFailed()
			Expect(err.Error()).To(ContainSubstring("open file failed"))
		})
		It("returns nil if nothing fails", func() {
			utils.System.Remove = func(string) error {
				return nil
			}
			utils.System.OpenFile = func(string, int, os.FileMode) (*os.File, error) {
				return nil, nil
			}
			cm := upgradestatus.NewChecklistManager("/some/random/dir")
			step := cm.GetStepWriter("step")
			err := step.MarkFailed()
			Expect(err).ToNot(HaveOccurred())
		})
	})

	Describe("MarkComplete", func() {
		It("errors if in.progress file can't be removed", func() {
			utils.System.Remove = func(string) error {
				return errors.New("remove failed")
			}
			cm := upgradestatus.NewChecklistManager("/some/random/dir")
			step := cm.GetStepWriter("step")
			err := step.MarkFailed()
			Expect(err.Error()).To(ContainSubstring("remove failed"))
		})
		It("errors if completed file can't be created", func() {
			utils.System.Remove = func(string) error {
				return nil
			}
			utils.System.OpenFile = func(string, int, os.FileMode) (*os.File, error) {
				return nil, errors.New("open file failed")
			}
			cm := upgradestatus.NewChecklistManager("/some/random/dir")
			step := cm.GetStepWriter("step")
			err := step.MarkComplete()
			Expect(err.Error()).To(ContainSubstring("open file failed"))
		})
		It("returns nil if nothing fails", func() {
			utils.System.Remove = func(string) error {
				return nil
			}
			utils.System.OpenFile = func(string, int, os.FileMode) (*os.File, error) {
				return nil, nil
			}
			cm := upgradestatus.NewChecklistManager("/some/random/dir")
			step := cm.GetStepWriter("step")
			err := step.MarkComplete()
			Expect(err).ToNot(HaveOccurred())
		})
	})

	Describe("AddWritableStep", func() {
		It("adds a step that can be written and read", func() {
			tempdir, err := ioutil.TempDir("", "")
			Expect(err).NotTo(HaveOccurred())
			defer os.RemoveAll(tempdir)

			cm := upgradestatus.NewChecklistManager(filepath.Join(tempdir, ".gpupgrade"))
			cm.AddWritableStep("my-step", 0)

			writer := cm.GetStepWriter("my-step")
			writer.ResetStateDir()
			writer.MarkInProgress()
			writer.MarkComplete()

			reader := cm.GetStepReader("my-step")
			Expect(reader.Status()).To(Equal(idl.StepStatus_COMPLETE))
		})

		It("adds a step that is retrievable via AllSteps", func() {
			tempdir, err := ioutil.TempDir("", "")
			Expect(err).NotTo(HaveOccurred())
			defer os.RemoveAll(tempdir)

			cm := upgradestatus.NewChecklistManager(filepath.Join(tempdir, ".gpupgrade"))
			cm.AddWritableStep("my-step", 0)

			allSteps := cm.AllSteps()
			Expect(allSteps).To(HaveLen(1))
			Expect(allSteps[0].Name()).To(Equal("my-step"))
		})

		It("panics if a step with the same name has already been added", func() {
			cm := upgradestatus.NewChecklistManager("some/random/dir")
			cm.AddWritableStep("my-step", 0)
			Expect(func() { cm.AddWritableStep("my-step", 0) }).To(Panic())
		})
	})

	Describe("AddReadOnlyStep", func() {
		It("adds a step that can be read using the given status func", func() {
			cm := upgradestatus.NewChecklistManager("some/random/dir")
			cm.AddReadOnlyStep("my-step", 0, func(name string) idl.StepStatus {
				Expect(name).To(Equal("my-step"))
				return idl.StepStatus_FAILED
			})

			reader := cm.GetStepReader("my-step")
			Expect(reader.Status()).To(Equal(idl.StepStatus_FAILED))
		})

		It("adds a step that cannot be written", func() {
			cm := upgradestatus.NewChecklistManager("some/random/dir")
			cm.AddReadOnlyStep("my-step", 0, func(string) idl.StepStatus {
				return idl.StepStatus_COMPLETE
			})

			Expect(func() { cm.GetStepWriter("my-step") }).To(Panic())
		})

		It("adds a step that is retrievable via AllSteps", func() {
			cm := upgradestatus.NewChecklistManager("some/random/dir")
			cm.AddReadOnlyStep("my-step", 0, func(string) idl.StepStatus {
				return idl.StepStatus_COMPLETE
			})

			allSteps := cm.AllSteps()
			Expect(allSteps).To(HaveLen(1))
			Expect(allSteps[0].Name()).To(Equal("my-step"))
		})

		It("panics if a step with the same name has already been added", func() {
			cm := upgradestatus.NewChecklistManager("some/random/dir")
			statusFunc := func(string) idl.StepStatus {
				return idl.StepStatus_COMPLETE
			}

			cm.AddReadOnlyStep("my-step", 0, statusFunc)
			Expect(func() { cm.AddReadOnlyStep("my-step", 0, statusFunc) }).To(Panic())
		})
	})
})


text:
DESCRIPTION = "GreekNetRadio"
SUMMARY = "Greek web radios"
SECTION = "multimedia"
MAINTAINER = "SatDreamGR"
HOMEPAGE = "http://satdreamgr.com"
LICENSE = "PD"
LIC_FILES_CHKSUM = "file://setup.py;md5=5d6dbd47e15611970ab1e4286f0acd22"

DEPENDS = "enigma2"

RDEPENDS_${PN} = "python-core"

PR = "r0"

S="${WORKDIR}/git"

SRC_URI = "git://github.com/athoik/GreekNetRadio;protocol=git"

SRCREV = "v${PV}"

inherit distutils-openplugins

do_install_append() {
  chmod 755 ${D}${libdir}/enigma2/python/Plugins/Extensions/GreekNetRadio/*.sh
}

PACKAGES =+ "${PN}-src"

FILES_${PN} = "/usr/lib/enigma2/python/Plugins/Extensions/GreekNetRadio/*"
FILES_${PN}-src = "/usr/lib/enigma2/python/Plugins/Extensions/GreekNetRadio/*.py"

license: Unlicense

repository: areadelta/recipes-local

repo_name: areadelta/recipes-local


text:
%% This BibTeX bibliography file was created using BibDesk.
%% https://bibdesk.sourceforge.io/

%% Created for Hari Sundaram at 2021-01-15 12:16:30 -0600

%% Saved with string encoding Unicode (UTF-8)

@article{alwin1985measurement,
  author    = {Alwin, Duane F and Krosnick, Jon A},
  journal   = {Public Opinion Quarterly},
  number    = {4},
  pages     = {535--552},
  publisher = {Oxford University Press},
  title     = {The measurement of values in surveys: A comparison of ratings and rankings},
  volume    = {49},
  year      = {1985}
}

@article{Andreoni1989,
  author        = {Andreoni, James},
  date-added    = {2021-01-14 11:53:02 -0600},
  date-modified = {2021-01-14 11:53:02 -0600},
  journal       = {Journal of political Economy},
  number        = {6},
  pages         = {1447--1458},
  publisher     = {The University of Chicago Press},
  title         = {Giving with impure altruism: Applications to charity and Ricardian equivalence},
  volume        = {97},
  year          = {1989},
  bdsk-file-1   = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxCOLi4vLi4vLi4vLi4vRHJvcGJveC9Xb3JrL1BhcGVycyB0byBSZWFkL1twXSBBbmRyZW9uaSwgMTk4OSAtIEdpdmluZyB3aXRoIGltcHVyZSBhbHRydWlzbSBBcHBsaWNhdGlvbnMgdG8gY2hhcml0eSBhbmQgUmljYXJkaWFuIGVxdWl2YWxlbmNlLnBkZk8RAt4AAAAAAt4AAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAAAAAAABCRAAB/////x9bcF0gQW5kcmVvbmksIDE5ODkjRkZGRkZGRkYucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAQABAAACiBjdQAAAAAAAAAAAAAAAAAOUGFwZXJzIHRvIFJlYWQAAgCXLzpVc2VyczpoYXJpc3VuZGFyYW06RHJvcGJveDpXb3JrOlBhcGVycyB0byBSZWFkOltwXSBBbmRyZW9uaSwgMTk4OSAtIEdpdmluZyB3aXRoIGltcHVyZSBhbHRydWlzbSBBcHBsaWNhdGlvbnMgdG8gY2hhcml0eSBhbmQgUmljYXJkaWFuIGVxdWl2YWxlbmNlLnBkZgAADgDOAGYAWwBwAF0AIABBAG4AZAByAGUAbwBuAGkALAAgADEAOQA4ADkAIAAtACAARwBpAHYAaQBuAGcAIAB3AGkAdABoACAAaQBtAHAAdQByAGUAIABhAGwAdAByAHUAaQBzAG0AIABBAHAAcABsAGkAYwBhAHQAaQBvAG4AcwAgAHQAbwAgAGMAaABhAHIAaQB0AHkAIABhAG4AZAAgAFIAaQBjAGEAcgBkAGkAYQBuACAAZQBxAHUAaQB2AGEAbABlAG4AYwBlAC4AcABkAGYADwAaAAwATQBhAGMAaQBuAHQAbwBzAGgAIABIAEQAEgCVVXNlcnMvaGFyaXN1bmRhcmFtL0Ryb3Bib3gvV29yay9QYXBlcnMgdG8gUmVhZC9bcF0gQW5kcmVvbmksIDE5ODkgLSBHaXZpbmcgd2l0aCBpbXB1cmUgYWx0cnVpc20gQXBwbGljYXRpb25zIHRvIGNoYXJpdHkgYW5kIFJpY2FyZGlhbiBlcXVpdmFsZW5jZS5wZGYAABMAAS8AABUAAgAT//8AAAAIAA0AGgAkALUAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAADlw==}
}

@article{Andreoni1990,
  author              = {Andreoni, James},
  copyright           = {Copyright {\copyright} 1990 Royal Economic Society},
  date-added          = {2021-01-14 11:53:02 -0600},
  date-modified       = {2021-01-14 11:53:02 -0600},
  issn                = {00130133},
  journal             = {The Economic Journal},
  jstor_articletype   = {research-article},
  jstor_formatteddate = {Jun., 1990},
  keywords            = {paper:read},
  language            = {English},
  number              = {401},
  pages               = {pp. 464-477},
  publisher           = {Wiley on behalf of the Royal Economic Society},
  title               = {Impure Altruism and Donations to Public Goods: A Theory of Warm-Glow Giving},
  url                 = {http://www.jstor.org/stable/2234133},
  volume              = {100},
  year                = {1990},
  bdsk-file-1         = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxCLLi4vLi4vLi4vLi4vRHJvcGJveC9Xb3JrL1BhcGVycyB0byBSZWFkL1twXSBhbmRyZW9uaSwgMTk5MCAtIGltcHVyZSBhbHRydWlzbSBhbmQgZG9uYXRpb25zIHRvIHB1YmxpYyBnb29kcyBhIHRoZW9yeSBvZiB3YXJtLWdsb3cgZ2l2aW5nLnBkZk8RAtAAAAAAAtAAAgAADE1hY2ludG9zaCBIRAAAAAAAAAAAAAAAAAAAAAAAAABCRAAB/////x9bcF0gYW5kcmVvbmksIDE5OTAjRkZGRkZGRkYucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////AAAAAAAAAAAAAAAAAAQABAAACiBjdQAAAAAAAAAAAAAAAAAOUGFwZXJzIHRvIFJlYWQAAgCULzpVc2VyczpoYXJpc3VuZGFyYW06RHJvcGJveDpXb3JrOlBhcGVycyB0byBSZWFkOltwXSBhbmRyZW9uaSwgMTk5MCAtIGltcHVyZSBhbHRydWlzbSBhbmQgZG9uYXRpb25zIHRvIHB1YmxpYyBnb29kcyBhIHRoZW9yeSBvZiB3YXJtLWdsb3cgZ2l2aW5nLnBkZgAOAMgAYwBbAHAAXQAgAGEAbgBkAHIAZQBvAG4AaQAsACAAMQA5ADkAMAAgAC0AIABpAG0AcAB1AHIAZQAgAGEAbAB0AHIAdQBpAHMAbQAgAGEAbgBkACAAZABvAG4AYQB0AGkAbwBuAHMAIAB0AG8AIABwAHUAYgBsAGkAYwAgAGcAbwBvAGQAcwAgAGEAIAB0AGgAZQBvAHIAeQAgAG8AZgAgAHcAYQByAG0ALQBnAGwAbwB3ACAAZwBpAHYAaQBuAGcALgBwAGQAZgAPABoADABNAGEAYwBpAG4AdABvAHMAaAAgAEgARAASAJJVc2Vycy9oYXJpc3VuZGFyYW0vRHJvcGJveC9Xb3JrL1BhcGVycyB0byBSZWFkL1twXSBhbmRyZW9uaSwgMTk5MCAtIGltcHVyZSBhbHRydWlzbSBhbmQgZG9uYXRpb25zIHRvIHB1YmxpYyBnb29kcyBhIHRoZW9yeSBvZiB3YXJtLWdsb3cgZ2l2aW5nLnBkZgATAAEvAAAVAAIAE///AAAACAANABoAJACyAAAAAAAAAgEAAAAAAAAABQAAAAAAAAAAAAAAAAAAA4Y=}
}

@article{araujo2017much,
  author    = {Araujo, Theo and Wonneberger, Anke and Neijens, Peter and de Vreese, Claes},
  journal   = {Communication Methods and Measures},
  number    = 3,
  pages     = {173--190},
  publisher = {Taylor \& Francis},
  title     = {How much time do you spend online? Understanding and improving the accuracy of self-reported measures of Internet use},
  volume    = 11,
  year      = 2017
}

@article{batchelor2016extreme,
  author  = {Batchelor, John H and Miao, Chao},
  journal = {Journal of Organizational Psychology},
  number  = {2},
  title   = {Extreme response style: A meta-analysis},
  volume  = {16},
  year    = {2016}
}

@article{benade2020preference,
  author    = {Benade, Gerdus and Nath, Swaprava and Procaccia, Ariel D and Shah, Nisarg},
  journal   = {Management Science},
  publisher = {INFORMS},
  title     = {Preference elicitation for participatory budgeting},
  year      = {2020}
}

@article{benz2008people,
  author    = {Benz, Matthias and Meier, Stephan},
  journal   = {Experimental economics},
  number    = 3,
  pages     = {268--281},
  publisher = {Springer},
  title     = {Do people behave in experiments as in the field?---evidence from donations},
  volume    = 11,
  year      = 2008
}

@article{berinsky2012evaluating,
  author    = {Berinsky, Adam J and Huber, Gregory A and Lenz, Gabriel S},
  journal   = {Political analysis},
  number    = {3},
  pages     = {351--368},
  publisher = {Cambridge University Press},
  title     = {Evaluating online labor markets for experimental research: Amazon. com's Mechanical Turk},
  volume    = {20},
  year      = {2012}
}

@article{bishop2015use,
  author    = {Bishop, Phillip A and Herron, Robert L},
  journal   = {International journal of exercise science},
  number    = 3,
  pages     = 297,
  publisher = {Western Kentucky University},
  title     = {Use and misuse of the Likert item responses and other ordinal measures},
  volume    = 8,
  year      = 2015
}

@article{cabannes2004participatory,
  author    = {Cabannes, Yves},
  journal   = {Environment and urbanization},
  number    = {1},
  pages     = {27--46},
  publisher = {Sage Publications Sage CA: Thousand Oaks, CA},
  title     = {Participatory budgeting: a significant contribution to participatory democracy},
  volume    = {16},
  year      = {2004}
}

@article{cavaille2018towards,
  author    = {Cavaill{\'e}, Charlotte and Chen, Daniel L and Van Der Straeten, Karine},
  publisher = {TSE Working Paper},
  title     = {Towards a General Theory of Survey Response: Likert Scales Vs. Quadratic Voting for Attitudinal Research},
  year      = 2018
}

@online{census2018,
  title      = {Educational Attainment in the United States: 2018},
  url        = {https://www.census.gov/data/tables/2018/demo/education-attainment/cps-detailed-tables.html},
  urldate    = {2020-10-13},
  year       = 2019,
  bdsk-url-1 = {https://www.census.gov/data/tables/2018/demo/education-attainment/cps-detailed-tables.html}
}

@article{champ1997using,
  author    = {Champ, Patricia A and Bishop, Richard C and Brown, Thomas C and McCollum, Daniel W},
  journal   = {Journal of environmental economics and management},
  number    = {2},
  pages     = {151--162},
  publisher = {Elsevier},
  title     = {Using donation mechanisms to value nonuse benefits from public goods},
  volume    = {33},
  year      = {1997}
}

@inproceedings{chang2017alpharead,
  title     = {AlphaRead: Support unambiguous referencing in remote collaboration with readable object annotation},
  author    = {Chang, Yuan-Chia and Wang, Hao-Chuan and Chu, Hung-kuo and Lin, Shung-Ying and Wang, Shuo-Ping},
  booktitle = {Proceedings of the 2017 ACM Conference on Computer Supported Cooperative Work and Social Computing},
  pages     = {2246--2259},
  year      = {2017}
}

@article{chen2006cognitive,
  author    = {Chen, Sherry Y and Ghinea, Gheorghita and Macredie, Robert D},
  journal   = {International Journal of Human-Computer Studies},
  number    = 12,
  pages     = {1200--1213},
  publisher = {Elsevier},
  title     = {A cognitive approach to user perception of multimedia quality: An empirical investigation},
  volume    = 64,
  year      = 2006
}

@inproceedings{cheng2017anyone,
  title     = {Anyone can become a troll: Causes of trolling behavior in online discussions},
  author    = {Cheng, Justin and Bernstein, Michael and Danescu-Niculescu-Mizil, Cristian and Leskovec, Jure},
  booktitle = {Proceedings of the 2017 ACM conference on computer supported cooperative work and social computing},
  pages     = {1217--1230},
  year      = {2017}
}

@inproceedings{claypool1999effects,
  author       = {Claypool, Mark and Tanner, Jonathan},
  booktitle    = {Proceedings of the seventh ACM international conference on Multimedia (Part 2)},
  organization = {ACM},
  pages        = {115--118},
  title        = {The effects of jitter on the peceptual quality of video},
  year         = 1999
}

@online{colorado_qv,
  title      = {\$120 million in requests and \$40 million in the bank. How an obscure theory helped prioritize the Colorado budget.},
  url        = {https://coloradosun.com/2019/05/28/quadratic-voting-colorado-house-budget/},
  urldate    = {2020-10-15},
  year       = 2019,
  bdsk-url-1 = {https://coloradosun.com/2019/05/28/quadratic-voting-colorado-house-budget/}
}

@book{converse1986survey,
  author    = {Converse, Jean M and Jean McDonnell, Converse and Presser, Stanley},
  publisher = {Sage},
  title     = {Survey questions: Handcrafting the standardized questionnaire},
  volume    = {63},
  year      = {1986}
}

@article{davey2007one,
  author    = {Davey, Heather M and Barratt, Alexandra L and Butow, Phyllis N and Deeks, Jonathan J},
  journal   = {Journal of clinical epidemiology},
  number    = {4},
  pages     = {356--360},
  publisher = {Elsevier},
  title     = {A one-item question with a Likert or Visual Analog Scale adequately measured current anxiety},
  volume    = {60},
  year      = {2007}
}

@article{david2000NHST,
  author     = {David R. Anderson and Kenneth P. Burnham and William L. Thompson},
  issn       = {0022541X, 19372817},
  journal    = {The Journal of Wildlife Management},
  number     = 4,
  pages      = {912--923},
  publisher  = {[Wiley, Wildlife Society]},
  title      = {Null Hypothesis Testing: Problems, Prevalence, and an Alternative},
  url        = {http://www.jstor.org/stable/3803199},
  volume     = 64,
  year       = 2000,
  bdsk-url-1 = {http://www.jstor.org/stable/3803199}
}

@article{dawes2008data,
  author    = {Dawes, John},
  journal   = {International journal of market research},
  number    = {1},
  pages     = {61--104},
  publisher = {SAGE Publications Sage UK: London, England},
  title     = {Do data characteristics change according to the number of scale points used? An experiment using 5-point, 7-point and 10-point scales},
  volume    = {50},
  year      = {2008}
}

@inproceedings{difallah2018demographics,
  author    = {Difallah, Djellel and Filatova, Elena and Ipeirotis, Panos},
  booktitle = {Proceedings of the eleventh ACM international conference on web search and data mining},
  pages     = {135--143},
  title     = {Demographics and dynamics of mechanical Turk workers},
  year      = {2018}
}

@article{easley2012networks,
  author = {Easley, David and Kleinberg, Jon and others},
  title  = {Networks, crowds, and markets}
}

@inproceedings{edmondson2005likert,
  author    = {Edmondson, Diane R},
  booktitle = {Proceedings of the 12th conference on historical analysis and research in marketing (CHARM)},
  pages     = {127--133},
  title     = {Likert scales: A history},
  year      = 2005
}

@article{eguia2019quadratic,
  author  = {Eguia, Jon X and Immorlica, Nicole and Ligett, Katrina and Weyl, E Glen and Xefteris, Dimitrios},
  journal = {Available at SSRN 3319508},
  title   = {Quadratic voting with multiple alternatives},
  year    = 2019
}

@online{experiment2015,
  author     = {Olga Nikolayeva and Esteban Buz and Linda Liu and Andrew Watts and Tim Florian Jaeger},
  title      = {Web based tutorial on experimental design.},
  url        = {https://www.hlp.rochester.edu/resources/BCS152-Tutorial/},
  year       = {2015},
  bdsk-url-1 = {https://www.hlp.rochester.edu/resources/BCS152-Tutorial/}
}

@article{Fehr2007,
  abstract            = {Since Durkheim, sociological explanations of social cooperation have emphasized the internalization of values that induce norm compliance. Since Adam Smith, economic explanations of social cooperation have emphasized incentives that induce selfish individuals to cooperate. Here, we develop a general approach---the Beliefs, Preferences, and Constraints approach---showing that each of the above models is a special case. Our approach is based on evidence indicating that pure Homo Sociologicus and pure Homo Economicus views are wrong. We show that self-regarding and norm-regarding actors coexist and that the available action opportunities determine which of these actor types dominates the aggregate level of social cooperation. Our approach contributes to the solution of long-standing problems, including the problems of social order and collective action, the determinants and consequences of social exchanges, the microfoundations of emergent aggregate patterns of social interactions, and the measurement of the impact of cultural and economic practices on individuals' social goals.},
  annote              = {A fascinating review paper attempting to understand how social order emerges from interaction amongst social actors. Fehr and Gintis show that a significant portion of the actors are conditional cooperators (50\%) while about 30\% of the population are selfish actors. The rest exhibit mixed behavior. They show that the presence of punishment is crucial to cooperation; even a few free riders can dramatically influence cooperation. On the other hand with the presence of punishment, even a few conditional cooperators can bring about cooperation. Strong reciprocity is the idea that individual will cooperate conditioned on the cooperation of others. And, these individuals who are strongly-reciprocal will using the punishment when available. There are two motivational factors behind strong reciprocity: reciprocal fairness and inequity aversion. In fact, punishment (where you lose money for punishing someone else and hence a rational actor will not punish), occurs in both repeated games within the same group as well as in one-shot dilemmas with strangers. Interestingly third parties also tend to punish! There is a neurobiological basis to strong reciprocity. Notions of reciprocity also drive wages in experiments conducted on employer-employee pairs; higher wage offers increase effort and leads to more equitable distribution of wealth (the experiment was conducted in cases where there was an excess supply of workers; the standard economic theory suggests that this should drive down prices). There is a difference between the case when the possibility of long term relationships is impossible (the effort is much lower) than the case when long term relationships are cultivated. Experiments with the ultimatum game across cultures reveal that the outcomes mirror cultural values;

Read gintis 2007; fehr 1999, and flak 2006 for the behaviors, preferences and beliefs (bpc) theory.

The authors do not discuss the role of communication in cooperation; Ostrom shows that cooperation enhances trust and therefore cooperative behavior. },
  author              = {Fehr, Ernst and Gintis, Herbert},
  copyright           = {Copyright {\copyright} 2007 Annual Reviews},
  date-added          = {2021-01-15 12:16:28 -0600},
  date-modified       = {2021-01-15 12:16:28 -0600},
  issn                = {03600572},
  journal             = {Annual Review of Sociology},
  jstor_articletype   = {research-article},
  jstor_formatteddate = {2007},
  keywords            = {paper:complete},
  language            = {English},
  pages               = {pp. 43-64},
  publisher           = {Annual Reviews},
  title               = {Human Motivation and Social Cooperation: Experimental and Analytical Foundations},
  url                 = {http://www.jstor.org/stable/29737753},
  volume              = {33},
  year                = {2007},
  bdsk-file-1         = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxCNLi4vLi4vLi4vLi4vRHJvcGJveC9Xb3JrL1BhcGVycyB0byBSZWFkL1twXSBmZWhyLCAyMDA3IC0gaHVtYW4gbW90aXZhdGlvbiBhbmQgc29jaWFsIGNvb3BlcmF0aW9uIGV4cGVyaW1lbnRhbCBhbmQgYW5hbHl0aWNhbCBmb3VuZGF0aW9uczAucGRmTxEC2AAAAAAC2AACAAAMTWFjaW50b3NoIEhEAAAAAAAAAAAAAAAAAAAAAAAAAEJEAAH/////H1twXSBmZWhyLCAyMDA3IC0gaCNGRkZGRkZGRi5wZGYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAABAAEAAAKIGN1AAAAAAAAAAAAAAAAAA5QYXBlcnMgdG8gUmVhZAACAJYvOlVzZXJzOmhhcmlzdW5kYXJhbTpEcm9wYm94Oldvcms6UGFwZXJzIHRvIFJlYWQ6W3BdIGZlaHIsIDIwMDcgLSBodW1hbiBtb3RpdmF0aW9uIGFuZCBzb2NpYWwgY29vcGVyYXRpb24gZXhwZXJpbWVudGFsIGFuZCBhbmFseXRpY2FsIGZvdW5kYXRpb25zMC5wZGYADgDMAGUAWwBwAF0AIABmAGUAaAByACwAIAAyADAAMAA3ACAALQAgAGgAdQBtAGEAbgAgAG0AbwB0AGkAdgBhAHQAaQBvAG4AIABhAG4AZAAgAHMAbwBjAGkAYQBsACAAYwBvAG8AcABlAHIAYQB0AGkAbwBuACAAZQB4AHAAZQByAGkAbQBlAG4AdABhAGwAIABhAG4AZAAgAGEAbgBhAGwAeQB0AGkAYwBhAGwAIABmAG8AdQBuAGQAYQB0AGkAbwBuAHMAMAAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIAlFVzZXJzL2hhcmlzdW5kYXJhbS9Ecm9wYm94L1dvcmsvUGFwZXJzIHRvIFJlYWQvW3BdIGZlaHIsIDIwMDcgLSBodW1hbiBtb3RpdmF0aW9uIGFuZCBzb2NpYWwgY29vcGVyYXRpb24gZXhwZXJpbWVudGFsIGFuZCBhbmFseXRpY2FsIGZvdW5kYXRpb25zMC5wZGYAEwABLwAAFQACABP//wAAAAgADQAaACQAtAAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAOQ}
}

@article{fehr2007human,
  author    = {Fehr, Ernst and Gintis, Herbert},
  journal   = {Annu. Rev. Sociol.},
  pages     = {43--64},
  publisher = {Annual Reviews},
  title     = {Human motivation and social cooperation: Experimental and analytical foundations},
  volume    = {33},
  year      = {2007}
}

@article{finstad2010,
  author    = {Finstad, Kraig},
  journal   = {Journal of Usability Studies},
  number    = 3,
  pages     = {104--110},
  publisher = {Usability Professionals' Association},
  title     = {Response interpolation and scale sensitivity: Evidence against 5-point scales},
  volume    = 5,
  year      = 2010
}

@article{furnham1986response,
  author    = {Furnham, Adrian},
  journal   = {Personality and individual differences},
  number    = {3},
  pages     = {385--400},
  publisher = {Elsevier},
  title     = {Response bias, social desirability and dissimulation},
  volume    = {7},
  year      = {1986}
}

@article{garland2008computer,
  author    = {Garland, Kate J and Noyes, Jan M},
  journal   = {Computers in Human Behavior},
  number    = 2,
  pages     = {563--575},
  publisher = {Elsevier},
  title     = {Computer attitude scales: How relevant today?},
  volume    = 24,
  year      = 2008
}

@article{gendall2010effect,
  author    = {Gendall, Philip and Healey, Benjamin},
  journal   = {International Journal of Market Research},
  number    = 5,
  pages     = {565--577},
  publisher = {SAGE Publications Sage UK: London, England},
  title     = {Effect of a promised donation to charity on survey response},
  volume    = 52,
  year      = 2010
}

@article{getzner2000hypothetical,
  author    = {Getzner, Michael},
  journal   = {Journal of Environmental planning and Management},
  number    = {4},
  pages     = {541--559},
  publisher = {Taylor \& Francis},
  title     = {Hypothetical and real economic commitments, and social status, in valuing a species protection programme},
  volume    = {43},
  year      = {2000}
}

@misc{glaser2008response,
  author    = {Glaser, P},
  publisher = {Sage: Thousand Oaks, CA, USA},
  title     = {Response Rates. Encyclopedia of Survey Research Methods},
  year      = {2008}
}

@article{gob2007ordinal,
  author    = {G{\"o}b, Rainer and McCollin, Christopher and Ramalhoto, Maria Fernanda},
  journal   = {Quality \& Quantity},
  number    = {5},
  pages     = {601--626},
  publisher = {Springer},
  title     = {Ordinal methodology in the analysis of Likert scales},
  volume    = {41},
  year      = {2007}
}

@article{goel2015knapsack,
  author = {Goel, Ashish and Krishnaswamy, Anilesh K and Sakshuwong, Sukolsak and Aitamurto, Tanja},
  title  = {Knapsack voting}
}

@article{Goel2016,
  author        = {Goel, Ashish and Krishnaswamy, Anilesh K and Sakshuwong, Sukolsak},
  date-added    = {2021-01-09 15:53:00 -0600},
  date-modified = {2021-01-09 15:53:00 -0600},
  journal       = {Collective Intelligence},
  pages         = {783--809},
  title         = {Budget aggregation via knapsack voting: welfare-maximization and strategy-proofness},
  year          = {2016},
  bdsk-file-1   = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxCPLi4vLi4vLi4vLi4vRHJvcGJveC9Xb3JrL1BhcGVycyB0byBSZWFkL1twXSBnb2VsLCAyMDE2IC0gYnVkZ2V0IGFnZ3JlZ2F0aW9uIHZpYSBrbmFwc2FjayB2b3Rpbmcgd2VsZmFyZS1tYXhpbWl6YXRpb24gYW5kIHN0cmF0ZWd5LXByb29mbmVzcy5wZGZPEQLgAAAAAALgAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAAAAAAAAQkQAAf////8fW3BdIGdvZWwsIDIwMTYgLSBiI0ZGRkZGRkZGLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAEAAQAAAogY3UAAAAAAAAAAAAAAAAADlBhcGVycyB0byBSZWFkAAIAmC86VXNlcnM6aGFyaXN1bmRhcmFtOkRyb3Bib3g6V29yazpQYXBlcnMgdG8gUmVhZDpbcF0gZ29lbCwgMjAxNiAtIGJ1ZGdldCBhZ2dyZWdhdGlvbiB2aWEga25hcHNhY2sgdm90aW5nIHdlbGZhcmUtbWF4aW1pemF0aW9uIGFuZCBzdHJhdGVneS1wcm9vZm5lc3MucGRmAA4A0ABnAFsAcABdACAAZwBvAGUAbAAsACAAMgAwADEANgAgAC0AIABiAHUAZABnAGUAdAAgAGEAZwBnAHIAZQBnAGEAdABpAG8AbgAgAHYAaQBhACAAawBuAGEAcABzAGEAYwBrACAAdgBvAHQAaQBuAGcAIAB3AGUAbABmAGEAcgBlAC0AbQBhAHgAaQBtAGkAegBhAHQAaQBvAG4AIABhAG4AZAAgAHMAdAByAGEAdABlAGcAeQAtAHAAcgBvAG8AZgBuAGUAcwBzAC4AcABkAGYADwAaAAwATQBhAGMAaQBuAHQAbwBzAGgAIABIAEQAEgCWVXNlcnMvaGFyaXN1bmRhcmFtL0Ryb3Bib3gvV29yay9QYXBlcnMgdG8gUmVhZC9bcF0gZ29lbCwgMjAxNiAtIGJ1ZGdldCBhZ2dyZWdhdGlvbiB2aWEga25hcHNhY2sgdm90aW5nIHdlbGZhcmUtbWF4aW1pemF0aW9uIGFuZCBzdHJhdGVneS1wcm9vZm5lc3MucGRmABMAAS8AABUAAgAT//8AAAAIAA0AGgAkALYAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAADmg==}
}

@article{gould2015home,
  author  = {Gould, Sandy JJ and Cox, Anna L and Brumby, Duncan P and Wiseman, Sarah},
  journal = {Human Computation},
  number  = {1},
  pages   = {45--67},
  title   = {Home is where the lab is: a comparison of online and lab data from a time-sensitive study of interruption},
  volume  = {2},
  year    = {2015}
}

@article{hardman1998successful,
  author    = {Hardman, Vicky and Sasse, Martina Angela and Kouvelas, Isidor},
  journal   = {Communications of the ACM},
  number    = {5},
  pages     = {74--80},
  publisher = {ACM New York, NY, USA},
  title     = {Successful multiparty audio communication over the Internet},
  volume    = {41},
  year      = {1998}
}

@article{hodge2003phrase,
  author    = {Hodge, David R and Gillespie, David},
  journal   = {Social Work Research},
  number    = 1,
  pages     = {45--56},
  publisher = {Oxford University Press},
  title     = {Phrase completions: An alternative to likert scales.(Note on Research Methodology)},
  volume    = 27,
  year      = 2003
}

@inproceedings{hsieh2010pay,
  author    = {Hsieh, Gary and Kraut, Robert E and Hudson, Scott E},
  booktitle = {Proceedings of the SIGCHI Conference on Human Factors in Computing Systems},
  pages     = {305--314},
  title     = {Why pay? Exploring how financial incentives are used for question \& answer},
  year      = {2010}
}

@inproceedings{hsieh2016you,
  author    = {Hsieh, Gary and Kocielnik, Rafa{\l}},
  booktitle = {Proceedings of the 19th ACM Conference on Computer-Supported Cooperative Work \& Social Computing},
  pages     = {823--835},
  title     = {You get who you pay for: The impact of incentives on participation bias},
  year      = {2016}
}

@article{huynh2008temporal,
  author    = {Huynh-Thu, Quan and Ghanbari, Mohammed},
  journal   = {IEEE Transactions on Broadcasting},
  number    = {3},
  pages     = {641--651},
  publisher = {IEEE},
  title     = {Temporal aspect of perceived quality in mobile video broadcasting},
  volume    = {54},
  year      = {2008}
}

@article{ioannidis2005most,
  author    = {Ioannidis, John PA},
  journal   = {PLoS medicine},
  number    = {8},
  pages     = {e124},
  publisher = {Public Library of Science},
  title     = {Why most published research findings are false},
  volume    = {2},
  year      = {2005}
}

@article{iyengar2000choice,
  author    = {Iyengar, Sheena S and Lepper, Mark R},
  journal   = {Journal of personality and social psychology},
  number    = {6},
  pages     = {995},
  publisher = {American Psychological Association},
  title     = {When choice is demotivating: Can one desire too much of a good thing?},
  volume    = {79},
  year      = {2000}
}

@article{jamieson2004likert,
  author    = {Jamieson, Susan and others},
  journal   = {Medical education},
  number    = 12,
  pages     = {1217--1218},
  publisher = {Chichester},
  title     = {Likert scales: how to (ab) use them},
  volume    = 38
}

@article{jamieson2011intervening,
  author    = {Jamieson, Jeremy P and Harkins, Stephen G},
  journal   = {Personality and Social Psychology Bulletin},
  number    = {5},
  pages     = {652--661},
  publisher = {Sage Publications Sage CA: Los Angeles, CA},
  title     = {The intervening task method: Implications for measuring mediation},
  volume    = {37},
  year      = {2011}
}

@article{joshi2015likert,
  author  = {Joshi, Ankur and Kale, Saket and Chandel, Satish and Pal, D Kumar},
  journal = {Current Journal of Applied Science and Technology},
  pages   = {396--403},
  title   = {Likert scale: Explored and explained},
  year    = {2015}
}

@inproceedings{kay2016researcher,
  author    = {Kay, Matthew and Nelson, Gregory L and Hekler, Eric B},
  booktitle = {Proceedings of the 2016 CHI Conference on Human Factors in Computing Systems},
  pages     = {4521--4532},
  title     = {Researcher-centered design of statistics: Why Bayesian statistics better fit the culture and incentives of HCI},
  year      = {2016}
}

@article{kiesler1986response,
  author    = {Kiesler, Sara and Sproull, Lee S},
  journal   = {Public Opinion Quarterly},
  number    = {3},
  pages     = {402--413},
  publisher = {Oxford University Press},
  title     = {Response effects in the electronic survey},
  volume    = {50},
  year      = {1986}
}

@inproceedings{knoche2005can,
  author    = {Knoche, Hendrik and McCarthy, John D and Sasse, M Angela},
  booktitle = {Proceedings of the 13th annual ACM international conference on Multimedia},
  pages     = {829--838},
  title     = {Can small be beautiful? Assessing image resolution requirements for mobile TV},
  year      = {2005}
}

@article{knoche2008low,
  author    = {Knoche, Hendrik and Mccarthy, John D and Sasse, M Angela},
  journal   = {Multimedia Tools and Applications},
  number    = {1-2},
  pages     = {145--166},
  publisher = {Springer},
  title     = {How low can you go? The effect of low resolutions on shot types in mobile TV},
  volume    = 36,
  year      = 2008
}

@article{komorita1965number,
  author    = {Komorita, Samuel S and Graham, William K},
  journal   = {Educational and Psychological Measurement},
  number    = {4},
  pages     = {987--995},
  publisher = {Sage Publications Sage CA: Thousand Oaks, CA},
  title     = {Number of scale points and the reliability of scales},
  volume    = {25},
  year      = {1965}
}

@article{kruschke2010bayesian,
  author    = {Kruschke, John K},
  journal   = {Wiley Interdisciplinary Reviews: Cognitive Science},
  number    = {5},
  pages     = {658--676},
  publisher = {Wiley Online Library},
  title     = {Bayesian data analysis},
  volume    = {1},
  year      = {2010}
}

@article{kuru2016improving,
  author    = {Kuru, Ozan and Pasek, Josh},
  journal   = {Computers in Human Behavior},
  pages     = {82--92},
  publisher = {Elsevier},
  title     = {Improving social media measurement in surveys: Avoiding acquiescence bias in Facebook research},
  volume    = {57},
  year      = {2016}
}

@inproceedings{Lalley2018,
  author        = {Lalley, Steven P and Weyl, E Glen},
  booktitle     = {AEA Papers and Proceedings},
  date-added    = {2021-01-10 10:20:24 -0600},
  date-modified = {2021-01-10 10:20:24 -0600},
  pages         = {33--37},
  title         = {Quadratic voting: How mechanism design can radicalize democracy},
  volume        = {108},
  year          = {2018},
  bdsk-file-1   = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxB9Li4vLi4vLi4vLi4vRHJvcGJveC9Xb3JrL1BhcGVycyB0byBSZWFkL1twXSBsYWxsZXksIDIwMTggLSBxdWFkcmF0aWMgdm90aW5nIGhvdyBtZWNoYW5pc20gZGVzaWduIGNhbiByYWRpY2FsaXplIGRlbW9jcmFjeS5wZGZPEQKYAAAAAAKYAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAAAAAAAAQkQAAf////8fW3BdIGxhbGxleSwgMjAxOCAtI0ZGRkZGRkZGLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAEAAQAAAogY3UAAAAAAAAAAAAAAAAADlBhcGVycyB0byBSZWFkAAIAhi86VXNlcnM6aGFyaXN1bmRhcmFtOkRyb3Bib3g6V29yazpQYXBlcnMgdG8gUmVhZDpbcF0gbGFsbGV5LCAyMDE4IC0gcXVhZHJhdGljIHZvdGluZyBob3cgbWVjaGFuaXNtIGRlc2lnbiBjYW4gcmFkaWNhbGl6ZSBkZW1vY3JhY3kucGRmAA4ArABVAFsAcABdACAAbABhAGwAbABlAHkALAAgADIAMAAxADgAIAAtACAAcQB1AGEAZAByAGEAdABpAGMAIAB2AG8AdABpAG4AZwAgAGgAbwB3ACAAbQBlAGMAaABhAG4AaQBzAG0AIABkAGUAcwBpAGcAbgAgAGMAYQBuACAAcgBhAGQAaQBjAGEAbABpAHoAZQAgAGQAZQBtAG8AYwByAGEAYwB5AC4AcABkAGYADwAaAAwATQBhAGMAaQBuAHQAbwBzAGgAIABIAEQAEgCEVXNlcnMvaGFyaXN1bmRhcmFtL0Ryb3Bib3gvV29yay9QYXBlcnMgdG8gUmVhZC9bcF0gbGFsbGV5LCAyMDE4IC0gcXVhZHJhdGljIHZvdGluZyBob3cgbWVjaGFuaXNtIGRlc2lnbiBjYW4gcmFkaWNhbGl6ZSBkZW1vY3JhY3kucGRmABMAAS8AABUAAgAT//8AAAAIAA0AGgAkAKQAAAAAAAACAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAADQA==}
}

@inproceedings{lalley2018quadratic,
  author    = {Lalley, Steven P and Weyl, E Glen},
  booktitle = {AEA Papers and Proceedings},
  pages     = {33--37},
  title     = {Quadratic voting: How mechanism design can radicalize democracy},
  volume    = 108,
  year      = 2018
}

@inproceedings{ledo2018evaluation,
  author    = {Ledo, David and Houben, Steven and Vermeulen, Jo and Marquardt, Nicolai and Oehlberg, Lora and Greenberg, Saul},
  booktitle = {Proceedings of the 2018 CHI Conference on Human Factors in Computing Systems},
  pages     = {1--17},
  title     = {Evaluation strategies for HCI toolkit research},
  year      = 2018
}

@inproceedings{Lee2014,
  author        = {Lee, David Timothy and Goel, Ashish and Aitamurto, Tanja and Landemore, Helene},
  booktitle     = {Second AAAI Conference on Human Computation and Crowdsourcing},
  date-added    = {2021-01-09 15:53:00 -0600},
  date-modified = {2021-01-09 15:53:00 -0600},
  title         = {Crowdsourcing for participatory democracies: Efficient elicitation of social choice functions},
  year          = {2014},
  bdsk-file-1   = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxCYLi4vLi4vLi4vLi4vRHJvcGJveC9Xb3JrL1BhcGVycyB0byBSZWFkL1twXSBsZWUsIDIwMTQgLSBjcm93ZHNvdXJjaW5nIGZvciBwYXJ0aWNpcGF0b3J5IGRlbW9jcmFjaWVzIGVmZmljaWVudCBlbGljaXRhdGlvbiBvZiBzb2NpYWwgY2hvaWNlIGZ1bmN0aW9ucy5wZGZPEQMGAAAAAAMGAAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAAAAAAAAQkQAAf////8fW3BdIGxlZSwgMjAxNCAtIGNyI0ZGRkZGRkZGLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAEAAQAAAogY3UAAAAAAAAAAAAAAAAADlBhcGVycyB0byBSZWFkAAIAoS86VXNlcnM6aGFyaXN1bmRhcmFtOkRyb3Bib3g6V29yazpQYXBlcnMgdG8gUmVhZDpbcF0gbGVlLCAyMDE0IC0gY3Jvd2Rzb3VyY2luZyBmb3IgcGFydGljaXBhdG9yeSBkZW1vY3JhY2llcyBlZmZpY2llbnQgZWxpY2l0YXRpb24gb2Ygc29jaWFsIGNob2ljZSBmdW5jdGlvbnMucGRmAAAOAOIAcABbAHAAXQAgAGwAZQBlACwAIAAyADAAMQA0ACAALQAgAGMAcgBvAHcAZABzAG8AdQByAGMAaQBuAGcAIABmAG8AcgAgAHAAYQByAHQAaQBjAGkAcABhAHQAbwByAHkAIABkAGUAbQBvAGMAcgBhAGMAaQBlAHMAIABlAGYAZgBpAGMAaQBlAG4AdAAgAGUAbABpAGMAaQB0AGEAdABpAG8AbgAgAG8AZgAgAHMAbwBjAGkAYQBsACAAYwBoAG8AaQBjAGUAIABmAHUAbgBjAHQAaQBvAG4AcwAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIAn1VzZXJzL2hhcmlzdW5kYXJhbS9Ecm9wYm94L1dvcmsvUGFwZXJzIHRvIFJlYWQvW3BdIGxlZSwgMjAxNCAtIGNyb3dkc291cmNpbmcgZm9yIHBhcnRpY2lwYXRvcnkgZGVtb2NyYWNpZXMgZWZmaWNpZW50IGVsaWNpdGF0aW9uIG9mIHNvY2lhbCBjaG9pY2UgZnVuY3Rpb25zLnBkZgAAEwABLwAAFQACABP//wAAAAgADQAaACQAvwAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAPJ}
}

@inproceedings{leon2013matters,
  author    = {Leon, Pedro Giovanni and Ur, Blase and Wang, Yang and Sleeper, Manya and Balebako, Rebecca and Shay, Richard and Bauer, Lujo and Christodorescu, Mihai and Cranor, Lorrie Faith},
  booktitle = {Proceedings of the ninth symposium on usable privacy and security},
  pages     = {1--12},
  title     = {What matters to users? Factors that affect users' willingness to share information with online advertisers},
  year      = 2013
}

@article{likert1932technique,
  author  = {Likert, Rensis},
  journal = {Archives of psychology},
  title   = {A technique for the measurement of attitudes.},
  year    = 1932
}

@article{litman2017turkprime,
  author    = {Litman, Leib and Robinson, Jonathan and Abberbock, Tzvi},
  journal   = {Behavior research methods},
  number    = {2},
  pages     = {433--442},
  publisher = {Springer},
  title     = {TurkPrime. com: A versatile crowdsourcing data acquisition platform for the behavioral sciences},
  volume    = {49},
  year      = {2017}
}

@inproceedings{lykourentzou2017team,
  title     = {Team dating leads to better online ad hoc collaborations},
  author    = {Lykourentzou, Ioanna and Kraut, Robert E and Dow, Steven P},
  booktitle = {Proceedings of the 2017 ACM conference on computer supported cooperative work and social computing},
  pages     = {2330--2343},
  year      = {2017}
}

@inproceedings{ma2017video,
  title     = {Video-based evanescent, anonymous, asynchronous social interaction: Motivation and adaption to medium},
  author    = {Ma, Xiaojuan and Cao, Nan},
  booktitle = {Proceedings of the 2017 ACM Conference on Computer Supported Cooperative Work and Social Computing},
  pages     = {770--782},
  year      = {2017}
}

@book{malhotra2006basic,
  author    = {Malhotra, Naresh K and Peterson, Mark},
  publisher = {Prentice hall},
  title     = {Basic marketing research: A decision-making approach},
  year      = {2006}
}

@book{McElreath2015,
  author        = {McElreath, Richard},
  date-added    = {2020-05-25 22:29:41 -0500},
  date-modified = {2020-05-25 22:29:41 -0500},
  publisher     = {Chapman and Hall/CRC},
  title         = {Statistical rethinking: A Bayesian course with examples in R and Stan},
  year          = {2015},
  bdsk-file-1   = {YnBsaXN0MDDSAQIDBFxyZWxhdGl2ZVBhdGhZYWxpYXNEYXRhXxCGLi4vLi4vLi4vLi4vRHJvcGJveC9Xb3JrL1BhcGVycyB0byBSZWFkL1twXSBtY2VscmVhdGgsIDIwMTUgLSBzdGF0aXN0aWNhbCByZXRoaW5raW5nIGEgYmF5ZXNpYW4gY291cnNlIHdpdGggZXhhbXBsZXMgaW4gciBhbmQgc3Rhbi5wZGZPEQK+AAAAAAK+AAIAAAxNYWNpbnRvc2ggSEQAAAAAAAAAAAAAAAAAAAAAAAAAQkQAAf////8fW3BdIG1jZWxyZWF0aCwgMjAxI0ZGRkZGRkZGLnBkZgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAAAAEAAQAAAogY3UAAAAAAAAAAAAAAAAADlBhcGVycyB0byBSZWFkAAIAjy86VXNlcnM6aGFyaXN1bmRhcmFtOkRyb3Bib3g6V29yazpQYXBlcnMgdG8gUmVhZDpbcF0gbWNlbHJlYXRoLCAyMDE1IC0gc3RhdGlzdGljYWwgcmV0aGlua2luZyBhIGJheWVzaWFuIGNvdXJzZSB3aXRoIGV4YW1wbGVzIGluIHIgYW5kIHN0YW4ucGRmAAAOAL4AXgBbAHAAXQAgAG0AYwBlAGwAcgBlAGEAdABoACwAIAAyADAAMQA1ACAALQAgAHMAdABhAHQAaQBzAHQAaQBjAGEAbAAgAHIAZQB0AGgAaQBuAGsAaQBuAGcAIABhACAAYgBhAHkAZQBzAGkAYQBuACAAYwBvAHUAcgBzAGUAIAB3AGkAdABoACAAZQB4AGEAbQBwAGwAZQBzACAAaQBuACAAcgAgAGEAbgBkACAAcwB0AGEAbgAuAHAAZABmAA8AGgAMAE0AYQBjAGkAbgB0AG8AcwBoACAASABEABIAjVVzZXJzL2hhcmlzdW5kYXJhbS9Ecm9wYm94L1dvcmsvUGFwZXJzIHRvIFJlYWQvW3BdIG1jZWxyZWF0aCwgMjAxNSAtIHN0YXRpc3RpY2FsIHJldGhpbmtpbmcgYSBiYXllc2lhbiBjb3Vyc2Ugd2l0aCBleGFtcGxlcyBpbiByIGFuZCBzdGFuLnBkZgAAEwABLwAAFQACABP//wAAAAgADQAaACQArQAAAAAAAAIBAAAAAAAAAAUAAAAAAAAAAAAAAAAAAANv}
}

@article{meier2007subsidies,
  author    = {Meier, Stephan},
  journal   = {Journal of the European Economic Association},
  number    = {6},
  pages     = {1203--1222},
  publisher = {Oxford University Press},
  title     = {Do subsidies increase charitable giving in the long run? Matching donations in a field experiment},
  volume    = {5},
  year      = {2007}
}

@article{meisenberg2008acquiescent,
  author    = {Meisenberg, Gerhard and Williams, Amandy},
  journal   = {Personality and individual differences},
  number    = {7},
  pages     = {1539--1550},
  publisher = {Elsevier},
  title     = {Are acquiescent and extreme response styles related to low intelligence and education?},
  volume    = {44},
  year      = {2008}
}

@inproceedings{molnar2013comedy,
  author       = {Molnar, Andreea and Muntean, Cristina Hava},
  booktitle    = {2013 IEEE International Symposium on Broadband Multimedia Systems and Broadcasting (BMSB)},
  organization = {IEEE},
  pages        = {1--7},
  title        = {COMEDY: Viewer trade off between multimedia quality and monetary benefits},
  year         = 2013
}

@article{molnar2015assessing,
  author    = {Molnar, Andreea and Muntean, Cristina Hava},
  journal   = {Journal of Universal Computer Science},
  number    = 7,
  pages     = {959--975},
  publisher = {Springer Verlag},
  title     = {Assessing learning achievements when reducing mobile video quality},
  volume    = 21,
  year      = 2015
}

@inproceedings{moors2016two,
  author    = {Moors, Guy and Vriens, Ingrid and Gelissen, John PTM and Vermunt, Jeroen K},
  booktitle = {Survey Research Methods},
  number    = {1},
  pages     = {15--33},
  title     = {Two of a Kind. Similarities Between Ranking and Rating Data in Measuring Values.},
  volume    = {10},
  year      = {2016}
}

@article{naylor2017first,
  author    = {Naylor, Ryan and others},
  journal   = {Student Success},
  number    = 2,
  pages     = {9--19},
  publisher = {Student Success Journal},
  title     = {First year student conceptions of success: What really matters?},
  volume    = 8,
  year      = 2017
}

@online{nielsen,
  title      = {SHELF SOLUTIONS},
  url        = {https://www.nielsen.com/apac/en/solutions/measurement/shelf-solutions/},
  urldate    = {2020-10-12},
  year       = 2020,
  bdsk-url-1 = {https://www.nielsen.com/apac/en/solutions/measurement/shelf-solutions/}
}

@article{noll1993wideband,
  author    = {Noll, Peter},
  journal   = {IEEE Communications Magazine},
  number    = 11,
  pages     = {34--44},
  publisher = {IEEE},
  title     = {Wideband speech and audio coding},
  volume    = 31,
  year      = 1993
}

@inproceedings{oeldorf2012bad,
  author       = {Oeldorf-Hirsch, Anne and Donner, Jonathan and Cutrell, Edward},
  booktitle    = {Proceedings of the 7th Nordic Conference on Human-Computer Interaction: Making Sense Through Design},
  organization = {ACM},
  pages        = {49--58},
  title        = {How bad is good enough?: exploring mobile video quality trade-offs for bandwidth-constrained consumers},
  year         = 2012
}

@inproceedings{oviatt2006human,
  author    = {Oviatt, Sharon},
  booktitle = {Proceedings of the 14th ACM international conference on Multimedia},
  pages     = {871--880},
  title     = {Human-centered design meets cognitive load theory: designing interfaces that help people think},
  year      = {2006}
}

@article{ozok2009survey,
  author    = {Ozok, A Ant},
  journal   = {Human-Computer Interaction: Development Process},
  publisher = {CRC Press},
  title     = {Survey design and implementation in HCI},
  volume    = 253,
  year      = 2009
}

@article{pell2005use,
  author    = {Pell, Godfrey},
  publisher = {Blackwell Publishing},
  title     = {Use and misuse of Likert scales.},
  year      = 2005
}

@article{pew,
  journal = {Pew research center},
  title   = {2018 Midterm Voters: Issues and Political Values},
  year    = 2018
}

@online{pew_spending,
  title      = {Little Public Support for Reductions in Federal Spending},
  url        = {https://www.pewresearch.org/politics/2019/04/11/little-public-support-for-reductions-in-federal-spending/},
  urldate    = {2020-10-15},
  year       = 2019,
  bdsk-url-1 = {https://www.pewresearch.org/politics/2019/04/11/little-public-support-for-reductions-in-federal-spending/}
}

@article{posner2017quadratic,
  author    = {Posner, Eric A and Weyl, E Glen},
  journal   = {Public Choice},
  number    = {1-2},
  pages     = {1--22},
  publisher = {Springer},
  title     = {Quadratic voting and the public good: introduction},
  volume    = {172},
  year      = {2017}
}

@book{posner2018radical,
  author    = {Posner, Eric A and Weyl, E Glen},
  publisher = {Princeton University Press},
  title     = {Radical markets: Uprooting capitalism and democracy for a just society},
  year      = 2018
}

@article{quarfoot2017quadratic,
  author    = {Quarfoot, David and von Kohorn, Douglas and Slavin, Kevin and Sutherland, Rory and Goldstein, David and Konar, Ellen},
  journal   = {Public Choice},
  number    = {1-2},
  pages     = {283--303},
  publisher = {Springer},
  title     = {Quadratic voting in the wild: real people, real votes},
  volume    = 172,
  year      = 2017
}

@article{ready2010using,
  title     = {Using respondent uncertainty to mitigate hypothetical bias in a stated choice experiment},
  author    = {Ready, Richard C and Champ, Patricia A and Lawton, Jennifer L},
  journal   = {Land Economics},
  volume    = {86},
  number    = {2},
  pages     = {363--381},
  year      = {2010},
  publisher = {University of Wisconsin Press}
}

@article{roster2015exploring,
  author  = {Roster, Catherine A and Lucianetti, Lorenzo and Albaum, Gerald},
  journal = {Journal of Research Practice},
  number  = 1,
  pages   = 1,
  title   = {Exploring slider vs. categorical response formats in web-based surveys},
  volume  = 11,
  year    = 2015
}

@article{roth1982incentive,
  author    = {Roth, Alvin E},
  journal   = {Economics letters},
  number    = {2},
  pages     = {127--132},
  publisher = {North-Holland},
  title     = {Incentive compatibility in a market with indivisible goods},
  volume    = {9},
  year      = {1982}
}

@article{roughgarden2010algorithmic,
  author    = {Roughgarden, Tim},
  journal   = {Communications of the ACM},
  number    = 7,
  pages     = {78--86},
  publisher = {ACM New York, NY, USA},
  title     = {Algorithmic game theory},
  volume    = 53,
  year      = 2010
}

@article{salvatier2016probabilistic,
  author    = {Salvatier, John and Wiecki, Thomas V and Fonnesbeck, Christopher},
  journal   = {PeerJ Computer Science},
  pages     = {e55},
  publisher = {PeerJ Inc.},
  title     = {Probabilistic programming in Python using PyMC3},
  volume    = {2},
  year      = {2016}
}

@article{scheffe1952analysis,
  author    = {Scheff{\'e}, Henry},
  journal   = {Journal of the American Statistical Association},
  number    = {259},
  pages     = {381--400},
  publisher = {Taylor \& Francis},
  title     = {An analysis of variance for paired comparisons},
  volume    = {47},
  year      = {1952}
}

@incollection{sep-voting-methods,
  author       = {Pacuit, Eric},
  booktitle    = {The Stanford Encyclopedia of Philosophy},
  edition      = {Fall 2019},
  editor       = {Edward N. Zalta},
  howpublished = {\url{https://plato.stanford.edu/archives/fall2019/entries/voting-methods/}},
  publisher    = {Metaphysics Research Lab, Stanford University},
  title        = {Voting Methods},
  year         = 2019
}

@article{Shah2015a,
  author  = {Anuj K. Shah and Eldar Shafir and Sendhil Mullainathan},
  journal = {Psychological Science},
  number  = {4},
  pages   = {402-412},
  title   = {Scarcity Frames Value},
  volume  = {26},
  year    = {2015}
}

@article{singhal2001modern,
  author  = {Singhal, Amit and others},
  journal = {IEEE Data Eng. Bull.},
  number  = {4},
  pages   = {35--43},
  title   = {Modern information retrieval: A brief overview},
  volume  = {24},
  year    = {2001}
}

@article{starch1923methods,
  author     = {Daniel Starch},
  doi        = {10.1177/000271622311000114},
  journal    = {The ANNALS of the American Academy of Political and Social Science},
  number     = {1},
  pages      = {139-143},
  title      = {Research Methods in Advertising},
  url        = {https://doi.org/10.1177/000271622311000114},
  volume     = {110},
  year       = {1923},
  bdsk-url-1 = {https://doi.org/10.1177/000271622311000114}
}

@article{steinmetz1996human,
  author    = {Steinmetz, Ralf},
  journal   = {IEEE Journal on selected Areas in Communications},
  number    = 1,
  pages     = {61--72},
  publisher = {IEEE},
  title     = {Human perception of jitter and media synchronization},
  volume    = 14,
  year      = 1996
}

@book{stone1999science,
  author    = {Stone, Arthur A and Bachrach, Christine A and Jobe, Jared B and Kurtzman, Howard S and Cain, Virginia S},
  publisher = {Psychology Press},
  title     = {The science of self-report: Implications for research and practice},
  year      = {1999}
}

@article{vavreck2007exaggerated,
  author    = {Vavreck, Lynn and others},
  journal   = {Quarterly Journal of Political Science},
  number    = 4,
  pages     = {325--343},
  publisher = {Now Publishers, Inc.},
  title     = {The exaggerated effects of advertising on turnout: The dangers of self-reports},
  volume    = 2,
  year      = 2007
}
@article{watson1996evaluating,
  author    = {Watson, Anna and Sasse, Martina Angela},
  journal   = {Interacting with Computers},
  number    = 3,
  pages     = {255--275},
  publisher = {OUP},
  title     = {Evaluating audio and video quality in low-cost multimedia conferencing systems},
  volume    = 8,
  year      = 1996
}
@article{xiao2019should,
  author    = {Xiao, Ziang and Ho, Po-Shiun and Wang, Xinran and Karahalios, Karrie and Sundaram, Hari},
  journal   = {Proceedings of the ACM on Human-Computer Interaction},
  number    = {CSCW},
  pages     = {1--28},
  publisher = {ACM New York, NY, USA},
  title     = {Should We Use an Abstract Comic Form to Persuade? Experiments with Online Charitable Donation},
  volume    = {3},
  year      = {2019}
}
@inproceedings{yannakakis2011ranking,
  author       = {Yannakakis, Georgios N and Hallam, John},
  booktitle    = {International conference on affective computing and intelligent interaction},
  organization = {Springer},
  pages        = {437--446},
  title        = {Ranking vs. preference: a comparative study of self-reporting},
  year         = {2011}
}
@techreport{zawojska2015re,
  author = {Zawojska, Ewa and Czajkowski, Miko{\l}aj and others},
  title  = {Re-examining empirical evidence on contingent valuation--Importance of incentive compatibility},
  year   = {2015}
}
@inproceedings{zhang2017wikum,
  title     = {Wikum: Bridging discussion forums and wikis using recursive summarization},
  author    = {Zhang, Amy X and Verou, Lea and Karger, David},
  booktitle = {Proceedings of the 2017 ACM Conference on Computer Supported Cooperative Work and Social Computing},
  pages     = {2082--2096},
  year      = {2017}
}

@misc{illinoisdatabankIDB_1928463,
doi = {10.13012/B2IDB-1928463_V1},
url = {https://doi.org/10.13012/B2IDB-1928463_V1},
author = {Cheng, Ti-Chung and Li, Tiffany Wenting and Karahalios, Karrie and Sundaram, Hari},
publisher = {University of Illinois at Urbana-Champaign},
title = {Dataset for ` ``{I} can show what {I} really like.'': {Eliciting Preferences via Quadratic Voting}'},
year = {2021}
}

repository: CrowdDynamicsLab/QV-paper

repo_name: CrowdDynamicsLab/QV-paper


text:
package main

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

	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/require"
	"gopkg.in/yaml.v2"
)

func normalizeYAMLString(input string) string {
	return strings.Replace(strings.TrimSpace(input), "\t", "  ", -1)
}

func writeTempFile(content []byte) (*os.File, error) {
	file, err := ioutil.TempFile("", "layercake")

	if err != nil {
		return nil, err
	}

	defer file.Close()

	if _, err := file.Write(content); err != nil {
		return nil, err
	}

	return file, nil
}

func TestConfig_FindDependencies(t *testing.T) {
	config := Config{
		Build: map[string]BuildConfig{
			"foo": {
				Scripts: []BuildScript{
					{Raw: "RUN foo"},
					{Import: "a"},
					{Import: "b"},
					{Import: "a"},
				},
			},
		},
	}

	expected := NewStringSet()
	expected.Insert("a", "b")
	assert.Equal(t, expected, config.FindDependencies("foo"))
}

func TestConfig_FindDependants(t *testing.T) {
	config := Config{
		Build: map[string]BuildConfig{
			"a": {
				Scripts: []BuildScript{
					{Import: "foo"},
				},
			},
			"b": {
				Scripts: []BuildScript{
					{Import: "bar"},
				},
			},
			"c": {
				Scripts: []BuildScript{
					{Import: "foo"},
				},
			},
		},
	}

	expected := NewStringSet()
	expected.Insert("a", "c")
	assert.Equal(t, expected, config.FindDependants("foo"))
}

func TestConfig_SortBuilds(t *testing.T) {
	config := Config{
		Build: map[string]BuildConfig{
			"a": {
				Scripts: []BuildScript{
					{Import: "c"},
				},
			},
			"b": {
				Scripts: []BuildScript{
					{Import: "a"},
				},
			},
			"c": {},
		},
	}

	expected := NewOrderedStringSet()
	expected.Insert("c", "a", "b")
	assert.Equal(t, expected, config.SortBuilds())
}

func TestConfig_Validate(t *testing.T) {
	t.Run("Success", func(t *testing.T) {
		config := Config{
			Build: map[string]BuildConfig{
				"foo": {
					From: "busybox",
					Scripts: []BuildScript{
						{Import: "bar"},
					},
				},
				"bar": {
					From: "busybox",
				},
			},
		}

		assert.NoError(t, config.Validate())
	})

	t.Run("No base image", func(t *testing.T) {
		config := Config{
			Build: map[string]BuildConfig{
				"foo": {},
			},
		}

		assert.Error(t, config.Validate())
	})

	t.Run("Undefined import", func(t *testing.T) {
		config := Config{
			Build: map[string]BuildConfig{
				"foo": {
					From: "busybox",
					Scripts: []BuildScript{
						{Import: "bar"},
					},
				},
			},
		}

		assert.Error(t, config.Validate())
	})
}

func TestBuildConfig_Dockerfile(t *testing.T) {
	config := BuildConfig{
		From: "alpine",
		Scripts: []BuildScript{
			{Raw: "RUN foo"},
			{Instruction: "CMD", Value: "bar"},
		},
	}

	assert.Equal(t, strings.TrimSpace(`
FROM alpine
RUN foo
CMD bar
`), config.Dockerfile())
}

func TestBuildConfig_FindImports(t *testing.T) {
	config := BuildConfig{
		Scripts: []BuildScript{
			{Raw: "RUN foo"},
			{Import: "a"},
			{Import: "b"},
			{Import: "a"},
		},
	}

	expected := NewStringSet()
	expected.Insert("a", "b")
	assert.Equal(t, expected, config.FindImports())
}

func TestBuildScript_Dockerfile(t *testing.T) {
	t.Run("Raw", func(t *testing.T) {
		script := BuildScript{Raw: "RUN foo"}
		assert.Equal(t, script.Raw, script.Dockerfile())
	})

	t.Run("Import", func(t *testing.T) {
		script := BuildScript{Import: "foo"}
		assert.Equal(t, fmt.Sprintf("ADD %s/%s.tar /", layercakeBaseDir, script.Import), script.Dockerfile())
	})

	t.Run("Instruction", func(t *testing.T) {
		script := BuildScript{Instruction: "RUN", Value: "bar"}
		assert.Equal(t, "RUN bar", script.Dockerfile())
	})
}

func TestBuildScript_UnmarshalYAML(t *testing.T) {
	tests := []struct {
		Name     string
		Input    string
		Expected BuildScript
	}{
		{
			Name:     "string",
			Input:    "RUN foo",
			Expected: BuildScript{Raw: "RUN foo"},
		},
		{
			Name:     "Import",
			Input:    "import: foo",
			Expected: BuildScript{Import: "foo"},
		},
		{
			Name:     "Instruction: string",
			Input:    "run: foo",
			Expected: BuildScript{Instruction: "RUN", Value: "foo"},
		},
		{
			Name:     "Instruction: int",
			Input:    "expose: 80",
			Expected: BuildScript{Instruction: "EXPOSE", Value: "80"},
		},
		{
			Name:     "Instruction: float",
			Input:    "run: 3.14",
			Expected: BuildScript{Instruction: "RUN", Value: "3.14"},
		},
		{
			Name:     "Instruction: array",
			Input:    "cmd: ['echo', 'hello', 'world']",
			Expected: BuildScript{Instruction: "CMD", Value: `["echo","hello","world"]`},
		},
		{
			Name:     "Instruction: bool",
			Input:    "run: true",
			Expected: BuildScript{Instruction: "RUN", Value: "true"},
		},
		{
			Name: "Instruction: map",
			Input: normalizeYAMLString(`
env:
	a: b
	c: d
`),
			Expected: BuildScript{Instruction: "ENV", Value: `a="b" c="d"`},
		},
	}

	for _, test := range tests {
		test := test

		t.Run(test.Name, func(t *testing.T) {
			var actual BuildScript
			err := yaml.Unmarshal([]byte(test.Input), &actual)
			require.NoError(t, err)
			assert.Equal(t, test.Expected, actual)
		})
	}
}

func TestLoadConfig(t *testing.T) {
	t.Run("Success", func(t *testing.T) {
		config, err := LoadConfig([]byte(normalizeYAMLString(`
build:
	foo:
		from: alpine
		tags:
			- foo-alpine
`)))

		require.NoError(t, err)
		assert.Equal(t, &Config{
			Build: map[string]BuildConfig{
				"foo": {
					From: "alpine",
					Tags: []string{"foo-alpine"},
				},
			},
		}, config)
	})

	t.Run("Error", func(t *testing.T) {
		config, err := LoadConfig([]byte("build: 123"))

		assert.Error(t, err)
		assert.Nil(t, config)
	})
}

func TestLoadConfigFile(t *testing.T) {
	t.Run("Success", func(t *testing.T) {
		file, err := writeTempFile([]byte(normalizeYAMLString(`
build:
	foo:
		from: alpine
		tags:
			- foo-alpine
`)))
		require.NoError(t, err)
		defer os.Remove(file.Name())

		config, err := LoadConfigFile(file.Name())
		require.NoError(t, err)
		assert.Equal(t, &Config{
			Build: map[string]BuildConfig{
				"foo": {
					From: "alpine",
					Tags: []string{"foo-alpine"},
				},
			},
		}, config)
	})

	t.Run("Error", func(t *testing.T) {
		config, err := LoadConfigFile("foo")
		assert.Error(t, err)
		assert.Nil(t, config)
	})
}

func TestInitConfig(t *testing.T) {
	content := []byte(normalizeYAMLString(`
build:
	foo:
		from: alpine
		tags:
			- foo-alpine
`))
	expected := &Config{
		Build: map[string]BuildConfig{
			"foo": {
				From: "alpine",
				Tags: []string{"foo-alpine"},
			},
		},
	}

	t.Run("Specified config path", func(t *testing.T) {
		t.Run("Success", func(t *testing.T) {
			file, err := writeTempFile(content)
			require.NoError(t, err)
			defer os.Remove(file.Name())

			globalOptions.Config = file.Name()
			actual, err := InitConfig()
			require.NoError(t, err)
			assert.Equal(t, expected, actual)
		})

		t.Run("Not found", func(t *testing.T) {
			globalOptions.Config = "foo"
			actual, err := InitConfig()
			require.Error(t, err)
			assert.Nil(t, actual)
		})
	})

	t.Run("Default path", func(t *testing.T) {
		globalOptions.Config = ""

		for _, path := range defaultConfigPaths {
			path := path
			t.Run("Success: "+path, func(t *testing.T) {
				require.NoError(t, ioutil.WriteFile(path, content, os.ModePerm))
				defer os.Remove(path)

				actual, err := InitConfig()
				require.NoError(t, err)
				assert.Equal(t, expected, actual)
			})
		}

		t.Run("Parse failed", func(t *testing.T) {
			require.NoError(t, ioutil.WriteFile("layercake.yml", []byte("build: 123"), os.ModePerm))
			defer os.Remove("layercake.yml")

			actual, err := InitConfig()
			assert.Error(t, err)
			assert.Nil(t, actual)
		})

		t.Run("Not found", func(t *testing.T) {
			actual, err := InitConfig()
			assert.Equal(t, errNoConfigFound, err)
			assert.Nil(t, actual)
		})
	})
}

repository: zichenlbl/layercake

repo_name: zichenlbl/layercake


text:
package mite

import (
	"github.com/leanovate/mite-go/domain"
)

type projectResponse struct {
	Project struct {
		Id   int    `json:"id"`
		Name string `json:"name"`
		Note string `json:"note"`
	} `json:"project"`
}

func (r *projectResponse) toProject() *domain.Project {
	return &domain.Project{
		Id:   domain.NewProjectId(r.Project.Id),
		Name: r.Project.Name,
		Note: r.Project.Note,
	}
}

func (a *api) Projects() ([]*domain.Project, error) {
	var prs []projectResponse
	err := a.get("/projects.json", nil, &prs)
	if err != nil {
		return nil, err
	}

	var projects []*domain.Project
	for _, pr := range prs {
		projects = append(projects, pr.toProject())
	}

	return projects, nil
}


text:
package schemas

import (
	"context"

	"github.com/eddycharly/terraform-provider-kops/pkg/api/resources"
	. "github.com/eddycharly/terraform-provider-kops/pkg/schemas"
	kopsschemas "github.com/eddycharly/terraform-provider-kops/pkg/schemas/kops"
	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
	"k8s.io/kops/pkg/apis/kops"
)

var _ = Schema

func DataSourceInstanceGroup() *schema.Resource {
	res := &schema.Resource{
		Schema: map[string]*schema.Schema{
			"role":                              ComputedString(),
			"image":                             ComputedString(),
			"min_size":                          ComputedInt(),
			"max_size":                          ComputedInt(),
			"autoscale":                         ComputedBool(),
			"machine_type":                      ComputedString(),
			"root_volume_size":                  ComputedInt(),
			"root_volume_type":                  ComputedString(),
			"root_volume_iops":                  ComputedInt(),
			"root_volume_throughput":            ComputedInt(),
			"root_volume_optimization":          ComputedBool(),
			"root_volume_delete_on_termination": ComputedBool(),
			"root_volume_encryption":            ComputedBool(),
			"root_volume_encryption_key":        ComputedString(),
			"volumes":                           ComputedList(kopsschemas.DataSourceVolumeSpec()),
			"volume_mounts":                     ComputedList(kopsschemas.DataSourceVolumeMountSpec()),
			"subnets":                           ComputedList(String()),
			"zones":                             ComputedList(String()),
			"hooks":                             ComputedList(kopsschemas.DataSourceHookSpec()),
			"max_price":                         ComputedString(),
			"spot_duration_in_minutes":          ComputedInt(),
			"cpu_credits":                       ComputedString(),
			"associate_public_ip":               ComputedBool(),
			"additional_security_groups":        ComputedList(String()),
			"cloud_labels":                      ComputedMap(String()),
			"node_labels":                       ComputedMap(String()),
			"file_assets":                       ComputedList(kopsschemas.DataSourceFileAssetSpec()),
			"tenancy":                           ComputedString(),
			"kubelet":                           ComputedStruct(kopsschemas.DataSourceKubeletConfigSpec()),
			"taints":                            ComputedList(String()),
			"mixed_instances_policy":            ComputedStruct(kopsschemas.DataSourceMixedInstancesPolicySpec()),
			"additional_user_data":              ComputedList(kopsschemas.DataSourceUserData()),
			"suspend_processes":                 ComputedList(String()),
			"external_load_balancers":           ComputedList(kopsschemas.DataSourceLoadBalancer()),
			"detailed_instance_monitoring":      ComputedBool(),
			"iam":                               ComputedStruct(kopsschemas.DataSourceIAMProfileSpec()),
			"security_group_override":           ComputedString(),
			"instance_protection":               ComputedBool(),
			"sysctl_parameters":                 ComputedList(String()),
			"rolling_update":                    ComputedStruct(kopsschemas.DataSourceRollingUpdate()),
			"instance_interruption_behavior":    ComputedString(),
			"compress_user_data":                ComputedBool(),
			"instance_metadata":                 ComputedStruct(kopsschemas.DataSourceInstanceMetadataOptions()),
			"update_policy":                     ComputedString(),
			"warm_pool":                         ComputedStruct(kopsschemas.DataSourceWarmPoolSpec()),
			"cluster_name":                      RequiredString(),
			"name":                              RequiredString(),
		},
	}
	res.SchemaVersion = 2
	res.StateUpgraders = []schema.StateUpgrader{
		{
			Type: res.CoreConfigSchema().ImpliedType(),
			Upgrade: func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
				ret := FlattenDataSourceInstanceGroup(ExpandDataSourceInstanceGroup(rawState))
				ret["id"] = rawState["id"]
				return ret, nil
			},
			Version: 0,
		}, {
			Type: res.CoreConfigSchema().ImpliedType(),
			Upgrade: func(ctx context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) {
				ret := FlattenDataSourceInstanceGroup(ExpandDataSourceInstanceGroup(rawState))
				ret["id"] = rawState["id"]
				return ret, nil
			},
			Version: 1,
		},
	}
	return res
}

func ExpandDataSourceInstanceGroup(in map[string]interface{}) resources.InstanceGroup {
	if in == nil {
		panic("expand InstanceGroup failure, in is nil")
	}
	return resources.InstanceGroup{
		InstanceGroupSpec: func(in interface{}) kops.InstanceGroupSpec {
			return kopsschemas.ExpandDataSourceInstanceGroupSpec(in.(map[string]interface{}))
		}(in),
		ClusterName: func(in interface{}) string {
			return string(ExpandString(in))
		}(in["cluster_name"]),
		Name: func(in interface{}) string {
			return string(ExpandString(in))
		}(in["name"]),
	}
}

func FlattenDataSourceInstanceGroupInto(in resources.InstanceGroup, out map[string]interface{}) {
	kopsschemas.FlattenDataSourceInstanceGroupSpecInto(in.InstanceGroupSpec, out)
	out["cluster_name"] = func(in string) interface{} {
		return FlattenString(string(in))
	}(in.ClusterName)
	out["name"] = func(in string) interface{} {
		return FlattenString(string(in))
	}(in.Name)
}

func FlattenDataSourceInstanceGroup(in resources.InstanceGroup) map[string]interface{} {
	out := map[string]interface{}{}
	FlattenDataSourceInstanceGroupInto(in, out)
	return out
}

repository: mirdhyn/terraform-provider-kops

repo_name: mirdhyn/terraform-provider-kops

branch_name: refs/heads/main


text:
SUMMARY = ""
LICENSE = "GPL"
LIC_FILES_CHKSUM = "file://LICENSE;md5=228348db49a2c1d1f4acf2afaea3c2a0"

DEPENDS = " projucer-native juce-native jucer2cmake-native freetype libx11 xext xinerama gtk+3 webkitgtk alsa-lib "

SRCREV = "master"
SRC_URI = "git://github.com/Tracktion/tracktion_engine.git"

S = "${WORKDIR}/git"

inherit cmake

EXTRA_OECMAKE_append = " \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX="${D}/${bindir}" \
    -DCMAKE_VERBOSE_MAKEFILE=TRUE \
    -DJUCE_ROOT=${STAGING_DATADIR_NATIVE}/juce \
    "

do_patch() {

    ${STAGING_BINDIR_NATIVE}/Projucer \
        --create-project-from-pip \
        ${S}/examples/TestRunner.h \
        ${S}/examples/projects \
        ${S}/juce/modules \
        ${S}/modules

    ${STAGING_BINDIR_NATIVE}/Projucer \
        --resave \
        ${S}/examples/projects/TestRunner/TestRunner.jucer

    ${STAGING_BINDIR_NATIVE}/jucer2cmake \
        -i ${S}/TestRunner.jucer -o ${S}
}

do_install() {
    install -d ${D}${bindir}
    install -m 755 TestRunner ${D}${bindir}
}

FILES_${PN} = "${bindir}/TestRunner"

repository: jwinarske/meta-juce

repo_name: jwinarske/meta-juce


text:
/*
 * Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <LibJS/Heap/GCPtr.h>
#include <LibJS/Heap/Handle.h>
#include <LibWeb/Forward.h>

namespace Web::DOM {

WebIDL::ExceptionOr<JS::NonnullGCPtr<Node>> convert_nodes_to_single_node(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes, DOM::Document& document);

}

repository: SerenityOS/serenity

repo_name: SerenityOS/serenity

extension: h


text:
package gen4go

var tpl4go = `

{{define "enum"}} {{$Enum := title .Name}}

//{{$Enum}} type define -- generate by gsc
type {{$Enum}} {{enumType .}}

//enum {{$Enum}} constants -- generate by gsc
const (
    {{range .Constants}}
    {{$Enum}}{{title .Name}} {{$Enum}} = {{.Value}}
    {{end}}
)

//Write{{$Enum}} write enum to output stream
func Write{{$Enum}}(writer gorpc.Writer, val {{$Enum}}) error{
    return {{if enumSize . | eq 4}} gorpc.WriteUInt32(writer,uint32(val)) {{else}} gorpc.WriteByte(writer,byte(val)) {{end}}
}

//Read{{$Enum}} write enum to output stream
func Read{{$Enum}}(reader gorpc.Reader)({{$Enum}}, error){
    val,err := {{if enumSize . | eq 4}} gorpc.ReadUInt32(reader) {{else}} gorpc.ReadByte(reader) {{end}}
    return {{$Enum}}(val),err
}

//String implement Stringer interface
func (val {{$Enum}}) String() string {
    switch val {
        {{range .Constants}}
        case {{.Value}}:
            return "{{$Enum}}.{{title .Name}}"
        {{end}}
    }
    return fmt.Sprintf("enum(Unknown(%d))",val)
}

{{end}}

{{define "table"}} {{$Table := title .Name}}

//{{$Table}} -- generate by gsc
type {{$Table}} struct {
    {{range .Fields}}
    {{title .Name}} {{typeName .Type}}
    {{end}}
}

{{if isException .}}
//Error implement error interface
func (e * {{$Table}}) Error() string {
    return "{{$Table}} error"
}
{{end}}

//New{{$Table}} create new struct object with default field val -- generate by gsc
func New{{$Table}}() *{{$Table}} {
    return &{{$Table}}{
        {{range .Fields}}
        {{title .Name}}: {{defaultVal .Type}},
        {{end}}
    }
}

{{if isPOD .}}
//Read{{$Table}} read {{$Table}} from input stream -- generate by gsc
func Read{{$Table}}(reader gorpc.Reader) (target *{{$Table}},err error) {
    target = New{{$Table}}()

    {{range .Fields}}

    {
        target.{{title .Name}},err = {{readType .Type}}(reader)

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

    return
}

//Write{{$Table}} write {{$Table}} to output stream -- generate by gsc
func Write{{$Table}}(writer gorpc.Writer,val *{{$Table}}) (err error) {

    {{range .Fields}}
    err = {{writeType .Type}}(writer,val.{{title .Name}})
    if err != nil {
        return
    }
    {{end}}
    return nil
}

{{else}}
//Read{{$Table}} read {{$Table}} from input stream -- generate by gsc
func Read{{$Table}}(reader gorpc.Reader) (target *{{$Table}},err error) {
    target = New{{$Table}}()

    var fields byte

    fields,err = gorpc.ReadByte(reader)

    if err != nil {
        return
    }

    {{range .Fields}}

    {
        var tag byte
        tag,err = gorpc.ReadByte(reader)

        if err != nil {
            return
        }

        if tag != byte(gorpc.TagSkip) {
            target.{{title .Name}},err = {{readType .Type}}(reader)

            if err != nil {
                return
            }
        }

        fields --

        if fields == 0 {
            return
        }
    }
    {{end}}

    for i :=0;i < int(fields); i ++ {

        var tag byte

        tag,err = gorpc.ReadByte(reader)

        if err != nil {
            return
        }

        if tag == byte(gorpc.TagSkip) {
            continue
        }

        gorpc.SkipRead(reader,gorpc.Tag(tag))
    }

    return
}

//Write{{$Table}} write {{$Table}} to output stream -- generate by gsc
func Write{{$Table}}(writer gorpc.Writer,val *{{$Table}}) (err error) {

    err = gorpc.WriteByte(writer,byte({{len .Fields}}))

    if err != nil {
        return
    }

    {{range .Fields}}
    gorpc.WriteByte(writer,byte({{tagValue .Type}}))
    err = {{writeType .Type}}(writer,val.{{title .Name}})
    if err != nil {
        return
    }
    {{end}}
    return nil
}
{{end}}

{{end}}

{{define "contract"}}{{$Contract := title .Name}}

//{{$Contract}} -- generate by gsc
type {{$Contract}} interface {
    {{range .Methods}}
    {{title .Name}}{{params .Params}}{{returnParam .Return}}
    {{end}}
}

const (
    NameOf{{$Contract}} = "{{.FullName}}"
)

//_{{$Contract}}Maker -- generate by gs2go
type _{{$Contract}}Maker struct {
    id            uint16          // service id
    impl          {{$Contract}}  // service implement
}
// Make{{$Contract}} -- generate by gs2go
func Make{{$Contract}}(id uint16,impl {{$Contract}}) (gorpc.Dispatcher){
    return &_{{$Contract}}Maker{
        id:      id,
        impl:    impl,
    }
}
// ID implement gorpc.Dispatcher
func (maker *_{{$Contract}}Maker) ID() uint16 {
    return maker.id
}

// ID implement gorpc.Dispatcher
func (maker *_{{$Contract}}Maker) String() string {
    return "{{.FullName}}"
}

// Dispatch implement gorpc.Dispatcher
func (maker *_{{$Contract}}Maker) Dispatch(call *gorpc.Request) (callReturn *gorpc.Response, err error) {

    defer func(){
        if e := recover(); e != nil {
            err = gserrors.New(e.(error))
        }
    }()

    traceflag := trace.Flag()

    if traceflag {
        traceRPC := trace.RPC(call.Trace,uint32(call.Service) << 16 | uint32(call.Method),call.Prev)

        traceRPC.Start()

        defer traceRPC.End()
    }

    switch call.Method {
    {{range .Methods}}{{$Name := title .Name}}
    case {{.ID}}:
        if len(call.Params) != {{.ParamsCount}} {
            err = gserrors.Newf(nil,"{{$Contract}}#{{$Name}} expect {{.ParamsCount}} params but got :%d",len(call.Params))
            return
        }

        {{range .Params}}
        var {{.Name}} {{typeName .Type}}
        {{.Name}},err = {{readType .Type}}(bytes.NewBuffer(call.Params[{{.ID}}].Content))
        if err != nil {
            err = gserrors.Newf(err,"read {{$Contract}}#{{$Name}} arg({{.Name}}) err")
            return
        }
        {{end}}

        callSite := &gorpc.CallSite {
            ID : uint32(call.Service) << 16 | uint32({{.ID}}),
            Trace : call.Trace,
        }

        {{if isAsync . | not }}{{if notVoid .Return}}
        var retval {{typeName .Return}}
        {{end}}{{end}}

        {{returnArgs .Return}} = maker.impl.{{$Name}}{{callArgs .Params}}

        {{if isAsync . | not }}
        if err != nil {

            {{if .Exceptions}}

            var buff bytes.Buffer

            id := int8(-1)

            switch err.(type) {
            {{range .Exceptions}}
            case {{typeName .Type}}:

                err = {{writeType .Type}}(&buff,err.({{typeName .Type}}))

                if err != nil {
                    return
                }

                id = {{.ID}}

            {{end}}
            default:
                return
            }

            callReturn = &gorpc.Response{
                ID : call.ID,
                Exception:id,
                Trace:call.Trace,
            }

            callReturn.Content = buff.Bytes()

            err = nil

            {{end}}

            return
        }

        {{if notVoid .Return}}

        var buff bytes.Buffer

        err = {{writeType .Return}}(&buff,retval)

        if err != nil {
            return
        }

        callReturn = &gorpc.Response{
            ID : call.ID,
            Exception:int8(-1),
            Trace:call.Trace,
        }

        callReturn.Content = buff.Bytes()

        {{else}}
        callReturn = &gorpc.Response{
            ID : call.ID,
            Exception:int8(-1),
            Trace:call.Trace,
        }
        {{end}}
        {{end}}

        return

    {{end}}
    }
    err = gserrors.Newf(nil,"unknown {{$Contract}}#%d method",call.Method)
    return
}

//_{{$Contract}}Binder the remote service proxy binder
type _{{$Contract}}Binder struct {
    id            uint16          // service id
    channel       gorpc.Channel   // contract bind channel
}
// Bind{{$Contract}} bind remote service and return remote service's proxy object
func Bind{{$Contract}}(id uint16,channel gorpc.Channel) {{$Contract}} {
    return &_{{$Contract}}Binder{id:id,channel:channel }
}

{{range .Methods}}
{{$Name := title .Name}}
//{{$Name}} -- generate by gsc
func (binder *_{{$Contract}}Binder){{$Name}}{{params .Params}}{{returnParam .Return}}{
    defer func(){
       if e := recover(); e != nil {
           err = gserrors.New(e.(error))
       }
    }()

    var traceID uint64
    var traceParentID uint32

    if trace.Flag() {
        if callSite != nil  {
            traceID = callSite.Trace
            traceParentID = callSite.ID
        } else {
            traceID = trace.NewTrace()
        }

        traceRPC := trace.RPC(traceID,uint32(binder.id) << 16 | uint32({{.ID}}),traceParentID)

        traceRPC.Start()

        defer traceRPC.End()
    }

    call := &gorpc.Request{
       Service:uint16(binder.id),
       Method:{{.ID}},
       Trace:traceID,
       Prev:traceParentID,
    }

    {{range .Params}}
    var param{{.ID}} bytes.Buffer
    err = {{writeType .Type}}(&param{{.ID}},{{.Name}})
    if err != nil {
        return
    }
    call.Params = append(call.Params,&gorpc.Param{Content:param{{.ID}}.Bytes()})
    {{end}}

    {{if isAsync .}}
    err = binder.channel.Post(call)
    return
    {{else}}
    var future gorpc.Future
    future, err = binder.channel.Send(call)
    if err != nil {
        return
    }

    var callReturn *gorpc.Response
    callReturn, err = future.Wait()
    if err != nil {
        return
    }

    //TODO: handler response callsite

    if callReturn.Exception != -1 {
        switch callReturn.Exception {
        {{range .Exceptions}}
        case {{.ID}}:
            var exception error
            exception,err = {{readType .Type}}(bytes.NewBuffer(callReturn.Content))

            if err != nil {
                err = gserrors.Newf(err,"read {{$Contract}}#{{$Name}} return")
            } else {
                err = exception
            }

            return
        {{end}}
        default:
            err = gserrors.Newf(gorpc.ErrRPC,"catch unknown exception(%d) for {{$Contract}}#{{$Name}}",callReturn.Exception)
            return
        }
    }

    {{if notVoid .Return}}
    retval,err = {{readType .Return}}(bytes.NewBuffer(callReturn.Content))

    if err != nil {
        err = gserrors.Newf(err,"read {{$Contract}}#{{$Name}} return")
        return
    }
    {{end}}
    {{end}}
    return
}
{{end}}

{{end}}

{{define "create_array"}}func() {{typeName .}} {

    var buff {{typeName .}}

    {{if builtin .Component}}
    {{else}}
    for i := uint16(0); i < {{.Size}}; i ++ {
        buff[i] = {{defaultVal .Component}}
    }
    {{end}}

    return buff
}(){{end}}

{{define "readList"}}func(reader gorpc.Reader)({{typeName .}},error) {
    length ,err := gorpc.ReadUInt16(reader)
    if err != nil {
        return nil,err
    }
    buff := make({{typeName .}},length)
    for i := uint16(0); i < length; i ++ {
        buff[i] ,err = {{readType .Component}}(reader)
        if err != nil {
            return buff,err
        }
    }
    return buff,nil
}{{end}}

{{define "readByteList"}}func(reader gorpc.Reader)({{typeName .}},error) {
    length ,err := gorpc.ReadUInt16(reader)
    if err != nil {
        return nil,err
    }
    if length == 0 {
        return nil,nil
    }
    buff := make({{typeName .}},length)
    err = gorpc.ReadBytes(reader,buff)
    return buff,err
}{{end}}

{{define "readArray"}}func(reader gorpc.Reader)({{typeName .}},error) {
    var buff {{typeName .}}

    length ,err := gorpc.ReadUInt16(reader)

    if err != nil {
        return buff,err
    }

    if length != {{.Size}} {
        return buff,gserrors.Newf(nil,"check array size failed")
    }

    for i := uint16(0); i < {{.Size}}; i ++ {
        buff[i] ,err = {{readType .Component}}(reader)
        if err != nil {
            return buff,err
        }
    }
    return buff,nil
}{{end}}

{{define "readByteArray"}}func(reader gorpc.Reader)({{typeName .}},error) {
    var buff {{typeName .}}

    length ,err := gorpc.ReadUInt16(reader)
    if err != nil {
        return buff,err
    }

    if length != {{.Size}} {
        return buff,gserrors.Newf(nil,"check array size failed")
    }

    if length == 0 {
        return buff,nil
    }

    err = gorpc.ReadBytes(reader,buff[:])
    return buff,err
}{{end}}

{{define "writeList"}}func(writer gorpc.Writer,val {{typeName .}})(error) {
    gorpc.WriteUInt16(writer,uint16(len(val)))
    for _,c:= range val {
        err := {{writeType .Component}}(writer,c)
        if err != nil {
            return err
        }
    }
    return nil
}{{end}}
{{define "writeByteList"}}func(writer gorpc.Writer,val {{typeName .}})(error) {
    err := gorpc.WriteUInt16(writer,uint16(len(val)))
    if err != nil {
        return err
    }
    if len(val) != 0 {
        return gorpc.WriteBytes(writer,val)
    }
    return nil
}{{end}}

{{define "writeArray"}}func(writer gorpc.Writer,val {{typeName .}})(error) {
    gorpc.WriteUInt16(writer,uint16(len(val)))
    for _,c:= range val {
        err := {{writeType .Component}}(writer,c)
        if err != nil {
            return err
        }
    }
    return nil
}{{end}}

{{define "writeByteArray"}}func(writer gorpc.Writer,val {{typeName .}})(error) {
    err := gorpc.WriteUInt16(writer,uint16(len(val)))
    if err != nil {
        return err
    }
    if len(val) != 0 {
        return gorpc.WriteBytes(writer,val[:])
    }
    return nil
}{{end}}

`

repository: gsrpc/gsrpc

repo_name: gsrpc/gsrpc