text:
// Code generated by SQLBoiler 4.8.6 (https://github.com/volatiletech/sqlboiler). DO NOT EDIT.
// This file is meant to be re-generated in place and/or deleted at any time.

package mdbmodels

var TableNames = struct {
	AuthorI18n              string
	Authors                 string
	AuthorsSources          string
	BlogPosts               string
	Blogs                   string
	CollectionI18n          string
	Collections             string
	CollectionsContentUnits string
	ContentRoleTypes        string
	ContentTypes            string
	ContentUnitDerivations  string
	ContentUnitI18n         string
	ContentUnits            string
	ContentUnitsPersons     string
	ContentUnitsPublishers  string
	ContentUnitsSources     string
	ContentUnitsTags        string
	Files                   string
	FilesOperations         string
	FilesStorages           string
	LabelI18n               string
	LabelTag                string
	Labels                  string
	OperationTypes          string
	Operations              string
	PersonI18n              string
	Persons                 string
	PublisherI18n           string
	Publishers              string
	SourceI18n              string
	SourceTypes             string
	Sources                 string
	Storages                string
	TagI18n                 string
	Tags                    string
	TwitterTweets           string
	TwitterUsers            string
	Users                   string
}{
	AuthorI18n:              "author_i18n",
	Authors:                 "authors",
	AuthorsSources:          "authors_sources",
	BlogPosts:               "blog_posts",
	Blogs:                   "blogs",
	CollectionI18n:          "collection_i18n",
	Collections:             "collections",
	CollectionsContentUnits: "collections_content_units",
	ContentRoleTypes:        "content_role_types",
	ContentTypes:            "content_types",
	ContentUnitDerivations:  "content_unit_derivations",
	ContentUnitI18n:         "content_unit_i18n",
	ContentUnits:            "content_units",
	ContentUnitsPersons:     "content_units_persons",
	ContentUnitsPublishers:  "content_units_publishers",
	ContentUnitsSources:     "content_units_sources",
	ContentUnitsTags:        "content_units_tags",
	Files:                   "files",
	FilesOperations:         "files_operations",
	FilesStorages:           "files_storages",
	LabelI18n:               "label_i18n",
	LabelTag:                "label_tag",
	Labels:                  "labels",
	OperationTypes:          "operation_types",
	Operations:              "operations",
	PersonI18n:              "person_i18n",
	Persons:                 "persons",
	PublisherI18n:           "publisher_i18n",
	Publishers:              "publishers",
	SourceI18n:              "source_i18n",
	SourceTypes:             "source_types",
	Sources:                 "sources",
	Storages:                "storages",
	TagI18n:                 "tag_i18n",
	Tags:                    "tags",
	TwitterTweets:           "twitter_tweets",
	TwitterUsers:            "twitter_users",
	Users:                   "users",
}

repository: Bnei-Baruch/archive-backend

repo_name: Bnei-Baruch/archive-backend


text:
package punct

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestPureWord(t *testing.T) {
	w, b, e := PureWord("mama.")
	assert.Equal(t, "mama", w)
	assert.Equal(t, "", b)
	assert.Equal(t, ".", e)
	w, b, e = PureWord("mama")
	assert.Equal(t, "mama", w)
	assert.Equal(t, "", b)
	assert.Equal(t, "", e)
}

func TestPureWordStartEnd(t *testing.T) {
	w, b, e := PureWord("(,mama.")
	assert.Equal(t, "mama", w)
	assert.Equal(t, "(,", b)
	assert.Equal(t, ".", e)
	w, b, e = PureWord("(-mama")
	assert.Equal(t, "mama", w)
	assert.Equal(t, "(-", b)
	assert.Equal(t, "", e)
}

func TestPureWord_NoChange(t *testing.T) {
	w, b, e := PureWord("„mama“")
	assert.Equal(t, "„mama“", w)
	assert.Equal(t, "", b)
	assert.Equal(t, "", e)
}

func TestTrimWord(t *testing.T) {
	s1, s2, s3 := TrimWord("<mama>", IsParentheses)
	test3(t, s1, s2, s3, "mama", "<", ">")
	s1, s2, s3 = TrimWord("<mama>", IsPunct)
	test3(t, s1, s2, s3, "<mama>", "", "")
	s1, s2, s3 = TrimWord(",..<mama>,-+", IsAllSep)
	test3(t, s1, s2, s3, "mama", ",..<", ">,-+")
}

func TestTrimQuote(t *testing.T) {
	assert.Equal(t, "mama", TrimQuote("„mama“"))
	assert.Equal(t, "mama", TrimQuote("mama“"))
	assert.Equal(t, "mama", TrimQuote("mama"))
	assert.Equal(t, "", TrimQuote(""))
	assert.Equal(t, "m", TrimQuote("„m“"))
	assert.Equal(t, "m", TrimQuote("m“"))
	assert.Equal(t, "m", TrimQuote("m"))
}

func test3(t *testing.T, s1, s2, s3, e1, e2, e3 string) {
	assert.Equal(t, e1, s1)
	assert.Equal(t, e2, s2)
	assert.Equal(t, e3, s3)
}

repository: airenas/pocolm

license_type: permissive

repo_name: airenas/pocolm

branch_name: refs/heads/master

extension: go


text:
DESCRIPTION = "a tool to perform local searches for known vulnerabilities "
AUTHOR = ""
HOMEPAGE = "https://github.com/cve-search/cve-search"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://README.md;startline=273;endline=280;md5=25abb122643498d4f7cf823ed712497e"
SRCREV = "18247fd56fca63ebbe29303a0b47e8626f47984c"
PR = "r0"

SRC_URI = "git://github.com/cve-search/cve-search.git;protocol=https;branch=master \
	file://fix_ssl_and_unicode_issue.patch"

S = "${WORKDIR}/git"

inherit native python3native

STARTMONGODB ??= "0"
MONGODB_SERVER ??= "127.0.0.1"
MONGODB_PORT ??= "27017"
MONGODB_NAME ??= "cvedb"
REDIS_SERVER ??= "127.0.0.1"
REDIS_PORT ??= "6379"
REDIS_VENDORSDB ??= "10"
REDIS_NOTIFICATIONSDB ??= "11"
REDIS_REFDB ??= "12"

do_configure[noexec] = "1"
do_compile[noexec] = "1"

do_install() {
	install -d ${D}${exec_prefix}
	cp -rvf ${S}/bin ${D}${exec_prefix}
	cp -rvf ${S}/sbin ${D}${exec_prefix}
	cp -rvf ${S}/lib ${D}${exec_prefix}
	create_wrapper ${D}${sbindir}/db_updater.py PYTHONPATH='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
	create_wrapper ${D}${sbindir}/db_mgmt.py PYTHONPATH='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
	create_wrapper ${D}${sbindir}/db_mgmt_cpe_dictionary.py PYTHONPATH='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
	create_wrapper ${D}${bindir}/search.py PYTHONPATH='${STAGING_DIR_HOST}/${PYTHON_SITEPACKAGES_DIR}'
}

PACKAGES = "${PN}"

FILES_${PN} = "${sbindir} ${sbindir} ${libdir}"

DEPENDS = "python3-native mongodb-native redis-native ${PYTHON3_DEPENDENCIES}"

PYTHON3_DEPENDENCIES = " \
        python3-pymongo-native \
        python3-whoosh-native \
        python3-redis-native \
        python3-dateutil-native \
        python3-flask-native \
        python3-flask-login-native \
        python3-flask-pymongo-native \
        python3-tornado-native \
        python3-passlib-native \
        python3-xlrd-native \
        python3-lxml-native \
        python3-feedformatter-native \
        python3-six-native \
        python3-pymisp-native \
        python3-pytz-native \
        "

do_start_mongodb() {
	${STAGING_BINDIR_NATIVE}/mongod \
	--port ${MONGODB_PORT} \
	--bind_ip ${MONGODB_SERVER} \
	--pidfilepath ${TMPDIR}/mongodb.pid \
	--noauth --fork --logappend \
	--logpath ${TMPDIR}/log/mongodb.log \
	--dbpath ${TMPDIR}/mongodb-data
}
do_start_mongodb[depends] = "mongodb-native:do_populate_sysroot"
do_start_mongodb[dirs] = "${TMPDIR}/mongodb-data ${TMPDIR}/log"
do_start_mongodb[nostamp] = "1"

do_start_redisdb() {
	${STAGING_BINDIR_NATIVE}/redis-server \
	--port ${REDIS_PORT} \
	--pidfile ${TMPDIR}/redis-server.pid \
	--bind ${REDIS_SERVER} \
	--dir ${TMPDIR}/redis-data \
	--daemonize yes
}
do_start_redisdb[depends] = "redis-native:do_populate_sysroot"
do_start_redisdb[nostamp] = "1"
do_start_redisdb[dirs] = "${TMPDIR}/redis-data"

do_initialize_db() {
	${STAGING_SBINDIR_NATIVE}/db_mgmt.py -p -v
	${STAGING_SBINDIR_NATIVE}/db_mgmt_cpe_dictionary.py
}

do_update_db() {
	${STAGING_SBINDIR_NATIVE}/db_updater.py -v
}

addtask start_redisdb before do_initialize_db before do_update_db
addtask start_mongodb before do_initialize_db before do_update_db
addtask initialize_db after do_populate_sysroot after do_initialize_db
addtask update_db after do_initialize_db after do_start_mongodb after do_start_redisdb

license: MIT

extension: bb


text:
// Copyright (c) 2019, The Emergent 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 main

import (
	"bufio"
	"io/ioutil"
	"log"
	"os"
	"strconv"
	"strings"

	_ "github.com/emer/etable/etview" // include to get gui views
	"github.com/goki/gi/gi"
	"github.com/goki/gi/gimain"
	"github.com/goki/gi/giv"
	"github.com/goki/ki/ki"
)

// this is the stub main for gogi that calls our actual
// mainrun function, at end of file
func main() {
	gimain.Main(func() {
		mainrun()
	})
}

