text:
inproceedings{03Horton23,
author = {Horton, Diane and Liu, David and McIlraith, Sheila A. and Wang, Nina},
title = {Is More Better When Embedding Ethics in CS Courses?},
year = {2023},
isbn = {9781450394314},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3545945.3569881},
doi = {10.1145/3545945.3569881},
abstract = {Embedding ethics modules in computer science (CS) courses is an approach to post-secondary ethics education that has been gaining traction. In contrast to dedicated courses on ethics in CS, embedding ethics modules into CS courses supports tight connections between ethical considerations and CS concepts, as well as enabling repeated exposure to ethics across multiple courses. Initial studies of the effectiveness of such modules suggest that this approach can increase both student interest in ethics and technology, and student self-efficacy towards incorporating ethical considerations in their computing work. Departments wishing to deploy embedded ethics (EE) modules need to decide how to invest resources, including class time, to maximize effectiveness while maintaining curriculum objectives. Such considerations include the number of EE module experiences a student has throughout their degree program, as well as the spacing of those experiences.Research to date has focused on the effect of a single embedded ethics module. In this paper, we report on a study examining the impact of experiencing EE modules in multiple courses. Among our findings, our results suggest that more is not necessarily better --- that a modest number of periodic exposures to EE modules over the course of a degree
program may be sufficient to achieve sustained positive attitudes and self-efficacy among students. While a picture is beginning to emerge, these results highlight the need for further research on the effectiveness of embedded ethics programs as a whole.},
booktitle = {Proceedings of the 54th ACM Technical Symposium on Computer Science Education V. 1},
pages = {652–658},
numpages = {7},
keywords = {embedded ethics, ethics education, impact of technology on society},
location = {Toronto ON, Canada},
series = {SIGCSE 2023}
}

