text:
package streetsweeping_test

import (
	"log"

	. "github.com/ouidevelop/dontfearthesweeper/streetsweeping"

	"time"

	"bytes"
	"net/http"
	"net/http/httptest"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Main", func() {
	Describe("application", func() {
		It("should alert people who's alert is past due", func() {
			err := DB.Ping()
			Expect(err).NotTo(HaveOccurred())

			jsonAlert := []byte(`{"timezone":"America/New_York","times":[{"weekday":0,"nthWeek":1}],"phoneNumber":"1234567890","token":""}`)

			clearDB()
			defer clearDB()

			req := httptest.NewRequest("POST", "/verification/verify", bytes.NewReader(jsonAlert))
			res := httptest.NewRecorder()
			MockEnv.VerificationVerifyHandler(res, req)
			Expect(res.Code).To(Equal(http.StatusOK))

			var nextCall int64
			err = DB.QueryRow("select NEXT_CALL from alerts").Scan(&nextCall)
			Expect(err).NotTo(HaveOccurred())
			Expect(nextCall).To(Equal(int64(1494111600))) //2017-05-06 19:00:00 -0400 EDT

			// 1 second after the next call of the alert
			done := MockNow(time.Unix(1494111601, 0))
			defer done()

			FindReadyAlerts(MockEnv.MsgSvc)
			expected := &MockMessageService{
				from: "5102414070",
				to:   "1234567890",
				body: "Don't forget about street sweeping tomorrow! (to stop getting these reminders, please email mjkurrels@gmail.com)",
			}
			Expect(MockEnv.MsgSvc).To(Equal(expected))
		})
	})

	Describe("CalculateNextCall", func() {
		It("should calculate the next date to send an alert", func() {
			location, err := time.LoadLocation("America/Los_Angeles")
			Now = func() time.Time {
				return time.Date(2017, 7, 31, 19, 1, 1, 0, location)
			}
			Expect(err).NotTo(HaveOccurred())

			weekday := 2
			nthWeek := 1
			timezone := "America/Los_Angeles"

			log.Println("hi:", Now())
			nextAlertTime, err := CalculateNextCall(nthWeek, weekday, timezone)
			Expect(err).NotTo(HaveOccurred())
			Expect(nextAlertTime).To(Equal(int64(1504576800))) //2017-09-04 19:00:00 -0700

			// change the weekday to friday to make sure that the function determines that the next alert is this month
			weekday = 5

			nextAlertTime, err = CalculateNextCall(nthWeek, weekday, timezone)
			log.Println("time: ", time.Unix(nextAlertTime, 0).In(location))
			Expect(err).NotTo(HaveOccurred())
			Expect(nextAlertTime).To(Equal(int64(1501812000))) //2017-08-03 19:00:00 -0700 PDT
		})
	})
})

func clearDB() {
	_, err := DB.Exec("Truncate table alerts")
	Expect(err).NotTo(HaveOccurred())
}

repository: ouidevelop/text-message-directions

repo_name: ouidevelop/text-message-directions


text:
DESCRIPTION = "Privoxy is a web proxy with advanced filtering capabilities for protecting \
               privacy, modifying web page content, managing cookies, controlling access, and \
               removing ads, banners, pop-ups and other obnoxious Internet junk."
SECTION = "console/network"
PRIORITY = "optional"
LICENSE = "GPL"
DEPENDS = "pcre"
PR = "r0"

SRC_URI = "${SOURCEFORGE_MIRROR}/ijbswa/privoxy-${PV}-stable-src.tar.gz \
          file://privoxy.conf \
          file://privoxy.init"

S = "${WORKDIR}/privoxy-${PV}-stable"

inherit autotools update-rc.d

LDFLAGS += "-L${STAGING_LIBDIR}"
CFLAGS += "-L${STAGING_LIBDIR} -I${STAGING_INCDIR}"

INITSCRIPT_NAME = "privoxy"

do_compile() {
        autoheader && autoconf && ./configure --host=localhost --disable-pthread
        oe_runmake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
}

do_install() {
        mkdir -p ${D}/${sbindir}
        install -m 0755 ${S}/privoxy ${D}/${sbindir}

        # Documentation
        mkdir -p ${D}/${docdir}
        install -m 0755 -d ${S}/doc ${D}/${docdir}

        # Install man page
        mkdir -p ${D}/${mandir}
        install -m 0755 ${S}/privoxy.1 ${D}/${mandir}
}