type Gen struct {
	TranscriptDir   string          `view:"no-inline" desc:"directory of transcripts"`
	TranscriptFile  string          `view:"no-inline" desc:"a single transcript file"`
	DirOut          string          `view:"no-inline" desc:"directory of where to write files"`
	TranscriptFiles []string        `view:"no-inline" desc:"list of transcript files in TranscriptDir"`
	Seqs            []string        `view:"no-inline" desc:"the generated word sequences"`
	NSeqs           int             `desc:"the number of sequences to create"`
	Separator       string          `view:"no-inline" desc:"between words string"`
	StructView      *giv.StructView `view:"-" desc:"the params viewer"`
}

func NewGen() *Gen {
	g := Gen{}
	g.TranscriptFile = "/Users/rohrlich/gnuspeech_sa-master/generated/temp.txt"
	g.TranscriptDir = "/Users/rohrlich/gnuspeech_sa-master/generated/ChildesNuffieldTranscripts"
	g.DirOut = "/Users/rohrlich/gnuspeech_sa-master/generated/ChildesNuffieldUtterances/"
	return &g
}

// Reset clears the seqs and words slices
func (gn *Gen) Reset() {
	gn.Seqs = gn.Seqs[:0]
}

func check(e error) {
	if e != nil {
		panic(e)
	}
}

// WriteSeqs writes each sequence to a separate file
func (gn *Gen) WriteSeqs() {
	strs := strings.Split(gn.TranscriptFile, ".")
	file := strs[0]
	last := strings.LastIndex(file, "/")
	prefix := file[last+1 : len(file)]

	for i, s := range gn.Seqs {
		a := strconv.Itoa(i)
		id := ""
		if i > 9999 {
			id = "_" + a
		} else if i > 999 {
			id = "_0" + a
		} else if i > 99 {
			id = "_00" + a
		} else if i > 9 {
			id = "_000" + a
		} else {
			id = "_0000" + a
		}
		fn := gn.DirOut + prefix + id
		f, err := os.Create(fn)
		check(err)
		f.Write([]byte(s))
	}
}

// SplitTranscript
func (gn *Gen) SplitTranscript() {
	fp, err := os.Open(gn.TranscriptFile)
	if err != nil {
		log.Println(err)
	}
	defer fp.Close() // we will be done with the file within this function

	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanLines)
	for scanner.Scan() {
		txt := scanner.Text() + "\n"
		if strings.HasPrefix(txt, "*CDS:") {
			strs := strings.SplitAfter(txt, "*CDS:\t")
			if strings.HasPrefix(strs[1], "&") || strings.Contains(strs[1], "xxx") {
				continue
			}
			gn.Seqs = append(gn.Seqs, strs[1])
		}
	}
}

// LoadTranscripts
func (gn *Gen) LoadTranscripts() {
	files, err := ioutil.ReadDir(gn.TranscriptDir)
	if err != nil {
		log.Fatal(err)
	}
	for _, f := range files {
		gn.TranscriptFiles = append(gn.TranscriptFiles, f.Name())
	}
}

// SplitTranscripts
func (gn *Gen) SplitTranscripts() {
	for _, f := range gn.TranscriptFiles {
		gn.TranscriptFile = gn.TranscriptDir + "/" + f
		gn.SplitTranscript()
		gn.WriteSeqs()
		gn.Seqs = gn.Seqs[:0]
	}
}

////////////////////////////////////////////////////////////////////////////////////////////
// 		Gui

// ConfigGui configures the GoGi gui interface for this Aud
func (gn *Gen) ConfigGui() *gi.Window {
	width := 1600
	height := 1200

	gi.SetAppName("Gen")
	gi.SetAppAbout(`Gen concatenated strings of syllables`)

	win := gi.NewMainWindow("one", "Gen ...", width, height)

	vp := win.WinViewport2D()
	updt := vp.UpdateStart()

	mfr := win.SetMainFrame()

	tbar := gi.AddNewToolBar(mfr, "tbar")
	tbar.SetStretchMaxWidth()
	// vi.ToolBar = tbar

	split := gi.AddNewSplitView(mfr, "split")
	split.Dim = gi.X
	split.SetStretchMaxWidth()
	split.SetStretchMaxHeight()

	sv := giv.AddNewStructView(split, "sv")
	sv.SetStruct(gn)
	gn.StructView = sv

	// tv := gi.AddNewTabView(split, "tv")

	tbar.AddAction(gi.ActOpts{Label: "Reset", Icon: "new", Tooltip: ""}, win.This(),
		func(recv, send ki.Ki, sig int64, data interface{}) {
			gn.Reset()
		})

	tbar.AddAction(gi.ActOpts{Label: "Load Transcripts", Icon: "new", Tooltip: "Read the names of all the transcripts in the transcripts directory"}, win.This(),
		func(recv, send ki.Ki, sig int64, data interface{}) {
			gn.LoadTranscripts()
		})

	tbar.AddAction(gi.ActOpts{Label: "Split Transcripts", Icon: "new", Tooltip: "Calls split transcript on each file in TranscriptFiles list"}, win.This(),
		func(recv, send ki.Ki, sig int64, data interface{}) {
			gn.SplitTranscripts()
		})

	tbar.AddAction(gi.ActOpts{Label: "Split Transcript", Icon: "new", Tooltip: " Splits a single transcript"}, win.This(),
		func(recv, send ki.Ki, sig int64, data interface{}) {
			gn.SplitTranscript()
		})

	tbar.AddAction(gi.ActOpts{Label: "Write Seqs", Icon: "new", Tooltip: "Write each utterance to file"}, win.This(),
		func(recv, send ki.Ki, sig int64, data interface{}) {
			gn.WriteSeqs()
		})

	vp.UpdateEndNoSig(updt)

	// main menu
	appnm := gi.AppName()
	mmen := win.MainMenu
	mmen.ConfigMenus([]string{appnm, "File", "Edit", "Window"})

	amen := win.MainMenu.ChildByName(appnm, 0).(*gi.Action)
	amen.Menu.AddAppMenu(win)

	emen := win.MainMenu.ChildByName("Edit", 1).(*gi.Action)
	emen.Menu.AddCopyCutPaste(win)

	vp.UpdateEndNoSig(updt)

	win.MainMenuUpdated()
	return win
}

func mainrun() {
	Gen := NewGen()
	win := Gen.ConfigGui()
	win.StartEventLoop()
}

repository: ccnlab/statlearn

repo_name: ccnlab/statlearn

branch_name: refs/heads/main


text:
package lgreedy

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func Test_minDeletionSize(t *testing.T) {
	assert := assert.New(t)

	assert.Equal(1, minDeletionSize([]string{"cba", "daf", "ghi"}))
	assert.Equal(0, minDeletionSize([]string{"a", "b"}))
	assert.Equal(3, minDeletionSize([]string{"zyx", "wvu", "tsr"}))
}

repository: TTWShell/algorithms

repo_name: TTWShell/algorithms

gha_license_id: MIT

gha_language: Go


text:
output = op.Div(s,
	op.Sub(s,
		// Resize
		op.ResizeBilinear(s,
			// Create a batch containing a single image
			op.ExpandDims(s,
				// Use decoded pixel values
				op.Cast(s, decode, tf.Float),
				op.Const(s.SubScope("make_batch"), int32(0))),
			op.Const(s.SubScope("size"), []int32{H, W})),
		op.Const(s.SubScope("mean"), Mean)),
	op.Const(s.SubScope("scale"), Scale))

repository: MarinX/talks

repo_name: MarinX/talks


text:
DESCRIPTION = "Dia is a gtk+ based diagram creation program released under the GPL license."
LICENSE = "GPL"
DEPENDS = "libart-lgpl libpng cairo zlib gtk+ libxml2"
MAINTAINER = "Koen Kooi <koen@handhelds.org>"
PR = "r1"

inherit autotools pkgconfig

SRC_URI = "ftp://ftp.gnome.org/pub/gnome/sources/dia/0.95/dia-0.95-pre3.tar.gz"

S = "${WORKDIR}/${PN}-0.95-pre3"

#work around some pkgconfig breakages
LDFLAGS += "-lart_lgpl_2 -lxml2 -lgthread-2.0 -lglib-2.0"
CFLAGS += "-I${STAGING_INCDIR}/libart-2.0 "

FILES_${PN} += "${datadir}/mime-info/"

repository: BackupTheBerlios/openslug-svn

repo_name: BackupTheBerlios/openslug-svn


text:
@inproceedings{keneshloo2013relative,
  title={A relative feature selection algorithm for graph classification},
  author={Keneshloo, Yaser and Yazdani, Sasan},
  booktitle={Advances in Databases and Information Systems},
  pages={137--148},
  year={2013},
  organization={Springer}
}

repository: yaserkl/resume

repo_name: yaserkl/resume

extension: bib


text:
package main

import (
	"flag"
	"fmt"
	"os"

	"github.com/bdastur/tfhelper"
)

func usage() {
	usageMessage := "Usage: " + "\n" +
		"./bin/tfbootstrap create --account <account alias> --region <region> "
	fmt.Println(usageMessage)
}

func build_nested_cli(args []string) string {
	// Validate cmdline arguments.
	fmt.Println("Args: ", args)
	if len(args) <= 1 {
		fmt.Printf("Arguments not provided!")
		usage()
		os.Exit(1)
	}

	// Create.
	createOperation := flag.NewFlagSet("create", flag.ExitOnError)
	regionOption := createOperation.String("region", "", "AWS Region.")
	accountOption := createOperation.String("account", "", "AWS Account Alias")
	clusterSpecOption := createOperation.String(
		"clusterspec", "", "Provide a json formated cluster spec")

	switch args[1] {
	case "create":
		createOperation.Parse(args[2:])
	default:
		fmt.Printf("%q is not a valid command. \n", args[1])
		os.Exit(1)
	}

	if createOperation.Parsed() {
		if *regionOption == "" || *accountOption == "" || *clusterSpecOption == "" {
			fmt.Println("Region and Account are required!")
			os.Exit(1)
		}
	}
	return *clusterSpecOption
}

