text:
// Copyright 2017 Pilosa Corp.
//
// 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 pilosa

import (
	"bytes"
	"fmt"
	"io"
	"sort"
	"sync"
	"time"

	"github.com/golang/groupcache/lru"
	"github.com/pilosa/pilosa/internal"
)

const (
	// ThresholdFactor is used to calculate the threshold for new items entering the cache
	ThresholdFactor = 1.1
)

// Cache represents a cache of counts.
type Cache interface {
	Add(id uint64, n uint64)
	BulkAdd(id uint64, n uint64)
	Get(id uint64) uint64
	Len() int

	// Returns a list of all IDs.
	IDs() []uint64

	// Updates the cache, if necessary.
	Invalidate()

	// Rebuilds the cache
	Recalculate()

	// Returns an ordered list of the top ranked bitmaps.
	Top() []BitmapPair
}

// LRUCache represents a least recently used Cache implemenation.
type LRUCache struct {
	cache  *lru.Cache
	counts map[uint64]uint64
}

// NewLRUCache returns a new instance of LRUCache.
func NewLRUCache(maxEntries uint32) *LRUCache {
	c := &LRUCache{
		cache:  lru.New(int(maxEntries)),
		counts: make(map[uint64]uint64),
	}
	c.cache.OnEvicted = c.onEvicted
	return c
}

// BulkAdd adds a count to the cache unsorted. You should Invalidate after completion.
func (c *LRUCache) BulkAdd(id, n uint64) {
	c.Add(id, n)
}

// Add adds a count to the cache.
func (c *LRUCache) Add(id, n uint64) {
	c.cache.Add(id, n)
	c.counts[id] = n
}

// Get returns a count for a given id.
func (c *LRUCache) Get(id uint64) uint64 {
	n, _ := c.cache.Get(id)
	nn, _ := n.(uint64)
	return nn
}

// Len returns the number of items in the cache.
func (c *LRUCache) Len() int { return c.cache.Len() }

// Invalidate is a no-op.
func (c *LRUCache) Invalidate() {}

// Recalculate is a no-op.
func (c *LRUCache) Recalculate() {}

// IDs returns a list of all IDs in the cache.
func (c *LRUCache) IDs() []uint64 {
	a := make([]uint64, 0, len(c.counts))
	for id := range c.counts {
		a = append(a, id)
	}
	sort.Sort(uint64Slice(a))
	return a
}

// Top returns all counts in the cache.
func (c *LRUCache) Top() []BitmapPair {
	a := make([]BitmapPair, 0, len(c.counts))
	for id, n := range c.counts {
		a = append(a, BitmapPair{
			ID:    id,
			Count: uint64(n),
		})
	}
	sort.Sort(BitmapPairs(a))
	return a
}

func (c *LRUCache) onEvicted(key lru.Key, _ interface{}) { delete(c.counts, key.(uint64)) }

// Ensure LRUCache implements Cache.
var _ Cache = &LRUCache{}

// RankCache represents a cache with sorted entries.
type RankCache struct {
	mu       sync.Mutex
	entries  map[uint64]uint64
	rankings []BitmapPair // cached, ordered list

	updateN    int
	updateTime time.Time

	// maxEntries is the user defined size of the cache
	maxEntries uint32

	// thresholdBuffer is used the calculate the lowest cached threshold value
	// This threshold determines what new items are added to the cache
	thresholdBuffer int

	// thresholdValue is the value of the last item in the cache
	thresholdValue uint64
}

// NewRankCache returns a new instance of RankCache.
func NewRankCache(maxEntries uint32) *RankCache {
	return &RankCache{
		maxEntries:      maxEntries,
		thresholdBuffer: int(ThresholdFactor * float64(maxEntries)),
		entries:         make(map[uint64]uint64),
	}
}

// Add adds a count to the cache.
func (c *RankCache) Add(id uint64, n uint64) {
	c.mu.Lock()
	defer c.mu.Unlock()
	// Ignore if the bit count is below the threshold.
	if n < c.thresholdValue {
		return
	}

	c.entries[id] = n

	c.invalidate()
}

// BulkAdd adds a count to the cache unsorted. You should Invalidate after completion.
func (c *RankCache) BulkAdd(id uint64, n uint64) {
	c.mu.Lock()
	defer c.mu.Unlock()
	if n < c.thresholdValue {
		return
	}

	c.entries[id] = n
}

// Get returns a count for a given id.
func (c *RankCache) Get(id uint64) uint64 {
	c.mu.Lock()
	defer c.mu.Unlock()
	return c.entries[id]
}

// Len returns the number of items in the cache.
func (c *RankCache) Len() int {
	c.mu.Lock()
	defer c.mu.Unlock()
	return len(c.entries)
}

// IDs returns a list of all IDs in the cache.
func (c *RankCache) IDs() []uint64 {
	c.mu.Lock()
	defer c.mu.Unlock()
	a := make([]uint64, 0, len(c.entries))
	for id := range c.entries {
		a = append(a, id)
	}
	sort.Sort(uint64Slice(a))
	return a
}

// Invalidate recalculates the the entries by rank.
func (c *RankCache) Invalidate() {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.invalidate()
}

// Recalculate rebuilds the cache.
func (c *RankCache) Recalculate() {
	c.mu.Lock()
	defer c.mu.Unlock()
	c.recalculate()
}

func (c *RankCache) invalidate() {
	// Don't invalidate more than once every X seconds.
	// TODO: consider making this configurable.
	if time.Now().Sub(c.updateTime).Seconds() < 10 {
		return
	}
	c.recalculate()
}

func (c *RankCache) recalculate() {
	// Convert cache to a sorted list.
	rankings := make([]BitmapPair, 0, len(c.entries))
	for id, cnt := range c.entries {
		rankings = append(rankings, BitmapPair{
			ID:    id,
			Count: cnt,
		})
	}
	sort.Sort(BitmapPairs(rankings))

	// Store the count of the item at the threshold index.
	c.rankings = rankings
	if len(c.rankings) > int(c.maxEntries) {
		c.thresholdValue = rankings[c.maxEntries].Count
		c.rankings = c.rankings[0:c.maxEntries]
	} else {
		c.thresholdValue = 1
	}

	// Reset counters.
	c.updateTime, c.updateN = time.Now(), 0

	// If size is larger than the threshold then trim it.
	if len(c.entries) > c.thresholdBuffer {
		for id, cnt := range c.entries {
			if cnt <= c.thresholdValue {
				delete(c.entries, id)
			}
		}
	}
}

// Top returns an ordered list of pairs.
func (c *RankCache) Top() []BitmapPair { return c.rankings }

// WriteTo writes the cache to w.
func (c *RankCache) WriteTo(w io.Writer) (n int64, err error) {
	panic("FIXME: TODO")
}

// ReadFrom read from r into the cache.
func (c *RankCache) ReadFrom(r io.Reader) (n int64, err error) {
	panic("FIXME: TODO")
}

// Ensure RankCache implements Cache.
var _ Cache = &RankCache{}

// BitmapPair represents a id/count pair with an associated identifier.
type BitmapPair struct {
	ID    uint64
	Count uint64
}

// BitmapPairs is a sortable list of BitmapPair objects.
type BitmapPairs []BitmapPair

func (p BitmapPairs) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p BitmapPairs) Len() int           { return len(p) }
func (p BitmapPairs) Less(i, j int) bool { return p[i].Count > p[j].Count }

// Pair holds an id/count pair.
type Pair struct {
	ID    uint64 `json:"id"`
	Count uint64 `json:"count"`
}

func encodePair(p Pair) *internal.Pair {
	return &internal.Pair{
		Key:   p.ID,
		Count: p.Count,
	}
}

func decodePair(pb *internal.Pair) Pair {
	return Pair{
		ID:    pb.Key,
		Count: pb.Count,
	}
}

// Pairs is a sortable slice of Pair objects.
type Pairs []Pair

func (p Pairs) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p Pairs) Len() int           { return len(p) }
func (p Pairs) Less(i, j int) bool { return p[i].Count > p[j].Count }

// PairHeap is a heap implementation over a group of Pairs.
type PairHeap struct {
	Pairs
}

// Less implemets the Sort interface.
// reports whether the element with index i should sort before the element with index j.
func (p PairHeap) Less(i, j int) bool { return p.Pairs[i].Count < p.Pairs[j].Count }

// Push appends the element onto the Pair slice.
func (p *Pairs) Push(x interface{}) {
	// Push and Pop use pointer receivers because they modify the slice's length,
	// not just its contents.
	*p = append(*p, x.(Pair))
}

// Pop removes the minimum element from the Pair slice.
func (p *Pairs) Pop() interface{} {
	old := *p
	n := len(old)
	x := old[n-1]
	*p = old[0 : n-1]
	return x
}

// Add merges other into p and returns a new slice.
func (p Pairs) Add(other []Pair) []Pair {
	// Create lookup of key/counts.
	m := make(map[uint64]uint64, len(p))
	for _, pair := range p {
		m[pair.ID] = pair.Count
	}

	// Add/merge from other.
	for _, pair := range other {
		m[pair.ID] += pair.Count
	}

	// Convert back to slice.
	a := make([]Pair, 0, len(m))
	for k, v := range m {
		a = append(a, Pair{ID: k, Count: v})
	}
	return a
}

// Keys returns a slice of all keys in p.
func (p Pairs) Keys() []uint64 {
	a := make([]uint64, len(p))
	for i := range p {
		a[i] = p[i].ID
	}
	return a
}

func (p Pairs) String() string {
	var buf bytes.Buffer
	buf.WriteString("Pairs(")
	for i := range p {
		fmt.Fprintf(&buf, "%d/%d", p[i].ID, p[i].Count)
		if i < len(p)-1 {
			buf.WriteString(", ")
		}
	}
	buf.WriteString(")")
	return buf.String()
}

func encodePairs(a Pairs) []*internal.Pair {
	other := make([]*internal.Pair, len(a))
	for i := range a {
		other[i] = encodePair(a[i])
	}
	return other
}

func decodePairs(a []*internal.Pair) []Pair {
	other := make([]Pair, len(a))
	for i := range a {
		other[i] = decodePair(a[i])
	}
	return other
}

// uint64Slice represents a sortable slice of uint64 numbers.
type uint64Slice []uint64

func (p uint64Slice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }
func (p uint64Slice) Len() int           { return len(p) }
func (p uint64Slice) Less(i, j int) bool { return p[i] < p[j] }

// merge combines p and other to a unique sorted set of values.
// p and other must both have unique sets and be sorted.
func (p uint64Slice) merge(other []uint64) []uint64 {
	ret := make([]uint64, 0, len(p))

	i, j := 0, 0
	for i < len(p) && j < len(other) {
		a, b := p[i], other[j]
		if a == b {
			ret = append(ret, a)
			i, j = i+1, j+1
		} else if a < b {
			ret = append(ret, a)
			i++
		} else {
			ret = append(ret, b)
			j++
		}
	}

	if i < len(p) {
		ret = append(ret, p[i:]...)
	} else if j < len(other) {
		ret = append(ret, other[j:]...)
	}

	return ret
}

// BitmapCache provides an interface for caching full bitmaps.
type BitmapCache interface {
	Fetch(id uint64) (*Bitmap, bool)
	Add(id uint64, b *Bitmap)
}

// SimpleCache implements BitmapCache
// it is meant to be a short-lived cache for cases where writes are continuing to access
// the same bit within a short time frame (i.e. good for write-heavy loads)
// A read-heavy use case would cause the cache to get bigger, potentially causing the
// node to run out of memory.
type SimpleCache struct {
	cache map[uint64]*Bitmap
}

// Fetch retrieves the bitmap at the id in the cache.
func (s *SimpleCache) Fetch(id uint64) (*Bitmap, bool) {
	m, ok := s.cache[id]
	return m, ok
}

// Add adds the bitmap to the cache, keyed on the id.
func (s *SimpleCache) Add(id uint64, b *Bitmap) {
	s.cache[id] = b
}

repository: benbjohnson/pilosa

repo_name: benbjohnson/pilosa

gha_language: Go

extension: go


text:
package main

import "fmt"

func main() {
	var a, b, res, i uint32
	fmt.Scan(&a)

	for i = 0; i < a; i++ {
		fmt.Scan(&b)
		res += b
	}
	fmt.Printf("%v", res)
}

license: MIT

repository: jmmrcp/HackerRank

license_type: permissive

repo_name: jmmrcp/HackerRank

branch_name: refs/heads/master


text:
// Copyright 2023 PingCAP, Inc.
//
// 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 checkpoint

import "time"

type TimeTicker interface {
	Ch() <-chan time.Time
	Stop()
}

type timeTicker struct {
	*time.Ticker
}

func (ticker timeTicker) Ch() <-chan time.Time {
	return ticker.C
}

type manualTicker struct{}

func (ticker manualTicker) Ch() <-chan time.Time {
	return nil
}

func (ticker manualTicker) Stop() {}

func dispatcherTicker(d time.Duration) TimeTicker {
	if d > 0 {
		return timeTicker{time.NewTicker(d)}
	}
	return manualTicker{}
}

repository: pingcap/tidb

repo_name: pingcap/tidb


text:
require linux-rp.inc

PR = "r23"

DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_collie = "1"
DEFAULT_PREFERENCE_qemux86 = "1"
DEFAULT_PREFERENCE_tosa = "1"
DEFAULT_PREFERENCE_poodle = "1"
DEFAULT_PREFERENCE_c7x0 = "1"
DEFAULT_PREFERENCE_akita = "1"
DEFAULT_PREFERENCE_spitz = "1"

# Handy URLs
# git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git;protocol=git;tag=ef7d1b244fa6c94fb76d5f787b8629df64ea4046
# ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.18.tar.bz2
# ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/testing/linux-2.6.20-rc4.tar.bz2
# ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/testing/patch-2.6.18-rc6.bz2;patch=1
# ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/snapshots/patch-2.6.18-rc2-git1.bz2;patch=1
# ${KERNELORG_MIRROR}/pub/linux/kernel/people/alan/linux-2.6/2.6.10/patch-2.6.10-ac8.gz;patch=1
# ${KERNELORG_MIRROR}/pub/linux/kernel/people/akpm/patches/2.6/2.6.14-rc2/2.6.14-rc2-mm1/2.6.14-rc2-mm1.bz2;patch=1

