text:
#
# base recipe: meta/recipes-core/busybox/busybox_1.22.1.bb
# base branch: daisy
#

PR = "r0"

inherit debian-package

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://LICENSE;md5=de10de48642ab74318e893a61105afbb"

#
# controllable variables
#

# Whether to split the suid apps into a seperate binary
BUSYBOX_SPLIT_SUID ?= "1"

# config that are enabled/disabled according to VIRTUAL-RUNTIME_init_manager
BUSYBOX_INIT_CONFIGS ?= "INIT FEATURE_USE_INITTAB"

# space-separated list of the terminals that allow login
# (same format as SERIAL_CONSOLES)
# respawning gettys for ttys in this list are automatically appended to inittab
BUSYBOX_INITTAB_GETTYS ?= \
"${@base_conditional('SERIAL_CONSOLES', None or '', '38400;tty1', '${SERIAL_CONSOLES}', d)}"

#
# basic definitions
#

# busybox-appletlib-dependency.patch: avoid build process races
# 0001-build-system...patch: required for cross compiling
# defconfig: based on ${S}/debian/config/pkg/deb, and some configs are modified
#            so that the default system works correctly (see header comments)
SRC_URI += " \
file://busybox-appletlib-dependency.patch \
file://0001-build-system-Specify-nostldlib-when-linking-to-.o-fi.patch \
file://defconfig \
file://inittab \
file://rcS \
file://run-ptest \
"

# settings for cross-compile
export EXTRA_CFLAGS = "${CFLAGS}"
export EXTRA_LDFLAGS = "${LDFLAGS}"
export EXTRA_OEMAKE += "'LD=${CCLD}' V=1 ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_PREFIX} SKIP_STRIP=y"

inherit cml1
inherit merge-config

do_configure () {
	# defconfig is the base configuration.
	# If they are .cfg files in SRC_URI, they are automatically
	# appended to defconfig in order of appearance.
	merge_config ${WORKDIR}/defconfig ${@" ".join(find_cfgs(d))}

	# enable/disable BUSYBOX_INIT_CONFIGS based on
	# VIRTUAL-RUNTIME_init_manager
	rm -f ${S}/.config.init
	for cfg in ${BUSYBOX_INIT_CONFIGS}; do
		if [ "${VIRTUAL-RUNTIME_init_manager}" = "busybox" ]; then
			cfg_def="CONFIG_${cfg}=y"
		else
			cfg_def="# CONFIG_${cfg} is not set"
		fi
		echo "${cfg_def}" >> ${S}/.config.init
	done
	merge_config .config ${S}/.config.init
	rm ${S}/.config.init

	cml1_do_configure
}

do_compile() {
	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS

	# FEATURE_INDIVIDUAL produces not a symlink but a binary for each applet,
	# so no need to build two busybox binaries
	if [ "${BUSYBOX_SPLIT_SUID}" = "1" -a x`grep "CONFIG_FEATURE_INDIVIDUAL=y" .config` = x ]; then
		# split the .config into two parts, and make two busybox binaries

		cp .config .config.orig
		rm -f .config.suid .config.nosuid

		# busybox.cfg.suid/nosuid are the default rules in Makefile.custom.
		# They have only CONFIGs for applets that does/doesn't require SUID.
		oe_runmake busybox.cfg.suid
		oe_runmake busybox.cfg.nosuid

		# .config.disable.apps:
		#   all applet CONFIGs are disabled
		#   non-applet CONFIGs are not included
		for i in `cat busybox.cfg.suid busybox.cfg.nosuid`; do
			echo "# $i is not set" >> .config.disable.apps
		done

		# .config.noapps:
		#   all applet CONFIGs are disable
		#   non-applet CONFIGs are the same as .config.orig
		merge_config .config.orig .config.disable.apps
		cp .config .config.nonapps

		for s in suid nosuid; do
			# .config.app.suid/nosuid:
			#   all suid/nosuid applet CONFIGs are the same as .config.orig
			#   all nosuid/suid applet CONFIGs are not included
			#   non-applet CONFIGs are not included
			cat busybox.cfg.$s | while read item; do
				grep -w "$item" .config.orig
			done > .config.app.$s

			# .config (the final configuration):
			#   all suid/nosuid applet CONFIGs are the same as .config.orig
			#   all nosuid/suid applet CONFIGs are disabled
			#   non-applet CONFIGs are the same as .config.orig
			merge_config .config.nonapps .config.app.$s

			# make busybox binaries and busybox.links
			oe_runmake busybox_unstripped
			mv busybox_unstripped busybox.$s
			oe_runmake busybox.links
			mv busybox.links busybox.links.$s

			# keep configs for busybox.suid and busybox.nosuid
			cp .config .config.${s}
		done
		# copy .config.orig back to .config, because the install process may check this file
		cp .config.orig .config
		# cleanup
		rm .config.orig .config.app.suid .config.app.nosuid .config.disable.apps .config.nonapps
	else
		oe_runmake busybox_unstripped
		cp busybox_unstripped busybox
		oe_runmake busybox.links
	fi
}

do_install() {
	if [ "${prefix}" != "/usr" ]; then
		sed -i "s:^/usr/:${prefix}/:" busybox.links*
	fi
	if [ "${base_sbindir}" != "/sbin" ]; then
		sed -i "s:^/sbin/:${base_sbindir}/:" busybox.links*
	fi

	install -d ${D}${sysconfdir}/init.d

	# install busybox binaries, busybox.links files,
	# and several symlinks for postinst script
	if ! grep -q "CONFIG_FEATURE_INDIVIDUAL=y" ${B}/.config; then
		# Install /bin/busybox, and the /bin/sh link so the postinst script
		# can run. Let update-alternatives handle the rest.
		install -d ${D}${base_bindir}
		if [ "${BUSYBOX_SPLIT_SUID}" = "1" ]; then
			install -m 4755 ${B}/busybox.suid ${D}${base_bindir}
			install -m 0755 ${B}/busybox.nosuid ${D}${base_bindir}
			install -m 0644 ${S}/busybox.links.suid ${D}${sysconfdir}
			install -m 0644 ${S}/busybox.links.nosuid ${D}${sysconfdir}
			if grep -q "CONFIG_FEATURE_SH_IS_ASH=y" ${B}/.config; then
				ln -sf busybox.nosuid ${D}${base_bindir}/sh
			fi
			# Keep a default busybox for people who want to invoke busybox directly.
			# This is also useful for the on device upgrade. Because we want
			# to use the busybox command in postinst.
			ln -sf busybox.nosuid ${D}${base_bindir}/busybox
		else
			if grep -q "CONFIG_FEATURE_SUID=y" ${B}/.config; then
				install -m 4755 ${B}/busybox ${D}${base_bindir}
			else
				install -m 0755 ${B}/busybox ${D}${base_bindir}
			fi
			install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
			if grep -q "CONFIG_FEATURE_SH_IS_ASH=y" ${B}/.config; then
				ln -sf busybox ${D}${base_bindir}/sh
			fi
			# We make this symlink here to eliminate the error when upgrading together
			# with busybox-syslog. Without this symlink, the opkg may think of the
			# busybox.nosuid as obsolete and remove it, resulting in dead links like
			# /bin/sed -> /bin/busybox.nosuid. This will make upgrading busybox-syslog fail.
			# This symlink will be safely deleted in postinst, thus no negative effect.
			ln -sf busybox ${D}${base_bindir}/busybox.nosuid
		fi
	else
		install -d ${D}${base_bindir} ${D}${base_sbindir}
		install -d ${D}${libdir} ${D}${bindir} ${D}${sbindir}
		cat busybox.links | while read FILE; do
			NAME=`basename "$FILE"`
			install -m 0755 "0_lib/$NAME" "${D}$FILE.${BPN}"
		done
		# add suid bit where needed
		for i in `grep -E "APPLET.*BB_SUID_((MAYBE|REQUIRE))" include/applets.h | \
			grep -v _BB_SUID_DROP | cut -f 3 -d '(' | cut -f 1 -d ','`; do
			find ${D} -name $i.${BPN} -exec chmod a+s {} \;
		done
		install -m 0755 0_lib/libbusybox.so.${PV} ${D}${libdir}/libbusybox.so.${PV}
		ln -sf sh.${BPN} ${D}${base_bindir}/sh
		ln -sf ln.${BPN} ${D}${base_bindir}/ln
		ln -sf test.${BPN} ${D}${bindir}/test
		if [ -f ${D}/linuxrc.${BPN} ]; then
			mv ${D}/linuxrc.${BPN} ${D}/linuxrc
		fi
		install -m 0644 ${S}/busybox.links ${D}${sysconfdir}
	fi

	# install scripts and configs for sub packages;
	# udhcpc, udhcpd, and syslogd
	install -d ${D}${sysconfdir}/default
	if grep -q "CONFIG_UDHCPC=y" ${B}/.config; then
		install -d ${D}${sysconfdir}/udhcpc
		install -m 0755 \
			${S}/debian/tree/udhcpc/etc/udhcpc/default.script \
			${D}${sysconfdir}/udhcpc
	fi
	if grep -q "CONFIG_UDHCPD=y" ${B}/.config; then
		install -m 0755 ${S}/debian/tree/udhcpd/etc/init.d/udhcpd \
			${D}${sysconfdir}/init.d
		install -m 0644 ${S}/debian/tree/udhcpd/etc/default/udhcpd \
			${D}${sysconfdir}/default
		install -m 0644 ${S}/debian/tree/udhcpd/etc/udhcpd.conf \
			${D}${sysconfdir}
	fi
	if grep -q "CONFIG_SYSLOGD=y" ${B}/.config; then
		install -m 0755 \
			${S}/debian/busybox-syslogd.busybox-klogd.init \
			${D}${sysconfdir}/init.d/busybox-klogd
		install -m 0755 ${S}/debian/busybox-syslogd.init \
			${D}${sysconfdir}/init.d/busybox-syslogd
		install -m 0644 ${S}/debian/busybox-syslogd.default \
			${D}${sysconfdir}/default/busybox-syslogd
		# drop insserv config file for sysvinit
	fi

	# install inittab and rcS only if busybox is the init manager
	if [ "${VIRTUAL-RUNTIME_init_manager}" = "busybox" ]; then
		install -m 0644 ${WORKDIR}/inittab ${D}${sysconfdir}

		# automatically append respawns for ${BUSYBOX_INITTAB_GETTYS}
		for gettyargs in $(echo "${BUSYBOX_INITTAB_GETTYS}" | tr ";" ":"); do
			baudrate=$(echo "${gettyargs}" | cut -d ":" -f 1)
			tty=$(echo "${gettyargs}" | cut -d ":" -f 2)
			echo "${tty}::respawn:${base_sbindir}/getty ${baudrate} ${tty}" \
				>> ${D}${sysconfdir}/inittab
		done

		install -m 0755 ${WORKDIR}/rcS ${D}${sysconfdir}/init.d
	fi
}

#
# packaging
#

PACKAGES =+ "${PN}-syslogd udhcpc udhcpd"

# sub packages don't include their core binaries (e.g. syslogd) and
# assume that the binaries are provided by the busybox main package
RDEPENDS_${PN}-syslogd += "${PN} lsb-base start-stop-daemon"
RDEPENDS_udhcpc += "${PN}"
RDEPENDS_udhcpd += "${PN} lsb-base start-stop-daemon"

# applets:
#   ${base_sbindir}/klogd
#   ${base_sbindir}/syslogd
#   ${base_bindir}/logread
FILES_${PN}-syslogd = "${sysconfdir}/default/busybox-syslogd \
                       ${sysconfdir}/init.d/busybox-klogd \
                       ${sysconfdir}/init.d/busybox-syslogd \
                      "