func main() {
	fmt.Println("Test! Build ensted cli.")
	clusterSpecString := build_nested_cli(os.Args)
	tfhelper.BootstrapEnvironment(clusterSpecString)
}

repository: bdastur/utils

repo_name: bdastur/utils

gha_language: JavaScript


text:
@article{cohen2018response,
 author = {Cohen, Alexander L and Mandrekar, Jay and St Louis, Erik K and Silber, Michael H and Kotagal, Suresh},
 journal = {Sleep medicine},
 pages = {237},
 title = {Response to" smoking, co-morbidities and narcolepsy".},
 volume = {52},
 year = {2018}
}

repository: bchcohenlab/academic-kickstart

repo_name: bchcohenlab/academic-kickstart


text:
require xorg-driver-video.inc
PE = "1"
SRC_URI[archive.md5sum] = "816842de26bce8a935f3c9c3cfedbc42"
SRC_URI[archive.sha256sum] = "59f2f8fc2399a4d6b0ce733481c58694e723a989f4712c00436d35e27c059292"


text:
require linux-omap3.inc

COMPATIBLE_MACHINE = "ti816x"

KVER = "2.6.37"
PSPREL = "04.00.00.12"

BRANCH = "ti81xx-master"
# Use literal tags in SRCREV, when available, instead of commit IDs
SRCREV = "v2.6.37_TI816XPSP_04.00.00.12"

SRC_URI += "file://vpss_notify_fix.patch \
"


text:
@InProceedings{he16,
  title = {Opponent Modeling in Deep Reinforcement Learning},
  author = {He He and Jordan {Boyd-Graber} and Kevin Kwok and Hal {Daumé III}},
  pages = {1804-1813},
  abstract = {Opponent modeling is necessary in multi-agent settings where secondary agents with competing goals also adapt their strategies, yet it remains challenging because of strategies' complex interaction and the non-stationary nature. Most previous work focuses on developing probabilistic models or parameterized strategies for specific applications. Inspired by the recent success of deep reinforcement learning, we present neural-based models that jointly learn a policy and the behavior of opponents. Instead of explicitly predicting the opponent's action, we encode observation of the opponents into a deep Q-Network (DQN), while retaining explicit modeling under multitasking. By using a Mixture-of-Experts architecture, our model automatically discovers different strategy patterns of opponents even without extra supervision. We evaluate our models on a simulated soccer game and a popular trivia game, showing superior performance over DQN and its variants.},
}

repository: mreid/papersite

repo_name: mreid/papersite

gha_language: TeX


text:
package utils

// ToMap parses given key-value pairs into a map
func ToMap(args ...interface{}) (fields map[string]interface{}) {
	l := len(args)
	if args != nil && l > 0 && l%2 == 0 {
		fields = make(map[string]interface{})
		for i := 0; i < l; i += 2 {
			if key, ok := args[i].(string); !ok {
				continue
			} else {
				fields[key] = args[i+1]
			}
		}
		if len(fields) == 0 {
			fields = nil
		}
	}
	return
}


text:
DESCRIPTION = "OpenGL headers required for OpenCL development"
LICENSE = "MIT"

LIC_FILES_CHKSUM = "file://../GL/gl.h;startline=1;endline=24;md5=10424a07c8d8310e34ced799b95f0fb6"

ALLOW_EMPTY_${PN} = "1"

SRC_URI = " \
    file://GL/gl.h \
    file://GL/gl_mangle.h \
    file://GL/glext.h \
    file://GL/glx.h \
    file://GL/glx_mangle.h \
    file://GL/glxext.h \
    file://GL/osmesa.h \
    file://GL/wglext.h \
    file://GL/wmesa.h \
    file://GL/internal/dri_interface.h \
"

