text:
package ecs

import (
	"context"
	"encoding/json"
	"fmt"
	"k8s.io/klog/v2"
	"strings"

	v1 "k8s.io/api/core/v1"
	ctrlCfg "k8s.io/cloud-provider-alibaba-cloud/pkg/config"
	"k8s.io/cloud-provider-alibaba-cloud/pkg/model"
	"k8s.io/cloud-provider-alibaba-cloud/pkg/provider"
	"k8s.io/cloud-provider-alibaba-cloud/pkg/provider/alibaba/base"
	"k8s.io/cloud-provider-alibaba-cloud/pkg/provider/alibaba/util"

	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
)

const (
	MaxNetworkInterfaceNum = 100
)

func NewECSProvider(
	auth *base.ClientMgr,
) *ECSProvider {
	return &ECSProvider{auth: auth}
}

var _ prvd.IInstance = &ECSProvider{}

type ECSProvider struct {
	auth *base.ClientMgr
}

func (e *ECSProvider) ListInstances(ctx context.Context, ids []string) (map[string]*prvd.NodeAttribute, error) {
	nodeRegionMap := make(map[string][]string)
	for _, id := range ids {
		regionID, nodeID, err := util.NodeFromProviderID(id)
		if err != nil {
			return nil, err
		}
		nodeRegionMap[regionID] = append(nodeRegionMap[regionID], nodeID)
	}

	var insList []ecs.Instance
	for region, nodes := range nodeRegionMap {
		ins, err := e.getInstances(nodes, region)
		if err != nil {
			return nil, err
		}
		insList = append(insList, ins...)
	}
	mins := make(map[string]*prvd.NodeAttribute)
	for _, id := range ids {
		mins[id] = nil
		for _, n := range insList {
			if strings.Contains(id, n.InstanceId) {
				mins[id] = &prvd.NodeAttribute{
					InstanceID:   n.InstanceId,
					InstanceType: n.InstanceType,
					Addresses:    findAddress(&n),
					Zone:         n.ZoneId,
					Region:       n.RegionId,
				}
				break
			}
		}
	}
	return mins, nil
}

func (e *ECSProvider) GetInstancesByIP(ctx context.Context, ips []string) (*prvd.NodeAttribute, error) {
	req := ecs.CreateDescribeInstancesRequest()
	req.InstanceNetworkType = "vpc"
	bips, err := json.Marshal(ips)
	if err != nil {
		return nil, fmt.Errorf("node ips %v marshal error: %s", ips, err.Error())
	}
	req.PrivateIpAddresses = string(bips)
	req.VpcId, err = e.auth.Meta.VpcID()
	if err != nil {
		return nil, fmt.Errorf("get vpc id error: %s", err.Error())
	}
	req.Tag = &[]ecs.DescribeInstancesTag{
		{
			Key: ctrlCfg.CloudCFG.GetKubernetesClusterTag(),
		},
	}
	resp, err := e.auth.ECS.DescribeInstances(req)
	if err != nil {
		klog.V(5).Infof("RequestId: %s, API: %s, ips: %s", resp.RequestId, "DescribeInstances", req.PrivateIpAddresses)
		return nil, fmt.Errorf("describe instances by ip %s error: %s", ips, err.Error())
	}

	if len(resp.Instances.Instance) != 1 {
		klog.V(5).Infof("RequestId: %s, API: %s, ips: %s", resp.RequestId, "DescribeInstances", req.PrivateIpAddresses)
		return nil, fmt.Errorf("find none or multiple instances by ip %s", ips)
	}

	ins := resp.Instances.Instance[0]

	return &prvd.NodeAttribute{
		InstanceID:   ins.InstanceId,
		InstanceType: ins.InstanceType,
		Addresses:    findAddress(&ins),
		Zone:         ins.ZoneId,
		Region:       e.auth.Region,
	}, nil
}

func (e *ECSProvider) getInstances(ids []string, region string) ([]ecs.Instance, error) {
	bids, err := json.Marshal(ids)
	if err != nil {
		return nil, fmt.Errorf("get instances error: %s", err.Error())
	}
	req := ecs.CreateDescribeInstancesRequest()
	req.RegionId = region
	req.InstanceIds = string(bids)
	req.NextToken = ""
	req.MaxResults = requests.NewInteger(50)

	var ecsInstances []ecs.Instance
	for {
		resp, err := e.auth.ECS.DescribeInstances(req)
		if err != nil {
			klog.Errorf("calling DescribeInstances: region=%s, "+
				"instancename=%s, message=[%s].", req.RegionId, req.InstanceName, err.Error())
			return nil, err
		}
		klog.V(5).Infof("RequestId: %s, API: %s, ids: %s", resp.RequestId, "DescribeInstances", string(bids))
		ecsInstances = append(ecsInstances, resp.Instances.Instance...)
		if resp.NextToken == "" {
			break
		}

		req.NextToken = resp.NextToken
	}

	return ecsInstances, nil
}

func (e *ECSProvider) DescribeNetworkInterfaces(vpcId string, ips []string, ipVersionType model.AddressIPVersionType) (map[string]string, error) {
	result := make(map[string]string)

	for begin := 0; begin < len(ips); begin += MaxNetworkInterfaceNum {
		last := len(ips)
		if begin+MaxNetworkInterfaceNum < last {
			last = begin + MaxNetworkInterfaceNum
		}
		privateIpAddress := ips[begin:last]

		req := ecs.CreateDescribeNetworkInterfacesRequest()
		req.VpcId = vpcId
		req.Status = "InUse"
		if ipVersionType == model.IPv6 {
			req.Ipv6Address = &privateIpAddress
		} else {
			req.PrivateIpAddress = &privateIpAddress
		}
		next := &util.Pagination{
			PageNumber: 1,
			PageSize:   100,
		}

		for {
			req.PageSize = requests.NewInteger(next.PageSize)
			req.PageNumber = requests.NewInteger(next.PageNumber)
			resp, err := e.auth.ECS.DescribeNetworkInterfaces(req)
			if err != nil {
				return result, err
			}
			klog.V(5).Infof("RequestId: %s, API: %s, ips: %s, privateIpAddress[%d:%d]",
				resp.RequestId, "DescribeNetworkInterfaces", privateIpAddress, begin, last)

			for _, eni := range resp.NetworkInterfaceSets.NetworkInterfaceSet {

				if ipVersionType == model.IPv6 {
					for _, ipv6 := range eni.Ipv6Sets.Ipv6Set {
						result[ipv6.Ipv6Address] = eni.NetworkInterfaceId
					}
				} else {
					for _, privateIp := range eni.PrivateIpSets.PrivateIpSet {
						result[privateIp.PrivateIpAddress] = eni.NetworkInterfaceId
					}
				}
			}

			pageResult := &util.PaginationResult{
				PageNumber: resp.PageNumber,
				PageSize:   resp.PageSize,
				TotalCount: resp.TotalCount,
			}
			next = pageResult.NextPage()
			if next == nil {
				break
			}
		}

	}
	return result, nil
}

func findAddress(instance *ecs.Instance) []v1.NodeAddress {
	var addrs []v1.NodeAddress

	if len(instance.PublicIpAddress.IpAddress) > 0 {
		for _, ipaddr := range instance.PublicIpAddress.IpAddress {
			addrs = append(addrs, v1.NodeAddress{Type: v1.NodeExternalIP, Address: ipaddr})
		}
	}

	if instance.EipAddress.IpAddress != "" {
		addrs = append(addrs, v1.NodeAddress{Type: v1.NodeExternalIP, Address: instance.EipAddress.IpAddress})
	}

	if len(instance.InnerIpAddress.IpAddress) > 0 {
		for _, ipaddr := range instance.InnerIpAddress.IpAddress {
			addrs = append(addrs, v1.NodeAddress{Type: v1.NodeInternalIP, Address: ipaddr})
		}
	}

	if len(instance.VpcAttributes.PrivateIpAddress.IpAddress) > 0 {
		for _, ipaddr := range instance.VpcAttributes.PrivateIpAddress.IpAddress {
			addrs = append(addrs, v1.NodeAddress{Type: v1.NodeInternalIP, Address: ipaddr})
		}
	}

	return addrs
}

func (e *ECSProvider) DeleteInstance(ctx context.Context, id string) error {
	req := ecs.CreateDeleteInstanceRequest()
	req.InstanceId = id
	_, err := e.auth.ECS.DeleteInstance(req)
	if err != nil {
		klog.Errorf("calling DeleteInstance: region=%s, instanceID=%s, message=[%s].", req.RegionId, id, err.Error())
		return err
	}
	return nil
}

repository: kubernetes/cloud-provider-alibaba-cloud

repo_name: kubernetes/cloud-provider-alibaba-cloud


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

package buffercache

import (
	"github.com/lpabon/godbc"
	"sync"
)

type ClockCacheBlock struct {
	key  uint64
	mru  bool
	used bool
	data []byte
}

type ClockCache struct {
	cacheblocks []ClockCacheBlock
	keymap      map[uint64]uint64
	index       uint64
	lock        sync.Mutex
}

func NewClockCache(cachesize, blocksize uint64) *ClockCache {

	b := &ClockCache{}
	numblocks := cachesize / blocksize
	b.cacheblocks = make([]ClockCacheBlock, numblocks)
	b.keymap = make(map[uint64]uint64)

	for i := 0; i < len(b.cacheblocks); i++ {
		b.cacheblocks[i].data = make([]byte, blocksize)
		godbc.Check(b.cacheblocks[i].data != nil)
	}

	godbc.Ensure(b.cacheblocks != nil)
	godbc.Ensure(b.keymap != nil)

	return b
}

func (c *ClockCache) remove(index uint64) {
	delete(c.keymap, c.cacheblocks[index].key)

	c.cacheblocks[index].mru = false
	c.cacheblocks[index].used = false
	c.cacheblocks[index].key = 0
}

func (c *ClockCache) Set(key uint64, buf []byte) (err error) {

	c.lock.Lock()
	defer c.lock.Unlock()

	// Yes i know its the same as Invalides.. I'll fix it later!
	// :-)
	if index, ok := c.keymap[key]; ok {
		c.remove(index)
	}

	for {
		for ; c.index < uint64(len(c.cacheblocks)); c.index++ {
			if c.cacheblocks[c.index].mru {
				c.cacheblocks[c.index].mru = false
			} else {
				if c.cacheblocks[c.index].used {
					c.remove(c.index)
				}

				err = nil

				c.cacheblocks[c.index].key = key
				c.cacheblocks[c.index].mru = false
				c.cacheblocks[c.index].used = true

				godbc.Check(len(buf) == len(c.cacheblocks[c.index].data))
				copy(c.cacheblocks[c.index].data, buf)

				c.keymap[key] = c.index
				c.index++

				return
			}
		}
		c.index = 0
	}
}

func (c *ClockCache) Get(key uint64, buf []byte) (err error) {
	c.lock.Lock()
	defer c.lock.Unlock()
	if index, ok := c.keymap[key]; ok {
		c.cacheblocks[index].mru = true
		copy(buf, c.cacheblocks[index].data)

		return nil
	} else {
		return ErrKeyNotFound
	}
}

func (c *ClockCache) Invalidate(key uint64) (err error) {
	c.lock.Lock()
	defer c.lock.Unlock()

	if index, ok := c.keymap[key]; ok {
		c.remove(index)
	}

	return nil
}

repository: lpabon/buffercache

license_type: permissive

repo_name: lpabon/buffercache

branch_name: refs/heads/master

extension: go


text:
package client

import (
	"fmt"
	"golang.org/x/net/context"
	"net/http"
	"net/url"
)

// MultiFizzbuzzPath computes a request path to the multi action of fizzbuzz.
func MultiFizzbuzzPath(begin int, end int) string {
	return fmt.Sprintf("/v1/between/%v/%v", begin, end)
}

// Retrieve FizzBuzz result for two inputs
func (c *Client) MultiFizzbuzz(ctx context.Context, path string) (*http.Response, error) {
	req, err := c.NewMultiFizzbuzzRequest(ctx, path)
	if err != nil {
		return nil, err
	}
	return c.Client.Do(ctx, req)
}

// NewMultiFizzbuzzRequest create the request corresponding to the multi action endpoint of the fizzbuzz resource.
func (c *Client) NewMultiFizzbuzzRequest(ctx context.Context, path string) (*http.Request, error) {
	scheme := c.Scheme
	if scheme == "" {
		scheme = "http"
	}
	u := url.URL{Host: c.Host, Scheme: scheme, Path: path}
	req, err := http.NewRequest("GET", u.String(), nil)
	if err != nil {
		return nil, err
	}
	return req, nil
}

// SingleFizzbuzzPath computes a request path to the single action of fizzbuzz.
func SingleFizzbuzzPath(input int) string {
	return fmt.Sprintf("/v1/get/%v", input)
}

// Retrieve FizzBuzz result for one input
func (c *Client) SingleFizzbuzz(ctx context.Context, path string) (*http.Response, error) {
	req, err := c.NewSingleFizzbuzzRequest(ctx, path)
	if err != nil {
		return nil, err
	}
	return c.Client.Do(ctx, req)
}

// NewSingleFizzbuzzRequest create the request corresponding to the single action endpoint of the fizzbuzz resource.
func (c *Client) NewSingleFizzbuzzRequest(ctx context.Context, path string) (*http.Request, error) {
	scheme := c.Scheme
	if scheme == "" {
		scheme = "http"
	}
	u := url.URL{Host: c.Host, Scheme: scheme, Path: path}
	req, err := http.NewRequest("GET", u.String(), nil)
	if err != nil {
		return nil, err
	}
	return req, nil
}

license: MIT

repository: steers/fbaas

repo_name: steers/fbaas


text:
SUMMARY = "Multi channel MIDI step sequencer LV2 plugin with a variable matrix"
HOMEPAGE = "https://github.com/sjaehn/BSEQuencer"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://LICENSE;md5=1ebbd3e34237af26da5dc08a4e440464"