# Patches submitted upstream are towards top of this list
# Hacks should clearly named and at the bottom
SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.24.tar.bz2 \
	   file://0001-time-prevent-the-loop-in-timespec_add_ns-from-bei.patch;patch=1 \
           ${RPSRC}/export_atags-r2.patch;patch=1;status=pending \
           ${RPSRC}/lzo_crypto-r2.patch;patch=1;status=pending \
           ${RPSRC}/corgi_rearrange_lcd-r0.patch;patch=1;status=pending \
	   file://hrw-hostapcard.patch;patch=1;status=pending \
           ${RPSRC}/allow_disable_deferrred-r0.patch;patch=1 \
           ${RPSRC}/lzo_jffs2_sysfs-r1.patch;patch=1 \
           ${RPSRC}/hx2750_base-r33.patch;patch=1 \
           ${RPSRC}/hx2750_bl-r9.patch;patch=1 \
           ${RPSRC}/hx2750_pcmcia-r3.patch;patch=1 \
           ${RPSRC}/pxa_keys-r8.patch;patch=1 \
           ${RPSRC}/tsc2101-r18.patch;patch=1 \
           ${RPSRC}/hx2750_test1-r8.patch;patch=1 \
           ${RPSRC}/input_power-r10.patch;patch=1 \
           ${RPSRC}/pxa25x_cpufreq-r2.patch;patch=1 \
           ${RPSRC}/sharpsl_pm_fixes1-r0.patch;patch=1 \
           ${RPSRC}/pm_changes-r1.patch;patch=1 \
           ${RPSRC}/usb_add_epalloc-r4.patch;patch=1 \
           ${RPSRC}/usb_pxa27x_udc-r8.patch;patch=1 \
           ${RPSRC}/locomo_kbd_tweak-r1a.patch;patch=1 \
           ${RPSRC}/pxa27x_overlay-r8.patch;patch=1 \
           ${RPSRC}/w100_extaccel-r2.patch;patch=1 \
           ${RPSRC}/w100_extmem-r1.patch;patch=1 \
           ${RPSRC}/poodle_pm-r5.patch;patch=1 \
           ${RPSRC}/poodle_lcd_hack-r0.patch;patch=1 \
           ${RPSRC}/poodle_asoc_fix-r1.patch;patch=1 \
           file://pxa27x-resume.patch;patch=1;status=external \
           file://mtd-module.patch;patch=1;status=external \
           file://wm8750-treble.patch;patch=1;status=external \
           file://spitz_h_rewrite.patch;patch=1;status=external \
           file://pxa2xx_udc-clock.patch;patch=1 \
           file://sharpsl-rc-r1.patch;patch=1 \
           file://sharpsl-rc-r2.patch;patch=1 \
           file://squashfs3.3.patch;patch=1;status=external \
#           ${RPSRC}/logo_oh-r1.patch.bz2;patch=1;status=unmergable \
           ${RPSRC}/pxa-linking-bug.patch;patch=1;status=unmergable \
           file://hostap-monitor-mode.patch;patch=1;status=unmergable \
           file://serial-add-support-for-non-standard-xtals-to-16c950-driver.patch;patch=1;status=unmergable \
           ${RPSRC}/mmcsd_large_cards-r1.patch;patch=1;status=hack \
           ${RPSRC}/mmcsd_no_scr_check-r2.patch;patch=1;status=hack \
           ${RPSRC}/integrator_rgb-r1.patch;patch=1;status=hack \
           ${RPSRC}/pxa_cf_initorder_hack-r1.patch;patch=1;status=hack \
           file://pxa-serial-hack.patch;patch=1;status=hack \
           file://connectplus-remove-ide-HACK.patch;patch=1;status=hack \
           file://connectplus-prevent-oops-HACK.patch;patch=1;status=hack \
           file://binutils-buildid-arm.patch;patch=1 \
           file://versatile-armv6.patch;patch=1 \
	   file://htcuni.patch;patch=1 \
           file://defconfig-c7x0 \
           file://defconfig-hx2000 \
           file://defconfig-collie \
           file://defconfig-poodle \
           file://defconfig-akita \
           file://defconfig-spitz \
           file://defconfig-qemuarm \
           file://defconfig-qemux86 \
           file://defconfig-bootcdx86 \
           file://defconfig-htcuniversal \
           file://defconfig-tosa \
           file://defconfig-zylonite"

# FIXMEs before made default
# ${RPSRC}/mmcsd_no_scr_check-r1.patch;patch=1;status=hack

# Add this to enable pm debug code (useful with a serial lead)
#  ${RPSRC}/sharpsl_pm_debug-r0.patch;patch=1

# Disabled until I find the reason this gives issues with cdc_subset
#            ${RPSRC}/usb_rndis_tweaks-r0.patch;patch=1 \

SRC_URI_append_collie = "\
	${TKSRC}/mtd-sharp-flash-hack-r4.patch;patch=1 \
	${TKSRC}/mcp-sa11x0-r0.patch;patch=1 \
	${TKSRC}/locomo-r1.patch;patch=1 \
	${TKSRC}/collie-kexec-r1.patch;patch=1 \
	${TKSRC}/sharpsl_pm-4.patch;patch=1 \
	${TKSRC}/collie_pm-3.patch;patch=1 \
	${TKSRC}/ucb1x00_suspend.patch;patch=1 \
	${TKSRC}/collie-ts.patch;patch=1 \
	${TKSRC}/pcmcia_suspend.patch;patch=1 \
	${TKSRC}/locomo_spi-6.patch;patch=1 \
	${TKSRC}/config.patch;patch=1 \
	${TKSRC}/mmc-spi.patch;patch=1 \
	${TKSRC}/linux-2.6.24-SIMpad-rtc-sa1100.patch;patch=1 \
	${TKSRC}/sa1100_spinlock.patch;patch=1 \
	${TKSRC}/sa1100-dma.patch;patch=1 \
"

SRC_URI_append_poodle = "\
           ${RPSRC}/poodle_serial_vcc-r0.patch;patch=1 \
           file://poodle_ts.patch;patch=1 \
           file://pxafb.patch;patch=1 \
"

SRC_URI_append_tosa = "\
           file://tosa/0001-Allow-runtime-registration-of-regions-of-memory-that.patch;patch=1 \
           file://tosa/0002-Modify-dma_alloc_coherent-on-ARM-so-that-it-supports.patch;patch=1 \
           file://tosa/0003-Core-MFD-support.patch;patch=1 \
           file://tosa/0004-Add-support-for-tc6393xb-MFD-core.patch;patch=1 \
           file://tosa/0005-Add-support-for-tc6387xb-MFD-core.patch;patch=1 \
           file://tosa/0006-Add-support-for-t7l66xb-MFD-core.patch;patch=1 \
           file://tosa/0007-Common-headers-for-TMIO-MFD-subdevices.patch;patch=1 \
           file://tosa/0008-Nand-driver-for-TMIO-devices.patch;patch=1 \
           file://tosa/0009-FB-driver-for-TMIO-devices.patch;patch=1 \
           file://tosa/0010-OHCI-driver-for-TMIO-devices.patch;patch=1 \
           file://tosa/0011-MMC-driver-for-TMIO-devices.patch;patch=1 \
           file://tosa/0012-Tosa-keyboard-support.patch;patch=1 \
           file://tosa/0013-USB-gadget-pxa2xx_udc-supports-inverted-vbus.patch;patch=1 \
           file://tosa/0014-tosa_udc_use_gpio_vbus.patch.patch;patch=1 \
           file://tosa/0015-sharpsl-export-params.patch;patch=1 \
           file://tosa/0016-This-patch-fixes-the-pxa25x-clocks-definitions-to-ad.patch;patch=1 \
           file://tosa/0026-I-don-t-think-we-should-check-for-IRQs-when-determin.patch;patch=1 \
           file://tosa/0027-Add-LiMn-one-of-the-most-common-for-small-non-recha.patch;patch=1 \
           file://tosa/0028-Add-suspend-resume-wakeup-support-for-pda_power.patch;patch=1 \
           file://tosa/0029-Support-using-VOLTAGE_-properties-for-apm-calculati.patch;patch=1 \
           file://tosa/0030-Core-driver-for-WM97xx-touchscreens.patch;patch=1 \
           file://tosa/0031-Add-chip-driver-for-WM9705-touchscreen.patch;patch=1 \
           file://tosa/0032-Add-chip-driver-for-WM9712-touchscreen.patch;patch=1 \
           file://tosa/0033-Add-chip-driver-for-WM9713-touchscreen.patch;patch=1 \
           file://tosa/0034-Driver-for-WM97xx-touchscreens-in-streaming-mode-on.patch;patch=1 \
           file://tosa/0035-Build-system-and-MAINTAINERS-entry-for-WM97xx-touchs.patch;patch=1 \
           file://tosa/0036-Set-id-to-1-for-wm97xx-subdevices.patch;patch=1 \
           file://tosa/0037-Don-t-lock-the-codec-list-in-snd_soc_dapm_new_widget.patch;patch=1 \
           file://tosa/0038-Don-t-lock-the-codec-list-in-snd_soc_dapm_new_widget.patch;patch=1 \
           file://tosa/0044-fix-tmio_mmc-debug-compilation.patch;patch=1 \
           file://tosa/0045-Update-tmio_ohci.patch;patch=1 \
           file://tosa/0046-patch-tc6393xb-cleanup.patch;patch=1 \
           file://tosa/0047-tc6393xb-use-bitmasks-instead-of-bit-field-structs.patch;patch=1 \
           file://tosa/0048-tc6393xb-GPIO-support.patch;patch=1 \
           file://tosa/0049-platform-support-for-TMIO-on-tosa.patch;patch=1 \
           file://tosa/0050-tosa-update-for-tc6393xb-gpio.patch;patch=1 \
           file://tosa/0051-fix-sound-soc-pxa-tosa.c-to-new-gpio-api.patch;patch=1 \
           file://tosa/0052-tosa-platform-backlight-support.patch;patch=1 \
           file://tosa/0053-sound-soc-codecs-wm9712.c-28.patch;patch=1 \
           file://tosa/0054-sound-soc-codecs-wm9712.c-2.patch;patch=1 \
           file://tosa/0055-Add-GPIO_POWERON-to-the-list-of-devices-that-we-supp.patch;patch=1 \
           file://tosa/0058-Fix-tosakbd-suspend.patch;patch=1 \
           file://tosa/0059-patch-tosa-wakeup-test.patch;patch=1 \
           file://tosa/0060-Add-support-for-power_supply-on-tosa.patch;patch=1 \
           file://tosa/0061-tosa-bat-unify.patch;patch=1 \
           file://tosa/0062-tosa-bat-fix-charging.patch;patch=1 \
           file://tosa/0063-patch-tosa-bat-jacket-detect.patch;patch=1 \
           file://tosa/0064-Export-modes-via-sysfs.patch;patch=1 \
           file://tosa/0065-wm97xx-core-fixes.patch;patch=1 \
           file://tosa/0066-tmiofb_probe-should-be-__devinit.patch;patch=1 \
           file://tosa/0067-modeswitching.patch;patch=1 \
           file://tosa/0068-Preliminary-tosa-denoiser.patch;patch=1 \
           file://tosa/0019-pxa-remove-periodic-mode-emulation-support.patch;patch=1 \
           file://tosa/0020-Provide-dew-device-clock-backports-from-2.6.24-git.patch;patch=1 \
           file://tosa/0021-Add-an-empty-drivers-gpio-directory-for-gpiolib-infr.patch;patch=1 \
           file://tosa/0022-Provide-new-implementation-infrastructure-that-platf.patch;patch=1 \
           file://tosa/0023-This-adds-gpiolib-support-for-the-PXA-architecture.patch;patch=1 \
           file://tosa/0024-Update-Documentation-gpio.txt-primarily-to-include.patch;patch=1 \
           file://tosa/0025-Signed-off-by-Dmitry-Baryshkov-dbaryshkov-gmail.co.patch;patch=1 \
           file://tosa/0039-Add-generic-framework-for-managing-clocks.patch;patch=1 \
           file://tosa/0040-Clocklib-debugfs-support.patch;patch=1 \
           file://tosa/0041-From-80a359e60c2aec59ccf4fca0a7fd20495f82b1d2-Mon-Se.patch;patch=1 \
           file://tosa/0042-Use-correct-clock-for-IrDA-on-pxa.patch;patch=1 \
           file://tosa/0043-Use-clocklib-for-sa1100-sub-arch.patch;patch=1 \
           file://tosa/0056-Support-resetting-by-asserting-GPIO-pin.patch;patch=1 \
           file://tosa/0057-Clean-up-tosa-resetting.patch;patch=1 \
           file://tosa/0001-pxa2xx-ac97-switch-AC-unit-to-correct-state-before.patch;patch=1 \
	   file://tosa/tosa-bl-fixup.diff;patch=1 \
           "
#           file://tosa/0017-Convert-pxa2xx-UDC-to-use-debugfs.patch;patch=1 \
#           file://tosa/0018-Fix-the-pxa2xx_udc-to-balance-calls-to-clk_enable-cl.patch;patch=1 \

SRC_URI_append_htcuniversal ="\
	file://htcuni-acx.patch;patch=1;status=external \
	"

SRC_URI_append_zylonite ="\
	file://pxa_fb_overlay.patch;patch=1 \
	file://zylonite-boot.patch;patch=1 \
	"

S = "${WORKDIR}/linux-2.6.24"

extension: bb