do_install() {
    install -d ${D}${includedir}/GL
    cp -r ${WORKDIR}/GL/* ${D}${includedir}/GL
}


text:
@inproceedings{poria2016convolutional,
  title={Convolutional MKL based multimodal emotion recognition and sentiment analysis},
  author={Poria, Soujanya and Chaturvedi, Iti and Cambria, Erik and Hussain, Amir},
  booktitle={2016 IEEE 16th international conference on data mining (ICDM)},
  pages={439--448},
  year={2016},
  organization={IEEE}
}

url: https://raw.githubusercontent.com/rbt-c/DL-NLP-Readings/82ca76e9184a3b00ac87129d99391477c85cfcd2/Bibtex/Convolutional MKL Based Multimodal Emotion Recognition and Sentiment Analysis.bib

repository: rbt-c/DL-NLP-Readings

repo_name: rbt-c/DL-NLP-Readings


text:
DESCRIPTION = "ARM Trusted Firmware"

LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://license.rst;md5=1dd070c98a281d18d9eefd938729b031"

PACKAGE_ARCH = "${MACHINE_ARCH}"

inherit deploy

S = "${WORKDIR}/git"

BRANCH = "rcar-s4_v2.5"
SRC_URI = "git://github.com/renesas-rcar/arm-trusted-firmware.git;branch=${BRANCH};protocol=https"
SRCREV = "c005892fdd83a08c363a4cb83ebf7c87386029a3"

PV = "v2.5+renesas+git${SRCPV}"

COMPATIBLE_MACHINE = "(spider|s4sk)"
PLATFORM = "rcar_gen4"
ATFW_OPT_r8a779f0 = "LSI=S4 CTX_INCLUDE_AARCH32_REGS=0 LOG_LEVEL=10 DEBUG=0"

# requires CROSS_COMPILE set by hand as there is no configure script
export CROSS_COMPILE="${TARGET_PREFIX}"

# Let the Makefile handle setting up the CFLAGS and LDFLAGS as it is a standalone application
CFLAGS[unexport] = "1"
LDFLAGS[unexport] = "1"
AS[unexport] = "1"
LD[unexport] = "1"

do_compile() {
    oe_runmake distclean
    oe_runmake bl31 rcar_srecord PLAT=${PLATFORM} SPD=opteed MBEDTLS_COMMON_MK=1 ${ATFW_OPT}
}

# do_install() nothing
do_install[noexec] = "1"

do_deploy() {
    # Create deploy folder
    install -d ${DEPLOYDIR}

    install -m 0644 ${S}/build/${PLATFORM}/release/bl31.bin ${DEPLOYDIR}/bl31-${MACHINE}.bin
    install -m 0644 ${S}/build/${PLATFORM}/release/bl31.srec ${DEPLOYDIR}/bl31-${MACHINE}.srec
}

addtask deploy before do_build after do_compile

repository: renesas-rcar/meta-renesas

repo_name: renesas-rcar/meta-renesas

branch_name: refs/heads/dunfell

gha_language: BitBake


text:
TOOLCHAIN_HOST_TASK ?= "task-arago-sdk-host-nativesdk task-arago-cross-canadian-${TRANSLATED_TARGET_ARCH}"
TOOLCHAIN_TARGET_TASK ?= "task-arago-standalone-sdk-target"
TOOLCHAIN_OUTPUTNAME ?= "${SDK_NAME}-${ARMPKGARCH}-${TARGET_OS}-sdk-${SDK_ARCH}"

require recipes-core/meta/meta-toolchain.bb

PR = "r12"

SDKTARGETSYSROOT = "${SDKPATH}/${ARAGO_TARGET_SYS}"

# This function creates an environment-setup-script for use in a deployable SDK
toolchain_create_sdk_env_script () {
	# Create environment setup script
	script=${SDK_OUTPUT}/${SDKPATH}/environment-setup
	rm -f $script
	touch $script
	echo 'SDK_PATH="${SDKPATHNATIVE}"' >> $script
	echo 'if [ -z "$ZSH_NAME" ] && [ "x$0" = "x./environment-setup" ]; then' >> $script
	echo '    echo "Error: This script needs to be sourced. Please run as \". ./environment-setup\""' >> $script
	echo '    exit 1' >> $script
	echo 'else' >> $script
	echo '    if [ -n "$BASH_SOURCE" ]; then' >> $script
	echo '        SDK_PATH="`dirname $BASH_SOURCE`"' >> $script
	echo '    fi' >> $script
	echo '    SDK_PATH=`readlink -f "$SDK_PATH"`' >> $script
	echo '    export SDK_PATH' >> $script
	echo 'fi' >> $script
	echo 'export TARGET_SYS=${ARAGO_TARGET_SYS}' >> $script
	echo 'export TARGET_PREFIX=$TARGET_SYS-' >> $script
	echo 'export PATH=$SDK_PATH/bin:$PATH' >> $script
	echo 'export CPATH=$SDK_PATH/$TARGET_SYS/usr/include:$CPATH' >> $script
	echo 'export PKG_CONFIG_SYSROOT_DIR=$SDK_PATH/$TARGET_SYS' >> $script
	echo 'export PKG_CONFIG_PATH=$SDK_PATH/$TARGET_SYS${libdir}/pkgconfig' >> $script
	echo 'export PKG_CONFIG_ALLOW_SYSTEM_LIBS=1' >> $script
	echo 'export CONFIG_SITE=$SDK_PATH/site-config' >> $script
	printf 'export CC=\x24{TARGET_PREFIX}gcc\n' >> $script
	printf 'export CXX=\x24{TARGET_PREFIX}g++\n' >> $script
	printf 'export GDB=\x24{TARGET_PREFIX}gdb\n' >> $script
	printf 'export CPP="\x24{TARGET_PREFIX}gcc -E"\n' >> $script
	printf 'export NM=\x24{TARGET_PREFIX}nm\n' >> $script
	printf 'export AS=\x24{TARGET_PREFIX}as\n' >> $script
	printf 'export AR=\x24{TARGET_PREFIX}ar\n' >> $script
	printf 'export RANLIB=\x24{TARGET_PREFIX}ranlib\n' >> $script
	printf 'export OBJCOPY=\x24{TARGET_PREFIX}objcopy\n' >> $script
	printf 'export OBJDUMP=\x24{TARGET_PREFIX}objdump\n' >> $script
	printf 'export STRIP=\x24{TARGET_PREFIX}strip\n' >> $script
	echo 'export CONFIGURE_FLAGS="--target=$TARGET_SYS --host=$TARGET_SYS --build=${SDK_ARCH}-linux --with-libtool-sysroot=$SDK_PATH/$TARGET_SYS"' >> $script
	echo 'export CPPFLAGS="${TARGET_CC_ARCH} --sysroot=$SDK_PATH/$TARGET_SYS"' >> $script
	echo 'export CFLAGS="$CPPFLAGS"' >> $script
	echo 'export CXXFLAGS="$CPPFLAGS"' >> $script
	echo 'export LDFLAGS="${TARGET_LD_ARCH} --sysroot=$SDK_PATH/$TARGET_SYS"' >> $script
	echo 'export OECORE_NATIVE_SYSROOT=$SDK_PATH' >> $script
	echo 'export OECORE_TARGET_SYSROOT=$SDK_PATH/$TARGET_SYS' >> $script
	echo 'export OECORE_ACLOCAL_OPTS="-I $SDK_PATH/usr/share/aclocal"' >> $script
	echo 'export OECORE_DISTRO_VERSION="${DISTRO_VERSION}"' >> $script
	echo 'export OECORE_SDK_VERSION="${SDK_VERSION}"' >> $script
}

create_shell_stub () {
	i=$1
	mv $i $i.real
	printf "#!/bin/sh\nif [ -n \x22\x24BASH_SOURCE\x22 ]; then\n\t. \x60dirname \x24BASH_SOURCE\x60/../environment-setup\nfi\n" > $i
	if [ "$2" == "yes" ]; then
		echo 'export PYTHONHOME=$SDK_PATH' >> $i
		echo 'export PYTHONPATH=lib/python2.7' >> $i
	fi
	printf "LD_LIBRARY_PATH=\x24SDK_PATH/lib:\x24LD_LIBRARY_PATH \x24SDK_PATH/lib/ld-linux.so.2 \x24SDK_PATH/bin/$i.real \x24\x2a\n" >> $i
	chmod +x $i
}

populate_sdk_ipk_append () {
	cd ${SDK_OUTPUT}/${SDKPATH}/bin
	binfiles=`find ! -name "${ARAGO_TARGET_SYS}-*" -type f -perm +111 -exec file {} \;|grep -v ":.*ASCII.*text"|cut -d":" -f1|cut -c3-`
	for i in $binfiles; do
		create_shell_stub $i
	done

	# Special case for gdb, that is built as part of canadian-cross-sdk
	${@base_conditional('PREFERRED_PROVIDER_gdb-cross-canadian-arm', 'external-arago-sdk-toolchain', '', 'create_shell_stub ${TARGET_PREFIX}gdb yes', d)}
}

repository: ejhayes/meta-arago

repo_name: ejhayes/meta-arago


text:
// Device API
// https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/api.md#device-api

package iotagent

import (
	"fmt"
	"net/http"
	"strings"

	"github.com/marrbor/gohttp"
)

const (
	DevicesUrl = "iot/devices"
)

var (
	DeviceNotFoundError = fmt.Errorf("deveice not found")
)

type (
	Device struct {
		DeviceID           string             `json:"device_id" bson:"id"`                                      // Device ID that will be used to identify the device.	ex) UO834IO
		Service            *string            `json:"service,omitempty" bson:"service"`                         // Name of the service the device belongs to (will be used in the fiware-service header).	ex) smartGondor
		ServicePath        *string            `json:"service_path,omitempty" bson:"subservice"`                 // Name of the subservice the device belongs to (used in the fiware-servicepath header). ex) /gardens
		EntityName         string             `json:"entity_name" bson:"name"`                                  // Name of the entity representing the device in the Context Broker ex) ParkLamplight12
		EntityType         string             `json:"entity_type" bson:"type"`                                  // Type of the entity in the Context Broker ex) Lamplights
		TimeZone           *string            `json:"timezone,omitempty" bson:"timezone"`                       // Time zone of the sensor if it has any ex) America/Santiago
		TimeStamp          *bool              `json:"timestamp,omitempty" bson:"timestamp"`                     // Optional flag about whether or not to addthe TimeInstant attribute to the device entity created, as well as a TimeInstant metadata to each attribute, with the current timestamp ex) true
		ApiKey             *string            `json:"apikey,omitempty" bson:"apikey"`                           // Optional Apikey key string to use instead of group apikey ex) 9n4hb1vpwbjozzmw9f0flf9c2
		EndPoint           *string            `json:"endpoint,omitempty" bson:"endpoint"`                       // Endpoint where the device is going to receive commands, if any. ex) http://theDeviceUrl:1234/commands
		Protocol           string             `json:"protocol" bson:"protocol"`                                 // Name of the device protocol, for its use with an IoT Manager. ex) IoTA-UL
		Transport          string             `json:"transport" bson:"transport"`                               // Name of the device transport protocol, for the IoT Agents with multiple transport protocols. ex) MQTT
		Attributes         *[]DeviceAttribute `json:"attributes,omitempty" bson:"attributes"`                   // attributes	active	List of active attributes of the device	ex) [ { "name": "attr_name", "type": "Text" } ]
		Lazy               *[]DeviceAttribute `json:"lazy,omitempty" bson:"lazy"`                               // List of lazy attributes of the device ex) [ { "name": "attr_name", "type": "Text" } ]
		Commands           *[]DeviceAttribute `json:"commands,omitempty" bson:"commands"`                       // List of commands of the device	ex) [ { "name": "attr_name", "type": "Text" } ]
		InternalAttributes *[]interface{}     `json:"internal_attributes,omitempty" bson:"internal_attributes"` // List of internal attributes with free format for specific IoT Agent configuration ex) LWM2M mappings from object URIs to attributes
		StaticAttributes   *[]DeviceAttribute `json:"static_attributes,omitempty" bson:"static_attributes"`     // List of static attributes to append to the entity. All the updateContext requests to the CB will have this set of attributes appended. ex) [ { "name": "attr_name", "type": "Text" } ]
	}

	// DeviceAttribute holds device data model list item.
	DeviceAttribute struct {
		ObjectID *string       `json:"object_id,omitempty" bson:"object_id"`
		Name     string        `json:"name" bson:"name"`
		Type     string        `json:"type" bson:"type"`
		Value    *string       `json:"value,omitempty" bson:"value"`
		UnitMeta *UnitMetadata `json:"metadata,omitempty" bson:"metadata"`
	}

	PostDevices struct {
		Devices []Device `json:"devices"`
	}

	GetDevices struct {
		Count   int      `json:"count"`
		Devices []Device `json:"devices"`
	}
)

// https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/api.md#post-iotdevices
func (a *Accessor) CreateDevice(service, path string, devices PostDevices) error {
	// set service and service path into request.
	for i := range devices.Devices {
		devices.Devices[i].Service = &service
		devices.Devices[i].ServicePath = &path
	}
	req, err := gohttp.GenRequest(gohttp.HttpMethods.POST, a.genConfigUrl(DevicesUrl), devices)
	if err != nil {
		return err
	}
	res, err := a.Crud(AddIoTHeader(service, path, req))
	if err != nil {
		return err
	}
	if !gohttp.IsSuccessful(res) {
		return gohttp.ResponseToError(res, nil, nil)
	}
	return nil
}

// https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/api.md#get-iotdevices
func (a *Accessor) ReadDevices(service, path string, limit, offset *int) (*GetDevices, error) {
	req, err := http.NewRequest(http.MethodGet, a.genConfigUrl(DevicesUrl), nil)
	if err != nil {
		return nil, err
	}

	if limit != nil {
		gohttp.AddQueries(req, map[string]string{"limit": fmt.Sprintf("%d", *limit)})
	}
	if offset != nil {
		gohttp.AddQueries(req, map[string]string{"offset": fmt.Sprintf("%d", *offset)})
	}
	res, err := a.Crud(AddIoTHeader(service, path, req))
	if err != nil {
		return nil, err
	}
	if !gohttp.IsSuccessful(res) {
		return nil, gohttp.ResponseToError(res, nil, nil)
	}
	var gd GetDevices
	if err := gohttp.ResponseJSONToParams(res, &gd); err != nil {
		return nil, err
	}
	return &gd, nil
}

// https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/api.md#get-iotdevicesdeviceid
func (a *Accessor) ReadDevice(service, path, id string) (*Device, error) {
	req, err := http.NewRequest(http.MethodGet, a.genConfigUrl(DevicesUrl+"/"+id), nil)
	if err != nil {
		return nil, err
	}

	res, err := a.Crud(AddIoTHeader(service, path, req))
	if err != nil {
		return nil, err
	}

	if gohttp.IsNotFound(res) {
		return nil, DeviceNotFoundError
	}

	if !gohttp.IsSuccessful(res) {
		return nil, gohttp.ResponseToError(res, nil, nil)
	}

	var dev Device
	if err := gohttp.ResponseJSONToParams(res, &dev); err != nil {
		return nil, err
	}
	return &dev, nil
}

// https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/api.md#put-iotdevicesdeviceid
func (a *Accessor) UpdateDevice(service, path, id, json string) error {
	req, err := http.NewRequest(http.MethodPut, a.genConfigUrl(DevicesUrl+"/"+id), strings.NewReader(json))
	if err != nil {
		return err
	}

	res, err := a.Crud(AddIoTHeader(service, path, req))
	if err != nil {
		return err
	}

	if !gohttp.IsSuccessful(res) {
		return gohttp.ResponseToError(res, nil, nil)
	}
	return nil

}

// https://github.com/telefonicaid/iotagent-node-lib/blob/master/doc/api.md#delete-iotdevicesdeviceid
func (a *Accessor) DeleteDevice(service, path, id string) error {
	req, err := http.NewRequest(http.MethodDelete, a.genConfigUrl(DevicesUrl+"/"+id), nil)
	if err != nil {
		return err
	}
	res, err := a.Crud(AddIoTHeader(service, path, req))
	if err != nil {
		return err
	}

	if !gohttp.IsSuccessful(res) {
		return gohttp.ResponseToError(res, nil, nil)
	}
	return nil
}

repository: marrbor/go-fiware-api

repo_name: marrbor/go-fiware-api


text:
// Copyright © 2018 Ryan Parman <https://ryanparman.com>
// Copyright © 2018 Contributors <https://github.com/skyzyx/pstore/graphs/contributors>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package cmd

import (
	"fmt"
	"os"
	"regexp"
	"sort"
	"strconv"
	"strings"
	"text/template"

	"github.com/aws/aws-sdk-go-v2/service/ssm"
	"github.com/davecgh/go-spew/spew"
	"github.com/spf13/cobra"
)

type Parameter struct {
	Profile string
	Name    string
	Type    string
	Value   string
}

const tmpl = `aws ssm put-parameter \
    --profile {{ .Profile }} \
    --name "{{ .Name }}" \
    --type {{ .Type }} \
    --value "{{ .Value }}" \
    --overwrite \
;
`

// cliCmd represents the cli command
var cliCmd = &cobra.Command{
	Use:   "cli",
	Short: "Export the selected Parameter Store values as AWS CLI commands.",
	Run: func(cmd *cobra.Command, args []string) {
		if !quiet && !debug {
			fmt.Println("")
		}

		// Fetch the data from AWS
		cfg := GetConfig(cmd.Flag("profile").Value.String())
		svc := ssm.New(cfg)
		SendPathRequest(svc, args)

		for _, page := range response {
			for _, param := range page.Parameters {
				parameters = append(parameters, []string{
					*param.Name,
					*param.Value,
					string(param.Type),
					strconv.FormatInt(*param.Version, 10),
				})
			}
		}

		if filter != "" {
			parameters = ArrayFilter(parameters, func(v []string) bool {
				searchString := []string{v[0], v[1]}
				e := strings.Join(searchString, " ")

				if debug {
					colorize("Filterable string:")
					colorize(spew.Sdump(e))
					fmt.Println("")
				}

				return Contains(e, filter)
			})
		} else if regex != "" {
			parameters = ArrayFilter(parameters, func(v []string) bool {
				e := strings.Join([]string{v[0], v[1]}, " ")
				r, err := regexp.Compile(regex)

				if err != nil {
					fmt.Println(err.Error())
					os.Exit(1)
				}

				if debug {
					colorize("Filterable string:")
					colorize(spew.Sdump(e, r))
					fmt.Println("")
				}

				return r.MatchString(e)
			})
		}

		if len(parameters) > 0 {
			// Sort alphabetically by key
			sort.Slice(parameters[:], func(i, j int) bool {
				return parameters[i][0] < parameters[j][0]
			})

			for _, entry := range parameters {
				construct := Parameter{
					Profile: profile,
					Name:    entry[0],
					Value:   entry[1],
					Type:    entry[2],
				}

				if debug {
					colorize("Parameter Object:")
					colorize(spew.Sdump(construct))
					fmt.Println("")
				}

				t := template.New("Parameter")

				t, err := t.Parse(tmpl)
				if err != nil {
					fmt.Println(err.Error())
					os.Exit(1)
				}

				err = t.Execute(os.Stdout, construct)
				if err != nil {
					fmt.Println(err.Error())
					os.Exit(1)
				}

				fmt.Println("")
			}
		}
	},
}

func init() {
	rootCmd.AddCommand(cliCmd)
}

repository: skyzyx/pstore

repo_name: skyzyx/pstore


text:
@InProceedings{mansinghka07a,
  title = {AClass: A simple, online, parallelizable algorithm for probabilistic classification},
  author = {Vikash K. Mansinghka and Daniel M. Roy and Ryan Rifkin and Josh Tenenbaum},
  pages = {315--322},
  abstract = {We present AClass, a simple, online, parallelizable algorithm for supervised multiclass classification. AClass models each classconditional density as a Chinese restaurant process mixture, and performs approximate inference in this model using a sequential Monte Carlo scheme. AClass combines several strengths of previous approaches to classification that are not typically found in a single algorithm; it supports learning from missing data and yields sensibly regularized nonlinear decision boundaries while remaining computationally efficient. We compare AClass to several standard classification algorithms and show competitive performance.},
  pdf = {http://jmlr.org/proceedings/papers/v2/mansinghka07a/mansinghka07a.pdf},
}


text:
@article{hannah2011,
  title={Dirichlet process mixtures of generalized linear models},
  author={Hannah, Lauren A and Blei, David M and Powell, Warren B},
  journal={Journal of Machine Learning Research},
  volume={12},
  number={Jun},
  pages={1923--1953},
  year={2011},
  url ={http://www.jmlr.org/papers/volume12/hannah11a/hannah11a.pdf}
}

@book{muller2015,
  title={Bayesian Nonparametric Data Analysis},
  author={M{\"u}ller, P. and Quintana, F.A. and Jara, A. and Hanson, T.},
  isbn={9783319189673},
  lccn={2015943065},
  series={Springer Series in Statistics},
  url={https://books.google.com/books?id=eH5ErgEACAAJ},
  year={2015},
  publisher={Springer International Publishing},
  doi={10.1007/978-3-319-18968-0}
}

@article{Neal2000,
author = { Radford M. Neal },
title = {Markov Chain Sampling Methods for Dirichlet Process Mixture Models},
journal = {Journal of Computational and Graphical Statistics},
volume = {9},
number = {2},
pages = {249-265},
year  = {2000},
publisher = {Taylor & Francis},
doi = {10.1080/10618600.2000.10474879},
URL = {https://amstat.tandfonline.com/doi/abs/10.1080/10618600.2000.10474879},
eprint = {https://amstat.tandfonline.com/doi/pdf/10.1080/10618600.2000.10474879}
}

@article{gershman2012,
  added-at = {2015-05-22T11:42:38.000+0200},
  author = {Gershman, Samuel J. and Blei, David M.},
  biburl = {https://www.bibsonomy.org/bibtex/21dbad47ef24ea22daef95f1d79c062dc/jil},
  doi = {http://dx.doi.org/10.1016/j.jmp.2011.08.004},
  interhash = {60a992ffab2105467ae596dc57fb098f},
  intrahash = {1dbad47ef24ea22daef95f1d79c062dc},
  issn = {0022-2496},
  journal = {Journal of Mathematical Psychology },
  keywords = {bayesian blei models nonparametric nonparametrics tutorial},
  number = 1,
  pages = {1 - 12},
  timestamp = {2015-05-22T11:42:38.000+0200},
  title = {A tutorial on Bayesian nonparametric models },
  url = {http://www.sciencedirect.com/science/article/pii/S002224961100071X},
  volume = 56,
  year = 2012,
  doi={10.1016/j.jmp.2011.08.004}
}

@article{Hastings1970,
 ISSN = {00063444},
 URL = {http://www.jstor.org/stable/2334940},
 abstract = {A generalization of the sampling method introduced by Metropolis et al. (1953) is presented along with an exposition of the relevant theory, techniques of application and methods and difficulties of assessing the error in Monte Carlo estimates. Examples of the methods, including the generation of random orthogonal matrices and potential applications of the methods to numerical problems arising in statistics, are discussed.},
 author = {W. K. Hastings},
 journal = {Biometrika},
 number = {1},
 pages = {97--109},
 publisher = {[Oxford University Press, Biometrika Trust]},
 title = {Monte Carlo Sampling Methods Using Markov Chains and Their Applications},
 volume = {57},
 year = {1970},
 doi = {10.2307/2334940}
}

@ARTICLE{Oganisian2018,
       author = {Oganisian, Arman and Mitra, Nandita and Roy, Jason},
        title = "A Bayesian Nonparametric Model for Zero-Inflated Outcomes: Prediction, Clustering, and Causal Estimation",
      journal = {arXiv e-prints},
     keywords = {Statistics - Methodology},
         year = "2018",
archivePrefix = {arXiv},
       eprint = {1810.09494},
 primaryClass = {stat.ME},
       adsurl = {https://ui.adsabs.harvard.edu/\#abs/2018arXiv181009494O},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@article{Rod2014,
author = {Carlos E. Rodríguez and Stephen G. Walker},
title = {Label Switching in Bayesian Mixture Models: Deterministic Relabeling Strategies},
journal = {Journal of Computational and Graphical Statistics},
volume = {23},
number = {1},
pages = {25-45},
year  = {2014},
publisher = {Taylor & Francis},
doi = {10.1080/10618600.2012.735624},
URL = { https://doi.org/10.1080/10618600.2012.735624},
eprint = { https://doi.org/10.1080/10618600.2012.735624}}

@article{stephens2000,
  title={Dealing with label switching in mixture models},
  author={Stephens, Matthew},
  journal={Journal of the Royal Statistical Society: Series B (Statistical Methodology)},
  volume={62},
  number={4},
  pages={795--809},
  year={2000},
  publisher={Wiley Online Library},
  doi={10.1111/1467-9868.00265}
}

@article{ferguson1973,
author = "Ferguson, Thomas S.",
doi = "10.1214/aos/1176342360",
fjournal = "The Annals of Statistics",
journal = "Ann. Statist.",
month = "03",
number = "2",
pages = "209--230",
publisher = "The Institute of Mathematical Statistics",
title = "A Bayesian Analysis of Some Nonparametric Problems",
url = "https://doi.org/10.1214/aos/1176342360",
volume = "1",
year = "1973",
doi = "10.1214/aos/1176342360"
}

@article{blackwell1973,
author = "Blackwell, David and MacQueen, James B.",
doi = "10.1214/aos/1176342372",
fjournal = "The Annals of Statistics",
journal = "Ann. Statist.",
month = "03",
number = "2",
pages = "353--355",
publisher = "The Institute of Mathematical Statistics",
title = "Ferguson Distributions Via Polya Urn Schemes",
url = "https://doi.org/10.1214/aos/1176342372",
volume = "1",
year = "1973",
doi = "10.1214/aos/1176342372"
}

repository: stablemarkets/ChiRP

repo_name: stablemarkets/ChiRP

gha_language: R


text:
@article{besanccon2022frankwolfe,
 author = {Besançon, Mathieu and Carderera, Alejandro and Pokutta, Sebastian},
 journal = {INFORMS Journal on Computing},
 publisher = {INFORMS},
 title = {FrankWolfe.jl: A High-Performance and Flexible Toolbox for Frank--Wolfe Algorithms and Conditional Gradients},
 year = {2022}
}

repository: matbesancon/hugo-site

repo_name: matbesancon/hugo-site

gha_language: HTML


text:
import { BrowserRouter } from 'react-router-dom';
import React from 'react';
import '@testing-library/jest-dom';
import TestRenderer from 'react-test-renderer';
import { applyMiddleware, createStore } from 'redux';
import thunk from 'redux-thunk';
import { Provider } from 'react-redux';
import rootReducer from '../../reducers';
import Login from '../LogIn';

const store = createStore(rootReducer, applyMiddleware(thunk));

describe('Display Dates.js', () => {
  it('renders correctly all dates', () => {
    const tree = TestRenderer.create(
      <Provider store={store}>
        <BrowserRouter>
          <Login />
        </BrowserRouter>
      </Provider>,
    ).toJSON();
    expect(tree).toMatchSnapshot();
  });
});

branch_name: refs/heads/develop

extension: js


text:
@INPROCEEDINGS{Cardoso04DynTravel,
author = {Cardoso, Jorge},
title = {Issues of Dynamic Travel Packaging using Web Process Technology},
booktitle = {International Conference e-Commerce 2004},
year = {2004},
pages = {357-362},
address = {Lisbon, Portugal},
date = {14-16 December 2004},
isbn = {972-98947-8-7},
owner = {Jorge Cardoso},
refid = {27},
timestamp = {2010.08.26},
webpdf = {/Papers/CP-2004-014-ECommerce-Issues-of-dynamic-travel-packaging-using.pdf}}


text:
/*
Copyright © 2019 orion0616 earth.nobu.light@gmail.com

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package cmd

import (
	"fmt"
	"time"

	"github.com/orion0616/sealion/todoist"
	"github.com/spf13/cobra"
)

// todayCmd represents the today command
var todayCmd = &cobra.Command{
	Use:   "today",
	Short: "Total time of today's tasks",
	Run: func(cmd *cobra.Command, args []string) {
		client, err := todoist.NewClient()
		if err != nil {
			fmt.Println(err)
			return
		}
		labels := []string{
			"5分",
			"15分",
			"30分",
			"1時間",
		}
		time := []int{
			5, 15, 30, 60,
		}
		labelIDs, err := client.CreateLabelIDs(labels)
		if err != nil {
			fmt.Println(err)
			return
		}
		tasks, err := client.GetAllTasks()
		if err != nil {
			fmt.Println(err)
			return
		}
		sum := 0
		for _, task := range tasks {
			if task.Due.Date != Today() {
				continue
			}
			for _, label := range task.Labels {
				for i, id := range labelIDs {
					if label == id {
						sum += time[i]
					}
				}
			}
		}
		fmt.Printf("Sum: %2dh %2dm\n", sum/60, sum%60)
	},
}

func Today() string {
	const layout = "2006-01-02"
	return time.Now().Format(layout)
}

func init() {
	rootCmd.AddCommand(todayCmd)
}


text:
package entities

import (
	"strconv"
	"time"

	"github.com/jinzhu/gorm"
	"github.com/sony/sonyflake"
)

// Entity is a copy of the gorm.Model struct with the exception that ID is a sonyflake id type instead of a sequential int.
// This struct also forces hard deletes
type Entity struct {
	ID        string    `json:"id" gorm:"type:varchar(255);primary_key;"`
	CreatedAt time.Time `json:"createdAt" gorm:"column:created_at;default:null"`
	UpdatedAt time.Time `json:"updatedAt" gorm:"column:updated_at;default:null"`
}

var sf *sonyflake.Sonyflake

func init() {
	var st sonyflake.Settings
	sf = sonyflake.NewSonyflake(st)
	if sf == nil {
		panic("sonyflake not created")
	}
}

// BeforeCreate will set a SonyFlake ID rather than a sequential ID.
func (entity *Entity) BeforeCreate(scope *gorm.Scope) error {
	id, err := sf.NextID()
	if err != nil {
		// We have been running our app for 174 years
		panic("Reset the sonyflake start date")
	}
	return scope.SetColumn("ID", strconv.FormatUint(id, 10))
}

// QueryParams contain information for paginating and ordering a FindAll query
type QueryParams struct {
	Limit  *int
	Offset *int
}

const (
	// MaxLimit is the maximum limit that can be specified per query requests
	MaxLimit = 1000
)

repository: kevinwmiller/assets-liabilities

repo_name: kevinwmiller/assets-liabilities


text:
@article{Morag_2010,
  doi = {10.2217/pgs.10.27},
  url = {https://doi.org/10.2217\%2Fpgs.10.27},
  year = 2010,
  month = {mar},
  publisher = {Future Medicine Ltd},
  volume = {11},
  number = {3},
  pages = {327--340},
  author = {Ayelet Morag and Julia Kirchheiner and Moshe Rehavi and David Gurwitz},
  title = {Human lymphoblastoid cell line panels: novel tools for assessing shared drug pathways},
  journal = {Pharmacogenomics}
}

repository: larmcr/px

repo_name: larmcr/px


text:
SUMMARY = "Tape Control"
SECTION = "console/utils"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
RDEPENDS_${PN} += " \
    python3 \
    python3-flask \
    rpi-gpio \
    python3-pprint \
"

SRC_URI = "file://tapecontrol.service file://tapecontrol"
S = "${WORKDIR}"

inherit systemd

SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "tapecontrol.service"

do_install() {
    install -d ${D}${systemd_unitdir}/system
    install -m 0644 tapecontrol.service ${D}${systemd_unitdir}/system

    install -d ${D}${bindir}
    install -m 0755 tapecontrol ${D}${bindir}
}

repository: thomasdstewart/meta-rptr

repo_name: thomasdstewart/meta-rptr


text:
package main

import (
	"database/sql"
	"errors"
	"fmt"
	"log"
	"strconv"
	"strings"

	_ "github.com/godror/godror"
)

const (
	ORALCE_EMPTY_STRING = "_xxxx"
)

func main() {
	db, err := sql.Open("godror", `oracle://ac:password@127.0.0.1:1521/ORCLPDB1`)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer db.Close()

	a := &Account{
		Subject: "xxx",
		Email:   "luoji@gmail.com",
		//Name:    "abc",
		//Label:   sql.NullString{String: "bcd", Valid: true},
		Name:  "",
		Label: sql.NullString{String: "", Valid: true},
		//Label: sql.NullString{Valid: false},
	}
	err = InsertAccount(db, a)
	//err = InsertAccountByFields(db, a)
	if err != nil {
		panic(err)
	}
	log.Println("ok:", a.ID, a.Name, a.Label.String, a.Label.Valid, a.CreatedDate, a.ChangedDate, a.DeletedDate)

	na, err := AccountByID(db, a.ID)
	if err != nil {
		panic(err)
	}
	log.Println("ok:", na.ID, na.Name, na.Label.String, na.Label.Valid, na.CreatedDate, na.ChangedDate, na.DeletedDate)
}

// Account represents a row from '"C##ADMIN"."account"'.
type Account struct {
	ID          int            `json:"id"`           // id
	Subject     string         `json:"subject"`      // subject
	Email       string         `json:"email"`        // email
	Name        string         `json:"name"`         // name
	Label       sql.NullString `json:"label"`        // label
	CreatedDate sql.NullTime   `json:"created_date"` // created_date
	ChangedDate sql.NullTime   `json:"changed_date"` // changed_date
	DeletedDate sql.NullTime   `json:"deleted_date"` // deleted_date

	// xo fields
	_exists, _deleted bool
}

// InsertAccount inserts the Account to the database.
func InsertAccount(db *sql.DB, a *Account) error {
	var err error

	// if already exist, bail
	if a._exists {
		return errors.New("insert failed: already exists")
	}

	// sql insert query, primary key provided by sequence
	const sqlstr = `INSERT INTO "account" (` +
		`"subject", "email", "name", "label", "created_date", "changed_date", "deleted_date"` +
		`) VALUES (` +
		`:1, :2, :3, :4, :5, :6, :7` +
		`) RETURNING "id", "name", "label" INTO :8, :9, :10`

	// run query
	log.Println(sqlstr, a.Subject, a.Email, a.Name, a.Label, a.CreatedDate, a.ChangedDate, a.DeletedDate)
	_, err = db.Exec(sqlstr, convertOracleEmptyString(a.Subject), convertOracleEmptyString(a.Email),
		convertOracleEmptyString(a.Name), convertOracleNullString(a.Label), a.CreatedDate, a.ChangedDate, a.DeletedDate,
		sql.Out{Dest: &a.ID}, sql.Out{Dest: &a.Name}, sql.Out{Dest: &a.Label.String})
	if err != nil {
		return err
	}

	fixOracleEmptyString(&a.Name)
	fixOracleNullString(&a.Label)

	// set existence
	a._exists = true

	return nil
}

// InsertAccountByFields inserts the Account to the database.
func InsertAccountByFields(db *sql.DB, a *Account) error {
	var err error

	params := make([]interface{}, 0, 5)
	fields := make([]string, 0, 5)
	retFields := make([]string, 0, 5)
	retFields = append(retFields, `"id"`)
	retVars := make([]interface{}, 0, 5)
	retVars = append(retVars, sql.Out{Dest: &a.ID})

	fields = append(fields, `"subject"`)
	params = append(params, convertOracleEmptyString(a.Subject))

	fields = append(fields, `"email"`)
	params = append(params, convertOracleEmptyString(a.Email))

	fields = append(fields, `"name"`)
	params = append(params, convertOracleEmptyString(a.Name))

	if a.Label.Valid {
		fields = append(fields, `"label"`)
		params = append(params, convertOracleNullString(a.Label))
	} else {
		retFields = append(retFields, `"label"`)
		retVars = append(retVars, sql.Out{Dest: &a.Label.String})
	}

	if a.CreatedDate.Valid {
		fields = append(fields, `"created_date"`)
		params = append(params, a.CreatedDate)
	} else {
		retFields = append(retFields, `"created_date"`)
		retVars = append(retVars, sql.Out{Dest: &a.CreatedDate})
	}
	if a.ChangedDate.Valid {
		fields = append(fields, `"changed_date"`)
		params = append(params, a.ChangedDate)
	} else {
		retFields = append(retFields, `"changed_date"`)
		retVars = append(retVars, sql.Out{Dest: &a.ChangedDate})
	}
	if a.DeletedDate.Valid {
		fields = append(fields, `"deleted_date"`)
		params = append(params, a.DeletedDate)
	} else {
		retFields = append(retFields, `"deleted_date"`)
		retVars = append(retVars, sql.Out{Dest: &a.DeletedDate})
	}
	if len(params) == 0 {
		return errors.New("all fields are empty, unable to insert")
	}
	params = append(params, retVars...)

	var fieldsPlaceHolders []string
	for i := range fields {
		fieldsPlaceHolders = append(fieldsPlaceHolders, ":"+strconv.Itoa(i+1))
	}
	var retFieldsPlaceHolders []string
	for i := range retFields {
		retFieldsPlaceHolders = append(retFieldsPlaceHolders, ":"+strconv.Itoa(len(fieldsPlaceHolders)+i+1))
	}

	sqlstr := `INSERT INTO "account" (` +
		strings.Join(fields, ",") +
		`) VALUES (` + strings.Join(fieldsPlaceHolders, ",") +
		`) RETURNING ` + strings.Join(retFields, ",") +
		` INTO ` + strings.Join(retFieldsPlaceHolders, ",")

	// run query
	log.Println(sqlstr, params)
	_, err = db.Exec(sqlstr, params...)
	if err != nil {
		return err
	}

	fixOracleEmptyString(&a.Name)
	if !a.Label.Valid {
		fixOracleNullString(&a.Label)
	}

	// set existence
	a._exists = true

	return nil
}

func AccountByID(db *sql.DB, id int) (*Account, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`"id", "subject", "email", "name", "label", "created_date", "changed_date", "deleted_date" ` +
		`FROM "AC"."account" ` +
		`WHERE "id" = :1`

	// run query
	log.Println(sqlstr, id)
	a := Account{
		_exists: true,
	}

	//var subject, email, name string
	//var label OracleNullString
	err = db.QueryRow(sqlstr, id).Scan(&a.ID, &a.Subject, &a.Email, &a.Name, &a.Label, &a.CreatedDate, &a.ChangedDate, &a.DeletedDate)
	if err != nil {
		return nil, err
	}

	fixOracleEmptyString(&a.Subject)
	fixOracleEmptyString(&a.Email)
	fixOracleEmptyString(&a.Name)
	fixOracleNullString(&a.Label)

	return &a, nil
}

/*
type OracleString string

func (s *OracleString) Scan(value interface{}) error {
	switch v := value.(type) {
	case string:
		if v == ORALCE_EMPTY_STRING {
			*s = ""
		} else {
			*s = OracleString(v)
		}
	default:
	}

	return nil
}

type OracleNullString struct {
	String string
	Valid  bool
}

func (ns *OracleNullString) Scan(value interface{}) error {
	switch v := value.(type) {
	case string:
		if v != "" {
			ns.Valid = true
			if v != ORALCE_EMPTY_STRING {
				ns.String = v
			}
		}
	default:
	}

	return nil
}
*/

func fixOracleEmptyString(s *string) {
	if *s == ORALCE_EMPTY_STRING {
		*s = ""
	}
}

func fixOracleNullString(ns *sql.NullString) {
	if ns == nil || !ns.Valid {
		return
	}

	if ns.String == "" {
		ns.Valid = false
		return
	}

	if ns.String == ORALCE_EMPTY_STRING {
		ns.String = ""
	}
}

func convertOracleEmptyString(s string) string {
	if s == "" {
		return ORALCE_EMPTY_STRING
	}
	return s
}

func convertOracleNullString(ns sql.NullString) sql.NullString {
	if !ns.Valid {
		return sql.NullString{}
	}

	if ns.String == "" {
		return sql.NullString{String: ORALCE_EMPTY_STRING, Valid: true}
	}

	return sql.NullString{String: ns.String, Valid: true}
}

repository: gunsluo/go-example

repo_name: gunsluo/go-example


text:
package sensor

import (
	"log"
	"time"

	rpi "github.com/stianeikeland/go-rpio"
)

const (
	detectionTimeout  = 5 * time.Second
	detectionInterval = 100 * time.Millisecond
)

type MQ3Response struct {
	AlcoholDetected bool `json:"alcoholDetected"`
}

type MQReader interface {
	DetectAlcohol() MQ3Response
}

type MQ3Reader struct {
	detectionTimeout  time.Duration
	detectionInterval time.Duration
	gpioPin           int
}

func (this *MQ3Reader) init() error {
	this.detectionInterval = detectionInterval
	this.detectionTimeout = detectionTimeout

	return rpi.Open()
}

// DetectAlcohol reads for 5 sec digital out from mq-3 sensor and returns true or false based on readings over time
func (this MQ3Reader) DetectAlcohol() MQ3Response {
	log.Printf("Starting alcohol detection. Detection time: %2.f seconds", this.detectionTimeout.Seconds())

	timeoutChan := time.NewTimer(this.detectionTimeout).C
	intervalChan := time.NewTicker(this.detectionInterval).C
	var result int
	tmp := 1.0
	readings := this.detectionTimeout.Seconds() / this.detectionInterval.Seconds()

	pin := rpi.Pin(this.gpioPin)

	// Set input mode to read from the pin
	pin.Input()

	for {
		select {
		case <-timeoutChan:
			tmp = tmp / float64(readings)
			result = int(tmp + 0.5)

			log.Printf("Finished alcohol detection. Result: %d", result)

			if result == 0 {
				return MQ3Response{AlcoholDetected: false}
			}

			return MQ3Response{AlcoholDetected: true}
		case <-intervalChan:
			out := pin.Read()
			if out == rpi.Low {
				tmp += 1.0
			}
		}
	}
}

func NewMQ3Reader(gpioPin int) (MQReader, error) {
	reader := &MQ3Reader{gpioPin: gpioPin}
	err := reader.init()
	if err != nil {
		return nil, err
	}

	return reader, nil
}

repository: floreks/breathalyzer

repo_name: floreks/breathalyzer


text:
package watch

import (
	"os"
	"path/filepath"

	"github.com/sirupsen/logrus"

	"github.com/fsnotify/fsnotify"
)

// Watcher file system notification using event channel.
type Watcher struct {
	Watcher   *fsnotify.Watcher
	EventChan chan fsnotify.Event
}

// Watch watches new files and directories. Files are added
// to event channel for processing and directories are
// added to Watcher for watching new files.
func (w Watcher) Watch() {
	// The watch does not support listing of added directories.
	// Check if the directory exists before the watching starts.
	// This issue should be fixed by developers of Watcher.
	// The watching does not detect error when no directory is added.

	for {
		select {
		case event, ok := <-w.Watcher.Events:
			if !ok {
				logrus.WithField("error", "not ok").Error("watcher is not set correctly")
				return
			}

			logrus.WithFields(logrus.Fields{"event": event.Name, "op": event.Op}).Debug("event")

			if event.Op&fsnotify.Create == fsnotify.Create {
				fi, err := os.Stat(event.Name)
				if err != nil {
					logrus.WithField("error", err).Error("error os state")
					continue
				}

				if fi.Mode().IsDir() { // add new directory to Watcher
					err = w.Watcher.Add(event.Name)
					if err != nil {
						logrus.WithField("error", err).Error("error add directory to watcher")
						continue
					}
					logrus.WithField("dir", event.Name).Debug("dir added to watcher")
				}
			}

			if event.Op&fsnotify.Write == fsnotify.Write {
				w.EventChan <- event // add event to channel when file is modified - writing was done
			}

		case err, ok := <-w.Watcher.Errors:
			if !ok {
				return
			}

			logrus.WithField("error", err).Error("watch error")
		}
	}
}

// AddRootWithSubDirs adds root and subdirectories recursively.
func (w Watcher) AddRootWithSubDirs(root string) error {
	return filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}

		if info.IsDir() {
			err = w.Watcher.Add(path)
			if err != nil {
				return err
			}

			logrus.WithField("dir", path).Debug("dir added to watcher")
		}

		return nil
	})
}