REQUIRED_DISTRO_FEATURES = "x11"

inherit pkgconfig features_check

DEPENDS += " \
    virtual/libx11 \
    cairo \
    lv2 \
"

SRC_URI = "git://github.com/sjaehn/BSEQuencer.git;branch=master;protocol=https"
SRCREV = "7ad4bf9b02c54ed98b8d293c52d1eca62fec626d"
S = "${WORKDIR}/git"
PV = "1.8.10"

EXTRA_OEMAKE = "STRIP=echo STRIPFLAG=-e"

do_install() {
    DESTDIR=${D} PREFIX=${prefix} oe_runmake install
}

FILES:${PN} += "${libdir}/lv2"

repository: schnitzeltony/meta-musicians

repo_name: schnitzeltony/meta-musicians

gha_license_id: MIT

gha_language: BitBake

extension: bb


text:
LICENSE = "GPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
DEPENDS += "zlib bzip2 xz xz-native lzo e2fsprogs util-linux libgcrypt"

SRC_URI = "git://github.com/fdupoux/fsarchiver.git;protocol=https \
"

SRCREV = "${AUTOREV}"
PV = "${SRCPV}"

S = "${WORKDIR}/git"

inherit autotools pkgconfig

EXTRA_OECONF += "--disable-lz4 \
		 --disable-zstd \
"

repository: neutrino-hd/meta-neutrino

repo_name: neutrino-hd/meta-neutrino


text:
require e2fsprogs-libs.inc
SRC_URI = "${SOURCEFORGE_MIRROR}/e2fsprogs/e2fsprogs-libs-${PV}.tar.gz \
	  "

PR = "r1"

EXTRA_OECONF += " --enable-elf-shlibs "

do_configure() {
        oe_runconf
}

do_compile_prepend () {
	find ./ -print|xargs chmod u=rwX
	( cd util; ${BUILD_CC} subst.c -o subst )
}

repository: demsey/openembedded

repo_name: demsey/openembedded

branch_name: HEAD


text:
@inproceedings{zhao_microservice_2019,
 abstract = {A large number of techniques for analyzing and optimizing mobile apps have emerged in the past decade. However, those techniques' components are notoriously difficult to extract and reuse outside their original tools. This paper introduces MAOMAO, a microservice-based reference architecture for reusing and integrating such components. MAOMAO's twin goals are (1) adoption of available app optimization techniques in practice and (2) improved construction and evaluation of new techniques. The paper uses several existing app optimization techniques to illustrate both the motivation behind MAOMAO and its potential to fundamentally alter the landscape in this area.},
 author = {Zhao, Yixue and Medvidovic, Nenad},
 booktitle = {Proceedings of the 6th International Conference on Mobile Software Engineering and Systems},
 date = {2019},
 location = {Piscataway, NJ, USA},
 note = {event-place: Montreal, Quebec, Canada},
 pages = {45--49},
 publisher = {IEEE Press},
 rights = {All rights reserved},
 series = {MOBILESoft '19},
 title = {A Microservice Architecture for Online Mobile App Optimization},
 url = {http://dl.acm.org/citation.cfm?id=3340730.3340742}
}

repository: felicitia/HugoAcademicWebsite

repo_name: felicitia/HugoAcademicWebsite

extension: bib


text:
package promplot

import (
	"context"
	"fmt"
	"io"
	"io/ioutil"
	"os"

	"github.com/slack-go/slack"
)

// Slack posts a file to a Slack channel.
func Slack(token, channel, title string, plot io.WriterTo) error {
	api := slack.New(token)

	if _, _, err := api.PostMessageContext(context.Background(), channel, slack.MsgOptionPostMessageParameters(
		slack.PostMessageParameters{
			Username:  "Promplot",
			IconEmoji: ":chart_with_upwards_trend:",
		},
	)); err != nil {
		return fmt.Errorf("failed to post message: %v", err)
	}

	f, err := ioutil.TempFile("", "promplot-")
	if err != nil {
		return fmt.Errorf("failed to create tmp file: %v", err)
	}

	defer func() {
		if err = f.Close(); err != nil {
			panic(fmt.Errorf("failed to close tmp file: %v", err))
		}
		if err = os.Remove(f.Name()); err != nil {
			panic(fmt.Errorf("failed to delete tmp file: %v", err))
		}
	}()

	if _, err = plot.WriteTo(f); err != nil {
		return fmt.Errorf("failed to write plot to file: %v", err)
	}

	if _, err = api.UploadFile(slack.FileUploadParameters{
		Title:    title,
		File:     f.Name(),
		Channels: []string{channel},
	}); err != nil {
		return fmt.Errorf("failed to upload file: %v", err)
	}

	return nil
}


text:
package aws

import (
	"bytes"
	"fmt"
	"net/url"
	"path"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/aws/aws-sdk-go/service/s3/s3iface"
	"github.com/aws/aws-sdk-go/service/s3/s3manager"
)

// Create valid AWS s3 bucket url
func S3Url(bucket string, parts ...string) (string, error) {
	var s3url string

	base, err := url.Parse(fmt.Sprintf("https://%s.s3.amazonaws.com", bucket))
	if err != nil {
		return "", err
	}

	if len(parts) > 0 {
		if sp, err := url.Parse(path.Join(parts...)); err != nil {
			return "", err
		} else {
			s3url = base.ResolveReference(sp).String()
		}
	}

	return s3url, nil
}

// S3 wrapper
type CfS3 struct {
	Client   s3iface.S3API
	Uploader *s3manager.Uploader
}

// S3 wrapper constructor
func NewS3(s3api s3iface.S3API) *CfS3 {
	return &CfS3{Client: s3api}
}

// Check if bucket exist
func (c *CfS3) IfBucketExist(bucket string) (bool, error) {
	var err error

	input := &s3.HeadBucketInput{
		Bucket: aws.String(bucket),
	}

	_, err = c.Client.HeadBucket(input)
	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			switch aerr.Code() {
			case s3.ErrCodeNoSuchBucket, "NotFound":
				return false, nil
			case s3.ErrCodeBucketAlreadyOwnedByYou:
				return true, nil
			default:
				err = aerr
			}
		}

		return false, err
	}

	return true, nil
}

// Wrapper function for creatinng S3 bucket.
func (c *CfS3) CreateBucket(input *s3.CreateBucketInput) (*s3.CreateBucketOutput, error) {
	result, err := c.Client.CreateBucket(input)

	if err != nil {
		if aerr, ok := err.(awserr.Error); ok {
			return result, aerr
		}
	}

	return result, err
}

// Upload to S3 using s3manager uploader
func (c *CfS3) Upload(bucket, keyName string, body []byte, options ...func(*s3manager.Uploader)) (*s3manager.UploadOutput, error) {
	// Load s3manager
	if c.Uploader == nil {
		c.Uploader = s3manager.NewUploaderWithClient(c.Client, options...)
	}

	// Upload input parameters
	upParams := &s3manager.UploadInput{
		Bucket: aws.String(bucket),
		Key:    aws.String(keyName),
		Body:   bytes.NewReader(body),
	}

	return c.Uploader.Upload(upParams)
}

repository: liangrog/cfctl

repo_name: liangrog/cfctl

gha_language: Go


text:
DESCRIPTION = "TensorFlow’s lightweight solution for mobile and embedded devices"
AUTHOR = "Google Inc. and Yuan Tang"
HOMEPAGE = "https://www.tensorflow.org/lite"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=01e86893010a1b87e69a213faa753ebd"

MD5SUM_EIGEN = "4c884968ede816a84c70e2cd2c81de8d"
SHA256SUM_EIGEN = "d956415d784fa4e42b6a2a45c32556d6aec9d0a3d8ef48baee2522ab762556a9"
MD5SUM_FARMHASH = "f039a65a7f62bdb6c4b4c8a732638d80"
SHA256SUM_FARMHASH = "6560547c63e4af82b0f202cb710ceabb3f21347a4b996db565a411da5b17aba0"
MD5SUM_GEMMLOWP = "a90a2161ad8ee4ccf724f56e07637601"
SHA256SUM_GEMMLOWP = "b87faa7294dfcc5d678f22a59d2c01ca94ea1e2a3b488c38a95a67889ed0a658"
MD5SUM_GTEST = "16877098823401d1bf2ed7891d7dce36"
SHA256SUM_GTEST = "58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8"
MD5SUM_ABSLCPP = "7c9945f256d3733a8eade255afcbd072"
SHA256SUM_ABSLCPP = "7dd09690ae7ca4551de3111d4a86b75b23ec17445f273d3c42bdcdc1c7b02e4e"
MD5SUM_NEON2SSE = "e08e9cf66876ca0acb5c9896f4c967b9"
SHA256SUM_NEON2SSE = "ea951915d21a2468f74be284fddc897facfa0279fed7cceb7b218d61edc75079"
MD5SUM_FLATBUFFER = "3811552512049fac3af419130904bc55"
SHA256SUM_FLATBUFFER = "b2bb0311ca40b12ebe36671bdda350b10c7728caf0cfe2d432ea3b6e409016f3"
MD5SUM_FFT = "4255dd8a74949d123216b1ab91520469"
SHA256SUM_FFT = "52bb637c70b971958ec79c9c8752b1df5ff0218a4db4510e60826e0cb79b5296"

SRC_URI = "git://github.com/tensorflow/tensorflow.git;branch=r1.12;protocol=https \
    https://mirror.bazel.build/bitbucket.org/eigen/eigen/get/fd6845384b86.tar.gz;md5sum=${MD5SUM_EIGEN};sha256sum=${SHA256SUM_EIGEN} \
    https://mirror.bazel.build/github.com/google/gemmlowp/archive/38ebac7b059e84692f53e5938f97a9943c120d98.zip;md5sum=${MD5SUM_GEMMLOWP};sha256sum=${SHA256SUM_GEMMLOWP} \
    https://github.com/google/googletest/archive/release-1.8.0.tar.gz;md5sum=${MD5SUM_GTEST};sha256sum=${SHA256SUM_GTEST} \
    https://github.com/abseil/abseil-cpp/archive/48cd2c3f351ff188bc85684b84a91b6e6d17d896.tar.gz;md5sum=${MD5SUM_ABSLCPP};sha256sum=${SHA256SUM_ABSLCPP} \
    https://github.com/intel/ARM_NEON_2_x86_SSE/archive/master.zip;md5sum=${MD5SUM_NEON2SSE};sha256sum=${SHA256SUM_NEON2SSE} \
    https://mirror.bazel.build/github.com/google/farmhash/archive/816a4ae622e964763ca0862d9dbd19324a1eaf45.tar.gz;md5sum=${MD5SUM_FARMHASH};sha256sum=${SHA256SUM_FARMHASH} \
    https://github.com/google/flatbuffers/archive/1f5eae5d6a135ff6811724f6c57f911d1f46bb15.tar.gz;md5sum=${MD5SUM_FLATBUFFER};sha256sum=${SHA256SUM_FLATBUFFER} \
    https://mirror.bazel.build/www.kurims.kyoto-u.ac.jp/~ooura/fft.tgz;md5sum=${MD5SUM_FFT};sha256sum=${SHA256SUM_FFT} \
    file://apply-modification-for-tflite-1.12-to-eigen.patch \
    file://tensorflow-lite.pc.in"

SRCREV = "${AUTOREV}"

S = "${WORKDIR}/git"

DEPENDS = "zlib"
TARGET_CFLAGS_remove = "-O2"
TARGET_CPPLAGS_remove = "-O2"
TARGET_CXXLAGS_remove = "-O2"
CCFLAGS_append = " -O3 -DNDEBUG -fPIC -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK \
    -I${STAGING_INCDIR}"
CXXFLAGS_append = " -O3 -DNDEBUG -fPIC -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK \
    -I${STAGING_INCDIR}"
LDFLAGS_remove = "-Wl,-O1"
CXXFLAGS_append = " -O3 -DNDEBUG -fPIC -DGEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK \
    -I${STAGING_INCDIR}"
LIBS = "-lstdc++ -lpthread -lm -lz -ldl"
BUILD_DEPS_DOWNLOAD_DIR_PREFIX = "${S}/tensorflow/contrib/lite/tools/make/downloads/"