# applet: ${base_sbindir}/udhcpc
FILES_udhcpc = "${sysconfdir}/udhcpc/default.script"
# applets:
#   ${sbindir}/udhcpd
#   ${bindir}/dumpleases
FILES_udhcpd = "${sysconfdir}/default/udhcpd \
                ${sysconfdir}/init.d/udhcpd \
                ${sysconfdir}/udhcpd.conf \
               "

CONFFILES_udhcpd = "${sysconfdir}/udhcpd.conf"

#
# update-alternatives
#
# busybox package usually includes a lot of commands that are also
# provided by other packages. In order to avoid conflicts between them,
# update-alternatives parameters must be defined for all commands.
#
# busybox sub packages don't include commands
# (include only helper scripts and configs),
# so no need to define update-alternatives parameters for them.
#

inherit update-alternatives

ALTERNATIVE_PRIORITY = "50"

# Dynamically define update-alternatives parameters (ALTERNATIVE_*)
# for all commands in busybox.links* files. A simple example is below:
#
# /etc/busybox.links:
#   /bin/cmd1
#   /sbin/cmd2
#   ...
# results:
#   ALTERNATIVE_busybox = "cmd1 cmd2 ..."
#   ALTERNATIVE_LINK_NAME[cmd1] = "/bin/cmd1"
#   ALTERNATIVE_LINK_NAME[cmd2] = "/sbin/cmd2"
#   ...
#   ALTERNATIVE_TARGET[cmd1] = "/bin/busybox"
#   ALTERNATIVE_TARGET[cmd2] = "/bin/busybox"
#   ...
python do_package_prepend () {
    # We need to load the full set of busybox provides from the /etc/busybox.links
    # Use this to see the update-alternatives with the right information

    dvar = d.getVar('D', True)
    pn = d.getVar('PN', True)
    def set_alternative_vars(links, target):
        f = open('%s%s' % (dvar, links), 'r')
        for alt_link_name in f:
            alt_link_name = alt_link_name.strip()
            alt_name = os.path.basename(alt_link_name)
            # Match coreutils
            if alt_name == '[':
                alt_name = 'lbracket'
            d.appendVar('ALTERNATIVE_%s' % (pn), ' ' + alt_name)
            d.setVarFlag('ALTERNATIVE_LINK_NAME', alt_name, alt_link_name)
            if os.path.exists('%s%s' % (dvar, target)):
                d.setVarFlag('ALTERNATIVE_TARGET', alt_name, target)
        f.close()
        return

    if os.path.exists('%s/etc/busybox.links' % (dvar)):
        set_alternative_vars("/etc/busybox.links", "/bin/busybox")
    else:
        set_alternative_vars("/etc/busybox.links.nosuid", "/bin/busybox.nosuid")
        set_alternative_vars("/etc/busybox.links.suid", "/bin/busybox.suid")
}

#
# ptest
#

do_install_ptest () {
	cp -r ${B}/testsuite ${D}${PTEST_PATH}/
	cp ${B}/.config      ${D}${PTEST_PATH}/
	ln -s /bin/busybox   ${D}${PTEST_PATH}/busybox
}

repository: nghiaht-tsdv/meta-debian

repo_name: nghiaht-tsdv/meta-debian

branch_name: refs/heads/jethro

gha_language: BitBake