repository: goat-project/exporter

repo_name: goat-project/exporter

gha_license_id: NOASSERTION


text:
package forms

import (
	"context"
	"errors"

	"flamingo.me/flamingo/v3/framework/flamingo"
	"flamingo.me/flamingo/v3/framework/web"
	"flamingo.me/form/application"
	"flamingo.me/form/domain"

	cartApplication "flamingo.me/flamingo-commerce/v3/cart/application"
	customerApplication "flamingo.me/flamingo-commerce/v3/customer/application"
)

type (
	// BillingAddressForm the form for billing address
	BillingAddressForm AddressForm

	// BillingAddressFormService implements Form(Data)Provider interface of form package
	BillingAddressFormService struct {
		customerApplicationService     *customerApplication.Service
		applicationCartReceiverService *cartApplication.CartReceiverService
	}

	// BillingAddressFormController the (mini) MVC
	BillingAddressFormController struct {
		responder                      *web.Responder
		applicationCartService         *cartApplication.CartService
		applicationCartReceiverService *cartApplication.CartReceiverService
		logger                         flamingo.Logger
		formHandlerFactory             application.FormHandlerFactory
	}
)

// Inject dependencies
func (p *BillingAddressFormService) Inject(
	applicationCartReceiverService *cartApplication.CartReceiverService,
	customerApplicationService *customerApplication.Service) {
	p.customerApplicationService = customerApplicationService
	p.applicationCartReceiverService = applicationCartReceiverService
}