text:
@Article{escande:ras:2013,
  author    = {Escande, Adrien and Kheddar, Abderrahmane and Miossec, Sylvain},
  title     = {Planning contact points for humanoid robots},
  journal   = {Robotics and Autonomous Systems},
  year      = {2013},
  volume    = {61},
  number    = {5},
  pages     = {428--442},
  month     = {October},
  doi       = {https://doi.org/10.1016/j.robot.2013.01.008},
  url       = {https://hal-lirmm.ccsd.cnrs.fr/file/index/docid/800829/filename/2013\_ras\_escande-planning\_contact\_points\_for\_humanoid\_robots.pdf},
  keywords  = {Multi-contact planning, Humanoid robot, Posture optimization},
  abstract  = {We present a planner for underactuated hyper-redundant robots, such as humanoid robots, for which the movement can only be initiated by taking contacts with the environment. We synthesize our previous work on the subject and go further into details to give an in-depth description of the contact planning problem and the mechanisms of our contact planner. We highlight the structure of the problem with a simple example, present the contact space and the heuristics we use for planning, and explain thoroughly the implementation of the different parts of the planner. Finally we give examples of planning results for complex scenarios with the humanoid robot HRP-2.},
  publisher = {Elsevier Science BV},
  address   = {Po Box 211, 1000 AE Amsterdam, Netherlands}
}

gha_language: TeX

extension: bib


text:
@article{changoor2006mapping,
 author = {Changoor, A and Hurtig, MB and Runciman, RJ and Quesnel, AJ and Dickey, JP and Lowerison, M},
 journal = {Equine veterinary journal},
 number = {4},
 pages = {330--336},
 publisher = {Wiley Online Library},
 title = {Mapping of donor and recipient site properties for osteochondral graft reconstruction of subchondral cystic lesions in the equine stifle joint},
 volume = {38},
 year = {2006}
}


text:
package fcrmessages

import (
	"testing"

	"github.com/ConsenSys/fc-retrieval/common/pkg/cid"
	"github.com/stretchr/testify/assert"
)

// TestEncodeProviderAdminPublishGroupOfferRequest success test
func TestEncodeProviderAdminPublishGroupOfferRequest(t *testing.T) {
	contentID, _ := cid.NewContentIDFromBytes([]byte{1})
	mockCids := []cid.ContentID{*contentID}
	var mockPrice uint64 = 41
	var mockExpiry int64 = 42
	var mockQos uint64 = 43

	validMsg := &FCRMessage{
		messageType:       502,
		protocolVersion:   1,
		protocolSupported: []int32{1, 1},
		messageBody:       []byte(`{"cids":["0000000000000000000000000000000000000000000000000000000000000001"],"price":41,"expiry":42,"qos":43}`),
		signature:         "",
	}

	msg, err := EncodeProviderAdminPublishGroupOfferRequest(mockCids, mockPrice, mockExpiry, mockQos)
	assert.Empty(t, err)
	assert.Equal(t, msg, validMsg)
}

// TestDecodeProviderAdminPublishGroupOfferRequest success test
func TestDecodeProviderAdminPublishGroupOfferRequest(t *testing.T) {
	contentID, _ := cid.NewContentIDFromBytes([]byte{1})
	mockCids := []cid.ContentID{*contentID}
	validMsg := &FCRMessage{
		messageType:       502,
		protocolVersion:   1,
		protocolSupported: []int32{1, 1},
		messageBody:       []byte(`{"cids":["0000000000000000000000000000000000000000000000000000000000000001"],"price":41,"expiry":42,"qos":43}`),
		signature:         "",
	}
	cids, price, expiry, qos, err := DecodeProviderAdminPublishGroupOfferRequest(validMsg)
	assert.Empty(t, err)
	assert.Equal(t, cids, mockCids)
	assert.Equal(t, price, uint64(41))
	assert.Equal(t, expiry, int64(42))
	assert.Equal(t, qos, uint64(43))
}

repository: zenyuk/fc-retrieval

repo_name: zenyuk/fc-retrieval

branch_name: refs/heads/main


text:
.btn-sub {
    padding: 0px;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    background-color: #95e1d3;
    width: 151px;
    height: 40px;
    text-transform: uppercase;
}

license: Unlicense

extension: css


text:
// Copyright 2022 The Cloud Robotics 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 v1

import (
	"bytes"
	"encoding/json"
	"encoding/pem"
	"fmt"
	"io"
	"net/http"
	"net/url"
	"path"
	"regexp"
	"strings"

	log "github.com/sirupsen/logrus"

	"github.com/googlecloudrobotics/core/src/go/cmd/token-vendor/api"
	"github.com/googlecloudrobotics/core/src/go/cmd/token-vendor/app"
	"github.com/googlecloudrobotics/core/src/go/cmd/token-vendor/oauth"
)

const (
	paramDeviceID = "device-id"
	contentType   = "content-type"
	pemFile       = "application/x-pem-file"
)

type HandlerContext struct {
	tv *app.TokenVendor
}

func NewHandlerContext(tv *app.TokenVendor) *HandlerContext {
	return &HandlerContext{tv}
}

// getQueryParam extracts a query parameter from the request URL.
//
// Multiple parameters with the same key are considered undefined and will result in error
func getQueryParam(u *url.URL, param string) (string, error) {
	values, ok := u.Query()[param]
	if !ok || len(values) != 1 {
		err := fmt.Errorf("missing or multiple query parameter %s", param)
		return "", err
	}
	return values[0], nil
}

// Handle requests to read a device's public key by device identifier.
//
// Method: GET
// URL parameter: device-id, the string identifier of the device
//
// Response code: 200 (even if key not found)
// Response body: A single public key or "" if no key was found.
func (h *HandlerContext) publicKeyReadHandler(w http.ResponseWriter, r *http.Request) {
	// validate request and parameters
	if r.Method != http.MethodGet {
		api.ErrResponse(w, http.StatusBadRequest,
			fmt.Sprintf("method %s not allowed, only %s", r.Method, http.MethodGet))
		return
	}
	deviceID, err := getQueryParam(r.URL, paramDeviceID)
	if err != nil {
		api.ErrResponse(w, http.StatusBadRequest, err.Error())
		return
	}
	if !app.IsValidDeviceID(deviceID) {
		api.ErrResponse(w, http.StatusBadRequest, "invalid device id")
		return
	}
	// retrieve public key from key repository
	publicKey, err := h.tv.ReadPublicKey(r.Context(), deviceID)
	if err != nil {
		api.ErrResponse(w, http.StatusInternalServerError, "request to repository failed")
		log.Error(err)
		return
	}
	// for missing public keys (publicKey == "") we return 200 with
	// empty body for conformance with the original token vendor API.
	w.Header().Add(contentType, pemFile)
	w.Write([]byte(publicKey))
}

// Handle requests to publish the public key of a given device identifier.
//
// Method: POST
// URL parameter: device-id, the identifier of the device
// Request body: a single public key to publish
// Response code: 200 if publish succeeded
func (h *HandlerContext) publicKeyPublishHandler(w http.ResponseWriter, r *http.Request) {
	// validate request and parameters
	if r.Method != http.MethodPost {
		api.ErrResponse(w, http.StatusBadRequest,
			fmt.Sprintf("method %s not allowed, only %s", r.Method, http.MethodPost))
		return
	}
	deviceID, err := getQueryParam(r.URL, paramDeviceID)
	if err != nil {
		api.ErrResponse(w, http.StatusBadRequest, err.Error())
		return
	}
	if !app.IsValidDeviceID(deviceID) {
		api.ErrResponse(w, http.StatusBadRequest, "invalid device id")
		return
	}
	body, err := io.ReadAll(r.Body)
	if err != nil {
		api.ErrResponse(w, http.StatusInternalServerError, "failed to read request body")
		return
	}
	_, err = isValidPublicKey(body)
	if err != nil {
		api.ErrResponse(w, http.StatusBadRequest, fmt.Sprintf("public key format error %v", err))
		return
	}
	// publish the key
	err = h.tv.PublishPublicKey(r.Context(), deviceID, string(body))
	if err != nil {
		api.ErrResponse(w, http.StatusInternalServerError, "publish key failed")
		log.Error(err)
		return
	}
}

// isValidPublicKeyFormat validates the given public key in PEM format.
//
// The returned error provides details on why the validation failed.
func isValidPublicKey(pk []byte) (bool, error) {
	const minSize, maxSize = 100, 18000 // educated guesses, technically unlimited
	if len(pk) < minSize || len(pk) > maxSize {
		return false, fmt.Errorf("invalid key size, assert %d <= %d <= %d", minSize, len(pk), maxSize)
	}
	pk = bytes.TrimSpace(pk)
	var pkStart = []byte("-----BEGIN ")
	if !bytes.HasPrefix(pk, pkStart) {
		return false, fmt.Errorf("public key suffix %q missing", pk)
	}
	block, extraData := pem.Decode(pk)
	if len(extraData) > 0 {
		return false, fmt.Errorf("public key contains extra data (%d Bytes)", len(extraData))
	}
	if block == nil || block.Type != "PUBLIC KEY" {
		return false, fmt.Errorf("failed to decode PEM block expecting public key")
	}
	return true, nil
}

// Handle requests to retrieve a GCP access token for access to cloud resources.
//
// The robot identifies itself using its private key to sign a JWT. The JWT is
// verified by the token vendor using the public key from the key repository and
// the device identifier from the `iss` key from the JWT's payload section.
// After successful verification, the token vendor uses its own IAM identity to
// generate an access token for the `robot-service` service account and returns
// the access token to the robot. We only accept RSA as signing algorithm right
// now. This is the default used by the metadata server's oauth package [1].
//
// [1] https://github.com/golang/oauth2/blob/f21342109be17cd214ecfcd33065b79cd571673e/jwt/jwt.go#L29
//
// Method: POST
// The body is formatted like an URL query with two parameters:
//   - grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
//   - assertion=<jwt signed by robots private key>
//
// Signed JWT expected header:
// “`json
// {
//
//	"alg": "RS256",
//	"typ": "JWT"
//
// }
// “`
// The JWT body is expected to look like this:
// “`json
// {
//
//	"aud": "<accepted audience>" or "<accepted audience>?token_type=access_token", // has to match the one specified in the token vendor config
//	"iss": "<device identifier>",
//	"exp": <expiration timestamp>,
//	"scopes": "...",  // unused
//	"claims": "..." // unused
//
// }
// The response body will look like this:
// "`json
// {
//
//	"access_token":"foo", // the cloud access token
//	"expires_in":3600, // the cloud access token expiration in seconds from now
//	"scope":"http://example1.com http://example2.com", // GCP API scope URLs from token vendor config
//	"token_type":"Bearer" // static
//
// }
// “`
func (h *HandlerContext) tokenOAuth2Handler(w http.ResponseWriter, r *http.Request) {
	if r.Method != http.MethodPost {
		api.ErrResponse(w, http.StatusBadRequest,
			fmt.Sprintf("method %s not allowed, only %s", r.Method, http.MethodPost))
		return
	}
	body, err := io.ReadAll(r.Body)
	if err != nil {
		api.ErrResponse(w, http.StatusInternalServerError, "error reading request body")
		log.Error(err)
		return
	}
	values, err := url.ParseQuery(string(body))
	if err != nil {
		api.ErrResponse(w, http.StatusBadRequest, err.Error())
		return
	}
	const paramGrant = "grant_type"
	const jwtGrant = "urn:ietf:params:oauth:grant-type:jwt-bearer"
	grant := values.Get(paramGrant)
	if grant != jwtGrant {
		api.ErrResponse(w, http.StatusBadRequest,
			fmt.Sprintf(`expected "%s=%s" in body`, paramGrant, jwtGrant))
		return
	}
	const paramAssert = "assertion"
	assertion := values.Get(paramAssert)
	if _, err := isValidJWT(assertion); err != nil {
		api.ErrResponse(w, http.StatusBadRequest,
			fmt.Sprintf(`expected "%s=<jwt>" in body, invalid token format: %v`, paramAssert, err))
		return
	}
	token, err := h.tv.GetOAuth2Token(r.Context(), assertion)
	if err != nil {
		api.ErrResponse(w, http.StatusForbidden, "unable to retrieve cloud access token with given JWT")
		log.Error(err)
		return
	}
	tokenBytes, err := json.Marshal(token)
	if err != nil {
		api.ErrResponse(w, http.StatusInternalServerError, "failed to marshal upstream response")
		log.Error(err)
		return
	}
	w.Header().Add(contentType, "application/json")
	w.Write(tokenBytes)
}

// Handle requests to verify if a given token has cloud access.
//
// The token is verified by testing if the token has `iam.serviceAccounts.actAs`
// authorization on either the `humanacl` or `robot-service` account by
// calling the GCP testIamPermissions API. This permission can be granted through e.g. the
// Service Account User (roles/iam.serviceAccountUser) role.
//
// Method: GET
// URL Parameters:
// - robots (optional): "true" to verify against `robot-service` role, else `humanacl`
// - token (optional): access token, if not given via header
// Headers (optional): X_FORWARDED_ACCESS_TOKEN or AUTHORIZATION
// See function `tokenFromRequest` for details on how to supply the token.
func (h *HandlerContext) verifyTokenHandler(w http.ResponseWriter, r *http.Request) {
	if r.Method != http.MethodGet {
		api.ErrResponse(w, http.StatusBadRequest,
			fmt.Sprintf("method %s not allowed, only %s", r.Method, http.MethodGet))
		return
	}
	robots := testForRobotACL(r.URL)
	token, err := tokenFromRequest(r.URL, &r.Header)
	if err != nil {
		api.ErrResponse(w, http.StatusBadRequest, err.Error())
		return
	}
	err = h.tv.VerifyToken(r.Context(), oauth.Token(token), robots)
	if err != nil {
		api.ErrResponse(w, http.StatusForbidden, "unable to verify token")
		log.Error(err)
		return
	}
	w.Write([]byte("OK"))
}

// testForRobotACL determines if the "robots" parameter is set.
func testForRobotACL(u *url.URL) bool {
	robots, err := getQueryParam(u, "robots")
	if err != nil || robots != "true" {
		return false
	}
	return true
}

// tokenFromRequest extracts the access token from the request.
//
// The access token can be supplied in one of the following ways, checked in the
// give order. This is based on the specification of the original java token vendor.
// 1. Header `X-Forwarded-Access-Token`: Token without prefix
// 2. Header `Authorization`: Token with "Bearer " prefix
// 3. URL Parameter `token`
func tokenFromRequest(u *url.URL, h *http.Header) (string, error) {
	const fwdToken = "X-Forwarded-Access-Token"
	if t := h.Get(fwdToken); t != "" {
		if _, err := isValidToken(t); err != nil {
			return "", err
		}
		return t, nil
	}
	const authHeader, authPrefix = "Authorization", "Bearer "
	if t := h.Get(authHeader); t != "" {
		if !strings.HasPrefix(t, authPrefix) {
			return "", fmt.Errorf("token in header %q has no prefix %q",
				authHeader, authPrefix)
		}
		t = strings.TrimPrefix(t, authPrefix)
		if _, err := isValidToken(t); err != nil {
			return "", err
		}
		return t, nil
	}
	const paramToken = "token"
	t, err := getQueryParam(u, paramToken)
	if err != nil {
		return "", fmt.Errorf("no token in headers %q or %q and unable to get token from URL param %q: %v",
			fwdToken, authHeader, paramToken, err)
	}
	_, err = isValidToken(t)
	if err != nil {
		return "", err
	}
	return t, nil
}

const tokenRegex = `^ya29\.[a-zA-Z0-9\.\-_]+$`

var tokenMatch = regexp.MustCompile(tokenRegex).MatchString

// isValidToken verifies the format of the token string.
//
// The returned error provides details on why the validation failed.
func isValidToken(token string) (bool, error) {
	// Minimum length is dummy, maximum from documentation
	// Source: https://cloud.google.com/iam/docs/reference/sts/rest/v1/TopLevel/token#response-body
	const minSize, maxSize = 100, 12288
	if len(token) < minSize || len(token) > maxSize {
		return false, fmt.Errorf("invalid token size, assert %d <= %d <= %d",
			minSize, len(token), maxSize)
	}
	if !tokenMatch(token) {
		return false, fmt.Errorf("token failed validation against %q", tokenRegex)
	}
	return true, nil
}

const jwtRegex = `^[a-zA-Z0-9\.\-_]+\.[a-zA-Z0-9\.\-_]+\.[a-zA-Z0-9\.\-_]+$`

var jwtMatch = regexp.MustCompile(jwtRegex).MatchString

// isValidJWT verifies the format of an encoded JWT.
//
// The returned error provides details on why the validation failed.
func isValidJWT(jwt string) (bool, error) {
	const minSize, maxSize = 100, 5000 // guess
	if len(jwt) < minSize || len(jwt) > maxSize {
		return false, fmt.Errorf("invalid size, assert %d <= %d <= %d",
			minSize, len(jwt), maxSize)
	}
	if !jwtMatch(jwt) {
		return false, fmt.Errorf("jwt failed validation against %q", jwtRegex)
	}
	return true, nil
}

// Register the API V1 API handler functions to the default http.DefaultServeMux
func Register(tv *app.TokenVendor, prefix string) error {

	log.Debug("mounting API V1 at ", prefix)

	h := NewHandlerContext(tv)

	http.HandleFunc(path.Join(prefix, "public-key.read"), h.publicKeyReadHandler)
	http.HandleFunc(path.Join(prefix, "public-key.publish"), h.publicKeyPublishHandler)
	http.HandleFunc(path.Join(prefix, "token.oauth2"), h.tokenOAuth2Handler)
	http.HandleFunc(path.Join(prefix, "token.verify"), h.verifyTokenHandler)

	return nil
}

repository: googlecloudrobotics/core

repo_name: googlecloudrobotics/core


text:
@book{noauthor_csdl_nodate,
	title = {{CSDL} {\textbackslash}textbar {IEEE} Computer Society},
	url = {https://www.computer.org/csdl/magazine/cg/2004/05/mcg2004050020/13rRUwfqpIK},
	urldate = {2020-01-09},
	file = {CSDL | IEEE Computer Society:/Users/evanlih/Zotero/storage/URFSQ5DR/13rRUwfqpIK.html:text/html}
}

@book{noauthor_visual_2004,
	title = {Visual Analytics},
	url = {https://www.computer.org/csdl/magazine/cg/2004/05/mcg2004050020/13rRUwfqpIK},
	urldate = {2020-01-09},
	date = {2004-09},
	langid = {english},
	doi = {10.1109/MCG.2004.39},
	file = {Snapshot:/Users/evanlih/Zotero/storage/K5SR4GHM/13rRUwfqpIK.html:text/html}
}

@online{noauthor_visual_nodate,
	title = {Visual Analytics: Definition, Process, and Challenges {\textbar} {SpringerLink}},
	url = {https://link.springer.com/chapter/10.1007/978-3-540-70956-5_7},
	urldate = {2020-01-09},
	file = {Visual Analytics\: Definition, Process, and Challenges | SpringerLink:/Users/evanlih/Zotero/storage/6AP56HX9/978-3-540-70956-5_7.html:text/html}
}

@article{shrum_managing_2018,
	title = {Managing climate risks on the ranch with limited drought information},
	volume = {20},
	issn = {2212-0963},
	url = {http://www.sciencedirect.com/science/article/pii/S2212096317301407},
	doi = {10.1016/j.crm.2018.01.002},
	abstract = {Ranching involves complex decision-making and risk management in the face of uncertainty about climate conditions. The profitability and sustainability of ranching depend heavily on sufficient and timely rainfall for rangeland forage production. As a result, ranchers may either adopt conservative long-term stocking strategies as a hedge against drought or practice a more dynamic approach in which they vary stocking rates and supplemental feed in response to drought. Yet, some strategies require more information about climate risks than is often available to ranchers. We review the literature to draw out the drought management options as well as the tools and products for drought monitoring and early warning that are available to ranchers. We find that a large gap remains between the information needs of ranchers seeking to adapt dynamically to drought and the information that is available. Moreover, even when actionable information is available, it is unclear whether ranchers are optimally incorporating that information into their risk management decisions. Further research is needed to understand how to package existing information into risk management decision tools in a way that addresses cognitive and operational barriers to support timely decisions that will reduce the impact of drought on profits and the long-term sustainability of rangelands. Due to the multi-faceted nature of climate risk management in ranching, further study of ranching behavior and decisions has the potential to bring new insights into climate risk management and decision and risk theory far beyond the field of ranching and agriculture.},
	pages = {11--26},
	journaltitle = {Climate Risk Management},
	shortjournal = {Climate Risk Management},
	author = {Shrum, Trisha R. and Travis, William R. and Williams, Travis M. and Lih, Evan},
	urldate = {2020-01-09},
	date = {2018-01-01},
	langid = {english},
	keywords = {Cattle, Climate, Decision-making, Drought adaptation, Information, Ranching, Risk management},
	file = {ScienceDirect Snapshot:/Users/evanlih/Zotero/storage/6TEDP2QT/S2212096317301407.html:text/html;ScienceDirect Full Text PDF:/Users/evanlih/Zotero/storage/HGW55BXA/Shrum et al. - 2018 - Managing climate risks on the ranch with limited d.pdf:application/pdf}
}

repository: EvanLih/visualExampleGit

repo_name: EvanLih/visualExampleGit

gha_license_id: MIT


text:
package app

import (
	"flag"
	"fmt"

	"github.com/spf13/viper"
)

// Config - Application config interface
type Config interface {
	GetString(key string) string
	GetInt(key string) int
}

func setDefaults(cfg *viper.Viper) *viper.Viper {
	var defaultDB string

	if flag.Lookup("test.v") == nil {
		defaultDB = "ledger_dev"
	} else {
		defaultDB = "ledger_test"
	}

	cfg.SetDefault("APP_ENV", "dev")
	cfg.SetDefault("DB_URL", fmt.Sprintf("postgresql://postgres@localhost:5432/%v?sslmode=disable", defaultDB))
	cfg.SetDefault("PORT", 3000)
	cfg.SetDefault("AUTH0_AUD", "https://staging.api.my-ledger.com")
	cfg.SetDefault("AUTH0_ISS", "https://ledger-staging.eu.auth0.com/")
	return cfg
}

// GetConfig - return config instance
func GetConfig() Config {
	viperCfg := viper.New()
	viperCfg.AutomaticEnv()
	return setDefaults(viperCfg)
}


text:
## Robin Sebastian (https://github.com/robseb) (git@robseb.de) 2019-2021

SUMMARY = "Linux Kernel 4.14.130 LTS for Intel PSG (ALTERA) SoC-FPGAs"
DESCRIPTION = "Linux Kernel 4.14.130 LTS for Intel PSG (ALTERA) SoC-FPGAs"

LINUX_VERSION = "4.14.130"
LINUX_VERSION_SUFFIX = "-ltsi"

SRCREV = "cae629555019eb0d3f63d9e8e639a982e994e80f"

include linux-altera.inc

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

SRC_URI_append_cyclone5 = " file://lbdaf.scc "
SRC_URI_append_arria5 = " file://lbdaf.scc "
SRC_URI_append_arria10 = " file://lbdaf.scc "

repository: BobAfwata/meta-intelfpga

repo_name: BobAfwata/meta-intelfpga


text:
@article{olin15,
 author = {Olin, S. and Lindeskog, M. and Pugh, T. A. M. and Schurgers, G. and Warlind, D. and Mishurov, M. and Zaehle, S. and Stocker, B. D. and Smith, B. and Arneth, A.},
 date-modified = {2018-01-09 14:37:43 +0000},
 journal = {Earth System Dynamics},
 number = {2},
 pages = {745-768},
 title = {Soil carbon management in large-scale Earth system modelling: implications for crop yields and nitrogen leaching},
 volume = {6},
 year = {2015}
}


text:
package cmd

import (
	"path/filepath"

	"github.com/pkg/errors"
	"github.com/spf13/cobra"
	"go.uber.org/zap"

	"github.com/Ryo-not-rio/grapi/pkg/grapicmd"
	"github.com/Ryo-not-rio/grapi/pkg/grapicmd/di"
	"github.com/Ryo-not-rio/grapi/pkg/grapicmd/internal/usecase"
	"github.com/izumin5210/clig/pkg/clib"
)

func newInitCommand(ctx *grapicmd.Ctx) *cobra.Command {
	var cfg usecase.InitConfig

	cmd := &cobra.Command{
		Use:           "init [name]",
		Short:         "Initialize a grapi application",
		SilenceErrors: true,
		SilenceUsage:  true,
		Args:          cobra.ExactArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			root, err := parseInitArgs(ctx, args)
			if err != nil {
				return errors.WithStack(err)
			}
			zap.L().Debug("parseInitArgs", zap.String("root", root))

			u, err := di.NewInitializeProjectUsecase(ctx, clib.Path(root))
			if err != nil {
				return errors.WithStack(err)
			}

			return errors.WithStack(u.Perform(root, cfg))
		},
	}

	cmd.PersistentFlags().StringVar(&cfg.Revision, "revision", "", "Specify grapi revision")
	cmd.PersistentFlags().StringVar(&cfg.Branch, "branch", "", "Specify grapi branch")
	cmd.PersistentFlags().StringVar(&cfg.Version, "version", "", "Specify grapi version")
	cmd.PersistentFlags().BoolVar(&cfg.HEAD, "HEAD", false, "Use HEAD grapi")
	cmd.PersistentFlags().StringVar(&cfg.GrapiReplacementURL, "replace-grapi", "", "Specify grapi replacement url")
	cmd.PersistentFlags().StringVarP(&cfg.Package, "package", "p", "", `Package name of the application(default: "<parent_package_or_username>.<app_name>")`)
	cmd.PersistentFlags().BoolVar(&cfg.Dep, "use-dep", false, "Use dep instead of Modules")

	return cmd
}

func parseInitArgs(ctx *grapicmd.Ctx, args []string) (root string, err error) {
	if argCnt := len(args); argCnt != 1 {
		err = errors.Errorf("invalid argument count: want 1, got %d", argCnt)
		return
	}

	arg := args[0]
	root = ctx.RootDir.String()

	if arg == "." {
		return
	}
	root = arg
	if !filepath.IsAbs(arg) {
		root = ctx.RootDir.Join(arg).String()
	}
	return
}

repository: Ryo-not-rio/grapi

repo_name: Ryo-not-rio/grapi


text:
/*
Copyright 2020 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 managedclusters

import (
	"context"
	"errors"
	"testing"

	"github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2022-03-01/containerservice"
	. "github.com/onsi/gomega"
	"go.uber.org/mock/gomock"
	"k8s.io/utils/ptr"
	infrav1 "sigs.k8s.io/cluster-api-provider-azure/api/v1beta1"
	"sigs.k8s.io/cluster-api-provider-azure/azure/services/async/mock_async"
	"sigs.k8s.io/cluster-api-provider-azure/azure/services/managedclusters/mock_managedclusters"
	gomockinternal "sigs.k8s.io/cluster-api-provider-azure/internal/test/matchers/gomock"
	clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1"
)

var fakeManagedClusterSpec = &ManagedClusterSpec{Name: "my-managedcluster", ResourceGroup: "my-rg"}

func TestReconcile(t *testing.T) {
	testcases := []struct {
		name          string
		expectedError string
		expect        func(m *mock_managedclusters.MockCredentialGetterMockRecorder, s *mock_managedclusters.MockManagedClusterScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder)
	}{
		{
			name:          "noop if managedcluster spec is nil",
			expectedError: "",
			expect: func(m *mock_managedclusters.MockCredentialGetterMockRecorder, s *mock_managedclusters.MockManagedClusterScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
				s.ManagedClusterSpec().Return(nil)
			},
		},
		{
			name:          "create managed cluster returns an error",
			expectedError: "some unexpected error occurred",
			expect: func(m *mock_managedclusters.MockCredentialGetterMockRecorder, s *mock_managedclusters.MockManagedClusterScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
				s.ManagedClusterSpec().Return(fakeManagedClusterSpec)
				r.CreateOrUpdateResource(gomockinternal.AContext(), fakeManagedClusterSpec, serviceName).Return(nil, errors.New("some unexpected error occurred"))
				s.UpdatePutStatus(infrav1.ManagedClusterRunningCondition, serviceName, errors.New("some unexpected error occurred"))
			},
		},
		{
			name:          "create managed cluster succeeds",
			expectedError: "",
			expect: func(m *mock_managedclusters.MockCredentialGetterMockRecorder, s *mock_managedclusters.MockManagedClusterScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
				s.ManagedClusterSpec().Return(fakeManagedClusterSpec)
				r.CreateOrUpdateResource(gomockinternal.AContext(), fakeManagedClusterSpec, serviceName).Return(containerservice.ManagedCluster{
					ManagedClusterProperties: &containerservice.ManagedClusterProperties{
						Fqdn:              ptr.To("my-managedcluster-fqdn"),
						ProvisioningState: ptr.To("Succeeded"),
						IdentityProfile: map[string]*containerservice.UserAssignedIdentity{
							kubeletIdentityKey: {
								ResourceID: ptr.To("kubelet-id"),
							},
						},
					},
				}, nil)
				s.SetControlPlaneEndpoint(clusterv1.APIEndpoint{
					Host: "my-managedcluster-fqdn",
					Port: 443,
				})
				m.GetCredentials(gomockinternal.AContext(), "my-rg", "my-managedcluster").Return([]byte("credentials"), nil)
				s.SetKubeConfigData([]byte("credentials"))
				s.SetKubeletIdentity("kubelet-id")
				s.UpdatePutStatus(infrav1.ManagedClusterRunningCondition, serviceName, nil)
			},
		},
		{
			name:          "fail to get managed cluster credentials",
			expectedError: "failed to get credentials for managed cluster: internal server error",
			expect: func(m *mock_managedclusters.MockCredentialGetterMockRecorder, s *mock_managedclusters.MockManagedClusterScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
				s.ManagedClusterSpec().Return(fakeManagedClusterSpec)
				r.CreateOrUpdateResource(gomockinternal.AContext(), fakeManagedClusterSpec, serviceName).Return(containerservice.ManagedCluster{
					ManagedClusterProperties: &containerservice.ManagedClusterProperties{
						Fqdn:              ptr.To("my-managedcluster-fqdn"),
						ProvisioningState: ptr.To("Succeeded"),
					},
				}, nil)
				s.SetControlPlaneEndpoint(clusterv1.APIEndpoint{
					Host: "my-managedcluster-fqdn",
					Port: 443,
				})
				m.GetCredentials(gomockinternal.AContext(), "my-rg", "my-managedcluster").Return([]byte(""), errors.New("internal server error"))
			},
		},
	}

	for _, tc := range testcases {
		tc := tc
		t.Run(tc.name, func(t *testing.T) {
			g := NewWithT(t)
			t.Parallel()
			mockCtrl := gomock.NewController(t)
			defer mockCtrl.Finish()
			scopeMock := mock_managedclusters.NewMockManagedClusterScope(mockCtrl)
			credsGetterMock := mock_managedclusters.NewMockCredentialGetter(mockCtrl)
			reconcilerMock := mock_async.NewMockReconciler(mockCtrl)

			tc.expect(credsGetterMock.EXPECT(), scopeMock.EXPECT(), reconcilerMock.EXPECT())

			s := &Service{
				Scope:            scopeMock,
				CredentialGetter: credsGetterMock,
				Reconciler:       reconcilerMock,
			}

			err := s.Reconcile(context.TODO())
			if tc.expectedError != "" {
				g.Expect(err).To(HaveOccurred())
				g.Expect(err).To(MatchError(tc.expectedError))
			} else {
				g.Expect(err).NotTo(HaveOccurred())
			}
		})
	}
}

func TestDelete(t *testing.T) {
	testcases := []struct {
		name          string
		expectedError string
		expect        func(s *mock_managedclusters.MockManagedClusterScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder)
	}{
		{
			name:          "noop if no managed cluster spec is found",
			expectedError: "",
			expect: func(s *mock_managedclusters.MockManagedClusterScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
				s.ManagedClusterSpec().Return(nil)
			},
		},
		{
			name:          "successfully delete an existing managed cluster",
			expectedError: "",
			expect: func(s *mock_managedclusters.MockManagedClusterScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
				s.ManagedClusterSpec().Return(fakeManagedClusterSpec)
				r.DeleteResource(gomockinternal.AContext(), fakeManagedClusterSpec, serviceName).Return(nil)
				s.UpdateDeleteStatus(infrav1.ManagedClusterRunningCondition, serviceName, nil)
			},
		},
		{
			name:          "managed cluster deletion fails",
			expectedError: "internal error",
			expect: func(s *mock_managedclusters.MockManagedClusterScopeMockRecorder, r *mock_async.MockReconcilerMockRecorder) {
				s.ManagedClusterSpec().Return(fakeManagedClusterSpec)
				r.DeleteResource(gomockinternal.AContext(), fakeManagedClusterSpec, serviceName).Return(errors.New("internal error"))
				s.UpdateDeleteStatus(infrav1.ManagedClusterRunningCondition, serviceName, errors.New("internal error"))
			},
		},
	}

	for _, tc := range testcases {
		tc := tc
		t.Run(tc.name, func(t *testing.T) {
			g := NewWithT(t)
			t.Parallel()
			mockCtrl := gomock.NewController(t)
			defer mockCtrl.Finish()
			scopeMock := mock_managedclusters.NewMockManagedClusterScope(mockCtrl)
			asyncMock := mock_async.NewMockReconciler(mockCtrl)

			tc.expect(scopeMock.EXPECT(), asyncMock.EXPECT())

			s := &Service{
				Scope:      scopeMock,
				Reconciler: asyncMock,
			}

			err := s.Delete(context.TODO())
			if tc.expectedError != "" {
				g.Expect(err).To(HaveOccurred())
				g.Expect(err).To(MatchError(tc.expectedError))
			} else {
				g.Expect(err).NotTo(HaveOccurred())
			}
		})
	}
}


text:
@inproceedings{xiong2016dynamic,
  title={Dynamic memory networks for visual and textual question answering},
  author={Xiong, Caiming and Merity, Stephen and Socher, Richard},
  booktitle={International conference on machine learning},
  pages={2397--2406},
  year={2016},
  organization={PMLR}
}

url: https://raw.githubusercontent.com/rbt-c/DL-NLP-Readings/82ca76e9184a3b00ac87129d99391477c85cfcd2/Bibtex/Dynamic Memory Networks for Visual and Textual Question Answering.bib

repository: rbt-c/DL-NLP-Readings

repo_name: rbt-c/DL-NLP-Readings


text:
package db

import (
	"context"
	"time"

	"database/sql"

	"github.com/go-bridget/mig/cli"
)

type (
	// Credentials contains DSN and Driver
	Credentials struct {
		DSN    string
		Driver string
	}

	// Options include database connection options
	Options struct {
		Credentials Credentials

		// Connector is an optional parameter to produce our
		// own *sql.DB, which is then wrapped in *sqlx.DB
		Connector func(context.Context, Credentials) (*sql.DB, error)

		Retries        int
		RetryDelay     time.Duration
		ConnectTimeout time.Duration
	}
)

// NewOptions provides an initialized *Options object
func NewOptions() *Options {
	return (&Options{}).Init()
}

// Init sets default *Options values
func (options *Options) Init() *Options {
	options.Retries = 100
	options.RetryDelay = 2 * time.Second
	options.ConnectTimeout = 2 * time.Minute
	return options
}

// Bind binds the options variable flags with `db` prefix for the default database connection
func (options *Options) Bind() *Options {
	return options.BindWithPrefix("db")
}

// Bind binds the options variable flags with a custom prefix for multiple database connections
func (options *Options) BindWithPrefix(prefix string) *Options {
	p := func(s string) string {
		if prefix != "" {
			return prefix + "-" + s
		}
		return s
	}
	cli.StringVar(&options.Credentials.Driver, p("driver"), "mysql", "Database driver")
	cli.StringVar(&options.Credentials.DSN, p("dsn"), "", "DSN for database connection")
	return options
}

repository: go-bridget/mig

repo_name: go-bridget/mig


text:
require xorg-app-common.inc
DEPENDS += " libxaw libxt"
PE = "1"
PR = "${INC_PR}.0"

SRC_URI += "file://0001-config-replace-AC_CHECK_FILE-with-test-f.patch"
SRC_URI[archive.md5sum] = "f9addda7d1e157fc7d17ff87b1e360f8"
SRC_URI[archive.sha256sum] = "c57a65c364923d02b0130a4b02117f7d7a0f5c6e01d5dd5c8c263afabc9a19b4"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


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

package test

/*import (
	"fmt"

	"github.com/alibaba/sealer/test/suites/apply"
	"github.com/alibaba/sealer/test/suites/registry"
	"github.com/alibaba/sealer/test/testhelper"
	"github.com/alibaba/sealer/test/testhelper/settings"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
	. "github.com/onsi/gomega/gexec"
)

var _ = Describe("sealer apply", func() {
	Context("start apply", func() {
		BeforeEach(func() {
			registry.Login()
		})

		Context("with roofs images", func() {
			clusterFile := apply.GetClusterFilePathOfRootfs()
			AfterEach(func() {
				cluster := apply.GetClusterFileData(clusterFile)
				apply.DeleteCluster(cluster.ClusterName)
			})

			It("apply cluster", func() {
				sess, err := testhelper.Start(fmt.Sprintf("sealer apply -f %s", clusterFile))
				Expect(err).NotTo(HaveOccurred())
				Eventually(sess, settings.MaxWaiteTime).Should(Exit(0))
			})
		})

	})

})*/

repository: chaunceyjiang/sealer

repo_name: chaunceyjiang/sealer


text:
@misc{mobilebankingwiki,
    author    = "Wikipedia",
    title     = "Mobile Banking",
    url       = "https://en.wikipedia.org/wiki/Mobile_banking"
}

@misc{agile,
    author    = "Linchpin",
    title     = "Agile Methodology",
    url       = "https://linchpinseo.com/the-agile-method/"
}
@misc{agilewaterfall,
    author    = "Marklogic",
    title     = "Waterfall to Agile",
    url       = "http://www.marklogic.com/blog/3-reasons-to-transition-from-waterfall-to-agile/"
}

@misc{scrum,
    author    = "Extreme Programming",
    title     = "Extreme Programming:
A gentle introduction",
    url       = "http://www.extremeprogramming.org/"
}

@misc{ionic,
    author    = "Wikipedia",
    title     = "Ionic (mobile app framework)",
    url       = "https://en.wikipedia.org/wiki/Ionic_(mobile_app_framework)"
}
@misc{angular,
    author    = "Sitepoint",
    title     = "10 reasons to use AngularJS",
    url       = "https://www.sitepoint.com/10-reasons-use-angularjs/"
}

@misc{html,
    author    = "Patrick Cox - Codrops",
    title     = "10 reasons to use HTML5",
    url       = "https://tympanus.net/codrops/2011/11/24/top-10-reasons-to-use-html5-right-now/"
}

@misc{html2,
    author    = "Elle Brown - Gomo Learning",
    title     = "Why is HTML5 important",
    url       = "https://www.gomolearning.com/blog/what-is-html5-why-is-it-important/"
}
@misc{auth0,
    author    = "Auth0",
    title     = "Auth0 Overview",
    url       = "https://auth0.com/docs/overview"
}
@misc{node,
    author    = "NodeJS",
    title     = "NodeJS",
    url       = "https://nodejs.org/en/"
}
@misc{node2,
    author    = "Tutorials Point",
    title     = "Node.js Quick Guide",
    url       = "https://www.tutorialspoint.com/nodejs/nodejs_quick_guide.htm"
}
@misc{heroku,
    author    = "Heroku",
    title     = "How Heroku Works",
    url       = "https://devcenter.heroku.com/articles/how-heroku-works"
}
@misc{http,
    author    = "Kate T, Pooja Sehgal, Nikhilesh Jasuja",
    title     = "GET vs. POST",
    url       = "www.diffen.com"
}
@misc{map,
    author    = "Ionic Framework",
    title     = "Google Maps",
    url       = "https://ionicframework.com/docs/native/google-maps/"
}
@misc{fintech,
    author    = "Patrick Schueffel",
    title     = "Taming the Beast: A Scientific Definition of Fintech",
    url       = "http://www.open-jim.org/article/view/322/221"
}
@misc{userStories,
    author    = "Sandy Mamoli",
    title     = "On Acceptance criteria for user stories",
    url       = "https://nomad8.com/acceptance_criteria/"
}
@misc{mongo,
    author    = "MongoDB",
    title     = "What is Mongo",
    url       = "https://www.mongodb.com/what-is-mongodb/"
}
@misc{mongoPlan,
    author    = "MongoDB",
    title     = "MongoDB plans",
    url       = "http://docs.mlab.com/plans/"
}
@misc{mongoose,
    author    = "MongoDB",
    title     = "Mongoose",
    url       = "https://devcenter.heroku.com/articles/nodejs-mongoose"
}

repository: sinderpl/BankingApplication

path: /Final Year Project Dissertation/bibliography.bib

repo_name: sinderpl/BankingApplication


text:
inherit esw deploy

COMPATIBLE_MACHINE = "microblaze-pmu"

ESW_COMPONENT_SRC = "/lib/sw_apps/zynqmp_pmufw/src"

DEPENDS += "xilstandalone xiltimer xilfpga xilskey"

do_install() {
    install -d ${D}/${base_libdir}/firmware
    # Note that we have to make the ELF executable for it to be stripped
    install -m 0755  ${B}/pmufw* ${D}/${base_libdir}/firmware
}

PMU_FIRMWARE_BASE_NAME ?= "${BPN}-${PKGE}-${PKGV}-${PKGR}-${MACHINE}-${DATETIME}"
PMU_FIRMWARE_BASE_NAME[vardepsexclude] = "DATETIME"

do_deploy() {

    # We need to deploy the stripped elf, hence why not doing it from ${D}
    install -Dm 0644 ${WORKDIR}/package/${base_libdir}/firmware/pmufw.elf ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.elf
    ln -sf ${PMU_FIRMWARE_BASE_NAME}.elf ${DEPLOYDIR}/${BPN}-${MACHINE}.elf
    ${OBJCOPY} -O binary ${WORKDIR}/package/${base_libdir}/firmware/pmufw.elf ${WORKDIR}/package/${base_libdir}/firmware/pmufw.bin
    install -m 0644 ${WORKDIR}/package/${base_libdir}/firmware/pmufw.bin ${DEPLOYDIR}/${PMU_FIRMWARE_BASE_NAME}.bin
    ln -sf ${PMU_FIRMWARE_BASE_NAME}.bin ${DEPLOYDIR}/${BPN}-${MACHINE}.bin
}

addtask deploy before do_build after do_package

FILES_${PN} = "${base_libdir}/firmware/pmufw*"


text:
DESCRIPTION = "A Python extension for the SQLite Embedded Relational Database"
SECTION = "devel/python"
PRIORITY = "optional"
MAINTAINER = "Michael 'Mickey' Lauer <mickey@Vanille.de>"
LICENSE = "PSF"
RDEPENDS = "python-core python-re python-lang python-datetime"
DEPENDS = "sqlite3"
SRCNAME = "pysqlite"
PR = "ml1"

SRC_URI = "http://initd.org/pub/software/pysqlite/releases/2.2/${PV}/${SRCNAME}-${PV}.tar.gz"
S = "${WORKDIR}/${SRCNAME}-${PV}"

inherit distutils


text:
package thunder

import (
	"testing"

	"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

var TEST_FW_TCP_WINDOW_CHECK_RESOURCE = `
resource "thunder_fw_tcp_window_check" "FwTest" {
        status = "enable"
}
`

//Acceptance test
func TestAccFwTcpWindowCheck_create(t *testing.T) {
	resource.Test(t, resource.TestCase{
		Providers: testAccProviders,
		Steps: []resource.TestStep{
			{
				Config: TEST_FW_TCP_WINDOW_CHECK_RESOURCE,
				Check: resource.ComposeTestCheckFunc(
					resource.TestCheckResourceAttr("thunder_fw_tcp_window_check.FwTest", "status", "enable"),
				),
			},
		},
	})
}

repository: DanielAtella/terraform-provider-thunder

repo_name: DanielAtella/terraform-provider-thunder


text:
require cairo.inc

PR = "r1"

SRC_URI = "http://cairographics.org/releases/cairo-${PV}.tar.gz;name=cairo \
"

SRC_URI[cairo.md5sum] = "70a2ece66cf473d976e2db0f75bf199e"
SRC_URI[cairo.sha256sum] = "0f2ce4cc4615594088d74eb8b5360bad7c3cc3c3da9b61af9bfd979ed1ed94b2"


text:
@article{pomacs18,
  author={Oleksenko, Oleksii and Kuvaiskii, Dmitrii and Bhatotia, Pramod and Felber, Pascal and Fetzer, Christof},
  title={{Intel MPX Explained: A Cross-layer Analysis of the Intel MPX System Stack}},
  journal={Proceedings of the ACM on Measurement and Analysis of Computing Systems},
  year = {2018},
}


text:
@article{wilson2020,
urldate = {2020-02-27},
abstract = {The human X and Y chromosomes evolved from a pair of autosomes approximately 180 million years ago. Despite their shared evolutionary origin, extensive genetic decay has resulted in the human Y chromosome losing 97% of its ancestral genes while gene content and order remain highly conserved on the X chromosome. Five ‘stratification' events, most likely inversions, reduced the Y chromosome’s ability to recombine with the X chromosome across the majority of its length and subjected its genes to the erosive forces associated with reduced recombination. The remaining functional genes are ubiquitously expressed, functionally coherent, dosage-sensitive genes, or have evolved male-specific functionality. It is unknown, however, whether functional specialization is a degenerative phenomenon unique to sex chromosomes, or if it conveys a potential selective advantage aside from sexual antagonism. We examined the evolution of mammalian orthologs to determine if the selective forces that led to the degeneration of the Y chromosome are unique in the genome. The results of our study suggest these forces are not exclusive to the Y chromosome, and chromosomal degeneration may have occurred throughout our evolutionary history. The reduction of recombination could additionally result in rapid fixation through isolation of specialized functions resulting in a cost-benefit relationship during times of intense selective pressure.},
author = {Wilson, Jason and Staley, Joshua M. and Wyckoff, Gerald J.},
date = {2020/02/07},
doi = {10.1038/s41598-020-58997-2},
isbn-issn = {2045-2322},
issue = {1},
journal-full-format = {Scientific Reports},
reference-id = {Wilson2020},
start-page = {2170},
title = {Extinction of chromosomes due to specialization is a universal occurrence},
type = {JOUR},
url = {https://doi.org/10.1038/s41598-020-58997-2},
volume = {10},
year = {2020},
}

repository: pmean/build-website

repo_name: pmean/build-website


text:
@inproceedings{Wen2020BatchEnsemble:,
title={BatchEnsemble: an Alternative Approach to Efficient Ensemble and Lifelong Learning},
author={Yeming Wen and Dustin Tran and Jimmy Ba},
booktitle={International Conference on Learning Representations},
year={2020},
url={https://openreview.net/forum?id=Sklf1yrYDr}
}

url: https://raw.githubusercontent.com/rbt-c/DL-NLP-Readings/82ca76e9184a3b00ac87129d99391477c85cfcd2/Bibtex/BatchEnsemble - An Alternative Approach to Efficient Ensemble and Lifelong Learning.bib


text:
package mypod

import (
	"encoding/json"
	"os"
)

type Config struct {
	BaseURL     string
	Title       string
	Description string
	Link        string
	Language    string
	Copyright   string
	Author      string
	Subtitle    string
	Summary     string
	Owner       struct {
		Name  string
		Email string
	}
	Image      string
	Categories []string
	Explicit   bool
}

func ReadConfig(filepath string) (Config, error) {
	f, err := os.Open(filepath)
	if err != nil {
		return Config{}, err
	}
	defer f.Close()

	conf := Config{}
	err = json.NewDecoder(f).Decode(&conf)
	return conf, err
}

repository: parkr/mypod

repo_name: parkr/mypod


text:
SECTION = "devel/chicken"
DESCRIPTION = "A declarative applicative logic programming system."
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://kanren.meta;md5=a67e886797c02b73fb26caf35f245ef8"
DEPENDS_append_class-cross = " chicken-egg-make-cross"
DEPENDS_append_class-crosssdk = " chicken-egg-make-crosssdk"
DEPENDS_append_class-nativesdk = " nativesdk-chicken-egg-make chicken-egg-make-crosssdk"
DEPENDS = " chicken-egg-make chicken-egg-make-cross"
RDEPENDS_${PN} = " chicken-egg-make"

SRC_URI = "http://code.call-cc.org/egg-tarballs/4/kanren/kanren-${PV}.tar.gz"

SRC_URI[md5sum] = "778fc7e155f69279a21eb4523908f534"
SRC_URI[sha256sum] = "d07579b4739b9e8092c149c0345966cca15e606bb927139821c433e463305cf4"

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

inherit chicken_install

BBCLASSEXTEND = "cross crosssdk nativesdk"

repository: OSSystems/meta-chicken

repo_name: OSSystems/meta-chicken


text:
%%% -*-BibTeX-*-
%%% Do NOT edit. File created by BibTeX with style
%%% ACM-Reference-Format-Journals [18-Jan-2012].

\begin{thebibliography}{10}

%%% ====================================================================
%%% NOTE TO THE USER: you can override these defaults by providing
%%% customized versions of any of these macros before the \bibliography
%%% command.  Each of them MUST provide its own final punctuation,
%%% except for \shownote{}, \showDOI{}, and \showURL{}.  The latter two
%%% do not use final punctuation, in order to avoid confusing it with
%%% the Web address.
%%%
%%% To suppress output of a particular field, define its macro to expand
%%% to an empty string, or better, \unskip, like this:
%%%
%%% \newcommand{\showDOI}[1]{\unskip}   % LaTeX syntax
%%%
%%% \def \showDOI #1{\unskip}           % plain TeX syntax
%%%
%%% ====================================================================

\ifx \showCODEN    \undefined \def \showCODEN     #1{\unskip}     \fi
\ifx \showDOI      \undefined \def \showDOI       #1{#1}\fi
\ifx \showISBNx    \undefined \def \showISBNx     #1{\unskip}     \fi
\ifx \showISBNxiii \undefined \def \showISBNxiii  #1{\unskip}     \fi
\ifx \showISSN     \undefined \def \showISSN      #1{\unskip}     \fi
\ifx \showLCCN     \undefined \def \showLCCN      #1{\unskip}     \fi
\ifx \shownote     \undefined \def \shownote      #1{#1}          \fi
\ifx \showarticletitle \undefined \def \showarticletitle #1{#1}   \fi
\ifx \showURL      \undefined \def \showURL       {\relax}        \fi
% The following commands are used for tagged output and should be
% invisible to TeX
\providecommand\bibfield[2]{#2}
\providecommand\bibinfo[2]{#2}
\providecommand\natexlab[1]{#1}
\providecommand\showeprint[2][]{arXiv:#2}

\bibitem[\protect\citeauthoryear{Amjady and Keynia}{Amjady and Keynia}{2008}]%
        {Amjady2008}
\bibfield{author}{\bibinfo{person}{Nima Amjady} {and} \bibinfo{person}{Farshid
  Keynia}.} \bibinfo{year}{2008}\natexlab{}.
\newblock \showarticletitle{{Day ahead price forecasting of electricity markets
  by a mixed data model and hybrid forecast method}}.
\newblock \bibinfo{journal}{\emph{International Journal of Electrical Power
  {\&} Energy Systems}} \bibinfo{volume}{30}, \bibinfo{number}{9}
  (\bibinfo{date}{nov} \bibinfo{year}{2008}), \bibinfo{pages}{533--546}.
\newblock
\showISSN{0142-0615}
\urldef\tempurl%
\url{https://doi.org/10.1016/J.IJEPES.2008.06.001}
\showDOI{\tempurl}

\bibitem[\protect\citeauthoryear{Brownlee}{Brownlee}{2018}]%
        {Brownlee2018}
\bibfield{author}{\bibinfo{person}{Jason Brownlee}.}
  \bibinfo{year}{2018}\natexlab{}.
\newblock \bibinfo{title}{{How to Develop LSTM Models for Time Series
  Forecasting}}.
\newblock
\newblock
\urldef\tempurl%
\url{https://machinelearningmastery.com/how-to-develop-lstm-models-for-time-series-forecasting/}
\showURL{%
\tempurl}

\bibitem[\protect\citeauthoryear{California}{California}{[n. d.]}]%
        {CAenergy2}
\bibfield{author}{\bibinfo{person}{California}.} \bibinfo{year}{[n.
  d.]}\natexlab{}.
\newblock \bibinfo{title}{{EIA - State Electricity Profiles}}.
\newblock
\newblock
\urldef\tempurl%
\url{https://www.eia.gov/electricity/state/california/}
\showURL{%
\tempurl}

\bibitem[\protect\citeauthoryear{Conejo, Plazas, Espinola, and Molina}{Conejo
  et~al\mbox{.}}{2005b}]%
        {Conejo2005}
\bibfield{author}{\bibinfo{person}{A.J. Conejo}, \bibinfo{person}{M.A. Plazas},
  \bibinfo{person}{R. Espinola}, {and} \bibinfo{person}{A.B. Molina}.}
  \bibinfo{year}{2005}\natexlab{b}.
\newblock \showarticletitle{{Day-Ahead Electricity Price Forecasting Using the
  Wavelet Transform and ARIMA Models}}.
\newblock \bibinfo{journal}{\emph{IEEE Transactions on Power Systems}}
  \bibinfo{volume}{20}, \bibinfo{number}{2} (\bibinfo{date}{may}
  \bibinfo{year}{2005}), \bibinfo{pages}{1035--1042}.
\newblock
\showISSN{0885-8950}
\urldef\tempurl%
\url{https://doi.org/10.1109/TPWRS.2005.846054}
\showDOI{\tempurl}

\bibitem[\protect\citeauthoryear{Conejo, Contreras, Esp{\'{i}}nola, and
  Plazas}{Conejo et~al\mbox{.}}{2005a}]%
        {Conejo2005a}
\bibfield{author}{\bibinfo{person}{Antonio~J. Conejo}, \bibinfo{person}{Javier
  Contreras}, \bibinfo{person}{Rosa Esp{\'{i}}nola}, {and}
  \bibinfo{person}{Miguel~A. Plazas}.} \bibinfo{year}{2005}\natexlab{a}.
\newblock \showarticletitle{{Forecasting electricity prices for a day-ahead
  pool-based electric energy market}}.
\newblock \bibinfo{journal}{\emph{International Journal of Forecasting}}
  \bibinfo{volume}{21}, \bibinfo{number}{3} (\bibinfo{date}{jul}
  \bibinfo{year}{2005}), \bibinfo{pages}{435--462}.
\newblock
\showISSN{0169-2070}
\urldef\tempurl%
\url{https://doi.org/10.1016/J.IJFORECAST.2004.12.005}
\showDOI{\tempurl}

\bibitem[\protect\citeauthoryear{Dasgupta}{Dasgupta}{2018}]%
        {Dasgupta2018}
\bibfield{author}{\bibinfo{person}{Tathagat Dasgupta}.}
  \bibinfo{year}{2018}\natexlab{}.
\newblock \bibinfo{title}{{Time-Series Analysis Using Recurrent Neural Networks
  in Tensorflow}}.
\newblock
\newblock
\urldef\tempurl%
\url{https://medium.com/themlblog/time-series-analysis-using-recurrent-neural-networks-in-tensorflow-2a0478b00be7}
\showURL{%
\tempurl}

\bibitem[\protect\citeauthoryear{Dowling, Kumar, and Zavala}{Dowling
  et~al\mbox{.}}{2017}]%
        {Dowling2017}
\bibfield{author}{\bibinfo{person}{Alexander~W. Dowling},
  \bibinfo{person}{Ranjeet Kumar}, {and} \bibinfo{person}{Victor~M. Zavala}.}
  \bibinfo{year}{2017}\natexlab{}.
\newblock \showarticletitle{{A multi-scale optimization framework for
  electricity market participation}}.
\newblock \bibinfo{journal}{\emph{Applied Energy}}  \bibinfo{volume}{190}
  (\bibinfo{date}{mar} \bibinfo{year}{2017}), \bibinfo{pages}{147--164}.
\newblock
\showISSN{0306-2619}
\urldef\tempurl%
\url{https://doi.org/10.1016/J.APENERGY.2016.12.081}
\showDOI{\tempurl}

\bibitem[\protect\citeauthoryear{Garcia, Contreras, VanAkkeren, and
  Garcia}{Garcia et~al\mbox{.}}{2005}]%
        {Garcia2005}
\bibfield{author}{\bibinfo{person}{R.C. Garcia}, \bibinfo{person}{J.
  Contreras}, \bibinfo{person}{M. VanAkkeren}, {and} \bibinfo{person}{J.B.C.
  Garcia}.} \bibinfo{year}{2005}\natexlab{}.
\newblock \showarticletitle{{A GARCH Forecasting Model to Predict Day-Ahead
  Electricity Prices}}.
\newblock \bibinfo{journal}{\emph{IEEE Transactions on Power Systems}}
  \bibinfo{volume}{20}, \bibinfo{number}{2} (\bibinfo{date}{may}
  \bibinfo{year}{2005}), \bibinfo{pages}{867--874}.
\newblock
\showISSN{0885-8950}
\urldef\tempurl%
\url{https://doi.org/10.1109/TPWRS.2005.846044}
\showDOI{\tempurl}

\bibitem[\protect\citeauthoryear{Tan, Zhang, Wang, and Xu}{Tan
  et~al\mbox{.}}{2010}]%
        {Tan2010}
\bibfield{author}{\bibinfo{person}{Zhongfu Tan}, \bibinfo{person}{Jinliang
  Zhang}, \bibinfo{person}{Jianhui Wang}, {and} \bibinfo{person}{Jun Xu}.}
  \bibinfo{year}{2010}\natexlab{}.
\newblock \showarticletitle{{Day-ahead electricity price forecasting using
  wavelet transform combined with ARIMA and GARCH models}}.
\newblock \bibinfo{journal}{\emph{Applied Energy}} \bibinfo{volume}{87},
  \bibinfo{number}{11} (\bibinfo{date}{nov} \bibinfo{year}{2010}),
  \bibinfo{pages}{3606--3610}.
\newblock
\showISSN{0306-2619}
\urldef\tempurl%
\url{https://doi.org/10.1016/J.APENERGY.2010.05.012}
\showDOI{\tempurl}

\bibitem[\protect\citeauthoryear{Wang and Wu}{Wang and Wu}{2012}]%
        {Wang2012}
\bibfield{author}{\bibinfo{person}{Yudong Wang} {and}
  \bibinfo{person}{Chongfeng Wu}.} \bibinfo{year}{2012}\natexlab{}.
\newblock \showarticletitle{{Forecasting energy market volatility using GARCH
  models: Can multivariate models beat univariate models?}}
\newblock \bibinfo{journal}{\emph{Energy Economics}} \bibinfo{volume}{34},
  \bibinfo{number}{6} (\bibinfo{date}{nov} \bibinfo{year}{2012}),
  \bibinfo{pages}{2167--2181}.
\newblock
\showISSN{0140-9883}
\urldef\tempurl%
\url{https://doi.org/10.1016/J.ENECO.2012.03.010}
\showDOI{\tempurl}

\end{thebibliography}

extension: bbl


text:
DESCRIPTION = "Tasks for SDL stuff"
LICENSE = MIT
PACKAGES = "task-sdl-libs task-sdl-games task-sdl-emulators"

# no need to add libsdl as all libsdl-* already rdepend on it
RDEPENDS_task-sdl-libs = "libsdl-gfx libsdl-image libsdl-mixer libsdl-ttf libsdl-net"

RDEPENDS_task-sdl-games = "abuse freedroid lbreakout2 openttd prboom quake1 rott supertux xmame"

RDEPENDS_task-sdl-emulators = "dgen-sdl e-uae frodo snes9x"

repository: BackupTheBerlios/openslug-svn

repo_name: BackupTheBerlios/openslug-svn


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

inherit packagegroup

RDEPENDS_${PN} = " \
	qtbase \
	qtmqtt \
	qtbase-plugins \
	qtbase-tools \
	qtbase-examples \
	qtmultimedia \
	qtmultimedia-plugins \
	qtmultimedia-qmlplugins \
	qtsvg \
	qtsvg-plugins \
	qtsensors \
	qtserialport \
	qtsystems \
	qtsystems-tools \
	qtsystems-qmlplugins \
	qtscript \
	qtgraphicaleffects-qmlplugins \
	qtconnectivity-qmlplugins \
	qtlocation-plugins \
	qtlocation-qmlplugins \
	qtdeclarative \
	qtdeclarative-qmlplugins \
	qtquickcontrols \
	qtquickcontrols-qmlplugins \
	qtquickcontrols2 \
	qtquickcontrols2-qmlplugins \
"

gha_language: PHP


text:
module.exports = [{
      plugin: require('/Users/ethan/GatsbyBoilerplate/node_modules/gatsby-plugin-netlify-cms/gatsby-browser.js'),
      options: {"plugins":[]},
    },{
      plugin: require('/Users/ethan/GatsbyBoilerplate/gatsby-browser.js'),
      options: {"plugins":[]},
    }]

repository: ethaneisenhard/GatsbyBoilerplate

repo_name: ethaneisenhard/GatsbyBoilerplate

gha_language: JavaScript

extension: js


text:
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
//     http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file 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.
//

// Code generated by MockGen. DO NOT EDIT.
// Source: github.com/aws/amazon-ecs-agent/ecs-agent/tmds/handlers/taskprotection/v1/handlers (interfaces: TaskProtectionClientFactoryInterface)

// Package handlers is a generated GoMock package.
package handlers

import (
	reflect "reflect"

	api "github.com/aws/amazon-ecs-agent/ecs-agent/api"
	credentials "github.com/aws/amazon-ecs-agent/ecs-agent/credentials"
	gomock "github.com/golang/mock/gomock"
)

// MockTaskProtectionClientFactoryInterface is a mock of TaskProtectionClientFactoryInterface interface.
type MockTaskProtectionClientFactoryInterface struct {
	ctrl     *gomock.Controller
	recorder *MockTaskProtectionClientFactoryInterfaceMockRecorder
}

// MockTaskProtectionClientFactoryInterfaceMockRecorder is the mock recorder for MockTaskProtectionClientFactoryInterface.
type MockTaskProtectionClientFactoryInterfaceMockRecorder struct {
	mock *MockTaskProtectionClientFactoryInterface
}

// NewMockTaskProtectionClientFactoryInterface creates a new mock instance.
func NewMockTaskProtectionClientFactoryInterface(ctrl *gomock.Controller) *MockTaskProtectionClientFactoryInterface {
	mock := &MockTaskProtectionClientFactoryInterface{ctrl: ctrl}
	mock.recorder = &MockTaskProtectionClientFactoryInterfaceMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockTaskProtectionClientFactoryInterface) EXPECT() *MockTaskProtectionClientFactoryInterfaceMockRecorder {
	return m.recorder
}

// NewTaskProtectionClient mocks base method.
func (m *MockTaskProtectionClientFactoryInterface) NewTaskProtectionClient(arg0 credentials.TaskIAMRoleCredentials) api.ECSTaskProtectionSDK {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "NewTaskProtectionClient", arg0)
	ret0, _ := ret[0].(api.ECSTaskProtectionSDK)
	return ret0
}

// NewTaskProtectionClient indicates an expected call of NewTaskProtectionClient.
func (mr *MockTaskProtectionClientFactoryInterfaceMockRecorder) NewTaskProtectionClient(arg0 interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "NewTaskProtectionClient", reflect.TypeOf((*MockTaskProtectionClientFactoryInterface)(nil).NewTaskProtectionClient), arg0)
}

repository: aws/amazon-ecs-agent

repo_name: aws/amazon-ecs-agent


text:
file(REMOVE_RECURSE
  "CMakeFiles/pac-analyzer-protocol-gssapi-gssapi.pac"
  "gssapi_pac.h"
  "gssapi_pac.cc"
)

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

repository: MaxPowell/bro

repo_name: MaxPowell/bro

extension: cmake


text:
package whoisparser

import (
	"regexp"
)

var orgParser = &Parser{

	errorRegex: &ParseErrorRegex{
		NoSuchDomain:     regexp.MustCompile(`NOT FOUND`),
		RateLimit:        regexp.MustCompile(`WHOIS LIMIT EXCEEDED`),
		MalformedRequest: regexp.MustCompile(`Not a valid domain search pattern`),
	},

	registrarRegex: &RegistrarRegex{
		CreatedDate:    regexp.MustCompile(`(?i)Creation Date: *(.+)`),
		DomainDNSSEC:   regexp.MustCompile(`DNSSEC: *(.+)`),
		DomainID:       regexp.MustCompile(`Registry Domain ID: *(.+)`),
		DomainName:     regexp.MustCompile(`Domain Name: *(.+)`),
		DomainStatus:   regexp.MustCompile(`(?i)Domain status: *(.+)`),
		Emails:         regexp.MustCompile(`(?i)Registrar Abuse Contact Email: *(` + EmailRegex + `)`),
		ExpirationDate: regexp.MustCompile(`Registrar Registration Expiration Date: *(.+)`),
		NameServers:    regexp.MustCompile(`Name Server: *(.+)`),
		RegistrarID:    regexp.MustCompile(`Registrar IANA ID: *(.+)`),
		RegistrarName:  regexp.MustCompile(`Registrar: *(.+)`),
		UpdatedDate:    regexp.MustCompile(`(?i)Updated Date: *(.+)`),
		WhoisServer:    regexp.MustCompile(`(?i)Registrar WHOIS Server: *(.+)`),
	},

	registrantRegex: &RegistrantRegex{
		Organization: regexp.MustCompile(`(?i)Registrant Organization: *(.+)`),
		Province:     regexp.MustCompile(`(?i)Registrant State/Province: *(.+)`),
		Country:      regexp.MustCompile(`(?i)Registrant Country: *(.+)`),
	},
}

func init() {
	RegisterParser(".org", orgParser)
}

repository: icamys/whois-parser

repo_name: icamys/whois-parser


text:
SUMMARY = "jsonref is a library for automatic dereferencing of JSON Reference objects for Python"
HOMEPAGE = "https://github.com/gazpachoking/jsonref"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=a34264f25338d41744dca1abfe4eb18f"

SRC_URI[md5sum] = "42b518b9ccd6852d1d709749bc96cb70"
SRC_URI[sha256sum] = "f3c45b121cf6257eafabdc3a8008763aed1cd7da06dbabc59a9e4d2a5e4e6697"

inherit pypi setuptools3

BBCLASSEXTEND = "native nativesdk"

repository: ni/meta-openembedded

repo_name: ni/meta-openembedded

branch_name: refs/heads/nilrt/master/hardknott

gha_language: BitBake


text:
% Encoding: UTF-8

@Book{胡伟2013LATEX,
  author    = {胡,伟},
  publisher = {清华大学出版社},
  title     = {LATEX 2e完全学习手册.第2版},
  year      = {2013},
  address   = {北京},
}

@Book{刘海洋2013LATEX,
  author    = {刘,海洋},
  publisher = {电子工业出版社},
  title     = {LATEX入门},
  year      = {2013},
  address   = {北京},
}

@Book{陈志杰2006LATEX,
  author    = {陈,志杰 and 赵,书钦 and 李,树钧 and 万,福永},
  publisher = {高等教育出版社},
  title     = {LATEX入门与提高（第二版）},
  year      = {2006},
  address   = {北京},
}
@Misc{gbt7714_2015,
  title     = {《文后参考文献著录规则》（{GB}／{T}7714-2015） {\textbar} 教育部高等学校图书情报工作指导委员会},
  timestamp = {2020-01-03},
  url       = {http://www.scal.edu.cn/dxtsgxb/201906120155},
}
@misc{noauthor_latex_nodate,
	title = {Latex 自定义参考文献格式（配置 bst）\_Chikily {Yongfeng}-{CSDN博客}},
	url = {https://blog.csdn.net/chikily_yongfeng/article/details/86553359},
	timestamp = {2020-01-03},
}
@misc{q_better_nodate,
	title = {Better {BibTeX}，一款将{Zotero与LaTeX 完美结合的插件}！},
	url = {https://mp.weixin.qq.com/s/-1IeuEYuxUgYXZyY_aPPYw},
	abstract = {推荐！},
	timestamp= {2020-01-17},
	journal = {WeChat Official Accounts Platform},
	author = {青柠学术},
	file = {Snapshot:files/101/-1IeuEYuxUgYXZyY_aPPYw.html:text/html}
}

@Comment{jabref-meta: databaseType:bibtex;}


text:
SECTION = "devel/chicken"
DESCRIPTION = "Serialized limited continuations"
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://suspension.meta;md5=78e02e279f518b16efaf25c01b389d35"
DEPENDS_append_class-cross = " chicken-egg-s11n-cross"
DEPENDS_append_class-crosssdk = " chicken-egg-s11n-crosssdk"
DEPENDS_append_class-nativesdk = " nativesdk-chicken-egg-s11n chicken-egg-s11n-crosssdk"
DEPENDS = " chicken-egg-s11n chicken-egg-s11n-cross"
RDEPENDS_${PN} = " chicken-egg-s11n"

SRC_URI = "http://code.call-cc.org/egg-tarballs/4/suspension/suspension-${PV}.tar.gz"

SRC_URI[md5sum] = "e96b87de9a7a3b4fa2f7399dec56bd4e"
SRC_URI[sha256sum] = "17c8707fbc60f1bce81ba735443042592a2c2c9b38d140be3cc1172525ffe0d0"

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

inherit chicken_install

BBCLASSEXTEND = "cross crosssdk nativesdk"


text:
# Copyright (C) 2021 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)
SUMMARY = "The simple GObject game controller library"
HOMEPAGE = "https://gnome.pages.gitlab.gnome.org/libmanette/"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"

DEPENDS = "libevdev libgudev"

SRC_URI = "https://download.gnome.org/sources/libmanette/0.2/libmanette-${PV}.tar.xz"
SRC_URI[sha256sum] = "63653259a821ec7d90d681e52e757e2219d462828c9d74b056a5f53267636bac"

inherit meson pkgconfig gobject-introspection ptest vala

FILES:${PN}-ptest =+ "${bindir}/manette-test"
FILES:${PN}-dev =+ "${libdir}/girepository-1.0"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded


text:
SECTION = "base"
DESCRIPTION = "Gives a fake root environment which can support chroot"
LICENSE = "GPL"

SRC_URI = "${DEBIAN_MIRROR}/main/f/fakechroot/fakechroot_${PV}.orig.tar.gz \
           file://fix-readlink.patch"

inherit autotools

SRC_URI[md5sum] = "b885951b98f4316f9686699e9853513d"
SRC_URI[sha256sum] = "990cd830ea362ba2cb88ca7b59cd3f4d115a054621450b5cf211cadebed23ee0"


text:
@PATENT{Armitage2014,  author = {John Armitage},
  title = {Method and system for generating a {Columnar Tree Map}},
  number = {US 8854371 B2},
  year = {2014},
  abstract = {A method and system to generate a columnar tree map of a hierarchical structure is provided. An example system comprises a memory, at least one processor coupled to the memory, a data access module configured to access a hierarchical data structure, and a tree map generator to generate a tree map using at least one processor. The tree map generator generates and renders a tree map for a target data set based on the size and dimensions of a viewing area provided on a target display device, the values associated with categories in the data set, and a predetermined column width.},
  url = {http://www.freepatentsonline.com/8854371.html}
}

repository: vis-au/treevisnet

repo_name: vis-au/treevisnet


text:
@inproceedings{joyce_semiotics_1999,
 author = {Joyce, Dan W and Lewis, Paul H and Tansley, Robert H and Dobie, Mark R and Hall, Wendy},
 pages = {120--131},
 publisher = {International Society for Optics and Photonics},
 title = {Semiotics and agents for integrating and navigating through multimedia representations of concepts},
 volume = {3972},
 year = {1999}
}

repository: danwjoyce/technical-blog

repo_name: danwjoyce/technical-blog


text:
package main

import (
	"bytes"
	"flag"
	"fmt"
	"log"

	"github.com/eoscanada/eos-go"
	"github.com/eoscanada/eos-go/cmd/eos-mega-tx/random"
	"github.com/eoscanada/eos-go/ecc"
	"github.com/eoscanada/eos-go/system"
	"github.com/eoscanada/eos-go/token"
	"github.com/satori/go.uuid"
)

var signingKey = flag.String("signing-key", "", "Key to sign transactions we're about to blast")
var apiAddr = flag.String("api-addr", "http://localhost:8888", "RPC endpoint of the nodeos instance")

var eosioAccount = AC("eosio")

type transferChannel chan *eos.Action

func main() {
	flag.Parse()

	privKey, err := ecc.NewPrivateKey(*signingKey)
	if err != nil {
		log.Fatalln("failed loading private key:", err)
	}

	api := eos.New(*apiAddr, bytes.Repeat([]byte{0}, 32)) // TODO: use chain ID from somewhere..

	keyBag := eos.NewKeyBag()
	if err := keyBag.Add(*signingKey); err != nil {
		log.Fatalln("Couldn't load private key:", err)
	}
	api.SetSigner(keyBag)

	var accountNames []eos.AccountName
	for i := 0; i < 10; i++ {
		acctName := random.String(12)

		fmt.Println("Creating account with name: ", acctName)

		newAcctAction := system.NewNewAccount(eosioAccount, AC(acctName), privKey.PublicKey())
		xferAction := token.NewTransfer(eosioAccount, AC(acctName), eos.NewEOSAsset(10000), "")
		uuid, err := uuid.NewV4()
		if err != nil {
			log.Fatal(uuid)
		}
		nonceAction := system.NewNonce(uuid.String())

		fmt.Printf("Will transfer from account : [%s] to account : [%s]\n", eosioAccount, acctName)
		_, err = api.SignPushActions(newAcctAction, xferAction, nonceAction)
		if err != nil {
			log.Fatalln("ERROR pushing tx:", err)
		}

		accountNames = append(accountNames, AC(acctName))
	}

	l := len(accountNames)
	fromIndex, toIndex := 0, 1

	for {
		from := accountNames[fromIndex]
		to := accountNames[toIndex]

		fmt.Printf("Transfer 0.1 EOS from [%d %s] to [%d %s]\n", fromIndex, from, toIndex, to)

		uuid, err := uuid.NewV4()
		if err != nil {
			log.Fatal(err)
		}

		_, err = api.SignPushActions(
			token.NewTransfer(from, to, eos.NewEOSAsset(1000), ""),

			system.NewNonce(uuid.String()),
		)
		if err != nil {
			log.Fatalln("ERROR sending transfer:", err)
		}

		fromIndex++
		toIndex++

		if fromIndex >= l {
			fromIndex = 0
		}
		if toIndex >= l {
			toIndex = 0
		}
	}
}

repository: DeBankDeFi/eos-go

repo_name: DeBankDeFi/eos-go


text:
@InProceedings{goerg13a,
  pdf = {http://jmlr.org/proceedings/papers/v31/goerg13a.pdf},
  supplementary = {Supplementary:goerg13a-supp.pdf},
  title = {Mixed LICORS: A Nonparametric Algorithm for Predictive State Reconstruction},
  author = {Goerg, Georg and Shalizi, Cosma },
  pages = {289--297},
  abstract = {We introduce mixed LICORS, an algorithm for learning nonlinear, high-dimensional dynamics from spatio-temporal data, suitable for both prediction and simulation. Mixed LICORS extends the recent LICORS algorithm (Goerg and Shalizi, 2012) from hard clustering of predictive distributions to a non-parametric, EM-like soft clustering. This retains the asymptotic predictive optimality of LICORS, but, as we show in simulations, greatly improves out-of-sample forecasts with limited data. The new method is implemented in the publicly-available R package LICORS.},
}

repository: mreid/papersite

repo_name: mreid/papersite


text:
DESCRIPTION = "Poppler is a PDF rendering library based on the xpdf-3.0 code base."
MAINTAINER = "Koen Kooi <koen@dominion.kabel.utwente.nl>"
DEPENDS = "fontconfig jpeg gtk+ cairo"
LICENSE = "GPL"
PV = "0.5.1+cvs20060418"
PR = "r0"

SRC_URI = "cvs://anoncvs@cvs.freedesktop.org/cvs/poppler;module=poppler;date=${PV}"
S = "${WORKDIR}/poppler"

inherit autotools pkgconfig

EXTRA_OECONF = "--enable-xpdf-headers  --disable-gtk-test --disable-poppler-qt"

do_stage() {
	autotools_stage_all
}


text:
package main

import (
	"context"
	"time"

	"github.com/pkg/errors"
	"github.com/rs/zerolog/log"
	"github.com/threefoldtech/tfexplorer/client"
	"github.com/threefoldtech/zos/pkg"
	"github.com/threefoldtech/zos/pkg/network"
	"github.com/threefoldtech/zos/pkg/network/namespace"
	"github.com/threefoldtech/zos/pkg/network/types"
)

// ErrNoPubIface is the error returns by ReadPubIface when no public
// interface is configured
var ErrNoPubIface = errors.New("no public interface configured for this node")

func getPubIface(dir client.Directory, nodeID string) (*types.PubIface, error) {
	schemaNode, err := dir.NodeGet(nodeID, false)
	if err != nil {
		return nil, err
	}

	node := types.NewNodeFromSchema(schemaNode)
	if node.PublicConfig == nil {
		return nil, ErrNoPubIface
	}

	return node.PublicConfig, nil
}

func watchPubIface(ctx context.Context, nodeID pkg.Identifier, dir client.Directory, ifaceVersion int) <-chan *types.PubIface {
	var currentVersion = ifaceVersion

	ch := make(chan *types.PubIface)
	go func() {
		defer func() {
			close(ch)
		}()

		for {
			select {
			case <-time.After(time.Minute * 10):
			case <-ctx.Done():
				break
			}

			exitIface, err := getPubIface(dir, nodeID.Identity())
			if err != nil {
				if err == ErrNoPubIface {
					continue
				}
				log.Error().Err(err).Msg("failed to read public interface")
				continue
			}

			if exitIface.Version <= currentVersion {
				continue
			}
			log.Info().
				Int("current version", currentVersion).
				Int("received version", exitIface.Version).
				Msg("new version of the public interface configuration")
			currentVersion = exitIface.Version

			select {
			case ch <- exitIface:
			case <-ctx.Done():
				break
			}
		}
	}()
	return ch
}

func configurePubIface(iface *types.PubIface, nodeID pkg.Identifier) error {
	cleanup := func() error {
		pubNs, err := namespace.GetByName(types.PublicNamespace)
		if err != nil {
			log.Error().Err(err).Msg("failed to find public namespace")
			return err
		}
		if err = namespace.Delete(pubNs); err != nil {
			log.Error().Err(err).Msg("failed to delete public namespace")
			return err
		}
		return nil
	}

	if err := network.CreatePublicNS(iface, nodeID); err != nil {
		_ = cleanup()
		return errors.Wrap(err, "failed to configure public namespace")
	}

	return nil
}

repository: zaibon/zos

repo_name: zaibon/zos


text:
BROKEN = "1"
SECTION = "console/network"
DEPENDS = "expat openssl"
DESCRIPTION = "A high performance Unix-based HTTP server."
LICENSE="Apache-2.0"

SRC_URI = "http://ftp.epix.net/apache/httpd/httpd-${PV}.tar.gz \
           file://configure.patch;patch=1 \
           file://pcre-configure.patch;patch=1 \
           file://init \
	   file://httpd.conf"
S = "${WORKDIR}/httpd-${PV}"

basesysconfdir := "${sysconfdir}"
sysconfdir = "/etc/apache"

inherit autotools

FILES_${PN}="${bindir} ${sbindir} ${libexecdir} ${libdir}/lib*.so.* \
	     ${libdir}/*/ ${basesysconfdir} ${sharedstatedir} ${localstatedir} \
	     /bin /sbin /lib/*/ /lib/*.so* ${datadir}/${PN} ${datadir}/htdocs \
	     ${datadir}/icons ${datadir}/cgi-bin ${datadir}/error /var"

CFLAGS_append = " -DPATH_MAX=4096"
CFLAGS_prepend = "-I${STAGING_INCDIR}/openssl "
EXTRA_OECONF = "--enable-ssl --with-ssl=${STAGING_LIBDIR}/.. --enable-dav \
		--enable-dav-fs --with-dbm=sdbm --with-berkeley-db=no \
		--with-gdbm=no --with-ndbm=no"
do_configure () {
	(cd srclib/apr && ./buildconf)
	(cd srclib/apr-util && ./buildconf)

	cp srclib/apr/build/config.guess srclib/apr/build/config.sub \
	   srclib/apr/build/PrintPath srclib/apr/build/apr_common.m4 \
	   srclib/apr/build/find_apr.m4 $apu_src_dir/build/find_apu.m4 build

	(cd srclib/pcre && autoconf)

	aclocal -I build
	autoheader
	autoconf
	oe_runconf
}

do_compile () {
	touch srclib/apr-util/uri/gen_uri_delims.lo
	${BUILD_CC} srclib/apr-util/uri/gen_uri_delims.c -o srclib/apr-util/uri/gen_uri_delims
	touch srclib/pcre/dftables.lo
	${BUILD_CC} -I/usr/include/pcre srclib/pcre/dftables.c -o srclib/pcre/dftables
	cd server
	${BUILD_CC} -I${S}/srclib/apr/include -c gen_test_char.c && touch gen_test_char.lo
	${BUILD_CC} -I${S}/os/unix -I${S}/srclib/apr/include -I${S}/srclib/apr-util/include -I${S}/include -c util_debug.c && touch util_debug.lo
	${BUILD_CC} gen_test_char.o util_debug.o -o gen_test_char
	/bin/sh ${S}/srclib/apr/libtool --silent --mode=compile ${CC} -DPATH_MAX=4096 -I${S}/srclib/apr/include -prefer-non-pic -static -c gen_test_char.c && touch gen_test_char.lo
	/bin/sh ${S}/srclib/apr/libtool --silent --mode=compile ${CC} -DPATH_MAX=4096 -I${S}/os/unix -I${S}/srclib/apr/include -I${S}/srclib/apr-util/include -I${S}/include -prefer-non-pic -static -c util_debug.c && touch util_debug.lo
	touch gen_test_char
	cd ..
	oe_runmake
}

do_install_append () {
	set -x
	install -d ${D}${basesysconfdir}/init.d
	cat ${WORKDIR}/init | \
		sed -e 's,/usr/sbin/,${sbindir}/,g; \
			s,/usr/bin/,${bindir}/,g; \
			s,/usr/lib,${libdir}/,g; \
			s,/etc/apache/,${sysconfdir}/,g; \
			s,/etc/,${basesysconfdir}/,g; \
			s,/usr/,${prefix}/,g;' > ${D}${basesysconfdir}/init.d/httpd
	chmod 755 ${D}${basesysconfdir}/init.d/httpd
	install -m 0644 ${WORKDIR}/httpd.conf ${D}${sysconfdir}/httpd.conf
}

pkg_postinst () {
	if test -n "${D}"; then
		D="-r $D"
	fi
	update-rc.d $D httpd defaults 91 20
}

pkg_prerm () {
	if test -n "${D}"; then
		D="-r $D"
	fi
	update-rc.d $D httpd remove
}

repository: jdegges/gumstix-pip-oe

repo_name: jdegges/gumstix-pip-oe


text:
LICENSE = "GPLv2"
MAINTAINER = "Koen Kooi <koen@handhelds.org>"
HOMEPAGE = "http://lpg.ticalc.org/prj_tilp/index.html"

SRC_URI = "${SOURCEFORGE_MIRROR}/tilp/${P}.tar.gz"

inherit autotools pkgconfig

do_stage() {
autotools_stage_all
}