do_cp_downloaded_build_deps() {
    mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}eigen
    mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}gemmlowp
    mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}googletest
    mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}absl
    mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}farmhash
    mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}neon_2_sse
    mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}flatbuffers
    mkdir -p ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}fft2d

    cp -rf ${WORKDIR}/eigen-eigen-fd6845384b86/* ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}eigen
    cp -rf ${WORKDIR}/gemmlowp-38ebac7b059e84692f53e5938f97a9943c120d98/* ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}gemmlowp
    cp -rf ${WORKDIR}/googletest-release-1.8.0/* ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}googletest
    cp -rf ${WORKDIR}/abseil-cpp-48cd2c3f351ff188bc85684b84a91b6e6d17d896/* ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}absl
    cp -rf ${WORKDIR}/farmhash-816a4ae622e964763ca0862d9dbd19324a1eaf45/* ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}farmhash
    cp -rf ${WORKDIR}/ARM_NEON_2_x86_SSE-master/* ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}neon_2_sse
    cp -rf ${WORKDIR}/flatbuffers-1f5eae5d6a135ff6811724f6c57f911d1f46bb15/* ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}flatbuffers
    cp -rf ${WORKDIR}/fft/* ${BUILD_DEPS_DOWNLOAD_DIR_PREFIX}fft2d
}
addtask do_cp_downloaded_build_deps after do_unpack before do_patch

EXTRA_OEMAKE = "\
    'CC=${CC}' \
    'CXX=${CXX}' \
    'CPP=${CPP}' \
    'CFLAGS=${CFLAGS}' \
    'CPPFLAGS=${CFLAGS}' \
    'CXXFLAGS=${CXXFLAGS}' \
    'AR=${AR}' \
    'LD=${LD}' \
    'LDFLAGS=${LDFLAGS}' \
    'LIBS=${LIBS}' \
    'TARGET=${TARGET_OS}' \
    'TARGET_ARCH=${TUNE_ARCH}'"

do_configure() {
    oe_runmake -f tensorflow/contrib/lite/tools/make/Makefile clean
}

do_compile() {
    oe_runmake -f tensorflow/contrib/lite/tools/make/Makefile
}

do_install() {
    install -d ${D}${libdir}
    install -m 0644 ${S}/tensorflow/contrib/lite/tools/make/gen/${TARGET_OS}_${TUNE_ARCH}/lib/libtensorflow-lite.a ${D}${libdir}/
    install -d ${D}${includedir}/tensorflow/contrib/lite
    install -m 0644 ${S}/tensorflow/contrib/lite/*.h ${D}${includedir}/tensorflow/contrib/lite/
    install -d ${D}${includedir}/tensorflow/contrib/lite/c
    install -m 0644 ${S}/tensorflow/contrib/lite/c/*.h ${D}${includedir}/tensorflow/contrib/lite/c/
    install -d ${D}${includedir}/tensorflow/contrib/lite/core/api/
    install -m 0644 ${S}/tensorflow/contrib/lite/core/api/*.h ${D}${includedir}/tensorflow/contrib/lite/core/api/
    install -d ${D}${includedir}/tensorflow/contrib/lite/kernels
    install -m 0644 ${S}/tensorflow/contrib/lite/kernels/*.h ${D}${includedir}/tensorflow/contrib/lite/kernels/
    install -d  ${D}${includedir}/tensorflow/contrib/lite/profiling/
    install -m 0644 ${S}/tensorflow/contrib/lite/profiling/*.h ${D}${includedir}/tensorflow/contrib/lite/profiling/
    install -d ${D}${includedir}/tensorflow/contrib/lite/schema/
    install -m 0644 ${S}/tensorflow/contrib/lite/schema/*.h ${D}${includedir}/tensorflow/contrib/lite/schema/
    install -d ${D}${includedir}/tensorflow/contrib/lite/tools/
    install -m 0644 ${S}/tensorflow/contrib/lite/tools/*.h ${D}${includedir}/tensorflow/contrib/lite/tools/
    install -d ${D}${libdir}/pkgconfig
    install -m 0644 ${WORKDIR}/tensorflow-lite.pc.in ${D}${libdir}/pkgconfig/tensorflow-lite.pc
    sed -i 's:@version@:${PV}:g
        s:@libdir@:${libdir}:g
        s:@includedir@:${includedir}:g' ${D}${libdir}/pkgconfig/tensorflow-lite.pc
    # flatbuffers
    install -d  ${D}${includedir}/flatbuffers
    install -m 0644 ${S}/tensorflow/contrib/lite/tools/make/downloads/flatbuffers/include/flatbuffers/*.h ${D}${includedir}/flatbuffers/
}

ALLOW_EMPTY_${PN} = "1"

repository: wooksong/meta-neural-network

repo_name: wooksong/meta-neural-network


text:
package php

import "encoding/base64"

// Base64Encode - Encodes data with MIME base64
func Base64Encode(s []byte) string {
	return base64.StdEncoding.EncodeToString(s)
}

// Base64Decode - Decodes data encoded with MIME base64
func Base64Decode(s string) ([]byte, error) {
	bs, err := base64.StdEncoding.DecodeString(s)
	return bs, err
}


text: @article{8737358, author={H. {Sinha} and P. K. {Ajmera}}, journal={IET Biometrics}, title={Upgrading security and protection in ear biometrics}, year={2019}, volume={8}, number={4}, pages={259-266},}

repository: sinhaharsh/academic-kickstart

repo_name: sinhaharsh/academic-kickstart


text:
@Manual{R,
  title = {R: A Language and Environment for Statistical Computing},
  author = {{R Core Team}},
  organization = {R Foundation for Statistical Computing},
  address = {Vienna, Austria},
  year = {2012},
  note = {{ISBN} 3-900051-07-0},
  url = {http://www.R-project.org/},
}

@article{ihaka:1996,
  Author = {Ihaka, Ross and Gentleman, Robert},
	Journal = {Journal of Computational and Graphical Statistics},
	Number = 3,
	Pages = {299--314},
	Title = {R: A Language for Data Analysis and Graphics},
	Volume = 5,
	Year = 1996}

repository: rbotafogo/galaaz

repo_name: rbotafogo/galaaz

gha_language: HTML


text:
/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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 cli

import (
	"fmt"
	"time"

	"github.com/spf13/cobra"

	"mynewt.apache.org/newt/util"
	"mynewt.apache.org/newtmgr/newtmgr/nmutil"
	"mynewt.apache.org/newtmgr/nmxact/sesn"
	"mynewt.apache.org/newtmgr/nmxact/xact"
)

func dateTimeRead(s sesn.Sesn) error {
	c := xact.NewDateTimeReadCmd()
	c.SetTxOptions(nmutil.TxOptions())

	res, err := c.Run(s)
	if err != nil {
		return util.ChildNewtError(err)
	}

	sres := res.(*xact.DateTimeReadResult)
	fmt.Println("Datetime(RFC 3339 format):", sres.Rsp.DateTime)

	return nil
}

func dateTimeWrite(s sesn.Sesn, args []string) error {
	c := xact.NewDateTimeWriteCmd()
	c.SetTxOptions(nmutil.TxOptions())

	if args[0] != "now" {
		c.DateTime = args[0]
	} else {
		c.DateTime = time.Now().Format(time.RFC3339)
		fmt.Printf("Setting time to %s\n", c.DateTime)
	}

	res, err := c.Run(s)
	if err != nil {
		return util.ChildNewtError(err)
	}

	sres := res.(*xact.DateTimeWriteResult)
	if sres.Rsp.Rc != 0 {
		fmt.Printf("Error: %d\n", sres.Rsp.Rc)
	} else {
		fmt.Printf("Done\n")
	}

	return nil
}

func dateTimeRunCmd(cmd *cobra.Command, args []string) {
	s, err := GetSesn()
	if err != nil {
		nmUsage(nil, err)
	}

	if len(args) == 0 {
		if err := dateTimeRead(s); err != nil {
			nmUsage(nil, err)
		}
	} else {
		if err := dateTimeWrite(s, args); err != nil {
			nmUsage(nil, err)
		}
	}
}

func dateTimeCmd() *cobra.Command {
	dateTimeHelpText := "Display or set datetime on a device. "
	dateTimeHelpText += "Specify a datetime-value\n"
	dateTimeHelpText += "to set the datetime on the device.\n\n"
	dateTimeHelpText += "Must specify datetime-value in RFC 3339 format, "
	dateTimeHelpText += "or use keyword 'now'.\n"

	dateTimeEx := nmutil.ToolInfo.ExeName + " datetime -c myserial\n"
	dateTimeEx += nmutil.ToolInfo.ExeName +
		" datetime 2016-03-02T22:44:00 -c myserial" +
		"             (implicit UTC) \n"
	dateTimeEx += nmutil.ToolInfo.ExeName +
		" datetime 2016-03-02T22:44:00Z -c myserial" +
		"            (explicit UTC)\n"
	dateTimeEx += nmutil.ToolInfo.ExeName +
		" datetime 2016-03-02T22:44:00-08:00 -c myserial" +
		"       (PST)\n"
	dateTimeEx += nmutil.ToolInfo.ExeName +
		" datetime 2016-03-02T22:44:00.1 -c myserial" +
		"           (fractional secs)\n"
	dateTimeEx += nmutil.ToolInfo.ExeName +
		" datetime 2016-03-02T22:44:00.101+05:30 -c myserial" +
		"   (fractional secs + timezone)\n"
	dateTimeEx += nmutil.ToolInfo.ExeName +
		" datetime now -c myserial " +
		"                            (current system time)\n"

	dateTimeCmd := &cobra.Command{
		Use:     "datetime [rfc-3339-date-string] -c <conn_profile>",
		Short:   "Manage datetime on a device",
		Long:    dateTimeHelpText,
		Example: dateTimeEx,
		Run:     dateTimeRunCmd,
	}

	return dateTimeCmd
}

repository: apache/mynewt-newtmgr

repo_name: apache/mynewt-newtmgr


text:
package modext

import (
	"strings"

	"gitlab.fidibo.com/backend/galaxy/api/models"
)

const (
	baseImageURL = "/images/books/"
)

func getNormalImagePath(b *models.Book) string {
	return strings.Replace(b.ImageName.String, ".jpg", "_normal.jpg", 1)
}

func GetBookNormalImage(b *models.Book) string {
	return baseImageURL + getNormalImagePath(b)
}

func IsFree(b *models.Book) bool {
	if b.Free == 1 {
		return true
	}

	return false
}

func IsRtl(b *models.Book) bool {
	return true
}

repository: vchakoshy/galaxy

repo_name: vchakoshy/galaxy


text:
SUMMARY = "This module supports ym2651y"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e"

inherit module

SRC_URI = " \
	  file://Makefile \
          file://ym2651y.c \
	  file://COPYING \
          "

S = "${WORKDIR}"

do_install() {
    install -d ${D}/lib/modules/${KERNEL_VERSION}/onl
    install -m 0644 ym2651y.ko ${D}/lib/modules/${KERNEL_VERSION}/onl
}

#KERNEL_MODULE_AUTOLOAD += " ym2651y"

repository: NetworkGradeLinux/meta-mion

repo_name: NetworkGradeLinux/meta-mion

branch_name: refs/heads/dunfell

gha_language: C


text:
package bios

import (
	"net/url"

	"github.com/eoscanada/eos-go/ecc"
)

type Config struct {
	// Producer describes your producing node.
	Peer struct {
		// MyAccount is the name of the `account_name` this producer will be using on chain
		MyAccount string `json:"my_account"`
		// APIAddress is the target API endpoint for the locally booting node, a clean-slate node. It can be routable only from the local machine.
		APIAddress    string   `json:"api_address"`
		APIAddressURL *url.URL `json:"-"`
		// SecretP2PAddress is the endpoint which will be published at the end of the process. Needs to be externally routable.  It must be kept secret for DDoS protection.
		SecretP2PAddress string `json:"secret_p2p_address"`

		// Key you want to register to sign blocks.
		BlockSigningPublicKey ecc.PublicKey `json:"block_signing_public_key"`

		// Private key used to setup your config.ini as an ABP (or as someone joining the network)
		BlockSigningPrivateKeyPath string `json:"block_signing_private_key_path"`

		// Available once loaded successfuly from the previous field's path.
		BlockSigningPrivateKey *ecc.PrivateKey `json:"-"`
	} `json:"producer"`

	// MyParameters system.EOSIOParameters `json:"my_parameters"`

	// PGP manages the PGP keys, used for the communications channel.
	PGP struct {
		// Program represents the type of program to use (gpg, keybase ?)
		Program string `json:"program"`
		// Path to binary executable.. unless we use in-process cryptography..
		Path string `json:"path"`
	} `json:"pgp"`
}

/*

Default values in code for eosio_parameters:

static const uint32_t bandwidth_average_window_ms   = 24*60*60*1000l;
static const uint32_t compute_average_window_ms     = 24*60*60*1000l;
static const uint32_t blocksize_average_window_ms   = 60*1000l;

const static uint32_t   default_max_block_size              = 1024 * 1024; /// at 500ms blocks and 200byte trx, this enables 10,000 TPS burst
const static uint32_t   default_target_block_size           = default_max_block_size / 10; /// we target 1000 TPS burst
const static uint32_t   default_target_block_acts_per_scope  = 1000;
const static uint32_t   default_max_block_acts_per_scope     = default_target_block_acts_per_scope*10;

const static uint32_t   default_target_block_acts  = 2000;
const static uint32_t   default_max_block_acts     = default_target_block_acts*100;
const static uint32_t   setcode_act_usage          = 100;

const static uint64_t   default_max_storage_size       = 10 * 1024;
const static uint32_t   default_max_trx_lifetime       = 60*60;
const static uint16_t   default_max_auth_depth         = 6;
const static uint32_t   default_max_trx_runtime        = 10*1000;
const static uint16_t   default_max_inline_depth       = 4;
const static uint32_t   default_max_inline_action_size = 4 * 1024;
const static uint32_t   default_max_gen_trx_size       = 64 * 1024; ///
const static uint32_t   default_max_gen_trx_count      = 16; ///< the number of generated transactions per action
const static uint32_t   producers_authority_threshold  = 14;
const static uint32_t   rate_limiting_precision        = 1000*1000;

const static uint16_t   max_recursion_depth = 6;
*/

repository: obnosis/eos-bios

repo_name: obnosis/eos-bios


text:
package utils

import (
	"fmt"
)

func RemoveDuplicatesFromSlice(s []interface{}) []interface{} {
	m := make(map[interface{}]bool)
	for _, item := range s {
		if _, ok := m[item]; ok {
			// duplicate item
			fmt.Println(item, "is a duplicate")
		} else {
			m[item] = true
		}
	}

	var result []interface{}
	for item, _ := range m {
		result = append(result, item)
	}
	return result
}

func StringInSlice(a string, list []string) bool {
	for _, b := range list {
		if b == a {
			return true
		}
	}
	return false
}

func GetKeysFromMap(tags map[string]bool)[]string{
	keys := make([]string, 0, len(tags))
	for k := range tags {
		keys = append(keys, k)
	}
	return keys
}

repository: news-scrapers/news-scraper-workers-go

repo_name: news-scrapers/news-scraper-workers-go


text:
# Copyright (C) 2015 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)

DESCRIPTION = "OpenWrt LuCI web user interface"
HOMEPAGE = "https://github.com/openwrt/luci"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=2b42edef8fa55315f34f2370b4715ca9"
SECTION = "base"