// GetFormData provides form data
func (p *BillingAddressFormService) GetFormData(ctx context.Context, req *web.Request) (interface{}, error) {
	billingAddressForm := AddressForm{}

	customer, err := p.customerApplicationService.GetForIdentity(ctx, req)
	if err == nil {
		billingAddress := customer.GetDefaultBillingAddress()
		if billingAddress != nil {
			billingAddressForm.LoadFromCustomerAddress(*billingAddress)
		}
	}

	cart, err := p.applicationCartReceiverService.ViewCart(ctx, req.Session())
	if err == nil {
		if cart.BillingAddress != nil {
			billingAddressForm.LoadFromCartAddress(*cart.BillingAddress)
		}
	}
	return BillingAddressForm(billingAddressForm), nil
}

// Inject dependencies
func (c *BillingAddressFormController) Inject(
	responder *web.Responder,
	applicationCartService *cartApplication.CartService,
	applicationCartReceiverService *cartApplication.CartReceiverService,
	logger flamingo.Logger,
	formHandlerFactory application.FormHandlerFactory,
) {
	c.responder = responder
	c.applicationCartReceiverService = applicationCartReceiverService
	c.applicationCartService = applicationCartService
	c.formHandlerFactory = formHandlerFactory
	c.logger = logger.WithField(flamingo.LogKeyModule, "cart").WithField(flamingo.LogKeyCategory, "billingform")
}

