text:
SUMMARY = "Network Time Protocol daemon and utilities"
DESCRIPTION = "The Network Time Protocol (NTP) is used to \
synchronize the time of a computer client or server to \
another server or reference time source, such as a radio \
or satellite receiver or modem."
HOMEPAGE = "http://support.ntp.org"
SECTION = "net"
LICENSE = "NTP"
LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=f41fedb22dffefcbfafecc85b0f79cfa"

DEPENDS = "libevent libenv-perl libcap"
RDEPENDS_${PN} += "perl"

SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz"
SRC_URI[md5sum] = "4a8636260435b230636f053ffd070e34"
SRC_URI[sha256sum] = "2ab3d0b5f0456e6311dda1cc27ab75da108762773a19e46abd938bd9407b97ee"
inherit autotools pkgconfig

EXTRA_OECONF += "--with-net-snmp-config=no \
                 --without-ntpsnmpd \
                 --with-yielding_select=yes \
                 "

do_install_append () {
  rm -rf ${D}${sbindir} ${D}${libdir} ${D}${datadir}
}

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

repository: billyjbryant/ops-build

repo_name: billyjbryant/ops-build

gha_language: Python


text:
@article{Li-2017-A,
    title = "A Numerical Study of the June 2013 Flood-Producing Extreme Rainstorm over Southern Alberta",
    author = "Li, Yanping  and
      Szeto, Kit  and
      Stewart, Ronald E.  and
      Th{\'e}riault, Julie M.  and
      Chen, Liang  and
      Kochtubajda, Bohdan  and
      Liu, Anthony  and
      Boodoo, Sudesh  and
      Goodson, Ron  and
      Mooney, Curtis  and
      Kurkute, Sopan",
    journal = "Journal of Hydrometeorology, Volume 18, Issue 8",
    volume = "18",
    number = "8",
    year = "2017",
    publisher = "American Meteorological Society",
    url = "https://aclanthology.org/G17-24001",
    doi = "10.1175/jhm-d-15-0176.1",
    pages = "2057--2078",
}
@article{Li-Szeto-2017-A-Numerical,
    title = "A Numerical Study of the June 2013 Flood-Producing Extreme Rainstorm over Southern Alberta",
    author = "Li, Yanping  and
      Szeto, Kit  and
      Stewart, Ronald E.  and
      Th{\'e}riault, Julie M.  and
      Chen, Liang  and
      Kochtubajda, Bohdan  and
      Liu, Anthony  and
      Boodoo, Sudesh  and
      Goodson, Ron  and
      Mooney, Curtis  and
      Kurkute, Sopan",
    journal = "Journal of Hydrometeorology, Volume 18, Issue 8",
    volume = "18",
    number = "8",
    year = "2017",
    publisher = "American Meteorological Society",
    url = "https://aclanthology.org/G17-1001",
    doi = "10.1175/jhm-d-15-0176.1",
    pages = "2057--2078",
}

repository: gwf-uwaterloo/gwf-publications

license_type: permissive

repo_name: gwf-uwaterloo/gwf-publications

branch_name: refs/heads/main

extension: bib


text:
@InProceedings{stepleton09a,
  title = {The Block Diagonal Infinite Hidden Markov Model},
  author = {Thomas Stepleton and Zoubin Ghahramani and Geoffrey Gordon and Tai-Sing Lee},
  pages = {552--559},
  abstract = {The Infinite Hidden Markov Model (IHMM) extends hidden Markov models to have a countably infinite number of hidden states \cite{ihmm,hdp}. We present a generalization of this framework that introduces block-diagonal structure in the transitions between the hidden states. These blocks correspond to ``sub-behaviors'' exhibited by data sequences. In identifying such structure, the model classifies, or partitions, sequence data according to these sub-behaviors in an unsupervised way. We present an application of this model to artificial data, a video gesture classification task, and a musical theme labeling task, and show that components of the model can also be applied to graph segmentation.},
  pdf = {http://jmlr.org/proceedings/papers/v5/stepleton09a/stepleton09a.pdf},
}

license: MIT

repository: mreid/papersite

repo_name: mreid/papersite

branch_name: refs/heads/master

gha_license_id: MIT

gha_language: TeX


text:
DESCRIPTION = "A Simple Scull Driver Example"
SECTION = "drivers"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

inherit module

SRC_URI = "file://scullp.c \
	file://scull.h \
	file://Makefile \
"

S = "${WORKDIR}"

repository: kiranuggina/meta-mycustom

repo_name: kiranuggina/meta-mycustom

extension: bb


text:
#
# Base recipe: meta/recipes-graphics/xorg-lib/libxinerama_1.1.3.bb
# Base branch: daisy
#

require xorg-lib-common.inc

SUMMARY = "Xinerama: Xinerama extension library"

DESCRIPTION = "Xinerama is a simple library designed to interface the \
Xinerama Extension for retrieving information about physical output \
devices which may be combined into a single logical X screen."

PR = "${INC_PR}.0"

LICENSE = "MIT"
LIC_FILES_CHKSUM = " \
file://COPYING;md5=6f4f634d1643a2e638bba3fcd19c2536 \
file://src/Xinerama.c;beginline=2;endline=25;md5=fcef273bfb66339256411dd06ea79c02"

DEPENDS += "libxext xineramaproto"
PROVIDES = "xinerama"

# There is no debian patch
DEBIAN_PATCH_TYPE = "nopatch"

# Correct the package name follow Debian
DEBIANNAME_${PN} = "${PN}1"
DEBIANNAME_${PN}-dbg = "${PN}1-dbg"

repository: nghiaht-tsdv/meta-debian

repo_name: nghiaht-tsdv/meta-debian

branch_name: refs/heads/jethro

gha_language: BitBake


text:
package server

import (
	"fmt"
	"io"
	"net"
	"sync"
	"sync/atomic"
	"time"

	"github.com/bio-routing/bio-rd/protocols/bgp/metrics"
	bmppkt "github.com/bio-routing/bio-rd/protocols/bmp/packet"
	"github.com/bio-routing/bio-rd/routingtable"
	"github.com/bio-routing/bio-rd/util/log"
	"github.com/bio-routing/tflow2/convert"
)

const (
	defaultBufferLen = 4096
)

type BMPReceiverInterface interface {
	GetRouter(rtr string) RouterInterface
	GetRouters() []RouterInterface
}

// BMPReceiver represents a BMP receiver
type BMPReceiver struct {
	routers          map[string]*Router
	routersMu        sync.RWMutex
	ribClients       map[string]map[afiClient]struct{}
	keepalivePeriod  time.Duration
	metrics          *bmpMetricsService
	listener         net.Listener
	adjRIBInFactory  adjRIBInFactoryI
	acceptAny        bool
	ignorePeerASNs   []uint32
	ignorePrePolicy  bool
	ignorePostPolicy bool
}

type BMPReceiverConfig struct {
	KeepalivePeriod  time.Duration
	AcceptAny        bool
	IgnorePeerASNs   []uint32
	IgnorePrePolicy  bool
	IgnorePostPolicy bool
}

type afiClient struct {
	afi    uint8
	client routingtable.RouteTableClient
}

// NewBMPReceiver creates a new BMP receiver
func NewBMPReceiver(cfg BMPReceiverConfig) *BMPReceiver {
	b := &BMPReceiver{
		routers:          make(map[string]*Router),
		ribClients:       make(map[string]map[afiClient]struct{}),
		keepalivePeriod:  cfg.KeepalivePeriod,
		adjRIBInFactory:  adjRIBInFactory{},
		acceptAny:        cfg.AcceptAny,
		ignorePeerASNs:   cfg.IgnorePeerASNs,
		ignorePrePolicy:  cfg.IgnorePrePolicy,
		ignorePostPolicy: cfg.IgnorePostPolicy,
	}

	b.metrics = &bmpMetricsService{b}
	return b
}

func NewBMPReceiverWithAdjRIBInFactory(cfg BMPReceiverConfig, adjRIBInFactory adjRIBInFactoryI) *BMPReceiver {
	b := NewBMPReceiver(cfg)
	b.adjRIBInFactory = adjRIBInFactory

	return b
}

// Listen starts a listener for routers to start the BMP connection
// the listener needs to be closed by calling Close() on the BMPReceiver
func (b *BMPReceiver) Listen(addr string) error {
	tcp, err := net.ResolveTCPAddr("tcp", addr)
	if err != nil {
		log.WithError(err).WithFields(log.Fields{
			"component": "bmp_receiver",
			"address":   addr,
		}).Info("Unable to resolve address")
		return err
	}
	l, err := net.ListenTCP("tcp", tcp)
	if err != nil {
		log.WithError(err).WithFields(log.Fields{
			"component": "bmp_receiver",
			"address":   addr,
		}).Infof("Unable to listen on %s", tcp.String())
		return err
	}
	b.listener = l
	return nil
}

// Serve accepts all incoming connections for the BMP receiver until Close() is called.
func (b *BMPReceiver) Serve() error {
	l := b.listener
	for {
		c, err := l.Accept()
		if err != nil {
			log.WithError(err).WithFields(log.Fields{
				"component": "bmp_receiver",
				"address":   b.LocalAddr(),
			}).Infof("Unable to accept on %s", b.LocalAddr())
			return err
		}

		// Do we know this router from configuration or have seen it before?
		remoteAddr := c.RemoteAddr().(*net.TCPAddr).IP.String()
		r := b.getRouter(remoteAddr)
		dynamic := false
		if r == nil {
			// If we don't know this router and don't accept connection from anyone, we drop it
			if !b.acceptAny {
				log.Infof("Drop connection from %v, not in routers and acceptAny disabled", remoteAddr)
				c.Close()
				continue
			}

			dynamic = true
			tcpRemoteAddr := c.RemoteAddr().(*net.TCPAddr)
			localPort := uint16(b.LocalAddr().(*net.TCPAddr).Port)
			err := b.AddRouter(tcpRemoteAddr.IP, localPort, true, dynamic)
			if err != nil {
				log.Errorf("failed to add router: %v", err)
				c.Close()
				continue
			}

			r = b.getRouter(tcpRemoteAddr.IP.String())
			// Potentially we could have already removed this router if it were connecting twice and did not offer an init message
			if r == nil {
				log.Infof("Drop connection from %v, not in routers", remoteAddr)
				c.Close()
				continue
			}
		}

		if b.validateConnection(r, c) {
			go b.handleConnection(c, r, true, dynamic)
		}
	}
}

// LocalAddr returns the local address the receiver is listening to.
func (b *BMPReceiver) LocalAddr() net.Addr {
	if b.listener != nil {
		return b.listener.Addr()
	}
	return nil
}

func (b *BMPReceiver) validateConnection(r *Router, c net.Conn) bool {
	if !r.passive {
		log.WithFields(log.Fields{
			"component":      "bmp_receiver",
			"remote_address": c.RemoteAddr(),
		}).Error("dropping unconfigured connection")
		c.Close()
		return false
	}

	if atomic.LoadUint32(&r.established) == 1 {
		log.WithFields(log.Fields{
			"component":      "bmp_receiver",
			"remote_address": c.RemoteAddr(),
			"router":         r.Name(),
		}).Error("router already connected, dropping connection")
		c.Close()
		return false
	}

	return true
}

func (b *BMPReceiver) handleConnection(c net.Conn, r *Router, passive bool, dynamic bool) error {
	if b.keepalivePeriod != 0 {
		if err := c.(*net.TCPConn).SetKeepAlive(true); err != nil {
			log.WithError(err).Error("Unable to enable keepalive")
			return err
		}
		if err := c.(*net.TCPConn).SetKeepAlivePeriod(b.keepalivePeriod); err != nil {
			log.WithError(err).Error("Unable to set keepalive period")
			return err
		}
	}

	log.WithFields(log.Fields{
		"component": "bmp_receiver",
		"address":   c.RemoteAddr().String(),
		"passive":   passive,
	}).Info("Connected")

	atomic.StoreUint32(&r.established, 1)
	err := r.serve(c)
	atomic.StoreUint32(&r.established, 0)

	if err != nil {
		if dynamic && r.counters.initiationMessages == 0 {
			defer b.RemoveRouter(r.address)

			log.WithFields(log.Fields{
				"component": "bmp_receiver",
				"address":   c.RemoteAddr().String(),
				"router":    r.Name(),
				"passive":   passive,
			}).WithError(err).Info("r.serve() failed for dynamic peer")
			return err

		} else {
			log.WithFields(log.Fields{
				"component": "bmp_receiver",
				"address":   c.RemoteAddr().String(),
				"router":    r.Name(),
				"passive":   passive,
			}).WithError(err).Error("r.serve() failed")
		}
		return err
	}

	return nil
}

func conString(host string, port uint16) string {
	return fmt.Sprintf("%s:%d", host, port)
}

// AddRouter adds a router to which we connect with BMP
func (b *BMPReceiver) AddRouter(addr net.IP, port uint16, passive bool, dynamic bool) error {
	b.routersMu.Lock()
	defer b.routersMu.Unlock()

	return b._addRouter(addr, port, passive, dynamic)
}

func (b *BMPReceiver) _addRouter(addr net.IP, port uint16, passive bool, dynamic bool) error {
	rCfg := RouterConfig{
		Passive:          passive,
		IgnorePeerASNs:   b.ignorePeerASNs,
		IgnorePrePolicy:  b.ignorePrePolicy,
		IgnorePostPolicy: b.ignorePostPolicy,
	}
	r := newRouter(addr, port, b.adjRIBInFactory, rCfg)
	if _, exists := b.routers[r.address.String()]; exists {
		return fmt.Errorf("router %s already configured,", r.address.String())
	}

	b.routers[r.address.String()] = r

	if r.passive {
		// router initializes the connection
		return nil
	}

	go func(r *Router) {
		for {
			select {
			case <-r.stop:
				log.WithFields(log.Fields{
					"component": "bmp_receiver",
					"address":   conString(r.address.String(), r.port),
				}).Info("Stop event: Stopping reconnect routine")
				return
			case <-r.reconnectTimer.C:
				log.WithFields(log.Fields{
					"component": "bmp_receiver",
					"address":   conString(r.address.String(), r.port),
				}).Info("Reconnect timer expired: Establishing connection")
			}

			c, err := net.DialTimeout("tcp", fmt.Sprintf("%s:%d", r.address.String(), r.port), r.dialTimeout)
			if err != nil {
				log.WithError(err).WithFields(log.Fields{
					"component": "bmp_receiver",
					"address":   conString(r.address.String(), r.port),
				}).Info("Unable to connect to BMP router")
				if r.reconnectTime == 0 {
					r.reconnectTime = r.reconnectTimeMin
				} else if r.reconnectTime < r.reconnectTimeMax {
					r.reconnectTime *= 2
				}
				r.reconnectTimer = time.NewTimer(time.Second * time.Duration(r.reconnectTime))
				continue
			}

			r.reconnectTime = r.reconnectTimeMin
			r.reconnectTimer = time.NewTimer(time.Second * time.Duration(r.reconnectTime))

			b.handleConnection(c, r, false, dynamic)
		}
	}(r)

	return nil
}

func (b *BMPReceiver) deleteRouter(addr net.IP) {
	b.routersMu.Lock()
	defer b.routersMu.Unlock()

	delete(b.routers, addr.String())
}

// RemoveRouter removes a BMP monitored router
func (b *BMPReceiver) RemoveRouter(addr net.IP) {
	id := addr.String()
	r := b.routers[id]
	close(r.stop)

	b.deleteRouter(addr)
}

func (b *BMPReceiver) getRouters() []*Router {
	b.routersMu.RLock()
	defer b.routersMu.RUnlock()

	ret := make([]*Router, 0, len(b.routers))
	for r := range b.routers {
		ret = append(ret, b.routers[r])
	}

	return ret
}

func (b *BMPReceiver) getRouter(name string) *Router {
	b.routersMu.RLock()
	defer b.routersMu.RUnlock()

	if _, ok := b.routers[name]; ok {
		return b.routers[name]
	}

	return nil
}

func recvBMPMsg(c net.Conn) (msg []byte, err error) {
	buffer := make([]byte, defaultBufferLen)
	_, err = io.ReadFull(c, buffer[0:bmppkt.MinLen])
	if err != nil {
		return nil, fmt.Errorf("Read failed: %w", err)
	}

	l := convert.Uint32b(buffer[1:5])
	if l > defaultBufferLen {
		tmp := buffer
		buffer = make([]byte, l)
		copy(buffer, tmp)
	}

	toRead := l
	_, err = io.ReadFull(c, buffer[bmppkt.MinLen:toRead])
	if err != nil {
		return nil, fmt.Errorf("Read failed: %w", err)
	}

	return buffer[0:toRead], nil
}

// GetRouters gets all routers
func (b *BMPReceiver) GetRouters() []RouterInterface {
	b.routersMu.RLock()
	defer b.routersMu.RUnlock()

	r := make([]RouterInterface, 0, len(b.routers))
	for name := range b.routers {
		r = append(r, b.routers[name])
	}

	return r
}

// GetRouter gets a router
func (b *BMPReceiver) GetRouter(name string) RouterInterface {
	if r := b.getRouter(name); r != nil {
		return r
	}
	return nil
}

// Metrics gets BMP receiver metrics
func (b *BMPReceiver) Metrics() (*metrics.BMPMetrics, error) {
	if b.metrics == nil {
		return nil, fmt.Errorf("BMP receiver not started yet")
	}

	return b.metrics.metrics(), nil
}

// Close tears down all open connections
func (b *BMPReceiver) Close() error {
	return b.listener.Close()
}

repository: bio-routing/bio-rd

repo_name: bio-routing/bio-rd

gha_language: Go

extension: go


text:
@InProceedings{Tallon2015,
  Title                    = {{Coexistence Through Adaptive Sensing and Markov Chains}},
  Author                   = {Tallon, Justin  and Bluemm, Christian and Puschmann, Andr\'e and Paisana, Francisco and van de Belt, Jonathan and Di Francesco, Paolo and Kaminski, Nicholas J. and Ahmadi, Hamed},
  Booktitle                = {IEEE International Symposium on New Frontiers in Dynamic Spectrum Access Networks (DySPAN)},
  Year                     = {2015},
  Month                    = sep,
  Pages                    = {12--13},
}

repository: andrepuschmann/academic-kickstart

repo_name: andrepuschmann/academic-kickstart


text:
DESCRIPTION = "Python Paho - MQTT client"
SECTION = "devel/python"
LICENSE = "EPL-1.0 | EDL-1.0"
LIC_FILES_CHKSUM = " \
       file://epl-v10;md5=8d383c379e91d20ba18a52c3e7d3a979 \
       file://edl-v10;md5=c09f121939f063aeb5235972be8c722c \
       "

SRCREV = "22ae9b9bbe98e30c19fbd59f618d78e5bb3267e9"
SRC_URI = "git://git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.python.git;branch=${PV}"

SRC_URI[md5sum] = "c270eb5551a02e8ab7a4cbb83e22af"
SRC_URI[sha256sum] = "7b7735efd3b1e2323dc9fcef06080d05f5f18bd0f247f5e9e74a628279de66"

S = "${WORKDIR}/git"

inherit setuptools

repository: BeeeOn/meta-beeeon

repo_name: BeeeOn/meta-beeeon


text:
package middleware

import (
	"net/http"
)

type Middlewares func(http.HandlerFunc) http.HandlerFunc

//Chain function takes in multiple middleware functions,
//and combines them, to prevent spaghetti code
func Chain(h http.HandlerFunc, m ...Middlewares) http.HandlerFunc {
	if len(m) < 1 {
		return h
	}
	wrapped := h
	for i := len(m) - 1; i >= 0; i-- {
		wrapped = m[i](wrapped)
	}
	return wrapped
}

//getUserIPAddress : find user IP address from the request
func getUserIPAddress(r *http.Request) string {
	IPAddress := r.Header.Get("X-Real-Ip")
	if IPAddress == "" {
		IPAddress = r.Header.Get("X-Forwarded-For")
	}
	if IPAddress == "" {
		IPAddress = r.RemoteAddr
	}
	return IPAddress
}

repository: sarmai/forum

repo_name: sarmai/forum


text:
# generated from genmsg/cmake/pkg-msg-paths.cmake.em

# message include dirs in develspace
set(quad_MSG_INCLUDE_DIRS "")
set(quad_MSG_DEPENDENCIES std_msgs;geometry_msgs;kobuki_msgs;hector_uav_msgs;nav_msgs;sensor_msgs;gazebo_msgs;tf)

repository: rafafigueroa/cws

repo_name: rafafigueroa/cws

extension: cmake