DEPENDS = "json-c libubox libnl lua5.1 iwinfo openssl virtual/crypt"
RDEPENDS:${PN} = "lua5.1 lucihttp cgi-io"

SRCREV = "709d48b72657084a27db1fb6fc0a4a4e8939552f"

SRC_URI = "git://github.com/openwrt/luci.git;branch=openwrt-22.03;protocol=https \
           file://cmake.patch"

inherit cmake openwrt pkgconfig

prefix=""
includedir="/usr/include"
bindir="/usr/bin"
libdir="/usr/${baselib}"

OECMAKE_C_FLAGS += "-I${STAGING_INCDIR}/libnl3 -DDESTDIR=${D}"

S = "${WORKDIR}/git"

FILES:${PN} += "/www ${base_libdir} /usr/share /usr/libexec"

repository: kraj/meta-openwrt

repo_name: kraj/meta-openwrt


text:
package models

import (
	"encoding/base64"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/url"
	"strings"
	"time"

	yaml "gopkg.in/yaml.v2"
)

const (
	DeploymentTargetKindV1Alpha = "DeploymentTarget"

	ObjectRuleTypeBranchV1Alpha      = "BRANCH"
	ObjectRuleTypeTagV1Alpha         = "TAG"
	ObjectRuleTypePullRequestV1Alpha = "PR"

	ObjectRuleMatchModeAllV1Alpha   = "ALL"
	ObjectRuleMatchModeExactV1Alpha = "EXACT"
	ObjectRuleMatchModeRegexV1Alpha = "REGEX"

	HistoryRequestCursorTypeFirstV1Alpha  = "FIRST"
	HistoryRequestCursorTypeAfterV1Alpha  = "AFTER"
	HistoryRequestCursorTypeBeforeV1Alpha = "BEFORE"
)

var DeploymentTargetCmdAliases = []string{"deployment-target", "deployment-targets", "dt", "dts", "deployment", "deployments"}

type DeploymentTargetListV1Alpha []*DeploymentTargetV1Alpha

type DeploymentTargetV1Alpha struct {
	ApiVersion string `json:"-" yaml:"apiVersion"`
	Kind       string `json:"-" yaml:"kind"`

	DeploymentTargetMetadataV1Alpha `yaml:"metadata,omitempty"`
	DeploymentTargetSpecV1Alpha     `yaml:"spec,omitempty"`
}

type DeploymentTargetMetadataV1Alpha struct {
	Id             string     `json:"id" yaml:"id"`
	Name           string     `json:"name" yaml:"name"`
	ProjectId      string     `json:"project_id" yaml:"project_id"`
	OrganizationId string     `json:"organization_id" yaml:"organization_id"`
	CreatedBy      string     `json:"created_by,omitempty" yaml:"created_by,omitempty"`
	UpdatedBy      string     `json:"updated_by,omitempty" yaml:"updated_by,omitempty"`
	CreatedAt      *time.Time `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	UpdatedAt      *time.Time `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	Description    string     `json:"description" yaml:"description"`
	Url            string     `json:"url" yaml:"url"`
}

type DeploymentTargetSpecV1Alpha struct {
	State              string                          `json:"state" yaml:"state"`
	StateMessage       string                          `json:"state_message" yaml:"state_message"`
	SubjectRules       []*SubjectRuleV1Alpha           `json:"subject_rules" yaml:"subject_rules"`
	ObjectRules        []*ObjectRuleV1Alpha            `json:"object_rules" yaml:"object_rules"`
	LastDeployment     *DeploymentV1Alpha              `json:"last_deployment,omitempty" yaml:"last_deployment,omitempty"`
	Active             bool                            `json:"active" yaml:"active"`
	BookmarkParameter1 string                          `json:"bookmark_parameter1" yaml:"bookmark_parameter1"`
	BookmarkParameter2 string                          `json:"bookmark_parameter2" yaml:"bookmark_parameter2"`
	BookmarkParameter3 string                          `json:"bookmark_parameter3" yaml:"bookmark_parameter3"`
	EnvVars            *DeploymentTargetEnvVarsV1Alpha `json:"env_vars,omitempty" yaml:"env_vars,omitempty"`
	Files              *DeploymentTargetFilesV1Alpha   `json:"files,omitempty" yaml:"files,omitempty"`
}

type DeploymentV1Alpha struct {
	Id             string                    `json:"id" yaml:"id"`
	TargetId       string                    `json:"target_id" yaml:"target_id"`
	PrevPipelineId string                    `json:"prev_pipeline_id" yaml:"prev_pipeline_id"`
	PipelineId     string                    `json:"pipeline_id" yaml:"pipeline_id"`
	TriggeredBy    string                    `json:"triggered_by,omitempty" yaml:"triggered_by,omitempty"`
	TriggeredAt    *time.Time                `json:"triggered_at,omitempty" yaml:"triggered_at,omitempty"`
	State          string                    `json:"state" yaml:"state"`
	StateMessage   string                    `json:"state_message" yaml:"state_message"`
	SwitchId       string                    `json:"switch_id" yaml:"switch_id"`
	TargetName     string                    `json:"target_name" yaml:"target_name"`
	EnvVars        *DeploymentEnvVarsV1Alpha `json:"env_vars,omitempty" yaml:"env_vars,omitempty"`
}
type DeploymentsHistoryV1Alpha struct {
	Deployments  []DeploymentV1Alpha `json:"deployments,omitempty" yaml:"deployments,omitempty"`
	CursorBefore int64               `json:"cursor_before,omitempty" yaml:"cursor_before,omitempty"`
	CursorAfter  int64               `json:"cursor_after,omitempty" yaml:"cursor_after,omitempty"`
}

type DeploymentEnvVarsV1Alpha []*DeploymentEnvVarV1Alpha

type DeploymentEnvVarV1Alpha struct {
	Name  string `json:"name" yaml:"name"`
	Value string `json:"value" yaml:"value"`
}

type SubjectRuleV1Alpha struct {
	Type      string `json:"type" yaml:"type"`
	SubjectId string `json:"subject_id,omitempty" yaml:"subject_id,omitempty"`
	GitLogin  string `json:"git_login,omitempty" yaml:"git_login,omitempty"`
}

type ObjectRuleV1Alpha struct {
	Type      string `json:"type" yaml:"type"`
	MatchMode string `json:"match_mode" yaml:"match_mode"`
	Pattern   string `json:"pattern" yaml:"pattern"`
}

type HistoryRequestFiltersV1Alpha struct {
	CursorType  string `json:"cursor_type,omitempty" yaml:"cursor_type,omitempty"`
	CursorValue string `json:"cursor_value,omitempty" yaml:"cursor_value,omitempty"`
	GitRefType  string `json:"git_ref_type,omitempty" yaml:"git_ref_type,omitempty"`
	GitRefLabel string `json:"git_ref_label,omitempty" yaml:"git_ref_label,omitempty"`
	TriggeredBy string `json:"triggered_by,omitempty" yaml:"triggered_by,omitempty"`
	Parameter1  string `json:"parameter1,omitempty" yaml:"parameter1,omitempty"`
	Parameter2  string `json:"parameter2,omitempty" yaml:"parameter2,omitempty"`
	Parameter3  string `json:"parameter3,omitempty" yaml:"parameter3,omitempty"`
}

type DeploymentTargetEnvVarV1Alpha struct {
	Name  string        `json:"name" yaml:"name"`
	Value HashedContent `json:"value" yaml:"value"`
}

type DeploymentTargetFileV1Alpha struct {
	Path    string        `json:"path" yaml:"path"`
	Content HashedContent `json:"content" yaml:"content"`
	Source  string        `json:"-" yaml:"source"`
}

type HashedContent string

type DeploymentTargetFilesV1Alpha []*DeploymentTargetFileV1Alpha
type DeploymentTargetEnvVarsV1Alpha []*DeploymentTargetEnvVarV1Alpha

type DeploymentTargetCreateRequestV1Alpha struct {
	DeploymentTargetV1Alpha
	UniqueToken string `json:"unique_token" yaml:"-"`
}

type DeploymentTargetUpdateRequestV1Alpha DeploymentTargetCreateRequestV1Alpha

type CordonResponseV1Alpha struct {
	TargetId string `json:"target_id,omitempty" yaml:"target_id,omitempty"`
	Cordoned bool   `json:"cordoned,omitempty" yaml:"cordoned,omitempty"`
}

func NewDeploymentTargetV1AlphaFromJson(data []byte) (*DeploymentTargetV1Alpha, error) {
	dt := DeploymentTargetV1Alpha{}
	err := json.Unmarshal(data, &dt)

	if err != nil {
		return nil, err
	}

	dt.setApiVersionAndKind()

	return &dt, nil
}

func NewDeploymentTargetV1AlphaFromYaml(data []byte) (*DeploymentTargetV1Alpha, error) {
	dt := DeploymentTargetV1Alpha{}

	err := yaml.UnmarshalStrict(data, &dt)

	if err != nil {
		return nil, err
	}

	dt.setApiVersionAndKind()

	return &dt, nil
}

func (dt *DeploymentTargetV1Alpha) ToYaml() ([]byte, error) {
	return yaml.Marshal(dt)
}

func (dt *DeploymentTargetV1Alpha) ToJson() ([]byte, error) {
	return json.Marshal(dt)
}

func (dt *DeploymentTargetV1Alpha) setApiVersionAndKind() {
	dt.ApiVersion = "v1alpha"
	dt.Kind = DeploymentTargetKindV1Alpha
}

func (dt *DeploymentTargetV1Alpha) LoadFiles() error {
	if dt.Files == nil {
		return nil
	}
	return dt.Files.Load()
}

func NewDeploymentTargetListV1AlphaFromJson(data []byte) (*DeploymentTargetListV1Alpha, error) {
	targetList := DeploymentTargetListV1Alpha{}

	err := json.Unmarshal(data, &targetList)

	if err != nil {
		return nil, err
	}
	for i := range targetList {
		targetList[i].setApiVersionAndKind()
	}
	return &targetList, nil
}

func NewCordonResponseV1AlphaFromJson(data []byte) (*CordonResponseV1Alpha, error) {
	cordonResponse := CordonResponseV1Alpha{}

	err := json.Unmarshal(data, &cordonResponse)

	if err != nil {
		return nil, err
	}

	return &cordonResponse, nil
}

func NewDeploymentsHistoryV1AlphaFromJson(data []byte) (*DeploymentsHistoryV1Alpha, error) {
	deployments := DeploymentsHistoryV1Alpha{}

	err := json.Unmarshal(data, &deployments)

	if err != nil {
		return nil, err
	}

	return &deployments, nil
}

func (d *DeploymentsHistoryV1Alpha) ToYaml() ([]byte, error) {
	return yaml.Marshal(d)
}

func (c *HashedContent) UnmarshalYAML(unmarshal func(interface{}) error) error {
	var s string
	if err := unmarshal(&s); err != nil {
		return err
	}
	*c = HashedContent(strings.TrimSuffix(string(s), " [md5]"))
	return nil
}

func (c HashedContent) MarshalYAML() (data interface{}, err error) {
	return fmt.Sprintf("%s [md5]", c), nil
}

func (r DeploymentTargetCreateRequestV1Alpha) ObjectName() string {
	return fmt.Sprintf("%s/%s", DeploymentTargetKindV1Alpha, r.Name)
}

func (r DeploymentTargetUpdateRequestV1Alpha) ObjectName() string {
	return fmt.Sprintf("%s/%s", DeploymentTargetKindV1Alpha, r.Name)
}

func (r *DeploymentTargetCreateRequestV1Alpha) ToYaml() ([]byte, error) {
	return yaml.Marshal(r)
}

func (r *DeploymentTargetCreateRequestV1Alpha) ToJson() ([]byte, error) {
	return json.Marshal(r)
}

func (r *DeploymentTargetCreateRequestV1Alpha) LoadFiles() error {
	if r.Files == nil {
		return nil
	}
	return r.Files.Load()
}

func (r *DeploymentTargetUpdateRequestV1Alpha) LoadFiles() error {
	if r.Files == nil {
		return nil
	}
	return r.Files.Load()
}

func (f *DeploymentTargetFilesV1Alpha) Load() error {
	for _, file := range *f {
		if file == nil {
			continue
		}
		if file.Content != "" {
			continue
		}
		err := file.LoadContent()
		if err != nil {
			return err
		}
	}
	return nil
}

func NewDeploymentTargetCreateRequestV1AlphaFromYaml(data []byte) (*DeploymentTargetCreateRequestV1Alpha, error) {
	deploymentTarget := DeploymentTargetCreateRequestV1Alpha{}

	err := yaml.UnmarshalStrict(data, &deploymentTarget)

	if err != nil {
		return nil, err
	}

	deploymentTarget.setApiVersionAndKind()

	return &deploymentTarget, nil
}

func NewDeploymentTargetUpdateRequestV1AlphaFromYaml(data []byte) (*DeploymentTargetUpdateRequestV1Alpha, error) {
	deploymentTargetUpdate := DeploymentTargetUpdateRequestV1Alpha{}

	err := yaml.UnmarshalStrict(data, &deploymentTargetUpdate)

	if err != nil {
		return nil, err
	}

	deploymentTargetUpdate.setApiVersionAndKind()
	if err = deploymentTargetUpdate.LoadFiles(); err != nil {
		return nil, err
	}

	return &deploymentTargetUpdate, nil
}

func (f *DeploymentTargetFileV1Alpha) LoadContent() error {
	content, err := ioutil.ReadFile(f.Source)
	if err != nil {
		return err
	}

	f.Content = HashedContent(base64.StdEncoding.EncodeToString(content))
	return nil
}