func (c *BillingAddressFormController) getFormHandler() (domain.FormHandler, error) {
	builder := c.formHandlerFactory.GetFormHandlerBuilder()
	err := builder.SetNamedFormService("commerce.cart.billingFormService")
	if err != nil {
		return nil, err
	}
	return builder.Build(), nil
}

// GetUnsubmittedForm returns unsubmitted form
func (c *BillingAddressFormController) GetUnsubmittedForm(ctx context.Context, r *web.Request) (*domain.Form, error) {
	formHandler, err := c.getFormHandler()
	if err != nil {
		return nil, err
	}
	return formHandler.HandleUnsubmittedForm(ctx, r)
}

// HandleFormAction return the form or error. If the form was submitted the action is performed
func (c *BillingAddressFormController) HandleFormAction(ctx context.Context, r *web.Request) (form *domain.Form, actionSuccessful bool, err error) {
	session := web.SessionFromContext(ctx)
	formHandler, err := c.getFormHandler()
	if err != nil {
		return nil, false, err
	}
	// ##  Handle the submitted form (validation etc)
	form, err = formHandler.HandleSubmittedForm(ctx, r)
	if err != nil {
		return nil, false, err
	}
	billingAddressForm, ok := form.Data.(BillingAddressForm)
	if !ok {
		return form, false, errors.New("cannot convert to AddressForm ")
	}
	if !form.IsValidAndSubmitted() {
		return form, false, nil
	}
	addressForm := AddressForm(billingAddressForm)
	billingAddress := addressForm.MapToDomainAddress()

	// update Billing
	err = c.applicationCartService.UpdateBillingAddress(ctx, session, &billingAddress)
	if err != nil {
		c.logger.WithContext(ctx).Error("BillingAddressFormController UpdateBillingAddress Error %v", err)
		return form, false, err
	}
	return form, true, nil
}

