text:
% Data Science
@online{failures,
  title = {Learn from your analytics failures},
  author = {Michael Schrage},
  year = {2014},
  month = {September},
  url = {https://hbr.org/2014/09/learn-from-your-analytics-failures},
  urldate = {2016-12-16},
}

@online{understand,
  title = {Before You Can Manage Big Data, You Must First Understand It},
  author = {Greg Satell},
  url = {http://www.forbes.com/sites/gregsatell/2013/06/22/before-you-can-manage-big-data-you-must-first-understand-it},
  year = {2013},
  month = {June},
  urldate = {2016-12-16},
}

@online{pitfalls,
  title = {Hard Hats for Data Miners: Myths and Pitfalls of Data Mining},
  author = {Tom Khabaza},
  url = {http://www.spss.ch/upload/1113911601_data_mining_khabaza (3).pdf},
  year = {2005},
  urldate = {2016-12-16},
}

@online{onemillion,
  title = {Businesses Will Need One Million Data Scientists by 2018},
  author = {Anmol Rajpurohit},
  url = {http://www.kdnuggets.com/2016/01/businesses-need-one-million-data-scientists-2018.html},
  year = {2016},
  urldate = {2017-02-25},
}

@online{sexy,
  title = {Data Scientist: The Sexiest Job of the 21st Century},
  author = {Thomas H. Davenport and D.J. Patil},
  url = {https://hbr.org/2012/10/data-scientist-the-sexiest-job-of-the-21st-century},
  year = {2012},
  urldate = {2017-02-25},
}

@online{hunt,
  title = {The Hunt For Unicorn Data Scientists Lifts Salaries For All Data Analytics Professionals},
  author = {Gil Press},
  url = {https://www.forbes.com/sites/gilpress/2015/10/09/the-hunt-for-unicorn-data-scientists-lifts-salaries-for-all-data-analytics-professionals/#38147ccc5258},
  year = {2015},
  urldate = {2017-04-03},
}

@online{unicorn,
  title = {Data scientists: 'As rare as unicorns'},
  author = {Jeanne G. Harris and Ray Eitel-Porter},
  url = {https://www.theguardian.com/media-network/2015/feb/12/data-scientists-as-rare-as-unicorns},
  year = {2015},
  urldate = {2017-04-03},
}

@online{datasciencelang,
  title = {The Most Popular Language For Machine Learning and Data Science Is …},
  author = {Jean-Francois Puget},
  url = {http://www.kdnuggets.com/2017/01/most-popular-language-machine-learning-data-science.html},
  year = {2017},
  urldate = {2017-04-11},
}

@online{venn,
  title = {http://www.kdnuggets.com/2016/10/battle-data-science-venn-diagrams.html},
  author = {David Taylor},
  url = {http://www.kdnuggets.com/2016/10/battle-data-science-venn-diagrams.html},
  year = {2016},
  urldate = {2017-06-07},
}

% Data Visualization
@online{principles,
  title = {Data Visualization Principles: Lessons from Tufte},
  author = {Mike Pantoliano},
  url = {https://moz.com/blog/data-visualization-principles-lessons-from-tufte},
  year = {2012},
  month = {February},
  urldate = {2016-12-16},
}

@book{fry2007visualizing,
  title = {Visualizing data: Exploring and explaining data with the processing environment},
  author = {Fry, Ben},
  year = {2007},
  publisher = {"O'Reilly Media, Inc."},
}

% Machine Learning
@online{whosklearn,
  title = {Who is using scikit-learn?},
  author = {{scikit-learn}},
  url = {http://scikit-learn.org/stable/testimonials/testimonials.html},
  year = {2016},
  urldate = {2017-02-08},
}

@online{automatic,
  title = {Approaching (Almost) Any Machine Learning Problem},
  author = {Abhishek Thakur},
  url = {http://blog.kaggle.com/2016/07/21/approaching-almost-any-machine-learning-problem-abhishek-thakur/},
  year = {2016},
  urldate = {2017-01-30},
}

@article{scikitlearn,
  title = {Scikit-learn: Machine learning without learning the machinery},
  author = {Varoquaux, Ga{\"e}l and Buitinck, Lars and Louppe, Gilles and Grisel, Olivier and Pedregosa, Fabian and Mueller, Andreas},
  journal = {GetMobile: Mobile Computing and Communications},
  volume = {19},
  number = {1},
  pages = {29--33},
  year = {2015},
  publisher = {ACM}
}

@online{azureFAQ,
  title = {Azure Machine Learning frequently asked questions: Billing, capabilities, limitations, and support},
  author = {Gary Ericsson and Don Glover and Andre Price and Larry Franks},
  url = {https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-faq},
  year = {2017},
  urldate = {2017-04-11},
}

@book{barga2015predictive,
  title={Predictive analytics with Microsoft Azure machine learning},
  author={Barga, Roger and Fontama, Valentine and Tok, Wee Hyong and Cabrera-Cordon, Luis},
  year={2015},
  publisher={Springer}
}

@article{hughes1968mean,
  title={On the mean accuracy of statistical pattern recognizers},
  author={Hughes, Gordon},
  journal={IEEE transactions on information theory},
  volume={14},
  number={1},
  pages={55--63},
  year={1968},
  publisher={IEEE}
}

@online{mlcomparison,
  title = {A Look at Popular Machine Learning Frameworks},
  author = {Fintan Ryan},
  url = {http://redmonk.com/fryan/2016/06/06/a-look-at-popular-machine-learning-frameworks/},
  year = {2016},
  urldate = {2017-04-12},
}

% Visual Programming
@online{unbelievable,
  title = {Visual Programming Is Unbelievable… Here’s Why We Don’t Believe In It},
  author = {Tiago Simões},
  url = {https://www.outsystems.com/blog/visual-programming-is-unbelievable.html},
  year = {2015},
  urldate = {2017-02-11},
}

@inproceedings{plc,
  title = {Visual PLC-programming using signal interpreted Petri nets},
  author = {Minas, Mark and Frey, Georg},
  booktitle = {American Control Conference, 2002. Proceedings of the 2002},
  volume = {6},
  pages = {5019--5024},
  year = {2002},
  organization = {IEEE},
}

@online{musicprogramming,
  title = {The 14 pieces of software that shaped modern music},
	author = {John Twells},
	url = {http://www.factmag.com/2016/10/01/the-14-pieces-of-software-that-shaped-modern-music/},
	year = {2016},
	urldate = {2017-02-21},
}

@online{2003DalkeVisualProgramming,
  title = {Visual dataflow programming},
  author = {Andrew Dalke},
  url = {http://www.dalkescientific.com/writings/diary/archive/2003/09/22/VisualProgramming.html},
  year = {2003},
  urldate = {2017-02-21},
}

@book{shah2014mastering,
  title = {Mastering the Art of Unreal Engine 4-Blueprints},
  author = {Shah, Ryan},
  year = {2014},
  publisher = {Lulu.com},
}

@book{shu1988visual,
  title={Visual programming},
  author={Shu, Nan C},
  year={1988},
  publisher={Van Nostrand Reinhold New York}
}

@article{weka,
  title={The WEKA data mining software: an update},
  author={Hall, Mark and Frank, Eibe and Holmes, Geoffrey and Pfahringer, Bernhard and Reutemann, Peter and Witten, Ian H},
  journal={ACM SIGKDD explorations newsletter},
  volume={11},
  number={1},
  pages={10--18},
  year={2009},
  publisher={ACM}
}

% Dataflow Programming
@article{bell,
  title = {A block diagram compiler},
  author = {Kelly, John L and Lochbaum, Carol and Vyssotsky, Victor A},
  journal = {Bell System Technical Journal},
  volume = {40},
  number = {3},
  pages = {669--676},
  year = {1961},
  publisher = {Wiley Online Library},
}

@inproceedings{sousa2012dataflow,
  title={Dataflow programming concept, languages and applications},
  author={Sousa, Tiago Boldt},
  booktitle={Doctoral Symposium on Informatics Engineering},
  volume={130},
  year={2012}
}

% Pandoc, LaTeX and friends
@online{emerald,
  title = {emerald-harvard.csl},
  author = {Sebastian Karcher},
  url = {https://github.com/citation-style-language/styles/blob/master/emerald-harvard.csl},
  year = {2015},
  urldate = {2016-12-16},
}

@online{pgfgantt,
  title = {A LaTeX package for drawing gantt plots using pgf},
  author = {Wolfgang Skala},
  year = {2011},
  url = {https://www.ctan.org/pkg/pgfgantt},
  urldate = {2016-12-16},
}

@online{pandoc,
  title = {Pandoc: a universal document converter},
  author = {John MacFarlane},
  year = {2006},
  url = {https://ww.pandoc.org},
  urldate = {2016-12-16},
}

% Functional programming
@article{backus1978can,
  title={Can programming be liberated from the von Neumann style?: a functional style and its algebra of programs},
  author={Backus, John},
  journal={Communications of the ACM},
  volume={21},
  number={8},
  pages={613--641},
  year={1978},
  publisher={ACM}
}

@article{mcbride2008applicative,
  title={Applicative programming with effects},
  author={McBride, Conor and Paterson, Ross},
  journal={Journal of functional programming},
  volume={18},
  number={01},
  pages={1--13},
  year={2008},
  publisher={Cambridge Univ Press}
}

@inproceedings{launchbury1993natural,
  title={A natural semantics for lazy evaluation},
  author={Launchbury, John},
  booktitle={Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages},
  pages={144--154},
  year={1993},
  organization={ACM}
}

@inproceedings{ennals2003optimistic,
  title={Optimistic evaluation: an adaptive evaluation strategy for non-strict programs},
  author={Ennals, Robert and Jones, Simon Peyton},
  booktitle={ACM Sigplan Notices},
  volume={38},
  number={9},
  pages={287--298},
  year={2003},
  organization={ACM}
}

% Development methodologies
@article{selic2003pragmatics,
  title={The pragmatics of model-driven development},
  author={Selic, Bran},
  journal={IEEE software},
  volume={20},
  number={5},
  pages={19--25},
  year={2003},
  publisher={IEEE}
}

@inproceedings{petersen2009waterfall,
  title={The waterfall model in large-scale development},
  author={Petersen, Kai and Wohlin, Claes and Baca, Dejan},
  booktitle={International Conference on Product-Focused Software Process Improvement},
  pages={386--400},
  year={2009},
  organization={Springer}
}

@article{beck2001manifesto,
  title={Manifesto for agile software development},
  author={Beck, Kent and Beedle, Mike and Van Bennekum, Arie and Cockburn, Alistair and Cunningham, Ward and Fowler, Martin and Grenning, James and Highsmith, Jim and Hunt, Andrew and Jeffries, Ron and others},
  year={2001}
}

@article{zmud1980management,
  title={Management of large software development efforts},
  author={Zmud, Robert W},
  journal={MIS quarterly},
  pages={45--55},
  year={1980},
  publisher={JSTOR}
}

@book{schwaber2002agile,
  title={Agile software development with Scrum},
  author={Schwaber, Ken and Beedle, Mike},
  volume={1},
  year={2002},
  publisher={Prentice Hall Upper Saddle River}
}

% Risk Analysis
@article{boehm1991software,
  title={Software risk management: principles and practices},
  author={Boehm, Barry W},
  journal={IEEE software},
  volume={8},
  number={1},
  pages={32--41},
  year={1991},
  publisher={IEEE}
}

% User Experience
@article{brooke1996sus,
  title={SUS-A quick and dirty usability scale},
  author={Brooke, John and others},
  journal={Usability evaluation in industry},
  volume={189},
  number={194},
  pages={4--7},
  year={1996},
  publisher={London, United kingdom}
}

@article{sauro201210,
  title={10 things to know about the Single Ease Question (SEQ)},
  author={Sauro, J},
  journal={Measuring U, 2012},
  year={2012}
}

@inproceedings{sauro2009comparison,
  title={Comparison of three one-question, post-task usability questionnaires},
  author={Sauro, Jeff and Dumas, Joseph S},
  booktitle={Proceedings of the SIGCHI Conference on Human Factors in Computing Systems},
  pages={1599--1608},
  year={2009},
  organization={ACM}
}

@misc{stanivcekpaletton,
  title={Paletton. com (aka Color Scheme Designer 4)},
  author={Stan{\'\i}{\v{c}}ek, Petr}
}

% Deep Learning
@online{dlmature,
  title = {PowerAI: Looking back on a year of Deep Learning innovation - and into the future},
  author = {Michael Gschwind},
  url = {https://www.ibm.com/developerworks/community/blogs/fe313521-2e95-46f2-817d-44a4f27eba32/entry/PowerAI_Looking_back_on_a_year_of_Deep_Learning_innovation_and_into_the_future?lang=en},
  year = {2017},
  urldate = {2017-04-12},
}

@article{abadi2016tensorflow,
  title={Tensorflow: Large-scale machine learning on heterogeneous distributed systems},
  author={Abadi, Mart{\'\i}n and Agarwal, Ashish and Barham, Paul and Brevdo, Eugene and Chen, Zhifeng and Citro, Craig and Corrado, Greg S and Davis, Andy and Dean, Jeffrey and Devin, Matthieu and others},
  journal={arXiv preprint arXiv:1603.04467},
  year={2016}
}

% Python
@article{numpy,
  title={The NumPy array: a structure for efficient numerical computation},
  author={Walt, St{\'e}fan van der and Colbert, S Chris and Varoquaux, Gael},
  journal={Computing in Science \& Engineering},
  volume={13},
  number={2},
  pages={22--30},
  year={2011},
  publisher={IEEE}
}

@article{scipy,
  title={SciPy: open source scientific tools for Python},
  author={Jones, Eric and Oliphant, Travis and Peterson, Pearu},
  year={2014}
}

@inproceedings{pandas,
  title={Data structures for statistical computing in python},
  author={McKinney, Wes and others},
  booktitle={Proceedings of the 9th Python in Science Conference},
  volume={445},
  pages={51--56},
  year={2010},
  organization={van der Voort S, Millman J}
}

@book{biancuzzi2009masterminds,
  title={Masterminds of programming: Conversations with the creators of major programming languages},
  author={Biancuzzi, Federico and others},
  year={2009},
  publisher={" O'Reilly Media, Inc."}
}

@online{pep483,
  title = {PEP 483 -- The Theory of Type Hints},
  author = {Guido van Rossum and Ivan Levkivskyi},
  url = {https://www.python.org/dev/peps/pep-0483/},
  year = {2014},
  urldate = {2017-04-20},
}

@online{pep484,
  title = {PEP 484 -- Type Hints},
  author = {Guido van Rossum and Jukka Lehtosalo and Łukasz Langa},
  url = {https://www.python.org/dev/peps/pep-0484/},
  year = {2014},
  urldate = {2017-04-20},
}

% Theoretical compsci
@book{madsen1990strong,
  title={Strong typing of object-oriented languages revisited},
  author={Madsen, Ole Lehrmann and Magnusson, Boris and M{\o}lier-Pedersen, Birger},
  volume={25},
  number={10},
  year={1990},
  publisher={ACM}
}

% git
@online{featworkflow,
  title = {Feature Branch Workflow},
  author = {Atlassian},
  url = {https://www.atlassian.com/git/tutorials/comparing-workflows#feature-branch-workflow},
  year = {2014},
  urldate = {2017-04-22},
}

repository: awthomp/whitewater

repo_name: awthomp/whitewater


text:
package fakes

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

	"github.com/google/go-containerregistry/pkg/v1/tarball"

	"github.com/buildpacks/pack/pkg/buildpack"
	"github.com/buildpacks/pack/pkg/dist"
)

type Package interface {
	Name() string
	BuildpackLayers() dist.ModuleLayers
	GetLayer(diffID string) (io.ReadCloser, error)
}

var _ Package = (*fakePackage)(nil)

type fakePackage struct {
	name       string
	bpTarFiles map[string]string
	bpLayers   dist.ModuleLayers
}

func NewPackage(tmpDir string, name string, buildpacks []buildpack.BuildModule) (Package, error) {
	processBuildpack := func(bp buildpack.BuildModule) (tarFile string, diffID string, err error) {
		tarFile, err = buildpack.ToLayerTar(tmpDir, bp)
		if err != nil {
			return "", "", err
		}

		layer, err := tarball.LayerFromFile(tarFile)
		if err != nil {
			return "", "", err
		}

		hash, err := layer.DiffID()
		if err != nil {
			return "", "", err
		}

		return tarFile, hash.String(), nil
	}

	bpLayers := dist.ModuleLayers{}
	bpTarFiles := map[string]string{}
	for _, bp := range buildpacks {
		tarFile, diffID, err := processBuildpack(bp)
		if err != nil {
			return nil, err
		}
		bpTarFiles[diffID] = tarFile
		dist.AddToLayersMD(bpLayers, bp.Descriptor(), diffID)
	}

	return &fakePackage{
		name:       name,
		bpTarFiles: bpTarFiles,
		bpLayers:   bpLayers,
	}, nil
}

func (f *fakePackage) Name() string {
	return f.name
}

func (f *fakePackage) BuildpackLayers() dist.ModuleLayers {
	return f.bpLayers
}

func (f *fakePackage) GetLayer(diffID string) (io.ReadCloser, error) {
	tarFile, ok := f.bpTarFiles[diffID]
	if !ok {
		return nil, errors.New("no layer found")
	}

	return os.Open(filepath.Clean(tarFile))
}

repository: buildpacks/pack

license_type: permissive

repo_name: buildpacks/pack

branch_name: refs/heads/main

gha_language: Go

extension: go


text:
package main

import(
	"log"
	"os"
	"os/exec"
	"syscall"
)

//IPC Namespace 用来隔离System V IPC 和POSIX message quques。每一个IPC Namespace
//都有自己的System V IPC 和 POSIX message queue
//System V 引用了三种高级进程间的通信机制:消息队列，共享内存和信号量
//IPC对象(消息队列,共享内存和信号量)存在于内核中而不是文件系统中，由用户控制释放，不像管道的释放又
//由内核控制IPC对象通过其标识符引用和访问，所有IPC对象内核空间有唯一性的标志ID，在用户空间的唯一性标志位key
//LINUX IPC 继承自 System IPC

//REF :https://blog.csdn.net/qq_38211852/article/details/80475818
func main(){

	cmd := exec.Command("sh")
	cmd.SysProcAttr = &syscall.SysProcAttr{
		Cloneflags: syscall.CLONE_NEWUTS | syscanll.CLONE_NEWIPC,
	}
	cmd.Stdin = os.Stdin
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr

	if err := cmd.Run(); err !=  nil{
		log.Fatal(err)
	}

}

license: MIT

repository: withlin/micro-docker

repo_name: withlin/micro-docker

branch_name: refs/heads/master


text:
@inproceedings{GopiKKNWZ20,
 author = {Gopi, Sivakanth and Kamath, Gautam and Kulkarni, Janardhan and Nikolov, Aleksandar and Wu, Zhiwei Steven and Zhang, Huanyu},
 booktitle = {Proceedings of the 33rd Annual Conference on Learning Theory},
 month = {July},
 series = {COLT '20},
 title = {Locally Private Hypothesis Selection},
 url = {https://arxiv.org/abs/2002.09465},
 year = {2020}
}

repository: TheSalon/academic-kickstart

repo_name: TheSalon/academic-kickstart

extension: bib


text:
@article{art_apj07l,
 author = {R. Soummer and A. Ferrari},
 journal = {The Astrophysical Journal Letters},
 number = {1},
 pages = {642--656},
 title = {Strehl ratio estimation and statistics in adaptive optics
images},
 volume = {669},
 year = {2007}
}

repository: andferrari/academic-kickstart

repo_name: andferrari/academic-kickstart

gha_license_id: MIT


text:
.navbar{
		background-color:#2c3e50;
		}

		.nav{
		color:white;
		}

	body
{
padding-top:70px;
}

.jumbotron
{
color:#2c3250;
background-color:#ecf0f1;
}
.navbar-inverse .navbar-nav>li>a
{
	color:white;
}

.navbar-inverse .navbar-brand
{
	color:white;
}

extension: css


text:
package main

import (
	"runtime"
	"fmt"
	"flag"
	"time"
	"github.com/sanjiOP/goodjob/worker"
)

var (
	confFile string
)

// 初始化命令行参数
func initArgs(){

	// ./worker -config ./worker.json
	flag.StringVar(&confFile,"config","./worker.json","指定worker.json")
	flag.Parse()

}

// 初始化环境信息
func initEnv(){
	// 定义线程数量跟cpu数量一致
	runtime.GOMAXPROCS(runtime.NumCPU())
}

//
func main(){

	var(
		err error
	)

	// 1 初始化命令行参数
	initArgs()

	// 2 初始化环境
	initEnv()

	// 3 初始化配置
	if err = worker.InitConfig(confFile); err != nil{
		goto ERR
	}

	// 4 启动日志协程
	if err = worker.InitLogSink();err != nil{
		goto ERR
	}

	// 5 服务注册
	if err = worker.InitRegister();err != nil{
		goto ERR
	}

	// 6 启动执行器
	if err = worker.InitExecutor();err != nil{
		goto ERR
	}

	// 7 启动调度器
	if err = worker.InitScheduler();err != nil{
		goto ERR
	}

	// 8 任务管理器
	if err = worker.InitJobManage();err != nil{
		goto ERR
	}

	for{
		time.Sleep(1 * time.Second)
	}

	return
ERR:
	fmt.Println(err)
}

repository: sanjiOP/goodjob

repo_name: sanjiOP/goodjob


text:
DESCRIPTION = "NVIDIA Fan Control"
L4T_DEB_COPYRIGHT_MD5 = "0131b26a89a8fbf5ca06d10b85ba2540"

L4T_DEB_TRANSLATED_BPN = "nvidia-l4t-nvfancontrol"
DEPENDS = "tegra-nvpower"

require tegra-debian-libraries-common.inc

MAINSUM = "6e5f9d85c47b76e7a3753d82e24fc461cebd2d309fbdfe9ed946f98d5f759642"

SRC_URI += "\
   file://nvfancontrol.init \
   file://nvfancontrol.service \
"

do_install() {
    install -d ${D}${sbindir}
    install -m 0755 ${B}/usr/sbin/nvfancontrol ${D}${sbindir}/
    install -d ${D}${sysconfdir}/init.d
    install -m 0644 ${B}/etc/nvpower/nvfancontrol/${NVFANCONTROL}.conf ${D}${sysconfdir}/nvfancontrol.conf
    install -m 0755 ${WORKDIR}/nvfancontrol.init ${D}${sysconfdir}/init.d/nvfancontrol
    install -d ${D}${systemd_system_unitdir}
    install -m 0644 ${WORKDIR}/nvfancontrol.service ${D}${systemd_system_unitdir}/
}

inherit systemd update-rc.d

INITSCRIPT_NAME = "nvfancontrol"
INITSCRIPT_PARAMS = "defaults"
SYSTEMD_SERVICE:${PN} = "nvfancontrol.service"
RDEPENDS:${PN} = "bash tegra-nvpower tegra-nvpmodel"
PACKAGE_ARCH = "${MACHINE_ARCH}"

repository: SOL-Space-Operating-Linux/meta-tegra

repo_name: SOL-Space-Operating-Linux/meta-tegra

gha_language: BitBake

extension: bb


text:
@MISC{BeOlSc2011,
    author = "Bell, W. N. and Olson, L. N. and Schroder, J. B.",
    title = "{PyAMG}: Algebraic Multigrid Solvers in {Python} v2.0",
    year = "2011",
    url = "http://www.pyamg.org",
    note = "Release 2.0"
}

repository: pyamg/pyamg

repo_name: pyamg/pyamg

gha_language: Python


text:
package server

import (
	"github.com/gocraft/web"
	"gopkg.in/pfnet/jasco.v1"
	"gopkg.in/sensorbee/sensorbee.v0/core"
	"gopkg.in/sensorbee/sensorbee.v0/server/response"
	"net/http"
)

type sources struct {
	*topologies
	src core.SourceNode
}

func setUpSourcesRouter(prefix string, router *web.Router) {
	root := router.Subrouter(sources{}, "/:topologyName/sources")
	root.Middleware((*sources).fetchSource)
	root.Get("/", (*sources).Index)
	root.Get("/:sourceName", (*sources).Show)
}

func (sc *sources) fetchSource(rw web.ResponseWriter, req *web.Request, next web.NextMiddlewareFunc) {
	tb := sc.fetchTopology()
	if tb == nil {
		return
	}

	if srcName := sc.PathParams().String("sourceName", ""); srcName != "" {
		src, err := tb.Topology().Source(srcName)
		if err != nil {
			sc.ErrLog(err).Error("Cannot find the source")
			sc.RenderError(jasco.NewError(requestResourceNotFoundErrorCode,
				"The source was not found", http.StatusNotFound, err))
			return
		}
		sc.src = src
		sc.AddLogField("node_type", core.NTSource.String())
		sc.AddLogField("node_name", src.Name())
	}
	next(rw, req)
}

func (sc *sources) Index(rw web.ResponseWriter, req *web.Request) {
	// TODO: support pagination

	srcs := sc.topology.Topology().Sources()
	res := make([]*response.Source, 0, len(srcs))
	for _, s := range srcs {
		res = append(res, response.NewSource(s, false))
	}
	sc.Render(map[string]interface{}{
		"topology": sc.topologyName,
		"count":    len(res),
		"sources":  res,
	})
}

func (sc *sources) Show(rw web.ResponseWriter, req *web.Request) {
	sc.Render(map[string]interface{}{
		"topology": sc.topologyName,
		"source":   response.NewSource(sc.src, true),
	})
}

// TODO: Support Update(e.g. pause/resume) and Destroy if necessary. They can be
// done by queries.

repository: mitghi/sensorbee

repo_name: mitghi/sensorbee


text:
DESCRIPTION = "weather-click"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
PR = "r0"

SRC_URI = "https://libstock.mikroe.com/projects/download/2142/5369/1502734257_weather_click_other_arm.zip "

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

do_compile() {
        oe_runmake
}

do_install() {
        install -d ${D}${bindir}
        install -m 0755 ${S}/${PN} ${D}${bindir}
}

SRC_URI[md5sum] = "3590870177d25963fc4ccc13cee89100"
SRC_URI[sha256sum] = "6ab814f6bb5a5e9de6552daea4b0c0fe04b67756cdc5e76d8342c7828502b309"

# Avoid QA Issue: No GNU_HASH in the elf binary
INSANE_SKIP_${PN} = "ldflags"


text:
find_path(Hiredis_INCLUDE_DIRS
  NAMES hiredis/hiredis.h
  DOC "Hiredis include dir"
  PATH_SUFFIXES hiredis/include)

find_library(Hiredis_LIBRARIES NAMES hiredis DOC "Hiredis library" PATH_SUFFIXES hiredis/lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Hiredis
  DEFAULT_MSG
  Hiredis_INCLUDE_DIRS
  Hiredis_LIBRARIES)

mark_as_advanced(Hiredis_INCLUDE_DIRS Hiredis_LIBRARIES)

if(Hiredis_FOUND)
  if(NOT TARGET Hiredis_lib)
    add_library(Hiredis_lib INTERFACE IMPORTED)
  endif()

  set_target_properties(Hiredis_lib
    PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
    "${Hiredis_INCLUDE_DIRS}"
    INTERFACE_LINK_LIBRARIES
    "${Hiredis_LIBRARIES}")
endif(Hiredis_FOUND)

repository: magicminglee/pico

repo_name: magicminglee/pico

extension: cmake


text:
/*
 * @Description: 类class  封装
 * @Author: HCQ
 * @Company(School): UCAS
 * @Email: 1756260160@qq.com
 * @Date: 2021-02-14 23:08:07
 * @LastEditTime: 2023-08-20 18:58:32
 * @FilePath: /go-learning/8小时转职Golang工程师/GolangStudy/10-OOP/test2_class封装.go
 */
package main

import "fmt"

//如果类名首字母大写，表示其他包也能够访问
type Hero struct {
	//如果说类的属性首字母大写, 表示该属性是对外能够访问的，否则的话只能够类的内部访问
	Name  string
	Ad    int
	level int  // 小写，私有属性
}

/*
func (this Hero) Show() {     // this Hero 绑定到Hero
	fmt.Println("Name = ", this.Name)
	fmt.Println("Ad = ", this.Ad)
	fmt.Println("Level = ", this.Level)
}

func (this Hero) GetName() string {
	return this.Name
}

func (this Hero) SetName(newName string) {
	//this 是调用该方法的对象的一个副本（拷贝）
	this.Name = newName
}
*/

// 必须加*  指针
func (this *Hero) Show() {
	fmt.Println("Name = ", this.Name)
	fmt.Println("Ad = ", this.Ad)
	fmt.Println("Level = ", this.level)
}

func (this *Hero) GetName() string {
	return this.Name
}

func (this *Hero) SetName(newName string) {
	//this 是调用该方法的对象的一个副本（拷贝）
	this.Name = newName
}

func main() {
	//创建一个对象
	hero := Hero{Name: "zhang3", Ad: 100}

	hero.Show()

	hero.SetName("li4")

	hero.Show()
}

repository: HuangCongQing/go-learning

repo_name: HuangCongQing/go-learning


text:
package test

import (
	"fmt"
	"testing"
	"time"

	codecstd "github.com/cosmos/cosmos-sdk/codec/std"
	"github.com/cosmos/cosmos-sdk/server"
	"github.com/cosmos/cosmos-sdk/simapp"
	"github.com/stretchr/testify/require"
	"github.com/tendermint/go-amino"

	. "github.com/cosmos/relayer/relayer"
	"github.com/CosmicCompass/post-chain/app"
)

var (
	// GAIA BLOCK TIMEOUTS on jackzampolin/gaiatest:master
	// timeout_commit = "1000ms"
	// timeout_propose = "1000ms"
	// 3 second relayer timeout works well with these block times
	gaiaTestConfig = testChainConfig{
		cdc:            codecstd.NewAppCodec(codecstd.MakeCodec(simapp.ModuleBasics)),
		amino:          codecstd.MakeCodec(simapp.ModuleBasics),
		dockerImage:    "jackzampolin/gaiatest",
		dockerTag:      "master",
		timeout:        3 * time.Second,
		rpcPort:        "26657",
		accountPrefix:  "cosmos",
		gas:            200000,
		gasPrices:      "0.025stake",
		defaultDenom:   "stake",
		trustingPeriod: "330h",
	}

	// MTD BLOCK TIMEOUTS on microtick/mtzonetest:ibc-alpha
	// timeout_commit = "1000ms"
	// timeout_propose = "1000ms"
	// 3 second relayer timeout works well with these block times
	mtdTestConfig = testChainConfig{
		cdc:            codecstd.NewAppCodec(codecstd.MakeCodec(simapp.ModuleBasics)),
		amino:          codecstd.MakeCodec(simapp.ModuleBasics),
		dockerImage:    "microtick/mtzonetest",
		dockerTag:      "ibc-alpha",
		timeout:        3 * time.Second,
		rpcPort:        "26657",
		accountPrefix:  "cosmos",
		gas:            200000,
		gasPrices:      "0.025stake",
		defaultDenom:   "stake",
		trustingPeriod: "330h",
	}

	// RocketZone
	// timeout_commit = "1000ms"
	// timeout_propose = "1000ms"
	// 3 second relayer timeout works well with these block times
	rocketTestConfig = testChainConfig{
		cdc:            codecstd.NewAppCodec(codecstd.MakeCodec(simapp.ModuleBasics)),
		amino:          codecstd.MakeCodec(simapp.ModuleBasics),
		dockerImage:    "rocketprotocol/rocketzone-relayer-test",
		dockerTag:      "latest",
		timeout:        3 * time.Second,
		rpcPort:        "26657",
		accountPrefix:  "cosmos",
		gas:            200000,
		gasPrices:      "0.025ufuel",
		defaultDenom:   "ufuel",
		trustingPeriod: "330h",
	}

	// Agoric Chain
	// timeout_commit = "1000ms"
	// timeout_propose = "1000ms"
	// 3 second relayer timeout works well with these block times
	agoricTestConfig = testChainConfig{
		cdc:            codecstd.NewAppCodec(codecstd.MakeCodec(simapp.ModuleBasics)),
		amino:          codecstd.MakeCodec(simapp.ModuleBasics),
		dockerImage:    "agoric/agoric-sdk",
		dockerTag:      "ibc-alpha",
		timeout:        3 * time.Second,
		rpcPort:        "26657",
		accountPrefix:  "agoric",
		gas:            200000,
		gasPrices:      "",
		defaultDenom:   "uag",
		trustingPeriod: "330h",
	}

	// CoCo Chain  saisunkari19/coco:ibc-alpha
	// timeout_commit = "1000ms"
	// timeout_propose = "1000ms"
	// 3 second relayer timeout works well with these block times
	cocoTestConfig = testChainConfig{
		cdc:            codecstd.NewAppCodec(codecstd.MakeCodec(app.ModuleBasics)),
		amino:          codecstd.MakeCodec(app.ModuleBasics),
		dockerImage:    "saisunkari19/coco",
		dockerTag:      "ibc-alpha",
		timeout:        3 * time.Second,
		rpcPort:        "26657",
		accountPrefix:  "cosmic",
		gas:            200000,
		gasPrices:      "0.025coco",
		defaultDenom:   "coco",
		trustingPeriod: "330h",
	}
)

type (
	// testChain represents the different configuration options for spinning up a test
	// cosmos-sdk based blockchain
	testChain struct {
		chainID string
		t       testChainConfig
	}

	// testChainConfig represents the chain specific docker and codec configurations
	// required.
	testChainConfig struct {
		dockerImage    string
		dockerTag      string
		cdc            *codecstd.Codec
		amino          *amino.Codec
		rpcPort        string
		timeout        time.Duration
		accountPrefix  string
		gas            uint64
		gasPrices      string
		defaultDenom   string
		trustingPeriod string
	}
)

// newTestChain generates a new instance of *Chain with a free TCP port configured as the RPC port
func newTestChain(t *testing.T, tc testChain) *Chain {
	_, port, err := server.FreeTCPAddr()
	require.NoError(t, err)
	return &Chain{
		Key:            "testkey",
		ChainID:        tc.chainID,
		RPCAddr:        fmt.Sprintf("http://localhost:%s", port),
		AccountPrefix:  tc.t.accountPrefix,
		Gas:            tc.t.gas,
		GasPrices:      tc.t.gasPrices,
		DefaultDenom:   tc.t.defaultDenom,
		TrustingPeriod: tc.t.trustingPeriod,
	}
}

repository: cosmos/relayer-archive

repo_name: cosmos/relayer-archive


text:
#
# This file is the aie-plio recipe.
#

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

SRC_URI = "git://github.com/Xilinx/plnx-aie-examples.git;protocol=https;branch=rel-v2020.2"
SRCREV = "e89e403cbc5b89be18d32ce2e3c57127c8377c2c"

DEPENDS = "ai-engine-driver xrt"
RDEPENDS_${PN}  = "ai-engine-driver xrt zocl"
INSANE_SKIP_${PN} += " arch"

COMPATIBLE_MACHINE = "^$"
COMPATIBLE_MACHINE_versal-ai-core = "versal-ai-core"

S = "${WORKDIR}/git"

do_compile[noexec] = "1"

do_install() {
	install -d ${D}${bindir}
	install -m 0755 ${S}/aie-matrix-multiplication ${D}${bindir}
	install -d ${D}/lib/firmware/aie/
	cp -r ${S}/Work ${D}/lib/firmware/aie
	cp ${S}/aie-matrix-multiplication.xclbin ${D}/lib/firmware/aie
}

FILES_${PN} += " \
	/lib/firmware/aie/Work \
	/lib/firmware/aie/aie-matrix-multiplication.xclbin \
	${bindir}/aie-matrix-multiplication \
"

PACKAGE_ARCH_versal-ai-core = "${SOC_VARIANT_ARCH}"

repository: sbahadirarslan/meta-petalinux

repo_name: sbahadirarslan/meta-petalinux


text:
@article{prandi2019,
author = "Prandi, Dario and Rizzi, Luca and Seri, Marcello",
doi = "10.4310/jdg/1549422105",
fjournal = "Journal of Differential Geometry",
journal = "J. Differential Geom.",
month = "02",
number = "2",
pages = "339--379",
publisher = "Lehigh University",
title = "A sub-Riemannian Santaló formula with applications to isoperimetric inequalities and first Dirichlet eigenvalue of hypoelliptic operators",
url = "https://doi.org/10.4310/jdg/1549422105",
volume = "111",
year = "2019"
}

repository: dprn/academic-kickstart

repo_name: dprn/academic-kickstart


text:
package main

import (
	"context"
	"crypto/tls"
	"crypto/x509"
	"fmt"
	"io/ioutil"
	"strings"
	"sync"
	"time"

	etcd "github.com/coreos/etcd/clientv3"
)

const (
	turingPrefix = "/turing-awards/"
)

// EtcdConfig stores important fileds to connect to etcd.
// Mainly endpoints and verification related info
type EtcdConfig struct {
	Endpoints []string
	KeyFile   string
	CertFile  string
	CAFile    string
	Username  string
	Password  string
}

func newEtcdClient(c *EtcdConfig) (*etcd.Client, error) {
	var tlsInfo *tls.Config
	var pool *x509.CertPool

	if c.CertFile != "" && c.KeyFile != "" {
		// load key and cert
		cert, err := tls.LoadX509KeyPair(c.CertFile, c.KeyFile)
		if err != nil {
			return nil, fmt.Errorf("Unable to load cert: %v", err)
		}

		if c.CAFile != "" {
			// load root CA info
			caData, err := ioutil.ReadFile(c.CAFile)
			if err != nil {
				return nil, fmt.Errorf("Unable to load ca file context: %v", caData)
			}
			pool = x509.NewCertPool()
			pool.AppendCertsFromPEM(caData)
		}

		tlsInfo = &tls.Config{
			Certificates: []tls.Certificate{cert},
			RootCAs:      pool,
		}
	}

	client, err := etcd.New(etcd.Config{
		Endpoints: c.Endpoints,
		Username:  c.Username,
		Password:  c.Password,
		TLS:       tlsInfo,
	})
	if err != nil {
		return nil, err
	}

	return client, nil
}

var client *etcd.Client

func init() {
	var err error
	client, err = newEtcdClient(&EtcdConfig{
		Endpoints: []string{"http://127.0.0.1:2379"},
	})

	if err != nil {
		panic(fmt.Sprintf("Unable to create etcd client: %v", err))
	}
}

func setWinner(who, what string) error {
	key := turingPrefix + who
	fmt.Printf("Set %s to [%s]\n", key, what)

	_, err := client.Put(context.Background(), key, what)
	if err != nil {
		fmt.Printf("Put error: %v", err)
	}
	return err
}

func setWinnerWithLease(who, what string, ttl int) error {
	key := turingPrefix + who
	fmt.Printf("Set %s to [%s] with lease %d\n", key, what, ttl)

	// create a lease first
	resp, err := client.Grant(context.Background(), int64(ttl))
	if err != nil {
		fmt.Printf("Unable to create lease")
	}

	// Use WithLease to add lease to key
	_, err = client.Put(context.Background(), key, what, etcd.WithLease(resp.ID))
	if err != nil {
		fmt.Printf("Put error: %v", err)
	}
	return err
}
func deleteWinner(who string) error {
	key := turingPrefix + who
	fmt.Printf("Delete %s \n", key)

	_, err := client.Delete(context.Background(), key)
	if err != nil {
		fmt.Printf("Delete error: %v", err)
	}
	return err
}

func getWinner(who string) error {
	key := turingPrefix + who

	resp, err := client.Get(context.Background(), key)
	if err != nil {
		return err
	}

	if len(resp.Kvs) == 0 {
		fmt.Printf("%s does not win Turing Awards\n", who)
		return nil
	}

	tokens := strings.Split(string(resp.Kvs[0].Key), "/")
	who = tokens[len(tokens)-1]
	what := resp.Kvs[0].Value
	fmt.Printf("%s won turing awards for %s\n", who, what)

	return nil
}

func getWinners() error {
	key := turingPrefix

	resp, err := client.Get(context.Background(), key, etcd.WithPrefix())
	if err != nil {
		return err
	}

	for _, ev := range resp.Kvs {
		fmt.Printf("%s won turing awards for %s\n", ev.Key, ev.Value)
	}
	return nil
}

// updateWinner only updates winner description if you provide
// the correct previous description
func updateWinner(who string, prev, new string) error {
	key := turingPrefix + who
	fmt.Printf("Update %s to [%s]\n", key, new)

	resp, err := client.Txn(context.Background()).
		If(etcd.Compare(etcd.Value(key), "=", prev)).
		Then(etcd.OpPut(key, new)).
		Commit()

	if err != nil {
		fmt.Printf("Set value error: %v", err)
	}

	if !resp.Succeeded {
		fmt.Printf("Set value failed: value compare error\n")
	}

	return err
}

func watchWinners(closeCh <-chan struct{}) {
	key := turingPrefix
	resultCh := client.Watch(context.Background(), key, etcd.WithPrefix())

	for {
		select {
		case resp := <-resultCh:
			for _, event := range resp.Events {
				fmt.Printf("Event received: %s %q: %q\n", event.Type, event.Kv.Key, event.Kv.Value)
			}

		case <-closeCh:
			return
		}
	}
}

func demoGetSet() error {
	who := "john-mccarthy"

	err := setWinner(who, "Artificial Interlligence")
	if err != nil {
		return err
	}

	err = getWinner(who)
	if err != nil {
		return err
	}

	// After delete winner from etcd,
	// we should get nothing
	err = deleteWinner(who)
	if err != nil {
		return err
	}

	err = getWinner(who)
	if err != nil {
		return err
	}

	return nil
}

func demoPrefix() error {
	// add more winnders
	winners := []winner{
		winner{
			"Dijkstra",
			"Programming Languages",
		},
		winner{
			"Knuth",
			"analysis of algorithms",
		},
	}

	for _, w := range winners {
		err := setWinner(w.name, w.what)
		if err != nil {
			return err
		}
	}

	// Get values of a directory
	return getWinners()
}

func demoTransaction() error {
	// add a winner Tim Berners Lee
	who := "Tim-Berners-Lee"
	err := setWinner(who, "WWW")
	if err != nil {
		return err
	}

	// try update winner with more descriptive info
	// returned error is expected, ignore it
	_ = updateWinner(who, "lisp", "Inventing World Wide Web")

	getWinner(who)

	// update with the correct information
	err = updateWinner(who, "WWW", "Inventing World Wide Web")
	if err != nil {
		return err
	}

	// print the updated information
	return getWinner(who)
}

func demoWatch() error {
	closeCh := make(chan struct{})

	// run watch in background
	// print can be out of order
	var wg sync.WaitGroup
	wg.Add(1)
	go func() {
		watchWinners(closeCh)
		wg.Done()
	}()

	// add winners
	winners := []winner{
		winner{
			"Ken-Thompson",
			"Unix operating system",
		},
		winner{
			"Alan-Key",
			"Object-Oriented Programming Languages",
		},
		winner{
			"cizixs",
			"nothing",
		},
	}

	// wait for watch is ready
	time.Sleep(time.Millisecond * 500)
	for _, w := range winners {
		err := setWinner(w.name, w.what)
		if err != nil {
			return err
		}
	}

	deleteWinner("cizixs")

	closeCh <- struct{}{}
	wg.Wait()

	return nil
}

func demoLease() error {
	// NOTE: the minimial ttl is 5 seconds, see the following explanation:
	// https://github.com/coreos/etcd/issues/6025
	err := setWinnerWithLease("cizixs", "nothing", 5)
	if err != nil {
		return err
	}

	if err := getWinner("cizixs"); err != nil {
		return err
	}

	fmt.Printf("wait for lease to expire...\n")
	time.Sleep(7 * time.Second)

	return getWinner("cizixs")
}

type winner struct {
	name string
	what string
}

type demo struct {
	action      func() error
	description string
}

func main() {
	defer client.Close()
	demos := []demo{
		demo{
			action:      demoGetSet,
			description: "simple set and get",
		},
		demo{
			action:      demoPrefix,
			description: "use prefix to get all values",
		},
		demo{
			action:      demoTransaction,
			description: "multiple action with transaction",
		},
		demo{
			action:      demoWatch,
			description: "watch key changes",
		},
		demo{
			action:      demoLease,
			description: "assign lease to keys",
		},
	}

	for i, d := range demos {
		fmt.Printf("\n------------- DEMO %d: %s --------------\n", i+1, d.description)
		err := d.action()
		if err != nil {
			fmt.Printf("Demo failed: %v", err)
		}
	}
}

repository: cocowh/etcd-demo

repo_name: cocowh/etcd-demo


text:
@book{iot_book,
 author = {Mosahebfard, Mohammadreza and Torres-Pérez, Claudia and Carmona-Cejudo, Estela and Cárdenas Córdova, Andrés and Pino Martínez, Adrián and Camargo Barragan, Juan Sebastian and Coronado, Estefanía and Siddiqui, Muhammad Shuaib},
 booktitle = {Shaping the Future of IoT with Edge Intelligence: How Edge Computing Enables the Next Generation of IoT Applications},
 publisher = {River Publishers Series},
 title = {Intelligent Management at the Edge},
 year = {2023}
}


text:
@article{morita_determining_2008,
	title = {Determining the Effective Sample Size of a Parametric Prior},
	volume = {64},
	issn = {0006-341X},
	url = {http://www.ncbi.nlm.nih.gov/pmc/articles/PMC3081791/},
	doi = {10.1111/j.1541-0420.2007.00888.x},
	abstract = {We present a definition for the effective sample size of a parametric prior distribution in a Bayesian model, and propose methods for computing the effective sample size in a variety of settings. Our approach first constructs a prior chosen to be vague in a suitable sense, and updates this prior to obtain a sequence of posteriors corresponding to each of a range of sample sizes. We then compute a distance between each posterior and the parametric prior, defined in terms of the curvature of the logarithm of each distribution, and the posterior minimizing the distance defines the effective sample size of the prior. For cases where the distance cannot be computed analytically, we provide a numerical approximation based on Monte Carlo simulation. We provide general guidelines for application, illustrate the method in several standard cases where the answer seems obvious, and then apply it to some nonstandard settings.},
	pages = {595--602},
	number = {2},
	journaltitle = {Biometrics},
	shortjournal = {Biometrics},
	author = {Morita, Satoshi and Thall, Peter F. and Muller, Peter},
	urldate = {2014-04-03},
	date = {2008-06},
	pmid = {17764481},
	pmcid = {PMC3081791}
}

repository: pmean/build-website

repo_name: pmean/build-website


text:
@inproceedings{handwritten,
  title={Handwritten digit recognition with a back-propagation network},
  author={LeCun, Yann and Boser, Bernhard E and Denker, John S and Henderson, Donnie and Howard, Richard E and Hubbard, Wayne E and Jackel, Lawrence D},
  booktitle={Advances in neural information processing systems},
  pages={396--404},
  year={1990}
}

@article{housing,
author = {Harrison, David and Rubinfeld, Daniel},
year = {1978},
month = {03},
pages = {81-102},
title = {Hedonic housing prices and the demand for clean air},
volume = {5},
journal = {Journal of Environmental Economics and Management},
doi = {10.1016/0095-0696(78)90006-2}
}

@article{koza,
author = {Koza, John and Rice, James},
year = {2004},
month = {02},
pages = {},
title = {Automatic Programming of Robots using Genetic Programming}
}

@article{relatedwork1,
  author    = {Adarsh Sehgal and
               Hung Manh La and
               Sushil J. Louis and
               Hai Nguyen},
  title     = {Deep Reinforcement Learning using Genetic Algorithm for Parameter
               Optimization},
  journal   = {CoRR},
  volume    = {abs/1905.04100},
  year      = {2019},
  url       = {http://arxiv.org/abs/1905.04100},
  archivePrefix = {arXiv},
  eprint    = {1905.04100},
  timestamp = {Mon, 27 May 2019 13:15:00 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1905-04100.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{relatedwork2,
  author    = {Felipe Petroski Such and
               Vashisht Madhavan and
               Edoardo Conti and
               Joel Lehman and
               Kenneth O. Stanley and
               Jeff Clune},
  title     = {Deep Neuroevolution: Genetic Algorithms Are a Competitive Alternative
               for Training Deep Neural Networks for Reinforcement Learning},
  journal   = {CoRR},
  volume    = {abs/1712.06567},
  year      = {2017},
  url       = {http://arxiv.org/abs/1712.06567},
  archivePrefix = {arXiv},
  eprint    = {1712.06567},
  timestamp = {Mon, 13 Aug 2018 16:46:09 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1712-06567.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{relatedwork3,
  author    = {Richard Evans and
               Edward Grefenstette},
  title     = {Learning Explanatory Rules from Noisy Data},
  journal   = {CoRR},
  volume    = {abs/1711.04574},
  year      = {2017},
  url       = {http://arxiv.org/abs/1711.04574},
  archivePrefix = {arXiv},
  eprint    = {1711.04574},
  timestamp = {Mon, 27 Jan 2020 16:21:19 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1711-04574.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{pirl,
  author    = {Abhinav Verma and
               Vijayaraghavan Murali and
               Rishabh Singh and
               Pushmeet Kohli and
               Swarat Chaudhuri},
  title     = {Programmatically Interpretable Reinforcement Learning},
  journal   = {CoRR},
  volume    = {abs/1804.02477},
  year      = {2018},
  url       = {http://arxiv.org/abs/1804.02477},
  archivePrefix = {arXiv},
  eprint    = {1804.02477},
  timestamp = {Mon, 13 Aug 2018 16:47:58 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1804-02477.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{atari,
  author    = {Dennis G. Wilson and
               Sylvain Cussat{-}Blanc and
               Herv{\'{e}} Luga and
               Julian F. Miller},
  title     = {Evolving simple programs for playing Atari games},
  journal   = {CoRR},
  volume    = {abs/1806.05695},
  year      = {2018},
  url       = {http://arxiv.org/abs/1806.05695},
  archivePrefix = {arXiv},
  eprint    = {1806.05695},
  timestamp = {Mon, 13 Aug 2018 16:46:45 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1806-05695.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{gprl,
  author    = {Daniel Hein and
               Steffen Udluft and
               Thomas A. Runkler},
  title     = {Interpretable Policies for Reinforcement Learning by Genetic Programming},
  journal   = {CoRR},
  volume    = {abs/1712.04170},
  year      = {2017},
  url       = {http://arxiv.org/abs/1712.04170},
  archivePrefix = {arXiv},
  eprint    = {1712.04170},
  timestamp = {Tue, 04 Dec 2018 07:36:12 +0100},
  biburl    = {https://dblp.org/rec/journals/corr/abs-1712-04170.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

@article{atari2,
  author    = {Volodymyr Mnih and
               Koray Kavukcuoglu and
               David Silver and
               Alex Graves and
               Ioannis Antonoglou and
               Daan Wierstra and
               Martin A. Riedmiller},
  title     = {Playing Atari with Deep Reinforcement Learning},
  journal   = {CoRR},
  volume    = {abs/1312.5602},
  year      = {2013},
  url       = {http://arxiv.org/abs/1312.5602},
  archivePrefix = {arXiv},
  eprint    = {1312.5602},
  timestamp = {Mon, 13 Aug 2018 16:47:42 +0200},
  biburl    = {https://dblp.org/rec/journals/corr/MnihKSGAWR13.bib},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}

repository: alexgeorgousis/GP-for-interpretable-RL

repo_name: alexgeorgousis/GP-for-interpretable-RL


text:
# Copyright (c) 2019 LG Electronics, Inc.

SUMMARY = "TurtleBot 3 packages that must be run on the device"

# Need this because the recipe uses MACHINE overrides.
PACKAGE_ARCH = "${MACHINE_ARCH}"

inherit packagegroup
inherit ros_distro_${ROS_DISTRO}

TURTLEBOT3_PACKAGES_LIDAR ??= " \
    hls-lfcd-lds-driver \
"
TURTLEBOT3_PACKAGES_LIDAR_qemux86 = ""

# From just above here http://emanual.robotis.com/docs/en/platform/turtlebot3/appendix_raspi_cam/#run-raspicam-node (also see
# http://emanual.robotis.com/docs/en/platform/turtlebot3/applications/#turtlebot-panorama-demo):
TURTLEBOT3_PACKAGES_CAMERA_rpi ??= " \
    camera-info-manager \
    compressed-image-transport \
"
TURTLEBOT3_PACKAGES_CAMERA_rpi_append_ros1-distro = " \
    raspicam-node \
"
# raspicam-node depends on userland to provide mmal, but for aarch64 it doesn't provide it.
TURTLEBOT3_PACKAGES_CAMERA_remove_aarch64 = "raspicam-node"

TURTLEBOT3_PACKAGES_CAMERA ??= ""

# From http://emanual.robotis.com/docs/en/platform/turtlebot3/raspberry_pi_3_setup/#3-install-dependent-packages-on-turtlebot-pc
RDEPENDS_${PN} = " \
    ros-base \
    turtlebot3-bringup \
    turtlebot3-msgs \
    ${TURTLEBOT3_PACKAGES_CAMERA} \
    ${TURTLEBOT3_PACKAGES_LIDAR} \
"

# Anticipate eventual TurtleBot 3 support under ROS 2, when the package names will be different.
RDEPENDS_${PN}_append_ros1-distro = " \
    rosserial-python \
    tf \
"

# "turtlebot3-bringup" expects "rosdep init; rosdep update" to have been done on the target. This is ROS 1 only.
RDEPENDS_${PN}_append_ros1-distro = " \
    python-rosdep-data \
"

repository: jianchangfeng/meta-ros

repo_name: jianchangfeng/meta-ros


text:
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit genimage

# define the image's layout
SRC_URI += "file://genimage.config"

DEPENDS += "barebox"

# add dependency to the required images
do_genimage[depends] += "barebox:do_deploy"

GENIMAGE_IMAGE_NAME = "qemu-normal-flash"
GENIMAGE_IMAGE_SUFFIX = "img"

repository: jluebbe/meta-code-signing

repo_name: jluebbe/meta-code-signing


text:
@article{Becker_2010,
  doi = {10.2217/pgs.10.146},
  url = {https://doi.org/10.2217\%2Fpgs.10.146},
  year = 2010,
  month = {nov},
  publisher = {Future Medicine Ltd},
  volume = {11},
  number = {11},
  pages = {1591--1602},
  author = {Mara L Becker and J Steven Leeder},
  title = {Identifying genomic and developmental causes of adverse drug reactions in children},
  journal = {Pharmacogenomics}
}

repository: larmcr/px

repo_name: larmcr/px


text:
package main

import (
	tg "github.com/brunetto/tegola"
	"gitlab.com/brunetto/sdbutils"
	"log"
	"strconv"
	"sync"
	"time"
)

func main () {
	var (
		b   tg.Bot
		cr ControlRoom
		conf        sdbutils.ConnInfo
		err error
		wg  sync.WaitGroup
	)
	b = tg.NewBotFromJsonFile("wntt.json")

	cr = ControlRoom{}
	cr.db = sdbutils.NewDB()
	cr.b = &b
	cr.c = make(chan string, 10)
	conf, err = sdbutils.ReadCnf("service-users.cnf")
	if err != nil {
		log.Println(err)
	}
	cr.db.SetConnectionInfo(conf)
	err = cr.db.NewConnection()
	if err != nil {
		log.Fatal(err)
	}

	wg.Add(1)
	go cr.Notifier(&wg)
	wg.Add(1)
	go cr.CheckTimesQueue(&wg)
	//close(cr.c)
	wg.Wait()
}

type ControlRoom struct {
	db sdbutils.DB
	b *tg.Bot
	c chan string
}

func (cr *ControlRoom) CheckTimesQueue (wg *sync.WaitGroup) () {
	defer wg.Done()
	var (
		queryString string
		message string
		result      sdbutils.Records
		err error
		threshold int64 = 20
		n int64
	)
	queryString = ``
	for {
		log.Println("Starting query")
		result, err = cr.db.GetDataFromGenericTable(queryString)
		if err != nil {
			log.Println(err)
			continue
		}
		log.Println("Query done")
		message = "Queue lenght for cron 'Times' is: " + result[0].Fields["lavorazioni_senza_times"].Value
		n, err = strconv.ParseInt(result[0].Fields["lavorazioni_senza_times"].Value, 10,64)
		if err != nil {
			log.Fatal(err)
		}
		if n < threshold {
			message += "\nNo action required.\n"
		} else {
			message += "\nBetter check the situation.\nCheck out https://confluence.pixartprinting.com/display/IFL."
		}
		message += "\nLet's check again in one minute.\n"
		log.Println("sending ", message)
		cr.c <- message

		log.Println("Sleeping for one minute")
		time.Sleep(1*time.Minute)
		log.Println("Resume")
	}
}

func (cr *ControlRoom) Notifier (wg *sync.WaitGroup) () {
	defer wg.Done()
	for message := range cr.c {
		log.Println(message)
		_, err := cr.b.SendSimpleMessage(0, message)
		if err != nil {
			log.Fatal(err)
		}
	}
}

repository: brunetto/tegola

repo_name: brunetto/tegola


text:
func countGoodTriplets(arr []int, a int, b int, c int) int {
    var ret int
    for i := 0; i < len(arr); i++ {
        for j := i + 1; j < len(arr); j++ {
            for k := j+1; k < len(arr); k++ {
                if abs(arr[i]-arr[j]) <= a && abs(arr[j]-arr[k]) <= b && abs(arr[i]-arr[k]) <= c {
                    ret++
                }

            }
        }
    }
    return ret
}

func abs(a int) int {
    if a < 0 {
        return -a
    }
    return a
}

repository: MingfeiPan/leetcode

repo_name: MingfeiPan/leetcode


text:
SUMMARY = "Classes Without Boilerplate"
DESCRIPTION = "attrs is the Python package that will bring back the joy of \
writing classes by relieving you from the drudgery of implementing object \
protocols (aka dunder methods).\
\
Its main goal is to help you to write concise and correct software without \
slowing down your code."
HOMEPAGE = "http://www.attrs.org/"
BUGTRACKER = "https://github.com/python-attrs/attrs/issues"
SECTION = "devel/python"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=d4ab25949a73fe7d4fdee93bcbdbf8ff"

SRC_URI[sha256sum] = "f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
SRC_URI[md5sum] = "5b2db50fcc31be34d32798183c9bd062"

inherit pypi setuptools

RDEPENDS_${PN}_class-target += " \
    ${PYTHON_PN}-crypt \
    ${PYTHON_PN}-ctypes \
    ${PYTHON_PN}-subprocess \
"

BBCLASSEXTEND = "native"

repository: opendreambox/opendreambox

repo_name: opendreambox/opendreambox

branch_name: refs/heads/pyro

gha_license_id: NOASSERTION


text:
// Package msgpublisher publishes outgoing SMS/Email messages.
package msgpublisher

import (
	"context"
	"fmt"
	"strings"
	"time"

	"github.com/go-kit/kit/log"

	auth "github.com/fmitra/authenticator"
	"github.com/fmitra/authenticator/internal/contactchecker"
)

// service is an implementation of auth.MessagingService.
type service struct {
	logger         log.Logger
	messageRepo    auth.MessageRepository
	expireAfter    time.Duration
	smsTemplates   map[auth.MessageType]string
	emailTemplates map[auth.MessageType]string
	subjects       map[auth.MessageType]string
}

// Send sends a message to a User. Behind the scenes, a message is stored
// in the MessageRepository to be consumed by a separate service.
func (s *service) Send(ctx context.Context, msg *auth.Message) error {
	if !contactchecker.Validator(msg.Delivery)(msg.Address) {
		return fmt.Errorf("invalid message delivery method")
	}

	if err := s.setMessageFields(msg); err != nil {
		return err
	}

	if err := s.messageRepo.Publish(ctx, msg); err != nil {
		return fmt.Errorf("failed to publish to repository: %w", err)
	}

	return nil
}

func (s *service) setMessageFields(msg *auth.Message) error {
	msg.ExpiresAt = time.Now().Add(s.expireAfter)

	// Message content was set by caller. Do not overwrite.
	if msg.Content != "" {
		return nil
	}

	template := s.template(msg.Type, msg.Delivery)
	if template == "" {
		return fmt.Errorf("no template set for %s", msg.Type)
	}

	for k, v := range msg.Vars {
		k = fmt.Sprintf("{{%s}}", k)
		template = strings.Replace(template, k, v, -1)
	}

	if strings.Contains(template, "{{") || strings.Contains(template, "}}") {
		return fmt.Errorf("all variables not set for template: %s", template)
	}

	msg.Content = template
	msg.Subject = s.subjects[msg.Type]
	return nil
}

func (s *service) template(t auth.MessageType, d auth.DeliveryMethod) string {
	if d == auth.Phone {
		return s.smsTemplates[t]
	}

	if d == auth.Email {
		return s.emailTemplates[t]
	}

	return ""
}

func (s *service) createTemplates() {
	s.smsTemplates = map[auth.MessageType]string{
		auth.OTPLogin:   "Your login code is {{code}}",
		auth.OTPSignup:  "Your signup code is {{code}}",
		auth.OTPResend:  "Youre new code is {{code}}",
		auth.OTPAddress: "Use the code {{code}} to verify your new contact address",
	}

	s.emailTemplates = map[auth.MessageType]string{
		auth.OTPLogin: `
			Code: {{code}}

Enter the code above to login

		`,
		auth.OTPSignup: `
			Code: {{code}}

Enter the code above to signup

		`,
		auth.OTPResend: `
			Here's your new code

Code: {{code}}

		`,
		auth.OTPAddress: `
			Code: {{code}}

Enter the code above to verify your new contact address

		`,
	}

	s.subjects = map[auth.MessageType]string{
		auth.OTPAddress: "Verify your contact details",
		auth.OTPLogin:   "Your login verification code",
		auth.OTPResend:  "You've requested a new verification code",
		auth.OTPSignup:  "Your signup verification code",
	}
}

repository: fmitra/authenticator

repo_name: fmitra/authenticator


text:
#
# This file is the nvdla-runtime recipe.
#

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

SRC_URI = "file://umd \
       file://umd/* \
       file://Makefile \
       "

S = "${WORKDIR}"
TARGET_CC_ARCH += "${LDFLAGS}"
RDEPENDS_${PN} += "opendla"
TARGET_PATH = "${S}/umd/out/runtime"

do_compile() {
	     oe_runmake
}

do_install() {
    install -d ${D}${libdir}
    install -d ${D}${includedir}/libnvdla_runtime
    install -d ${D}${includedir}/libnvdla_runtime/nvdla
    install -m 0755 ${TARGET_PATH}/libnvdla_runtime/libnvdla_runtime.so     ${D}${libdir}
    install -m 0644 ${S}/umd/include/*.h ${D}${includedir}/libnvdla_runtime
    install -m 0644 ${S}/umd/include/nvdla/*.h ${D}${includedir}/libnvdla_runtime/nvdla
}

FILES_${PN} = " ${libdir}/libnvdla_runtime.so ${includedir}/*"
FILES_${PN}-dev = ""


text:
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

IMAGE_INSTALL += " \
    packagegroup-boot \
    packagegroup-base \
    ${ROOTFS_PKGMANAGE} \
    update-alternatives-opkg \
    coreutils \
    bash \
    bash-completion \
    systemd-bash-completion \
    systemd-analyze \
    cpufrequtils \
    findutils \
    htop \
    util-linux-lsblk \
    nano \
    rsync \
    wget \
    dbus-broker \
    sudo \
    ${LIBC_SPECIFIC_PACKS} \
"

LIBC_SPECIFIC_PACKS = ""
LIBC_SPECIFIC_PACKS:libc-glibc = "glibc-gconv glibc-gconvs glibc-utils"

IMAGE_DEV_MANAGER   = "udev"
IMAGE_INIT_MANAGER  = "systemd"
IMAGE_INITSCRIPTS   = " "
IMAGE_LOGIN_MANAGER = "busybox shadow"

inherit image

export IMAGE_BASENAME = "console-base-image"

# we have journal
BAD_RECOMMENDATIONS += "busybox-syslog"

# This is the mother af all or images. Add more love to root's console
python () {
    d.appendVar('ROOTFS_POSTPROCESS_COMMAND', 'root_defaults;')
}

root_defaults () {
    cp ${IMAGE_ROOTFS}/${sysconfdir}/skel/.bashrc ${IMAGE_ROOTFS}/${ROOT_HOME}
    cp ${IMAGE_ROOTFS}/${sysconfdir}/skel/.profile ${IMAGE_ROOTFS}/${ROOT_HOME}
}

repository: ZeraGmbH/meta-mortsgna

repo_name: ZeraGmbH/meta-mortsgna


text:
package settings

import (
	"fmt"
	"strings"

	"github.com/qdm12/gluetun/internal/params"
)

// HTTPProxy contains settings to configure the HTTP proxy.
type HTTPProxy struct {
	User     string
	Password string
	Port     uint16
	Enabled  bool
	Stealth  bool
	Log      bool
}

func (h *HTTPProxy) String() string {
	if !h.Enabled {
		return "HTTP Proxy settings: disabled"
	}
	auth, log, stealth := disabled, disabled, disabled
	if h.User != "" {
		auth = enabled
	}
	if h.Log {
		log = enabled
	}
	if h.Stealth {
		stealth = enabled
	}
	settingsList := []string{
		"HTTP proxy settings:",
		fmt.Sprintf("Port: %d", h.Port),
		"Authentication: " + auth,
		"Stealth: " + stealth,
		"Log: " + log,
	}
	return strings.Join(settingsList, "\n |--")
}

// GetHTTPProxySettings obtains HTTPProxy settings from environment variables using the params package.
func GetHTTPProxySettings(paramsReader params.Reader) (settings HTTPProxy, warning string, err error) {
	settings.Enabled, err = paramsReader.GetHTTPProxy()
	if err != nil || !settings.Enabled {
		return settings, "", err
	}
	settings.User, err = paramsReader.GetHTTPProxyUser()
	if err != nil {
		return settings, "", err
	}
	settings.Password, err = paramsReader.GetHTTPProxyPassword()
	if err != nil {
		return settings, "", err
	}
	settings.Stealth, err = paramsReader.GetHTTPProxyStealth()
	if err != nil {
		return settings, "", err
	}
	settings.Log, err = paramsReader.GetHTTPProxyLog()
	if err != nil {
		return settings, "", err
	}
	settings.Port, warning, err = paramsReader.GetHTTPProxyPort()
	if err != nil {
		return settings, warning, err
	}
	return settings, warning, nil
}

repository: justinkprince/gluetun

repo_name: justinkprince/gluetun


text:
SUMMARY = "Script to properly configure BT-HCI on Raspberry Pi"
HOMEPAGE = "https://github.com/RPi-Distro/pi-bluetooth"
SECTION = "kernel"
LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "\
    file://debian/copyright;md5=6af8de3c8ee71f8e91e9b22f84ff2022 \
"

SRC_URI = "git://github.com/RPi-Distro/pi-bluetooth"
SRCREV = "2a7477966bb3c69838b224f3ea92cb49a88124d5"
UPSTREAM_VERSION_UNKNOWN = "1"

S = "${WORKDIR}/git"

inherit allarch

do_install() {
    install -d ${D}${bindir}
    install -m 0755 ${S}/usr/bin/btuart ${D}${bindir}
}

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

repository: wouterlucas/meta-raspberrypi

repo_name: wouterlucas/meta-raspberrypi


text:
# xfce-mcs-plugins OE build file
# Copyright (C) 2004, Advanced Micro Devices, Inc.  All Rights Reserved
# Released under the MIT license (see packages/COPYING)

DESCRIPTION="Common XFCE4 configuration plugins."
SECTION = "x11"

PACKAGES="${PN}"
FILES_${PN}="${libdir}/xfce4/mcs-plugins/*.so ${datadir}/xfce4/doc/C"

DEPENDS="libxfcegui4 xfce-mcs-manager gtk+"
inherit xfce

repository: BackupTheBerlios/openslug-svn

repo_name: BackupTheBerlios/openslug-svn


text:
package main

import (
	"context"
	"fmt"
	"os"
	"os/signal"
	"strings"
	"syscall"

	"github.com/briansorahan/death"
	"github.com/pkg/errors"
	flag "github.com/spf13/pflag"
	"github.com/xthexder/go-jack"
)

const (
	clientName = "ndseq" // JACK client name.
)

// Error codes.
const (
	DivideByZero = 50
)

var (
	bufferSize uint32

	client *jack.Client

	launchpadInput  *jack.Port // JACK port for sending MIDI data to the Launchpad.
	launchpadOutput *jack.Port // JACK port for receiving MIDI data from the Launchpad.

	nd       string     // Name of the MIDI interface to use for communicating with the Nord Drum 3p.
	ndInput  *jack.Port // JACK port for sending MIDI data to the Nord Drum 3p.
	ndOutput *jack.Port // JACK port for receiving MIDI data from the Nord Drum 3p.

	beat            int    // 64 steps
	firstNotePlayed bool   // Flag telling us if we've ever played a note.
	sampleCount     uint32 // Current sample count. This gets reset everytime we trigger a sequencer step.
	samplesPerBeat  uint32 // Samples per beat. Gets updated if the sample rate or the tempo changes.
	tempo           uint32 // Tempo in BPM.

	trigs [8][64]uint8 // Launchpad grid data.
)

func main() {
	// Parse the command line flags.
	// I use a Focusrite Scarlett 6i6 to communicate with the Nord Drum.
	flag.StringVar(&nd, "nd", "Scarlett", "JACK port for the Nord Drum 3p.")
	flag.Uint32Var(&tempo, "t", 120, "Tempo in BPM.")
	flag.Parse()

	var code int

	// Open the JACK client.
	client, code = jack.ClientOpen(clientName, jack.NoStartServer)
	death.Main(wrapCode(code, "opening JACK client"))

	// Set the callbacks.
	death.Main(wrapCode(client.SetSampleRateCallback(setSamplesPerBeat), "setting sample rate callback"))
	death.Main(wrapCode(client.SetProcessCallback(Process), "setting process callback"))

	// Register the JACK ports.
	death.Main(errors.Wrap(registerPorts(), "registering ports"))

	// Activate the client.
	death.Main(wrapCode(client.Activate(), "activating JACK client"))

	// Set the buffer size.
	bufferSize = client.GetBufferSize()

	// Wait for a signal or context done.
	var (
		ctx = context.Background()
		sc  = make(chan os.Signal, 1)
	)
	signal.Notify(sc, os.Interrupt, syscall.SIGQUIT, syscall.SIGINT)

	select {
	case <-ctx.Done():
		os.Exit(0)
	case sig := <-sc:
		fmt.Printf("received %s, exiting\n", sig)
		os.Exit(0)
	}
}

// Process is the JACK process callback.
func Process(nframes uint32) int {
	var (
		launchpadEvents = launchpadInput.GetMidiEvents(bufferSize)
		outBuffer       = ndOutput.MidiClearBuffer(nframes)
	)
	if len(launchpadEvents) > 0 {
		for _, event := range launchpadEvents {
			if code := processMidi(nframes, event, outBuffer); code != 0 {
				return code
			}
		}
	}
	return tick(nframes, outBuffer)
}

func advanceStepLight(outBuffer jack.MidiBuffer) int {
	if beat == 0 && !firstNotePlayed {
		// First note ever: light step 0.
		beat++
		return launchpadOutput.MidiEventWrite(&jack.MidiData{Buffer: []byte{0x90, 0x10, 63}}, outBuffer)
	}
	beat++
	return 0
}

func cc(nframes uint32, in []byte, outBuffer jack.MidiBuffer) int {
	var (
		event = jack.MidiData{
			Buffer: []byte{0x90, 0x36, in[2]}, // Note On C3
		}
	)
	// Set the output channel.
	switch in[1] {
	case 0x68: // Button 1
	case 0x69: // Button 2
		event.Buffer[0] |= 0x01
	case 0x6A: // Button 3
		event.Buffer[0] |= 0x02
	case 0x6B: // Button 4
		event.Buffer[0] |= 0x03
	case 0x6C: // Button 5
		event.Buffer[0] |= 0x04
	case 0x6D: // Button 6
		event.Buffer[0] |= 0x05
	}
	return ndOutput.MidiEventWrite(&event, outBuffer)
}

func contains(sub string) func(string) bool {
	return func(s string) bool {
		return strings.Contains(s, sub)
	}
}

func isFailure(code int) bool {
	return code == jack.Failure || code == jack.InvalidOption || code == jack.NameNotUnique ||
		code == jack.ServerError || code == jack.NoSuchClient || code == jack.LoadFailure ||
		code == jack.InitFailure || code == jack.ShmFailure || code == jack.VersionError ||
		code == jack.BackendError || code == jack.ClientZombie || code == DivideByZero
}

func light(x, y, g, r int, outBuffer jack.MidiBuffer) int {
	var (
		note     = byte(x + (16 * y))
		velocity = byte((16 * g) + r + 8 + 4)
	)
	return ndOutput.MidiEventWrite(&jack.MidiData{Buffer: []byte{0x90, note, velocity}}, outBuffer)

}

func note(nframes uint32, in []byte, out jack.MidiBuffer) int {
	return 0
}

type Port struct {
	*jack.Port

	Matches    func(string) bool
	Flags      uint64
	BufferSize uint64
}

var Ports = struct {
	Inputs  map[string]*Port
	Outputs map[string]*Port
}{
	Inputs: map[string]*Port{
		"LaunchpadRecv": {
			Matches: contains("Launchpad"),
		},
		"NordDrumRecv": {
			Matches: contains("Scarlett"),
		},
	},
	Outputs: map[string]*Port{
		"LaunchpadSend": {
			Matches: contains("Launchpad"),
		},
		"NordDrumSend": {
			Matches: contains("Scarlett"),
		},
	},
}

func registerPorts() error {
	for name, input := range Ports.Inputs {
		input.Port = client.PortRegister(name, jack.DEFAULT_MIDI_TYPE, input.Flags|jack.PortIsInput, input.BufferSize)
	}
	for name, output := range Ports.Outputs {
		output.Port = client.PortRegister(name, jack.DEFAULT_MIDI_TYPE, output.Flags|jack.PortIsOutput, output.BufferSize)
	}
	for _, in := range client.GetPorts("", jack.DEFAULT_MIDI_TYPE, jack.PortIsInput) {
		for name, out := range Ports.Outputs {
			if out.Matches(in) {
				rc := client.ConnectPorts(out.Port, client.GetPortByName(in))
				if err := wrapCodef(rc, "connecting %s to %s", name, in); err != nil {
					return err
				}
			}
		}
	}
	return nil
}

func processMidi(nframes uint32, event *jack.MidiData, outBuffer jack.MidiBuffer) int {
	switch event.Buffer[0] {
	case 0xB0: // CC
		return cc(nframes, event.Buffer, outBuffer)
	case 0x80, 0x90: // Note
		return note(nframes, event.Buffer, outBuffer)
	}
	return 0
}

func setSamplesPerBeat(sr uint32) int {
	if tempo == 0 {
		return DivideByZero
	}
	samplesPerBeat = (60 * sr) / tempo
	return 0
}

func stepLightMidiData(beat int) *jack.MidiData {
	var (
		note = byte((beat / 8) + (16 * (beat % 8)))
	)
	return &jack.MidiData{Buffer: []byte{0x90, note, 63}}
}

func tick(nframes uint32, outBuffer jack.MidiBuffer) int {
	if !firstNotePlayed {
		if code := advanceStepLight(outBuffer); isFailure(code) {
			return code
		}
		firstNotePlayed = true

		return trigger(nframes, outBuffer)
	}
	if sampleCount+nframes < samplesPerBeat {
		sampleCount += nframes
		return 0
	}
	return trigger(nframes, outBuffer)
}

func trigger(nframes uint32, outBuffer jack.MidiBuffer) int {
	for track, trackTrigs := range trigs {
		for _, trig := range trackTrigs {
			// TODO: trigger the notes.
			if code := triggerTrack(track, trig, outBuffer); isFailure(code) {
				return code
			}
		}
	}
	return 0
}

func triggerTrack(track int, trig uint8, outBuffer jack.MidiBuffer) int {
	return 0
}

func wrapCode(code int, msg string) error {
	return errors.Wrap(jack.Strerror(code), msg)
}

func wrapCodef(code int, format string, args ...interface{}) error {
	return errors.Wrapf(jack.Strerror(code), format, args...)
}

repository: scgolang/ndseq

repo_name: scgolang/ndseq


text:
// Copyright 2012 The LevelDB-Go and Pebble Authors. All rights reserved. Use
// of this source code is governed by a BSD-style license that can be found in
// the LICENSE file.

package vfs // import "github.com/cockroachdb/pebble/vfs"

import (
	"bytes"
	"fmt"
	"io"
	"os"
	"path"
	"sort"
	"strings"
	"sync"
	"sync/atomic"
	"time"

	"github.com/cockroachdb/errors"
	"github.com/cockroachdb/errors/oserror"
	"github.com/cockroachdb/pebble/internal/invariants"
)

const sep = "/"

// NewMem returns a new memory-backed FS implementation.
func NewMem() *MemFS {
	return &MemFS{
		root: newRootMemNode(),
	}
}

// NewStrictMem returns a "strict" memory-backed FS implementation. The behaviour is strict wrt
// needing a Sync() call on files or directories for the state changes to be finalized. Any
// changes that are not finalized are visible to reads until MemFS.ResetToSyncedState() is called,
// at which point they are discarded and no longer visible.
//
// Expected usage:
//
//	strictFS := NewStrictMem()
//	db := Open(..., &Options{FS: strictFS})
//	// Do and commit various operations.
//	...
//	// Prevent any more changes to finalized state.
//	strictFS.SetIgnoreSyncs(true)
//	// This will finish any ongoing background flushes, compactions but none of these writes will
//	// be finalized since syncs are being ignored.
//	db.Close()
//	// Discard unsynced state.
//	strictFS.ResetToSyncedState()
//	// Allow changes to finalized state.
//	strictFS.SetIgnoreSyncs(false)
//	// Open the DB. This DB should have the same state as if the earlier strictFS operations and
//	// db.Close() were not called.
//	db := Open(..., &Options{FS: strictFS})
func NewStrictMem() *MemFS {
	return &MemFS{
		root:   newRootMemNode(),
		strict: true,
	}
}

// NewMemFile returns a memory-backed File implementation. The memory-backed
// file takes ownership of data.
func NewMemFile(data []byte) File {
	n := &memNode{}
	n.refs.Store(1)
	n.mu.data = data
	n.mu.modTime = time.Now()
	return &memFile{
		n:    n,
		read: true,
	}
}

// MemFS implements FS.
type MemFS struct {
	mu   sync.Mutex
	root *memNode

	strict      bool
	ignoreSyncs bool
	// Windows has peculiar semantics with respect to hard links and deleting
	// open files. In tests meant to exercise this behavior, this flag can be
	// set to error if removing an open file.
	windowsSemantics bool
}

var _ FS = &MemFS{}

// UseWindowsSemantics configures whether the MemFS implements Windows-style
// semantics, in particular with respect to whether any of an open file's links
// may be removed. Windows semantics default to off.
func (y *MemFS) UseWindowsSemantics(windowsSemantics bool) {
	y.mu.Lock()
	defer y.mu.Unlock()
	y.windowsSemantics = windowsSemantics
}

// String dumps the contents of the MemFS.
func (y *MemFS) String() string {
	y.mu.Lock()
	defer y.mu.Unlock()

	s := new(bytes.Buffer)
	y.root.dump(s, 0)
	return s.String()
}

// SetIgnoreSyncs sets the MemFS.ignoreSyncs field. See the usage comment with NewStrictMem() for
// details.
func (y *MemFS) SetIgnoreSyncs(ignoreSyncs bool) {
	y.mu.Lock()
	if !y.strict {
		// noop
		return
	}
	y.ignoreSyncs = ignoreSyncs
	y.mu.Unlock()
}

// ResetToSyncedState discards state in the FS that is not synced. See the usage comment with
// NewStrictMem() for details.
func (y *MemFS) ResetToSyncedState() {
	if !y.strict {
		// noop
		return
	}
	y.mu.Lock()
	y.root.resetToSyncedState()
	y.mu.Unlock()
}

// walk walks the directory tree for the fullname, calling f at each step. If
// f returns an error, the walk will be aborted and return that same error.
//
// Each walk is atomic: y's mutex is held for the entire operation, including
// all calls to f.
//
// dir is the directory at that step, frag is the name fragment, and final is
// whether it is the final step. For example, walking "/foo/bar/x" will result
// in 3 calls to f:
//   - "/", "foo", false
//   - "/foo/", "bar", false
//   - "/foo/bar/", "x", true
//
// Similarly, walking "/y/z/", with a trailing slash, will result in 3 calls to f:
//   - "/", "y", false
//   - "/y/", "z", false
//   - "/y/z/", "", true
func (y *MemFS) walk(fullname string, f func(dir *memNode, frag string, final bool) error) error {
	y.mu.Lock()
	defer y.mu.Unlock()

	// For memfs, the current working directory is the same as the root directory,
	// so we strip off any leading "/"s to make fullname a relative path, and
	// the walk starts at y.root.
	for len(fullname) > 0 && fullname[0] == sep[0] {
		fullname = fullname[1:]
	}
	dir := y.root

	for {
		frag, remaining := fullname, ""
		i := strings.IndexRune(fullname, rune(sep[0]))
		final := i < 0
		if !final {
			frag, remaining = fullname[:i], fullname[i+1:]
			for len(remaining) > 0 && remaining[0] == sep[0] {
				remaining = remaining[1:]
			}
		}
		if err := f(dir, frag, final); err != nil {
			return err
		}
		if final {
			break
		}
		child := dir.children[frag]
		if child == nil {
			return &os.PathError{
				Op:   "open",
				Path: fullname,
				Err:  oserror.ErrNotExist,
			}
		}
		if !child.isDir {
			return &os.PathError{
				Op:   "open",
				Path: fullname,
				Err:  errors.New("not a directory"),
			}
		}
		dir, fullname = child, remaining
	}
	return nil
}

// Create implements FS.Create.
func (y *MemFS) Create(fullname string) (File, error) {
	var ret *memFile
	err := y.walk(fullname, func(dir *memNode, frag string, final bool) error {
		if final {
			if frag == "" {
				return errors.New("pebble/vfs: empty file name")
			}
			n := &memNode{name: frag}
			dir.children[frag] = n
			ret = &memFile{
				n:     n,
				fs:    y,
				read:  true,
				write: true,
			}
		}
		return nil
	})
	if err != nil {
		return nil, err
	}
	ret.n.refs.Add(1)
	return ret, nil
}

// Link implements FS.Link.
func (y *MemFS) Link(oldname, newname string) error {
	var n *memNode
	err := y.walk(oldname, func(dir *memNode, frag string, final bool) error {
		if final {
			if frag == "" {
				return errors.New("pebble/vfs: empty file name")
			}
			n = dir.children[frag]
		}
		return nil
	})
	if err != nil {
		return err
	}
	if n == nil {
		return &os.LinkError{
			Op:  "link",
			Old: oldname,
			New: newname,
			Err: oserror.ErrNotExist,
		}
	}
	return y.walk(newname, func(dir *memNode, frag string, final bool) error {
		if final {
			if frag == "" {
				return errors.New("pebble/vfs: empty file name")
			}
			if _, ok := dir.children[frag]; ok {
				return &os.LinkError{
					Op:  "link",
					Old: oldname,
					New: newname,
					Err: oserror.ErrExist,
				}
			}
			dir.children[frag] = n
		}
		return nil
	})
}

func (y *MemFS) open(fullname string, openForWrite bool) (File, error) {
	var ret *memFile
	err := y.walk(fullname, func(dir *memNode, frag string, final bool) error {
		if final {
			if frag == "" {
				ret = &memFile{
					n:  dir,
					fs: y,
				}
				return nil
			}
			if n := dir.children[frag]; n != nil {
				ret = &memFile{
					n:     n,
					fs:    y,
					read:  true,
					write: openForWrite,
				}
			}
		}
		return nil
	})
	if err != nil {
		return nil, err
	}
	if ret == nil {
		return nil, &os.PathError{
			Op:   "open",
			Path: fullname,
			Err:  oserror.ErrNotExist,
		}
	}
	ret.n.refs.Add(1)
	return ret, nil
}

// Open implements FS.Open.
func (y *MemFS) Open(fullname string, opts ...OpenOption) (File, error) {
	return y.open(fullname, false /* openForWrite */)
}

// OpenReadWrite implements FS.OpenReadWrite.
func (y *MemFS) OpenReadWrite(fullname string, opts ...OpenOption) (File, error) {
	f, err := y.open(fullname, true /* openForWrite */)
	pathErr, ok := err.(*os.PathError)
	if ok && pathErr.Err == oserror.ErrNotExist {
		return y.Create(fullname)
	}
	return f, err
}

// OpenDir implements FS.OpenDir.
func (y *MemFS) OpenDir(fullname string) (File, error) {
	return y.open(fullname, false /* openForWrite */)
}

// Remove implements FS.Remove.
func (y *MemFS) Remove(fullname string) error {
	return y.walk(fullname, func(dir *memNode, frag string, final bool) error {
		if final {
			if frag == "" {
				return errors.New("pebble/vfs: empty file name")
			}
			child, ok := dir.children[frag]
			if !ok {
				return oserror.ErrNotExist
			}
			if y.windowsSemantics {
				// Disallow removal of open files/directories which implements
				// Windows semantics. This ensures that we don't regress in the
				// ordering of operations and try to remove a file while it is
				// still open.
				if n := child.refs.Load(); n > 0 {
					return oserror.ErrInvalid
				}
			}
			if len(child.children) > 0 {
				return errNotEmpty
			}
			delete(dir.children, frag)
		}
		return nil
	})
}

// RemoveAll implements FS.RemoveAll.
func (y *MemFS) RemoveAll(fullname string) error {
	err := y.walk(fullname, func(dir *memNode, frag string, final bool) error {
		if final {
			if frag == "" {
				return errors.New("pebble/vfs: empty file name")
			}
			_, ok := dir.children[frag]
			if !ok {
				return nil
			}
			delete(dir.children, frag)
		}
		return nil
	})
	// Match os.RemoveAll which returns a nil error even if the parent
	// directories don't exist.
	if oserror.IsNotExist(err) {
		err = nil
	}
	return err
}

// Rename implements FS.Rename.
func (y *MemFS) Rename(oldname, newname string) error {
	var n *memNode
	err := y.walk(oldname, func(dir *memNode, frag string, final bool) error {
		if final {
			if frag == "" {
				return errors.New("pebble/vfs: empty file name")
			}
			n = dir.children[frag]
			delete(dir.children, frag)
		}
		return nil
	})
	if err != nil {
		return err
	}
	if n == nil {
		return &os.PathError{
			Op:   "open",
			Path: oldname,
			Err:  oserror.ErrNotExist,
		}
	}
	return y.walk(newname, func(dir *memNode, frag string, final bool) error {
		if final {
			if frag == "" {
				return errors.New("pebble/vfs: empty file name")
			}
			dir.children[frag] = n
			n.name = frag
		}
		return nil
	})
}

// ReuseForWrite implements FS.ReuseForWrite.
func (y *MemFS) ReuseForWrite(oldname, newname string) (File, error) {
	if err := y.Rename(oldname, newname); err != nil {
		return nil, err
	}
	f, err := y.Open(newname)
	if err != nil {
		return nil, err
	}
	y.mu.Lock()
	defer y.mu.Unlock()

	mf := f.(*memFile)
	mf.read = false
	mf.write = true
	return f, nil
}

// MkdirAll implements FS.MkdirAll.
func (y *MemFS) MkdirAll(dirname string, perm os.FileMode) error {
	return y.walk(dirname, func(dir *memNode, frag string, final bool) error {
		if frag == "" {
			if final {
				return nil
			}
			return errors.New("pebble/vfs: empty file name")
		}
		child := dir.children[frag]
		if child == nil {
			dir.children[frag] = &memNode{
				name:     frag,
				children: make(map[string]*memNode),
				isDir:    true,
			}
			return nil
		}
		if !child.isDir {
			return &os.PathError{
				Op:   "open",
				Path: dirname,
				Err:  errors.New("not a directory"),
			}
		}
		return nil
	})
}

// Lock implements FS.Lock.
func (y *MemFS) Lock(fullname string) (io.Closer, error) {
	// FS.Lock excludes other processes, but other processes cannot see this
	// process' memory. We translate Lock into Create so that have the normal
	// detection of non-existent directory paths.
	return y.Create(fullname)
}

// List implements FS.List.
func (y *MemFS) List(dirname string) ([]string, error) {
	if !strings.HasSuffix(dirname, sep) {
		dirname += sep
	}
	var ret []string
	err := y.walk(dirname, func(dir *memNode, frag string, final bool) error {
		if final {
			if frag != "" {
				panic("unreachable")
			}
			ret = make([]string, 0, len(dir.children))
			for s := range dir.children {
				ret = append(ret, s)
			}
		}
		return nil
	})
	return ret, err
}

// Stat implements FS.Stat.
func (y *MemFS) Stat(name string) (os.FileInfo, error) {
	f, err := y.Open(name)
	if err != nil {
		if pe, ok := err.(*os.PathError); ok {
			pe.Op = "stat"
		}
		return nil, err
	}
	defer f.Close()
	return f.Stat()
}

// PathBase implements FS.PathBase.
func (*MemFS) PathBase(p string) string {
	// Note that MemFS uses forward slashes for its separator, hence the use of
	// path.Base, not filepath.Base.
	return path.Base(p)
}

// PathJoin implements FS.PathJoin.
func (*MemFS) PathJoin(elem ...string) string {
	// Note that MemFS uses forward slashes for its separator, hence the use of
	// path.Join, not filepath.Join.
	return path.Join(elem...)
}

// PathDir implements FS.PathDir.
func (*MemFS) PathDir(p string) string {
	// Note that MemFS uses forward slashes for its separator, hence the use of
	// path.Dir, not filepath.Dir.
	return path.Dir(p)
}

// GetDiskUsage implements FS.GetDiskUsage.
func (*MemFS) GetDiskUsage(string) (DiskUsage, error) {
	return DiskUsage{}, ErrUnsupported
}

// memNode holds a file's data or a directory's children, and implements os.FileInfo.
type memNode struct {
	name  string
	isDir bool
	refs  atomic.Int32

	// Mutable state.
	// - For a file: data, syncedDate, modTime: A file is only being mutated by a single goroutine,
	//   but there can be concurrent readers e.g. DB.Checkpoint() which can read WAL or MANIFEST
	//   files that are being written to. Additionally Sync() calls can be concurrent with writing.
	// - For a directory: children and syncedChildren. Concurrent writes are possible, and
	//   these are protected using MemFS.mu.
	mu struct {
		sync.Mutex
		data       []byte
		syncedData []byte
		modTime    time.Time
	}

	children       map[string]*memNode
	syncedChildren map[string]*memNode
}

func newRootMemNode() *memNode {
	return &memNode{
		name:     "/", // set the name to match what file systems do
		children: make(map[string]*memNode),
		isDir:    true,
	}
}

func (f *memNode) IsDir() bool {
	return f.isDir
}

func (f *memNode) ModTime() time.Time {
	f.mu.Lock()
	defer f.mu.Unlock()
	return f.mu.modTime
}

func (f *memNode) Mode() os.FileMode {
	if f.isDir {
		return os.ModeDir | 0755
	}
	return 0755
}

func (f *memNode) Name() string {
	return f.name
}

func (f *memNode) Size() int64 {
	f.mu.Lock()
	defer f.mu.Unlock()
	return int64(len(f.mu.data))
}

func (f *memNode) Sys() interface{} {
	return nil
}

func (f *memNode) dump(w *bytes.Buffer, level int) {
	if f.isDir {
		w.WriteString("          ")
	} else {
		f.mu.Lock()
		fmt.Fprintf(w, "%8d  ", len(f.mu.data))
		f.mu.Unlock()
	}
	for i := 0; i < level; i++ {
		w.WriteString("  ")
	}
	w.WriteString(f.name)
	if !f.isDir {
		w.WriteByte('\n')
		return
	}
	if level > 0 { // deal with the fact that the root's name is already "/"
		w.WriteByte(sep[0])
	}
	w.WriteByte('\n')
	names := make([]string, 0, len(f.children))
	for name := range f.children {
		names = append(names, name)
	}
	sort.Strings(names)
	for _, name := range names {
		f.children[name].dump(w, level+1)
	}
}

func (f *memNode) resetToSyncedState() {
	if f.isDir {
		f.children = make(map[string]*memNode)
		for k, v := range f.syncedChildren {
			f.children[k] = v
		}
		for _, v := range f.children {
			v.resetToSyncedState()
		}
	} else {
		f.mu.Lock()
		f.mu.data = append([]byte(nil), f.mu.syncedData...)
		f.mu.Unlock()
	}
}

// memFile is a reader or writer of a node's data, and implements File.
type memFile struct {
	n           *memNode
	fs          *MemFS // nil for a standalone memFile
	rpos        int
	wpos        int
	read, write bool
}

var _ File = (*memFile)(nil)

func (f *memFile) Close() error {
	if n := f.n.refs.Add(-1); n < 0 {
		panic(fmt.Sprintf("pebble: close of unopened file: %d", n))
	}
	f.n = nil
	return nil
}

func (f *memFile) Read(p []byte) (int, error) {
	if !f.read {
		return 0, errors.New("pebble/vfs: file was not opened for reading")
	}
	if f.n.isDir {
		return 0, errors.New("pebble/vfs: cannot read a directory")
	}
	f.n.mu.Lock()
	defer f.n.mu.Unlock()
	if f.rpos >= len(f.n.mu.data) {
		return 0, io.EOF
	}
	n := copy(p, f.n.mu.data[f.rpos:])
	f.rpos += n
	return n, nil
}

func (f *memFile) ReadAt(p []byte, off int64) (int, error) {
	if !f.read {
		return 0, errors.New("pebble/vfs: file was not opened for reading")
	}
	if f.n.isDir {
		return 0, errors.New("pebble/vfs: cannot read a directory")
	}
	f.n.mu.Lock()
	defer f.n.mu.Unlock()
	if off >= int64(len(f.n.mu.data)) {
		return 0, io.EOF
	}
	n := copy(p, f.n.mu.data[off:])
	if n < len(p) {
		return n, io.EOF
	}
	return n, nil
}

func (f *memFile) Write(p []byte) (int, error) {
	if !f.write {
		return 0, errors.New("pebble/vfs: file was not created for writing")
	}
	if f.n.isDir {
		return 0, errors.New("pebble/vfs: cannot write a directory")
	}
	f.n.mu.Lock()
	defer f.n.mu.Unlock()
	f.n.mu.modTime = time.Now()
	if f.wpos+len(p) <= len(f.n.mu.data) {
		n := copy(f.n.mu.data[f.wpos:f.wpos+len(p)], p)
		if n != len(p) {
			panic("stuff")
		}
	} else {
		f.n.mu.data = append(f.n.mu.data[:f.wpos], p...)
	}
	f.wpos += len(p)

	if invariants.Enabled {
		// Mutate the input buffer to flush out bugs in Pebble which expect the
		// input buffer to be unmodified.
		for i := range p {
			p[i] ^= 0xff
		}
	}
	return len(p), nil
}

func (f *memFile) WriteAt(p []byte, ofs int64) (int, error) {
	if !f.write {
		return 0, errors.New("pebble/vfs: file was not created for writing")
	}
	if f.n.isDir {
		return 0, errors.New("pebble/vfs: cannot write a directory")
	}
	f.n.mu.Lock()
	defer f.n.mu.Unlock()
	f.n.mu.modTime = time.Now()

	for len(f.n.mu.data) < int(ofs)+len(p) {
		f.n.mu.data = append(f.n.mu.data, 0)
	}

	n := copy(f.n.mu.data[int(ofs):int(ofs)+len(p)], p)
	if n != len(p) {
		panic("stuff")
	}

	return len(p), nil
}

func (f *memFile) Prefetch(offset int64, length int64) error { return nil }
func (f *memFile) Preallocate(offset, length int64) error    { return nil }

func (f *memFile) Stat() (os.FileInfo, error) {
	return f.n, nil
}

func (f *memFile) Sync() error {
	if f.fs != nil && f.fs.strict {
		f.fs.mu.Lock()
		defer f.fs.mu.Unlock()
		if f.fs.ignoreSyncs {
			return nil
		}
		if f.n.isDir {
			f.n.syncedChildren = make(map[string]*memNode)
			for k, v := range f.n.children {
				f.n.syncedChildren[k] = v
			}
		} else {
			f.n.mu.Lock()
			f.n.mu.syncedData = append([]byte(nil), f.n.mu.data...)
			f.n.mu.Unlock()
		}
	}
	return nil
}

func (f *memFile) SyncData() error {
	return f.Sync()
}

func (f *memFile) SyncTo(length int64) (fullSync bool, err error) {
	// NB: This SyncTo implementation lies, with its return values claiming it
	// synced the data up to `length`. When fullSync=false, SyncTo provides no
	// durability guarantees, so this can help surface bugs where we improperly
	// rely on SyncTo providing durability.
	return false, nil
}

func (f *memFile) Fd() uintptr {
	return InvalidFd
}

// Flush is a no-op and present only to prevent buffering at higher levels
// (e.g. it prevents sstable.Writer from using a bufio.Writer).
func (f *memFile) Flush() error {
	return nil
}

repository: cockroachdb/pebble

repo_name: cockroachdb/pebble


text:
@inproceedings{lou2020understanding,
  title={Understanding, Detecting and Localizing Partial Failures in Large System Software},
  author={Lou, Chang and Huang, Peng and Smith, Scott},
  booktitle={17th $\{$USENIX$\}$ Symposium on Networked Systems Design and Implementation ($\{$NSDI$\}$ 20)},
  pages={559--574},
  year={2020}
}

@inproceedings{huang2018capturing,
  title={Capturing and enhancing in situ system observability for failure detection},
  author={Huang, Peng and Guo, Chuanxiong and Lorch, Jacob R and Zhou, Lidong and Dang, Yingnong},
  booktitle={13th $\{$USENIX$\}$ Symposium on Operating Systems Design and Implementation ($\{$OSDI$\}$ 18)},
  pages={1--16},
  year={2018}
}

@inproceedings{leners2011detecting,
  title={Detecting failures in distributed systems with the falcon spy network},
  author={Leners, Joshua B and Wu, Hao and Hung, Wei-Lun and Aguilera, Marcos K and Walfish, Michael},
  booktitle={Proceedings of the Twenty-Third ACM Symposium on Operating Systems Principles},
  pages={279--294},
  year={2011}
}

repository: li-xin-yi/partial-failures-slides

repo_name: li-xin-yi/partial-failures-slides


text:
DESCRIPTION = "Nabi is an easy and powerful GNU XIM for the Korean language"
HOMEPAGE = "http://nabi.kldp.net/"
SECTION = "x11/input"
LICENSE = "GPL"
DEPENDS = "gtk+ libhangul"

SRC_URI = "http://kldp.net/frs/download.php/3742/${PN}-${PV}.tar.gz"

inherit autotools pkgconfig

SRC_URI[md5sum] = "8746890ea666ac1b7ae6db77993c6592"
SRC_URI[sha256sum] = "1a239a7bb0644441ca781459fbf5a1c5fb95e823351bf308aa680eb60cc45b94"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
@book{bass15,
  title={DevOps: A software architect's perspective},
  author={Bass, Len and Weber, Ingo and Zhu, Liming},
  year={2015},
  publisher={Addison-Wesley Professional}
}

@book{humble2010,
  title={Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation (Adobe Reader)},
  author={Humble, Jez and Farley, David},
  year={2010},
  publisher={Pearson Education}
}

@book{davis2016,
  title={Effective DevOps: building a culture of collaboration, affinity, and tooling at scale},
  author={Davis, Jennifer and Daniels, Ryn},
  year={2016},
  publisher={O'Reilly Media, Inc.}
}

@inproceedings{kerzazi2016,
 author = {Kerzazi, Noureddine and Adams, Bram},
 title = {Who Needs Release and Devops Engineers, and Why?},
 booktitle = {Proceedings of the International Workshop on Continuous Software Evolution and Delivery},
 series = {CSED'16},
 year = {2016},
 location = {Austin, Texas},
 pages = {77--83},
 numpages = {7},
 publisher = {ACM},
 address = {New York, NY, USA}
}

@mastersthesis{paule2018,
  title={Securing DevOps: detection of vulnerabilities in CD pipelines},
  author={Paule, Christina},
  year={2018}
}

@inproceedings{palihawadana2017,
  title={Tool support for traceability management of software artefacts with DevOps practices},
  author={Palihawadana, S and Wijeweera, CH and Sanjitha, MGTN and Liyanage, VK and Perera, I and Meedeniya, DA},
  booktitle={2017 Moratuwa Engineering Research Conference (MERCon)},
  pages={129--134},
  year={2017},
  organization={IEEE}
}

@inproceedings{erich2018,
  title={DevOps is Simply Interaction Between Development and Operations},
  author={Erich, Floris},
  booktitle={International Workshop on Software Engineering Aspects of Continuous Development and New Paradigms of Software Production and Deployment},
  pages={89--99},
  year={2018},
  organization={Springer}
}

@inproceedings{qiu2004,
 author = {Qiu, Dongyu and Srikant, R.},
 title = {Modeling and Performance Analysis of BitTorrent-like Peer-to-peer Networks},
 booktitle = {Proceedings of the 2004 Conference on Applications, Technologies, Architectures, and Protocols for Computer Communications},
 series = {SIGCOMM'04},
 year = {2004},
 location = {Portland, Oregon, USA},
 pages = {367--378},
 numpages = {12},
 publisher = {ACM},
 address = {New York, NY, USA}
}

@inproceedings{pouwelse2005,
  title={The bittorrent p2p file-sharing system: Measurements and analysis},
  author={Pouwelse, Johan and Garbacki, Pawe{\l} and Epema, Dick and Sips, Henk},
  booktitle={International Workshop on Peer-to-Peer Systems},
  pages={205--216},
  year={2005},
  organization={Springer}
}

@inproceedings{kopp2017,
  title={Design of a privacy-preserving decentralized file storage with financial incentives},
  author={Kopp, Henning and M{\"o}dinger, David and Hauck, Franz and Kargl, Frank and B{\"o}sch, Christoph},
  booktitle={2017 IEEE European Symposium on Security and Privacy Workshops (EuroS\&PW)},
  pages={14--22},
  year={2017},
  organization={IEEE}
}

@inproceedings{shafagh2017,
  title={Towards blockchain-based auditable storage and sharing of IoT data},
  author={Shafagh, Hossein and Burkhalter, Lukas and Hithnawi, Anwar and Duquennoy, Simon},
  booktitle={Proceedings of the 2017 on Cloud Computing Security Workshop},
  pages={45--50},
  year={2017},
  organization={ACM}
}

@inproceedings{zhu2019,
  title={Blockchain-based Decentralized Storage Scheme},
  author={Zhu, Yan and Lv, Chunli and Zeng, Zichuan and Wang, Jingfu and Pei, Bei},
  booktitle={Journal of Physics: Conference Series},
  volume={1237},
  number={4},
  pages={042008},
  year={2019},
  organization={IOP Publishing}
}

repository: artipie/white-paper

repo_name: artipie/white-paper

gha_language: TeX


text:
#
# Install ilastik headless (non-GUI) from source
#
# Ilastik is composed of 3 git repos, 2 of which are necessary for headless mode.
#
# lazyflow
# applet-workflows
# volumina (for gui builds)
#
# Also, you must build lazyflow/lazyflow/drtile with CMake to produce drtile.so shared library.
# This is done in the CONFIGURE_COMMAND below and the shared library is saved in the
# drtile source directory.

if (NOT lazyflow_NAME)

CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

include (ExternalProject)
include (ExternalSource)
include (BuildSupport)
include (TemplateSupport)

include (vigra)
include (h5py)
include (psutil)
include (blist)
include (greenlet)

external_git_repo (lazyflow
    HEAD
    http://github.com/ilastik/lazyflow)

message ("Installing ${lazyflow_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    # On Mac OS X, building drtile requires explicitly setting several cmake cache variables
    ExternalProject_Add(${lazyflow_NAME}
        DEPENDS             ${vigra_NAME} ${h5py_NAME} ${psutil_NAME}
                            ${blist_NAME} ${greenlet_NAME}
        PREFIX              ${BUILDEM_DIR}
        GIT_REPOSITORY      ${lazyflow_URL}
        UPDATE_COMMAND      ""
        PATCH_COMMAND       ""
        CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND}
            -DLIBRARY_OUTPUT_PATH=${lazyflow_SRC_DIR}/lazyflow/drtile
            -DCMAKE_PREFIX_PATH=${BUILDEM_DIR}
            -DPYTHON_EXECUTABLE=${PYTHON_EXE}
            -DPYTHON_INCLUDE_DIR=${PYTHON_PREFIX}/include/python2.7
            "-DPYTHON_LIBRARY=${PYTHON_PREFIX}/lib/libpython2.7.${BUILDEM_PLATFORM_DYLIB_EXTENSION}"
            -DPYTHON_NUMPY_INCLUDE_DIR=${PYTHON_PREFIX}/lib/python2.7/site-packages/numpy/core/include
            -DVIGRA_NUMPY_CORE_LIBRARY=${PYTHON_PREFIX}/lib/python2.7/site-packages/vigra/vigranumpycore.so
            ${lazyflow_SRC_DIR}/lazyflow/drtile
        # For some reason, python refuses to recognize the shared library unless it ends with .so.
        # Renaming it seems to do the trick
        BUILD_COMMAND       ${BUILDEM_ENV_STRING} make && mv ${lazyflow_SRC_DIR}/lazyflow/drtile/drtile.dylib ${lazyflow_SRC_DIR}/lazyflow/drtile/drtile.so
        TEST_COMMAND        ""
        INSTALL_COMMAND     ""
    )
else()
    # On Linux, building drtile requires less explicit configuration
    # The explicit configuration above would probably work, but let's keep this simple...
    ExternalProject_Add(${lazyflow_NAME}
        DEPENDS             ${vigra_NAME} ${h5py_NAME} ${psutil_NAME}
                            ${blist_NAME} ${greenlet_NAME}
        PREFIX              ${BUILDEM_DIR}
        GIT_REPOSITORY      ${lazyflow_URL}
        UPDATE_COMMAND      ""
        PATCH_COMMAND       ""
        CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND}
            -DLIBRARY_OUTPUT_PATH=${lazyflow_SRC_DIR}/lazyflow/drtile
            -DCMAKE_PREFIX_PATH=${BUILDEM_DIR}
            -DVIGRA_ROOT=${BUILDEM_DIR}
            ${lazyflow_SRC_DIR}/lazyflow/drtile
        BUILD_COMMAND       ${BUILDEM_ENV_STRING} make
        TEST_COMMAND        ""
        INSTALL_COMMAND     ""
    )
endif()

set_target_properties(${lazyflow_NAME} PROPERTIES EXCLUDE_FROM_ALL ON)

endif (NOT lazyflow_NAME)

repository: fblumenthal/buildem

repo_name: fblumenthal/buildem


text:
# This recipe provides the kernel with PREEMPT_RT patches and is based on
# linux-linaro-arm_5.4.bb. Set PREFERRED_PROVIDER_virtual/kernel to
# linux-linaro-arm-rt to enable it as the default kernel.
require linux-linaro-arm_5.4.bb

#
# Include preempt-rt patches
#
SRC_URI_append = " https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.4/older/patch-5.4.3-rt1.patch.gz;name=rt-patch"
SRC_URI[rt-patch.sha256sum] = "6b92ba32c7ce30919c9b66e49e5f1dce58e1f8bd92fef91e548d6f2d434a2b39"

LINUX_KERNEL_TYPE = "preempt-rt"

repository: akavoukis/meta-arm

repo_name: akavoukis/meta-arm


text:
import {Component} from 'react';
import heartIcon from './assets/heartIcon.png';
import 'bootstrap/dist/css/bootstrap.min.css';
import Col from 'react-bootstrap/Col';
import Card from 'react-bootstrap/Card';

class HornedBeast extends Component {

  constructor(props) {
    super(props);
    this.state = {
      'favorites': 0
    };
  }

  handleHeartClick = () => {
    const newFavorites = this.state.favorites + 1;
    this.setState({
      favorites: newFavorites
    });
  }

  render() {
    return (
      <Col sm={3}>
        <Card id="card" onClick={this.handleHeartClick}>
          <Card.Img onClick={() => this.props.onCardImgClick(this.props)} variant="top" src={this.props.image_url} alt={this.props.title} title={this.props.title}/>
          <Card.Body>
            <Card.Title>{this.props.title}</Card.Title>
            <Card.Text>{this.props.description}</Card.Text>
            <Card.Text>Horns: {this.props.horns}</Card.Text>
            <Card.Img id="favoriteHeart" src={heartIcon} alt="heart icon" />
            <Card.Text id="favoriteCount">{this.state.favorites}</Card.Text>
          </Card.Body>
        </Card>
      </Col>
    );
  }
}

export default HornedBeast;

repository: SarahCreager/horned-beasts-react-app

repo_name: SarahCreager/horned-beasts-react-app

gha_language: JavaScript

extension: js


text:
# - Try to find Newmat
# Once done, this will define
#
#  Newmat_FOUND - system has Newmat
#  Newmat_INCLUDE_DIRS - the Newmat include directories
#  Newmat_LIBRARIES - link these to use Newmat

if (Newmat_INCLUDE_DIRS AND Newmat_LIBRARIES)
	# in cache already
	set(Newmat_FOUND TRUE)
else (Newmat_INCLUDE_DIRS AND Newmat_LIBRARIES)
	include(LibFindMacros)

	# Dependencies
	# NOTE: Newmat has no explicit dependencies.
	# libfind_package(Newmat Dependencies)

	# Use pkg-config to get hints about paths
	libfind_pkg_check_modules(Newmat_PKGCONF newmat)

	# Include dir
	find_path(Newmat_INCLUDE_DIR
		NAMES newmat/newmat.h
		PATHS
			${Newmat_PKGCONF_INCLUDE_DIRS}
			/usr/include
			/usr/local/include
	)

	# Finally the library itself
	find_library(Newmat_LIBRARY
		NAMES newmat
		PATHS ${Newmat_PKGCONF_LIBRARY_DIRS}
	)

	# Set the include dir variables and the libraries and let libfind_process do the rest.
	# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
	set(Newmat_PROCESS_INCLUDES Newmat_INCLUDE_DIR)
	set(Newmat_PROCESS_LIBS Newmat_LIBRARY)
	libfind_process(Newmat)

	if (Newmat_INCLUDE_DIRS AND Newmat_LIBRARIES)
		set(Newmat_FOUND TRUE)
	endif (Newmat_INCLUDE_DIRS AND Newmat_LIBRARIES)
endif (Newmat_INCLUDE_DIRS AND Newmat_LIBRARIES)

repository: rschurade/braingl

repo_name: rschurade/braingl