func (hr HistoryRequestFiltersV1Alpha) ToURLValues() (values url.Values, err error) {
	data, err := json.Marshal(hr)
	if err != nil {
		return nil, err
	}
	var m map[string]string
	err = json.Unmarshal(data, &m)
	if err != nil {
		return nil, err
	}
	values = url.Values{}
	for k, v := range m {
		values.Add(k, v)
	}
	return
}

repository: semaphoreci/cli

repo_name: semaphoreci/cli


text:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You 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 serverlist

import (
	"github.com/stack-labs/stack/plugin/config/source/apollo/agollo/protocol/http"
	"testing"

	"github.com/stack-labs/stack/plugin/config/source/apollo/agollo/env"
	"github.com/stack-labs/stack/plugin/config/source/apollo/agollo/env/config"
	. "github.com/tevid/gohamcrest"
)

func TestSyncServerIPList(t *testing.T) {
	trySyncServerIPList(t)
}

func trySyncServerIPList(t *testing.T) {
	server := runMockServicesConfigServer()
	defer server.Close()

	newAppConfig := getTestAppConfig()
	newAppConfig.IP = server.URL
	err := SyncServerIPList(newAppConfig)

	Assert(t, err, NilVal())

	serverLen := 0
	newAppConfig.GetServers().Range(func(k, v interface{}) bool {
		serverLen++
		return true
	})

	Assert(t, 10, Equal(serverLen))

}

func getTestAppConfig() *config.AppConfig {
	jsonStr := `{
    "appId": "test",
    "cluster": "dev",
    "namespaceName": "application",
    "ip": "localhost:8888",
    "releaseKey": "1"
	}`
	c, _ := env.Unmarshal([]byte(jsonStr))

	return c.(*config.AppConfig)
}

func TestSyncServerIpListSuccessCallBack(t *testing.T) {
	appConfig := getTestAppConfig()
	SyncServerIPListSuccessCallBack([]byte(servicesConfigResponseStr), http.CallBack{AppConfig: appConfig})
	Assert(t, appConfig.GetServersLen(), Equal(10))
}

func TestSetDownNode(t *testing.T) {
	t.SkipNow()
	appConfig := getTestAppConfig()
	SyncServerIPListSuccessCallBack([]byte(servicesConfigResponseStr), http.CallBack{AppConfig: appConfig})

	downNode := "10.15.128.102:8080"
	appConfig.SetDownNode(downNode)

	value, ok := appConfig.GetServers().Load("http://10.15.128.102:8080/")
	info := value.(*config.ServerInfo)
	Assert(t, ok, Equal(true))
	Assert(t, info.IsDown, Equal(true))
}

repository: stack-labs/stack

repo_name: stack-labs/stack


text:
/*
 * File:        g048.go
 *
 * Author:      Schuyler Martin <schuylermartin45@gmail.com>
 *
 * Description: Main execution point of the `g048` project.
 */
package main

import (
	"./model"
	"./view"
	"fmt"
	"os"
	"strings"
)

/***** Constants *****/

// USAGE message to display on bad input
const USAGE string = "Usage: g048 [help]"

/***** Functions *****/

/*
 Main entry point of the G048 project.
*/
func main() {
	// Handle user input
	argc := len(os.Args)
	if argc > 1 {
		if strings.ToLower(os.Args[1]) == "help" {
			fmt.Println("G048: A Go-implementation of 2048")
			fmt.Println("\nAbout")
			fmt.Println("  Author: Schuyler Martin")
			fmt.Println("  Date:   February 2020")
			fmt.Println("\n" + USAGE + "\n")
			fmt.Println("Controls")
			fmt.Println("  * W/[Up]:         Move up")
			fmt.Println("  * A/[Left]:       Move left")
			fmt.Println("  * S/[Down]:       Move right")
			fmt.Println("  * D/[Right]:      Move down")
			fmt.Println("  * [Esc]/[Ctrl-C]: Exit game")

			os.Exit(view.EXIT_SUCCESS)
		} else {
			fmt.Fprintf(os.Stderr, "%v\n", USAGE)
			os.Exit(view.ERROR_USAGE)
		}
	}

	// Initialize, run, and exit with the selected mode
	textGame := new(view.TextGame)
	playAgain := true
	for playAgain {
		textGame.InitGame(model.NewBoard())
		playAgain = textGame.RenderGame()
	}
	textGame.ExitGame()
}


text:
SUMMARY = "A pure-Python MySQL client library"
DESCRIPTION = " \
  This package contains a pure-Python MySQL client library, based on PEP 249 \
  Most public APIs are compatible with mysqlclient and MySQLdb. \
  "
SECTION = "devel/python"
HOMEPAGE = "https://pymysql.readthedocs.io"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=528175c84163bb800d23ad835c7fa0fc"

SRC_URI[md5sum] = "e5d9183cc0a775ac29f9e0365cca6556"
SRC_URI[sha256sum] = "d8c059dcd81dedb85a9f034d5e22dcb4442c0b201908bede99e306d65ea7c8e7"

inherit pypi setuptools

PYPI_PACKAGE = "PyMySQL"

RDEPENDS:${PN} += "${PYTHON_PN}-cryptography"

SKIP_RECIPE[python-pymysql] ?= "${@bb.utils.contains('I_SWEAR_TO_MIGRATE_TO_PYTHON3', 'yes', '', 'python2 is out of support for long time, read https://www.python.org/doc/sunset-python-2/ https://python3statement.org/ and if you really have to temporarily use this, then set I_SWEAR_TO_MIGRATE_TO_PYTHON3 to "yes"', d)}"

branch_name: refs/heads/jansa/master


text:
#
# Copyright Matthias Hentges <devel@hentges.net> (c) 2006
# License: MIT (see COPYING.MIT)
#
# Filename: essential-image.bb
# Date: 23-Apr-06

HOMEPAGE = "http://www.hentges.net/misc/openzaurus/index.shtml"

DEPENDS = "task-essential-to-boot"
IMAGE_LINGUAS = ""
IMAGE_INSTALL = "task-essential-to-boot"

inherit image

repository: jdegges/gumstix-pip-oe

repo_name: jdegges/gumstix-pip-oe


text:
package awx

import (
	"testing"
	"time"
)

func TestListProjects(t *testing.T) {
	var (
		expectListProjectsResponse = []*Project{
			{
				ID:   4,
				Type: "project",
				URL:  "/api/v2/projects/4/",
				Related: &Related{
					CreatedBy:    "/api/v2/users/1/",
					ModifiedBy:   "/api/v2/users/1/",
					ObjectRoles:  "/api/v2/projects/4/object_roles/",
					Copy:         "/api/v2/projects/4/copy/",
					AccessList:   "/api/v2/projects/4/access_list/",
					Schedules:    "/api/v2/projects/4/schedules/",
					Organization: "/api/v2/organizations/1/",
				},
				SummaryFields: &Summary{
					Organization: &OrgnizationSummary{
						ID:          1,
						Name:        "Default",
						Description: "",
					},
					CreatedBy: &ByUserSummary{
						ID:        1,
						Username:  "admin",
						FirstName: "admin",
						LastName:  "admin",
					},
					ModifiedBy: &ByUserSummary{
						ID:        1,
						Username:  "admin",
						FirstName: "admin",
						LastName:  "admin",
					},
					ObjectRoles: &ObjectRoles{
						AdminRole: &ApplyRole{
							ID:          14,
							Description: "Can manage all aspects of the project",
							Name:        "Admin",
						},

						UseRole: &ApplyRole{
							ID:          16,
							Description: "Can manage all aspects of the project",
							Name:        "Use",
						},

						UpdateRole: &ApplyRole{
							ID:          17,
							Description: "May update project or inventory or group using the configured source update system",
							Name:        "Update",
						},

						ReadRole: &ApplyRole{
							ID:          15,
							Description: "May view settings for the project",
							Name:        "Read",
						},
					},

					UserCapabilities: &UserCapabilities{
						Edit:     true,
						Start:    true,
						Copy:     true,
						Schedule: true,
						Delete:   true,
					},
				},
				Created: func() time.Time {
					t, _ := time.Parse(time.RFC3339, "2018-06-28T16:31:15.809617Z")
					return t
				}(),

				Modified: func() time.Time {
					t, _ := time.Parse(time.RFC3339, "2018-06-28T16:31:15.923732Z")
					return t
				}(),
				Name:                  "Demo Project",
				Description:           "",
				LocalPath:             "",
				ScmType:               "git",
				ScmURL:                "https://github.com/ansible/ansible-tower-samples",
				ScmClean:              false,
				ScmDeleteOnUpdate:     false,
				Status:                "never updated",
				ScmDeleteOnNextUpdate: false,
				ScmUpdateOnLaunch:     true,
				ScmUpdateCacheTimeout: 0,
				LastUpdateFailed:      false,
			},
		}
	)

	awx := NewAWX(testAwxHost, testAwxUserName, testAwxPasswd, nil)
	result, _, err := awx.ProjectService.ListProjects(map[string]string{
		"name": "Demo Project",
	})

	if err != nil {
		t.Fatalf("ListProjects err: %s", err)
	} else {
		checkAPICallResult(t, expectListProjectsResponse, result)
		t.Log("ListProjects passed!")
	}
}

func TestCreateProject(t *testing.T) {
	var (
		expectCreateProjectResponse = &Project{
			ID:   4,
			Type: "project",
			URL:  "/api/v2/projects/4/",
			Related: &Related{
				CreatedBy:    "/api/v2/users/1/",
				ModifiedBy:   "/api/v2/users/1/",
				ObjectRoles:  "/api/v2/projects/4/object_roles/",
				Copy:         "/api/v2/projects/4/copy/",
				AccessList:   "/api/v2/projects/4/access_list/",
				Schedules:    "/api/v2/projects/4/schedules/",
				Organization: "/api/v2/organizations/1/",
			},
			SummaryFields: &Summary{
				Organization: &OrgnizationSummary{
					ID:          1,
					Name:        "Default",
					Description: "",
				},
				CreatedBy: &ByUserSummary{
					ID:        1,
					Username:  "admin",
					FirstName: "admin",
					LastName:  "admin",
				},
				ModifiedBy: &ByUserSummary{
					ID:        1,
					Username:  "admin",
					FirstName: "admin",
					LastName:  "admin",
				},
				ObjectRoles: &ObjectRoles{
					AdminRole: &ApplyRole{
						ID:          14,
						Description: "Can manage all aspects of the project",
						Name:        "Admin",
					},

					UseRole: &ApplyRole{
						ID:          16,
						Description: "Can manage all aspects of the project",
						Name:        "Use",
					},

					UpdateRole: &ApplyRole{
						ID:          17,
						Description: "May update project or inventory or group using the configured source update system",
						Name:        "Update",
					},

					ReadRole: &ApplyRole{
						ID:          15,
						Description: "May view settings for the project",
						Name:        "Read",
					},
				},

				UserCapabilities: &UserCapabilities{
					Edit:     true,
					Start:    true,
					Copy:     true,
					Schedule: true,
					Delete:   true,
				},
			},
			Created: func() time.Time {
				t, _ := time.Parse(time.RFC3339, "2018-06-28T16:31:15.809617Z")
				return t
			}(),

			Modified: func() time.Time {
				t, _ := time.Parse(time.RFC3339, "2018-06-28T16:31:15.923732Z")
				return t
			}(),
			Name:                  "Demo Project",
			Description:           "",
			LocalPath:             "",
			ScmType:               "git",
			ScmURL:                "https://github.com/ansible/ansible-tower-samples",
			ScmClean:              false,
			ScmDeleteOnUpdate:     false,
			Status:                "never updated",
			ScmDeleteOnNextUpdate: false,
			ScmUpdateOnLaunch:     true,
			ScmUpdateCacheTimeout: 0,
			LastUpdateFailed:      false,
		}
	)

	awx := NewAWX(testAwxHost, testAwxUserName, testAwxPasswd, nil)
	result, err := awx.ProjectService.CreateProject(map[string]interface{}{
		"name":         "TestProject",
		"description":  "Test project",
		"organization": 1,
		"scm_type":     "git",
	}, map[string]string{})

	if err != nil {
		t.Fatalf("CreateProject err: %s", err)
	} else {
		checkAPICallResult(t, expectCreateProjectResponse, result)
		t.Log("CreateProject passed!")
	}
}

func TestUpdateProject(t *testing.T) {
	var (
		expectUpdateProjectResponse = &Project{
			ID:   4,
			Type: "project",
			URL:  "/api/v2/projects/4/",
			Related: &Related{
				CreatedBy:    "/api/v2/users/1/",
				ModifiedBy:   "/api/v2/users/1/",
				ObjectRoles:  "/api/v2/projects/4/object_roles/",
				Copy:         "/api/v2/projects/4/copy/",
				AccessList:   "/api/v2/projects/4/access_list/",
				Schedules:    "/api/v2/projects/4/schedules/",
				Organization: "/api/v2/organizations/1/",
			},
			SummaryFields: &Summary{
				Organization: &OrgnizationSummary{
					ID:          1,
					Name:        "Default",
					Description: "",
				},
				CreatedBy: &ByUserSummary{
					ID:        1,
					Username:  "admin",
					FirstName: "admin",
					LastName:  "admin",
				},
				ModifiedBy: &ByUserSummary{
					ID:        1,
					Username:  "admin",
					FirstName: "admin",
					LastName:  "admin",
				},
				ObjectRoles: &ObjectRoles{
					AdminRole: &ApplyRole{
						ID:          14,
						Description: "Can manage all aspects of the project",
						Name:        "Admin",
					},

					UseRole: &ApplyRole{
						ID:          16,
						Description: "Can manage all aspects of the project",
						Name:        "Use",
					},

					UpdateRole: &ApplyRole{
						ID:          17,
						Description: "May update project or inventory or group using the configured source update system",
						Name:        "Update",
					},

					ReadRole: &ApplyRole{
						ID:          15,
						Description: "May view settings for the project",
						Name:        "Read",
					},
				},

				UserCapabilities: &UserCapabilities{
					Edit:     true,
					Start:    true,
					Copy:     true,
					Schedule: true,
					Delete:   true,
				},
			},
			Created: func() time.Time {
				t, _ := time.Parse(time.RFC3339, "2018-06-28T16:31:15.809617Z")
				return t
			}(),

			Modified: func() time.Time {
				t, _ := time.Parse(time.RFC3339, "2018-06-28T16:31:15.923732Z")
				return t
			}(),
			Name:                  "Demo Project",
			Description:           "Test Update",
			LocalPath:             "",
			ScmType:               "git",
			ScmURL:                "https://github.com/ansible/ansible-tower-samples",
			ScmClean:              false,
			ScmDeleteOnUpdate:     false,
			Status:                "never updated",
			ScmDeleteOnNextUpdate: false,
			ScmUpdateOnLaunch:     true,
			ScmUpdateCacheTimeout: 0,
			LastUpdateFailed:      false,
		}
	)

	awx := NewAWX(testAwxHost, testAwxUserName, testAwxPasswd, nil)
	result, err := awx.ProjectService.UpdateProject(4, map[string]interface{}{
		"description": "Test Update",
	}, map[string]string{})

	if err != nil {
		t.Fatalf("UpdateProject err: %s", err)
	} else {
		checkAPICallResult(t, expectUpdateProjectResponse, result)
		t.Log("UpdateProject passed!")
	}
}