repository: i-love-flamingo/flamingo-commerce

repo_name: i-love-flamingo/flamingo-commerce


text:
SUMMARY = "A fast JSON parser/generator for C++ with both SAX/DOM style API"
HOMEPAGE = "http://rapidjson.org/"
SECTION = "libs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://license.txt;md5=ba04aa8f65de1396a7e59d1d746c2125"

SRC_URI = "git://github.com/miloyip/rapidjson.git;nobranch=1;protocol=https"

SRCREV = "0ccdbf364c577803e2a751f5aededce935314313"

PV = "1.1.0+git${SRCPV}"

S = "${WORKDIR}/git"

inherit cmake

EXTRA_OECMAKE += "-DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_TESTS=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF"
# the install path for cmake modules etc. is hardcoded as ${prefix}/lib in
# CMakeLists.txt, which breaks the package split with multilib
EXTRA_OECMAKE += "-DLIB_INSTALL_DIR=${libdir}"

# RapidJSON is a header-only C++ library, so the main package will be empty.

ALLOW_EMPTY:${PN} = "1"

BBCLASSEXTEND = "native nativesdk"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded


text:
package main

import "fmt"

func sum(nums []int) int {
	res := 0
	for i := 0; i < len(nums); i++ {
		res += nums[i]
	}
	return res
}

func pivotIndex(nums []int) int {
	leftSum := 0
	rightSum := sum(nums)
	for i := 0; i < len(nums); i++ {
		rightSum -= nums[i]
		if leftSum == rightSum {
			return i
		}
		leftSum += nums[i]
	}
	return -1
}

func main() {
	nums := []int{1, 7, 3, 6, 5, 6}
	fmt.Println(pivotIndex(nums))
}

repository: OZ-T/leetcode

repo_name: OZ-T/leetcode


text:
require xz.inc
PR = "${INC_PR}.0"
SRC_URI = "http://tukaani.org/xz/xz-${PV}.tar.bz2;name=xz"
SRC_URI[xz.md5sum] = "cc4044fcc073b8bcf3164d1d0df82161"
SRC_URI[xz.sha256sum] = "330312c4397608d8b7be362cc7edbfeafa6101614bc2164d816ea767656aa15c"

repository: trini/openembedded

repo_name: trini/openembedded


text:
inherit pypi setuptools3
require python-periphery.inc

SRC_URI[sha256sum] = "2df05528a7668db4fb3faaff516b34ed99e9009ed9610a4efe3ea6c0ea8a3aab"

repository: Kynetics/meta-openembedded

repo_name: Kynetics/meta-openembedded


text:
SUMMARY = "OpenPower procedure control"
DESCRIPTION = "Provides procedures that run against the host chipset"
PR = "r1"
PV = "1.0+git${SRCPV}"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"

S = "${WORKDIR}/git"

inherit meson obmc-phosphor-utils pkgconfig
inherit systemd

SRC_URI = "git://github.com/openbmc/openpower-proc-control;branch=master;protocol=https"
SRCREV = "b8c910666568ace381df8af448274a14c240bff2"

DEPENDS += " \
        phosphor-logging \
        phosphor-dbus-interfaces \
        libgpiod \
        "

RDEPENDS:${PN} += " op-proc-control-systemd-links"

EXTRA_OEMESON += "-Dtests=disabled"

# For libpdbg, provided by the pdbg package
DEPENDS += "pdbg"

PACKAGECONFIG ??= "${@bb.utils.filter('OBMC_MACHINE_FEATURES', 'phal op-fsi', d)}"
PACKAGECONFIG[phal] = "-Dphal=enabled, -Dphal=disabled -Dp9=enabled, ipl pdata"
PACKAGECONFIG[op-fsi] = "-Dopenfsi=enabled, -Dopenfsi=disabled"

# By default all openpower systems support op-fsi
PACKAGECONFIG = " op-fsi"

TEMPLATE = "pcie-poweroff@.service"
INSTANCE_FORMAT = "pcie-poweroff@{}.service"
INSTANCES = "${@compose_list(d, 'INSTANCE_FORMAT', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE:${PN} = "${TEMPLATE} ${INSTANCES}"

SYSTEMD_SERVICE:${PN} +=  " \
        op-cfam-reset.service \
        op-continue-mpreboot@.service \
        op-enter-mpreboot@.service \
        op-stop-instructions@.service \
        xyz.openbmc_project.Control.Host.NMI.service \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'op-reset-host-check@.service', '', d)} \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'op-reset-host-clear.service', '', d)} \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'phal-export-devtree@.service', '', d)} \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'phal-import-devtree@.service', '', d)} \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'phal-reinit-devtree.service', '', d)} \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'proc-pre-poweroff@.service', '', d)} \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'set-spi-mux.service', '', d)} \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'phal-create-boottime-guard-indicator.service', '', d)} \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'op-clear-sys-dump-active@.service', '', d)} \
        ${@bb.utils.contains('MACHINE_FEATURES', 'phal', 'op-clock-data-logger@.service', '', d)} \
        "

repository: openbmc/openbmc

repo_name: openbmc/openbmc

gha_language: Python


text:
@InProceedings{Makarychev15,
  author = {Makarychev, Konstantin and Makarychev, Yury and Vijayaraghavan, Aravindan},
  title = {Correlation Clustering with Noisy Partial Information},
  pages = {1321-1342},
  abstract = {In this paper, we propose and study a semi-random model for the Correlation Clustering problem on arbitrary graphs $G$. We give two approximation algorithms for Correlation Clustering instances
from this model. The first algorithm finds a solution of value $(1+ \delta)\mathrm{opt-cost} + O_{\delta}(n\log^3 n)$ with high probability, where $\mathrm{opt-cost}$ is the value of the optimal solution (for every $\delta > 0$). The second algorithm finds the ground truth clustering with an arbitrarily small classification error $\eta$ (under some additional assumptions on the instance).},
}

repository: mreid/papersite

repo_name: mreid/papersite