do_install_append() {
        # Install config files
        install -d ${D}${sysconfdir}/privoxy/templates
        install ${WORKDIR}/privoxy.conf ${D}${sysconfdir}/privoxy/config
        install ${S}/templates/* ${D}${sysconfdir}/privoxy/templates/
        install ${S}/default.action ${D}${sysconfdir}/privoxy/
        install ${S}/default.filter ${D}${sysconfdir}/privoxy/
        install ${S}/standard.action ${D}${sysconfdir}/privoxy/
        install ${S}/trust ${D}${sysconfdir}/privoxy/
        install ${S}/user.action ${D}${sysconfdir}/privoxy/

        # Install init script
        install -d ${D}${sysconfdir}/init.d
        install ${WORKDIR}/privoxy.init ${D}${sysconfdir}/init.d/privoxy
}

# Add user and groups
pkg_postinst() {
        grep -q privoxy: /etc/group || addgroup privoxy
        grep -q privoxy: /etc/passwd || adduser --disabled-password --home=/etc/privoxy \
                                               --ingroup privoxy -g "Privoxy" privoxy
}

SRC_URI[md5sum] = "b0710be8af09409bfb03f52523a17010"
SRC_URI[sha256sum] = "4dab0049049c1ae6cfb00faea606d981535d0f0a65aab17e3179cc3d75de9f84"

license: MIT

repository: overo/overo-oe-natty

license_type: permissive

repo_name: overo/overo-oe-natty

branch_name: HEAD

extension: bb


text:
DESCRIPTION = "Madplay is a command-line MPEG audio decoder and player"
SECTION = "console/multimedia"
DEPENDS = "libmad"
LICENSE = "GPL"
AUTHOR = "Robert Leslie <rob@mars.org>"
HOMEPAGE = "http://www.mars.org/home/rob/proj/mpeg/"

SRC_URI = "ftp://ftp.mars.org/pub/mpeg/${PN}-${PV}.tar.gz"

inherit autotools
ARM_INSTRUCTION_SET = "arm"

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

SRC_URI[md5sum] = "6814b47ceaa99880c754c5195aa1aac1"
SRC_URI[sha256sum] = "5a79c7516ff7560dffc6a14399a389432bc619c905b13d3b73da22fa65acede0"


text:
require ${BPN}.inc

SRCREV = "${EFL_SRCREV}"
PV = "1.7.4+svnr${SRCPV}"
PR = "${INC_PR}.0"
DEFAULT_PREFERENCE = "-1"

SRCNAME_append = "-1.7"

SRC_URI = "\
    ${E_SVN}/branches;module=${SRCNAME};protocol=http;scmdata=keep \
"
S = "${WORKDIR}/${SRCNAME}"

repository: ExorEmbedded/exor-workspace

repo_name: ExorEmbedded/exor-workspace

gha_language: Python


text:
@inproceedings{combemale:hal-02285737,
 address = {Munich, Germany},
 author = {Combemale, Benoit},
 booktitle = {MDE4IoT 2019 - 3nd International Workshop on Model-Driven Engineering for the Internet-of-Things},
 hal_id = {hal-02285737},
 hal_version = {v1},
 month = {September},
 pages = {1-2},
 pdf = {https://hal.inria.fr/hal-02285737/file/MDE4IoT19.pdf},
 title = {Bringing Intelligence to Sociotechnical IoT Systems: Modeling Opportunities and Challenges},
 url = {https://hal.inria.fr/hal-02285737},
 year = {2019}
}

branch_name: refs/heads/master

gha_license_id: MIT

gha_language: TeX

extension: bib


text:
@CONTROL{REVTEX41Control}
@CONTROL{apsrev41Control,author="08",editor="1",pages="0",title="",year="1"}

repository: ulises-jeremias/informatica-unlp

repo_name: ulises-jeremias/informatica-unlp


text:
// Go Substrate RPC Client (GSRPC) provides APIs and types around Polkadot and any Substrate-based chain RPC calls
//
// Copyright 2019 Centrifuge GmbH
//
// 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 types

import "github.com/centrifuge/go-substrate-rpc-client/v4/scale"

// OptionH160 is a structure that can store a H160 or a missing value
type OptionH160 struct {
	option
	value H160
}

// NewOptionH160 creates an OptionH160 with a value
func NewOptionH160(value H160) OptionH160 {
	return OptionH160{option{true}, value}
}

// NewOptionH160Empty creates an OptionH160 without a value
func NewOptionH160Empty() OptionH160 {
	return OptionH160{option: option{false}}
}

func (o OptionH160) Encode(encoder scale.Encoder) error {
	return encoder.EncodeOption(o.hasValue, o.value)
}

func (o *OptionH160) Decode(decoder scale.Decoder) error {
	return decoder.DecodeOption(&o.hasValue, &o.value)
}

// SetSome sets a value
func (o *OptionH160) SetSome(value H160) {
	o.hasValue = true
	o.value = value
}

// SetNone removes a value and marks it as missing
func (o *OptionH160) SetNone() {
	o.hasValue = false
	o.value = H160{}
}

// Unwrap returns a flag that indicates whether a value is present and the stored value
func (o OptionH160) Unwrap() (ok bool, value H160) {
	return o.hasValue, o.value
}

// OptionH256 is a structure that can store a H256 or a missing value
type OptionH256 struct {
	option
	value H256
}

// NewOptionH256 creates an OptionH256 with a value
func NewOptionH256(value H256) OptionH256 {
	return OptionH256{option{true}, value}
}

// NewOptionH256Empty creates an OptionH256 without a value
func NewOptionH256Empty() OptionH256 {
	return OptionH256{option: option{false}}
}

func (o OptionH256) Encode(encoder scale.Encoder) error {
	return encoder.EncodeOption(o.hasValue, o.value)
}

func (o *OptionH256) Decode(decoder scale.Decoder) error {
	return decoder.DecodeOption(&o.hasValue, &o.value)
}

// SetSome sets a value
func (o *OptionH256) SetSome(value H256) {
	o.hasValue = true
	o.value = value
}

// SetNone removes a value and marks it as missing
func (o *OptionH256) SetNone() {
	o.hasValue = false
	o.value = H256{}
}

// Unwrap returns a flag that indicates whether a value is present and the stored value
func (o OptionH256) Unwrap() (ok bool, value H256) {
	return o.hasValue, o.value
}

// OptionH512 is a structure that can store a H512 or a missing value
type OptionH512 struct {
	option
	value H512
}

// NewOptionH512 creates an OptionH512 with a value
func NewOptionH512(value H512) OptionH512 {
	return OptionH512{option{true}, value}
}

// NewOptionH512Empty creates an OptionH512 without a value
func NewOptionH512Empty() OptionH512 {
	return OptionH512{option: option{false}}
}

func (o OptionH512) Encode(encoder scale.Encoder) error {
	return encoder.EncodeOption(o.hasValue, o.value)
}

func (o *OptionH512) Decode(decoder scale.Decoder) error {
	return decoder.DecodeOption(&o.hasValue, &o.value)
}

// SetSome sets a value
func (o *OptionH512) SetSome(value H512) {
	o.hasValue = true
	o.value = value
}

// SetNone removes a value and marks it as missing
func (o *OptionH512) SetNone() {
	o.hasValue = false
	o.value = H512{}
}

// Unwrap returns a flag that indicates whether a value is present and the stored value
func (o OptionH512) Unwrap() (ok bool, value H512) {
	return o.hasValue, o.value
}

// OptionHash is a structure that can store a Hash or a missing value
type OptionHash struct {
	option
	value Hash
}

// NewOptionHash creates an OptionHash with a value
func NewOptionHash(value Hash) OptionHash {
	return OptionHash{option{true}, value}
}

// NewOptionHashEmpty creates an OptionHash without a value
func NewOptionHashEmpty() OptionHash {
	return OptionHash{option: option{false}}
}

func (o OptionHash) Encode(encoder scale.Encoder) error {
	return encoder.EncodeOption(o.hasValue, o.value)
}

func (o *OptionHash) Decode(decoder scale.Decoder) error {
	return decoder.DecodeOption(&o.hasValue, &o.value)
}

// SetSome sets a value
func (o *OptionHash) SetSome(value Hash) {
	o.hasValue = true
	o.value = value
}

// SetNone removes a value and marks it as missing
func (o *OptionHash) SetNone() {
	o.hasValue = false
	o.value = Hash{}
}

// Unwrap returns a flag that indicates whether a value is present and the stored value
func (o OptionHash) Unwrap() (ok bool, value Hash) {
	return o.hasValue, o.value
}

repository: centrifuge/go-substrate-rpc-client

repo_name: centrifuge/go-substrate-rpc-client

gha_language: Go

extension: go


text:
DESCRIPTION = "OMX Media Components R-Car Gen3"
LICENSE = "CLOSED"
require include/omx-control.inc
require include/rcar-gen3-modules-common.inc

COMPATIBLE_MACHINE = "(salvator-x|ulcb|ebisu)"

DEPENDS = " \
    kernel-module-mmngr mmngr-user-module \
    vspmif-user-module kernel-module-vspmif \
    kernel-module-vspm kernel-module-vsp2driver \
"

# Task Control. Compile is not performed when not installing OMX Video and Audio Libs.
# Note) dummy-omx-user-module.inc does not exist.
INCLUDE_FILE = '${@oe.utils.conditional("USE_OMX_COMMON", "1", "dummy", "deltask", d )}'
include ${INCLUDE_FILE}-omx-user-module.inc

DEPENDS += '${@oe.utils.conditional("USE_VIDEO_OMX", "1", "kernel-module-uvcs-drv", "", d )}'

inherit autotools

includedir = "${RENESAS_DATADIR}/include"
CFLAGS += " -I${STAGING_DIR_HOST}${RENESAS_DATADIR}/include"
PACKAGE_ARCH = "${MACHINE_ARCH}"

# SRC file name
SRC_URI_OMX = '${@oe.utils.conditional("USE_OMX_COMMON", "1", "file://RTM8RC0000ZMX0LQ00JPL3E.tar.bz2;unpack=0", "", d )}'
SRC_URI_VCMND = '${@oe.utils.conditional("USE_VIDEO_DEC", "1", "file://RTM8RC0000ZMD0LQ00JPL3E.tar.bz2;unpack=0", "", d )}'
SRC_URI_VCMNE = '${@oe.utils.conditional("USE_VIDEO_ENC", "1", "file://RTM8RC0000ZME0LQ00JPL3E.tar.bz2;unpack=0", "", d )}'
SRC_URI_H264D = '${@oe.utils.conditional("USE_H264D_OMX", "1", "file://RTM8RC0000ZMD1LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_H264E = '${@oe.utils.conditional("USE_H264E_OMX", "1", "file://RTM8RC0000ZME1LQ00JPL3E.tar.bz2", "", d )}'

SRC_URI_H263D = '${@oe.utils.conditional("USE_H263D_OMX", "1", "file://RTM8RC0000ZMD4LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_H265D = '${@oe.utils.conditional("USE_H265D_OMX", "1", "file://RTM8RC0000ZMDALQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_MPEG2D = '${@oe.utils.conditional("USE_MPEG2D_OMX", "1", "file://RTM8RC0000ZMD5LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_MPEG4D = '${@oe.utils.conditional("USE_MPEG4D_OMX", "1", "file://RTM8RC0000ZMD2LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_VC1D = '${@oe.utils.conditional("USE_VC1D_OMX", "1", "file://RTM8RC0000ZMD3LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_DIVXD = '${@oe.utils.conditional("USE_DIVXD_OMX", "1", "file://RTM8RC0000ZMD7LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_RVD = '${@oe.utils.conditional("USE_RVD_OMX", "1", "file://RTM8RC0000ZMD6LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_VP8D = '${@oe.utils.conditional("USE_VP8D_OMX", "1", "file://RTM8RC0000ZMD8LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_VP8E = '${@oe.utils.conditional("USE_VP8E_OMX", "1", "file://RTM8RC0000ZME8LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_VP9D = '${@oe.utils.conditional("USE_VP9D_OMX", "1", "file://RTM8RC0000ZMD9LQ00JPL3E.tar.bz2", "", d )}'
SRC_URI_ACMND = '${@oe.utils.conditional("USE_AUDIO_OMX", "1", "file://RTM8RC0000ZNX0LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_AACLC = '${@oe.utils.conditional("USE_AACLCD_OMX", "1", "file://RTM8RC0000ZND1LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_AACPV2 = '${@oe.utils.conditional("USE_AACPV2D_OMX", "1", "file://RTM8RC0000ZND2LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_MP3 = '${@oe.utils.conditional("USE_MP3D_OMX", "1", "file://RTM8RC0000ZND3LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_AACLCE = '${@oe.utils.conditional("USE_AACLCE_OMX", "1", "file://RTM8RC0000ZNE1LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_WMA = '${@oe.utils.conditional("USE_WMAD_OMX", "1", "file://RTM8RC0000ZND4LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_ALACD = '${@oe.utils.conditional("USE_ALACD_OMX", "1", "file://RTM8RC0000ZND7LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_FLACD = '${@oe.utils.conditional("USE_FLACD_OMX", "1", "file://RTM8RC0000ZND6LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_DDD = '${@oe.utils.conditional("USE_DDD_OMX", "1", "file://RTM0AC0000XADD5D30SL41C.tar.gz", "", d )}'
SRC_URI_AACMZ = '${@oe.utils.conditional("USE_AACLC_MDW", "1", "file://RTM8RC0000ZAD1LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_AACPV2MZ = '${@oe.utils.conditional("USE_AACPV2_MDW", "1", "file://RTM8RC0000ZAD2LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_MP3MZ = '${@oe.utils.conditional("USE_MP3_MDW", "1", "file://RTM8RC0000ZAD3LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_WMAMZ = '${@oe.utils.conditional("USE_WMA_MDW", "1", "file://RTM8RC0000ZAD4LQ00JPL3E.tar.gz", "", d )}'
SRC_URI_DDMZ = '${@oe.utils.conditional("USE_DD_MDW", "1", "file://RTM0AC0000ADDD5MZ1SL41C.tar.gz", "", d )}'
SRC_URI_AEAACMZ = '${@oe.utils.conditional("USE_AACLCE_MDW", "1", "file://RTM8RC0000ZAE1LQ00JPL3E.tar.gz", "", d )}'

SRC_URI = " \
    ${SRC_URI_OMX} \
    ${SRC_URI_VCMND} \
    ${SRC_URI_VCMNE} \
    ${SRC_URI_H263D} \
    ${SRC_URI_H264D} \
    ${SRC_URI_H264E} \
    ${SRC_URI_H265D} \
    ${SRC_URI_MPEG2D} \
    ${SRC_URI_MPEG4D} \
    ${SRC_URI_VC1D} \
    ${SRC_URI_DIVXD} \
    ${SRC_URI_RVD} \
    ${SRC_URI_ACMND} \
    ${SRC_URI_AACLC} \
    ${SRC_URI_AACPV2} \
    ${SRC_URI_MP3} \
    ${SRC_URI_WMA} \
    ${SRC_URI_ALACD} \
    ${SRC_URI_FLACD} \
    ${SRC_URI_DDD} \
    ${SRC_URI_AACLCE} \
    ${SRC_URI_AACMZ} \
    ${SRC_URI_AACPV2MZ} \
    ${SRC_URI_MP3MZ} \
    ${SRC_URI_WMAMZ} \
    ${SRC_URI_DDMZ} \
    ${SRC_URI_AEAACMZ} \
    ${SRC_URI_VP8D} \
    ${SRC_URI_VP8E} \
    ${SRC_URI_VP9D} \
"

# SRC directory name
OMX_COMMON_SRC = '${@oe.utils.conditional("USE_OMX_COMMON", "1", "RTM8RC0000ZMX0LQ00JPL3E", "", d )}'
OMX_VIDEO_DEC_COMMON_SRC = '${@oe.utils.conditional("USE_VIDEO_DEC", "1", "RTM8RC0000ZMD0LQ00JPL3E", "", d )}'
OMX_VIDEO_ENC_COMMON_SRC = '${@oe.utils.conditional("USE_VIDEO_ENC", "1", "RTM8RC0000ZME0LQ00JPL3E", "", d )}'

OMX_H264_DEC_SRC = '${@oe.utils.conditional("USE_H264D_OMX", "1", "RTM8RC0000ZMD1LQ00JPL3E", "", d )}'
OMX_H264_ENC_SRC = '${@oe.utils.conditional("USE_H264E_OMX", "1", "RTM8RC0000ZME1LQ00JPL3E", "", d )}'

OMX_H263_DEC_SRC = '${@oe.utils.conditional("USE_H263D_OMX", "1", "RTM8RC0000ZMD4LQ00JPL3E", "", d )}'
OMX_H265_DEC_SRC = '${@oe.utils.conditional("USE_H265D_OMX", "1", "RTM8RC0000ZMDALQ00JPL3E", "", d )}'
OMX_MPEG2_DEC_SRC = '${@oe.utils.conditional("USE_MPEG2D_OMX", "1", "RTM8RC0000ZMD5LQ00JPL3E", "", d )}'
OMX_MPEG4_DEC_SRC = '${@oe.utils.conditional("USE_MPEG4D_OMX", "1", "RTM8RC0000ZMD2LQ00JPL3E", "", d )}'
OMX_VC1_DEC_SRC = '${@oe.utils.conditional("USE_VC1D_OMX", "1", "RTM8RC0000ZMD3LQ00JPL3E", "", d )}'
OMX_DIVX_DEC_SRC = '${@oe.utils.conditional("USE_DIVXD_OMX", "1", "RTM8RC0000ZMD7LQ00JPL3E", "", d )}'
OMX_RV_DEC_SRC = '${@oe.utils.conditional("USE_RVD_OMX", "1", "RTM8RC0000ZMD6LQ00JPL3E", "", d )}'
OMX_VP8_DEC_SRC = '${@oe.utils.conditional("USE_VP8D_OMX", "1", "RTM8RC0000ZMD8LQ00JPL3E", "", d )}'
OMX_VP8_ENC_SRC = '${@oe.utils.conditional("USE_VP8E_OMX", "1", "RTM8RC0000ZME8LQ00JPL3E", "", d )}'
OMX_VP9_DEC_SRC = '${@oe.utils.conditional("USE_VP9D_OMX", "1", "RTM8RC0000ZMD9LQ00JPL3E", "", d )}'

OMX_VIDEO_SRC_LIST = " \
    ${OMX_COMMON_SRC} \
    ${OMX_VIDEO_DEC_COMMON_SRC} \
    ${OMX_VIDEO_ENC_COMMON_SRC} \
    ${OMX_H263_DEC_SRC} \
    ${OMX_H264_DEC_SRC} \
    ${OMX_H264_ENC_SRC} \
    ${OMX_H265_DEC_SRC} \
    ${OMX_MPEG2_DEC_SRC} \
    ${OMX_MPEG4_DEC_SRC} \
    ${OMX_VC1_DEC_SRC} \
    ${OMX_DIVX_DEC_SRC} \
    ${OMX_RV_DEC_SRC} \
    ${OMX_VP8_DEC_SRC} \
    ${OMX_VP8_ENC_SRC} \
    ${OMX_VP9_DEC_SRC} \
"

AAC_MIDDLEWARE_SRC = "RTM8RC0000ZAD1LQ00JPL3E"
AACPV2_MIDDLEWARE_SRC = "RTM8RC0000ZAD2LQ00JPL3E"
MP3_MIDDLEWARE_SRC = "RTM8RC0000ZAD3LQ00JPL3E"
WMA_MIDDLEWARE_SRC = "RTM8RC0000ZAD4LQ00JPL3E"
DD_MIDDLEWARE_SRC = "RTM0AC0000ADDD5MZ1SL41C"
AEAAC_MIDDLEWARE_SRC = "RTM8RC0000ZAE1LQ00JPL3E"

OMX_AUDIO_COMMON_SRC = '${@oe.utils.conditional("USE_AUDIO_OMX", "1", "RTM8RC0000ZNX0LQ00JPL3E", "", d )}'
OMX_AACLC_DEC_SRC = '${@oe.utils.conditional("USE_AACLCD_OMX", "1", "RTM8RC0000ZND1LQ00JPL3E", "", d )}'
OMX_AACPV2_DEC_SRC = '${@oe.utils.conditional("USE_AACPV2D_OMX", "1", "RTM8RC0000ZND2LQ00JPL3E", "", d )}'
OMX_MP3_DEC_SRC = '${@oe.utils.conditional("USE_MP3D_OMX", "1", "RTM8RC0000ZND3LQ00JPL3E", "", d )}'
OMX_WMA_DEC_SRC = '${@oe.utils.conditional("USE_WMAD_OMX", "1", "RTM8RC0000ZND4LQ00JPL3E", "", d )}'
OMX_ALAC_DEC_SRC = '${@oe.utils.conditional("USE_ALACD_OMX", "1", "RTM8RC0000ZND7LQ00JPL3E", "", d )}'
OMX_FLAC_DEC_SRC = '${@oe.utils.conditional("USE_FLACD_OMX", "1", "RTM8RC0000ZND6LQ00JPL3E", "", d )}'
OMX_DD_DEC_SRC = '${@oe.utils.conditional("USE_DDD_OMX", "1", "RTM0AC0000XADD5D30SL41C", "", d )}'
OMX_AACLC_ENC_SRC = '${@oe.utils.conditional("USE_AACLCE_OMX", "1", "RTM8RC0000ZNE1LQ00JPL3E", "", d )}'

OMX_AUDIO_SRC_LIST = " \
    ${OMX_AUDIO_COMMON_SRC} \
    ${OMX_AACLC_DEC_SRC} \
    ${OMX_AACPV2_DEC_SRC} \
    ${OMX_MP3_DEC_SRC} \
    ${OMX_WMA_DEC_SRC} \
    ${OMX_ALAC_DEC_SRC} \
    ${OMX_FLAC_DEC_SRC} \
    ${OMX_DD_DEC_SRC} \
    ${OMX_AACLC_ENC_SRC} \
"

S = "${WORKDIR}/omx/"

# Create ${S} directory
do_unpack_prepend() {
    os.system("install -d ${S}")
}

do_unpack_append() {
    bb.build.exec_func('setup_build_tree', d)
}

setup_build_tree() {
    for omxmc in ${OMX_COMMON_SRC} ${OMX_VIDEO_DEC_COMMON_SRC} ${OMX_VIDEO_ENC_COMMON_SRC}
    do
        tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${WORKDIR}
        tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${S} ${omxmc}/src --strip=2
        tar xf ${WORKDIR}/${omxmc}.tar.bz2 -C ${S} ${omxmc}/include --strip=1
    done
}

B = "${S}"

EXTRA_OECONF = "OMXR_DEFAULT_CONFIG_FILE_NAME=${sysconfdir}/omxr/omxr_config_base.txt"

do_configure() {
    export uvcsdrv_dir="${INCSHARED}"
    chmod u+x autogen.sh
    ./autogen.sh
    oe_runconf
}

do_install_omx_video() {
    cd ${D}/${libdir}
    for omxmc in ${OMX_VIDEO_SRC_LIST}
    do
        src="${WORKDIR}/${omxmc}"
        install -m 755 ${src}/${baselib}/lib*.so.* ${D}/${libdir}
        install -m 644 ${src}/include/*.h ${D}/${includedir}
        install -m 644 ${src}/config/*.txt ${D}/${sysconfdir}/omxr
    done

    if [ "X${USE_OMX_COMMON}" = "X1" ] ; then
        ln -s libomxr_core.so.3.0.0 libomxr_core.so.3
        ln -s libomxr_core.so.3 libomxr_core.so

        ln -s libomxr_mc_cmn.so.3.0.0 libomxr_mc_cmn.so.3
        ln -s libomxr_mc_cmn.so.3 libomxr_mc_cmn.so
    fi

    if [ "X${USE_VIDEO_OMX}" = "X1" ] ; then
        ln -s libomxr_mc_vcmn.so.3.0.0 libomxr_mc_vcmn.so.3
        ln -s libomxr_mc_vcmn.so.3 libomxr_mc_vcmn.so
    fi

    if [ "X${USE_VIDEO_DEC}" = "X1" ] ; then
        ln -s libomxr_mc_vdcmn.so.3.0.0 libomxr_mc_vdcmn.so.3
        ln -s libomxr_mc_vdcmn.so.3 libomxr_mc_vdcmn.so

        ln -s libuvcs_dec.so.3.0.0 libuvcs_dec.so.3
        ln -s libuvcs_dec.so.3 libuvcs_dec.so
    fi

    if [ "X${USE_VIDEO_ENC}" = "X1" ] ; then
        ln -s libomxr_mc_vecmn.so.3.0.0 libomxr_mc_vecmn.so.3
        ln -s libomxr_mc_vecmn.so.3 libomxr_mc_vecmn.so

        ln -s libuvcs_enc.so.3.0.0 libuvcs_enc.so.3
        ln -s libuvcs_enc.so.3 libuvcs_enc.so
    fi

    if [ "X${USE_H263D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_h263d.so.3.0.0 libomxr_mc_h263d.so.3
        ln -s libomxr_mc_h263d.so.3 libomxr_mc_h263d.so

        ln -s libuvcs_hv3d.so.3.0.0 libuvcs_hv3d.so.3
        ln -s libuvcs_hv3d.so.3 libuvcs_hv3d.so
    fi

    if [ "X${USE_H264D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_h264d.so.3.0.0 libomxr_mc_h264d.so.3
        ln -s libomxr_mc_h264d.so.3 libomxr_mc_h264d.so

        ln -s libuvcs_avcd.so.3.0.0 libuvcs_avcd.so.3
        ln -s libuvcs_avcd.so.3 libuvcs_avcd.so
    fi

    if [ "X${USE_H264E_OMX}" = "X1" ]; then
        ln -s libomxr_mc_h264e.so.3.0.0 libomxr_mc_h264e.so.3
        ln -s libomxr_mc_h264e.so.3 libomxr_mc_h264e.so

        ln -s libuvcs_avce.so.3.0.0 libuvcs_avce.so.3
        ln -s libuvcs_avce.so.3 libuvcs_avce.so
    fi

    if [ "X${USE_H265D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_hevd.so.3.0.0 libomxr_mc_hevd.so.3
        ln -s libomxr_mc_hevd.so.3 libomxr_mc_hevd.so

        ln -s libuvcs_hevd.so.3.0.0 libuvcs_hevd.so.3
        ln -s libuvcs_hevd.so.3 libuvcs_hevd.so
    fi

    if [ "X${USE_MPEG2D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_m2vd.so.3.0.0 libomxr_mc_m2vd.so.3
        ln -s libomxr_mc_m2vd.so.3 libomxr_mc_m2vd.so

        ln -s libuvcs_m2vd.so.3.0.0 libuvcs_m2vd.so.3
        ln -s libuvcs_m2vd.so.3 libuvcs_m2vd.so
    fi

    if [ "X${USE_MPEG4D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_m4vd.so.3.0.0 libomxr_mc_m4vd.so.3
        ln -s libomxr_mc_m4vd.so.3 libomxr_mc_m4vd.so

        ln -s libuvcs_m4vd.so.3.0.0 libuvcs_m4vd.so.3
        ln -s libuvcs_m4vd.so.3 libuvcs_m4vd.so
    fi

    if [ "X${USE_VC1D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_vc1d.so.3.0.0 libomxr_mc_vc1d.so.3
        ln -s libomxr_mc_vc1d.so.3 libomxr_mc_vc1d.so

        ln -s libuvcs_vc1d.so.3.0.0 libuvcs_vc1d.so.3
        ln -s libuvcs_vc1d.so.3 libuvcs_vc1d.so
    fi

    if [ "X${USE_DIVXD_OMX}" = "X1" ]; then
        ln -s libomxr_mc_divxd.so.3.0.0 libomxr_mc_divxd.so.3
        ln -s libomxr_mc_divxd.so.3 libomxr_mc_divxd.so

        ln -s libuvcs_dvxd.so.3.0.0 libuvcs_dvxd.so.3
        ln -s libuvcs_dvxd.so.3 libuvcs_dvxd.so
    fi

    if [ "X${USE_RVD_OMX}" = "X1" ]; then
        ln -s libomxr_mc_rlvd.so.3.0.0 libomxr_mc_rlvd.so.3
        ln -s libomxr_mc_rlvd.so.3 libomxr_mc_rlvd.so

        ln -s libuvcs_rlvd.so.3.0.0 libuvcs_rlvd.so.3
        ln -s libuvcs_rlvd.so.3 libuvcs_rlvd.so
    fi

    if [ "X${USE_VP8D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_vp8d.so.3.0.0 libomxr_mc_vp8d.so.3
        ln -s libomxr_mc_vp8d.so.3 libomxr_mc_vp8d.so

        ln -s libuvcs_vp8d.so.3.0.0 libuvcs_vp8d.so.3
        ln -s libuvcs_vp8d.so.3 libuvcs_vp8d.so
    fi

    if [ "X${USE_VP8E_OMX}" = "X1" ]; then
        ln -s libomxr_mc_vp8e.so.3.0.0 libomxr_mc_vp8e.so.3
        ln -s libomxr_mc_vp8e.so.3 libomxr_mc_vp8e.so

        ln -s libuvcs_vp8e.so.3.0.0 libuvcs_vp8e.so.3
        ln -s libuvcs_vp8e.so.3 libuvcs_vp8e.so
    fi

    if [ "X${USE_VP9D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_vp9d.so.3.0.0 libomxr_mc_vp9d.so.3
        ln -s libomxr_mc_vp9d.so.3 libomxr_mc_vp9d.so

        ln -s libuvcs_vp9d.so.3.0.0 libuvcs_vp9d.so.3
        ln -s libuvcs_vp9d.so.3 libuvcs_vp9d.so
    fi
}

do_install_audio_middleware() {
    cd ${D}/${libdir}

    if [ "X${USE_AACLC_MDW}" = "X1" ]; then
        install -m 755 ${WORKDIR}/${AAC_MIDDLEWARE_SRC}/${baselib}/libAACDLA_L.so.3.0 \
            ${D}/${libdir}
        install -m 644 ${WORKDIR}/${AAC_MIDDLEWARE_SRC}/include/*.h ${D}/${includedir}

        ln -s libAACDLA_L.so.3.0 libAACDLA_L.so.3
        ln -s libAACDLA_L.so.3 libAACDLA_L.so
    fi

    if [ "X${USE_AACPV2_MDW}" = "X1" ]; then
        install -m 755 ${WORKDIR}/${AACPV2_MIDDLEWARE_SRC}/${baselib}/libRSACPDLA_L.so.2.0 \
            ${D}/${libdir}
        install -m 644 ${WORKDIR}/${AACPV2_MIDDLEWARE_SRC}/include/*.h ${D}/${includedir}

        ln -s libRSACPDLA_L.so.2.0 libRSACPDLA_L.so.2
        ln -s libRSACPDLA_L.so.2 libRSACPDLA_L.so
    fi

    if [ "X${USE_MP3_MDW}" = "X1" ]; then
        install -m 755 ${WORKDIR}/${MP3_MIDDLEWARE_SRC}/${baselib}/libMP3DLA_L.so.2.0 \
            ${D}/${libdir}
        install -m 644 ${WORKDIR}/${MP3_MIDDLEWARE_SRC}/include/*.h ${D}/${includedir}

        ln -s libMP3DLA_L.so.2.0 libMP3DLA_L.so.2
        ln -s libMP3DLA_L.so.2 libMP3DLA_L.so
    fi

    if [ "X${USE_WMA_MDW}" = "X1" ]; then
        install -m 755 ${WORKDIR}/${WMA_MIDDLEWARE_SRC}/${baselib}/libWMASTDLA_L.so.2.0 \
            ${D}/${libdir}
        install -m 644 ${WORKDIR}/${WMA_MIDDLEWARE_SRC}/include/*.h ${D}/${includedir}

        ln -s libWMASTDLA_L.so.2.0 libWMASTDLA_L.so.2
        ln -s libWMASTDLA_L.so.2 libWMASTDLA_L.so
    fi

    if [ "X${USE_DD_MDW}" = "X1" ]; then
        install -m 755 ${WORKDIR}/${DD_MIDDLEWARE_SRC}/${baselib}/libRSDACDLA_L.so.2.0 \
            ${D}/${libdir}
        install -m 644 ${WORKDIR}/${DD_MIDDLEWARE_SRC}/include/*.h ${D}/${includedir}

        ln -s libRSDACDLA_L.so.2.0 libRSDACDLA_L.so.2
        ln -s libRSDACDLA_L.so.2 libRSDACDLA_L.so
    fi

    if [ "X${USE_AACLCE_MDW}" = "X1" ]; then
        install -m 755 ${WORKDIR}/${AEAAC_MIDDLEWARE_SRC}/${baselib}/libRSAACELA_L.so.3.0 \
            ${D}/${libdir}
        install -m 644 ${WORKDIR}/${AEAAC_MIDDLEWARE_SRC}/include/*.h ${D}/${includedir}

        ln -s libRSAACELA_L.so.3.0 libRSAACELA_L.so.3
        ln -s libRSAACELA_L.so.3 libRSAACELA_L.so
    fi
}

do_install_omx_audio() {
    cd ${D}/${libdir}
    for omxmc in ${OMX_AUDIO_SRC_LIST}
    do
        src="${WORKDIR}/${omxmc}/"
        install -m 755 ${src}/${baselib}/lib*.so.* ${D}/${libdir}
        if [ -d ${src}/include ]; then
            install -m 644 ${src}/include/*.h ${D}/${includedir}
        fi
        install -m 644 ${src}/config/*.txt ${D}/${sysconfdir}/omxr
    done

    if [ "X${USE_AUDIO_OMX}" = "X1" ]; then
        ln -s libomxr_mc_acmn.so.3.0.0 libomxr_mc_acmn.so.3
        ln -s libomxr_mc_acmn.so.3 libomxr_mc_acmn.so
    fi

    if [ "X${USE_AACLCD_OMX}" = "X1" ]; then
        ln -s libomxr_mc_aacd.so.3.0.0 libomxr_mc_aacd.so.3
        ln -s libomxr_mc_aacd.so.3 libomxr_mc_aacd.so
    fi

    if [ "X${USE_AACPV2D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_aapd.so.3.0.0 libomxr_mc_aapd.so.3
        ln -s libomxr_mc_aapd.so.3 libomxr_mc_aapd.so
    fi

    if [ "X${USE_MP3D_OMX}" = "X1" ]; then
        ln -s libomxr_mc_mp3d.so.3.0.0 libomxr_mc_mp3d.so.3
        ln -s libomxr_mc_mp3d.so.3 libomxr_mc_mp3d.so
    fi

    if [ "X${USE_WMAD_OMX}" = "X1" ]; then
        ln -s libomxr_mc_wmad.so.3.0.0 libomxr_mc_wmad.so.3
        ln -s libomxr_mc_wmad.so.3 libomxr_mc_wmad.so
    fi

    if [ "X${USE_ALACD_OMX}" = "X1" ]; then
        ln -s libomxr_mc_alacd.so.3.0.0 libomxr_mc_alacd.so.3
        ln -s libomxr_mc_alacd.so.3 libomxr_mc_alacd.so
    fi

    if [ "X${USE_FLACD_OMX}" = "X1" ]; then
        ln -s libomxr_mc_flacd.so.3.0.0 libomxr_mc_flacd.so.3
        ln -s libomxr_mc_flacd.so.3 libomxr_mc_flacd.so
    fi

    if [ "X${USE_AACLCE_OMX}" = "X1" ]; then
        ln -s libomxr_mc_aace.so.3.0.0 libomxr_mc_aace.so.3
        ln -s libomxr_mc_aace.so.3 libomxr_mc_aace.so
    fi

    if [ "X${USE_DDD_OMX}" = "X1" ]; then
        ln -s libomxr_mc_ddd.so.3.0.0 libomxr_mc_ddd.so.3
        ln -s libomxr_mc_ddd.so.3 libomxr_mc_ddd.so
    fi
}

do_install () {
    if [ "X${USE_OMX_COMMON}" = "X1" ]; then
        oe_runmake 'DESTDIR=${D}' install
        # Info dir listing isn't interesting at this point so remove it if it exists.
        if [ -e "${D}/${infodir}/dir" ]; then
            rm -f ${D}/${infodir}/dir
        fi
    fi
}

do_install_append() {
    # Create destination directory
    install -d ${D}/${libdir}
    install -d ${D}/${includedir}
    if [ "X${USE_OMX_COMMON}" = "X1" ]; then
        install -d ${D}/${sysconfdir}/omxr
    fi

    # Copy omx video library
    do_install_omx_video
    # Copy audio middleware library
    do_install_audio_middleware
    # Copy omx audio library
    do_install_omx_audio
}

INSANE_SKIP_${PN} = "dev-so"

FILES_${PN} += " \
    ${libdir}/*.so \
"

FILES_${PN}-dev = " \
    ${includedir} \
    ${libdir}/*.la \
"

RDEPENDS_${PN} += "mmngr-user-module vspmif-user-module"
RDEPENDS_${PN} += '${@oe.utils.conditional("USE_ALACD_OMX", "1", "libalacdla-l", "", d )}'
RDEPENDS_${PN} += '${@oe.utils.conditional("USE_FLACD_OMX", "1", "libflacdla-l", "", d )}'

#To avoid already-stripped errors and not stripped libs from packages
INSANE_SKIP_${PN} += "already-stripped"

# Skip debug split and strip of do_package()
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

repository: renesas-rcar/meta-renesas

repo_name: renesas-rcar/meta-renesas

branch_name: refs/heads/dunfell

gha_language: BitBake


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

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

@article{Rae2009,
author = {Rae, Alasdair},
doi = {10.1016/j.compenvurbsys.2009.01.007},
file = {:media/robin/data/Copy/1Lit/2009/Rae - 2009 - From spatial interaction data to spatial interaction information Geovisualisation and spatial structures of migration from.pdf:pdf},
isbn = {0198-9715},
issn = {01989715},
journal = {Computers, Environment and Urban Systems},
keywords = {Flow mapping,Folder - GraphVisualization,GIS,Geovisualisation,Migration,Spatial interaction data,Urska supplied paper,cartography,demography,flow,jtc,movement,network-analysis,social network,spatial,spatial interaction data,spatial-networks,visualization},
mendeley-tags = {Flow mapping,Folder - GraphVisualization,GIS,Geovisualisation,Migration,Spatial interaction data,Urska supplied paper,cartography,demography,flow,jtc,movement,network-analysis,social network,spatial,spatial-networks,visualization},
month = may,
number = {3},
pages = {161--178},
publisher = {Elsevier Ltd},
title = {{From spatial interaction data to spatial interaction information? Geovisualisation and spatial structures of migration from the 2001 UK census}},
url = {http://linkinghub.elsevier.com/retrieve/pii/S019897150900009X},
volume = {33},
year = {2009}
}
@book{kabacoff2011r,
author = {Kabacoff, Robert},
publisher = {Manning Publications Co.},
title = {{R in Action}},
year = {2011}
}
@article{Fotheringham1981,
author = {Fotheringham, AS},
file = {:media/robin/data/Copy/1Lit/1981/Fotheringham - 1981 - Spatial structure and distance-decay parameters.pdf:pdf},
journal = {Annals of the Association of American Geographers},
number = {3},
pages = {425--436},
title = {{Spatial structure and distance-decay parameters}},
url = {http://www.tandfonline.com/doi/abs/10.1111/j.1467-8306.1981.tb01367.x},
volume = {71},
year = {1981}
}
@article{lovelace2014introduction,
abstract = {This tutorial is an introduction to spatial data in R and map making with R's `base' graphics and the popular graphics package ggplot2. It assumes no prior knowledge of spatial data analysis but prior understanding of the R command line would be beneficial. For people new to R, we recommend working through an `Introduction to R' type tutorial, such as "A (very) short introduction to R" (Torfs and Brauer, 2012) or the more geographically inclined "Short introduction to R" (Harris, 2012). Building on such background material, the following set of exercises is concerned with specific functions for spatial data and visualisation. It is divided into five parts: *Introduction, which provides a guide to R's syntax and preparing for the tutorial *Spatial data in R, which describes basic spatial functions in R *Manipulating spatial data, which includes changing projection, clipping and spatial joins *Map making with ggplot2, a recent graphics package for producing beautiful maps quickly *Taking spatial analysis in R further, a compilation of resources for furthering your skills An up-to-date version of this tutorial is maintained at https://github.com/Robinlovelace/Creating-maps-in-R and the entire tutorial, including the input data can be downloaded as a zip file, as described below. The entire tutorialwas written in RMarkdown, which allows R code to run as the document compiles. Thus all the examples are entirely reproducible. Suggested improvements welcome - please fork, improve and push this document to its original home to ensure its longevity. The tutorial was developed for a series of Short Courses put on by the National Centre for Research Methods, via the TALISMAN node (see geotalisman.org).},
address = {London},
author = {Lovelace, Robin and Cheshire, James},
file = {:media/robin/data/Copy/1Lit/2014/Lovelace, Cheshire - 2014 - Introduction to visualising spatial data in R.pdf:pdf},
institution = {National Centre for Research Methods},
journal = {National Centre for Research Methods Working Papers},
number = {03},
publisher = {Comprehensive R Archive Network},
title = {{Introduction to visualising spatial data in R}},
url = {https://github.com/Robinlovelace/Creating-maps-in-R},
volume = {14},
year = {2014}
}
@article{lovelace2015propensity,
  title={The Propensity to Cycle Tool: An open source online system for sustainable transport planning},
  author={Lovelace, Robin and Goodman, Anna and Aldred, Rachel and Berkoff, Nikolai and Abbas, Ali and Woodcock, James},
  journal={arXiv preprint arXiv:1509.04425},
  year={2015}
}
@article{caceres2007deriving,
  title={Deriving origin destination data from a mobile phone network},
  author={Caceres, N and Wideberg, JP and Benitez, FG},
  journal={Intelligent Transport Systems, IET},
  volume={1},
  number={1},
  pages={15--26},
  year={2007},
  publisher={IET}
}

repository: ilanfri/stplanr

repo_name: ilanfri/stplanr


text:
SUMMARY = "Read uboot environment via go"
HOMEPAGE = "https://github.com/mvo5/uboot-go"
SECTION = "devel/go"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://COPYING;md5=a64983c752e68e915cb4ec5ab6c2cc75"

PKG_NAME = "github.com/mvo5/uboot-go"
SRC_URI = "git://github.com/mvo5/uboot-go;protocol=https"

SRCREV = "5927df7626d370f54a4bc75f26e57883f5d429d5"
PV = "0.0+git${SRCREV}"

S = "${WORKDIR}/git"

do_install() {
	install -d ${D}${prefix}/local/go/src/${PKG_NAME}
	cp -r ${S}/* ${D}${prefix}/local/go/src/${PKG_NAME}/
}

SYSROOT_PREPROCESS_FUNCS += "go_check_sysroot_preprocess"

go_check_sysroot_preprocess () {
    install -d ${SYSROOT_DESTDIR}${prefix}/local/go/src/${PKG_NAME}
    cp -r ${D}${prefix}/local/go/src/${PKG_NAME} ${SYSROOT_DESTDIR}${prefix}/local/go/src/$(dirname ${PKG_NAME})
}

FILES_${PN} += "${prefix}/local/go/src/${PKG_NAME}/*"

repository: walimis/meta-snappy

repo_name: walimis/meta-snappy


text:
package types

import (
	sdk "github.com/cosmos/cosmos-sdk/types"
)

type EpochHooks interface {
	// the first block whose timestamp is after the duration is counted as the end of the epoch
	AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64)
	// new epoch is next block of epoch end block
	BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)
}

var _ EpochHooks = MultiEpochHooks{}

// combine multiple gamm hooks, all hook functions are run in array sequence
type MultiEpochHooks []EpochHooks

func NewMultiEpochHooks(hooks ...EpochHooks) MultiEpochHooks {
	return hooks
}

// AfterEpochEnd is called when epoch is going to be ended, epochNumber is the number of epoch that is ending
func (h MultiEpochHooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) {
	for i := range h {
		h[i].AfterEpochEnd(ctx, epochIdentifier, epochNumber)
	}
}

// BeforeEpochStart is called when epoch is going to be started, epochNumber is the number of epoch that is starting
func (h MultiEpochHooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64) {
	for i := range h {
		h[i].BeforeEpochStart(ctx, epochIdentifier, epochNumber)
	}
}

repository: commercionetwork/commercionetwork

repo_name: commercionetwork/commercionetwork


text:
@Article{biecek2008chromosome,
  title = {Why Y chromosome is shorter and women live longer?},
  author = {Przemyslaw Biecek and Stanislaw Cebrat},
  journal = {The European Physical Journal B},
  volume = {65},
  number = {1},
  pages = {149--153},
  year = {2008},
  publisher = {Springer-Verlag},
}


text:
package agent

import (
	"github.com/hansen1101/go_heating/system"
	"fmt"
)

const (
	BOILER_TARGET_FALLBACK = 40000
	BOILER_MAX_TOP = 45000
)

type SimpleHeatingAgent struct {
	config_chan chan int
	config_request_generator system.ConfigRequester
}

func NewSimpleHeatingAgent(config_oracle_available bool)(a *SimpleHeatingAgent){
	if config_oracle_available {
		a = &SimpleHeatingAgent{make(chan int),system.MakeConfigRequest}
	} else {
		a = &SimpleHeatingAgent{}
	}
	return
}

//type Policy func(system.SystemState)(system.Action)

// Implementation of HeatingAgent interface
func (self *SimpleHeatingAgent) GetAction(percept *system.Percept)(action *system.Action){
	// init a new action with default roll out
	action = new(system.Action)

	// update state by processing percept

	// requesting percepts reward

	// request action from policy
	boiler_target := BOILER_TARGET_FALLBACK
	if self.config_chan != nil {
		fmt.Printf("[Agent]\ttry to get boiler target...")
		self.config_request_generator(self.config_chan,percept)
		boiler_target = <-self.config_chan
	}
	fmt.Printf(" received: %d\n",boiler_target)
	burnerOn,triangleOn := waterNeedsHeating(percept,getState().GetBurnerState(),boiler_target)
	timePassedSinceLastTransition := percept.CurrentTime.Sub(getState().Time)
	action.SetBurnerState(burnerOn)
	action.SetTriangleState(triangleOn)
	if timePassedSinceLastTransition.Minutes() < 1.5 {
		action.SetWPumpState(getState().GetWState())
	} else {
		action.SetWPumpState(energyIsAvailable(percept))
	}
	action.SetHPumpState(radiatorsNeedEnergy(percept))

	// update internal fields

	return
}

func getState()(state *system.ActorState){
	if lastState != nil {
		state = lastState.(*system.ActorState)
	}
	return
}

func waterNeedsHeating(percept *system.Percept, burnerIsOn bool, boilerTarget int)(burner bool,triangle bool){
	triangle = true
	burner = false
	if percept.BoilerTopTemp.GetValue() >= 45000 {
		triangle = false
	}
	if percept.BoilerMidTemp.GetValue() < boilerTarget - 2000 && !burnerIsOn {
		burner= true
	} else if percept.BoilerMidTemp.GetValue() < boilerTarget + 3500 && burnerIsOn {
		burner= true
	}
	return
}

func energyIsAvailable(percept *system.Percept)(bool){
	if percept.WForeRunTemp.GetValue() + 300 < percept.KettleTemp.GetValue() {
	//if percept.BoilerMidTemp.GetValue() < percept.KettleTemp.GetValue() {
		return true
	} else {
		return false
	}
}

func radiatorsNeedEnergy(percept *system.Percept)(bool){
	if percept.OutsideTemp.GetValue() < 19000 && (percept.CurrentTime.Hour() >= 5 && percept.CurrentTime.Minute() >= 30 || percept.CurrentTime.Hour() >= 6) && percept.CurrentTime.Hour() < 23 {
		return true
	} else {
		return false
	}
}


text:
package ahaslides

import (
	"fmt"

	"google.golang.org/api/slides/v1"
)

const (
	CanvasMaxX = float64(700.0)
	CanvasMaxY = float64(500.0)
)

type SlideCanvasInfo struct {
	BoxFgColor      *slides.RgbColor
	BoxBgColor      *slides.RgbColor
	BoxHeight       float64
	BoxMarginBottom float64
	Canvas          CanvasFloat64
}

type CanvasFloat64 struct {
	MinX float64
	MinY float64
	MaxX float64
	MaxY float64
}

func (c64 *CanvasFloat64) ThisX(this, min, max float64) (float64, error) {
	if min > max {
		return 0.0, fmt.Errorf("Min (%v) is larger than max (%v)", min, max)
	} else if this < min || this > max {
		return 0.0, fmt.Errorf("This (%v) is not within min,max (%v, %v)", this, min, max)
	}
	diff := max - min
	plus := this - min
	pct := float64(plus) / float64(diff)
	diffCan := c64.MaxX - c64.MinX
	thisPlus := pct * diffCan
	thisX := c64.MinX + thisPlus
	return thisX, nil
}

type location struct {
	SrcAllMinX int64
	SrcAllMaxX int64
	SrcAllWdtX int64
	SrcBoxMinX int64
	SrcBoxMaxX int64
	SrcBoxWdtX int64
	SrcPctWdtX float64
	OutAllMinX float64
	OutAllMaxX float64
	OutAllWdtX float64
	OutBoxMinX float64
	OutBoxMaxX float64
	OutBoxWdtX float64
	BoxOutPctX float64
}

repository: robhutchin/go-aha

repo_name: robhutchin/go-aha


text:
DESCRIPTION = "lua-cURL"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
HOMEPAGE = "https://github.com/Lua-cURL/Lua-cURLv3"
DEPENDS += "curl virtual/lua"
RDEPENDS_${PN} += "virtual/lua"

include ../lua.inc

S = "${WORKDIR}/git"
SRCREV = "c38f3d4c298a1ce941158e0b8bc9ea5ca40fe655"
PV = "0.3.11"

SRC_URI = "git://github.com/Lua-cURL/Lua-cURLv3.git;protocol=https \
	   file://0001-Makefile-adjust-for-OE.patch \
"

EXTRA_OEMAKE += "LUA_VER=${LUA_VER}"

inherit autotools-brokensep

FILES_${PN} =  "/usr/share \
		/usr/lib \
"

BBCLASSEXTEND = "native nativesdk"

repository: neutrino-hd/meta-neutrino

repo_name: neutrino-hd/meta-neutrino


text:
// Copyright 2021 The casbin Authors. 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.
// 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 object

import (
	"fmt"
	"regexp"

	"github.com/casbin/casdoor/util"
)

var reWhiteSpace *regexp.Regexp

func init() {
	reWhiteSpace, _ = regexp.Compile(`\s`)
}

func CheckUserSignup(application *Application, organization *Organization, username string, password string, displayName string, email string, phone string, affiliation string) string {
	if organization == nil {
		return "organization does not exist"
	}

	if application.IsSignupItemVisible("Username") {
		if len(username) <= 1 {
			return "username must have at least 2 characters"
		} else if reWhiteSpace.MatchString(username) {
			return "username cannot contain white spaces"
		} else if HasUserByField(organization.Name, "name", username) {
			return "username already exists"
		}
	}

	if len(password) <= 5 {
		return "password must have at least 6 characters"
	}

	if application.IsSignupItemVisible("Email") {
		if HasUserByField(organization.Name, "email", email) {
			return "email already exists"
		} else if !util.IsEmailValid(email) {
			return "email is invalid"
		}
	}

	if application.IsSignupItemVisible("Phone") {
		if HasUserByField(organization.Name, "phone", phone) {
			return "phone already exists"
		} else if organization.PhonePrefix == "86" && !util.IsPhoneCnValid(phone) {
			return "phone number is invalid"
		}
	}

	if application.IsSignupItemVisible("Display name") {
		if displayName == "" {
			return "displayName cannot be blank"
		} else if application.GetSignupItemRule("Display name") == "Personal" {
			if !isValidPersonalName(displayName) {
				return "displayName is not valid personal name"
			}
		}
	}

	if application.IsSignupItemVisible("Affiliation") {
		if affiliation == "" {
			return "affiliation cannot be blank"
		}
	}

	return ""
}

func CheckPassword(user *User, password string) string {
	organization := GetOrganizationByUser(user)

	if organization.PasswordType == "plain" {
		if password == user.Password {
			return ""
		} else {
			return "password incorrect"
		}
	} else if organization.PasswordType == "salt" {
		if password == user.Password || getSaltedPassword(password, organization.PasswordSalt) == user.Password {
			return ""
		} else {
			return "password incorrect"
		}
	} else {
		return fmt.Sprintf("unsupported password type: %s", organization.PasswordType)
	}
}

func CheckUserPassword(organization string, username string, password string) (*User, string) {
	user := GetUserByFields(organization, username)
	if user == nil {
		return nil, "the user does not exist, please sign up first"
	}

	if user.IsForbidden {
		return nil, "the user is forbidden to sign in, please contact the administrator"
	}

	msg := CheckPassword(user, password)
	if msg != "" {
		return nil, msg
	}

	return user, ""
}

repository: WindSpiritSR/casdoor

repo_name: WindSpiritSR/casdoor

gha_language: JavaScript


text:
@proceedings{eacl-2017-student,
    title = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    editor = "Kunneman, Florian  and
      I{\~n}urrieta, Uxoa  and
      Camilleri, John J.  and
      Ardanuy, Mariona Coll",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4000",
}
@inproceedings{van-miltenburg-2017-pragmatic,
    title = "Pragmatic descriptions of perceptual stimuli",
    author = "van Miltenburg, Emiel",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4001",
    pages = "1--10",
}
@inproceedings{barteld-2017-detecting,
    title = "Detecting spelling variants in non-standard texts",
    author = "Barteld, Fabian",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4002",
    pages = "11--22",
}
@inproceedings{marrese-taylor-matsuo-2017-replication,
    title = "Replication issues in syntax-based aspect extraction for opinion mining",
    author = "Marrese-Taylor, Edison  and
      Matsuo, Yutaka",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4003",
    pages = "23--32",
}
@inproceedings{pyatkin-webber-2017-discourse,
    title = "Discourse Relations and Conjoined {VP}s: Automated Sense Recognition",
    author = "Pyatkin, Valentina  and
      Webber, Bonnie",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4004",
    pages = "33--42",
}
@inproceedings{litvinova-etal-2017-deception,
    title = "Deception detection in {R}ussian texts",
    author = "Litvinova, Olga  and
      Seredin, Pavel  and
      Litvinova, Tatiana  and
      Lyell, John",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4005",
    pages = "43--52",
}
@inproceedings{seminck-amsili-2017-computational,
    title = "A Computational Model of Human Preferences for Pronoun Resolution",
    author = "Seminck, Olga  and
      Amsili, Pascal",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4006",
    pages = "53--63",
}
@inproceedings{piotrkowicz-etal-2017-automatic,
    title = "Automatic Extraction of News Values from Headline Text",
    author = "Piotrkowicz, Alicja  and
      Dimitrova, Vania  and
      Markert, Katja",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4007",
    pages = "64--74",
}
@inproceedings{chalaguine-schulz-2017-assessing,
    title = "Assessing Convincingness of Arguments in Online Debates with Limited Number of Features",
    author = "Chalaguine, Lisa Andreevna  and
      Schulz, Claudia",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4008",
    pages = "75--83",
}
@inproceedings{perez-melian-etal-2017-zipfs,
    title = "{Z}ipf{'}s and {B}enford{'}s laws in Twitter hashtags",
    author = "P{\'e}rez Meli{\'a}n, Jos{\'e} Alberto  and
      Conejero, J. Alberto  and
      Ferri Ram{\'\i}rez, C{\`e}sar",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4009",
    pages = "84--93",
}
@inproceedings{amorim-veloso-2017-multi,
    title = "A Multi-aspect Analysis of Automatic Essay Scoring for {B}razilian {P}ortuguese",
    author = "Amorim, Evelin  and
      Veloso, Adriano",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4010",
    pages = "94--102",
}
@inproceedings{ehren-2017-literal,
    title = "Literal or idiomatic? Identifying the reading of single occurrences of {G}erman multiword expressions using word embeddings",
    author = "Ehren, Rafael",
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4011",
    pages = "103--112",
}
@inproceedings{hatty-etal-2017-evaluating,
    title = "Evaluating the Reliability and Interaction of Recursively Used Feature Classes for Terminology Extraction",
    author = {H{\"a}tty, Anna  and
      Dorna, Michael  and
      Schulte im Walde, Sabine},
    booktitle = "Proceedings of the Student Research Workshop at the 15th Conference of the {E}uropean Chapter of the Association for Computational Linguistics",
    month = apr,
    year = "2017",
    address = "Valencia, Spain",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/E17-4012",
    pages = "113--121",
}

repository: emorynlp/nlprankings

repo_name: emorynlp/nlprankings

gha_license_id: NOASSERTION


text:
package service

import "golang.org/x/net/context"

type WXService struct {
}

func NewWXService() *WXService {
	s := WXService{}
	return &s
}

func (s *WXService) ValidateServer(ctx context.Context) {

}

repository: hyt-hz/wxOpenID

repo_name: hyt-hz/wxOpenID


text:
require fvp-ecosystem.inc

MODEL = "Corstone-1000-23"
MODEL_CODE = "FVP_Corstone_1000"
PV = "11.17_23"

SRC_URI = "https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/${MODEL}/Linux/${MODEL_CODE}_${PV}.tgz;subdir=${BP}"
SRC_URI[sha256sum] = "00ccb72d02c90e2424d24a625d275cabf8ea8dc024713985208f618bb88d1934"

LIC_FILES_CHKSUM = "file://license_terms/license_agreement.txt;md5=1a33828e132ba71861c11688dbb0bd16 \
                    file://license_terms/third_party_licenses.txt;md5=41029e71051b1c786bae3112a29905a7"

repository: wistron-corporation/openbmc

repo_name: wistron-corporation/openbmc


text:
@article{Hakim:2017,
 abstract = {This paper demonstrates the development of a simple chemical kinetics model designed for autoignition of n-dodecane in air using Bayesian inference with a model-error representation. The model error, i.e. intrinsic discrepancy from a high-fidelity benchmark model, is represented by allowing additional variability in selected parameters. Subsequently, we quantify predictive uncertainties in the results of autoignition simulations of homogeneous reactors at realistic diesel engine conditions. We demonstrate that these predictive error bars capture model error as well. The uncertainty propagation is performed using non-intrusive spectral projection that can also be used in principle with larger scale computations, such as large eddy simulation. While the present calibration is performed to match a skeletal mechanism, it can be done with equal success using experimental data only (e.g. shock-tube measurements). Since our method captures the error associated with structural model simplifications, we believe that the optimised model could then lead to better qualified predictions of autoignition delay time in high-fidelity large eddy simulations than the existing detailed mechanisms. This methodology provides a way to reduce the cost of reaction kinetics in simulations systematically, while quantifying the accuracy of predictions of important target quantities.},
 author = {L. Hakim and G. Lacaze and M. Khalil and K. Sargsyan and
H. Najm and J. Oefelein},
 doi = {10.1080/13647830.2017.1403653},
 eprint = { https://doi.org/10.1080/13647830.2017.1403653 },
 journal = {Combustion Theory and Modeling},
 month = {February},
 number = {3},
 pages = {446-466},
 publisher = {Taylor & Francis},
 title = {Probabilistic parameter estimation in a 2-step chemical
kinetics model for n-dodecane jet autoignition},
 volume = {22},
 year = {2018}
}


text:
########################################################
# tf_cc_framework library
########################################################
set(tf_cc_framework_srcs
    "${tensorflow_source_dir}/tensorflow/cc/framework/ops.h"
    "${tensorflow_source_dir}/tensorflow/cc/framework/ops.cc"
    "${tensorflow_source_dir}/tensorflow/cc/framework/scope.h"
    "${tensorflow_source_dir}/tensorflow/cc/framework/scope.cc"
)

add_library(tf_cc_framework OBJECT ${tf_cc_framework_srcs})

add_dependencies(tf_cc_framework tf_core_framework)

########################################################
# tf_cc_op_gen_main library
########################################################
set(tf_cc_op_gen_main_srcs
    "${tensorflow_source_dir}/tensorflow/cc/framework/cc_op_gen.cc"
    "${tensorflow_source_dir}/tensorflow/cc/framework/cc_op_gen_main.cc"
    "${tensorflow_source_dir}/tensorflow/cc/framework/cc_op_gen.h"
)

add_library(tf_cc_op_gen_main OBJECT ${tf_cc_op_gen_main_srcs})

add_dependencies(tf_cc_op_gen_main tf_core_framework)

########################################################
# tf_gen_op_wrapper_cc executables
########################################################

# create directory for ops generated files
set(cc_ops_target_dir ${CMAKE_CURRENT_BINARY_DIR}/tensorflow/cc/ops)

add_custom_target(create_cc_ops_header_dir
    COMMAND ${CMAKE_COMMAND} -E make_directory ${cc_ops_target_dir}
)

set(tf_cc_ops_generated_files)

set(tf_cc_op_lib_names
    ${tf_op_lib_names}
    "user_ops"
)
foreach(tf_cc_op_lib_name ${tf_cc_op_lib_names})
    # Using <TARGET_OBJECTS:...> to work around an issue where no ops were
    # registered (static initializers dropped by the linker because the ops
    # are not used explicitly in the *_gen_cc executables).
    add_executable(${tf_cc_op_lib_name}_gen_cc
        $<TARGET_OBJECTS:tf_cc_op_gen_main>
        $<TARGET_OBJECTS:tf_${tf_cc_op_lib_name}>
        $<TARGET_OBJECTS:tf_core_lib>
        $<TARGET_OBJECTS:tf_core_framework>
    )

    target_link_libraries(${tf_cc_op_lib_name}_gen_cc PRIVATE
        tf_protos_cc
        ${tensorflow_EXTERNAL_LIBRARIES}
    )

    set(cc_ops_include_internal 0)
    if(${tf_cc_op_lib_name} STREQUAL "sendrecv_ops")
        set(cc_ops_include_internal 1)
    endif()

    add_custom_command(
        OUTPUT ${cc_ops_target_dir}/${tf_cc_op_lib_name}.h
               ${cc_ops_target_dir}/${tf_cc_op_lib_name}.cc
        COMMAND ${tf_cc_op_lib_name}_gen_cc ${cc_ops_target_dir}/${tf_cc_op_lib_name}.h ${cc_ops_target_dir}/${tf_cc_op_lib_name}.cc ${cc_ops_include_internal}
        DEPENDS ${tf_cc_op_lib_name}_gen_cc create_cc_ops_header_dir
    )

    list(APPEND tf_cc_ops_generated_files ${cc_ops_target_dir}/${tf_cc_op_lib_name}.h)
    list(APPEND tf_cc_ops_generated_files ${cc_ops_target_dir}/${tf_cc_op_lib_name}.cc)
endforeach()

########################################################
# tf_cc_ops library
########################################################
add_library(tf_cc_ops OBJECT
    ${tf_cc_ops_generated_files}
    "${tensorflow_source_dir}/tensorflow/cc/ops/const_op.h"
    "${tensorflow_source_dir}/tensorflow/cc/ops/const_op.cc"
    "${tensorflow_source_dir}/tensorflow/cc/ops/standard_ops.h"
)

########################################################
# tf_cc library
########################################################
file(GLOB_RECURSE tf_cc_srcs
    "${tensorflow_source_dir}/tensorflow/cc/client/*.h"
    "${tensorflow_source_dir}/tensorflow/cc/client/*.cc"
    "${tensorflow_source_dir}/tensorflow/cc/gradients/*.h"
    "${tensorflow_source_dir}/tensorflow/cc/gradients/*.cc"
    "${tensorflow_source_dir}/tensorflow/cc/training/*.h"
    "${tensorflow_source_dir}/tensorflow/cc/training/*.cc"
)

set(tf_cc_srcs
    ${tf_cc_srcs}
    "${tensorflow_source_dir}/tensorflow/cc/framework/grad_op_registry.h"
    "${tensorflow_source_dir}/tensorflow/cc/framework/grad_op_registry.cc"
    "${tensorflow_source_dir}/tensorflow/cc/framework/gradient_checker.h"
    "${tensorflow_source_dir}/tensorflow/cc/framework/gradient_checker.cc"
    "${tensorflow_source_dir}/tensorflow/cc/framework/gradients.h"
    "${tensorflow_source_dir}/tensorflow/cc/framework/gradients.cc"
)

file(GLOB_RECURSE tf_cc_test_srcs
    "${tensorflow_source_dir}/tensorflow/cc/*test*.cc"
)

list(REMOVE_ITEM tf_cc_srcs ${tf_cc_test_srcs})

add_library(tf_cc OBJECT ${tf_cc_srcs})
add_dependencies(tf_cc tf_cc_framework tf_cc_ops)

repository: udacity/tensorflow

repo_name: udacity/tensorflow

extension: cmake


text:
package main

// Based on G3N demo hellog3n-no-app
// https://github.com/g3n/demos/tree/master/hellog3n-no-app

import (
	"log"
	"runtime"
	"time"

	"github.com/g3n/engine/camera"
	"github.com/g3n/engine/camera/control"
	"github.com/g3n/engine/core"
	"github.com/g3n/engine/geometry"
	"github.com/g3n/engine/gls"
	"github.com/g3n/engine/graphic"
	"github.com/g3n/engine/light"
	"github.com/g3n/engine/material"
	"github.com/g3n/engine/math32"
	"github.com/g3n/engine/renderer"
	"github.com/g3n/engine/window"
)

func main() {

	// Creates window and OpenGL context
	wmgr, err := window.Manager("glfw")
	if err != nil {
		panic(err)
	}
	win, err := wmgr.CreateWindow(800, 600, "Sun Colony Desktop", false)
	if err != nil {
		panic(err)
	}

	// OpenGL functions must be executed in the same thread where
	// the context was created (by wmgr.CreateWindow())
	runtime.LockOSThread()

	// Create OpenGL state
	gs, err := gls.New()
	if err != nil {
		panic(err)
	}

	// Set the OpenGL viewport size the same as the window size
	// We later set up a callback to update this if the window is resized
	width, height := win.Size()
	gs.Viewport(0, 0, int32(width), int32(height))

	// Add a perspective camera to the scene
	// We later set up a callback to update the camera aspect ratio if the window is resized
	aspect := float32(width) / float32(height)
	camera := camera.NewPerspective(65, aspect, 0.01, 1000)
	camera.SetPosition(0, 0, 3)

	// Set up callback to update viewport and camera aspect ratio when the window is resized
	win.Subscribe(window.OnWindowSize, func(evname string, ev interface{}) {

		// Get framebuffer size and update viewport accordingly
		width, height := win.FramebufferSize()
		gs.Viewport(0, 0, int32(width), int32(height))

		// Update the camera's aspect ratio
		aspect := float32(width) / float32(height)
		camera.SetAspect(aspect)
	})

	// Set up orbit control for the camera
	control.NewOrbitControl(camera, win)

	// Create scene for 3D objects
	scene := core.NewNode()
	scene.Add(camera)

	// Create a blue torus and add it to the scene
	geom := geometry.NewTorus(.4, .07, 12, 32, math32.Pi*2)
	mat := material.NewPhong(math32.NewColor("DarkBlue"))
	torusMesh := graphic.NewMesh(geom, mat)
	scene.Add(torusMesh)

	// Add lights to the scene
	ambientLight := light.NewAmbient(&math32.Color{1.0, 1.0, 1.0}, 0.8)
	scene.Add(ambientLight)
	pointLight := light.NewPoint(&math32.Color{1, 1, 1}, 5.0)
	pointLight.SetPosition(1, 0, 2)
	scene.Add(pointLight)

	// Add an axis helper to the scene
	axis := graphic.NewAxisHelper(0.5)
	scene.Add(axis)

	// Create a renderer and add default shaders
	rend := renderer.NewRenderer(gs)
	err = rend.AddDefaultShaders()
	if err != nil {
		panic(err)
	}
	rend.SetScene(scene)

	// Set window background color to gray
	gs.ClearColor(0.5, 0.5, 0.5, 1.0)

	server := make(chan command)
	go serverLoop(server) // spawn server handler

	// Render loop
	for !win.ShouldClose() {

		select {
		case cmd := <-server:
			switch cmd.code {
			case cmdRandomTorus:
				tm := graphic.NewMesh(geom, mat)
				tm.SetPosition(p, p, p)
				p += .2 // next "random" x,y,z
				scene.Add(tm)
			default:
				log.Printf("unknown server command: %d", cmd.code)
			}
		default: // prevent render loop from blocking on channel
		}

		// Render the scene using the specified camera
		rend.Render(camera)

		// Update window and check for I/O events
		win.SwapBuffers()
		wmgr.PollEvents()
	}
}

var p float32 = .2 // "random" x,y,z

const (
	cmdRandomTorus = iota
)

type command struct {
	code int
}

// serverLoop will fetch commands from server over the network
func serverLoop(ch chan<- command) {
	for {
		time.Sleep(time.Second * 2)
		ch <- command{code: cmdRandomTorus}
		time.Sleep(time.Second * 2)
		ch <- command{code: 999} // expect log errors for this
	}
}

repository: udhos/suco

repo_name: udhos/suco


text:
// Copyright 2018-2021 Polyaxon, 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.

// Code generated by go-swagger; DO NOT EDIT.

package organizations_v1

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

import (
	"fmt"
	"io"

	"github.com/go-openapi/runtime"
	"github.com/go-openapi/strfmt"

	"github.com/polyaxon/polyaxon/sdks/go/http_client/v1/service_model"
)

// BookmarkOrganizationRunsReader is a Reader for the BookmarkOrganizationRuns structure.
type BookmarkOrganizationRunsReader struct {
	formats strfmt.Registry
}

// ReadResponse reads a server response into the received o.
func (o *BookmarkOrganizationRunsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
	switch response.Code() {
	case 200:
		result := NewBookmarkOrganizationRunsOK()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 204:
		result := NewBookmarkOrganizationRunsNoContent()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return result, nil
	case 403:
		result := NewBookmarkOrganizationRunsForbidden()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	case 404:
		result := NewBookmarkOrganizationRunsNotFound()
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		return nil, result
	default:
		result := NewBookmarkOrganizationRunsDefault(response.Code())
		if err := result.readResponse(response, consumer, o.formats); err != nil {
			return nil, err
		}
		if response.Code()/100 == 2 {
			return result, nil
		}
		return nil, result
	}
}

// NewBookmarkOrganizationRunsOK creates a BookmarkOrganizationRunsOK with default headers values
func NewBookmarkOrganizationRunsOK() *BookmarkOrganizationRunsOK {
	return &BookmarkOrganizationRunsOK{}
}

/* BookmarkOrganizationRunsOK describes a response with status code 200, with default header values.

A successful response.
*/
type BookmarkOrganizationRunsOK struct {
}

func (o *BookmarkOrganizationRunsOK) Error() string {
	return fmt.Sprintf("[POST /api/v1/orgs/{owner}/runs/bookmark][%d] bookmarkOrganizationRunsOK ", 200)
}

func (o *BookmarkOrganizationRunsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	return nil
}

// NewBookmarkOrganizationRunsNoContent creates a BookmarkOrganizationRunsNoContent with default headers values
func NewBookmarkOrganizationRunsNoContent() *BookmarkOrganizationRunsNoContent {
	return &BookmarkOrganizationRunsNoContent{}
}

/* BookmarkOrganizationRunsNoContent describes a response with status code 204, with default header values.

No content.
*/
type BookmarkOrganizationRunsNoContent struct {
	Payload interface{}
}

func (o *BookmarkOrganizationRunsNoContent) Error() string {
	return fmt.Sprintf("[POST /api/v1/orgs/{owner}/runs/bookmark][%d] bookmarkOrganizationRunsNoContent  %+v", 204, o.Payload)
}
func (o *BookmarkOrganizationRunsNoContent) GetPayload() interface{} {
	return o.Payload
}

func (o *BookmarkOrganizationRunsNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewBookmarkOrganizationRunsForbidden creates a BookmarkOrganizationRunsForbidden with default headers values
func NewBookmarkOrganizationRunsForbidden() *BookmarkOrganizationRunsForbidden {
	return &BookmarkOrganizationRunsForbidden{}
}

/* BookmarkOrganizationRunsForbidden describes a response with status code 403, with default header values.

You don't have permission to access the resource.
*/
type BookmarkOrganizationRunsForbidden struct {
	Payload interface{}
}

func (o *BookmarkOrganizationRunsForbidden) Error() string {
	return fmt.Sprintf("[POST /api/v1/orgs/{owner}/runs/bookmark][%d] bookmarkOrganizationRunsForbidden  %+v", 403, o.Payload)
}
func (o *BookmarkOrganizationRunsForbidden) GetPayload() interface{} {
	return o.Payload
}

func (o *BookmarkOrganizationRunsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewBookmarkOrganizationRunsNotFound creates a BookmarkOrganizationRunsNotFound with default headers values
func NewBookmarkOrganizationRunsNotFound() *BookmarkOrganizationRunsNotFound {
	return &BookmarkOrganizationRunsNotFound{}
}

/* BookmarkOrganizationRunsNotFound describes a response with status code 404, with default header values.

Resource does not exist.
*/
type BookmarkOrganizationRunsNotFound struct {
	Payload interface{}
}

func (o *BookmarkOrganizationRunsNotFound) Error() string {
	return fmt.Sprintf("[POST /api/v1/orgs/{owner}/runs/bookmark][%d] bookmarkOrganizationRunsNotFound  %+v", 404, o.Payload)
}
func (o *BookmarkOrganizationRunsNotFound) GetPayload() interface{} {
	return o.Payload
}

func (o *BookmarkOrganizationRunsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	// response payload
	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

// NewBookmarkOrganizationRunsDefault creates a BookmarkOrganizationRunsDefault with default headers values
func NewBookmarkOrganizationRunsDefault(code int) *BookmarkOrganizationRunsDefault {
	return &BookmarkOrganizationRunsDefault{
		_statusCode: code,
	}
}

/* BookmarkOrganizationRunsDefault describes a response with status code -1, with default header values.

An unexpected error response.
*/
type BookmarkOrganizationRunsDefault struct {
	_statusCode int

	Payload *service_model.RuntimeError
}

// Code gets the status code for the bookmark organization runs default response
func (o *BookmarkOrganizationRunsDefault) Code() int {
	return o._statusCode
}

func (o *BookmarkOrganizationRunsDefault) Error() string {
	return fmt.Sprintf("[POST /api/v1/orgs/{owner}/runs/bookmark][%d] BookmarkOrganizationRuns default  %+v", o._statusCode, o.Payload)
}
func (o *BookmarkOrganizationRunsDefault) GetPayload() *service_model.RuntimeError {
	return o.Payload
}

func (o *BookmarkOrganizationRunsDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {

	o.Payload = new(service_model.RuntimeError)

	// response payload
	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
		return err
	}

	return nil
}

repository: alexander-manley/polyaxon

repo_name: alexander-manley/polyaxon


text:
@article{smith_pope_2012,
 author = {Smith, Innocent},
 journal = {Dominicana},
 number = {2},
 pages = {102--107},
 title = {The Pope and the Teddy Bear},
 volume = {55},
 year = {2012}
}

repository: innocentop/innocentsmith

repo_name: innocentop/innocentsmith


text:
@phdthesis{Kent2015a,
 abstract = {This thesis investigates the notion of fuel-reduction through formation flight for com- mercial aircraft, addressing the problems of global routing and assignment. A two stage centralised approach is presented, firstly, assuming a reduction in observed cost by flying in formation the routes, including rendezvous and break points, are calcu- lated to minimise a total cost. The interconnected assignment problem then takes a set of flights, their possible formations and corresponding costs and optimally allo- cates them into a cost-minimising formation fleet. An analytic geometric approach is used to develop a scalable methodology for the formation routing problem enabling the quick calculation of costs. The rapid evaluation allows the large scale fleet assignment problem to be solved via a Mixed Integer Linear Program in reasonable time. A Transatlantic case study shows possible formation fuel savings against solo flight of around 8.7% and 13.1% for formations up to size two and three respectively. Further case studies of three distinct sets of flights show that encouraging levels of saving can still be achieved by flights with varied distances, geographical locations and formation drag-reduction levels. For the more complex task of routing through wind, results show that the analytic approach can act as a reasonable estimate to the assignment problem, allowing higher- fidelity and computationally more intensive routing methods to be introduced via a post-process, significantly reducing solve time. Methods for mitigating the impact of uncertainty in aircraft take-off times are ex- plored, where a state-space approach, solved using value iteration, can provide optimal speed-policies for aircraft to follow for any possible realisation of delay. Additionally portfolio optimisation provides a method for formations to be assigned to simultane- ously maximise reward and minimise the associated risk. Finally the calculation of efficient frontiers allows matching of reward to desired levels of risk-aversion.},
 author = {Kent, Thomas E},
 doi = {10.13140/RG.2.2.27277.74721},
 file = {:home/aetek/Documents/Mendeley Papers/Kent - 2015 - Optimal Routing and Assignment for Commercial Formation Flight - Unknown.pdf:pdf},
 number = {July 2015},
 pages = {211},
 school = {University of Bristol},
 title = {Optimal Routing and Assignment for Commercial Formation Flight},
 year = {2015}
}

repository: tomekent/portfolio

repo_name: tomekent/portfolio


text:
AUTHOR = "Dimitris Tassopoulos <dimtass@gmail.com>"
SECTION = "kernel"
LICENSE = "GPLv2"
COMPATIBLE_MACHINE = "(sun8i|sun50i)"

inherit kernel
require recipes-kernel/linux/linux-yocto.inc

LIC_FILES_CHKSUM = "file://COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"

# Pull in the devicetree files and u-boot config files into the rootfs
RDEPENDS_${KERNEL_PACKAGE_NAME}-base += "kernel-devicetree u-boot"

KERNEL_EXTRA_ARGS += "LOADADDR=${UBOOT_ENTRYPOINT}"

LINUX_VERSION = "4.19"
LINUX_VERSION_EXTENSION = "-allwinner"

FILESEXTRAPATHS_prepend := "${THISDIR}/linux_4.19:"

S = "${WORKDIR}/git"

PV = "4.19.81"
SRCREV = "ef244c3088856cf048c77231653b4c92a7b2213c"

SRC_URI = " \
        git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git;branch=linux-${LINUX_VERSION}.y \
        file://do_patch.sh \
        file://patches-${LINUX_VERSION} \
        file://custom-patches-${LINUX_VERSION} \
        file://${SOC_FAMILY}-defconfig/defconfig \
"

# Apply the armbian patches and defconfig
do_patch_append() {
    cp ${WORKDIR}/${SOC_FAMILY}-defconfig/defconfig ${WORKDIR}/defconfig
    cd ${WORKDIR}/git
    ${WORKDIR}/do_patch.sh ${WORKDIR}/patches-${LINUX_VERSION}
    ${WORKDIR}/do_patch.sh ${WORKDIR}/custom-patches-${LINUX_VERSION}
}

python() {
    if not d.getVar('SOC_FAMILY'):
        bb.fatal("You need to set 'SOC_FAMILY' in your local.conf file to 'sunxi' or 'sunxi64' depending your board.")
    else:
        bb.note("%s-defconfig/defconfig will be used for the kernel." % (d.getVar('SOC_FAMILY')))
}

repository: asupawat/meta-allwinner-hx

repo_name: asupawat/meta-allwinner-hx


text:
DESCRIPTION = "Python Cairo Bindings"
SECTION = "devel/python"
PRIORITY = "optional"
MAINTAINER = "Sandino 'Tigrux' Flores <tigrux@ximian.com>"
DEPENDS = "python-pygtk cairo"
SRCNAME = "pycairo"
PV = "0.0+cvs${SRCDATE}"
LICENSE = "LGPL MPL"
inherit autotools

SRC_URI = "cvs://anoncvs@cvs.cairographics.org/cvs/cairo;module=pycairo"
S = "${WORKDIR}/${SRCNAME}"

FILES_${PN} = "${libdir}/${PYTHON_DIR}/"


text:
package main

import (
	"bufio"
	"encoding/binary"
	"errors"
	"fmt"
	"io"
	"log"
	"net"
	"sync"
)

func handshake(r *bufio.Reader, conn net.Conn) error {
	version, _ := r.ReadByte() //ReadByte 代表读取一个字节
	//处理第一个字节
	log.Printf("version:%d", version)
	if version != 5 {
		return errors.New("bad version")
	}
	//处理第二个字节
	nmethods, _ := r.ReadByte()
	buf := make([]byte, nmethods)
	io.ReadFull(r, buf) //将buf填充满
	log.Printf("%v", buf)

	//返回数据
	resp := []byte{5, 0}
	conn.Write(resp)
	return nil
}

func readAddr(r *bufio.Reader) (string, error) {
	//处理第一个数据
	version, _ := r.ReadByte()
	log.Printf("version:%d", version)
	if version != 5 {
		return "", errors.New("bad version")
	}

	//处理第二个数据
	cmd, err := r.ReadByte()
	if err != nil {
		return "", err
	}
	log.Printf("%s", cmd)
	if cmd != 1 {
		return "", errors.New("bad cmd")
	}

	//处理第三个数据(保留数据跳过即可)
	r.ReadByte()

	//处理第四个数据
	readtype, _ := r.ReadByte()
	log.Printf("%s", readtype)
	if readtype != 3 {
		return "", errors.New("bad type")
	}

	//处理第五个数据
	/*
		读取一个字节的数据,代表后面竟跟着域名的长度
		读取n个字节的得到域名,n根据上一步得到的结果来决定
		addrlen  长度
		addr     地址
	*/
	addrlen, _ := r.ReadByte()
	addr := make([]byte, addrlen)
	io.ReadFull(r, addr)
	log.Printf("addrlen:%s", addrlen)
	log.Printf("addr:%s", addr)

	//处理第六个数据,占位2个字节
	var port int16
	binary.Read(r, binary.BigEndian, &port)

	return fmt.Sprintf("%s:%d", addr, port), nil
}

func handleConn(conn net.Conn) {
	defer conn.Close()
	/*
		参考链接地址: http://www.jianshu.com/p/172810a70fad

		1.握手
		socks5 接收3个字段的数据
			第一个字段 1个字节  VER 代表版本
			第二个字段 1个字节  NMETHODS 表示第三个字段的长度
			第三个字段 1-255个字节 METHODS 表示客户端支持的认证方式
		2.获取客户端代理的请求
			第一个字段 1个字节  VER 代表版本
			第二个字段 1个字节
			第三个字段 1个字节
			第四个字段 1个字节
			第五个字段
			第六个字段 2个字节
		3.开始代理
	*/
	r := bufio.NewReader(conn)
	//开始代理
	handshake(r, conn)
	//获取客户端代理的请求
	addr, err := readAddr(r)
	if err != nil {
		log.Print("Addr Error:", err)
		return
	}
	log.Printf("addr:", addr)
	resp := []byte{0x05, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
	conn.Write(resp)
	//开始代理
	var remote net.Conn

	remote, err = net.Dial("tcp", addr)
	if err != nil {
		log.Print("Error:", err)
		return
	}

	wg := new(sync.WaitGroup)
	wg.Add(2)
	//go 接收客户端的数据,发送到remote,直到conn的EOF
	go func() {
		defer wg.Done()
		io.Copy(remote, conn)
		remote.Close()
	}()
	//go 接收remote的数据,发送到客户端,直到remote的EOF
	go func() {
		defer wg.Done()
		io.Copy(conn, remote)
		conn.Close()
	}()
	//等待两个协程结束
	wg.Wait()
}

func main() {
	//建立监听
	addr := ":9999"
	listener, err := net.Listen("tcp", addr)
	if err != nil {
		log.Fatal(err)
	}
	defer listener.Close()
	//接收新的连接
	for {
		//accept new conection
		conn, err := listener.Accept()
		log.Print(conn.RemoteAddr())
		if err != nil {
			log.Print(err)
		}
		// 参考页面 http://www.jianshu.com/p/172810a70fad
		go handleConn(conn)
	}
}


text:
package gostrutils

import (
	"reflect"
	"testing"
)

func TestStrToInt64Valid(t *testing.T) {
	result := StrToInt64("-42", 2)
	if result != -42 {
		t.Errorf("Invalid result value, expected '-42', got %d", result)
	}
}

func TestStrToInt64WithDefaultValue(t *testing.T) {
	result := StrToInt64("a", -42)
	if result != -42 {
		t.Errorf("Invalid result value, expected '-42', got %d", result)
	}
}

func TestStrToUInt64Valid(t *testing.T) {
	result := StrToUInt64("42", 2)
	if result != 42 {
		t.Errorf("Invalid result value, expected '42', got %d", result)
	}
}

func TestStrToUInt64WithDefaultValue(t *testing.T) {
	result := StrToUInt64("a", 42)
	if result != 42 {
		t.Errorf("Invalid result value, expected '42', got %d", result)
	}
}

func TestUInt64JoinSimple(t *testing.T) {
	var list []uint64
	list = append(list, 1, 2, 3, 4)
	str := UInt64Join(list, ",")
	if str != "1,2,3,4" {
		t.Errorf("Expected a string of '1,2,3,4', got: '%s'", str)
	}
}

func TestUInt64JoinEmpty(t *testing.T) {
	var list []uint64
	str := UInt64Join(list, ",")
	if str != "" {
		t.Errorf("Expected empty string, got '%s'", str)
	}
}

func TestUInt64JoinSingle(t *testing.T) {
	var list []uint64
	list = append(list, 1)
	str := UInt64Join(list, ",")
	if str != "1" {
		t.Errorf("Expected '1', got '%s'", str)
	}
}

func TestInt64JoinSimple(t *testing.T) {
	var list []int64
	list = append(list, -1, 2, 3, 4)
	str := Int64Join(list, ",")
	if str != "-1,2,3,4" {
		t.Errorf("Expected a string of '-1,2,3,4', got: '%s'", str)
	}
}

func TestInt64JoinEmpty(t *testing.T) {
	var list []int64
	str := Int64Join(list, ",")
	if str != "" {
		t.Errorf("Expected empty string, got '%s'", str)
	}
}

func TestInt64JoinSingle(t *testing.T) {
	var list []int64
	list = append(list, -1)
	str := Int64Join(list, ",")
	if str != "-1" {
		t.Errorf("Expected '-1', got '%s'", str)
	}
}

func TestUin64SplitSimple(t *testing.T) {
	list := Uin64Split("1,2,3,4", ",")
	var expected []uint64
	expected = append(expected, 1, 2, 3, 4)
	if !reflect.DeepEqual(list, expected) {
		t.Errorf("Invalid list was provided, expected list of: %+v, got %+v", expected, list)
	}
}

func TestIn64Split(t *testing.T) {
	list := In64Split("-1,2,3,4", ",")
	var expected []int64
	expected = append(expected, -1, 2, 3, 4)
	if !reflect.DeepEqual(list, expected) {
		t.Errorf("Invalid list was provided, expected list of: %+v, got %+v", expected, list)
	}
}

func TestToFloat32DefaultSimple(t *testing.T) {
	num := ToFloat32Default("3.14", 1.0)
	if num != 3.14 {
		t.Errorf("Expected '3.14', got %f", num)
	}
}

func TestToFloat32DefaultWithDefault(t *testing.T) {
	num := ToFloat32Default(".", 3.14)
	if num != 3.14 {
		t.Errorf("Expected '3.14', got %f", num)
	}
}

func TestToFloat32Valid(t *testing.T) {
	num := ToFloat32("3.14")
	if num != 3.14 {
		t.Errorf("Expected '3.14', got '%f'", num)
	}
}

func TestToFloat32Zero(t *testing.T) {
	num := ToFloat32("Hello World")
	if num != 0.0 {
		t.Errorf("Expected '0.0', got '%f'", num)
	}
}

func TestToFloat64DefaultSimple(t *testing.T) {
	num := ToFloat6Default("3.14", 1.0)
	if num != 3.14 {
		t.Errorf("Expected '3.14', got %f", num)
	}
}

func TestToFloat64DefaultWithDefault(t *testing.T) {
	num := ToFloat6Default(".", 3.14)
	if num != 3.14 {
		t.Errorf("Expected '3.14', got %f", num)
	}
}

func TestToFloat64Valid(t *testing.T) {
	num := ToFloat64("3.14")
	if num != 3.14 {
		t.Errorf("Expected '3.14', got '%f'", num)
	}
}

func TestToFloat64Zero(t *testing.T) {
	num := ToFloat64("Hello World")
	if num != 0.0 {
		t.Errorf("Expected '0.0', got '%f'", num)
	}
}

func TestIsUIntegerTrue(t *testing.T) {
	txt := "42"
	result := IsUInteger(txt)
	if !result {
		t.Errorf("Expected `%s` to be true", txt)
	}
}

func TestIsUIntegerFalse(t *testing.T) {
	txt := "42 Meaning"
	result := IsUInteger(txt)
	if result {
		t.Errorf("Expected `%s` to be false", txt)
	}
}

func TestIsIntegerTrue(t *testing.T) {
	txt := "-42"
	result := IsInteger(txt)
	if !result {
		t.Errorf("Expected `%s` to be true", txt)
	}
}

func TestIsIntegerFalse(t *testing.T) {
	txt := "-42 Meaning"
	result := IsInteger(txt)
	if result {
		t.Errorf("Expected `%s` to be false", txt)
	}
}

func TestIsUFloatTrue(t *testing.T) {
	txt := "3.14"
	result := IsUFloat(txt)
	if !result {
		t.Errorf("Expected `%s` to be true", txt)
	}
}

func TestIsUFloatFalse(t *testing.T) {
	txt := "-3.14"
	result := IsUFloat(txt)
	if result {
		t.Errorf("Exprected `%s` to be false", txt)
	}
}

func TestIsFloatTrue(t *testing.T) {
	txt := "-3.14"
	result := IsFloat(txt)
	if !result {
		t.Errorf("Exprected `%s` to be true", txt)
	}
}

func TestIsFloatFalse(t *testing.T) {
	txt := "42"
	result := IsFloat(txt)
	if result {
		t.Errorf("Expected `%s` to be true", txt)
	}
}

func TestIsUNumberIntTrue(t *testing.T) {
	txt := "42"
	result := IsUNumber(txt)
	if !result {
		t.Errorf("Expected `%s` to be true", txt)
	}
}

func TestIsUNumberFloatTrue(t *testing.T) {
	txt := "3.14"
	result := IsUNumber(txt)
	if !result {
		t.Errorf("Expected `%s` to be true", txt)
	}
}

func TestUNumberFalse(t *testing.T) {
	txt := "42 meaning"
	result := IsUNumber(txt)
	if result {
		t.Errorf("Expected `%s` to be false", txt)
	}
}

func TestIsNumberIntTrue(t *testing.T) {
	txt := "-42"
	result := IsNumber(txt)
	if !result {
		t.Errorf("Expected `%s` to be true", txt)
	}
}

func TestIsNumberFloatTrue(t *testing.T) {
	txt := "-3.14"
	result := IsNumber(txt)
	if !result {
		t.Errorf("Expected `%s` to be true", txt)
	}
}

func TestNumberFalse(t *testing.T) {
	txt := "42 meaning"
	result := IsNumber(txt)
	if result {
		t.Errorf("Expected `%s` to be false", txt)
	}
}

func TestIsInRange(t *testing.T) {
	type rang struct {
		min      int64
		max      int64
		src      string
		expected bool
	}

	var toCheckFalse = []rang{
		{
			min:      10,
			max:      1,
			expected: false,
		},

		{
			min:      0,
			max:      1,
			src:      "",
			expected: false,
		},

		{
			min:      0,
			max:      1,
			src:      "a",
			expected: false,
		},

		{
			min:      5,
			max:      10,
			src:      "1",
			expected: false,
		},

		{
			min:      0,
			max:      10,
			src:      "100",
			expected: false,
		},

		{
			min:      0,
			max:      15,
			src:      "020",
			expected: false,
		},

		{
			min:      0,
			max:      16,
			src:      "0x0f",
			expected: false,
		},
	}

	var toCheckTrue = []rang{
		{
			min:      0,
			max:      1,
			src:      "0",
			expected: true,
		},
		{
			min:      0,
			max:      5,
			src:      "5",
			expected: true,
		},
		{
			min:      0,
			max:      10,
			src:      "8",
			expected: true,
		},
	}

	t.Run("to_check_false", func(t2 *testing.T) {
		for _, item := range toCheckFalse {
			result := IsInRange(item.min, item.max, item.src)

			if result != item.expected {
				t2.Errorf("%#v | Expected %t got %t", item, item.expected, result)
			}
		}
	})

	t.Run("to_check_true", func(t2 *testing.T) {
		for _, item := range toCheckTrue {
			result := IsInRange(item.min, item.max, item.src)

			if result != item.expected {
				t2.Errorf("%#v | Expected %t got %t", item, item.expected, result)
			}

		}
	})
}


text:
package gorm

import (
	"context"

	"github.com/chunganhbk/gin-go/internal/app/schema"
	"github.com/chunganhbk/gin-go/pkg/util"
	"github.com/jinzhu/gorm"
)

// GetMenuActionDB
func GetMenuActionDB(ctx context.Context, defDB *gorm.DB) *gorm.DB {
	return GetDBWithModel(ctx, defDB, new(MenuAction))
}

// SchemaMenuAction
type SchemaMenuAction schema.MenuAction

// ToMenuAction
func (a SchemaMenuAction) ToMenuAction() *MenuAction {
	item := new(MenuAction)
	util.StructMapToStruct(a, item)
	return item
}

// MenuAction
type MenuAction struct {
	Model
	MenuID string `gorm:"column:menu_id;size:36;index;default:'';not null;"`
	Code   string `gorm:"column:code;size:100;default:'';not null;"`
	Name   string `gorm:"column:name;size:100;default:'';not null;"`
}

// ToSchema MenuAction
func (a MenuAction) ToSchemaMenuAction() *schema.MenuAction {
	item := new(schema.MenuAction)
	util.StructMapToStruct(a, item)
	return item
}

// Menu Actions
type MenuActions []*MenuAction

// ToSchema Menu Actions
func (a MenuActions) ToSchemaMenuActions() []*schema.MenuAction {
	list := make([]*schema.MenuAction, len(a))
	for i, item := range a {
		list[i] = item.ToSchemaMenuAction()
	}
	return list
}

repository: chunganhbk/gin-go

repo_name: chunganhbk/gin-go


text:
package client

import (
	"testing"

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

	"github.com/dnovikoff/tempai-core/compact"
	"github.com/dnovikoff/tempai-core/score"
	"github.com/dnovikoff/tempai-core/tile"
	"github.com/dnovikoff/tenhou/tbase"
)

func TestSMessageDrop(t *testing.T) {
	c := NewXMLWriter()
	test := func(o tbase.Opponent, i tile.Instance, isTg bool, s Suggest) {
		params := Drop{}
		params.Opponent = o
		params.Instance = i
		params.IsTsumogiri = isTg
		params.Suggest = s
		c.Drop(params)
	}
	test(tbase.Self, tile.Green.Instance(0), false, 0)
	test(tbase.Self, tile.Green.Instance(0), true, 0)

	test(tbase.Right, tile.Man1.Instance(0), false, 0)
	test(tbase.Right, tile.Man1.Instance(0), true, 0)

	test(tbase.Front, tile.Man2.Instance(0), false, 0)
	test(tbase.Front, tile.Man2.Instance(0), true, 0)

	test(tbase.Left, tile.Man1.Instance(1), false, 0)
	test(tbase.Left, tile.Man1.Instance(1), true, 1)

	assert.Equal(t, `<D128/> <d128/> <E0/> <e0/> <F4/> <f4/> <G1/> <g1 t="1"/>`, c.String())
}

func TestSMessageTake(t *testing.T) {
	c := NewXMLWriter()
	test := func(o tbase.Opponent, i tile.Instance, s Suggest) {
		params := Take{}
		params.Opponent = o
		params.Instance = i
		params.Suggest = s
		c.Take(params)
	}
	test(tbase.Self, tile.Pin1.Instance(0), 0)
	test(tbase.Self, tile.Pin1.Instance(0), 1)
	test(tbase.Right, tile.Pin1.Instance(0), 0)
	test(tbase.Front, tile.Pin1.Instance(0), 0)
	test(tbase.Left, tile.Pin1.Instance(0), 1)
	assert.Equal(t, `<T36/> <T36 t="1"/> <U/> <V/> <W/>`, c.String())
}

func TestSMessageReach(t *testing.T) {
	c := NewXMLWriter()
	test := func(o tbase.Opponent, step int, sc []score.Money) {
		params := Reach{}
		params.Opponent = o
		params.Step = step
		params.Score = sc
		c.Reach(params)
	}
	test(tbase.Front, 1, nil)
	test(tbase.Self, 2, []score.Money{25000, 25000, 25000, 24000})

	assert.Equal(t, `<REACH who="2" step="1"/> <REACH who="0" ten="250,250,250,240" step="2"/>`, c.String())
}

func TestSDeclare(t *testing.T) {
	c := NewXMLWriter()
	x := &tbase.Called{
		Type:     tbase.Pon,
		Opponent: tbase.Front,
		Called:   tile.Sou4.Instance(3),
		Upgraded: tile.Sou4.Instance(2),
	}
	params := Declare{}
	params.Opponent = tbase.Self
	params.Meld = tbase.EncodeCalled(x)
	c.Declare(params)
	assert.Equal(t, `<N who="0" m="33354"/>`, c.String())
}

func TestSInit(t *testing.T) {
	c := NewXMLWriter()
	tg := compact.NewTileGenerator()
	tiles, err := tg.InstancesFromString("579m577p234679s57z")
	require.NoError(t, err)
	b := tbase.Init{
		tbase.Seed{
			RoundNumber: 1,
			Honba:       2,
			Sticks:      3,
			Dice:        [2]int{5, 4},
			Indicator:   tg.Instance(tile.Man4),
		},
		[]score.Money{25000, 25000, 25000, 24000},
		tbase.Front,
		nil,
	}
	c.Init(Init{b, tiles})

	assert.Equal(t, `<INIT seed="1,2,3,5,4,12" ten="250,250,250,240" oya="2" hai="16,24,32,52,60,61,76,80,84,92,96,104,124,132"/>`, c.String())
}

func TestSLogInfo(t *testing.T) {
	c := NewXMLWriter()
	c.LogInfo(LogInfo{WithDealer{tbase.Front}, "2018011712gm-0009-0000-84f0883b"})
	assert.Equal(t, `<TAIKYOKU oya="2" log="2018011712gm-0009-0000-84f0883b"/>`, c.String())
}

func TestSGo(t *testing.T) {
	c := NewXMLWriter()
	c.Go(Go{WithLobby{LobbyNumber: 0, LobbyType: 9}, "12D32385-4987D01D"})
	assert.Equal(t, `<GO type="9" lobby="0" gpid="12D32385-4987D01D"/>`, c.String())
}

func TestSUN(t *testing.T) {
	c := NewXMLWriter()
	c.UserList(UserList{tbase.UserList{
		Names: []string{"NoName", "@yukimi", "さあ、行くぞ", "pjgwpdjw"},
		Sex:   []tbase.Sex{tbase.SexMale, tbase.SexFemale, tbase.SexMale, tbase.SexMale},
		Dan:   []int{0, 2, 10, 0},
		Rate:  []tbase.Float{{Value: 1500}, {Value: 1499.99}, {Value: 1467.57}, {Value: 1500}},
	}})

	assert.Equal(t, `<UN n0="%4E%6F%4E%61%6D%65" n1="%40%79%75%6B%69%6D%69" n2="%E3%81%95%E3%81%82%E3%80%81%E8%A1%8C%E3%81%8F%E3%81%9E" n3="%70%6A%67%77%70%64%6A%77" dan="0,2,10,0" rate="1500.00,1499.99,1467.57,1500.00" sx="M,F,M,M"/>`,
		c.String())
}

func TestSHello(t *testing.T) {
	c := NewXMLWriter()
	c.Hello(Hello{
		Name:        "NoName",
		Auth:        "20180117-e7b5e83e",
		RatingScale: DefaultRatingScale})
	assert.Equal(t, `<HELO uname="%4E%6F%4E%61%6D%65" auth="20180117-e7b5e83e" ratingscale="PF3=1.000000&PF4=1.000000&PF01C=0.582222&PF02C=0.501632&PF03C=0.414869&PF11C=0.823386&PF12C=0.709416&PF13C=0.586714&PF23C=0.378722&PF33C=0.535594&PF1C00=8.000000"/>`,
		c.String())
}

// Get: <AGARI ba="0,1" hai="14,18,19,21,23,26,36,37,57,63,66,82,84,91" machi="91" ten="20,5200,0" yaku="1,1,0,1,7,1,52,1,53,0" doraHai="79,33" doraHaiUra="29,50" who="3" fromWho="3" sc="250,-13,250,-13,250,-26,240,62" />
// <PROF lobby="0" type="9" add="-39.0,0,0,0,1,0,9,0,2,4,1"/>
// <RYUUKYOKU ba="0,1" sc="120,-10,404,-10,246,-10,220,30" hai3="19,22,26,29,30,62,66,81,84,91,98,102,105" owari="110,-39.0,404,50.0,236,-16.0,250,5.0" />
// <PROF lobby="0" type="9" add="-38.0,0,0,0,1,0,8,1,1,4,2"/> <AGARI ba="0,0" hai="23,24,31,56,62,66,83,86,89,100,101" m="15977" machi="66" ten="30,1100,0" yaku="8,1" doraHai="14" who="1" fromWho="1" sc="124,-3,372,11,141,-3,363,-5" owari="121,-38.0,383,48.0,138,-26.0,358,16.0" />

repository: dnovikoff/tenhou

repo_name: dnovikoff/tenhou


text:
require xorg-driver-video.inc
PE = "1"

DESCRIPTION = "X.Org X server -- legacy S3 display driver"
SRC_URI[archive.md5sum] = "5eb06d88533fb327d067928faeb20860"
SRC_URI[archive.sha256sum] = "ed9f65aa6eb1811d8c16cddfce00c5fc5880d6d46b907a83ef77700610085144"