func TestDeleteProject(t *testing.T) {
	var (
		expectDeleteProjectResponse = &Project{}
	)
	awx := NewAWX(testAwxHost, testAwxUserName, testAwxPasswd, nil)
	result, err := awx.ProjectService.DeleteProject(4)

	if err != nil {
		t.Fatalf("DeleteProject err: %s", err)
	} else {
		checkAPICallResult(t, expectDeleteProjectResponse, result)
		t.Log("DeleteProject passed!")
	}
}

func TestCancelUpdateProject(t *testing.T) {
	var (
		expectProjectUpdateCancelResponse = &ProjectUpdateCancel{
			CanCancel: true,
		}
	)
	awx := NewAWX(testAwxHost, testAwxUserName, testAwxPasswd, nil)
	result, err := awx.ProjectService.CancelUpdate(80)
	if err != nil {
		t.Fatalf("CancelUpdateProject err: %s", err)
	} else {
		checkAPICallResult(t, expectProjectUpdateCancelResponse, result)
		t.Log("CancelUpdateProject passed!")
	}
}

func TestGetUpdateProject(t *testing.T) {
	var (
		expectProjectUpdateGetResponse = &Job{
			ID:   301,
			Type: "job",
			URL:  "/api/v2/jobs/301/",
			Related: &Related{
				CreatedBy:          "/api/v2/users/1/",
				Labels:             "/api/v2/jobs/301/labels/",
				Inventory:          "/api/v2/inventories/1/",
				Project:            "/api/v2/projects/6/",
				ExtraCredentials:   "/api/v2/jobs/301/extra_credentials/",
				Credentials:        "/api/v2/jobs/301/credentials/",
				UnifiedJobTemplate: "/api/v2/job_templates/8/",
				Stdout:             "/api/v2/jobs/301/stdout/",
				Notifications:      "/api/v2/jobs/301/notifications/",
				JobHostSummaries:   "/api/v2/jobs/301/job_host_summaries/",
				JobEvents:          "/api/v2/jobs/301/job_events/",
				ActivityStream:     "/api/v2/jobs/301/activity_stream/",
				JobTemplate:        "/api/v2/job_templates/8/",
				Cancel:             "/api/v2/jobs/301/cancel/",
				ProjectUpdate:      "/api/v2/project_updates/303/",
				CreateSchedule:     "/api/v2/jobs/301/create_schedule/",
				Relaunch:           "/api/v2/jobs/301/relaunch/",
			},
			SummaryFields: &Summary{
				InstanceGroup: &InstanceGroupSummary{
					ID:   1,
					Name: "tower",
				},

				JobTemplate: &JobTemplateSummary{
					ID:          8,
					Name:        "Hello-world",
					Description: "",
				},

				Inventory: &Inventory{
					ID:                           1,
					Name:                         "Demo Inventory",
					Description:                  "",
					HasActiveFailures:            false,
					TotalHosts:                   2,
					HostsWithActiveFailures:      0,
					TotalGroups:                  0,
					GroupsWithActiveFailures:     0,
					HasInventorySources:          false,
					TotalInventorySources:        0,
					InventorySourcesWithFailures: 0,
					OrganizationID:               1,
					Kind:                         "",
				},

				ProjectUpdate: &ProjectUpdate{
					ID:          303,
					Name:        "DeployBook",
					Description: "",
					Status:      "successful",
					Failed:      false,
				},

				UnifiedJobTemplate: &UnifiedJobTemplate{
					ID:             8,
					Description:    "",
					Name:           "Hello-world",
					UnifiedJobType: "job",
				},

				Project: &Project{
					ID:          6,
					Name:        "DeployBook",
					Description: "",
					Status:      "successful",
					ScmType:     "git",
				},

				CreatedBy: &ByUserSummary{
					ID:        1,
					Username:  "admin",
					FirstName: "",
					LastName:  "",
				},

				UserCapabilities: &UserCapabilities{
					Start:  true,
					Delete: true,
				},

				Labels: &Labels{
					Count:   0,
					Results: []interface{}{},
				},

				ExtraCredentials: []interface{}{},
				Credentials:      []Credential{},
			},

			Created: func() time.Time {
				t, _ := time.Parse(time.RFC3339, "2018-06-05T09:13:43.046077Z")
				return t
			}(),

			Modified: func() time.Time {
				t, _ := time.Parse(time.RFC3339, "2018-06-05T09:13:49.132905Z")
				return t
			}(),

			Name:               "Hello-world",
			Description:        "",
			JobType:            "run",
			Inventory:          1,
			Project:            6,
			Playbook:           "hello-world.yml",
			Forks:              0,
			Limit:              "localhost",
			Verbosity:          0,
			ExtraVars:          "{}",
			JobTags:            "",
			ForceHandlers:      false,
			SkipTags:           "",
			StartAtTask:        "",
			Timeout:            0,
			UseFactCache:       false,
			UnifiedJobTemplate: 8,
			LaunchType:         "manual",
			Status:             "canceled",
			Failed:             true,
			Started: func() time.Time {
				t, _ := time.Parse(time.RFC3339, "2018-06-05T09:13:47.060276Z")
				return t
			}(),
			Finished: func() time.Time {
				t, _ := time.Parse(time.RFC3339, "2018-06-05T09:13:54.740342Z")
				return t
			}(),
			Elapsed:                 7.68,
			JobArgs:                 "[\"ansible-playbook\", \"-i\", \"/tmp/awx_301_3kuP6Z/tmpupf88B\", \"-u\", \"root\", \"-l\", \"localhost\", \"-e\", \"@/tmp/awx_301_3kuP6Z/tmpjlw9Dp\", \"hello-world.yml\"]",
			JobCwd:                  "/var/lib/awx/projects/_6__deploybook",
			JobEnv:                  map[string]string{},
			JobExplanation:          "",
			ExecutionNode:           "awx",
			ResultTraceback:         "",
			EventProcessingFinished: true,
			JobTemplate:             8,
			PasswordsNeededToStart:  []interface{}{},
			AskDiffModeOnLaunch:     false,
			AskVariablesOnLaunch:    true,
			AskLimitOnLaunch:        true,
			AskTagsOnLaunch:         false,
			AskSkipTagsOnLaunch:     false,
			AskJobTypeOnLaunch:      false,
			AskVerbosityOnLaunch:    false,
			AskInventoryOnLaunch:    true,
			AskCredentialOnLaunch:   false,
			AllowSimultaneous:       false,
			Artifacts:               map[string]string{},
			ScmRevision:             "ae9cc6b0fee9aea55e10a4a325c9ae3d97c42f1a",
			InstanceGroup:           1,
			DiffMode:                false,
			Credential:              nil,
			VaultCredential:         nil,
		}
	)
	awx := NewAWX(testAwxHost, testAwxUserName, testAwxPasswd, nil)
	result, err := awx.ProjectService.GetUpdate(301)
	if err != nil {
		t.Fatalf("GetUpdateProject err: %s", err)
	} else {
		checkAPICallResult(t, expectProjectUpdateGetResponse, result)
		t.Log("GetUpdateProject passed!")
	}
}

repository: suwa-sh/awx-go

repo_name: suwa-sh/awx-go


text:
LICENSE = "LGPL"
DESCRIPTION = "Database access library for GPE contacts"
SECTION = "gpe/libs"
PRIORITY = "optional"
DEPENDS = "libgpewidget libgpepimc sqlite"
MAINTAINER = "Florian Boor <florian.boor@kernelconcepts.de>"

PR = "r0"
GPE_TARBALL_SUFFIX = "bz2"

inherit autotools gpe pkgconfig

do_stage () {
autotools_stage_all
}

repository: Terentyev/familiar-linux

repo_name: Terentyev/familiar-linux


text:
.bubble
{
position: relative;
min-width:100px;
min-height:30px;
max-width:520px;
padding: 13px;
padding-top: 5px;
background:rgba(100,100,127,0.5);
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border: #BBBBBB solid 1px;
}

.bubble:after
{
content: '';
position: absolute;
border-style: solid;
border-width: 7px 10px 7px 0;
border-color: transparent rgba(100,100,127,0.5);
display: block;
width: 0;
z-index: 1;
left: -10px;
top: 10px;
}

.bubble:before
{
content: '';
position: absolute;
border-style: solid;
border-width: 7px 10px 7px 0;
border-color: transparent #7F7F7F;
display: block;
width: 0;
z-index: 0;
left: -11px;
top: 10px;
}
.bubble-left-author{
	padding-right: 10px;
}
.bubble-p{
	color:#FFF;
}

.bubble-title{
	color:#333333;
	font-weight:bold;
}

/*right bubble*/
.bubble-right{
position: relative;
min-width:100px;
max-width:520px;
padding: 5px;
background: #DDDDFF;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border: #7F7F7F solid 1px;
}

.bubble-right:after
{
content: '';
position: absolute;
border-style: solid;
border-width: 12px 0 12px 17px;
border-color: transparent #DDDDFF;
display: block;
width: 0;
z-index: 1;
right: -17px;
top: 13px;
}

.bubble-right:before
{
content: '';
position: absolute;
border-style: solid;
border-width: 12px 0 12px 17px;
border-color: transparent #7F7F7F;
display: block;
width: 0;
z-index: 0;
right: -18px;
top: 13px;
}

.bubble-right-author{
	padding-left: 10px;
}
/*the file display*/
.file-icon{
	color:#777777;
	font-size:0.8em;
}
.file-title{
	color:#333333;
}
.file-op{
	margin:3px;
}

.file-legend{
	font-size:0.8em;
	color:#777777;
}

.file-item{
	border-right:#CCCCCC 1px solid;
	display:inline-block;
	padding-right:10px;
}
.image-opblock{
	z-index:1000px;
	text-align:right;
}

.image-op{
	color:white;
	text-shadow: grey 2px 2px 2px;
	margin:3px;
}

repository: GiggleLiu/numericclub

repo_name: GiggleLiu/numericclub

extension: css


text:
package state

import (
	"github.com/arborlang/ArborGo/internal/lexer/internal"
	"github.com/arborlang/ArborGo/internal/tokens"
)

func isComparison(lex *internal.Lexer, next rune) bool {
	isLT := next == '<'
	isLTE := next == '<' && lex.Peek() == '='
	isGT := next == '>'
	isGTE := next == '>' && lex.Peek() == '='
	isEq := next == '=' && lex.Peek() == '='
	isNeq := next == '!' && lex.Peek() == '='
	if isLTE || isGTE || isEq || isNeq {
		lex.Next()
	}
	return isLT || isLTE || isGT || isGTE || isEq || isNeq
}

//lexTextis the first state
func lexText(lex *internal.Lexer) State {
	for {
		next := lex.Next()
		if next == tokens.EOFChar {
			break
		}
		switch {
		case next == '+' || next == '-':
			if next == '-' && lex.Peek() == '>' {
				lex.Next()
				lex.Emit(tokens.ARROW, nil)
				return lexText
			}
			if lex.Peek() >= '0' && lex.Peek() <= '9' {
				lex.Backup()
				return lexNumeric
			}
			lex.Emit(tokens.ARTHOP, nil)
		case next == '/' && lex.Peek() == '/':
			return func(lex *internal.Lexer) State {
				for {
					next := lex.Next()
					if next == '\n' {
						lex.Ignore()
						return lexText
					}
				}
			}
		case next == '/' && lex.Peek() == '*':
			return func(lex *internal.Lexer) State {
				for {
					next := lex.Next()
					if next == '*' && lex.Peek() == '/' {
						lex.Next()
						lex.Ignore()
						return lexText
					}
				}
			}
		case next == '@':
			lex.Emit(tokens.AT, nil)
		case isComparison(lex, next):
			lex.Emit(tokens.COMPARISON, nil)
		case next == '|' && lex.Peek() == '>':
			lex.Next()
			lex.Emit(tokens.PIPE, nil)
		case next == '*' || next == '/':
			lex.Emit(tokens.ARTHOP, nil)
		case next >= '0' && next <= '9':
			lex.Backup()
			return lexNumeric
		case next == '!':
			lex.Emit(tokens.NOT, nil)
		case (next == '&' && lex.Peek() == '&') || (next == '|' && lex.Peek() == '|'):
			lex.Next()
			lex.Emit(tokens.BOOLEAN, nil)
		case next == '&' || next == '|' || next == '^':
			lex.Emit(tokens.LOGICAL, nil)
		case isAlphaNumeric(next):
			lex.Backup()
			return lexAlphaNumeric
		case isWhitespace(next):
			lex.Backup()
			return lexWhiteSpace
		case next == '=':
			lex.Emit(tokens.EQUAL, nil)
		case next == '(':
			lex.Emit(tokens.RPAREN, nil)
		case next == ')':
			lex.Emit(tokens.LPAREN, nil)
		case next == '\'':
			return lexChar
		case next == '"':
			return lexString
		case next == ':':
			if lex.Peek() == ':' {
				lex.Next()
				lex.Emit(tokens.DCOLON, nil)
			} else {
				lex.Emit(tokens.COLON, nil)
			}
		case next == ',':
			lex.Emit(tokens.COMMA, nil)
		case next == ';':
			lex.Emit(tokens.SEMI, nil)
		case next == '{':
			lex.Emit(tokens.RCURLY, nil)
		case next == '}':
			lex.Emit(tokens.LCURLY, nil)
		case next == '[':
			lex.Emit(tokens.LSQUARE, nil)
		case next == ']':
			lex.Emit(tokens.RSQUARE, nil)
		case next == '.':
			lex.Emit(tokens.DOT, nil)
		}
	}
	lex.EmitEOF()
	return nil
}