text:
@book{WAMbook,
 author = {A\"{\i}t-Kaci, Hassan},
 title = {Warren's Abstract Machine: A Tutorial Reconstruction},
 year = {1991},
 isbn = {0-262-51058-8},
 publisher = {MIT Press},
 address = {Cambridge, MA, USA},
}

@phdthesis{prologExec,
  author       = {Mark Andrew Friedman},
  title        = {A Characterization of Prolog Execution},
  school       = {University of Wisconsin-Madison},
  year         = 1992,
  note         = {\url{ftp://ftp.cs.wisc.edu/sohi/theses/friedman.pdf}},
}

@article{prologImple,
title = "Special Issue: Ten Years of Logic Programming 1983–1993: The wonder years of sequential Prolog implementation",
journal = "The Journal of Logic Programming",
volume = "19",
pages = "385 - 441",
year = "1994",
note = "",
issn = "0743-1066",
doi = "http://dx.doi.org/10.1016/0743-1066(94)90031-0",
url = "http://www.sciencedirect.com/science/article/pii/0743106694900310",
author = "Peter Van Roy",
}

license: MIT

repository: ThermalSpan/russWAM

license_type: permissive

repo_name: ThermalSpan/russWAM

branch_name: refs/heads/master

extension: bib


text:
package main

import (
	"context"
	"encoding/json"
	"strings"
	"time"

	"github.com/spf13/cobra"

	"github.com/restic/restic/internal/debug"
	"github.com/restic/restic/internal/errors"
	"github.com/restic/restic/internal/filter"
	"github.com/restic/restic/internal/restic"
	"github.com/restic/restic/internal/walker"
)

var cmdFind = &cobra.Command{
	Use:   "find [flags] PATTERN...",
	Short: "Find a file, a directory or restic IDs",
	Long: `
The "find" command searches for files or directories in snapshots stored in the
repo.
It can also be used to search for restic blobs or trees for troubleshooting.`,
	Example: `restic find config.json
restic find --json "*.yml" "*.json"
restic find --json --blob 420f620f b46ebe8a ddd38656
restic find --show-pack-id --blob 420f620f
restic find --tree 577c2bc9 f81f2e22 a62827a9
restic find --pack 025c1d06

EXIT STATUS
===========

Exit status is 0 if the command was successful, and non-zero if there was any error.
`,
	DisableAutoGenTag: true,
	RunE: func(cmd *cobra.Command, args []string) error {
		return runFind(findOptions, globalOptions, args)
	},
}

const shortStr = 8 // Length of short IDs: 4 bytes as hex strings

// FindOptions bundles all options for the find command.
type FindOptions struct {
	Oldest             string
	Newest             string
	Snapshots          []string
	BlobID, TreeID     bool
	PackID, ShowPackID bool
	CaseInsensitive    bool
	ListLong           bool
	Hosts              []string
	Paths              []string
	Tags               restic.TagLists
}

var findOptions FindOptions

func init() {
	cmdRoot.AddCommand(cmdFind)

	f := cmdFind.Flags()
	f.StringVarP(&findOptions.Oldest, "oldest", "O", "", "oldest modification date/time")
	f.StringVarP(&findOptions.Newest, "newest", "N", "", "newest modification date/time")
	f.StringArrayVarP(&findOptions.Snapshots, "snapshot", "s", nil, "snapshot `id` to search in (can be given multiple times)")
	f.BoolVar(&findOptions.BlobID, "blob", false, "pattern is a blob-ID")
	f.BoolVar(&findOptions.TreeID, "tree", false, "pattern is a tree-ID")
	f.BoolVar(&findOptions.PackID, "pack", false, "pattern is a pack-ID")
	f.BoolVar(&findOptions.ShowPackID, "show-pack-id", false, "display the pack-ID the blobs belong to (with --blob or --tree)")
	f.BoolVarP(&findOptions.CaseInsensitive, "ignore-case", "i", false, "ignore case for pattern")
	f.BoolVarP(&findOptions.ListLong, "long", "l", false, "use a long listing format showing size and mode")

	f.StringArrayVarP(&findOptions.Hosts, "host", "H", nil, "only consider snapshots for this `host`, when no snapshot ID is given (can be specified multiple times)")
	f.Var(&findOptions.Tags, "tag", "only consider snapshots which include this `taglist`, when no snapshot-ID is given")
	f.StringArrayVar(&findOptions.Paths, "path", nil, "only consider snapshots which include this (absolute) `path`, when no snapshot-ID is given")
}

type findPattern struct {
	oldest, newest time.Time
	pattern        []string
	ignoreCase     bool
}

var timeFormats = []string{
	"2006-01-02",
	"2006-01-02 15:04",
	"2006-01-02 15:04:05",
	"2006-01-02 15:04:05 -0700",
	"2006-01-02 15:04:05 MST",
	"02.01.2006",
	"02.01.2006 15:04",
	"02.01.2006 15:04:05",
	"02.01.2006 15:04:05 -0700",
	"02.01.2006 15:04:05 MST",
	"Mon Jan 2 15:04:05 -0700 MST 2006",
}

func parseTime(str string) (time.Time, error) {
	for _, fmt := range timeFormats {
		if t, err := time.ParseInLocation(fmt, str, time.Local); err == nil {
			return t, nil
		}
	}

	return time.Time{}, errors.Fatalf("unable to parse time: %q", str)
}

type statefulOutput struct {
	ListLong bool
	JSON     bool
	inuse    bool
	newsn    *restic.Snapshot
	oldsn    *restic.Snapshot
	hits     int
}

func (s *statefulOutput) PrintPatternJSON(path string, node *restic.Node) {
	type findNode restic.Node
	b, err := json.Marshal(struct {
		// Add these attributes
		Path        string `json:"path,omitempty"`
		Permissions string `json:"permissions,omitempty"`

		*findNode

		// Make the following attributes disappear
		Name               byte `json:"name,omitempty"`
		Inode              byte `json:"inode,omitempty"`
		ExtendedAttributes byte `json:"extended_attributes,omitempty"`
		Device             byte `json:"device,omitempty"`
		Content            byte `json:"content,omitempty"`
		Subtree            byte `json:"subtree,omitempty"`
	}{
		Path:        path,
		Permissions: node.Mode.String(),
		findNode:    (*findNode)(node),
	})
	if err != nil {
		Warnf("Marshall failed: %v\n", err)
		return
	}
	if !s.inuse {
		Printf("[")
		s.inuse = true
	}
	if s.newsn != s.oldsn {
		if s.oldsn != nil {
			Printf("],\"hits\":%d,\"snapshot\":%q},", s.hits, s.oldsn.ID())
		}
		Printf(`{"matches":[`)
		s.oldsn = s.newsn
		s.hits = 0
	}
	if s.hits > 0 {
		Printf(",")
	}
	Print(string(b))
	s.hits++
}

func (s *statefulOutput) PrintPatternNormal(path string, node *restic.Node) {
	if s.newsn != s.oldsn {
		if s.oldsn != nil {
			Verbosef("\n")
		}
		s.oldsn = s.newsn
		Verbosef("Found matching entries in snapshot %s from %s\n", s.oldsn.ID().Str(), s.oldsn.Time.Local().Format(TimeFormat))
	}
	Println(formatNode(path, node, s.ListLong))
}

func (s *statefulOutput) PrintPattern(path string, node *restic.Node) {
	if s.JSON {
		s.PrintPatternJSON(path, node)
	} else {
		s.PrintPatternNormal(path, node)
	}
}

func (s *statefulOutput) PrintObjectJSON(kind, id, nodepath, treeID string, sn *restic.Snapshot) {
	b, err := json.Marshal(struct {
		// Add these attributes
		ObjectType string    `json:"object_type"`
		ID         string    `json:"id"`
		Path       string    `json:"path"`
		ParentTree string    `json:"parent_tree,omitempty"`
		SnapshotID string    `json:"snapshot"`
		Time       time.Time `json:"time,omitempty"`
	}{
		ObjectType: kind,
		ID:         id,
		Path:       nodepath,
		SnapshotID: sn.ID().String(),
		ParentTree: treeID,
		Time:       sn.Time,
	})
	if err != nil {
		Warnf("Marshall failed: %v\n", err)
		return
	}
	if !s.inuse {
		Printf("[")
		s.inuse = true
	}
	if s.hits > 0 {
		Printf(",")
	}
	Print(string(b))
	s.hits++
}

func (s *statefulOutput) PrintObjectNormal(kind, id, nodepath, treeID string, sn *restic.Snapshot) {
	Printf("Found %s %s\n", kind, id)
	if kind == "blob" {
		Printf(" ... in file %s\n", nodepath)
		Printf("     (tree %s)\n", treeID)
	} else {
		Printf(" ... path %s\n", nodepath)
	}
	Printf(" ... in snapshot %s (%s)\n", sn.ID().Str(), sn.Time.Local().Format(TimeFormat))
}

func (s *statefulOutput) PrintObject(kind, id, nodepath, treeID string, sn *restic.Snapshot) {
	if s.JSON {
		s.PrintObjectJSON(kind, id, nodepath, treeID, sn)
	} else {
		s.PrintObjectNormal(kind, id, nodepath, treeID, sn)
	}
}

func (s *statefulOutput) Finish() {
	if s.JSON {
		// do some finishing up
		if s.oldsn != nil {
			Printf("],\"hits\":%d,\"snapshot\":%q}", s.hits, s.oldsn.ID())
		}
		if s.inuse {
			Printf("]\n")
		} else {
			Printf("[]\n")
		}
		return
	}
}

// Finder bundles information needed to find a file or directory.
type Finder struct {
	repo        restic.Repository
	pat         findPattern
	out         statefulOutput
	ignoreTrees restic.IDSet
	blobIDs     map[string]struct{}
	treeIDs     map[string]struct{}
	itemsFound  int
}

func (f *Finder) findInSnapshot(ctx context.Context, sn *restic.Snapshot) error {
	debug.Log("searching in snapshot %s\n  for entries within [%s %s]", sn.ID(), f.pat.oldest, f.pat.newest)

	if sn.Tree == nil {
		return errors.Errorf("snapshot %v has no tree", sn.ID().Str())
	}

	f.out.newsn = sn
	return walker.Walk(ctx, f.repo, *sn.Tree, f.ignoreTrees, func(parentTreeID restic.ID, nodepath string, node *restic.Node, err error) (bool, error) {
		if err != nil {
			debug.Log("Error loading tree %v: %v", parentTreeID, err)

			Printf("Unable to load tree %s\n ... which belongs to snapshot %s.\n", parentTreeID, sn.ID())

			return false, walker.SkipNode
		}

		if node == nil {
			return false, nil
		}

		normalizedNodepath := nodepath
		if f.pat.ignoreCase {
			normalizedNodepath = strings.ToLower(nodepath)
		}

		var foundMatch bool

		for _, pat := range f.pat.pattern {
			found, err := filter.Match(pat, normalizedNodepath)
			if err != nil {
				return false, err
			}
			if found {
				foundMatch = true
				break
			}
		}

		var (
			ignoreIfNoMatch = true
			errIfNoMatch    error
		)
		if node.Type == "dir" {
			var childMayMatch bool
			for _, pat := range f.pat.pattern {
				mayMatch, err := filter.ChildMatch(pat, normalizedNodepath)
				if err != nil {
					return false, err
				}
				if mayMatch {
					childMayMatch = true
					break
				}
			}

			if !childMayMatch {
				ignoreIfNoMatch = true
				errIfNoMatch = walker.SkipNode
			} else {
				ignoreIfNoMatch = false
			}
		}

		if !foundMatch {
			return ignoreIfNoMatch, errIfNoMatch
		}

		if !f.pat.oldest.IsZero() && node.ModTime.Before(f.pat.oldest) {
			debug.Log("    ModTime is older than %s\n", f.pat.oldest)
			return ignoreIfNoMatch, errIfNoMatch
		}

		if !f.pat.newest.IsZero() && node.ModTime.After(f.pat.newest) {
			debug.Log("    ModTime is newer than %s\n", f.pat.newest)
			return ignoreIfNoMatch, errIfNoMatch
		}

		debug.Log("    found match\n")
		f.out.PrintPattern(nodepath, node)
		return false, nil
	})
}

func (f *Finder) findIDs(ctx context.Context, sn *restic.Snapshot) error {
	debug.Log("searching IDs in snapshot %s", sn.ID())

	if sn.Tree == nil {
		return errors.Errorf("snapshot %v has no tree", sn.ID().Str())
	}

	f.out.newsn = sn
	return walker.Walk(ctx, f.repo, *sn.Tree, f.ignoreTrees, func(parentTreeID restic.ID, nodepath string, node *restic.Node, err error) (bool, error) {
		if err != nil {
			debug.Log("Error loading tree %v: %v", parentTreeID, err)

			Printf("Unable to load tree %s\n ... which belongs to snapshot %s.\n", parentTreeID, sn.ID())

			return false, walker.SkipNode
		}

		if node == nil {
			return false, nil
		}

		if node.Type == "dir" && f.treeIDs != nil {
			treeID := node.Subtree
			found := false
			if _, ok := f.treeIDs[treeID.Str()]; ok {
				found = true
			} else if _, ok := f.treeIDs[treeID.String()]; ok {
				found = true
			}
			if found {
				f.out.PrintObject("tree", treeID.String(), nodepath, "", sn)
				f.itemsFound++
				// Terminate if we have found all trees (and we are not
				// looking for blobs)
				if f.itemsFound >= len(f.treeIDs) && f.blobIDs == nil {
					// Return an error to terminate the Walk
					return true, errors.New("OK")
				}
			}
		}

		if node.Type == "file" && f.blobIDs != nil {
			for _, id := range node.Content {
				idStr := id.String()
				if _, ok := f.blobIDs[idStr]; !ok {
					// Look for short ID form
					if _, ok := f.blobIDs[idStr[:shortStr]]; !ok {
						continue
					}
					// Replace the short ID with the long one
					f.blobIDs[idStr] = struct{}{}
					delete(f.blobIDs, idStr[:shortStr])
				}
				f.out.PrintObject("blob", idStr, nodepath, parentTreeID.String(), sn)
				break
			}
		}

		return false, nil
	})
}

// packsToBlobs converts the list of pack IDs to a list of blob IDs that
// belong to those packs.
func (f *Finder) packsToBlobs(ctx context.Context, packs []string) error {
	packIDs := make(map[string]struct{})
	for _, p := range packs {
		packIDs[p] = struct{}{}
	}
	if f.blobIDs == nil {
		f.blobIDs = make(map[string]struct{})
	}

	allPacksFound := false
	packsFound := 0

	debug.Log("Looking for packs...")
	err := f.repo.List(ctx, restic.DataFile, func(id restic.ID, size int64) error {
		if allPacksFound {
			return nil
		}
		idStr := id.String()
		if _, ok := packIDs[idStr]; !ok {
			// Look for short ID form
			if _, ok := packIDs[idStr[:shortStr]]; !ok {
				return nil
			}
		}
		debug.Log("Found pack %s", idStr)
		blobs, _, err := f.repo.ListPack(ctx, id, size)
		if err != nil {
			return err
		}
		for _, b := range blobs {
			f.blobIDs[b.ID.String()] = struct{}{}
		}
		// Stop searching when all packs have been found
		packsFound++
		if packsFound >= len(packIDs) {
			allPacksFound = true
		}
		return nil
	})

	if err != nil {
		return err
	}

	if !allPacksFound {
		return errors.Fatal("unable to find all specified pack(s)")
	}

	debug.Log("%d blobs found", len(f.blobIDs))
	return nil
}

func (f *Finder) findObjectPack(ctx context.Context, id string, t restic.BlobType) {
	idx := f.repo.Index()

	rid, err := restic.ParseID(id)
	if err != nil {
		Printf("Note: cannot find pack for object '%s', unable to parse ID: %v\n", id, err)
		return
	}

	blobs, found := idx.Lookup(rid, t)
	if !found {
		Printf("Object %s not found in the index\n", rid.Str())
		return
	}

	for _, b := range blobs {
		if b.ID.Equal(rid) {
			Printf("Object belongs to pack %s\n ... Pack %s: %s\n", b.PackID, b.PackID.Str(), b.String())
			break
		}
	}
}

func (f *Finder) findObjectsPacks(ctx context.Context) {
	for i := range f.blobIDs {
		f.findObjectPack(ctx, i, restic.DataBlob)
	}

	for i := range f.treeIDs {
		f.findObjectPack(ctx, i, restic.TreeBlob)
	}
}

func runFind(opts FindOptions, gopts GlobalOptions, args []string) error {
	if len(args) == 0 {
		return errors.Fatal("wrong number of arguments")
	}

	var err error
	pat := findPattern{pattern: args}
	if opts.CaseInsensitive {
		for i := range pat.pattern {
			pat.pattern[i] = strings.ToLower(pat.pattern[i])
		}
		pat.ignoreCase = true
	}

	if opts.Oldest != "" {
		if pat.oldest, err = parseTime(opts.Oldest); err != nil {
			return err
		}
	}

	if opts.Newest != "" {
		if pat.newest, err = parseTime(opts.Newest); err != nil {
			return err
		}
	}

	// Check at most only one kind of IDs is provided: currently we
	// can't mix types
	if (opts.BlobID && opts.TreeID) ||
		(opts.BlobID && opts.PackID) ||
		(opts.TreeID && opts.PackID) {
		return errors.Fatal("cannot have several ID types")
	}

	repo, err := OpenRepository(gopts)
	if err != nil {
		return err
	}

	if !gopts.NoLock {
		lock, err := lockRepo(repo)
		defer unlockRepo(lock)
		if err != nil {
			return err
		}
	}

	if err = repo.LoadIndex(gopts.ctx); err != nil {
		return err
	}

	ctx, cancel := context.WithCancel(gopts.ctx)
	defer cancel()

	f := &Finder{
		repo:        repo,
		pat:         pat,
		out:         statefulOutput{ListLong: opts.ListLong, JSON: globalOptions.JSON},
		ignoreTrees: restic.NewIDSet(),
	}

	if opts.BlobID {
		f.blobIDs = make(map[string]struct{})
		for _, pat := range f.pat.pattern {
			f.blobIDs[pat] = struct{}{}
		}
	}
	if opts.TreeID {
		f.treeIDs = make(map[string]struct{})
		for _, pat := range f.pat.pattern {
			f.treeIDs[pat] = struct{}{}
		}
	}

	if opts.PackID {
		f.packsToBlobs(ctx, []string{f.pat.pattern[0]}) // TODO: support multiple packs
	}

	for sn := range FindFilteredSnapshots(ctx, repo, opts.Hosts, opts.Tags, opts.Paths, opts.Snapshots) {
		if f.blobIDs != nil || f.treeIDs != nil {
			if err = f.findIDs(ctx, sn); err != nil && err.Error() != "OK" {
				return err
			}
			continue
		}
		if err = f.findInSnapshot(ctx, sn); err != nil {
			return err
		}
	}
	f.out.Finish()

	if opts.ShowPackID && (f.blobIDs != nil || f.treeIDs != nil) {
		f.findObjectsPacks(ctx)
	}

	return nil
}

repository: aawsome/restic

repo_name: aawsome/restic

gha_language: Go

extension: go


text:
@article{michel_axiom:_2016,
 author = {Michel, Loïc N and Sturaro, Nicolas and Heughebaert, André and Lepoint, Gilles},
 copyright = {All rights reserved},
 doi = {10.3897/BDJ.4.e10109},
 file = {michel_et_al_2016_axiom.pdf:C\:\\Research\\03 Literature\\Zotero Library\\storage\\W7W8N3DW\\michel_et_al_2016_axiom.pdf:application/pdf},
 issn = {1314-2828},
 journal = {Biodiversity Data Journal},
 pages = {e10109},
 title = {AxIOM: Amphipod crustaceans from insular \textitPosidonia oceanica seagrass meadows},
 url = {http://bdj.pensoft.net/articles.php?id=10109},
 volume = {4},
 year = {2016}
}

repository: loicnmichel/personal-website

repo_name: loicnmichel/personal-website


text:
@article{mazursky_compact_2020,
	title = {A compact and compliant electrorheological actuator for generating a wide range of haptic sensations},
	copyright = {All rights reserved},
	issn = {0964-1726, 1361-665X},
	url = {https://iopscience.iop.org/article/10.1088/1361-665X/ab710c},
	doi = {10.1088/1361-665X/ab710c},
	language = {en},
	urldate = {2020-01-31},
	journal = {Smart Materials and Structures},
	author = {Mazursky, Alex and Koo, Jeong-Hoi and Yang, Tae-Heon},
	month = jan,
	year = {2020},
	file = {Mazursky et al. - 2020 - A compact and compliant electrorheological actuato.pdf:C\:\\Users\\conta\\Zotero\\storage\\8EKBLJBV\\Mazursky et al. - 2020 - A compact and compliant electrorheological actuato.pdf:application/pdf}
}

repository: AlexMazursky/academic-kickstart

repo_name: AlexMazursky/academic-kickstart


text:
package util

import "log"

// Log provides a basic wrapper to format log output.
func Log(key string, value interface{}) {
	log.Printf(`{"%s": "%+v"}`, key, value)
}

repository: forstmeier/todalytics

repo_name: forstmeier/todalytics


text:
@article{astakhov2020revealing283765459,
 address = {United Kingdom},
 annote = {The QM/MM simulations followed by electron density feature analysis are carried out to deepen theunderstanding of the reaction mechanism of cephalosporin hydrolysis in the active site of the L1metallo-b-lactamase. The differences in reactivity of ten similar cephalosporin compounds are explainedby using an extended set of bonding descriptors. The limiting step of the reaction is characterized by theproton transfer to the nitrogen atom of the cephalosporin thiazine ring accompanied with formation ofthe C4]C3 double bond in its N–C4–C3 fragment. The temporary N/H–Ow hydrogen bond, which isformed in the transition state of the limiting step of the reaction was recognized as a key atomicinteraction governing the reactivity of various cephalosporins. Non-local real-space bonding descriptorsshow that different extent of localization of electron lone pair at N atom in the transition state affect thereactivity of compounds: smaller electron localization is typical for the less reactive species. In particular,the Fermi hole analysis shows how exchange electron correlation in the N/H–Ow fragment controlelectron lone pair localization. Delocalization tensor, linear response kernel and source function indicatethat features of electron delocalization in the N–C4–C3 fragment of cephalosporins in the transitionstate complexes determine the differences in C4–C3 bond for substrates with high and low rateconstants. The C4–C3 bond of the N–C4–C3 fragment at the transition state is similar to that of thepreceding intermediate for the less reactive species and resembles the features of the enzyme–productcomplex for more reactive compounds. The power and limitations of the descriptors applied for solvingthe problem are discussed and the generality of approach is stressed.},
 author = {Levina, E. O. and Khrenova, M. G. and Astakhov, A. A. and Tsirelson, V. G.},
 doi = {10.1039/c9ra10649a},
 issn = {2046-2069},
 journal = {RSC advances},
 language = {english},
 pages = {8664--8676},
 publisher = {United Kingdom},
 title = {Revealing electronic features governing hydrolysis of cephalosporins in the active site of the L1 metallo-β-lactamase},
 volume = {10},
 year = {2020}
}

repository: polyakoviv/LCC

repo_name: polyakoviv/LCC

branch_name: refs/heads/main


text:
Automatically generated by Mendeley Desktop 1.19.4
Any changes to this file will be lost if it is regenerated by Mendeley.

BibTeX export options can be customized via Preferences -> BibTeX in Mendeley Desktop

@article{Wong2013,
abstract = {BACKGROUND: Zika virus (ZIKV) is a little known arbovirus until it caused a major outbreak in the Pacific Island of Yap in 2007. Although the virus has a wide geographic distribution, most of the known vectors are sylvatic Aedes mosquitoes from Africa where the virus was first isolated. Presently, Ae. aegypti is the only known vector to transmit the virus outside the African continent, though Ae. albopictus has long been a suspected vector. Currently, Ae. albopictus has been shown capable of transmitting more than 20 arboviruses and its notoriety as an important vector came to light during the recent chikungunya pandemic. The vulnerability of Singapore to emerging infectious arboviruses has stimulated our interest to determine the competence of local Ae. albopictus to transmit ZIKV.$\backslash$n$\backslash$nMETHODOLOGY/PRINCIPAL FINDINGS: To determine the competence of Ae. albopictus to ZIKV, we orally infected local mosquito strains to a Ugandan strain virus. Fully engorged mosquitoes were maintained in an environmental chamber set at 29°C and 80-85{\%}RH. Twelve mosquitoes were then sampled daily from day one to seven and on day 10 and 14 post infection (pi). Zika virus titre in the midgut and salivary glands of each mosquito were determined using tissue culture infectious dose50 assay, while transmissibility of the virus was determined by detecting viral antigen in the mosquito saliva by qRT-PCR. High dissemination and transmission rate of ZIKV were observed. By day 7-pi, all mosquitoes have disseminated infection and 73{\%} of these mosquitoes have ZIKV in their saliva. By day 10-pi, all mosquitoes were potentially infectious.$\backslash$n$\backslash$nCONCLUSIONS/SIGNIFICANCE: The study highlighted the potential of Ae. albopictus to transmit ZIKV and the possibility that the virus could be established locally. Nonetheless, the threat of ZIKV can be mitigated by existing dengue and chikungunya control program being implemented in Singapore.},
author = {Wong, Pei Sze Jeslyn and Li, Mei zhi Irene and Chong, Chee Seng and Ng, Lee Ching and Tan, Cheong Huat},
doi = {10.1371/journal.pntd.0002348},
isbn = {1935-2735 (Electronic)$\backslash$r1935-2727 (Linking)},
issn = {19352727},
journal = {PLoS Neglected Tropical Diseases},
number = {8},
pmid = {23936579},
title = {{Aedes (Stegomyia) albopictus (Skuse): A Potential Vector of Zika Virus in Singapore}},
volume = {7},
year = {2013}
}

license: Unlicense

repository: sepmein/references

repo_name: sepmein/references


text:
@article{2004AJ....128.1955H,
 abstract = {We present BVR$_C$JHK$_s$ photometry of the optical afterglow of the
gamma-ray burst GRB 021211 taken at the Magellan, MMT, and WIYN
observatories between 0.7 and 50 days after the burst. We find
an intrinsic spectral slope at optical and near-infrared
wavelengths of 0.69+/-0.14 at 0.87 days. The optical decay
during the first day is almost identical to that of GRB 990123
except that GRB 021211's optical afterglow was intrinsically
approximately 38 times fainter and the transition from the
reverse shock to the forward shock may have occurred earlier
than it did for GRB 990123. We find no evidence for a jet break
or the cooling break passing through optical frequencies during
the first day after the burst. There is weak evidence for a
break in the J-band decay between 0.89 and 1.87 days, which may
be due to a jet. The optical and infrared data are consistent
with a relativistic fireball where the shocked electrons are in
the slow cooling regime and the electron index is 2.3+/-0.1. The
forward shock appears to have been expanding in a homogeneous
ambient medium during the first day after the burst. Our
analysis suggests that the jet of GRB 021211 may have a small
opening angle and that the total gamma-ray energy is likely to
be much less than the canonical value of
1.33×10$^51$ ergs. If this is the case, then it
is possible that most of the energy of the burst is in another
form such as a frozen magnetic field, supernova ejecta, or a
second jet component. The host galaxy of GRB 021211 is
subluminous and has a star formation rate of at least 1
M$_solar$ yr$^-1$. <P />Some of the observations reported
here were obtained at the MMT Observatory, a joint facility of
the Smithsonian Institution and the University of Arizona. Some
of the observations reported here were obtained with the
Magellan 2 (Landon Clay) telescope at the Las Campanas
Observatory. Some of the observations reported here were taken
at the WIYN Observatory, a joint facility of the University of
Wisconsin-Madison, Indiana University, Yale University, and the
National Optical Astronomy Observatory.},
 adsnote = {Provided by the SAO/NASA Astrophysics Data System},
 adsurl = {https://ui.adsabs.harvard.edu/abs/2004AJ....128.1955H},
 archiveprefix = {arXiv},
 author = {Holland, Stephen T. and Bersier, David and Bloom, J.~S. and
Garnavich, Peter M. and Caldwell, Nelson and Challis, Peter and
Kirshner, Robert and Luhman, Kevin and McLeod, Brian and
Stanek, K.~Z.},
 doi = {10.1086/425048},
 eprint = {astro-ph/0405062},
 journal = {\aj},
 keywords = {gamma rays: bursts, Astrophysics},
 month = {Nov},
 number = {5},
 pages = {1955-1964},
 primaryclass = {astro-ph},
 title = {GRB 021211 as a Faint Analog of GRB 990123: Exploring the Similarities and Differences in the Optical Afterglows},
 volume = {128},
 year = {2004}
}

repository: profjsb/my-content

repo_name: profjsb/my-content

gha_license_id: MIT

gha_language: TeX


text:
require python-iniparse_${PV}.bb
inherit native
DEPENDS = "python-native"
RDEPENDS_${PN} = ""
PR = "r1"

do_stage() {
	distutils_stage_all
}

extension: bb


text:
@inproceedings{cossu_continual_2020,
	title = {Continual {Learning} with {Gated} {Incremental} {Memories} for sequential data processing},
	booktitle = {2020 {{International Joint Conference}} on {{Neural Networks}} ({{IJCNN}})},
	author = {Cossu, A. and Carta, A. and Bacciu, D.},
	year = {2020},
	pages = {1--8},
	issn = {2161-4407},
	doi = {10.1109/IJCNN48605.2020.9207550},
	abstract = {The ability to learn in dynamic, nonstationary environments without forgetting previous knowledge, also known as Continual Learning (CL), is a key enabler for scalable and trustworthy deployments of adaptive solutions. While the importance of continual learning is largely acknowledged in machine vision and reinforcement learning problems, this is mostly under-documented for sequence processing tasks. This work proposes a Recurrent Neural Network (RNN) model for CL that is able to deal with concept drift in input distribution without forgetting previously acquired knowledge. We also implement and test a popular CL approach, Elastic Weight Consolidation (EWC), on top of two different types of RNNs. Finally, we compare the performances of our enhanced architecture against EWC and RNNs on a set of standard CL benchmarks, adapted to the sequential data processing scenario. Results show the superior performance of our architecture and highlight the need for special solutions designed to address CL in RNNs.},
	keywords = {Computational modeling,Computer architecture,continual learning,data handling,Data processing,dynamic environments,elastic weight consolidation,gated incremental memories,learning (artificial intelligence),Logic gates,neural net architecture,recurrent neural nets,recurrent neural network,Recurrent neural networks,sequential data processing,Standards,Task analysis}
}

repository: AndreaCossu/academic-kickstart

repo_name: AndreaCossu/academic-kickstart


text:
.project-image{
    opacity: 1.0;
    float:left;
    margin-right: 20px;
    margin-top: 5px;
    display: inline;
}

.project-image-screenshot{
    margin-top: 20px;
    margin-right: 20px;
    display: inline;
}

.fabric-project-image{
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.fabric-project-image-horizontal-group{
    float:left;
    width:50%;
    margin-bottom: 10px;
}

.project-list .h4{
    display: inline;
}

.project-list .p{
    display: inline;
}

.project-page-right{
    padding: 20px;
}
.project-page-left{
    padding: 20px;
}

.article-page-right{
    padding: 20px;
}
.article-page-right-content{
}
.article-page-left{
    padding: 20px;
    min-height: 100%;
}
.article-responsive-video{
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
}
.article-responsive-video iframe{
    position: absolute;
    top:0;
    left: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 1200px) {
    .project-page-right{
        display: none;
    }
    .article-page-right{
        display: none;
    }
    .project-input{
        width: 100%;
        resize: none;
    }
}

@media (max-width: 994px) {
    .git-hub-calender{
        display: none;
    }
    .fabric-project-image-horizontal-group{
        float:left;
        width:100%;
        margin-bottom: 10px;
    }
}

.readmore-anchor{
    display: inline;
    float: right;
    color: #a9d300;
    text-transform: uppercase;
    font-weight: bold;
}

extension: css


text:
@inproceedings{Veres&Hjalmarsson:02,
 address = {Las Vegas, USA},
 author = {S.M. Veres and H. Hjalmarsson},
 booktitle = {CDC},
 month = {},
 organization = {IEEE},
 title = {Tuning for robustness and performance using Iterative Feedback Tuning},
 year = {2002}
}

repository: hhjalmars/academic-kickstart

repo_name: hhjalmars/academic-kickstart


text:
SUMMARY = "Fixup ipmi file permissions"
DESCRIPTION = "Fixup ipmi file permissions"
PR = "r1"
HOMEPAGE = "http://github.com/openbmc/meta-phosphor"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${IBMBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658"

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

inherit systemd
inherit obmc-phosphor-systemd

# Add a service to change the file modes (permission bits) for files
# related to IPMI users.  Other users should have no access.
# A service is needed (contrasted with changing the permissions in the
# read-only firmware image) because the file may have been modified in
# a read-write overlay, so a firmware update will not change the modes.

# This service can be removed in the first release X where the
# incorrect permissions are not set in any release along any upgrade
# path to release X.

SERVICE = "fixup-file-modes.service"
SYSTEMD_SERVICE_${PN} += " ${SERVICE}"

repository: joseph-reynolds/openbmc

repo_name: joseph-reynolds/openbmc

gha_license_id: NOASSERTION


text:
DESCRIPTION = "Flashrom is a simple utility for reading/writing BIOS chips"
HOMEPAGE = "http://www.coreboot.org/Flashrom"
LICENSE = "GPL"
DEPENDS = "zlib pciutils"

SRCREV = "3682"
PV = "0.0+svnr${SRCPV}"
PR = "r0"

SRC_URI = " \
	svn://coreboot.org/repos/trunk/util/;module=flashrom \
	file://makefile-disable-strip.patch \
	"

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

LDFLAGS += "-lpci -lz"

do_install () {
	install -d "${D}${sbindir}"
	oe_runmake 'PREFIX=${D}/${prefix}' install
}

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
@INPROCEEDINGS{MJBF20,
AUTHOR="Thaha Mohammed and Carlee Joe-Wong and Rohit Babbar and Mario {Di
Francesco}",
TITLE="Distributed Inference Acceleration with Adaptive DNN Partitioning and
Offloading",
BOOKTITLE="IEEE INFOCOM 2020 - IEEE Conference on Computer Communications (INFOCOM
2020)",
ADDRESS="Beijing, China",
DAYS=26,
MONTH=apr,
YEAR=2020,
KEYWORDS="DNN inference; Task partitioning; Task offloading; Distributed algorithm",
ABSTRACT="Deep neural networks (DNN) are the de-facto solution behind many
intelligent applications of today, ranging from machine translation to
autonomous driving. DNNs are accurate but resource-intensive, especially
for embedded devices such as smartphones and smart objects in the Internet
of Things. To overcome the related resource constraints, DNN inference is
generally offloaded to the edge or to the cloud. This is accomplished by
partitioning the DNN and distributing computations at the two different
ends. However, existing solutions simply split the DNN into two parts, one
running locally or at the edge, and the other one in the cloud. In
contrast, this article proposes a solution to divide a DNN in multiple
partitions that can be processed locally by end devices or offloaded to one
or multiple powerful nodes, such as in fog networks. The proposed solution
includes both an adaptive DNN partitioning scheme and a distributed
algorithm to offload computations based on a matching game approach.
Results obtained by using a self-driving car dataset and several DNN
benchmarks show that the proposed solution significantly reduces the total
latency for DNN inference compared to other distributed approaches and is
2.6 to 4.2 times faster than the state of the art."
}

repository: stormvirux/personal-hugo

repo_name: stormvirux/personal-hugo


text:
@Article{ivo_pilar_institute_of_social_sciences_zagreb_croatia_international_2017,
  title = {An international integration history of the Zagreb Stock Exchange},
  language = {en},
  author = {Ivo Pilar Institute of Social Sciences and {Zagreb} and {Croatia} and Luka Sikic and Contentio d.o.o. and Velika Gorica and {Croatia} and Mislav Sagovac},
  pages = {227--257},
  file = {Ivo Pilar Institute of Social Sciences, Zagreb, Croatia et al. - 2017 - An international integration history of the Zagreb.pdf:C\:\\Users\\Lukas\\Zotero\\storage\\SPEZUBDF\\Ivo Pilar Institute of Social Sciences, Zagreb, Croatia et al. - 2017 - An international integration history of the Zagreb.pdf:application/pdf},
  volume = {41},
  issn = {2459-8860},
  url = {http://www.pse-journal.hr/upload/files/pse/2017/2/sikic_sagovac.pdf},
  doi = {10.3326/pse.41.2.4},
  abstract = {We investigate stock market co-movements among the Croatian and several other markets (in the US, UK, Germany, Austria, Poland, Czech Republic and Hungary) in the period from 3 September 1997 to 19 August 2016 with dynamic correlation coefficient models. This allows us to analyse long-term trends of the international financial integration of the Zagreb Stock Exchange in the last two decades as well as the separate impacts of major events that influenced financial markets during that period. Our results imply a relatively low level of international financial integration of the Croatian stock market, but some convergence in co-movement with the analysed markets over time is present. The strongest market co-movement is related to the subprime mortgage crisis, and EU accession seems to have made Croatian international integration less segmented.},
  number = {2},
  urldate = {2020-11-27},
  journal = {Public Sector Economics},
  month = {jun},
  year = {2017},
  pubtype = {2},
  date = {2017-01-01},
}

repository: lusiki/starter-academic

repo_name: lusiki/starter-academic


text:
SUMMARY = "C-Periphery lib used to access GPIO, LED, PWM, SPI, I2C, MMIO, Serial"
DESCRIPTION = "A C library for peripheral I/O (GPIO, LED, PWM, SPI, I2C, MMIO, Serial) in Linux"

HOMEPAGE = "https://github.com/vsergeev/c-periphery"

SECTION = "libs"

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

SRC_URI = "git://github.com/vsergeev/c-periphery;protocol=https;branch=master"
SRCREV = "91f9678d2a35a3af3c633f20165bdde8bea32209"

S = "${WORKDIR}/git"

inherit cmake

EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON"

BBCLASSEXTEND = "native nativesdk"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded


text:
/*
Copyright 2014 The Kubernetes Authors.

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

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

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

package lifecycle

import (
	"context"
	"errors"
	"fmt"
	"io"
	"net"
	"net/http"
	"net/url"
	"strconv"
	"strings"

	v1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/apimachinery/pkg/util/intstr"
	utilfeature "k8s.io/apiserver/pkg/util/feature"
	"k8s.io/client-go/tools/record"
	"k8s.io/klog/v2"
	"k8s.io/kubernetes/pkg/features"
	kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
	"k8s.io/kubernetes/pkg/kubelet/metrics"
	kubetypes "k8s.io/kubernetes/pkg/kubelet/types"
	"k8s.io/kubernetes/pkg/kubelet/util/format"
	httpprobe "k8s.io/kubernetes/pkg/probe/http"
	"k8s.io/kubernetes/pkg/security/apparmor"
)

const (
	maxRespBodyLength = 10 * 1 << 10 // 10KB
)

type handlerRunner struct {
	httpDoer         kubetypes.HTTPDoer
	commandRunner    kubecontainer.CommandRunner
	containerManager podStatusProvider
	eventRecorder    record.EventRecorder
}

type podStatusProvider interface {
	GetPodStatus(ctx context.Context, uid types.UID, name, namespace string) (*kubecontainer.PodStatus, error)
}

// NewHandlerRunner returns a configured lifecycle handler for a container.
func NewHandlerRunner(httpDoer kubetypes.HTTPDoer, commandRunner kubecontainer.CommandRunner, containerManager podStatusProvider, eventRecorder record.EventRecorder) kubecontainer.HandlerRunner {
	return &handlerRunner{
		httpDoer:         httpDoer,
		commandRunner:    commandRunner,
		containerManager: containerManager,
		eventRecorder:    eventRecorder,
	}
}

func (hr *handlerRunner) Run(ctx context.Context, containerID kubecontainer.ContainerID, pod *v1.Pod, container *v1.Container, handler *v1.LifecycleHandler) (string, error) {
	switch {
	case handler.Exec != nil:
		var msg string
		// TODO(tallclair): Pass a proper timeout value.
		output, err := hr.commandRunner.RunInContainer(ctx, containerID, handler.Exec.Command, 0)
		if err != nil {
			msg = fmt.Sprintf("Exec lifecycle hook (%v) for Container %q in Pod %q failed - error: %v, message: %q", handler.Exec.Command, container.Name, format.Pod(pod), err, string(output))
			klog.V(1).ErrorS(err, "Exec lifecycle hook for Container in Pod failed", "execCommand", handler.Exec.Command, "containerName", container.Name, "pod", klog.KObj(pod), "message", string(output))
		}
		return msg, err
	case handler.HTTPGet != nil:
		err := hr.runHTTPHandler(ctx, pod, container, handler, hr.eventRecorder)
		var msg string
		if err != nil {
			msg = fmt.Sprintf("HTTP lifecycle hook (%s) for Container %q in Pod %q failed - error: %v", handler.HTTPGet.Path, container.Name, format.Pod(pod), err)
			klog.V(1).ErrorS(err, "HTTP lifecycle hook for Container in Pod failed", "path", handler.HTTPGet.Path, "containerName", container.Name, "pod", klog.KObj(pod))
		}
		return msg, err
	default:
		err := fmt.Errorf("invalid handler: %v", handler)
		msg := fmt.Sprintf("Cannot run handler: %v", err)
		klog.ErrorS(err, "Cannot run handler")
		return msg, err
	}
}

// resolvePort attempts to turn an IntOrString port reference into a concrete port number.
// If portReference has an int value, it is treated as a literal, and simply returns that value.
// If portReference is a string, an attempt is first made to parse it as an integer.  If that fails,
// an attempt is made to find a port with the same name in the container spec.
// If a port with the same name is found, it's ContainerPort value is returned.  If no matching
// port is found, an error is returned.
func resolvePort(portReference intstr.IntOrString, container *v1.Container) (int, error) {
	if portReference.Type == intstr.Int {
		return portReference.IntValue(), nil
	}
	portName := portReference.StrVal
	port, err := strconv.Atoi(portName)
	if err == nil {
		return port, nil
	}
	for _, portSpec := range container.Ports {
		if portSpec.Name == portName {
			return int(portSpec.ContainerPort), nil
		}
	}
	return -1, fmt.Errorf("couldn't find port: %v in %v", portReference, container)
}

func (hr *handlerRunner) runHTTPHandler(ctx context.Context, pod *v1.Pod, container *v1.Container, handler *v1.LifecycleHandler, eventRecorder record.EventRecorder) error {
	host := handler.HTTPGet.Host
	podIP := host
	if len(host) == 0 {
		status, err := hr.containerManager.GetPodStatus(ctx, pod.UID, pod.Name, pod.Namespace)
		if err != nil {
			klog.ErrorS(err, "Unable to get pod info, event handlers may be invalid.", "pod", klog.KObj(pod))
			return err
		}
		if len(status.IPs) == 0 {
			return fmt.Errorf("failed to find networking container: %v", status)
		}
		host = status.IPs[0]
		podIP = host
	}

	if utilfeature.DefaultFeatureGate.Enabled(features.ConsistentHTTPGetHandlers) {
		req, err := httpprobe.NewRequestForHTTPGetAction(handler.HTTPGet, container, podIP, "lifecycle")
		if err != nil {
			return err
		}
		resp, err := hr.httpDoer.Do(req)
		discardHTTPRespBody(resp)

		if isHTTPResponseError(err) {
			klog.V(1).ErrorS(err, "HTTPS request to lifecycle hook got HTTP response, retrying with HTTP.", "pod", klog.KObj(pod), "host", req.URL.Host)

			req := req.Clone(context.Background())
			req.URL.Scheme = "http"
			req.Header.Del("Authorization")
			resp, httpErr := hr.httpDoer.Do(req)

			// clear err since the fallback succeeded
			if httpErr == nil {
				metrics.LifecycleHandlerHTTPFallbacks.Inc()
				if eventRecorder != nil {
					// report the fallback with an event
					eventRecorder.Event(pod, v1.EventTypeWarning, "LifecycleHTTPFallback", fmt.Sprintf("request to HTTPS lifecycle hook %s got HTTP response, retry with HTTP succeeded", req.URL.Host))
				}
				err = nil
			}
			discardHTTPRespBody(resp)
		}
		return err
	}

	// Deprecated code path.
	var port int
	if handler.HTTPGet.Port.Type == intstr.String && len(handler.HTTPGet.Port.StrVal) == 0 {
		port = 80
	} else {
		var err error
		port, err = resolvePort(handler.HTTPGet.Port, container)
		if err != nil {
			return err
		}
	}

	url := fmt.Sprintf("http://%s/%s", net.JoinHostPort(host, strconv.Itoa(port)), handler.HTTPGet.Path)
	req, err := http.NewRequest(http.MethodGet, url, nil)
	if err != nil {
		return err
	}
	resp, err := hr.httpDoer.Do(req)

	discardHTTPRespBody(resp)
	return err
}

func discardHTTPRespBody(resp *http.Response) {
	if resp == nil {
		return
	}

	// Ensure the response body is fully read and closed
	// before we reconnect, so that we reuse the same TCP
	// connection.
	defer resp.Body.Close()

	if resp.ContentLength <= maxRespBodyLength {
		io.Copy(io.Discard, &io.LimitedReader{R: resp.Body, N: maxRespBodyLength})
	}
}

// NewAppArmorAdmitHandler returns a PodAdmitHandler which is used to evaluate
// if a pod can be admitted from the perspective of AppArmor.
func NewAppArmorAdmitHandler(validator apparmor.Validator) PodAdmitHandler {
	return &appArmorAdmitHandler{
		Validator: validator,
	}
}

type appArmorAdmitHandler struct {
	apparmor.Validator
}

func (a *appArmorAdmitHandler) Admit(attrs *PodAdmitAttributes) PodAdmitResult {
	// If the pod is already running or terminated, no need to recheck AppArmor.
	if attrs.Pod.Status.Phase != v1.PodPending {
		return PodAdmitResult{Admit: true}
	}

	err := a.Validate(attrs.Pod)
	if err == nil {
		return PodAdmitResult{Admit: true}
	}
	return PodAdmitResult{
		Admit:   false,
		Reason:  "AppArmor",
		Message: fmt.Sprintf("Cannot enforce AppArmor: %v", err),
	}
}

func isHTTPResponseError(err error) bool {
	if err == nil {
		return false
	}
	urlErr := &url.Error{}
	if !errors.As(err, &urlErr) {
		return false
	}
	return strings.Contains(urlErr.Err.Error(), "server gave HTTP response to HTTPS client")
}

repository: kubernetes/kubernetes

repo_name: kubernetes/kubernetes


text:
DESCRIPTION = "Package containing Makefile and Rules.make file for TISDKs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

# Build the list of component makefiles to put together to build the
# Makefile that goes into the SDK.  For legacy devices the base Makefile
# will be picked up and will contain everything.
#
# It is assumed that the component makefiles follow the naming
# Makefile_$component.  All Makefiles will be part of the SRC_URI to be
# fetched, but only the listed ones will be used to build the final Makefile

SRC_URI = "\
    file://Makefile \
    file://Rules.make \
    file://Makefile_linux \
    file://Makefile_linux-dtbs \
    file://Makefile_u-boot-legacy \
    file://Makefile_matrix-gui \
    file://Makefile_arm-benchmarks \
    file://Makefile_ti-crypto-examples \
    file://Makefile_am-sysinfo \
    file://Makefile_av-examples \
    file://Makefile_u-boot-spl \
    file://Makefile_matrix-gui-browser \
    file://Makefile_refresh-screen \
    file://Makefile_pru \
    file://Makefile_ti-ocf-crypto-module \
    file://Makefile_qt-tstat \
    file://Makefile_quick-playground \
    file://Makefile_omapconf \
    file://Makefile_oprofile-example \
    file://Makefile_dual-camera-demo \
    file://Makefile_image-gallery \
    file://Makefile_cryptodev \
    file://Makefile_cmem-mod \
    file://Makefile_debugss-module-drv \
    file://Makefile_gdbserverproxy-module-drv \
    file://Makefile_ti-sgx-ddk-km \
    file://Makefile_opencl-examples \
    file://Makefile_boot-monitor \
    file://Makefile_hplib-mod \
    file://Makefile_uio-module-drv \
    file://Makefile_pru-icss \
    file://Makefile_qt-opencv-opencl-opengl-multithreaded \
    file://Makefile_ipsecmgr-mod \
    file://Makefile_openmpacc-examples \
    file://Makefile_linalg-examples \
    file://Makefile_ti-gc320-driver \
    file://Makefile_barcode-roi \
    file://Makefile_sysfw-image \
    file://Makefile_mmwavegesture-hmi \
    file://Makefile_pdm-anomaly-detection \
    file://Makefile_tiovx-app-host \
    file://Makefile_ti-ipc \
    file://Makefile_ti-img-rogue-driver \
"

PR = "r105"

MAKEFILES_MATRIX_GUI = "matrix-gui-browser \
                        refresh-screen \
                        qt-tstat \
"

MAKEFILES_MATRIX_GUI_keystone = ""
MAKEFILES_MATRIX_GUI_omapl138 = ""
MAKEFILES_MATRIX_GUI_j7 = ""

MAKEFILES_COMMON = "linux \
                    matrix-gui \
                    arm-benchmarks \
                    am-sysinfo \
                    oprofile-example \
                    ${MAKEFILES_MATRIX_GUI} \
"
MAKEFILES = ""

# This example application should not be used when using non-SGX
QUICK_PLAYGROUND = "${@oe.utils.conditional('ARAGO_QT_PROVIDER','qt4-embedded-gles','quick-playground','', d)}"

# Add device specific make targets

MAKEFILES_append_omap3 = " u-boot-spl \
                           ${QUICK_PLAYGROUND} \
"
MAKEFILES_append_am37x-evm = " av-examples \
                               ti-ocf-crypto-module \
"
MAKEFILES_append_am3517-evm = " av-examples \
                                ti-ocf-crypto-module \
"
MAKEFILES_append_ti33x = " u-boot-spl \
                           ${QUICK_PLAYGROUND} \
                           ti-crypto-examples \
                           linux-dtbs \
                           cryptodev \
                           ti-sgx-ddk-km \
                           pru-icss \
                           barcode-roi \
                           uio-module-drv \
			   mmwavegesture-hmi \
                           pdm-anomaly-detection \
"
MAKEFILES_append_ti43x = " u-boot-spl \
                           ${QUICK_PLAYGROUND} \
                           ti-crypto-examples \
                           linux-dtbs \
                           cryptodev \
                           dual-camera-demo \
                           image-gallery \
                           ti-sgx-ddk-km \
                           cmem-mod \
                           pru-icss \
                           barcode-roi \
                           uio-module-drv \
			   mmwavegesture-hmi \
                           pdm-anomaly-detection \
"

#                            debugss-module-drv
#                            gdbserverproxy-module-drv
MAKEFILES_append_dra7xx = " cryptodev \
                            opencl-examples \
                            openmpacc-examples \
                            qt-opencv-opencl-opengl-multithreaded \
                            linalg-examples \
                            tiovx-app-host \
"

MAKEFILES_append_omap-a15 = " u-boot-spl \
                              ${QUICK_PLAYGROUND} \
                              omapconf \
                              linux-dtbs \
                              ti-sgx-ddk-km \
                              cmem-mod \
                              pru-icss \
                              ti-gc320-driver \
                              barcode-roi \
                              uio-module-drv \
			      mmwavegesture-hmi \
                              pdm-anomaly-detection \
                              ti-ipc \
"
MAKEFILES_append_omapl138 = " linux-dtbs \
                              u-boot-spl \
                              ti-ipc \
"

MAKEFILES_append_keystone = " u-boot-spl \
                              linux-dtbs \
                              boot-monitor \
                              cmem-mod \
                              cryptodev \
                              ti-crypto-examples \
                              hplib-mod \
                              uio-module-drv \
                              ipsecmgr-mod \
                              barcode-roi \
                              ti-ipc \
"

#                              gdbserverproxy-module-drv
#                              debugss-module-drv
MAKEFILES_append_k2hk = " opencl-examples \
                              openmpacc-examples \
                              linalg-examples \
"

#                             gdbserverproxy-module-drv
#                             debugss-module-drv
MAKEFILES_append_k2l = " opencl-examples \
                             openmpacc-examples \
"

#                             gdbserverproxy-module-drv
#                             debugss-module-drv
MAKEFILES_append_k2e = " opencl-examples \
                             openmpacc-examples \
"

MAKEFILES_append_k2g = " pru-icss"

MAKEFILES_append_k3 = " u-boot-spl \
                        linux-dtbs \
                        cryptodev \
                        sysfw-image \
                        ti-ipc \
"

MAKEFILES_append_am65xx = " \
                        pru-icss \
                        ti-sgx-ddk-km \
                        barcode-roi \
                        mmwavegesture-hmi \
                        pdm-anomaly-detection \
"

MAKEFILES_append_j7 = " pru-icss \
                            ti-img-rogue-driver \
"

# Use this to export kernel arch to ARCH
#
# We need to be very careful here. This class will also overwrite UBOOT_ARCH
# even though it may be set in the machine configuration.
inherit kernel-arch

# Use ARCH format expected by the makefile
PLATFORM_ARCH = "${ARMPKGARCH}"
PLATFORM_ARCH_arm = "armv7-a"
PLATFORM_ARCH_omapl138 = "armv5te"

# ti-sgx-ddk-km configurations
# See meta-ti/recipes-bsp/powervr-drivers/ti-sgx-ddk-km_1.17.4948957.bb
TI_SGX_TARGET_PRODUCT = "jacinto6evm"
TI_SGX_TARGET_PRODUCT_ti33x = "ti335x"
TI_SGX_TARGET_PRODUCT_ti43x = "ti437x"
TI_SGX_TARGET_PRODUCT_k3 = "ti654x"

TI_SGX_TARGET_ARCH = "armhf"
TI_SGX_TARGET_ARCH_k3 = "aarch64"

PLATFORM_DEBUGSS = ""
PLATFORM_DEBUGSS_dra7xx = "DRA7xx_PLATFORM"
PLATFORM_DEBUGSS_keystone = "KEYSTONE_PLATFORM"

PLATFORM_GDBSERVERPROXY = ""
PLATFORM_GDBSERVERPROXY_dra7xx = "DRA7xx_PLATFORM"
PLATFORM_GDBSERVERPROXY_keystone = "KEYSTONE_PLATFORM"

PRU_ICSS_INSTALL_TARGET = "pru-icss_install_none"
PRU_ICSS_INSTALL_TARGET_ti33x = "pru-icss_install_am335x"
PRU_ICSS_INSTALL_TARGET_ti43x = "pru-icss_install_am437x"
PRU_ICSS_INSTALL_TARGET_omap-a15 = "pru-icss_install_am572x"
PRU_ICSS_INSTALL_TARGET_k2g = "pru-icss_install_k2g"
PRU_ICSS_INSTALL_TARGET_am65xx = "pru-icss_install_am65x"
PRU_ICSS_INSTALL_TARGET_j7 = "pru-icss_install_j721e"

# Path to toolchains for the various cores in TI SOCs
#
# These are provided by the TI RTOS SDK and used to build firmwares used by the
# IPC Linux examples.
IPC_TOOLS_PATHS_C66 = "ti.targets.elf.C66="\$\(C6X_GEN_INSTALL_PATH\)""
IPC_TOOLS_PATHS_M4  = "ti.targets.arm.elf.M4="\$\(TOOLCHAIN_PATH_M4\)" ti.targets.arm.elf.M4F="\$\(TOOLCHAIN_PATH_M4\)""
IPC_TOOLS_PATHS_R5F  = "ti.targets.arm.elf.R5F="\$\(TOOLCHAIN_PATH_R5\)""
IPC_TOOLS_PATHS_C674 = "ti.targets.elf.C674="\$\(C6X_GEN_INSTALL_PATH\)""

IPC_TOOLS_PATHS = ""
IPC_TOOLS_PATHS_append_keystone = " ${IPC_TOOLS_PATHS_C66}"
IPC_TOOLS_PATHS_append_omap-a15 = " ${IPC_TOOLS_PATHS_C66} ${IPC_TOOLS_PATHS_M4}"
IPC_TOOLS_PATHS_append_omapl138 = " ${IPC_TOOLS_PATHS_C674}"
IPC_TOOLS_PATHS_append_k3 = "${IPC_TOOLS_PATHS_R5F}"

# If it's not defined at all, like for zImage case
UBOOT_LOADADDRESS ?= "0"

KERNEL_BUILD_CMDS = "${@oe.utils.conditional('KERNEL_IMAGETYPE','uImage','LOADADDR=${UBOOT_LOADADDRESS}','',d)} ${KERNEL_IMAGETYPE}"

DEFCONFIG = "tisdk_${MACHINE}${ARAGO_KERNEL_SUFFIX}_defconfig"

AMSDK_DEFCONFIG = "singlecore-omap2plus_defconfig"

DEFCONFIG := "${@oe.utils.conditional('ARAGO_BRAND','amsdk','${AMSDK_DEFCONFIG}','${DEFCONFIG}',d)}"

EXTERNAL_TOOLCHAIN_BINDIR = "/usr/bin"
INTERNAL_TOOLCHAIN_BINDIR = "/usr/bin/${TARGET_ARCH}${TARGET_VENDOR}-${TARGET_OS}"

# This step will stitch together the final Makefile based on the supported
# make targets.
do_install () {
    install -d ${D}/

    # Start with the base Makefile
    install  ${WORKDIR}/Makefile ${D}/Makefile

    # Remember the targets added so we can update the all target
    targets=""
    clean_targets=""
    install_targets=""

    # Now add common build targets
    for x in ${MAKEFILES_COMMON}
    do
        cat ${WORKDIR}/Makefile_${x} >> ${D}/Makefile
        targets="$targets""$x\ "
        clean_targets="$clean_targets""$x""_clean\ "
        install_targets="$install_targets""$x""_install\ "
    done

    # Now add device specific build targets
    for x in ${MAKEFILES}
    do
        cat ${WORKDIR}/Makefile_${x} >> ${D}/Makefile
        targets="$targets""$x\ "
        clean_targets="$clean_targets""$x""_clean\ "
        install_targets="$install_targets""$x""_install\ "
    done

    # Update the all, clean, and install targets if we added targets
    if [ "$targets" != "" ]
    then
        sed -i -e "s/__ALL_TARGETS__/$targets/" ${D}/Makefile
        sed -i -e "s/__CLEAN_TARGETS__/$clean_targets/" ${D}/Makefile
        sed -i -e "s/__INSTALL_TARGETS__/$install_targets/" ${D}/Makefile
    fi

    sed -i -e "s/__KERNEL_ARCH__/${ARCH}/" ${D}/Makefile
    sed -i -e "s/__KERNEL_IMAGE_TYPE__/${KERNEL_IMAGETYPE}/" ${D}/Makefile
    sed -i -e "s/__KERNEL_BUILD_CMDS__/${KERNEL_BUILD_CMDS}/" ${D}/Makefile
    sed -i -e "s/__SDKMACHINE__/${SDKMACHINE}/g" ${D}/Makefile

    sed -i -e "s/__TI_SGX_TARGET_PRODUCT__/${TI_SGX_TARGET_PRODUCT}/" ${D}/Makefile
    sed -i -e "s/__TI_SGX_TARGET_ARCH__/${TI_SGX_TARGET_ARCH}/" ${D}/Makefile
    sed -i -e "s/__PLATFORM_DEBUGSS__/${PLATFORM_DEBUGSS}/g" ${D}/Makefile
    sed -i -e "s/__PLATFORM_GDBSERVERPROXY__/${PLATFORM_GDBSERVERPROXY}/g" ${D}/Makefile
    sed -i -e "s/__BOOT_MONITOR_MAKE_TARGET__/${BOOT_MONITOR_MAKE_TARGET}/g" ${D}/Makefile
    sed -i -e "s/__PRU_ICSS_INSTALL_TARGET__/${PRU_ICSS_INSTALL_TARGET}/g" ${D}/Makefile
    sed -i -e "s/__IPC_TOOLS_PATHS__/${IPC_TOOLS_PATHS}/g" ${D}/Makefile
    sed -i -e "s/__TISDK_VERSION__/${TISDK_VERSION}/g" ${D}/Makefile

    cat ${D}/Makefile | grep "__DTB_DEPEND__" > /dev/null

    if [ "$?" == "0" ]
    then
        sed -i -e "s|__KERNEL_DEVICETREE__|${KERNEL_DEVICETREE}|" ${D}/Makefile
        sed -i -e "s/__DTB_DEPEND__/linux-dtbs/" ${D}/Makefile
        sed -i -e "s/__DTB_DEPEND_INSTALL__/linux-dtbs_install/" ${D}/Makefile
    else
        sed -i -e "s/__DTB_DEPEND__//" ${D}/Makefile
        sed -i -e "s/__DTB_DEPEND_INSTALL__//" ${D}/Makefile
    fi

    install  ${WORKDIR}/Rules.make ${D}/Rules.make

    # fixup Rules.make values
    sed -i -e "s/__PLATFORM__/${MACHINE}/" ${D}/Rules.make
    sed -i -e "s/__DEFCONFIG__/${DEFCONFIG}/" ${D}/Rules.make
    sed -i -e "s/__ARCH__/${PLATFORM_ARCH}/" ${D}/Rules.make
    sed -i -e "s/__TOOLCHAIN_PREFIX__/${TOOLCHAIN_SYS}-/" ${D}/Rules.make
    sed -i -e "s/__UBOOT_MACHINE__/${UBOOT_MACHINE}/" ${D}/Rules.make
    sed -i -e "s/__CFLAGS__/${TARGET_CC_ARCH}/" ${D}/Rules.make
    sed -i -e "s/__SDKMACHINE__/${SDKMACHINE}/" ${D}/Rules.make

    if [ "${TOOLCHAIN_TYPE}" = "internal" ]; then
        sed -i -e "s|__TOOLCHAIN_BINDIR__|${INTERNAL_TOOLCHAIN_BINDIR}|" ${D}/Rules.make
    else
        sed -i -e "s|__TOOLCHAIN_BINDIR__|${EXTERNAL_TOOLCHAIN_BINDIR}|" ${D}/Rules.make
    fi

}

K3_UBOOT_MACHINE_R5 = ""
K3_UBOOT_MACHINE_R5_am65xx-evm = "am65x_evm_r5_defconfig"
K3_UBOOT_MACHINE_R5_am65xx-hs-evm = "am65x_hs_evm_r5_defconfig"
K3_UBOOT_MACHINE_R5_j7-evm = "j721e_evm_r5_config"
K3_UBOOT_MACHINE_R5_j7-hs-evm = "j721e_hs_evm_r5_config"

do_install_append_k3() {
    cat >> ${D}/Rules.make << __EOF__

# Add CROSS_COMPILE and UBOOT_MACHINE for the R5
export CROSS_COMPILE_ARMV7=\$(LINUX_DEVKIT_PATH)/sysroots/${SDKMACHINE}-arago-linux/usr/bin/arm-none-linux-gnueabihf-
UBOOT_MACHINE_R5=${K3_UBOOT_MACHINE_R5}
__EOF__
}

PACKAGE_ARCH = "${MACHINE_ARCH}"

FILES_${PN} = "/*"


text:
/*---
title:    grow
section:  Flex items
---

Use grow utility classes to change the grow of a flex item from `0` to `8`.
E.g. `.u-fg5` sets `flex-grow: 5;`

```example:html
<div class="flex">
  <div class="u-fg1 u-fb1x">Grow 1</div>
  <div class="u-fg2 u-fb1x">Grow 2</div>
  <div class="u-fg4 u-fb1x">Grow 4</div>
  <div class="u-fg8 u-fb1x">Grow 8</div>
</div>
```

*/

@import "settings.css";

@define-mixin grow $resp {
  @for $i from 0 to 8 {
    .u-fg$(i)$(resp) {
      flex-grow: $i;
    }
  }
}

@mixin grow {}

@media (--sm-viewport) {
  @mixin grow \@sm {}
}

@media (--md-viewport) {
  @mixin grow \@md {}
}

@media (--lg-viewport) {
  @mixin grow \@lg {}
}

gha_language: CSS


text:
@InProceedings{10.1007/978-3-319-03161-3_35,
author="Anderson, Keith
and Andr{\'e}, Elisabeth
and Baur, T.
and Bernardini, Sara
and Chollet, M.
and Chryssafidou, E.
and Damian, I.
and Ennis, C.
and Egges, A.
and Gebhard, P.
and Jones, H.
and Ochs, M.
and Pelachaud, C.
and Porayska-Pomsta, Ka{\'{s}}ka
and Rizzo, P.
and Sabouret, Nicolas",
editor="Reidsma, Dennis
and Katayose, Haruhiro
and Nijholt, Anton",
title="The TARDIS Framework: Intelligent Virtual Agents for Social Coaching in Job Interviews",
booktitle="Advances in Computer Entertainment",
year="2013",
publisher="Springer International Publishing",
address="Cham",
pages="476--491",
abstract="The TARDIS project aims to build a scenario-based serious-game simulation platform for NEETs and job-inclusion associations that supports social training and coaching in the context of job interviews. This paper presents the general architecture of the TARDIS job interview simulator, and the serious game paradigm that we are developing.",
isbn="978-3-319-03161-3"
}

repository: matchollet/academic-kickstart

repo_name: matchollet/academic-kickstart


text:
@article{Lyu-2018-Validation,
    title = "Validation of the SMAP freeze/thaw product using categorical triple collocation",
    author = "Lyu, Haobo  and
      McColl, Kaighin A.  and
      Li, Xinlu  and
      Derksen, Chris  and
      Berg, Aaron  and
      Black, T. Andrew  and
      Euskirchen, Eugenie  and
      Loranty, Michael  and
      Pulliainen, Jouni  and
      Rautiainen, Kimmo  and
      Rowlandson, Tracy  and
      Roy, Alexandre  and
      Royer, Alain  and
      Langlois, Alexandre  and
      Stephens, Jilmarie  and
      Lu, Hui  and
      Entekhabi, Dara",
    journal = "Remote Sensing of Environment, Volume 205",
    volume = "205",
    year = "2018",
    publisher = "Elsevier BV",
    url = "https://aclanthology.org/G18-74001",
    doi = "10.1016/j.rse.2017.12.007",
    pages = "329--337",
}

repository: gwf-uwaterloo/gwf-publications

repo_name: gwf-uwaterloo/gwf-publications

gha_language: Python


text:
@misc{DBLP:conf/isola/NiekeMSY16,
 author = {Michael Nieke and
Jacopo Mauro and
Christoph Seidl and
Ingrid Chieh Yu},
 bibsource = {dblp computer science bibliography, http://dblp.org},
 biburl = {http://dblp.uni-trier.de/rec/bib/conf/isola/NiekeMSY16},
 booktitle = {Leveraging Applications of Formal Methods, Verification and Validation:
Discussion, Dissemination, Applications - 7th International Symposium,
ISoLA 2016, Imperial, Corfu, Greece, October 10-14, 2016, Proceedings,
Part II},
 crossref = {DBLP:conf/isola/2016-2},
 doi = {10.1007/978-3-319-47169-3_44},
 pages = {563--578},
 timestamp = {Tue, 23 May 2017 01:12:13 +0200},
 title = {User Profiles for Context-Aware Reconfiguration in Software Product
Lines},
 url = {https://doi.org/10.1007/978-3-319-47169-3_44},
 year = {2016}
}

repository: jacopoMauro/website

repo_name: jacopoMauro/website


text:
################################################################################
#                        Copyright 2018 Ryan M. Richard                        #
#       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.                        #
################################################################################

include_guard()
include(build_recipe/ctor_add_kwargs)
include(object/object)
include(utility/set_return)

## Class storing the information required to build a dependency
#
# :Members:
#
#     * name - The name of the dependency
#     * version - The version of the dependency
#     * src - The path to the root of the source tree.
#     * args - A list of build options
#
# :param handle: An identifier to store the resulting object's handle in.
# :param kwargs: A handle to the kwargs instance to use.
function(_cpp_BuildRecipe_ctor _cBc_handle _cBc_kwargs)
    _cpp_BuildRecipe_ctor_add_kwargs(${_cBc_kwargs})
    _cpp_Kwargs_parse_argn(${_cBc_kwargs} ${ARGN})
    _cpp_Kwargs_kwarg_value(${_cBc_kwargs} _cBc_src SOURCE_DIR)
    _cpp_Kwargs_kwarg_value(${_cBc_kwargs} _cBc_name NAME)
    _cpp_Kwargs_kwarg_value(${_cBc_kwargs} _cBc_version VERSION)
    _cpp_Kwargs_kwarg_value(${_cBc_kwargs} _cBc_toolchain TOOLCHAIN)
    _cpp_Kwargs_kwarg_value(${_cBc_kwargs} _cBc_args CMAKE_ARGS)
    _cpp_Kwargs_kwarg_value(${_cBc_kwargs} _cBc_depends DEPENDS)

    _cpp_does_not_exist(_cBc_dne "${_cBc_src}")
    if(_cBc_dne)
        _cpp_error("The source directory: ${_cBc_src} does not exist.")
    endif()
    _cpp_Object_ctor(_cBc_temp)
    _cpp_Object_set_type(${_cBc_temp} BuildRecipe)
    _cpp_Object_add_members(
        ${_cBc_temp} name version src args depends toolchain
    )
    foreach(_cBc_mem_i name version src toolchain args depends)
        _cpp_Object_set_value(
            ${_cBc_temp} ${_cBc_mem_i} "${_cBc_${_cBc_mem_i}}"
        )
    endforeach()
    _cpp_set_return(${_cBc_handle} ${_cBc_temp})
endfunction()

repository: keipertk/CMakePackagingProject

repo_name: keipertk/CMakePackagingProject

extension: cmake


text:
package renderer

import (
	"bytes"
	"os"
	"testing"

	"github.com/google/go-cmp/cmp"
	"github.com/yuin/goldmark"
	"github.com/yuin/goldmark/ast"
	"github.com/yuin/goldmark/extension"
	"github.com/yuin/goldmark/text"
)

func open(t *testing.T, path string) []byte {
	t.Helper()

	b, err := os.ReadFile(path)

	if err != nil {
		t.Fatal(err)
	}

	return b
}

func parse(t *testing.T, b []byte) ast.Node {
	t.Helper()

	md := goldmark.New(
		goldmark.WithExtensions(extension.NewTable()),
	)

	return md.Parser().Parse(text.NewReader(b))
}

func openString(t *testing.T, path string) string {
	t.Helper()

	return string(open(t, path))
}

func TestRenderer_Render(t *testing.T) {
	type args struct {
		source []byte
		n      ast.Node
	}
	initArgs := func(p string) args {
		b := open(t, p)

		return args{
			source: b,
			n:      parse(t, b),
		}
	}

	tests := []struct {
		name    string
		args    args
		wantW   string
		wantErr bool
	}{
		{
			name:    "Computer Architecture A",
			args:    initArgs("./testfiles/normal/input.md"),
			wantW:   openString(t, "./testfiles/normal/wanted.pukiwiki"),
			wantErr: false,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			r := &Renderer{}
			w := &bytes.Buffer{}
			if err := r.Render(w, tt.args.source, tt.args.n); (err != nil) != tt.wantErr {
				t.Errorf("Renderer.Render() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			gotW := w.String()
			if diff := cmp.Diff(tt.wantW, gotW); diff != "" {
				t.Errorf("Renderer.Render() = %s", diff)
			}
		})
	}
}


text:
package main
import "fmt"
func main(){
	var n int
	fmt.Print("Enter a number: ")
	fmt.Scan(&n)

	if(n % 5 == 0){
		if(n % 11 == 0){
			fmt.Println("The given number is divisible by both 5 and 11")
		} else {
			fmt.Println("The given number is divisible by 5, but not 11")
		}
	} else {
		if(n % 11 == 0){
			fmt.Println("The given number is divisible by 11, but not 5")
		} else {
			fmt.Println("The given number is not divisible by 5 and 11")
		}
	}
}

/** Outputs

$ go run is_divisible_by_5_and_11.go
Enter a number: 55
The given number is divisible by both 5 and 11

$ go run is_divisible_by_5_and_11.go
Enter a number: 22
The given number is divisible by 11, but not 5

$ go run is_divisible_by_5_and_11.go
Enter a number: 25
The given number is divisible by 5, but not 11

$ go run is_divisible_by_5_and_11.go
Enter a number: 13
The given number is not divisible by 5 and 11

*/

repository: srekan/golang-coding-exercises

repo_name: srekan/golang-coding-exercises


text:
@article{10.1093/bioinformatics/bts480,
    author = {Köster, Johannes and Rahmann, Sven},
    title = "{Snakemake—a scalable bioinformatics workflow engine}",
    journal = {Bioinformatics},
    volume = {28},
    number = {19},
    pages = {2520-2522},
    year = {2012},
    month = {08},
    abstract = "{Summary: Snakemake is a workflow engine that provides a readable Python-based workflow definition language and a powerful execution environment that scales from single-core workstations to compute clusters without modifying the workflow. It is the first system to support the use of automatically inferred multiple named wildcards (or variables) in input and output filenames.Availability:http://snakemake.googlecode.com.Contact:johannes.koester@uni-due.de}",
    issn = {1367-4803},
    doi = {10.1093/bioinformatics/bts480},
    url = {https://doi.org/10.1093/bioinformatics/bts480},
    eprint = {https://academic.oup.com/bioinformatics/article-pdf/28/19/2520/819790/bts480.pdf},
}

repository: AntonieV/RADSeq

repo_name: AntonieV/RADSeq

extension: bibtex


text:
#.............................................................
#. snakeoil (c) Alexis Constantin Link
#. Distributed under the MIT license
#.............................................................

#
# determine/option the host and target architecture
#
# the values here can be initialized using a toolchain file

set( SNAKEOIL_ARCH_CONFIGURED FALSE )

set( SNAKEOIL_HOST_ARCH "Unknown" )
set( SNAKEOIL_HOST_ARCH_X86 OFF )
set( SNAKEOIL_HOST_ARCH_BIT_32 OFF )
set( SNAKEOIL_HOST_ARCH_BIT_64 OFF )

set( SNAKEOIL_TARGET_ARCH "Unknown" )
set( SNAKEOIL_TARGET_ARCH_X86 ON ) # default
set( SNAKEOIL_TARGET_ARCH_ARM OFF )
set( SNAKEOIL_TARGET_ARCH_CBEA OFF )
set( SNAKEOIL_TARGET_ARCH_PPC OFF )
set( SNAKEOIL_TARGET_ARCH_MIPS OFF )
set( SNAKEOIL_TARGET_ARCH_BIT_32 OFF )
set( SNAKEOIL_TARGET_ARCH_BIT_64 ON ) #default

set( SNAKEOIL_ARCH_CONFIGURED TRUE )

repository: aconstlink/snakeoil

repo_name: aconstlink/snakeoil


text:
@inproceedings{liu2018,
  title={Direct Ink Writing of Graphene Oxide Reinforced PDMS Matrix Composites for Improved Mechanical Properties},
  author={Liu, Chao and Jiang, Li and Ding, Junjun},
  booktitle={ASME 2018 International Mechanical Engineering Congress and Exposition},
  year={2018},
  organization={American Society of Mechanical Engineers Digital Collection},
  abstract={Recently, PDMS has been widely used because of its outstanding properties, such as its biocompatibility, moldability, and Mechanical Flexibility. However, the low mechanical strength hinders its ability for further applications. The Addition of graphene oxide (GO) into Polydimethylsiloxane (PDMS) matrices as a reinforcement is a reasonably simple way to improve its mechanical properties. Direct ink writing (DIW) is an ideal method for printing viscous materials which provides useful advantages for fabrication, such as higher design freedom, as well as having no requirement for a castable mold, compared to conventional PDMS processing methods. Herein, we demonstrate the DIW 3D printing of GO reinforced PDMS matrix composites. PDMS SE 1700 and Sylgard 184 were mixed in 4:1 and 7:3 ratios as matrix materials with controlled rheological properties. GO, synthesized by modified Hummer?s method, was loaded into PDMS at various weight ratios (0.5%, 1%, 2%, 3% and 4%) to fabricate GO/PDMS composites. The GO dispersed uniformly throughout the PDMS matrix with no visible aggregation during the mixing and printing processes. Tensile tests were performed using 3D printed dog-bone shape GO/PDMS bars to evaluate the enhancement of the GO reinforcement. The results showed that the Young?s modulus of PDMS increased by 58.7% with 1% GO reinforcement.}
}

repository: JunjunDing/jding-academic-kickstart

repo_name: JunjunDing/jding-academic-kickstart