@inproceedings{03Liu19,
 author = {David Liu and Andrew Petersen},
 title = {Static Analyses in Python Programming Courses},
 booktitle = {Proceedings of the 50th ACM Technical Symposium on Computer Science Education},
 series = {SIGCSE '19},
 year = {2019},
 isbn = {978-1-4503-5890-3},
 location = {Minneapolis, MN, USA},
 pages = {666--671},
 numpages = {6},
 url = {http://doi.acm.org/10.1145/3287324.3287503},
 doi = {10.1145/3287324.3287503},
 acmid = {3287503},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {cs1, error messages, errors, python, static analysis},
}

gha_license_id: NOASSERTION

gha_language: TeX


text:
@article{lin2021structured,
  title={Structured Attention Network for Referring Image Segmentation},
  author={Lin, Liang and Yan, Pengxiang and Xu, Xiaoqian and Yang, Sibei and Zeng, Kun and Li, Guanbin},
  journal={IEEE Transactions on Multimedia},
  year={2021},
  publisher={IEEE}
}

license: MIT

repository: Kinpzz/hugo-academic

license_type: permissive

repo_name: Kinpzz/hugo-academic

branch_name: refs/heads/master

extension: bib


text:
@article{jorg_comment_2008,
 author = {Jörg, Thomas and Krząkała, Florent},
 doi = {10.1103/PhysRevLett.100.159701},
 file = {Jörg and Krząkała - 2008 - Comment on “Ultrametricity in the Edwards-Anderson.pdf:/Users/florentkrzakala/Zotero/storage/NB2LKF7W/Jörg and Krząkała - 2008 - Comment on “Ultrametricity in the Edwards-Anderson.pdf:application/pdf},
 issn = {0031-9007, 1079-7114},
 journal = {Physical Review Letters},
 language = {en},
 month = {April},
 number = {15},
 title = {Comment on “Ultrametricity in the Edwards-Anderson Model”},
 url = {https://link.aps.org/doi/10.1103/PhysRevLett.100.159701},
 urldate = {2019-07-01},
 volume = {100},
 year = {2008}
}

repository: krzakala/academic-kickstart

repo_name: krzakala/academic-kickstart


text:
@book{atlas2014,
  title={The atlas of economic complexity: Mapping paths to prosperity},
  author={Hidalgo, C{\'e}sar and Hausmann, Ricardo and Bustos, Sebasti{\'a}n and Coscia, Michele and Simoes, Alexander and Yildirim, Muhammed},
  year={2014},
  publisher={Mit Press}
}

@article{buildingblocks2009,
  title={The building blocks of economic complexity},
  author={Hidalgo, C{\'e}sar and Hausmann, Ricardo},
  journal={Proceedings of the national academy of sciences},
  volume={106},
  number={26},
  pages={10570--10575},
  year={2009},
  publisher={National Acad Sciences}
}

@article{productspace2007,
  title={The product space conditions the development of nations},
  author={Hidalgo, C{\'e}sar and Klinger, Bailey and Barab{\'a}si, Albert-L{'a}szl{'o} and Hausmann, Ricardo},
  journal={Science},
  volume={317},
  number={5837},
  pages={482--487},
  year={2007},
  publisher={American Association for the Advancement of Science}
}

@techreport{worldtrade2005,
  title={World trade flows: 1962-2000},
  author={Feenstra, Robert and Lipsey, Robert and Deng, Haiyan and Ma, Alysonand Mo, Hengyong},
  year={2005},
  institution={National Bureau of Economic Research}
}

@article{mesuringcomplexity2015,
  title={Measuring economic complexity of countries and products: which metric to use?},
  author={Mariani, Manuel and Vidmer, Alexandre and Medo, Mats{\'u}{\v{s}} and Zhang, Yi-Cheng},
  journal={The European Physical Journal B},
  volume={88},
  number={11},
  pages={293},
  year={2015},
  publisher={Springer}
}

@TechReport{interpretationreflections2014,
  author={Kemp-Benedict, Eric},
  title={An interpretation and critique of the Method of Reflections},
  year={2014},
  institution={University Library of Munich}
}

@book{advancedr2014,
  title={Advanced R},
  author={Wickham, Hadley},
  year={2014},
  publisher={CRC Press}
}

@book{masteringsoftware2017,
  title={Mastering Software Development in {R}},
  author={Peng, Roger and Kross, Sean and Anderson, Brooke},
  year={2017},
  publisher={Leanpub}
}

@techreport{rcpparmadillo2018,
  title={RcppArmadillo: Sparse Matrix Support},
  year={2018},
  author={Ni, Binxiang and Selivanov, Dmitriy and Eddelbuettel, Dirk and Kou, Qiang},
  institution={Comprehensive R Archive Network}
}

@book{r4ds2016,
  title={R for data science: Import, tidy, transform, visualize, and model data},
  author={Wickham, Hadley and Grolemund, Garrett},
  year={2016},
  publisher={O'Reilly Media, Inc.}
}

@article{tidydata2014,
   author = {Hadley  Wickham},
   title = {Tidy Data},
   journal = {Journal of Statistical Software, Articles},
   volume = {59},
   number = {10},
   year = {2014},
   pages = {1--23}
}

@article{tradecosts2004,
  title={Trade costs},
  author={Anderson, James E and Van Wincoop, Eric},
  journal={Journal of Economic literature},
  volume={42},
  number={3},
  pages={691--751},
  year={2004}
}

@article{geography2009,
  title={Toward a geography of trade costs},
  author={Hummels, David},
  year={1999}
}

@article{baci2010,
  title={Baci: international trade database at the product-level (the 1994-2007 version)},
  author={Gaulier, Guillaume and Zignago, Soledad},
  year={2010}
}


text:
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
//

package aws

import (
	"fmt"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/arn"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/mattermost/mattermost-cloud/model"
	mmv1alpha1 "github.com/mattermost/mattermost-operator/pkg/apis/mattermost/v1alpha1"
	"github.com/pkg/errors"
	log "github.com/sirupsen/logrus"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// S3MultitenantFilestore is a filestore backed by a shared AWS S3 bucket.
type S3MultitenantFilestore struct {
	installationID string
	awsClient      *Client
}

// NewS3MultitenantFilestore returns a new NewS3MultitenantFilestore interface.
func NewS3MultitenantFilestore(installationID string, awsClient *Client) *S3MultitenantFilestore {
	return &S3MultitenantFilestore{
		installationID: installationID,
		awsClient:      awsClient,
	}
}

// Provision completes all the steps necessary to provision an S3 multitenant
// filestore.
func (f *S3MultitenantFilestore) Provision(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error {
	err := f.s3FilestoreProvision(store, logger)
	if err != nil {
		return errors.Wrap(err, "failed to provision AWS multitenant S3 filestore")
	}

	return nil
}

// Teardown removes all AWS resources related to a shared S3 filestore.
func (f *S3MultitenantFilestore) Teardown(keepData bool, store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error {
	awsID := CloudID(f.installationID)

	logger = logger.WithFields(log.Fields{
		"awsID":          awsID,
		"filestore-type": "s3-multitenant",
	})
	logger.Info("Tearing down AWS S3 filestore")

	bucketName, err := f.getMultitenantBucketName(store)
	if err != nil {
		return errors.Wrap(err, "failed to find multitenant bucket")
	}

	logger = logger.WithField("s3-bucket-name", bucketName)

	err = f.awsClient.iamEnsureUserDeleted(awsID, logger)
	if err != nil {
		return errors.Wrap(err, "failed to delete AWS IAM user")
	}

	err = f.awsClient.secretsManagerEnsureIAMAccessKeySecretDeleted(awsID, logger)
	if err != nil {
		return errors.Wrap(err, "failed to delete IAM access key secret")
	}

	if keepData {
		logger.Info("AWS S3 bucket was left intact due to the keep-data setting of this server")
		return nil
	}

	err = f.awsClient.S3EnsureBucketDirectoryDeleted(bucketName, f.installationID, logger)
	if err != nil {
		return errors.Wrap(err, "unable to ensure that AWS S3 filestore was deleted")
	}

	logger.Debug("AWS multitenant S3 filestore was deleted")
	return nil
}

// GenerateFilestoreSpecAndSecret creates the k8s filestore spec and secret for
// accessing the shared S3 bucket.
func (f *S3MultitenantFilestore) GenerateFilestoreSpecAndSecret(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) (*mmv1alpha1.Minio, *corev1.Secret, error) {
	awsID := CloudID(f.installationID)

	logger = logger.WithFields(log.Fields{
		"awsID":          awsID,
		"filestore-type": "s3-multitenant",
	})
	logger.Debug("Generating S3 multitenant filestore information")

	bucketName, err := f.getMultitenantBucketName(store)
	if err != nil {
		return nil, nil, errors.Wrap(err, "failed to find multitenant bucket")
	}

	logger = logger.WithField("s3-bucket-name", bucketName)

	iamAccessKey, err := f.awsClient.secretsManagerGetIAMAccessKey(awsID, logger)
	if err != nil {
		return nil, nil, err
	}

	filestoreSecretName := fmt.Sprintf("%s-iam-access-key", f.installationID)
	filestoreSecret := &corev1.Secret{
		ObjectMeta: metav1.ObjectMeta{
			Name: filestoreSecretName,
		},
		StringData: map[string]string{
			"accesskey": iamAccessKey.ID,
			"secretkey": iamAccessKey.Secret,
		},
	}

	S3RegionURL := S3URL
	awsRegion := *f.awsClient.config.Region
	if awsRegion != "" && awsRegion != "us-east-1" {
		S3RegionURL = "s3." + awsRegion + ".amazonaws.com"
	}

	filestoreSpec := &mmv1alpha1.Minio{
		ExternalURL:    S3RegionURL,
		ExternalBucket: bucketName,
		Secret:         filestoreSecretName,
	}

	logger.Debug("AWS multitenant S3 filestore configuration generated for cluster installation")

	return filestoreSpec, filestoreSecret, nil
}

// s3FilestoreProvision provisions a shared S3 filestore for an installation.
func (f *S3MultitenantFilestore) s3FilestoreProvision(store model.InstallationDatabaseStoreInterface, logger log.FieldLogger) error {
	awsID := CloudID(f.installationID)

	logger = logger.WithFields(log.Fields{
		"awsID":          awsID,
		"filestore-type": "s3-multitenant",
	})
	logger.Info("Provisioning AWS multitenant S3 filestore")

	bucketName, err := f.getMultitenantBucketName(store)
	if err != nil {
		return errors.Wrap(err, "failed to find multitenant bucket")
	}

	logger = logger.WithField("s3-bucket-name", bucketName)

	user, err := f.awsClient.iamEnsureUserCreated(awsID, logger)
	if err != nil {
		return err
	}

	// The IAM policy lookup requires the AWS account ID for the ARN. The user
	// object contains this ID so we will user that.
	arn, err := arn.Parse(*user.Arn)
	if err != nil {
		return err
	}
	policyARN := fmt.Sprintf("arn:aws:iam::%s:policy/%s", arn.AccountID, awsID)
	policy, err := f.awsClient.iamEnsureS3PolicyCreated(awsID, policyARN, bucketName, f.installationID, logger)
	if err != nil {
		return err
	}
	err = f.awsClient.iamEnsurePolicyAttached(awsID, policyARN, logger)
	if err != nil {
		return err
	}
	logger.WithFields(log.Fields{
		"iam-policy-name": *policy.PolicyName,
		"iam-user-name":   *user.UserName,
	}).Debug("AWS IAM policy attached to user")

	ak, err := f.awsClient.iamEnsureAccessKeyCreated(awsID, logger)
	if err != nil {
		return err
	}
	logger.WithField("iam-user-name", *user.UserName).Debug("AWS IAM user access key created")

	err = f.awsClient.secretsManagerEnsureIAMAccessKeySecretCreated(awsID, ak, logger)
	if err != nil {
		return err
	}
	logger.WithField("iam-user-name", *user.UserName).Debug("AWS secrets manager secret created")

	return nil
}

func (f *S3MultitenantFilestore) getMultitenantBucketName(store model.InstallationDatabaseStoreInterface) (string, error) {
	envName, err := f.awsClient.GetCloudEnvironmentName()
	if err != nil {
		return "", errors.Wrap(err, "failed to get cloud environment name")
	}
	vpc, err := getVPCForInstallation(f.installationID, store, f.awsClient)
	if err != nil {
		return "", errors.Wrap(err, "failed to find cluster installation VPC")
	}

	bucketName := MattermostMultitenantS3Name(envName, *vpc.VpcId)

	// Ensure the bucket exists and that the tags are correct.
	tags, err := f.awsClient.Service().s3.GetBucketTagging(&s3.GetBucketTaggingInput{
		Bucket: aws.String(bucketName),
	})
	if aerr, ok := err.(awserr.Error); ok {
		if aerr.Code() == s3.ErrCodeNoSuchBucket {
			return "", errors.Wrapf(err, "failed to find bucket %s", bucketName)
		}
	} else if err != nil {
		return "", errors.Wrap(err, "failed to get bucket tags")
	}

	if !ensureTagInTagset(trimTagPrefix(VpcIDTagKey), *vpc.VpcId, tags.TagSet) {
		return "", errors.Errorf("failed to find %s tag on S3 bucket %s", VpcIDTagKey, bucketName)
	}
	if !ensureTagInTagset(trimTagPrefix(FilestoreMultitenantS3TagKey), FilestoreMultitenantS3TagValue, tags.TagSet) {
		return "", errors.Errorf("failed to find %s tag on S3 bucket %s", FilestoreMultitenantS3TagKey, bucketName)
	}

	return bucketName, nil
}

func ensureTagInTagset(key, value string, tags []*s3.Tag) bool {
	for _, tag := range tags {
		if *tag.Key == key && *tag.Value == value {
			return true
		}
	}

	return false
}

extension: go


text:
package reflect

import (
	"context"
	"sync"

	"github.com/pkg/errors"
	"github.com/rs/zerolog"
	apierrors "k8s.io/apimachinery/pkg/api/errors"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	corev1 "k8s.io/client-go/kubernetes/typed/core/v1"

	"github.com/havulv/reflector/pkg/annotations"
)

func cascadeDelete(
	ctx context.Context,
	logger zerolog.Logger,
	client corev1.SecretsGetter,
	secret string,
	namespaces []string,
	concurrency int,
) error {
	// shortcircuit if we have the best case of `do nothing`
	if len(namespaces) == 0 {
		logger.Info().Msg("no namespaces, skipping")
		return nil
	}

	return batchOverNamespaces(
		concurrency,
		namespaces,
		deleteLambda(ctx, logger, client, secret))
}

func deleteLambda(
	ctx context.Context,
	logger zerolog.Logger,
	client corev1.SecretsGetter,
	secret string,
) func(wg *sync.WaitGroup, ns string, errChan chan error) {
	return func(wg *sync.WaitGroup, ns string, errChan chan error) {
		// spin off a goroutine for every level of concurrency
		deleteSecret(
			ctx, logger.With().
				Str("reflectionNamespace", ns).Logger(),
			wg, client, secret, ns, errChan)
	}
}

func deleteSecret(
	ctx context.Context,
	logger zerolog.Logger,
	wg *sync.WaitGroup,
	client corev1.SecretsGetter,
	secret string,
	ns string,
	errChan chan error,
) {
	wg.Add(1)
	go func() {
		defer wg.Done()
		secretClient := client.Secrets(ns)
		if err := secretClient.Delete(
			ctx, secret, metav1.DeleteOptions{},
		); err != nil && !apierrors.IsNotFound(err) {
			logger.Error().Err(err).Msg("unable to delete secret")
			errChan <- errors.Wrap(
				err,
				"error while removing secret from the namspace")
		}
	}()
}

func findExistingSecretNamespaces(
	ctx context.Context,
	core corev1.CoreV1Interface,
	name string,
) ([]string, error) {
	// fetch all namespaces
	allNs, err := core.Namespaces().List(ctx, metav1.ListOptions{})
	if err != nil {
		return []string{}, errors.Wrap(err, "unable to list all namespaces")
	}

	namespaces := []string{}
	for _, item := range allNs.Items {
		found, err := core.Secrets(item.Name).Get(ctx, name, metav1.GetOptions{})
		if err != nil {
			return []string{}, errors.Wrap(err, "could not fetch secret for ns")
		}
		if annotations.CanOperate(found.Annotations) {
			namespaces = append(namespaces, item.Name)
		}
	}

	return namespaces, nil
}

repository: havulv/reflector

repo_name: havulv/reflector

branch_name: refs/heads/root

gha_language: Go


text:
% Encoding: UTF-8

@Article{Yang2016291,
  author          = {Yang, X. and Mao, K.},
  title           = {Learning multi-prototype word embedding from single-prototype word embedding with integrated knowledge},
  journal         = {Expert Systems with Applications},
  year            = {2016},
  volume          = {56},
  pages           = {291-299},
  note            = {cited By},
  abstract        = {Distributional semantic models (DSM) or word embeddings are widely used in prediction of semantic similarity and relatedness. However, context aware similarity and relatedness prediction is still a challenging issue because most DSM models or word embeddings use one vector per word without considering polysemy and homonym. In this paper, we propose a supervised fine tuning framework to transform the existing single-prototype word embeddings into multi-prototype word embeddings based on lexical semantic resources. As a post-processing step, the proposed framework is compatible with any sense inventory and any word embedding. To test the proposed learning framework, both intrinsic and extrinsic evaluations are conducted. Experiments results of 3 tasks with 8 datasets show that the multi-prototype word representations learned by the proposed framework outperform single-prototype word representations. © 2016 Elsevier Ltd. All rights reserved.},
  affiliation     = {School of Electrical and Electronic Engineering, Nanyang Technological University, Nanyang Avenue, Singapore, Singapore},
  author_keywords = {Distributional semantic model; Fine tuning; Multi-prototype word embedding; Semantic similarity},
  document_type   = {Article},
  doi             = {10.1016/j.eswa.2016.03.013},
  source          = {Scopus},
  url             = {https://www.scopus.com/inward/record.uri?eid=2-s2.0-84961960526&doi=10.1016%2fj.eswa.2016.03.013&partnerID=40&md5=a9903a94e467da3c952eaa33c41ef8b9},
}

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

repository: queirozfcom/auto-tagger

repo_name: queirozfcom/auto-tagger


text:
@article{Agrawal:2016ubh,
 archiveprefix = {arXiv},
 author = {Agrawal, Prateek and Sundrum, Raman},
 doi = {10.1007/JHEP05(2017)144},
 eprint = {1611.07021},
 journal = {JHEP},
 pages = {144},
 primaryclass = {hep-th},
 reportnumber = {UMD-PP-017-012},
 title = {Small Vacuum Energy from Small Equivalence Violation in Scalar Gravity},
 volume = {05},
 year = {2017}
}

repository: prateekagrawal/academic-kickstart

repo_name: prateekagrawal/academic-kickstart


text:
@inproceedings{DBLP:journals/corr/SzegedyZSBEGF13,
 author = {Christian Szegedy and
Wojciech Zaremba and
Ilya Sutskever and
Joan Bruna and
Dumitru Erhan and
Ian J. Goodfellow and
Rob Fergus},
 booktitle = {2nd International Conference on Learning Representations},
 title = {Intriguing properties of neural networks},
 year = {2014}
}
@inproceedings{DBLP:journals/corr/GoodfellowSS14,
 author = {Ian J. Goodfellow and
Jonathon Shlens and
Christian Szegedy},
 booktitle = {3rd International Conference on Learning Representations, {ICLR} 2015, Conference Track Proceedings},
 title = {Explaining and Harnessing Adversarial Examples},
 year = {2015}
}
@inproceedings{XiaoLZHLS18,
 author = {Chaowei Xiao and
Bo Li and
Jun{-}Yan Zhu and
Warren He and
Mingyan Liu and
Dawn Song},
 booktitle = {Proceedings of the Twenty-Seventh International Joint Conference on
Artificial Intelligence, {IJCAI} 2018, July 13-19, 2018, Stockholm,
Sweden},
 pages = {3905--3911},
 title = {Generating Adversarial Examples with Adversarial Networks},
 year = {2018}
}
@inproceedings{NIPS2018_8052,
 author = {Yang Song and
Rui Shu and
Nate Kushman and
Stefano Ermon},
 booktitle = {Advances in Neural Information Processing Systems 31: Annual Conference
on Neural Information Processing Systems 2018},
 pages = {8322--8333},
 title = {Constructing Unrestricted Adversarial Examples with Generative Models},
 year = {2018}
}

repository: tao-bai/ntu-poster-latex-template

repo_name: tao-bai/ntu-poster-latex-template

branch_name: refs/heads/main


text:
package mapbox

import (
	"context"
	"fmt"
	"github.com/soider/elevations/internal/geo"
	"io/ioutil"
	"log"
	"net/http"
)

const defaultTileAPIUrl = "https://api.mapbox.com/v4/mapbox.terrain-rgb"

// EncodedElevationData represents pngraw elevation data from mapbox API
type EncodedElevationData struct {
	png map[geo.TileCoordinatesPair][]byte
}

// Client default mapbox clients
type Client struct {
	token   string
	baseURL string
}

// NewClient constructs new mapbox client
func NewClient(t string) *Client {
	return &Client{
		token:   t, // TODO: make through opts...
		baseURL: defaultTileAPIUrl,
	}
}

// GetElevationPNGs loads elevation data for given set of tiles
// To be production ready:
// - do requests concurrently
// - add pooling (each png has the same size, should align perfectly with sync.Pool)
// - deduplicate tiles to avoid requesting same tile few times
// - circuit breaker and rate limiter for the outgoing requests
// - tune http clients (keep alive could be an option here, because all requests go to the same host)
// - metrics for requests duration
// - metrics for cache hit
func (m Client) GetElevationPNGs(ctx context.Context, tiles geo.Tiles) (EncodedElevationData, error) {
	result := EncodedElevationData{
		png: map[geo.TileCoordinatesPair][]byte{},
	}
	for _, t := range tiles {
		finalURL := fmt.Sprintf("%s/%d/%d/%d.pngraw?access_token=%s", defaultTileAPIUrl, t.Z, t.X, t.Y, m.token)
		fmt.Println(finalURL)
		resp, err := http.DefaultClient.Get(finalURL)
		if err != nil {
			log.Printf("error while requesting mapbox api: %s", err)
		}
		if resp.Body != nil {
			defer resp.Body.Close()
		}
		png, err := ioutil.ReadAll(resp.Body)
		if err != nil {
			log.Printf("error while requesting mapbox api: %s", err)
		}
		result.png[t] = png
	}
	return result, nil
}

repository: mikhail-sakhnov/elevations

repo_name: mikhail-sakhnov/elevations


text:
package dispatcher

import (
	"context"
	"fmt"
	"time"

	"github.com/containers-ai/alameda/ai-dispatcher/pkg/metrics"
	"github.com/containers-ai/alameda/ai-dispatcher/pkg/queue"
	datahub_v1alpha1 "github.com/containers-ai/api/alameda_api/v1alpha1/datahub"
	"github.com/golang/protobuf/jsonpb"
	"github.com/golang/protobuf/ptypes/duration"

	"github.com/golang/protobuf/ptypes/timestamp"
	"google.golang.org/grpc"
)

type nodeModelJobSender struct {
	datahubGrpcCn  *grpc.ClientConn
	modelMapper    *ModelMapper
	metricExporter *metrics.Exporter
}

func NewNodeModelJobSender(datahubGrpcCn *grpc.ClientConn, modelMapper *ModelMapper,
	metricExporter *metrics.Exporter) *nodeModelJobSender {
	return &nodeModelJobSender{
		datahubGrpcCn:  datahubGrpcCn,
		modelMapper:    modelMapper,
		metricExporter: metricExporter,
	}
}

func (sender *nodeModelJobSender) sendModelJobs(nodes []*datahub_v1alpha1.Node,
	queueSender queue.QueueSender, pdUnit string, granularity int64, predictionStep int64) {

	dataGranularity := queue.GetGranularityStr(granularity)
	datahubServiceClnt := datahub_v1alpha1.NewDatahubServiceClient(sender.datahubGrpcCn)
	queryCondition := &datahub_v1alpha1.QueryCondition{
		Order: datahub_v1alpha1.QueryCondition_DESC,
		TimeRange: &datahub_v1alpha1.TimeRange{
			StartTime: &timestamp.Timestamp{
				Seconds: time.Now().Unix() - predictionStep*granularity,
			},
			Step: &duration.Duration{
				Seconds: granularity,
			},
		},
	}
	for _, node := range nodes {
		nodeName := node.GetName()
		shouldDrift := false

		lastPrediction, lastPredictionTime, err := sender.getLastPrediction(datahubServiceClnt, node, granularity)
		if err != nil {
			scope.Infof("Get node %s last prediction failed: %s",
				nodeName, err.Error())
			continue
		}
		if lastPrediction == nil && err == nil {
			scope.Infof("No prediction found of node %s",
				nodeName)
		}
		nowSeconds := time.Now().Unix()
		if lastPrediction != nil && lastPredictionTime <= nowSeconds {
			scope.Infof("node prediction %s is out of date due to last predict time is %v (current: %v)",
				nodeName, lastPredictionTime, nowSeconds)
		}
		if (lastPrediction == nil && err == nil) || (lastPrediction != nil && lastPredictionTime <= nowSeconds) {
			nodeInfo := sender.genNodeInfo(nodeName)
			nodeInfo.ModelMetrics = []datahub_v1alpha1.MetricType{
				datahub_v1alpha1.MetricType_CPU_USAGE_SECONDS_PERCENTAGE,
				datahub_v1alpha1.MetricType_MEMORY_USAGE_BYTES,
			}
			scope.Infof("send node %s model job due to no predict found or predict is out of date",
				nodeName)
			sender.sendJob(node, queueSender, pdUnit, granularity, nodeInfo)
		}

		nodePredictRes, err := datahubServiceClnt.ListNodePredictions(context.Background(),
			&datahub_v1alpha1.ListNodePredictionsRequest{
				NodeNames:      []string{nodeName},
				ModelId:        lastPrediction.GetModelId(),
				Granularity:    granularity,
				QueryCondition: queryCondition,
			})
		if err != nil {
			scope.Errorf("Get node %s Prediction with granularity %v for sending model job failed: %s",
				nodeName, granularity, err.Error())
			continue
		}
		nodePredictions := nodePredictRes.GetNodePredictions()
		queryStartTime := time.Now().Unix() - predictionStep*granularity
		firstPDTime := sender.getQueryMetricStartTime(nodePredictions)
		if firstPDTime > 0 {
			queryStartTime = firstPDTime
		}
		nodeMetricsRes, err := datahubServiceClnt.ListNodeMetrics(context.Background(),
			&datahub_v1alpha1.ListNodeMetricsRequest{
				QueryCondition: &datahub_v1alpha1.QueryCondition{
					Order: datahub_v1alpha1.QueryCondition_DESC,
					TimeRange: &datahub_v1alpha1.TimeRange{
						StartTime: &timestamp.Timestamp{
							Seconds: queryStartTime,
						},
						Step: &duration.Duration{
							Seconds: granularity,
						},
					},
				},
				NodeNames: []string{nodeName},
			})
		if err != nil {
			scope.Errorf("List nodes %s metric with granularity %v for sending model job failed: %s",
				nodeName, granularity, err.Error())
			continue
		}
		nodeMetrics := nodeMetricsRes.GetNodeMetrics()

		for _, nodeMetric := range nodeMetrics {
			metricData := nodeMetric.GetMetricData()
			for _, metricDatum := range metricData {
				mData := metricDatum.GetData()
				pData := []*datahub_v1alpha1.Sample{}
				nodeInfo := sender.genNodeInfo(nodeName)
				for _, nodePrediction := range nodePredictions {
					predictRawData := nodePrediction.GetPredictedRawData()
					for _, predictRawDatum := range predictRawData {
						if metricDatum.GetMetricType() == predictRawDatum.GetMetricType() {
							pData = append(pData, predictRawDatum.GetData()...)
						}
					}
				}
				metricsNeedToModel, drift := DriftEvaluation(UnitTypeNode, metricDatum.GetMetricType(), granularity, mData, pData, map[string]string{
					"nodeName":          nodeName,
					"targetDisplayName": fmt.Sprintf("node %s", nodeName),
				}, sender.metricExporter)
				if drift {
					shouldDrift = drift
				}
				nodeInfo.ModelMetrics = append(nodeInfo.ModelMetrics, metricsNeedToModel...)
				isModeling := sender.modelMapper.IsModeling(pdUnit, dataGranularity, nodeInfo)
				if !isModeling || (isModeling && sender.modelMapper.IsModelTimeout(
					pdUnit, dataGranularity, nodeInfo)) {
					sender.sendJob(node, queueSender, pdUnit, granularity, nodeInfo)
				}
			}
		}
		if shouldDrift {
			scope.Infof("export node %s drift counter with granularity %s",
				nodeName, dataGranularity)
			sender.metricExporter.AddNodeMetricDrift(nodeName, queue.GetGranularityStr(granularity), 1.0)
		}
	}
}

func (sender *nodeModelJobSender) sendJob(node *datahub_v1alpha1.Node, queueSender queue.QueueSender, pdUnit string,
	granularity int64, nodeInfo *modelInfo) {
	nodeName := node.GetName()
	dataGranularity := queue.GetGranularityStr(granularity)
	marshaler := jsonpb.Marshaler{}
	nodeStr, err := marshaler.MarshalToString(node)
	if err != nil {
		scope.Errorf("Encode pb message failed for node %s with granularity seconds %v. %s",
			node.GetName(), granularity, err.Error())
		return
	}
	if len(nodeInfo.ModelMetrics) > 0 && nodeStr != "" {
		jb := queue.NewJobBuilder(pdUnit, granularity, nodeStr)
		jobJSONStr, err := jb.GetJobJSONString()
		if err != nil {
			scope.Errorf(
				"Prepare model job payload failed for node %s with granularity seconds %v. %s",
				nodeName, granularity, err.Error())
			return
		}

		err = queueSender.SendJsonString(modelQueueName, jobJSONStr,
			fmt.Sprintf("%s/%v", nodeName, granularity))
		if err == nil {
			sender.modelMapper.AddModelInfo(pdUnit, dataGranularity, nodeInfo)
		} else {
			scope.Errorf(
				"Send model job payload failed for node %s with granularity seconds %v. %s",
				nodeName, granularity, err.Error())
		}
	}
}

func (sender *nodeModelJobSender) genNodeInfo(nodeName string) *modelInfo {
	nodeInfo := new(modelInfo)
	nodeInfo.Name = nodeName
	nodeInfo.ModelMetrics = []datahub_v1alpha1.MetricType{}
	nodeInfo.SetTimeStamp(time.Now().Unix())
	return nodeInfo
}

func (sender *nodeModelJobSender) getLastPrediction(datahubServiceClnt datahub_v1alpha1.DatahubServiceClient,
	node *datahub_v1alpha1.Node, granularity int64) (*datahub_v1alpha1.NodePrediction, int64, error) {
	nodeName := node.GetName()
	nodePredictRes, err := datahubServiceClnt.ListNodePredictions(context.Background(),
		&datahub_v1alpha1.ListNodePredictionsRequest{
			NodeNames:   []string{nodeName},
			Granularity: granularity,
			QueryCondition: &datahub_v1alpha1.QueryCondition{
				Limit: 1,
				Order: datahub_v1alpha1.QueryCondition_DESC,
				TimeRange: &datahub_v1alpha1.TimeRange{
					Step: &duration.Duration{
						Seconds: granularity,
					},
				},
			},
		})
	if err != nil {
		return nil, 0, err
	}
	if len(nodePredictRes.GetNodePredictions()) > 0 {
		lastNodePrediction := nodePredictRes.GetNodePredictions()[0]
		for _, metricPd := range lastNodePrediction.GetPredictedRawData() {
			for _, metricPdSample := range metricPd.GetData() {
				return lastNodePrediction, metricPdSample.GetTime().GetSeconds(), nil
			}
		}
	}
	return nil, 0, nil
}

func (sender *nodeModelJobSender) getQueryMetricStartTime(descNodePredictions []*datahub_v1alpha1.NodePrediction) int64 {
	if len(descNodePredictions) > 0 {
		pdMDs := descNodePredictions[len(descNodePredictions)-1].GetPredictedRawData()
		for _, pdMD := range pdMDs {
			mD := pdMD.GetData()
			if len(mD) > 0 {
				return mD[len(mD)-1].GetTime().GetSeconds()
			}
		}
	}
	return 0
}

repository: ming-ddtechcg/alameda

repo_name: ming-ddtechcg/alameda


text:
import React, { Component } from 'react';
import urlConfig from '../../../url-config';
import axios from 'axios';
import LinearChart from '../../../components/Charts/LinearChart';
import { typography } from 'material-ui/styles';
import PageBase from '../../../components/PageBase';
import { FlatButton, Divider, SelectField, MenuItem, TextField } from 'material-ui';
import PDFMake from '../../../components/PDF/PDFMake';
import FoodReportTable from '../../../components/Food/FoodReportTable';
import AreaChartP from '../../../components/Charts/AreaChartP';
import BarChartP from '../../../components/Charts/BarChartP';
import PieChartP from '../../../components/Charts/PieChartP';
import DonutChartP from '../../../components/Charts/DonutChartP';
import html2canvas from 'html2canvas';
import debounce from 'lodash.debounce';

class FoodReportsPage extends Component {

  constructor() {
    super();
    this.state = {
      foods: [],
      dataChart: [],
      chartSelected: 'Lineal',
      columnOptionSelected: 1,
      limit: 15,
      chartType: [
        { name: 'Lineal', value: 'Lineal' },
        { name: 'Área', value: 'Area' },
        { name: 'Barras', value: 'Bar' },
        { name: 'Pie', value: 'Scatter' },
        { name: 'Dona', value: 'Donut' },
      ],
      columnOptions: [
        {
          name: 'Reporte de alimentos con más proteínas',
          value: 1,
          column: 'proteins',
          order: 'desc',
          dataKey: 'proteína',
          propertyToGraph: 'proteins',
        },
        {
          name: 'Reporte de alimentos con más carbohidratos',
          value: 2,
          column: 'carbohydrates',
          order: 'desc',
          dataKey: 'carbohidratos',
          propertyToGraph: 'carbohydrates',
        },
        {
          name: 'Reporte de alimentos con más grasas',
          value: 3,
          column: 'fats',
          order: 'desc',
          dataKey: 'grasas',
          propertyToGraph: 'fats',
        },
        {
          name: 'Reporte de alimentos con menos proteínas',
          value: 4,
          column: 'proteins',
          order: 'asc',
          dataKey: 'proteína',
          propertyToGraph: 'proteins',
        },
        {
          name: 'Reporte de alimentos con menos carbohidratos',
          value: 5,
          column: 'carbohydrates',
          order: 'asc',
          dataKey: 'carbohidratos',
          propertyToGraph: 'carbohydrates',
        },
        {
          name: 'Reporte de alimentos con menos grasas',
          value: 6,
          column: 'fats',
          order: 'asc',
          dataKey: 'grasas',
          propertyToGraph: 'fats',
        },
      ],
    };
    this.getFoods = this.getFoods.bind(this);
    this.getChartData = this.getChartData.bind(this);
    this.menuItems = this.menuItems.bind(this);
    this.handleSelectChange = this.handleSelectChange.bind(this);
    this.handleInputChange = this.handleInputChange.bind(this);
    this.renderChart = this.renderChart.bind(this);
    this.getCanvasFromDiv = this.getCanvasFromDiv.bind(this);
    this.performPDFAction = this.performPDFAction.bind(this);
    this.debounceGetFoods = debounce(this.getFoods.bind(this), 1000);

  }

  componentDidMount() {
    this.getFoods();
  }

  componentDidUpdate(prevProps, prevState) {
    if (this.state.columnOptionSelected !== prevState.columnOptionSelected)
      this.getFoods();

    if (this.state.limit !== prevState.limit)
      this.debounceGetFoods();

  }

  getFoods() {

    const { limit } = this.state;
    const { order, column } = this.getCurrentSelectedOption();

    const { baseUrl, axiosConfig } = urlConfig;
    const url = `${baseUrl}/foods/reports`;
    const data = { column, order, limit };

    return axios.post(url, data, axiosConfig)
      .then( res => {
        const foods = res.data.data;

        foods.forEach( food => {
          food.calories = this.roundNumber(food.calories * 100);
          food.carbohydrates = this.roundNumber(food.carbohydrates * 100);
          food.fats = this.roundNumber(food.fats * 100);
          food.proteins = this.roundNumber(food.proteins * 100);
        });

        //Get current selected endpoint object.
        const currentOption = this.getCurrentSelectedOption();

        this.setState({
          foods: foods,
          dataChart: this.getChartData(
            foods,
            currentOption.propertyToGraph,
            currentOption.dataKey
          ),
          dataKey: currentOption.dataKey
        });
      })
      .catch( err => {throw err;});

  }

  getCurrentSelectedOption() {

    return [ ...this.state.columnOptions ].find( endpoint => {
      return endpoint.value === this.state.columnOptionSelected;
    });

  }

  roundNumber( num ) {
    return Math.round(num * 100) / 100;
  }

  performPDFAction( action ) {
    const pdfMake = PDFMake.make();
    const  { foods } = this.state;
    const currentSelection = this.getCurrentSelectedOption();

    this.getCanvasFromDiv()
      .then(canvas => {
        const base64 = canvas.toDataURL();
        const docDefinition = PDFMake.docDefinitionFoods({
          foods: foods,
          chartImage: base64,
          reportName: currentSelection.name,
        });

        switch(action) {
          case 'open':
            PDFMake.open(pdfMake, docDefinition);
            break;
          case 'download':
            PDFMake.download(pdfMake, docDefinition);
            break;
          case 'print':
            PDFMake.print(pdfMake, docDefinition);
            break;
          default:
            PDFMake.open(pdfMake, docDefinition);
        }
    });
  }

  handleSelectChange( property, event, index, value ) {
    this.setState({ [property]: value });
  }

  handleInputChange( event ) {
    const name = event.target.name;
    const value = event.target.value;

    this.setState({
        [name]: value
    });
  }

  menuItems( accessorArray ) {
    // console.log('accessorArray: ', accessorArray);

    return this.state[accessorArray].map( (element, index) => (
       <MenuItem
        key={index}
        insetChildren={true}
        value={element.value}
        primaryText={element.name}
      />
    ));

  }

  renderChart() {
    const { chartSelected, dataChart, dataKey } = this.state;
    switch ( chartSelected ) {
      case 'Lineal':
        return <LinearChart dataKey={dataKey} data={dataChart} />;
      case 'Area':
        return <AreaChartP dataKey={dataKey} data={dataChart}/>;
      case 'Bar':
        return <BarChartP dataKey={dataKey} data={dataChart}/>;
      case 'Scatter':
        return <PieChartP dataKey={dataKey} data={dataChart}/>;
      case 'Donut':
        return <DonutChartP dataKey={dataKey} data={dataChart}/>;
      default:
        return <LinearChart dataKey={dataKey} data={dataChart} />;
    }
  }

  getChartData(foods, value, name) {
    return foods.map( food => {
      return Object.assign({}, {
        [name]: food[value],
        name: food.description,
      });
    });
  }

  getCanvasFromDiv() {
    return html2canvas(this.canvasDiv);
  }
  render() {

    return (
      <PageBase
        title="Reportes de alimentos">

            <FoodReportTable foods={this.state.foods}/>

                <SelectField
                  fullWidth={true}
                  name="chartSelected"
                  value={this.state.chartSelected}
                  floatingLabelText="Tipo de gráfica"
                  onChange={this.handleSelectChange.bind(this,'chartSelected')}
                  >
                    {this.menuItems('chartType')}
                  </SelectField>

                <SelectField
                  fullWidth={true}
                  name="columnOptionSelected"
                  value={this.state.columnOptionSelected}
                  floatingLabelText="Reporte a seleccionar"
                  onChange={this.handleSelectChange.bind(this, 'columnOptionSelected')}
                  >
                    {this.menuItems('columnOptions')}
                </SelectField>

                <TextField
                  name="limit"
                  type="number"
                  floatingLabelText="Número de filas"
                  min="1"
                  max="20"
                  required={true}
                  onChange={this.handleInputChange}
                  value={this.state.limit}
                />

 {this.canvasDiv = e;}} style={styles.container}>
                {this.renderChart()}

                  Representación gráfica de
                   {this.getCurrentSelectedOption().name}

                <Divider />

Operaciones PDF

                  <FlatButton primary={true} label="Abrir" onClick={this.performPDFAction.bind(this, 'open')}/>
                  <FlatButton primary={true} label="Descargar" onClick={this.performPDFAction.bind(this, 'download')}/>
                  <FlatButton primary={true} label="Imprimir" onClick={this.performPDFAction.bind(this, 'print')}/>

      </PageBase>

    );
  }
}

const styles = {
  container: {
    // padding: 10,
  },
  paper: {
    padding: 20,
  },
  title: {
    fontWeight: typography.fontWeightLight,
    fontSize: 20,
  },
  chartTittle: {
    fontWeight: typography.fontWeightLight,
    fontSize: 15,
    textAlign: 'center',
  },
  pdfTitle: {
    marginLeft: 20,
    fontWeight: typography.fontWeightMedium,
    fontSize: 16,
    paddingBottom: '0',
    marginBottom: 5,
    textAlign: 'center',
  },
  floatRight: {
    float: 'right'
  }
};

export default FoodReportsPage;

extension: js


text:
@ARTICLE{BenchmarkTools.jl-2016,
  author =	 {{Chen}, Jiahao and {Revels}, Jarrett},
  title =	 "{Robust benchmarking in noisy environments}",
  journal =	 {arXiv e-prints},
  keywords =	 {Computer Science - Performance, 68N30, B.8.1, D.2.5},
  year =	 2016,
  month =	 "Aug",
  eid =		 {arXiv:1608.04295},
  archivePrefix ={arXiv},
  eprint =	 {1608.04295},
  primaryClass = {cs.PF},
  adsurl =	 {https://ui.adsabs.harvard.edu/abs/2016arXiv160804295C},
  adsnote =	 {Provided by the SAO/NASA Astrophysics Data System}
}

gha_language: Julia


text:
@article{riscvpriv,
author = {RISC-V ISA Privileged Specification},
year = {2020},
title = {},
journal = {https://riscv.org/specifications/privileged-isa/},
}
@article{riscv,
author = {RISC-V ISA Unprivileged Specification},
year = {2020},
title = {},
journal = {https://riscv.org/specifications/isa-spec-pdf/},
}

@article{riscvdebug,
  author = {RISC-V ISA Debug Specification},
  year = {2020},
  title = {},
  journal = {https://riscv.org/specifications/debug-specification/}
}

repository: ShrreyaSingh/riscv-isac

repo_name: ShrreyaSingh/riscv-isac

gha_language: Python


text:
# Copyright (C) 2018 Stephane Desneux <stephane.desneux@iot.bzh>
# Released under the Apache 2.0 license

SUMMARY = "AGL Demo Assets"
SECTION = "multimedia"
LICENSE = "CC0-1.0 & CC-BY-3.0 & CC-BY-NC-ND-3.0 & CC-BY-4.0 & Unsplash"

# license text downloaded from
# https://creativecommons.org/2014/01/07/plaintext-versions-of-creative-commons-4-0-licenses/
# - https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode.txt
# - https://creativecommons.org/licenses/by/4.0/legalcode.txt
LICENSE_PATH += "${THISDIR}/licences"

LIC_FILES_CHKSUM = "\
   file://${COMMON_LICENSE_DIR}/CC0-1.0;md5=0ceb3372c9595f0a8067e55da801e4a1 \
   file://${COMMON_LICENSE_DIR}/CC-BY-3.0;md5=dfa02b5755629022e267f10b9c0a2ab7 \
   file://${COMMON_LICENSE_DIR}/CC-BY-NC-ND-3.0;md5=a1038f0f4a3de1fe9e79e2180c40f10c \
   file://${THISDIR}/licenses/CC-BY-4.0;md5=3e19557ffd5cbc68a1fd63ac8d687a95 \
   file://${THISDIR}/licenses/Unsplash;md5=d468155de19c134c7abf7ea188e37861 \
"

SRC_URI = "gitsm://github.com/iotbzh/agl-demo-assets.git;protocol=https"
SRCREV = "${AUTOREV}"

S = "${WORKDIR}/git"

#ASSETS_DIR = "${datadir}/${PN}"

# lightmediascanner currently use hardcoded paths
ASSETS_DIR = "/media/${PN}"

do_install_append() {
    install -d ${D}${ASSETS_DIR}
	make -C ${S} install DESTDIR=${D} PREFIX=${ASSETS_DIR}
}

FILES_${PN} += "${ASSETS_DIR}/Music/*"
FILES_${PN} += "${ASSETS_DIR}/Pictures/*"
FILES_${PN} += "${ASSETS_DIR}/Videos/*"

repository: iotbzh/meta-iot-bzh

repo_name: iotbzh/meta-iot-bzh

gha_language: Shell

extension: bb


text:
package server

import (
	"fmt"
	"io"
	"server/libs/log"
	"server/libs/rpc"
	"sync"
	"time"
)

//每个客户端的连接
type ClientNode struct {
	Session      int64
	DelayDestroy int
	Connected    bool
	rwc          io.ReadWriteCloser
	Sendbuf      chan *rpc.Message
	Addr         string
	quit         bool
	MailBox      rpc.Mailbox
	lastping     time.Time
}

func NewClientNode() *ClientNode {
	cn := &ClientNode{}
	cn.Sendbuf = make(chan *rpc.Message, 32)

	return cn
}

func (c *ClientNode) Ping() {
	c.lastping = time.Now()
}

//向客户端发包，存进一个消息队列，异步发送
func (c *ClientNode) SendMessage(message *rpc.Message) error {
	if c.quit {
		return fmt.Errorf("client is quit")
	}
	message.Dup()
	select {
	case c.Sendbuf <- message:
		return nil
	default:
		message.Free()
		return fmt.Errorf("send buffer full")
	}
}

//向客户端发包，存进一个消息队列，异步发送
func (c *ClientNode) Send(data []byte) error {
	if c.quit {
		return fmt.Errorf("client is quit")
	}
	message := rpc.NewMessage(len(data))
	message.Body = append(message.Body, data...)
	select {
	case c.Sendbuf <- message:
		return nil
	default:
		message.Free() //满了，直接扔掉
		return fmt.Errorf("send buffer full")
	}
}

//延迟删除计数
func (c *ClientNode) DelCount(count int) {
	c.DelayDestroy = count
}

//主循环
func (c *ClientNode) Run() {
	c.quit = false
	go c.innerSend()
}

//向客户端发送数据
func (c *ClientNode) innerSend() {
sendloop:
	for {
		select {
		case message := <-c.Sendbuf:
			if c.rwc != nil {
				_, err := c.rwc.Write(message.Body)
				log.LogMessage("send message to client:", c.Addr, " size:", len(message.Body))
				message.Free()
				if err != nil {
					break sendloop
				}
			} else {
				if message != nil {
					message.Free()
					break sendloop
				}
			}
		default:
			if c.quit {
				break sendloop
			}

			time.Sleep(time.Millisecond)
		}
	}

	//丢弃所有消息
	for {
		select {
		case m := <-c.Sendbuf:
			m.Free()
		default:
			log.LogMessage("client node quit loop")
			return
		}
	}

}

//关闭连接
func (c *ClientNode) Close() {
	if c.rwc != nil {
		c.rwc.Close()
	}
	c.quit = true
	c.Connected = false
}

//客户端连接池
type ClientList struct {
	l         sync.RWMutex
	freeNodes *ClientNode
	clients   map[int64]*ClientNode
	serial    int64
}

//关闭所有连接
func (cl *ClientList) CloseAll() {
	cl.l.Lock()
	for _, node := range cl.clients {
		node.Close()
	}
	cl.l.Unlock()
}

//增加一个客户端连接
func (cl *ClientList) Add(c io.ReadWriteCloser, addr string) int64 {
	cl.l.Lock()
	//寻找一个唯一ID
	for {
		cl.serial++
		if cl.serial > 0x7FFFFFFFFFFF {
			cl.serial = 1
		}
		if _, dup := cl.clients[cl.serial]; dup {
			continue
		}
		break
	}

	cn := NewClientNode()
	cn.Session = cl.serial
	cn.Connected = true
	cn.Addr = addr
	cn.rwc = c
	cn.DelayDestroy = -1
	cn.lastping = time.Now()
	cl.clients[cl.serial] = cn
	cl.l.Unlock()
	return cn.Session
}

//交换两个socket,用于顶号处理
func (cl *ClientList) Switch(src, dest int64) bool {
	cl.l.Lock()
	var srcnode *ClientNode
	var destnode *ClientNode
	var ok bool
	if srcnode, ok = cl.clients[src]; !ok {
		cl.l.Unlock()
		return false
	}

	if destnode, ok = cl.clients[dest]; !ok {
		cl.l.Unlock()
		return false
	}

	srcnode.Session, destnode.Session = dest, src
	srcnode.MailBox, destnode.MailBox = destnode.MailBox, srcnode.MailBox
	cl.clients[src], cl.clients[dest] = destnode, srcnode
	cl.l.Unlock()
	return true
}

//移除一个客户端连接
func (cl *ClientList) Remove(session int64) {
	cl.l.Lock()
	if cn, ok := cl.clients[session]; ok {
		delete(cl.clients, session)
		log.LogDebug("remove client node, ", cn.Addr)
		cn.Close()
	}
	cl.l.Unlock()
}

//检查需要删除的连接（延迟删除）
func (cl *ClientList) Check() {
	cl.l.Lock()
	for _, v := range cl.clients {
		if v.DelayDestroy > 0 {
			v.DelayDestroy--
			if v.DelayDestroy == 0 {
				v.Close()
			}
			continue
		}

		if time.Now().Sub(v.lastping).Minutes() > 5.0 { //5分钟超时
			v.Close()
		}
	}
	cl.l.Unlock()
}

//通过session获取连接
func (cl *ClientList) FindNode(session int64) *ClientNode {
	cl.l.RLock()
	if cn, ok := cl.clients[session]; ok {
		cl.l.RUnlock()
		return cn
	}
	cl.l.RUnlock()
	return nil
}

//创建新的连接池
func NewClientList() *ClientList {
	cl := &ClientList{}
	cl.clients = make(map[int64]*ClientNode)
	return cl
}

repository: mysll/flynet

repo_name: mysll/flynet


text:
package engine

import (
	"context"
	"fmt"

	"github.com/docker/distribution/reference"
	"github.com/opentracing/opentracing-go"

	"github.com/windmilleng/tilt/internal/build"
	"github.com/windmilleng/tilt/internal/container"
	"github.com/windmilleng/tilt/internal/docker"
	"github.com/windmilleng/tilt/internal/dockercompose"
	"github.com/windmilleng/tilt/internal/logger"
	"github.com/windmilleng/tilt/internal/model"
	"github.com/windmilleng/tilt/internal/store"
)

type DockerComposeBuildAndDeployer struct {
	dcc   dockercompose.DockerComposeClient
	dc    docker.Client
	icb   *imageAndCacheBuilder
	clock build.Clock
}

var _ BuildAndDeployer = &DockerComposeBuildAndDeployer{}

func NewDockerComposeBuildAndDeployer(dcc dockercompose.DockerComposeClient, dc docker.Client,
	icb *imageAndCacheBuilder, c build.Clock) *DockerComposeBuildAndDeployer {
	return &DockerComposeBuildAndDeployer{
		dcc:   dcc,
		dc:    dc,
		icb:   icb,
		clock: c,
	}
}

// Extract the targets we can apply -- DCBaD supports ImageTargets and DockerComposeTargets.
func (bd *DockerComposeBuildAndDeployer) extract(specs []model.TargetSpec) ([]model.ImageTarget, []model.DockerComposeTarget) {
	var iTargets []model.ImageTarget
	var dcTargets []model.DockerComposeTarget

	for _, s := range specs {
		switch s := s.(type) {
		case model.ImageTarget:
			iTargets = append(iTargets, s)
		case model.DockerComposeTarget:
			dcTargets = append(dcTargets, s)
		default:
			// unrecognized target
			return nil, nil
		}
	}
	return iTargets, dcTargets
}

func (bd *DockerComposeBuildAndDeployer) BuildAndDeploy(ctx context.Context, st store.RStore, specs []model.TargetSpec, currentState store.BuildStateSet) (store.BuildResultSet, error) {
	iTargets, dcTargets := bd.extract(specs)
	if len(dcTargets) != 1 {
		return store.BuildResultSet{}, SilentRedirectToNextBuilderf(
			"DockerComposeBuildAndDeployer requires exactly one dcTarget (got %d)", len(dcTargets))
	}
	dcTarget := dcTargets[0]

	span, ctx := opentracing.StartSpanFromContext(ctx, "DockerComposeBuildAndDeployer-BuildAndDeploy")
	span.SetTag("target", dcTargets[0].Name)
	defer span.Finish()

	q, err := NewImageTargetQueue(iTargets, currentState)
	if err != nil {
		return store.BuildResultSet{}, err
	}

	numStages := q.CountDirty()
	haveImage := len(iTargets) > 0

	ps := build.NewPipelineState(ctx, numStages, bd.clock)
	defer func() { ps.End(ctx, err) }()

	iTargetMap := model.ImageTargetsByID(iTargets)
	err = q.RunBuilds(func(target model.TargetSpec, state store.BuildState, depResults []store.BuildResult) (store.BuildResult, error) {
		iTarget, ok := target.(model.ImageTarget)
		if !ok {
			return store.BuildResult{}, fmt.Errorf("Not an image target: %T", target)
		}

		iTarget, err := injectImageDependencies(iTarget, iTargetMap, depResults)
		if err != nil {
			return store.BuildResult{}, err
		}

		expectedRef := iTarget.ConfigurationRef

		// NOTE(maia): we assume that this func takes one DC target and up to one image target
		// corresponding to that service. If this func ever supports specs for more than one
		// service at once, we'll have to match up image build results to DC target by ref.
		ref, err := bd.icb.Build(ctx, iTarget, currentState[iTarget.ID()], ps)
		if err != nil {
			return store.BuildResult{}, err
		}

		ref, err = bd.tagWithExpected(ctx, ref, expectedRef)
		if err != nil {
			return store.BuildResult{}, err
		}

		return store.NewImageBuildResult(iTarget.ID(), ref), nil
	})

	if err != nil {
		return store.BuildResultSet{}, err
	}

	stdout := logger.Get(ctx).Writer(logger.InfoLvl)
	stderr := logger.Get(ctx).Writer(logger.InfoLvl)
	err = bd.dcc.Up(ctx, dcTarget.ConfigPath, dcTarget.Name, !haveImage, stdout, stderr)
	if err != nil {
		return store.BuildResultSet{}, err
	}

	// NOTE(dmiller): right now we only need this the first time. In the future
	// it might be worth it to move this somewhere else
	cid, err := bd.dcc.ContainerID(ctx, dcTarget.ConfigPath, dcTarget.Name)
	if err != nil {
		return store.BuildResultSet{}, err
	}

	results := q.results
	for _, iTarget := range iTargets {
		if isImageDeployedToDC(iTarget, dcTarget) {
			result := results[iTarget.ID()]
			result.ContainerID = cid
			results[iTarget.ID()] = result
		}
	}
	results[dcTarget.ID()] = store.NewContainerBuildResult(dcTarget.ID(), cid)
	return results, nil
}

func (bd *DockerComposeBuildAndDeployer) tagWithExpected(ctx context.Context, ref reference.NamedTagged,
	expected container.RefSelector) (reference.NamedTagged, error) {
	var tagAs reference.NamedTagged
	expectedNt, err := container.ParseNamedTagged(expected.String())
	if err == nil {
		// expected ref already includes a tag, so just tag the image as that
		tagAs = expectedNt
	} else {
		// expected ref is just a name, so tag it as `latest` b/c that's what Docker Compose wants
		tagAs, err = reference.WithTag(ref, docker.TagLatest)
		if err != nil {
			return nil, err
		}
	}

	err = bd.dc.ImageTag(ctx, ref.String(), tagAs.String())
	return tagAs, err
}

repository: lyft/tilt

repo_name: lyft/tilt


text:
package main

import (
	"io/ioutil"
	"os"
	"path/filepath"
	"testing"

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

func TestSSHKey(t *testing.T) {
	assert := assert.New(t)

	tempdir, _ := ioutil.TempDir("", "ddc")
	defer os.RemoveAll(tempdir)

	sc, _ := NewSystemClientWithBase(tempdir)

	key1, err := sc.EnsureSSHKey()
	assert.Nil(err)
	assert.NotEmpty(key1.privatePath)
	assert.NotEmpty(key1.publicPath)

	key2, err := sc.EnsureSSHKey()
	assert.Nil(err)

	assert.Equal(key1.privatePath, key2.privatePath)
	assert.Equal(key1.publicPath, key2.publicPath)
}

func TestDir(t *testing.T) {
	assert := assert.New(t)

	tempdir, _ := ioutil.TempDir("", "ddc")
	base := filepath.Join(tempdir, "skegs")
	defer os.RemoveAll(tempdir)

	sc, _ := NewSystemClientWithBase(base)

	path, err := sc.EnsureEnvironmentDir("foo")
	assert.Nil(err)
	assert.NotEmpty(path)
}

repository: skegio/skeg

repo_name: skegio/skeg


text:
package main

import (
	"fmt"
	"strings"
)

func main() {
	inputString := "bob" + ""
	hasSuffix := false
	// <<<<<extract,12,2,14,2,check,pass
	if strings.Contains(inputString, "Suffix") {
		hasSuffix = true
	}

	fmt.Print("string:", inputString)
	if hasSuffix {
		fmt.Println(" has Suffix")
	} else {
		fmt.Println(" is missing Suffix")
	}
}

repository: godoctor/godoctor

repo_name: godoctor/godoctor


text:
package updater

import (
	"context"
	"fmt"
	"sort"

	"github.com/qdm12/gluetun/internal/constants/vpn"
	"github.com/qdm12/gluetun/internal/models"
	"github.com/qdm12/gluetun/internal/provider/common"
	"github.com/qdm12/gluetun/internal/updater/openvpn"
)

func (u *Updater) FetchServers(ctx context.Context, minServers int) (
	servers []models.Server, err error) {
	hostToData, err := fetchServers(ctx, u.client)
	if err != nil {
		return nil, fmt.Errorf("fetching and parsing website: %w", err)
	}

	openvpnURLs := make([]string, 0, len(hostToData))
	for _, data := range hostToData {
		openvpnURLs = append(openvpnURLs, data.ovpnURL)
	}

	if len(openvpnURLs) < minServers {
		return nil, fmt.Errorf("%w: %d and expected at least %d",
			common.ErrNotEnoughServers, len(openvpnURLs), minServers)
	}

	const failEarly = false // some URLs from the website are not valid
	hostToURL, errors := openvpn.FetchMultiFiles(ctx, u.client, openvpnURLs, failEarly)
	for _, err := range errors {
		u.warner.Warn(fmt.Sprintf("fetching OpenVPN files: %s", err))
	}

	if len(hostToURL) < minServers {
		return nil, fmt.Errorf("%w: %d and expected at least %d",
			common.ErrNotEnoughServers, len(hostToURL), minServers)
	}

	hosts := make([]string, 0, len(hostToURL))
	for host := range hostToURL {
		hosts = append(hosts, host)
	}

	resolveSettings := parallelResolverSettings(hosts)
	hostToIPs, warnings, err := u.parallelResolver.Resolve(ctx, resolveSettings)
	for _, warning := range warnings {
		u.warner.Warn(warning)
	}
	if err != nil {
		return nil, fmt.Errorf("resolving hosts: %w", err)
	}

	if len(hostToIPs) < minServers {
		return nil, fmt.Errorf("%w: %d and expected at least %d",
			common.ErrNotEnoughServers, len(hosts), minServers)
	}

	servers = make([]models.Server, 0, len(hostToIPs))
	for host, IPs := range hostToIPs {
		serverData := hostToData[host]

		server := models.Server{
			VPN:      vpn.OpenVPN,
			Region:   serverData.region,
			Country:  serverData.country,
			City:     serverData.city,
			Hostname: host,
			UDP:      true,
			TCP:      true,
			IPs:      IPs,
		}
		servers = append(servers, server)
	}

	sort.Sort(models.SortableServers(servers))

	return servers, nil
}

gha_license_id: MIT


text:
SUMMARY = "Native Go bindings for D-Bus"
HOMEPAGE = "https://${GO_SRCROOT}"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://${GO_SRCROOT}/LICENSE;md5=09042bd5c6c96a2b9e45ddf1bc517eed"
SRCREV = "37252881b3a87eaa2eb04b0ff2211f54f45199ab"
RECIPE_PV := "${PV}"
PV = "${RECIPE_PV}+git${SRCPV}"

SRC_URI = "git://${GO_SRCROOT}"

inherit golang

GO_SRCROOT = "github.com/godbus/dbus"

repository: opendreambox/opendreambox

repo_name: opendreambox/opendreambox

branch_name: refs/heads/pyro

gha_language: BitBake


text:
package storagemaster

import (
       "errors"
)

type Extras interface {
     Set(string, interface{}) error
     Get(string) (interface{}, error)
}

type Provider interface {
	Put(string, []byte, ...Extras) error
	Get(string) ([]byte, error)
	Delete(string) error
	Exists(string) (bool, error)
}

type StoragemasterExtras struct {
	Extras
	extras map[string]interface{}
}

func NewStoragemasterExtras() (*StoragemasterExtras, error){

     extras := make(map[string]interface{})

     e := StoragemasterExtras{
     	extras: extras,
     }

     return &e, nil
}

func (e *StoragemasterExtras) Get(key string) (interface{}, error){

     v, ok := e.extras[key]

     if !ok {
     	return nil, errors.New("Invalid key")
     }

     return v, nil
}

func (e *StoragemasterExtras) Set(key string, value interface{}) error{
     e.extras[key] = value
     return nil
}

repository: whosonfirst/go-storagemaster

repo_name: whosonfirst/go-storagemaster


text:
% This file was created with JabRef 2.10b2.
% Encoding: UTF-8

@Article{Amacher2014,
  Title                    = {Thin ply composites: Experimental characterization and modeling of size-effects},
  Author                   = {R. Amacher and J. Cugnoni and J. Botsis and L. Sorensen and W. Smith and C. Dransfeld},
  Journal                  = {Composites Science and Technology},
  Year                     = {2014},

  Month                    = {sep},
  Pages                    = {121--132},
  Volume                   = {101},

  Doi                      = {10.1016/j.compscitech.2014.06.027},
  Publisher                = {Elsevier {BV}}
}

@Article{Arteiro2014,
  Title                    = {Large damage capability of non-crimp fabric thin-ply laminates},
  Author                   = {A. Arteiro and G. Catalanotti and J. Xavier and P.P. Camanho},
  Journal                  = {Composites Part A: Applied Science and Manufacturing},
  Year                     = {2014},

  Month                    = {aug},
  Pages                    = {110--122},
  Volume                   = {63},

  Doi                      = {10.1016/j.compositesa.2014.04.002},
  Publisher                = {Elsevier {BV}}
}

@Article{Arteiro2013,
  Title                    = {Notched response of non-crimp fabric thin-ply laminates},
  Author                   = {A. Arteiro and G. Catalanotti and J. Xavier and P.P. Camanho},
  Journal                  = {Composites Science and Technology},
  Year                     = {2013},

  Month                    = {apr},
  Pages                    = {97--114},
  Volume                   = {79},

  Doi                      = {10.1016/j.compscitech.2013.02.001},
  Publisher                = {Elsevier {BV}}
}

@Article{Bailey1979,
  Title                    = {On the Transverse Cracking and Longitudinal Splitting Behaviour of Glass and Carbon Fibre Reinforced Epoxy Cross Ply Laminates and the Effect of Poisson and Thermally Generated Strain},
  Author                   = {J. E. Bailey and P. T. Curtis and A. Parvizi},
  Journal                  = {Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences},
  Year                     = {1979},

  Month                    = {jul},
  Number                   = {1727},
  Pages                    = {599--623},
  Volume                   = {366},

  Doi                      = {10.1098/rspa.1979.0071},
  Publisher                = {The Royal Society}
}

@Article{Bailey1981,
  Title                    = {On fibre debonding effects and the mechanism of transverse-ply failure in cross-ply laminates of glass fibre/thermoset composites},
  Author                   = {J. E. Bailey and A. Parvizi},
  Journal                  = {Journal of Materials Science},
  Year                     = {1981},

  Month                    = {mar},
  Number                   = {3},
  Pages                    = {649--659},
  Volume                   = {16},

  Doi                      = {10.1007/bf02402782},
  Publisher                = {Springer Nature}
}

@Article{Comninou1977,
  Title                    = {The Interface Crack},
  Author                   = {Maria Comninou},
  Journal                  = {Journal of Applied Mechanics},
  Year                     = {1977},
  Number                   = {4},
  Pages                    = {631},
  Volume                   = {44},

  Doi                      = {10.1115/1.3424148},
  Publisher                = {{ASME} International}
}

@Article{Correa2007,
  Title                    = {Effects of the presence of compression in transverse cyclic loading on fibre{\textendash}matrix debonding in unidirectional composite plies},
  Author                   = {E. Correa and E.K. Gamstedt and F. Par{\'{\i}}s and V. Manti{\v{c}}},
  Journal                  = {Composites Part A: Applied Science and Manufacturing},
  Year                     = {2007},

  Month                    = {nov},
  Number                   = {11},
  Pages                    = {2260--2269},
  Volume                   = {38},

  Doi                      = {10.1016/j.compositesa.2006.11.002},
  Publisher                = {Elsevier {BV}}
}

@Article{Correa2011,
  Title                    = {Effect of thermal residual stresses on matrix failure under transverse tension at micromechanical level: A numerical and experimental analysis},
  Author                   = {E. Correa and V. Manti{\v{c}} and F. Par{\'{\i}}s},
  Journal                  = {Composites Science and Technology},
  Year                     = {2011},

  Month                    = {mar},
  Number                   = {5},
  Pages                    = {622--629},
  Volume                   = {71},

  Doi                      = {10.1016/j.compscitech.2010.12.027},
  Publisher                = {Elsevier {BV}}
}

@Article{Correa2014,
  Title                    = {Effect of a secondary transverse load on the inter-fibre failure under compression},
  Author                   = {E. Correa and F. Par{\'{\i}}s and V. Manti{\v{c}}},
  Journal                  = {Composites Part B: Engineering},
  Year                     = {2014},

  Month                    = {oct},
  Pages                    = {57--68},
  Volume                   = {65},

  Doi                      = {10.1016/j.compositesb.2014.01.005},
  Publisher                = {Elsevier {BV}}
}

@Article{Correa2013,
  Title                    = {Effect of the presence of a secondary transverse load on the inter-fibre failure under tension},
  Author                   = {E. Correa and F. Par{\'{\i}}s and V. Manti{\v{c}}},
  Journal                  = {Engineering Fracture Mechanics},
  Year                     = {2013},

  Month                    = {may},
  Pages                    = {174--189},
  Volume                   = {103},

  Doi                      = {10.1016/j.engfracmech.2013.02.026},
  Publisher                = {Elsevier {BV}}
}

@Article{Cugnoni2018,
  Title                    = {Towards aerospace grade thin-ply composites: Effect of ply thickness, fibre, matrix and interlayer toughening on strength and damage tolerance},
  Author                   = {J. Cugnoni and R. Amacher and S. Kohler and J. Brunner and E. Kramer and C. Dransfeld and W. Smith and K. Scobbie and L. Sorensen and J. Botsis},
  Journal                  = {Composites Science and Technology},
  Year                     = {2018},

  Month                    = {nov},
  Pages                    = {467--477},
  Volume                   = {168},

  Doi                      = {10.1016/j.compscitech.2018.08.037},
  Publisher                = {Elsevier {BV}}
}

@Article{England1971,
  Title                    = {On stress singularities in linear elasticity},
  Author                   = {A.H. England},
  Journal                  = {International Journal of Engineering Science},
  Year                     = {1971},

  Month                    = {jun},
  Number                   = {6},
  Pages                    = {571--585},
  Volume                   = {9},

  Doi                      = {10.1016/0020-7225(71)90039-5},
  Publisher                = {Elsevier {BV}}
}

@Article{England1966,
  Title                    = {An Arc Crack Around a Circular Elastic Inclusion},
  Author                   = {A. H. England},
  Journal                  = {Journal of Applied Mechanics},
  Year                     = {1966},
  Number                   = {3},
  Pages                    = {637},
  Volume                   = {33},

  Doi                      = {10.1115/1.3625132},
  Publisher                = {{ASME} International}
}

@Article{Garcia2015,
  Title                    = {Debonding at the fibre{\textendash}matrix interface under remote transverse tension. One debond or two symmetric debonds?},
  Author                   = {I.G. Garc{\'{\i}}a and V. Manti{\v{c}} and E. Graciani},
  Journal                  = {European Journal of Mechanics - A/Solids},
  Year                     = {2015},

  Month                    = {sep},
  Pages                    = {75--88},
  Volume                   = {53},

  Doi                      = {10.1016/j.euromechsol.2015.02.007},
  Publisher                = {Elsevier {BV}}
}

@Article{Garrett1977,
  Title                    = {Multiple transverse fracture in $90^{\circ}$ cross-ply laminates of a glass fibre-reinforced polyester},
  Author                   = {K. W. Garrett and J. E. Bailey},
  Journal                  = {Journal of Materials Science},
  Year                     = {1977},

  Month                    = {jan},
  Number                   = {1},
  Pages                    = {157--168},
  Volume                   = {12},

  Doi                      = {10.1007/bf00738481},
  Publisher                = {Springer Nature}
}

@Article{Guillamet2014,
  Title                    = {Damage occurrence at edges of non-crimp-fabric thin-ply laminates under off-axis uniaxial loading},
  Author                   = {G. Guillamet and A. Turon and J. Costa and J. Renart and P. Linde and J.A. Mayugo},
  Journal                  = {Composites Science and Technology},
  Year                     = {2014},

  Month                    = {jun},
  Pages                    = {44--50},
  Volume                   = {98},

  Doi                      = {10.1016/j.compscitech.2014.04.014},
  Publisher                = {Elsevier {BV}}
}

@Article{Huang2018,
  Title                    = {Identification of failure modes of composite thin-ply laminates containing circular hole under tension by acoustic emission signals},
  Author                   = {Chunfang Huang and Su Ju and Mingchang He and Qing Zheng and Yonglyu He and Jiayu Xiao and Jiangwei Zhang and Dazhi Jiang},
  Journal                  = {Composite Structures},
  Year                     = {2018},

  Month                    = {dec},
  Pages                    = {70--79},
  Volume                   = {206},

  Doi                      = {10.1016/j.compstruct.2018.08.019},
  Publisher                = {Elsevier {BV}}
}

@Article{Kawabe2008,
  Title                    = {New Spreading Technology for Carbon Fiber Tow and Its Application to Composite Materials},
  Author                   = {Kazumasa Kawabe},
  Journal                  = {Sen'i Gakkaishi},
  Year                     = {2008},
  Number                   = {8},
  Pages                    = {262--267},
  Volume                   = {64},

  Doi                      = {10.2115/fiber.64.p_262},
  Language                 = {Japanese},
  Publisher                = {Society of Fiber Science and Technology Japan}
}

@Article{Kawabe2008en,
  Title                    = {New Carbon Fiber Tow-Spread Technology and Applications to Advanced Composite Materials},
  Author                   = {K. Kawabe and H. Sasayama and S. Tomoda},
  Journal                  = {{SAMPE} Journal},
  Year                     = {2008},
  Number                   = {2},
  Pages                    = {6--17},
  Volume                   = {45},

  Publisher                = {Society for the Advancement of Material and Process Engineering (SAMPE)}
}

@InProceedings{Kawabe1997,
  Title                    = {A Pneumatic Process for Spreading Reinforcing Fiber Tow},
  Author                   = {K. Kawabe and S. Tomoda and T. Matsuo},
  Booktitle                = {Proceedings of the $42^{nd}$ International SAMPE Symposium and Exhibition},
  Pages                    = {65--76},
  Publisher                = {SAMPE},

  Date                     = {1997},
  Venue                    = {Anaheim, CA, USA}
}

@Article{Kim2017,
  Title                    = {Effects of Shallow Biangle, Thin-Ply Laminates on Structural Performance of Composite Wings},
  Author                   = {Yong Han Noel Kim and Seunghyun Ko and Wei-Siang Lay and Jingmeng Tian and Paochen Chang and Seiji Umeda Thielk and Hyung-Joon Bang and Jinkyu Yang},
  Journal                  = {{AIAA} Journal},
  Year                     = {2017},

  Month                    = {jun},
  Number                   = {6},
  Pages                    = {2086--2092},
  Volume                   = {55},

  Doi                      = {10.2514/1.j055465},
  Publisher                = {American Institute of Aeronautics and Astronautics ({AIAA})}
}

@Article{Kopp2017,
  Title                    = {The Aurora space launcher concept},
  Author                   = {Alexander Kopp and Sven Stappert and David Mattsson and Kurt Olofsson and Erik Marklund and Guido Kurth and Erwin Mooij and Evelyne Roorda},
  Journal                  = {{CEAS} Space Journal},
  Year                     = {2017},

  Month                    = {nov},
  Number                   = {2},
  Pages                    = {167--187},
  Volume                   = {10},

  Doi                      = {10.1007/s12567-017-0184-2},
  Publisher                = {Springer Nature}
}

@Article{Krueger2004,
  Title                    = {Virtual crack closure technique: History, approach, and applications},
  Author                   = {Ronald Krueger},
  Journal                  = {Applied Mechanics Reviews},
  Year                     = {2004},
  Number                   = {2},
  Pages                    = {109},
  Volume                   = {57},

  Doi                      = {10.1115/1.1595677},
  Publisher                = {{ASME} International}
}

@InBook{McCarville2018,
  Title                    = {3.5 Design, Manufacture and Test of Cryotank Components},
  Author                   = {Douglas A. McCarville and Juan C. Guzman and Alexandra K. Dillon and Justin R. Jackson and Jordan O. Birkland},
  Pages                    = {153--179},
  Publisher                = {Elsevier},
  Year                     = {2018},

  Booktitle                = {Comprehensive Composite Materials {II}},
  Doi                      = {10.1016/b978-0-12-803581-8.09958-6}
}

@Article{Moon2011,
  Title                    = {Improvement of tensile properties of {CFRP} composites under {LEO} space environment by applying {MWNTs} and thin-ply},
  Author                   = {Jin-Bum Moon and Myung-Gon Kim and Chun-Gon Kim and Shantanu Bhowmik},
  Journal                  = {Composites Part A: Applied Science and Manufacturing},
  Year                     = {2011},

  Month                    = {jun},
  Number                   = {6},
  Pages                    = {694--701},
  Volume                   = {42},

  Doi                      = {10.1016/j.compositesa.2011.02.011},
  Publisher                = {Elsevier {BV}}
}

@Article{Paris1996,
  Title                    = {The fiber-matrix interface crack {\textemdash} A numerical analysis using Boundary Elements},
  Author                   = {F. Par{\'{\i}}s and J. C. Ca{\~{n}}o and J. Varna},
  Journal                  = {International Journal of Fracture},
  Year                     = {1996},

  Month                    = {may},
  Number                   = {1},
  Pages                    = {11--29},
  Volume                   = {82},

  Doi                      = {10.1007/bf00017861},
  Publisher                = {Springer Nature America, Inc}
}

@Article{Paris2007,
  Title                    = {Kinking of Transversal Interface Cracks Between Fiber and Matrix},
  Author                   = {Federico Par{\'{\i}}s and Elena Correa and Vladislav Manti{\v{c}}},
  Journal                  = {Journal of Applied Mechanics},
  Year                     = {2007},
  Number                   = {4},
  Pages                    = {703},
  Volume                   = {74},

  Doi                      = {10.1115/1.2711220},
  Publisher                = {{ASME} International}
}

@Article{Parvizi1978a,
  Title                    = {On multiple transverse cracking in glass fibre epoxy cross-ply laminates},
  Author                   = {A. Parvizi and J. E. Bailey},
  Journal                  = {Journal of Materials Science},
  Year                     = {1978},

  Month                    = {oct},
  Number                   = {10},
  Pages                    = {2131--2136},
  Volume                   = {13},

  Doi                      = {10.1007/bf00541666},
  Publisher                = {Springer Nature America, Inc}
}

@Article{Parvizi1978b,
  Title                    = {Constrained cracking in glass fibre-reinforced epoxy cross-ply laminates},
  Author                   = {A. Parvizi and K. W. Garrett and J. E. Bailey},
  Journal                  = {Journal of Materials Science},
  Year                     = {1978},

  Month                    = {jan},
  Number                   = {1},
  Pages                    = {195--201},
  Volume                   = {13},

  Doi                      = {10.1007/bf00739291},
  Publisher                = {Springer Nature}
}

@Article{Perlman1967,
  Title                    = {Elastostatic problems of curvilinear cracks in bonded dissimilar materials},
  Author                   = {A.B. Perlman and G.C. Sih},
  Journal                  = {International Journal of Engineering Science},
  Year                     = {1967},

  Month                    = {nov},
  Number                   = {11},
  Pages                    = {845--867},
  Volume                   = {5},

  Doi                      = {10.1016/0020-7225(67)90009-2},
  Publisher                = {Elsevier {BV}}
}

@Article{Rice1968,
  Title                    = {A Path Independent Integral and the Approximate Analysis of Strain Concentration by Notches and Cracks},
  Author                   = {J. R. Rice},
  Journal                  = {Journal of Applied Mechanics},
  Year                     = {1968},
  Number                   = {2},
  Pages                    = {379},
  Volume                   = {35},

  Doi                      = {10.1115/1.3601206},
  Publisher                = {{ASME} International}
}

@Article{Saito2012,
  Title                    = {Experimental Evaluation of the Damage Growth Restraining in 90$^{\circ}$ Layer of Thin-ply CFRP Cross-ply Laminates},
  Author                   = { Hiroshi Saito and Hiroki Takeuchi and Isao Kimpara },
  Journal                  = {Advanced Composite Materials},
  Year                     = {2012},
  Number                   = {1},
  Pages                    = {57-66},
  Volume                   = {21},

  Doi                      = {10.1163/156855112X629522},
  Publisher                = {Taylor \& Francis}
}

@Article{Sandino2016,
  Title                    = {Numerical analysis of the influence of a nearby fibre on the interface crack growth in composites under transverse tensile load},
  Author                   = {C. Sandino and E. Correa and F. Par{\'{\i}}s},
  Journal                  = {Engineering Fracture Mechanics},
  Year                     = {2016},

  Month                    = {dec},
  Pages                    = {58--75},
  Volume                   = {168},

  Doi                      = {10.1016/j.engfracmech.2016.01.022},
  Publisher                = {Elsevier {BV}}
}

@InProceedings{Sandino2018,
  Title                    = {Interface crack growth under transverse compression: nearby fibre effect},
  Author                   = {C. Sandino and E. Correa and F. Par{\'{i}}s},
  Booktitle                = {Proceeding of the $18^{th}$ European Conference on Composite Materials (ECCM-18)},
  Year                     = {2018},

  Eventdate                = {2018-06-24/2018-06-28},
  Venue                    = {Athens, Greece}
}

@InProceedings{Sandino2016b,
  Title                    = {Composite materials under transverse biaxial loads: Study of the influence of a nearby fibre on the interface crack growth under tension},
  Author                   = {C. Sandino and E. Correa and F. Par{\'{i}}s},
  Booktitle                = {Proceeding of the $17^{th}$ European Conference on Composite Materials (ECCM-17)},
  Year                     = {2016},

  Eventdate                = {2016-06-26/2016-06-30},
  Venue                    = {Munich, Germany}
}

@InProceedings{Sasayama2003,
  Title                    = {Effect of lamina thickness on first ply failure in multidirectionally laminated composites},
  Author                   = {H. Sasayama and K. Kawabe and S. Tomoda and I. Ohsawa and K. Kageyama and N. Ogata},
  Booktitle                = {Proceedings of the $8^{th}$ Japan SAMPE Symposium},
  Year                     = {2003},
  Publisher                = {SAMPE},

  Venue                    = {Tokyo, Japan}
}

@Article{Sihn2007,
  Title                    = {Experimental studies of thin-ply laminated composites},
  Author                   = {S. Sihn and R. Kim and K. Kawabe and S. Tsai},
  Journal                  = {Composites Science and Technology},
  Year                     = {2007},

  Month                    = {may},
  Number                   = {6},
  Pages                    = {996--1008},
  Volume                   = {67},

  Doi                      = {10.1016/j.compscitech.2006.06.008},
  Publisher                = {Elsevier {BV}}
}

@Article{Toya1974,
  Title                    = {A crack along the interface of a circular inclusion embedded in an infinite solid},
  Author                   = {M. Toya},
  Journal                  = {Journal of the Mechanics and Physics of Solids},
  Year                     = {1974},

  Month                    = {oct},
  Number                   = {5},
  Pages                    = {325--348},
  Volume                   = {22},

  Doi                      = {10.1016/0022-5096(74)90002-7},
  Publisher                = {Elsevier {BV}}
}

@InProceedings{Tsai2005,
  Title                    = {Thin Ply Composites},
  Author                   = {S.W. Tsai and S. Sihn and R.Y. Kim},
  Booktitle                = {Proceedings of $46^{th}$ AIAA/ASME/AHS/ASC Structures, Structural Dynamics \& Materials Conference},
  Year                     = {2005},

  Eventdate                = {2005-04-18/2005-04-21},
  Venue                    = {Austin, TX, USA}
}

@Article{Varna1997b,
  Title                    = {Transverse single-fibre test for interfacial debonding in composites: 2. Modelling},
  Author                   = {J. Varna and L.A. Berglund and M.L. Ericson},
  Journal                  = {Composites Part A: Applied Science and Manufacturing},
  Year                     = {1997},

  Month                    = {jan},
  Number                   = {4},
  Pages                    = {317--326},
  Volume                   = {28},

  Doi                      = {10.1016/s1359-835x(96)00125-x},
  Publisher                = {Elsevier {BV}}
}

@Article{Varna1997a,
  Title                    = {The effect of crack-face contact on fiber/matrix debonding in transverse tensile loading},
  Author                   = {J. Varna and Federico Par{\'{\i}}s and J. C.Ca{\~{n}}o},
  Journal                  = {Composites Science and Technology},
  Year                     = {1997},
  Number                   = {5},
  Pages                    = {523--532},
  Volume                   = {57},

  Doi                      = {10.1016/s0266-3538(96)00175-3},
  Publisher                = {Elsevier {BV}}
}

@Article{Varna2017,
  Title                    = {Growth and Interaction of Debonds in Local Clusters of Fibers in Unidirectional Composites during Transverse Loading},
  Author                   = {Janis Varna and Lin Qi Zhuang and Andrejs Pupurs and Zoubir Ayadi},
  Journal                  = {Key Engineering Materials},
  Year                     = {2017},

  Month                    = {sep},
  Pages                    = {63--66},
  Volume                   = {754},

  Doi                      = {10.4028/www.scientific.net/kem.754.63},
  Publisher                = {Trans Tech Publications}
}

@InProceedings{Yamaguchi2005,
  Title                    = {The improved ply cracking resistance of thin-ply laminates},
  Author                   = {K. Yamaguchi and H.T. Hahn},
  Booktitle                = {Proceedings of the $15^{th}$ International Conference on Composite Materials (ICCM-15)},
  Year                     = {2005},
  Publisher                = {SAMPE},

  Eventdate                = {2005-06-27/2005-07-02},
  Venue                    = {Tokyo, Japan}
}

@Article{Yokozeki2008,
  Title                    = {Experimental characterization of strength and damage resistance properties of thin-ply carbon fiber/toughened epoxy laminates},
  Author                   = {Tomohiro Yokozeki and Yuichiro Aoki and Toshio Ogasawara},
  Journal                  = {Composite Structures},
  Year                     = {2008},

  Month                    = {feb},
  Number                   = {3},
  Pages                    = {382--389},
  Volume                   = {82},

  Doi                      = {10.1016/j.compstruct.2007.01.015},
  Publisher                = {Elsevier {BV}}
}

@Article{Yokozeki2010,
  Title                    = {Damage characterization in thin-ply composite laminates under out-of-plane transverse loadings},
  Author                   = {Tomohiro Yokozeki and Akiko Kuroda and Akinori Yoshimura and Toshio Ogasawara and Takahira Aoki},
  Journal                  = {Composite Structures},
  Year                     = {2010},

  Month                    = {dec},
  Number                   = {1},
  Pages                    = {49--57},
  Volume                   = {93},

  Doi                      = {10.1016/j.compstruct.2010.06.016},
  Publisher                = {Elsevier {BV}}
}

@Article{Zhang1997,
  Title                    = {Transverse single-fibre test for interfacial debonding in composites: 1. Experimental observations},
  Author                   = {H. Zhang and M.L. Ericson and J. Varna and L.A. Berglund},
  Journal                  = {Composites Part A: Applied Science and Manufacturing},
  Year                     = {1997},

  Month                    = {jan},
  Number                   = {4},
  Pages                    = {309--315},
  Volume                   = {28},

  Doi                      = {10.1016/s1359-835x(96)00123-6},
  Publisher                = {Elsevier {BV}}
}

@Article{Zhuang2018,
  Title                    = {Effects of inter-fiber spacing on fiber-matrix debond crack growth in unidirectional composites under transverse loading},
  Author                   = {Linqi Zhuang and Andrejs Pupurs and Janis Varna and Ramesh Talreja and Zoubir Ayadi},
  Journal                  = {Composites Part A: Applied Science and Manufacturing},
  Year                     = {2018},

  Month                    = {jun},
  Pages                    = {463--471},
  Volume                   = {109},

  Doi                      = {10.1016/j.compositesa.2018.03.031},
  Publisher                = {Elsevier {BV}}
}

@article{Varna1997,
  doi = {10.1016/s0266-3538(96)00175-3},
  year  = {1997},
  publisher = {Elsevier {BV}},
  volume = {57},
  number = {5},
  pages = {523--532},
  author = {Janis Varna and Federico Paris and Juan Carlos del Cano},
  title = {The effect of crack-face contact on fiber/matrix debonding in transverse tensile loading},
  journal = {Composites Science and Technology}
}

@article{Asp1996,
  doi = {10.1016/s0266-3538(96)00090-5},
  year  = {1996},
  month = {jan},
  publisher = {Elsevier {BV}},
  volume = {56},
  number = {11},
  pages = {1291--1301},
  author = {L.E. Asp and L.A. Berglund and R. Talreja},
  title = {A criterion for crack initiation in glassy polymers subjected to a composite-like stress state},
  journal = {Composites Science and Technology}
}

@article{Asp1995,
  doi = {10.1016/0266-3538(94)00075-1},
  year  = {1995},
  month = {jan},
  publisher = {Elsevier {BV}},
  volume = {53},
  number = {1},
  pages = {27--37},
  author = {Leif E. Asp and Lars A. Berglund and Peter Gudmundson},
  title = {Effects of a composite-like stress state on the fracture of epoxies},
  journal = {Composites Science and Technology}
}

@Manual{abq12,
  Title                    = {ABAQUS/Standard User's Manual, Version 6.12},

  Address                  = {Providence, RI, USA},
  Organization             = {Simulia},
  Year                     = {2012}
}

repository: LucaDiStasio/thinPlyMechanics

repo_name: LucaDiStasio/thinPlyMechanics


text:
UBOOT_VERSION = "v2020.01"

UBRANCH ?= "xlnx_rebase_v2020.01"

SRCREV ?= "86c84c0d0f916ec00d5d76a32dc9372a25429ca9"

include u-boot-xlnx.inc
include u-boot-spl-zynq-init.inc

LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://README;beginline=1;endline=4;md5=744e7e3bb0c94b4b9f6b3db3bf893897"

# u-boot-xlnx has support for these
HAS_PLATFORM_INIT ?= " \
		xilinx_zynqmp_virt_config \
		xilinx_zynq_virt_defconfig \
		xilinx_versal_vc_p_a2197_revA_x_prc_01_revA \
		"

repository: ampere-openbmc/openbmc

repo_name: ampere-openbmc/openbmc


text:
# This file will be configured to contain variables for CPack. These variables
# should be set in the CMake list file of the project before CPack module is
# included. The list of available CPACK_xxx variables and their associated
# documentation may be obtained using
#  cpack --help-variable-list
#
# Some variables are common to all generators (e.g. CPACK_PACKAGE_NAME)
# and some are specific to a generator
# (e.g. CPACK_NSIS_EXTRA_INSTALL_COMMANDS). The generator specific variables
# usually begin with CPACK_<GENNAME>_xxxx.

SET(CPACK_ARCHIVE_COMPONENT_INSTALL "ON")
SET(CPACK_BINARY_7Z "")
SET(CPACK_BINARY_BUNDLE "")
SET(CPACK_BINARY_CYGWIN "")
SET(CPACK_BINARY_DEB "")
SET(CPACK_BINARY_DRAGNDROP "")
SET(CPACK_BINARY_IFW "")
SET(CPACK_BINARY_NSIS "")
SET(CPACK_BINARY_OSXX11 "")
SET(CPACK_BINARY_PACKAGEMAKER "")
SET(CPACK_BINARY_PRODUCTBUILD "")
SET(CPACK_BINARY_RPM "")
SET(CPACK_BINARY_STGZ "")
SET(CPACK_BINARY_TBZ2 "")
SET(CPACK_BINARY_TGZ "")
SET(CPACK_BINARY_TXZ "")
SET(CPACK_BINARY_TZ "")
SET(CPACK_BINARY_WIX "")
SET(CPACK_BINARY_ZIP "")
SET(CPACK_BUILD_SOURCE_DIRS "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5;/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5")
SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
SET(CPACK_COMMAND "/usr/bin/cpack")
SET(CPACK_COMPONENTS_ALL "runtime;tools;dev")
SET(CPACK_COMPONENTS_ALL_SET_BY_USER "TRUE")
SET(CPACK_COMPONENT_DEV_DEPENDS "runtime")
SET(CPACK_COMPONENT_DEV_DESCRIPTION "Development files for glbinding library")
SET(CPACK_COMPONENT_DEV_DISPLAY_NAME "C/C++ development files")
SET(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY "OFF")
SET(CPACK_COMPONENT_RUNTIME_DESCRIPTION "Runtime components for glbinding library")
SET(CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "Library")
SET(CPACK_COMPONENT_TOOLS_DEPENDS "runtime")
SET(CPACK_COMPONENT_TOOLS_DESCRIPTION "Tools for glbinding library")
SET(CPACK_COMPONENT_TOOLS_DISPLAY_NAME "Tools")
SET(CPACK_COMPONENT_UNSPECIFIED_HIDDEN "TRUE")
SET(CPACK_COMPONENT_UNSPECIFIED_REQUIRED "TRUE")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all")
SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "")
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "A C++ binding for the OpenGL API, generated using the gl.xml specification.")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "opensource@cginternals.com")
SET(CPACK_DEBIAN_PACKAGE_NAME "glbinding")
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
SET(CPACK_DEBIAN_PACKAGE_VERSION "2.1.1")
SET(CPACK_DEB_COMPONENT_INSTALL "ON")
SET(CPACK_GENERATOR "TGZ;DEB;RPM")
SET(CPACK_IGNORE_FILES "")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "OFF")
SET(CPACK_INSTALLED_DIRECTORIES "")
SET(CPACK_INSTALL_CMAKE_PROJECTS "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5;sia_td5;ALL;/")
SET(CPACK_INSTALL_PREFIX "/usr/local")
SET(CPACK_MODULE_PATH "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/ext/glbinding/deploy/packages/glbinding")
SET(CPACK_NSIS_DISPLAY_NAME "glbinding")
SET(CPACK_NSIS_INSTALLER_ICON_CODE "")
SET(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
SET(CPACK_NSIS_MUI_ICON "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/ext/glbinding/deploy/images/logo.ico")
SET(CPACK_NSIS_MUI_UNIICON "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/ext/glbinding/deploy/images/logo.ico")
SET(CPACK_NSIS_PACKAGE_NAME "glbinding")
SET(CPACK_OUTPUT_CONFIG_FILE "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/ext/glbinding/CPackConfig-glbinding.cmake")
SET(CPACK_PACKAGE_DEFAULT_LOCATION "/")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/ext/glbinding/README.md")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A C++ binding for the OpenGL API, generated using the gl.xml specification.")
SET(CPACK_PACKAGE_FILE_NAME "glbinding-2.1.1")
SET(CPACK_PACKAGE_ICON "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/ext/glbinding/deploy/images/logo.bmp")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "glbinding")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "glbinding")
SET(CPACK_PACKAGE_NAME "glbinding")
SET(CPACK_PACKAGE_RELOCATABLE "false")
SET(CPACK_PACKAGE_VENDOR "CG Internals GmbH")
SET(CPACK_PACKAGE_VERSION "2.1.1")
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "1")
SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
SET(CPACK_PATH "/usr/bin")
SET(CPACK_RESOURCE_FILE_LICENSE "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/ext/glbinding/LICENSE")
SET(CPACK_RESOURCE_FILE_README "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/ext/glbinding/README.md")
SET(CPACK_RESOURCE_FILE_WELCOME "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/ext/glbinding/README.md")
SET(CPACK_RPM_COMPONENT_INSTALL "ON")
SET(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
SET(CPACK_RPM_PACKAGE_DESCRIPTION "")
SET(CPACK_RPM_PACKAGE_GROUP "unknown")
SET(CPACK_RPM_PACKAGE_LICENSE "MIT")
SET(CPACK_RPM_PACKAGE_NAME "glbinding")
SET(CPACK_RPM_PACKAGE_PROVIDES "")
SET(CPACK_RPM_PACKAGE_RELEASE "1")
SET(CPACK_RPM_PACKAGE_RELOCATABLE "OFF")
SET(CPACK_RPM_PACKAGE_REQUIRES "")
SET(CPACK_RPM_PACKAGE_SUMMARY "A C++ binding for the OpenGL API, generated using the gl.xml specification.")
SET(CPACK_RPM_PACKAGE_VENDOR "CG Internals GmbH")
SET(CPACK_RPM_PACKAGE_VERSION "2.1.1")
SET(CPACK_SET_DESTDIR "OFF")
SET(CPACK_SOURCE_7Z "")
SET(CPACK_SOURCE_CYGWIN "")
SET(CPACK_SOURCE_GENERATOR "TBZ2;TGZ;TXZ;TZ")
SET(CPACK_SOURCE_IGNORE_FILES "")
SET(CPACK_SOURCE_INSTALLED_DIRECTORIES "")
SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/CPackSourceConfig.cmake")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "")
SET(CPACK_SOURCE_RPM "OFF")
SET(CPACK_SOURCE_TBZ2 "ON")
SET(CPACK_SOURCE_TGZ "ON")
SET(CPACK_SOURCE_TOPLEVEL_TAG "")
SET(CPACK_SOURCE_TXZ "ON")
SET(CPACK_SOURCE_TZ "ON")
SET(CPACK_SOURCE_ZIP "OFF")
SET(CPACK_STRIP_FILES "")
SET(CPACK_SYSTEM_NAME "Linux")
SET(CPACK_TOPLEVEL_TAG "Linux")
SET(CPACK_WIX_SIZEOF_VOID_P "8")

if(NOT CPACK_PROPERTIES_FILE)
  set(CPACK_PROPERTIES_FILE "/autofs/unityaccount/cremi/tepepin/SIA/TD5/sia_td5/CPackProperties.cmake")
endif()

if(EXISTS ${CPACK_PROPERTIES_FILE})
  include(${CPACK_PROPERTIES_FILE})
endif()

repository: TeikiP/SIA

repo_name: TeikiP/SIA

extension: cmake


text:
package run

import (
	"github.com/pelotech/drone-helm3/internal/env"
	"github.com/stretchr/testify/suite"
	"strings"
	"testing"
)

type ConfigTestSuite struct {
	suite.Suite
}

func TestConfigTestSuite(t *testing.T) {
	suite.Run(t, new(ConfigTestSuite))
}

func (suite *ConfigTestSuite) TestNewConfig() {
	stdout := &strings.Builder{}
	stderr := &strings.Builder{}
	envCfg := env.Config{
		Namespace: "private",
		Debug:     true,
		Stdout:    stdout,
		Stderr:    stderr,
	}
	cfg := newConfig(envCfg)
	suite.Require().NotNil(cfg)
	suite.Equal(&config{
		namespace: "private",
		debug:     true,
		stdout:    stdout,
		stderr:    stderr,
	}, cfg)
}

func (suite *ConfigTestSuite) TestGlobalFlags() {
	cfg := config{
		debug:     true,
		namespace: "public",
	}
	flags := cfg.globalFlags()
	suite.Equal([]string{"--debug", "--namespace", "public"}, flags)

	cfg = config{}
	flags = cfg.globalFlags()
	suite.Equal([]string{}, flags)
}


text:
// This is free and unencumbered software released into the public
// domain.  For more information, see <http://unlicense.org> or the
// accompanying UNLICENSE file.
package commands

import (
	"github.com/nelsam/gxui"
	"github.com/nelsam/gxui/themes/basic"
	"github.com/nelsam/vidar/settings"
)

type projectPane interface {
	Add(settings.Project)
}

type ProjectAdder struct {
	path  *FSLocator
	name  gxui.TextBox
	input <-chan gxui.Focusable
}

func NewProjectAdder(driver gxui.Driver, theme *basic.Theme) *ProjectAdder {
	projectAdder := new(ProjectAdder)
	projectAdder.Init(driver, theme)
	return projectAdder
}

func (p *ProjectAdder) Init(driver gxui.Driver, theme *basic.Theme) {
	p.path = NewFSLocator(driver, theme)
	p.name = theme.CreateTextBox()
}

func (p *ProjectAdder) Name() string {
	return "add-project"
}

func (p *ProjectAdder) Start(control gxui.Control) gxui.Control {
	p.path.loadEditorDir(control)

	input := make(chan gxui.Focusable, 2)
	p.input = input
	input <- p.path
	input <- p.name
	close(input)

	return nil
}

func (p *ProjectAdder) Next() gxui.Focusable {
	return <-p.input
}

func (p *ProjectAdder) Project() settings.Project {
	return settings.Project{
		Name: p.name.Text(),
		Path: p.path.Path(),
	}
}

func (p *ProjectAdder) Exec(element interface{}) (executed, consume bool) {
	if projects, ok := element.(projectPane); ok {
		project := p.Project()
		settings.AddProject(project)
		projects.Add(project)
		return true, true
	}
	return false, false
}

license: Unlicense

repository: darthlukan/vidar

repo_name: darthlukan/vidar


text:
// Based on goauth2 example :
//   Copyright 2011 The goauth2 Authors. All rights reserved.
//   Use of this source code is governed by a BSD-style
//   license that can be found in the LICENSE file.

package main

import (
	"code.google.com/p/goauth2/oauth"
	"encoding/json"
	"flag"
	"fmt"
	"log"
	"os"
	"time"
)

var (
	clientId     = flag.String("id", "your client id", "Client ID")
	clientSecret = flag.String("secret", "your client secret", "Client Secret")
	redirectURL  = flag.String("redirect_url", "http://example.net", "Redirect URL")
	authURL      = flag.String("auth_url", "https://na.airvantage.net/api/oauth/authorize", "Authentication URL")
	tokenURL     = flag.String("token_url", "https://na.airvantage.net/api/oauth/token", "Token URL")
	requestURL   = flag.String("request_url", "https://na.airvantage.net/api/gateways", "API request")
	code         = flag.String("code", "", "Authorization Code")
	cachefile    = flag.String("cache", "cache.json", "Token cache file")
)

const usageMsg = `
To obtain a request token you must specify both -id and -secret.

To obtain Client ID and Secret, create a new client in Develop=>API client menu.

Once you have completed the OAuth flow, the credentials should be stored inside
the file specified by -cache and you may run without the -id and -secret flags.
`

// Some simple structures representing the result of API calls

// a Gateway
type Gateway struct {
	State        string
	Type         string
	Metadata     []KeyValue
	Labels       []string
	CreationDate int64
	Imei         string
	SerialNumber string
	MacAddress   string
	Uid          string
}

// key value struct for metadata
type KeyValue struct {
	Key   string
	Value string
}

// the result of the gateway API call
type GatewayResult struct {
	Items  []Gateway
	Count  int32
	Size   int32
	Offset int32
}

// to String for the Gateway struct
func (gw Gateway) String() string {
	var creationDate = time.Unix(gw.CreationDate/1000, 0)
	return fmt.Sprintf("uid: %s state: %s type:%s imei: %s s/n: %s creation: %s ", gw.Uid, gw.State, gw.Type, gw.Imei, gw.SerialNumber, creationDate.String())
}

// to String for the GatewayResult struct
func (gr GatewayResult) String() string {
	var res = fmt.Sprintf("GatewayResult:\n   count: %d\n   size: %d\n   offset: %d\n   gateways:\n", gr.Count, gr.Size, gr.Offset)

	for _, gw := range gr.Items {
		res += "      " + gw.String() + "\n"
	}

	res += "\n"
	return res
}

// main program entry point
func main() {
	fmt.Println("hello AirVantage, will try to authenticate and get a list of the present gateways")
	flag.Parse()

	// Set up a OAuth configuration.
	config := &oauth.Config{
		ClientId:     *clientId,
		ClientSecret: *clientSecret,
		RedirectURL:  *redirectURL,
		AuthURL:      *authURL,
		TokenURL:     *tokenURL,
		TokenCache:   oauth.CacheFile(*cachefile),
	}

	// Set up a Transport using the config.
	transport := &oauth.Transport{Config: config}

	// Try to pull the token from the cache; if this fails, we need to get one.
	token, err := config.TokenCache.Token()
	if err != nil {
		if *clientId == "" || *clientSecret == "" {
			flag.Usage()
			fmt.Fprint(os.Stderr, usageMsg)
			os.Exit(2)
		}
		if *code == "" {
			// Get an authorization code from the data provider.
			// ("Please ask the user if I can access this resource.")
			url := config.AuthCodeURL("")
			fmt.Println("Visit this URL to get a code, then run again with -code=YOUR_CODE\n")
			fmt.Println(url)
			return
		}
		// Exchange the authorization code for an access token.
		// ("Here's the code you gave the user, now give me a token!")
		token, err = transport.Exchange(*code)
		if err != nil {
			log.Fatal("Exchange:", err)
		}
		// (The Exchange method will automatically cache the token.)
		fmt.Printf("Token is cached in %v\n", config.TokenCache)
	}

	// Make the actual request using the cached token to authenticate.
	// ("Here's the token, let me in!")
	transport.Token = token

	// Make the request.
	r, err := transport.Client().Get(*requestURL)
	if err != nil {
		log.Fatal("Get:", err)
	}
	// be sure to close the stream
	defer r.Body.Close()

	// create a JSon decoder for the HTTP request result
	dec := json.NewDecoder(r.Body)
	var gwResult GatewayResult
	if err := dec.Decode(&gwResult); err != nil {
		log.Fatal("JSon decode:", err)
	}
	fmt.Println("result : ")
	fmt.Println(gwResult)
}

repository: araltek/airvantage-api-golang

repo_name: araltek/airvantage-api-golang