//LexText is the public entry point for all lexer states
func LexText(lex *internal.Lexer) State {
	return lexText
}

repository: arborlang/ArborGo

repo_name: arborlang/ArborGo


text:
package slackapi

// RTMMessage is a real-time message sent/received to/from Slack
type RTMMessage struct {
	ID      uint64 `json:"id"`
	Type    string `json:"type"`
	Channel string `json:"channel"`
	Text    string `json:"text"`
	User    string `json:"user"`
}

// RTMMessageResponse is received in response to RTMMessage requests
type RTMMessageResponse struct {
	OK        bool                `json:"ok"`       // success: true
	ReplyTo   int                 `json:"reply_to"` // ID of the request this responds to
	timestamp string              `json:"ts"`       // timestamp in the format "1355517523.000005"
	Text      string              `json:"text"`     // potentially modified version of the request
	Error     RTMMessageErrorCode `json:"error"`    // error, if OK==false
}

// RTMMessageErrorCode is included in RTMMessageResponse on error
type RTMMessageErrorCode struct {
	Code    int    `json:"code"`
	Message string `json:"msg"`
}

repository: wblakecaldwell/slackapi

repo_name: wblakecaldwell/slackapi


text:
SUMMARY = "Dump ACPI tables to a file"

LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7"

do_configure[depends] += "virtual/kernel:do_shared_workdir"
do_populate_lic[depends] += "virtual/kernel:do_patch"

inherit linux-kernel-base kernelsrc

EXTRA_OEMAKE += "-C ${S}/tools/power/acpi/tools/acpidump CC='${CC}' LD='${CCLD}' CROSS_COMPILE=${TARGET_PREFIX} DESTDIR=${D}"

do_compile() {
	oe_runmake all
}

do_install() {
	oe_runmake install
}

PACKAGE_ARCH = "${MACHINE_ARCH}"

repository: westeri/meta-acpi

repo_name: westeri/meta-acpi

gha_language: ASL


text:
require xorg-driver-input.inc

DESCRIPTION = "X.Org X server -- VMMouse input driver to use with VMWare"
PE = "1"


text:
DESCRIPTION = "Mender add-on for remote terminal access."
HOMEPAGE = "https://mender.io"

SRC_URI = "git://github.com/mendersoftware/mender-shell.git;protocol=https;branch=master"

# See: https://www.yoctoproject.org/docs/2.5.1/dev-manual/dev-manual.html#automatically-incrementing-a-binary-package-revision-number
SRCREV = "${AUTOREV}"
PV = "0.1+git${SRCPV}"

# DO NOT change the checksum here without make sure that ALL licenses (including
# dependencies) are included in the LICENSE variable below. Note that for
# releases, we must check the LIC_FILES_CHKSUM.sha256 file, not the LICENSE
# file.
LICENSE = "Apache-2.0 & BSD-2-Clause & BSD-3-Clause & ISC & MIT"
LIC_FILES_CHKSUM = "file://src/${GO_IMPORT}/LICENSE;md5=7fd64609fe1bce47db0e8f6e3cc6a11d"

DEPENDS_append = " glib-2.0"
RDEPENDS_${PN} = "glib-2.0"

MENDER_SERVER_URL ?= "https://docker.mender.io"
MENDER_SHELL_USER ??= "nobody"
SYSTEMD_AUTO_ENABLE ?= "enable"

B = "${WORKDIR}/build"

inherit go
inherit go-ptest
inherit pkgconfig
inherit systemd

GO_IMPORT = "github.com/mendersoftware/mender-shell"

do_compile() {
    oe_runmake \
        -C ${B}/src/${GO_IMPORT} \
        V=1
}

python do_prepare_mender_shell_conf() {
    import json

    mender_shell_conf = {}
    # If a mender-shell.conf has been provided in SRC_URI, merge contents
    src_conf = os.path.join(d.getVar("WORKDIR"), "mender-shell.conf")
    if os.path.exists(src_conf):
        with open(src_conf) as fd:
            mender_shell_conf = json.load(fd)

    if "ServerURL" not in mender_shell_conf:
        mender_shell_conf["ServerURL"] = d.getVar("MENDER_SERVER_URL")

    if "User" not in mender_shell_conf:
        mender_shell_conf["User"] = d.getVar("MENDER_SHELL_USER")

    dst_conf = os.path.join(d.getVar("B"), "mender-shell.conf")
    with open(dst_conf, "w") as fd:
        json.dump(mender_shell_conf, fd, indent=4, sort_keys=True)

}
addtask do_prepare_mender_shell_conf after do_compile before do_install
do_prepare_mender_shell_conf[vardeps] = " \
    MENDER_SERVER_URL \
    MENDER_SHELL_USER \
"

do_install() {
    oe_runmake \
        -C ${B}/src/${GO_IMPORT} \
        V=1 \
        prefix=${D} \
        bindir=${bindir} \
        datadir=${datadir} \
        sysconfdir=${sysconfdir} \
        systemd_unitdir=${systemd_unitdir} \
        install-bin \
        install-systemd

    # install configuration
    mkdir -p  ${D}/${sysconfdir}/mender
    install -m 0600 ${B}/mender-shell.conf ${D}/${sysconfdir}/mender/mender-shell.conf
}

FILES_${PN}_append += "\
    ${systemd_unitdir}/system/mender-shell.service \
"


text:
# Helper functions for generating the clients

# Create target python_client for generating the python client.
# This will build the required thrift files and move everything together in
# ${CMAKE_BINARY_DIR}/clients/python/
function(genPythonClient)
  # Directory of the python client
  set(OUTPUT_DIR "${CMAKE_SOURCE_DIR}/clients/python")

  # Generate the command that builds the python thrift module.
  buildThriftPy(thrift/FalconService.thrift)

  set(FILES_TO_MOVE
    ${CMAKE_BINARY_DIR}/thrift/gen-py/FalconService/FalconService.py
    ${CMAKE_BINARY_DIR}/thrift/gen-py/FalconService/ttypes.py)

  set(FILES_MOVED "")

  foreach(FILE ${FILES_TO_MOVE})
    get_filename_component(fileName "${FILE}" NAME)
    get_filename_component(filePath "${FILE}" PATH)

    set(OUTPUT "${OUTPUT_DIR}/${fileName}")
    list(APPEND FILES_MOVED ${OUTPUT})

    add_custom_command(
      OUTPUT ${OUTPUT}
      COMMAND ${CMAKE_COMMAND} -E copy ${FILE} ${OUTPUT}
      DEPENDS ${FILE}
      COMMENT Copying ${FILE}
      )
  endforeach()

  # Create a custom target that
  add_custom_target(python_client ALL DEPENDS ${FILES_MOVED})
endfunction()

repository: falcon-org/Falcon

repo_name: falcon-org/Falcon

extension: cmake


text:
package model

type Transport struct {
	Name string
}

func (g *Transport) SetName(name string) {
	g.Name = name
}

func (g *Transport) GetName() string {
	return g.Name
}

branch_name: refs/heads/main


text:
@INPROCEEDINGS{6503215,
author={Liang Wang and Kangasharju, J.},
booktitle={Global Communications Conference (GLOBECOM), 2012 IEEE},
title={Real-world sybil attacks in BitTorrent mainline DHT},
year={2012},
month={Dec},
pages={826-832},
keywords={computer crime;peer-to-peer computing;BitTorrent Mainline DHT network;DHT attack;P2P content-distribution system;distributed hash table;distributed tracker;honeypot;network attack;network threat;real-world Sybil attack},
doi={10.1109/GLOCOM.2012.6503215},
ISSN={1930-529X},}

repository: ryanrhymes/personal

repo_name: ryanrhymes/personal


text:
package handlers

import (
	"adexchange/lib"
	adxm "adexchange/models"
	adpm "adprocess/models"
	"github.com/astaxie/beego"
	"github.com/garyburd/redigo/redis"
	"gopkg.in/vmihailenco/msgpack.v2"
	"time"
)

func HandleDemandLog() {

	c := lib.GetQueuePool().Get()
	for {
		reply, err := c.Do("brpop", beego.AppConfig.String("runmode")+"_ADMUX_DEMAND", "0")

		if err != nil {
			beego.Error(err.Error())
			continue
		}

		switch reply := reply.(type) {
		case []interface{}:
			b, _ := redis.Bytes(reply[1], nil)
			dealDemandLog(b)
			break
		case nil:

			beego.Debug("ADMUX_DEMAND Connection timeout")
			break
		default:
			beego.Debug("ADMUX_DEMAND Unknow reply:")
			beego.Debug(reply)
			break
		}

	}

	defer c.Close()
}

func dealDemandLog(b []byte) {
	var adResponse adxm.AdResponse
	err := msgpack.Unmarshal(b, &adResponse)
	if err != nil {
		beego.Error(err.Error())
	} else {
		adpm.AddDemandLog(getDemandResponseLog(&adResponse))
	}

}

func getDemandResponseLog(adResponse *adxm.AdResponse) *adpm.PmpDemandResponseLog {

	demandResponseLog := new(adpm.PmpDemandResponseLog)

	demandResponseLog.ResponseTime = time.Unix(adResponse.GetResponseTime(), 0).Format("2006-01-02 15:04:05")

	demandResponseLog.AdDate = time.Unix(adResponse.GetResponseTime(), 0).Format("2006-01-02")
	demandResponseLog.Bid = adResponse.Bid
	demandResponseLog.Did = adResponse.Did
	demandResponseLog.ResponseCode = adResponse.StatusCode
	demandResponseLog.DemandAdspaceId = adpm.GetDemandAdspaceId(adResponse.GetDemandAdspaceKey())
	demandResponseLog.ResponseBody = adResponse.ResBody

	return demandResponseLog
}

repository: joyplus/adprocess

repo_name: joyplus/adprocess


text:
@Article{Cohen:Daubechies:Vial:1993,
	Title = {Wavelets on the Interval and Fast Wavelet Transforms},
	Author = {Albert Cohen and Ingrid Daubechies and Pierre Vial},
	Journal = {Applied and Computational Harmonic Analysis},
	Year = {1993},
	Month = {December},
	Number = {1},
	Pages = {54--81},
	Volume = {1},
	Doi = {10.1006/acha.1993.1005},
}

@Article{Adcock:Gataric:Hansen:2015,
	Title = {Weighted frames of exponentials and stable recovery of multidimensional functions from nonuniform {Fourier} samples},
	Author = {Ben Adcock and Milana Gataric and Anders C. Hansen},
	Journal = {Applied Computational Harmonic Analysis},
	Year = {2015},
	Doi = {10.1016/j.acha.2015.09.006}

}

@Article{Adcock:Gataric:Hansen:2014,
	Title = {On stable reconstructions from univariate nonuniform {Fourier} measurements},
	Author = {Ben Adcock and Milana Gataric and Anders C. Hansen},
	Journal = {SIAM Journal on Imaging Sciences},
	Year = {2014},
	Number = {3},
	Pages = {1690--1723},
	Volume = {7},
	Doi = {10.1137/130943431},
}

@Article{Gataric:Poon:2016,
	Title = {A practical guide to the recovery of wavelet coefficients from {Fourier} measurements},
	Author = {Milana Gataric and Clarice Poon},
	Journal = {SIAM Journal on Scientific Computing},
	Year = {2016},
	Number = {2},
	Pages = {A1075–-A1099},
	Volume = {38},
	Doi = {10.1137/15M1018630},
}

@Article{Adcock:Hansen:2012,
	Title = {A Generalized Sampling Theorem for Stable Reconstructions in Arbitrary Bases},
	Author = {Ben Adcock and Anders C. Hansen},
	Journal = {Journal of Fourier Analysis and Applications},
	Year = {2012},
	Pages = {685--716},
	Volume = {18},
	Doi = {10.1007/s00041-012-9221-x},
}

gha_license_id: NOASSERTION


text:
@inproceedings{alberti-etal-2019-fusion,
    title = "Fusion of Detected Objects in Text for Visual Question Answering",
    author = "Alberti, Chris  and
      Ling, Jeffrey  and
      Collins, Michael  and
      Reitter, David",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP)",
    month = nov,
    year = "2019",
    address = "Hong Kong, China",
    publisher = "Association for Computational Linguistics",
    url = "https://www.aclweb.org/anthology/D19-1219",
    doi = "10.18653/v1/D19-1219",
    pages = "2131--2140",
    abstract = "To advance models of multimodal context, we introduce a simple yet powerful neural architecture for data that combines vision and natural language. The {``}Bounding Boxes in Text Transformer{''} (B2T2) also leverages referential information binding words to portions of the image in a single unified architecture. B2T2 is highly effective on the Visual Commonsense Reasoning benchmark, achieving a new state-of-the-art with a 25{\%} relative reduction in error rate compared to published baselines and obtaining the best performance to date on the public leaderboard (as of May 22, 2019). A detailed ablation analysis shows that the early integration of the visual features into the text analysis is key to the effectiveness of the new architecture. A reference implementation of our models is provided.",
}

url: https://raw.githubusercontent.com/Hugh-Shi/DL-NLP-Readings/924e4d189e5660c5b5d4854278f3df755ae2231d/Bibtex/Fusion of Detected Objects in Text for Visual Question Answering.bib

repository: Hugh-Shi/DL-NLP-Readings

repo_name: Hugh-Shi/DL-NLP-Readings


text:
package spacetraders

import "time"

type GetMyIpAddressResponse struct {
	Ip string `json:"ip"`
}

type GameStatusResponse struct {
	Status string `json:"status"`
}

type ClaimUsernameResponseUser struct {
	Username string `json:"username"`
	Credits  int    `json:"credits"`
	Ships    []Ship `json:"ships"`
	Loans    []Loan `json:"loans"`
}

type ClaimUsernameResponse struct {
	Token string                    `json:"token"`
	User  ClaimUsernameResponseUser `json:"user"`
}

type UserInfoUser struct {
	Username       string    `json:"username"`
	Credits        int       `json:"credits"`
	ShipCount      int       `json:"shipCount"`
	StructureCount int       `json:"structureCount"`
	JoinedAt       time.Time `json:"joinedAt"`
}

type GetMyInfoResponse struct {
	User UserInfoUser `json:"user"`
}

type GetFlightPlanResponse struct {
	FlightPlan FlightPlan `json:"flightPlan"`
}

type CreateFlightPlanResponse struct {
	FlightPlan FlightPlan `json:"flightPlan"`
}

type GetMyLoansResponse struct {
	Loans []Loan `json:"loans"`
}

type PayOffLoanResponse struct {
	Credits int    `json:"credits"`
	Loans   []Loan `json:"loans"`
}

type CreateLoanResponse struct {
	Credits int  `json:"credits"`
	Loan    Loan `json:"loan"`
}

type GetLocationResponse struct {
	Location    LocationDetails `json:"location"`
	DockedShips int             `json:"dockedShips"`
}

type GetLocationMarketplaceResponse struct {
	Marketplace []MarketplaceData
}

type CreatePurchaseOrderResponse struct {
	Credits int       `json:"credits"`
	Order   OrderData `json:"order"`
	Ship    Ship      `json:"ship"`
}

type CreateSellOrderResponse struct {
	Credits int       `json:"credits"`
	Order   OrderData `json:"order"`
	Ship    Ship      `json:"ship"`
}

type PurchaseShipResponse struct {
	Credits int  `json:"credits"`
	Ship    Ship `json:"ship"`
}

type GetMyShipRequest struct {
	Ship Ship `json:"ship"`
}

type GetMyShipsResponse struct {
	Ships []Ship `json:"ships"`
}

type JettisonCargoResponse struct {
	ShipId            string `json:"shipId"`
	Good              string `json:"good"`
	QuantityRemaining int    `json:"quantityRemaining"`
}

type PurchaseLocation struct {
	System   string `json:"system"`
	Location string `json:"location"`
	Price    int    `json:"price"`
}

type ShipForSale struct {
	Type              string             `json:"type"`
	Class             string             `json:"class"`
	MaxCargo          int                `json:"maxCargo"`
	LoadingSpeed      int                `json:"loadingSpeed"`
	Speed             int                `json:"speed"`
	Manufacturer      string             `json:"manufacturer"`
	Plating           int                `json:"plating"`
	Weapons           int                `json:"weapons"`
	PurchaseLocations []PurchaseLocation `json:"purchaseLocations"`
	RestrictedGoods   []string           `json:"restrictedGoods"`
}

type GetShipsForSaleResponse struct {
	ShipsForSale []ShipForSale `json:"ships"`
}

type SystemLocation struct {
	Symbol             string   `json:"symbol"`
	Type               string   `json:"type"`
	Name               string   `json:"name"`
	X                  int      `json:"x"`
	Y                  int      `json:"y"`
	AllowsConstruction bool     `json:"allowsConstruction"`
	Traits             []string `json:"traits"`
	Messages           []string `json:"messages"`
}

type GetSystemLocationsResponse struct {
	Locations []SystemLocation `json:"locations"`
}

type System struct {
	Name   string `json:"name"`
	Symbol string `json:"symbol"`
}

type GetSystemResponse struct {
	System System `json:"system"`
}

type AvailableLoan struct {
	Type               string  `json:"type"`
	Amount             int     `json:"amount"`
	Rate               float64 `json:"rate"`
	TermInDays         int     `json:"termInDays"`
	CollateralRequired bool    `json:"collateralRequired"`
}

type GetAvailableLoansResponse struct {
	Loans []AvailableLoan `json:"loans"`
}

type WarpJumpResponse struct {
	FlightPlan FlightPlan `json:"flightPlan"`
}

type ScrapShipResponse struct {
	Success string `json:"success"`
}

repository: bloveless/spacemonger-api

repo_name: bloveless/spacemonger-api

gha_language: Rust


text:
@article{soler-toscano_calculating_2014,
    title = {Calculating {Kolmogorov} {Complexity} from the {Output} {Frequency} {Distributions} of {Small} {Turing} {Machines}},
    volume = {9},
    number = {5},
    journal = {PLoS ONE},
    author = {Soler-Toscano, Fernando and Zenil, Hector and Delahaye, Jean-Paul and Gauvrit, Nicolas},
    year = {2014},
    pages = {e96223},
}

repository: sztal/ecss-class

repo_name: sztal/ecss-class


text:
SUMMARY = "Framework core base components for display and mutlimedia"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

PACKAGE_ARCH = "${MACHINE_ARCH}"

inherit packagegroup

PROVIDES = "${PACKAGES}"
PACKAGES = "\
            packagegroup-framework-core-base            \
            packagegroup-framework-core-base-display    \
            packagegroup-framework-core-base-mm         \
            packagegroup-framework-core-base-fs         \
            "

# Manage to provide all framework core base packages with overall one
RDEPENDS:packagegroup-framework-core-base = "\
    packagegroup-framework-core-base-display    \
    packagegroup-framework-core-base-mm         \
    packagegroup-framework-core-base-fs         \
    "

SUMMARY:packagegroup-framework-core-base-display = "Framework core base components for display"
RDEPENDS:packagegroup-framework-core-base-display = "\
    libdrm          \
    libdrm-tests    \
    \
    ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'libsdl2', '', d)} \
    "

SUMMARY:packagegroup-framework-core-base-mm = "Framework core base components for multimedia"
RDEPENDS:packagegroup-framework-core-base-mm = "\
    "

SUMMARY:packagegroup-framework-core-base-fs = "Framework core base components for filesystem"
RDEPENDS:packagegroup-framework-core-base-fs = "\
    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-mount-partitions', '', d)} \
    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'userfs-cleanup-package', '', d)} \
    "

repository: STMicroelectronics/meta-st-openstlinux

repo_name: STMicroelectronics/meta-st-openstlinux

branch_name: refs/heads/kirkstone


text:
inherit noto-fonts
inherit noto-cjk

SRC_URI = "${NOTO_SRC_URI_PREFIX}/NotoSansCJK-Bold.ttc.zip"
SRC_URI[sha256sum] = "3cd895bce6765903b2eefcd90eea6ed372364e66d5b896ea3a594bd3e737eba0"

repository: ssfivy/meta-noto

repo_name: ssfivy/meta-noto


text:
require libva.inc

PR = "${INC_PR}.0"

SRC_URI = "http://www.freedesktop.org/software/vaapi/releases/libva/libva-${PV}.tar.bz2"

SRC_URI[md5sum] = "cd5cc1ce37d6fc6f991ef579ac81d891"
SRC_URI[sha256sum] = "c0af7bf3e96e19fbd0513fbf461a010638907136b5ee0d68094fa0cc7e66cd4d"

repository: linkessence/Galileo

repo_name: linkessence/Galileo


text:
// Package billmodel contains the types for schema 'equinox'.
package billmodel

// GENERATED BY XO. DO NOT EDIT.

import (
	"database/sql"

	"github.com/lib/pq"
)

// Expcall represents a row from 'equinox.expcalls'.
type Expcall struct {
	Expdate         pq.NullTime     `json:"expdate"`         // expdate
	Exptime         sql.NullString  `json:"exptime"`         // exptime
	Expdestination  sql.NullString  `json:"expdestination"`  // expdestination
	Expdestnumber   sql.NullString  `json:"expdestnumber"`   // expdestnumber
	Expratingperiod sql.NullString  `json:"expratingperiod"` // expratingperiod
	Expdurationsecs sql.NullInt64   `json:"expdurationsecs"` // expdurationsecs
	Expband         sql.NullString  `json:"expband"`         // expband
	Expwholesale    sql.NullInt64   `json:"expwholesale"`    // expwholesale
	Exptypeofexecpt sql.NullFloat64 `json:"exptypeofexecpt"` // exptypeofexecpt
	Expcli          sql.NullString  `json:"expcli"`          // expcli
	Expfileid       sql.NullString  `json:"expfileid"`       // expfileid
	Expbillno       sql.NullFloat64 `json:"expbillno"`       // expbillno
	Expcarrier      sql.NullString  `json:"expcarrier"`      // expcarrier
	Expsparec1      sql.NullString  `json:"expsparec1"`      // expsparec1
	Expsparen1      sql.NullFloat64 `json:"expsparen1"`      // expsparen1
	Expspared1      pq.NullTime     `json:"expspared1"`      // expspared1
	EquinoxLrn      int64           `json:"equinox_lrn"`     // equinox_lrn
	EquinoxSec      sql.NullInt64   `json:"equinox_sec"`     // equinox_sec
}

func AllExpcall(db XODB, callback func(x Expcall) bool) error {

	// sql query
	const sqlstr = `SELECT ` +
		`expdate, exptime, expdestination, expdestnumber, expratingperiod, expdurationsecs, expband, expwholesale, exptypeofexecpt, expcli, expfileid, expbillno, expcarrier, expsparec1, expsparen1, expspared1, equinox_lrn, equinox_sec ` +
		`FROM equinox.expcalls `

	q, err := db.Query(sqlstr)

	if err != nil {
		return err
	}
	defer q.Close()

	// load results
	for q.Next() {
		e := Expcall{}

		// scan
		err = q.Scan(&e.Expdate, &e.Exptime, &e.Expdestination, &e.Expdestnumber, &e.Expratingperiod, &e.Expdurationsecs, &e.Expband, &e.Expwholesale, &e.Exptypeofexecpt, &e.Expcli, &e.Expfileid, &e.Expbillno, &e.Expcarrier, &e.Expsparec1, &e.Expsparen1, &e.Expspared1, &e.EquinoxLrn, &e.EquinoxSec)
		if err != nil {
			return err
		}
		if !callback(e) {
			return nil
		}
	}

	return nil
}

// ExpcallByEquinoxLrn retrieves a row from 'equinox.expcalls' as a Expcall.
//
// Generated from index 'expcalls_pkey'.
func ExpcallByEquinoxLrn(db XODB, equinoxLrn int64) (*Expcall, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`expdate, exptime, expdestination, expdestnumber, expratingperiod, expdurationsecs, expband, expwholesale, exptypeofexecpt, expcli, expfileid, expbillno, expcarrier, expsparec1, expsparen1, expspared1, equinox_lrn, equinox_sec ` +
		`FROM equinox.expcalls ` +
		`WHERE equinox_lrn = $1`

	// run query
	XOLog(sqlstr, equinoxLrn)
	e := Expcall{}

	err = db.QueryRow(sqlstr, equinoxLrn).Scan(&e.Expdate, &e.Exptime, &e.Expdestination, &e.Expdestnumber, &e.Expratingperiod, &e.Expdurationsecs, &e.Expband, &e.Expwholesale, &e.Exptypeofexecpt, &e.Expcli, &e.Expfileid, &e.Expbillno, &e.Expcarrier, &e.Expsparec1, &e.Expsparen1, &e.Expspared1, &e.EquinoxLrn, &e.EquinoxSec)
	if err != nil {
		return nil, err
	}

	return &e, nil
}

repository: utilitywarehouse/poc-pg-mirror

repo_name: utilitywarehouse/poc-pg-mirror


text:
package payment

import (
	"koding/db/mongodb/modelhelper"

	"github.com/stripe/stripe-go"
	"github.com/stripe/stripe-go/invoice"
)

// ListInvoicesForGroup lists invoices of a group
func ListInvoicesForGroup(groupName string, startingAfter string, limit int) ([]*stripe.Invoice, error) {
	group, err := modelhelper.GetGroup(groupName)
	if err != nil {
		return nil, err
	}

	if group.Payment.Customer.ID == "" {
		return nil, ErrCustomerNotExists
	}

	var invoices []*stripe.Invoice

	params := &stripe.InvoiceListParams{}
	params.Customer = group.Payment.Customer.ID
	params.Limit = limit
	params.Start = startingAfter
	i := invoice.List(params)
	for i.Next() {
		invoices = append(invoices, i.Invoice())
	}

	if err := i.Err(); err != nil {
		return nil, err
	}

	return invoices, nil
}

repository: ishan-marikar/koding

repo_name: ishan-marikar/koding

gha_language: CoffeeScript


text:
package main

import (
	"fmt"
	"log"
	"net/http"
)

func main() {
	fileServer := http.FileServer(http.Dir("./"))
	http.Handle("/", fileServer)
	port := ":60595"

	fmt.Printf("Starting server on: http://localhost%s", port)
	if err := http.ListenAndServe(port, nil); err != nil {
		log.Fatal(err)
	}
}

repository: hackclub/web-slides

repo_name: hackclub/web-slides