text:
package cmd

import (
  "encoding/json"
  "io/ioutil"
  "os"
  "fmt"
  "net/http"
  "net/url"
)

func Log(txt string) {
  if ! Verbose { return }
  fmt.Println(txt)
}

func Die(txt string) {
  fmt.Println(txt)
  os.Exit(255)
}

func Check(err error,txt string) {
	if err == nil { return }
	fmt.Println(txt)
	Die(err.Error())
}

func RemoveFile(fn string) {
  if _, err := os.Stat(fn); os.IsNotExist(err) {
		return
	}
  if err := os.Remove(fn); err != nil {
    Log(fmt.Sprintf("Error deleting message file %s",fn))
    }
}

func WriteMessageFile(msg *slackMessage,fn string) {
	b,err:=json.Marshal(msg)
	Check(err,"Error decoding JSON message")
	d := []byte(b)
	err = ioutil.WriteFile(fn,d,0600)
	Check(err,"Error writing JSON object")
	if Verbose { fmt.Printf("JSON Object written to %s\n",fn)}
	return
}

func ReadMessageFile(msg *slackMessage,fn string) {
  if _, err := os.Stat(fn); os.IsNotExist(err) {
		Die("Error: Message has not yet been initialized")
	}
	dat, err  := ioutil.ReadFile(fn)
  Check (err,"Error reading JSON object")
	err = json.Unmarshal(dat,msg)
  Check (err,"Error decoding JSON object")
	return
}

func PathExists(path string) (bool, error) {
	_, err := os.Stat(path)
	if err == nil { return true, nil }
	if os.IsNotExist(err) { return false, nil }
	return true, err
}

func DumpMessage(msg slackMessage) {
  if ! Verbose { return }
  fmt.Println("\nMessage Data   : START")
  fmt.Printf("  Webhook      : %s\n",msg.Hook)
  fmt.Printf("  Message      : %s\n",msg.Payload.Text)
  fmt.Printf("  User         : %s\n",msg.Payload.User)
  fmt.Printf("  Icon         : %s\n",msg.Payload.Icon)
  fmt.Printf("  Icon-url     : %s\n",msg.Payload.Iconlink)
  fmt.Printf("  Channel      : %s\n",msg.Payload.Channel)
  acnt := len(msg.Payload.Attachments)
  if acnt > 0 {
    for i := range msg.Payload.Attachments {
    fmt.Printf("  Attachment   # %d\n",i)
    DumpAttach(msg.Payload.Attachments[i])
    }
  } else {
    fmt.Println("  Attachments  : (none)")
  }
  fmt.Println("Message Data   : END\n")
}

func DumpAttach(a slackAttachment) {
  if ! Verbose { return }
  fmt.Printf("    Fallback   : %s\n",a.Fallback)
  fmt.Printf("    Color      : %s\n",a.Color)
  fmt.Printf("    PreText    : %s\n",a.PreText)
  fmt.Printf("    AuthorName : %s\n",a.AuthorName)
  fmt.Printf("    AuthorLink : %s\n",a.AuthorLink)
  fmt.Printf("    AuthorIcon : %s\n",a.AuthorIcon)
  fmt.Printf("    Title      : %s\n",a.Title)
  fmt.Printf("    TitleLink  : %s\n",a.TitleLink)
  fmt.Printf("    Text       : %s\n",a.Text)
  fmt.Printf("    ImageUrl   : %s\n",a.ImageUrl)
  fmt.Printf("    ThumbUrl   : %s\n",a.ThumbUrl)
  fmt.Printf("    Footer     : %s\n",a.Footer)
  fmt.Printf("    FooterIcon : %s\n",a.FooterIcon)
  fmt.Printf("    TimeStamp  : %s\n",a.TS)
  fcnt := len(a.Fields)
  if fcnt > 0 {
    for i := range a.Fields {
      fmt.Printf("    Field      # %d\n",i)
      DumpFields(a.Fields[i])
    }
  } else {
    fmt.Println("    Fields     : (none)")
  }
}

func DumpFields(f slackAttachmentFields) {
  if ! Verbose { return }
  fmt.Printf("      Title    : %s\n",f.Title)
  fmt.Printf("      Value    : %s\n",f.Value)
  fmt.Printf("      Short    : %s\n",f.Short)
}

func SlackSend(msg *slackMessage) {
	params, _ := json.Marshal(msg.Payload)

	resp, err := http.PostForm(
		msg.Hook,
		url.Values{"payload": {string(params)}},
	)
  Check(err,"Unexpected Error from http.PostForm")

	body, err := ioutil.ReadAll(resp.Body)
  Check(err,"Unexpected Error from http.PostForm")

	defer resp.Body.Close()
  if string(body) != "ok" {Die(fmt.Sprintf("Error: Slack post returned error: %s",string(body)))}
	return
}

repository: mjbrowns/slackpost

repo_name: mjbrowns/slackpost


text:
##==================================================================================================
##                             Copyright 2016   NumScale SAS
##
##                   Distributed under the Boost Software License, Version 1.0.
##                        See accompanying file LICENSE.txt or copy at
##                            http://www.boost.org/LICENSE_1_0.txt
##==================================================================================================

include(${NS_CMAKE_ROOT}/ns.cmake)
NS_guard(NS_CMAKE_MAKE_COVERAGE)
NS_include(compilers)
NS_include(add_target_parent)

##==================================================================================================
## Process a list of source files to generate corresponding coverage target
##==================================================================================================
function(make_coverage root)

  if(DEFINED COVERAGE_SUPPORTED)

    foreach(file ${ARGN})

      string(REPLACE ".cpp" ".coverage" base ${file})
      set(test "${root}.${base}")

      add_executable(${test} ${file})

      set_property( TARGET ${test}
                    PROPERTY COMPILE_FLAGS  ${CMAKE_CXX_FLAGS_COVERAGE}
                  )

      set_property( TARGET ${test}
                    PROPERTY LINK_FLAGS ${CMAKE_EXE_LINKER_FLAGS_COVERAGE}
                  )

      set_property( TARGET ${test}
                    PROPERTY RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/test"
                  )

      add_target_parent(${test})

      add_test( NAME ${test}
                WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/test"
                COMMAND $<TARGET_FILE:${test}>
              )

      set_target_properties ( ${test} PROPERTIES
                              EXCLUDE_FROM_DEFAULT_BUILD TRUE
                              EXCLUDE_FROM_ALL TRUE
                              ${MAKE_COVERAGE_TARGET_PROPERTIES}
                            )
      if (MAKE_COVERAGE_TARGET_LINK_LIBRARIES)
          target_link_libraries(${test} ${MAKE_COVERAGE_TARGET_LINK_LIBRARIES})
      endif()

      add_dependencies(coverage ${test})

    endforeach()

  endif()

endfunction()

license_type: permissive

branch_name: refs/heads/develop

extension: cmake


text:
package gurnel

import (
	"bytes"
	"encoding/csv"
	"errors"
	"flag"
	"fmt"
	"io"
	"math"
	"os"
	"path/filepath"
	"sort"
	"strconv"
	"strings"
	"sync"
	"text/tabwriter"
	"time"

	"github.com/mikeraimondi/gurnel/internal/bindata"
)

type statsCmd struct{}

func (*statsCmd) Name() string       { return "stats" }
func (*statsCmd) ShortHelp() string  { return "View journal statistics" }
func (*statsCmd) Flag() flag.FlagSet { return flag.FlagSet{} }

func (*statsCmd) LongHelp() string {
	return "Unusually frequent/infrequent words are relative " +
		"to a Google Ngram corpus of scanned literature"
}

func (*statsCmd) Run(_ io.Reader, w io.Writer, args []string, conf *Config) error {
	refFreqsCSV, err := bindata.Asset("eng-us-10000-1960.csv")
	if err != nil {
		return fmt.Errorf("loading asset: %w", err)
	}
	csvReader := csv.NewReader(bytes.NewReader(refFreqsCSV))
	csvReader.FieldsPerRecord = 2

	refFreqs := make(map[string]float64)
	for {
		record, csvErr := csvReader.Read()
		if csvErr == io.EOF {
			break
		}
		if csvErr != nil {
			return csvErr
		}

		if record[0] == "" || record[1] == "" {
			return fmt.Errorf("invalid input")
		}
		freq, csvErr := strconv.ParseFloat(record[1], 64)
		if csvErr != nil {
			return fmt.Errorf("invalid frequency: %w", csvErr)
		}
		refFreqs[strings.ReplaceAll(record[0], `"`, `\"`)] = freq
	}

	wd, err := os.Getwd()
	if err != nil {
		return errors.New("getting working directory " + err.Error())
	}
	wd, err = filepath.EvalSymlinks(wd)
	if err != nil {
		return errors.New("evaluating symlinks " + err.Error())
	}

	done := make(chan struct{})
	defer close(done)
	paths, errc := walkFiles(done, wd)
	c := make(chan result)
	var wg sync.WaitGroup
	const numScanners = 32
	wg.Add(numScanners)
	for i := 0; i < numScanners; i++ {
		go func() {
			entryScanner(done, paths, c)
			wg.Done()
		}()
	}
	go func() {
		wg.Wait()
		close(c)
	}()
	var entryCount float64
	wordMap := make(map[string]uint64)
	t := conf.clock.Now()
	minDate := t
	for r := range c {
		if r.err != nil {
			return r.err
		}
		entryCount++
		for word, count := range r.wordMap {
			wordMap[word] += count
		}
		if minDate.After(r.date) {
			minDate = r.date
		}
	}
	// Check whether the Walk failed.
	if err := <-errc; err != nil {
		return err
	}

	if entryCount == 0 {
		fmt.Fprint(w, "no entries found! why not try writing one with 'gurnel start'?")
		return nil
	}

	percent := entryCount / math.Ceil(t.Sub(minDate).Hours()/24)
	const outFormat = "Jan 2 2006"
	fmt.Fprintf(w, "%.2f%% of days journaled since %v\n", percent*100, minDate.Format(outFormat))
	var wordCount uint64
	for _, count := range wordMap {
		wordCount += count
	}
	fmt.Fprintf(w, "Total word count: %v\n", wordCount)
	avgCount := float64(wordCount) / entryCount
	fmt.Fprintf(w, "Average word count: %.1f\n", avgCount)
	fmt.Fprint(w, "\n")

	wordStats := make([]*wordStat, len(wordMap))
	i := 0
	for word, count := range wordMap {
		frequency := float64(count) / float64(wordCount)
		var relFrequency float64
		refFrequency := refFreqs[word]
		if frequency > refFrequency {
			if refFrequency > 0 {
				relFrequency = frequency / refFrequency
			}
		} else {
			relFrequency = (refFrequency / frequency) * -1
		}
		wordStats[i] = &wordStat{word: word, occurrences: count, frequency: relFrequency}
		i++
	}

	sort.Slice(wordStats, func(i, j int) bool {
		return wordStats[i].frequency > wordStats[j].frequency
	})

	var topUnusualWordCount uint64
	topUnusualWordCount = 100
	if topUnusualWordCount > wordCount {
		topUnusualWordCount = wordCount
	}
	out := tabwriter.NewWriter(w, 0, 0, 1, ' ', 0)
	fmt.Fprintf(out, "Top %v unusually frequent words:\n", topUnusualWordCount)
	for _, ws := range wordStats[:topUnusualWordCount] {
		fmt.Fprintf(out, "%v\t%.1fX\n", ws.word, ws.frequency)
	}
	out.Flush()
	fmt.Fprint(out, "\n")
	fmt.Fprintf(out, "Top %v unusually infrequent words:\n", topUnusualWordCount)
	for i := 1; i <= int(topUnusualWordCount); i++ {
		ws := wordStats[len(wordStats)-i]
		fmt.Fprintf(out, "%v\t%.1fX\n", ws.word, ws.frequency)
	}
	out.Flush()

	return nil
}

type result struct {
	wordMap map[string]uint64
	date    time.Time
	err     error
}

type wordStat struct {
	word        string
	occurrences uint64
	frequency   float64
}

func walkFiles(
	done <-chan struct{},
	root string,
) (paths chan string, errc chan error) {
	paths = make(chan string)
	errc = make(chan error, 1)
	visited := make(map[string]bool)
	go func() {
		// Close the paths channel after Walk returns.
		defer close(paths)
		// No select needed for this send, since errc is buffered.
		errc <- filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
			if err != nil {
				return err
			}
			if !info.Mode().IsRegular() || visited[info.Name()] || !IsEntry(path) {
				return nil
			}
			visited[info.Name()] = true
			select {
			case paths <- path:
			case <-done:
				return errors.New("walk canceled")
			}
			return nil
		})
	}()
	return paths, errc
}

func entryScanner(done <-chan struct{}, paths <-chan string, c chan<- result) {
	for path := range paths {
		p := &Entry{Path: path}
		m := make(map[string]uint64)
		_, err := p.Load()
		if err == nil {
			for _, word := range p.Words() {
				m[strings.ToLower(string(word))]++
			}
		}
		date, _ := p.Date()
		select {
		case c <- result{date: date, wordMap: m, err: err}:
		case <-done:
			return
		}
	}
}

license: MIT

repository: mikeraimondi/gurnel

repo_name: mikeraimondi/gurnel

branch_name: refs/heads/master

gha_license_id: MIT

gha_language: Go

extension: go


text:
package native

import (
	"fmt"
	"net"
	"testing"

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

func TestNewPortAllocator(t *testing.T) {
	_, err := NewPortAllocator(-1, 2)
	assert.Error(t, err)
	_, err = NewPortAllocator(30000, 1000000)
	assert.Error(t, err)
	_, err = NewPortAllocator(1024, 1024)
	assert.Error(t, err)

	alloc, err := NewPortAllocator(50020, 50021)
	assert.NoError(t, err)
	port1, err := alloc.Allocate()
	assert.NoError(t, err)
	assert.Equal(t, port1, 50020)
	port2, err := alloc.Allocate()
	assert.NoError(t, err)
	assert.Equal(t, port2, 50021)

	listener1, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", port1))
	assert.NoError(t, err)

	listener2, err := net.Listen("tcp", fmt.Sprintf("127.0.0.1:%d", port2))
	assert.NoError(t, err)

	_, err = alloc.Allocate()
	assert.Error(t, err)
	assert.Equal(t, err.Error(), "no available ports in range 50020-50021")

	listener1.Close()
	listener2.Close()

	port4, err := alloc.Allocate()
	assert.NoError(t, err)
	assert.Equal(t, port4, 50020)
}

repository: baetyl/baetyl-go

repo_name: baetyl/baetyl-go


text:
// Copyright 2018 Bull S.A.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package internal

import (
	"context"
	"github.com/ystia/yorc/v4/storage/store"
	"path"
	"strings"

	"github.com/pkg/errors"

	"github.com/ystia/yorc/v4/helper/collections"
	"github.com/ystia/yorc/v4/helper/consulutil"
	"github.com/ystia/yorc/v4/storage"
	"github.com/ystia/yorc/v4/storage/types"
	"github.com/ystia/yorc/v4/tosca"
)

// StoreWorkflow stores a workflow
func StoreWorkflow(ctx context.Context, deploymentID, workflowName string, workflow *tosca.Workflow) error {
	wfPrefix := path.Join(consulutil.DeploymentKVPrefix, deploymentID, "workflows", workflowName)
	return storage.GetStore(types.StoreTypeDeployment).Set(ctx, wfPrefix, *transformedWorkflow(workflow))
}

func transformedWorkflow(workflow *tosca.Workflow) *tosca.Workflow {
	for _, step := range workflow.Steps {
		for _, activity := range step.Activities {
			if activity.CallOperation != nil {
				// Preserve case for requirement and target node name in case of relationship operation
				opSlice := strings.SplitN(activity.CallOperation.Operation, "/", 2)
				opSlice[0] = strings.ToLower(opSlice[0])
				activity.CallOperation.Operation = strings.Join(opSlice, "/")
			}
		}
	}
	return workflow
}

// storeWorkflows stores topology workflows
func storeWorkflows(ctx context.Context, topology tosca.Topology, deploymentID string) error {
	kv := make([]store.KeyValueIn, 0)
	for wfName, workflow := range topology.TopologyTemplate.Workflows {
		// no need to store empty workflow
		if workflow.Steps == nil {
			continue
		}
		wfPrefix := path.Join(consulutil.DeploymentKVPrefix, deploymentID, "workflows", wfName)
		kv = append(kv, store.KeyValueIn{
			Key:   wfPrefix,
			Value: *transformedWorkflow(&workflow),
		})
	}
	return storage.GetStore(types.StoreTypeDeployment).SetCollection(ctx, kv)
}

// checkNestedWorkflows detect potential cycle in all nested workflows
func checkNestedWorkflows(topology tosca.Topology) error {
	for wfName, workflow := range topology.TopologyTemplate.Workflows {
		nestedWfs := make([]string, 0)
		if err := checkNestedWorkflow(topology, workflow, nestedWfs, wfName); err != nil {
			return err
		}
	}
	return nil
}

// checkNestedWorkflows detect potential cycle in a nested workflow
func checkNestedWorkflow(topology tosca.Topology, workflow tosca.Workflow, nestedWfs []string, wfName string) error {
	nestedWfs = append(nestedWfs, wfName)
	for _, step := range workflow.Steps {
		for _, activity := range step.Activities {
			if activity.Inline != nil {
				if collections.ContainsString(nestedWfs, activity.Inline.Workflow) {
					return errors.Errorf("A cycle has been detected in inline workflows [initial: %q, repeated: %q]", nestedWfs[0], activity.Inline.Workflow)
				}
				if err := checkNestedWorkflow(topology, topology.TopologyTemplate.Workflows[activity.Inline.Workflow], nestedWfs, activity.Inline.Workflow); err != nil {
					return err
				}
			}
		}
	}
	return nil
}

repository: ystia/yorc

repo_name: ystia/yorc


text:
@book{van1996matrix,
  title={Matrix computations (Johns Hopkins studies in mathematical sciences)},
  author={Van Loan, Charles F and Golub, G},
  year={1996},
  publisher={The Johns Hopkins University Press}
}

@article{moler1978nineteen,
  title={Nineteen dubious ways to compute the exponential of a matrix},
  author={Moler, Cleve and Van Loan, Charles},
  journal={SIAM review},
  volume={20},
  number={4},
  pages={801--836},
  year={1978},
  publisher={SIAM}
}

@article{moler2003nineteen,
  title={Nineteen dubious ways to compute the exponential of a matrix, twenty-five years later},
  author={Moler, Cleve and Van Loan, Charles},
  journal={SIAM review},
  volume={45},
  number={1},
  pages={3--49},
  year={2003},
  publisher={SIAM}
}

@article{flynn1966very,
  title={Very high-speed computing systems},
  author={Flynn, Michael J},
  journal={Proceedings of the IEEE},
  volume={54},
  number={12},
  pages={1901--1909},
  year={1966},
  publisher={IEEE}
}

@article{matsumoto1998mersenne,
  title={Mersenne twister: a 623-dimensionally equidistributed uniform pseudo-random number generator},
  author={Matsumoto, Makoto and Nishimura, Takuji},
  journal={ACM Transactions on Modeling and Computer Simulation (TOMACS)},
  volume={8},
  number={1},
  pages={3--30},
  year={1998},
  publisher={ACM New York, NY, USA}
}

@article{von195113,
  title={13. various techniques used in connection with random digits},
  author={Von Neumann, John},
  journal={Appl. Math Ser},
  volume={12},
  number={36-38},
  pages={3},
  year={1951}
}

@book{stewart2009probability,
  title={Probability, Markov chains, queues, and simulation},
  author={Stewart, William J},
  year={2009},
  publisher={Princeton university press}
}

@book{maschler2013game,
  title={Game theory},
  author={Maschler, Michael and Solan, Eilon and Zamir, Shmuel},
  journal={Cambridge University Press, Cambridge, pp. xxvi},
  volume={979},
  pages={4},
  year={2013}
}

@article{smith1974theory,
  title={The theory of games and the evolution of animal conflicts},
  author={Smith, J Maynard},
  journal={Journal of theoretical biology},
  volume={47},
  number={1},
  pages={209--221},
  year={1974},
  publisher={Elsevier}
}

@book{fudenberg1998theory,
  title={The theory of learning in games},
  author={Fudenberg, Drew and Drew, Fudenberg and Levine, David K and Levine, David K},
  volume={2},
  year={1998},
  publisher={MIT press}
}

@book{burden2001numerical,
  title={Numerical analysis},
  author={Burden, Richard L and Faires, J Douglas and Reynolds, Albert C},
  year={2001},
  publisher={Brooks/cole Pacific Grove, CA}
}

@book{schelling2006micromotives,
  title={Micromotives and macrobehavior},
  author={Schelling, Thomas C},
  year={2006},
  publisher={WW Norton \& Company}
}

@book{conforti2014integer,
  title={Integer programming},
  author={Conforti, Michele and Cornu{\'e}jols, G{\'e}rard and Zambelli, Giacomo and others},
  volume={271},
  year={2014},
  publisher={Springer}
}

@book{michalewicz2013solve,
  title={How to solve it: modern heuristics},
  author={Michalewicz, Zbigniew and Fogel, David B},
  year={2013},
  publisher={Springer Science \& Business Media}
}

@article{croes1958method,
  title={A method for solving traveling-salesman problems},
  author={Croes, Georges A},
  journal={Operations research},
  volume={6},
  number={6},
  pages={791--812},
  year={1958},
  publisher={INFORMS}
}
@article{tan1997markov,
  title={Markov chains and the RISK board game},
  author={Tan, Bari{\c{s}}},
  journal={Mathematics Magazine},
  volume={70},
  number={5},
  pages={349--357},
  year={1997},
  publisher={Taylor \& Francis}
}

@article{stewart1996monopoly,
  title={Monopoly revisited},
  author={Stewart, Ian},
  journal={Scientific American},
  volume={275},
  number={4},
  pages={116--119},
  year={1996},
  publisher={JSTOR}
}

@article{griffiths2013modelling,
  title={Modelling activities at a neurological rehabilitation unit},
  author={Griffiths, Jeff D and Williams, Janet E and Wood, Richard Max},
  journal={European Journal of Operational Research},
  volume={226},
  number={2},
  pages={301--312},
  year={2013},
  publisher={Elsevier}
}

@article{white1993survey,
  title={A survey of applications of Markov decision processes},
  author={White, Douglas J},
  journal={Journal of the Operational Research society},
  volume={44},
  number={11},
  pages={1073--1096},
  year={1993},
  publisher={Taylor \& Francis}
}

@book{robinson2004simulation,
  title={Simulation: the practice of model development and use},
  author={Robinson, Stewart},
  volume={50},
  year={2004},
  publisher={Wiley Chichester}
}

@article{osorio2017simulation,
  title={Simulation-optimization model for production planning in the blood supply chain},
  author={Osorio, Andres F and Brailsford, Sally C and Smith, Honora K and Forero-Matiz, Sonia P and Camacho-Rodr{\'\i}guez, Bernardo A},
  journal={Health care management science},
  volume={20},
  number={4},
  pages={548--564},
  year={2017},
  publisher={Springer}
}

@article{figueira2014hybrid,
  title={Hybrid simulation--optimization methods: A taxonomy and discussion},
  author={Figueira, Gon{\c{c}}alo and Almada-Lobo, Bernardo},
  journal={Simulation Modelling Practice and Theory},
  volume={46},
  pages={118--134},
  year={2014},
  publisher={Elsevier}
}

@article{brailsford2009analysis,
  title={An analysis of the academic literature on simulation and modelling in health care},
  author={Brailsford, Sally C and Harper, Paul Robert and Patel, Brijesh and Pitt, Martin},
  journal={Journal of simulation},
  volume={3},
  number={3},
  pages={130--140},
  year={2009},
  publisher={Taylor \& Francis}
}

@book{stewart2009calculus,
  title={Calculus: Concepts and contexts},
  author={Stewart, James},
  year={2009},
  publisher={Cengage Learning}
}

@article{syms2015dynamic,
  title={A dynamic competition model of regime change},
  author={Syms, Richard and Solymar, Laszlo},
  journal={Journal of the Operational Research Society},
  volume={66},
  number={11},
  pages={1939--1947},
  year={2015},
  publisher={Taylor \& Francis}
}

@book{robinson1998dynamical,
  title={Dynamical systems: stability, symbolic dynamics, and chaos},
  author={Robinson, Clark},
  year={1998},
  publisher={CRC press}
}

@misc{martin2006theory,
  title={Theory and practical exercises of System Dynamics},
  author={Mart{\'i}n Garc{\'i}a, Juan},
  year={2018},
  publisher={Independently published}
}

@article{forrester1995beginning,
  title={The beginning of system dynamics},
  author={Forrester, Jay W},
  year={1995},
  journal={McKinsey Quarterly}
}

@article{forrester1961industrial,
  title={Industrial dynamics.},
  author={Forrester, Jay W},
  journal={Pegasus Communications, Waltham, MA},
  year={1961}
}

@inproceedings{vazquez2020system,
  title={System dynamics applications in healthcare: A literature review},
  author={V{\'a}zquez-Serrano, Jes{\'u}s Isaac and Peimbert-Garca, RE},
  booktitle={Proceedings of the international conference on industrial engineering and operations management},
  pages={10--12},
  year={2020}
}

@article{cooper2020sir,
  title={A SIR model assumption for the spread of COVID-19 in different communities},
  author={Cooper, Ian and Mondal, Argha and Antonopoulos, Chris G},
  journal={Chaos, Solitons \& Fractals},
  volume={139},
  pages={110057},
  year={2020},
  publisher={Elsevier}
}

@article{brailsford2019hybrid,
  title = {Hybrid simulation modelling in operational research: A state-of-the-art review},
  journal = {European Journal of Operational Research},
  volume = {278},
  number = {3},
  pages = {721-737},
  year = {2019},
  issn = {0377-2217},
  doi = {https://doi.org/10.1016/j.ejor.2018.10.025},
  url = {https://www.sciencedirect.com/science/article/pii/S0377221718308786},
  author = {Sally C. Brailsford and Tillal Eldabi and Martin Kunc and Navonil Mustafee and Andres F. Osorio},
}

@article{coyle1999system,
  title={System dynamics in defence analysis: some case studies},
  author={Coyle, JM and Exelby, D and Holt, J},
  journal={Journal of the Operational Research Society},
  volume={50},
  number={4},
  pages={372--382},
  year={1999},
  publisher={Springer}
}

@book{shoham2008multiagent,
  title={Multiagent systems: Algorithmic, game-theoretic, and logical foundations},
  author={Shoham, Yoav and Leyton-Brown, Kevin},
  year={2008},
  publisher={Cambridge University Press}
}

@inproceedings{reynolds1987flocks,

  title={Flocks, herds and schools: A distributed behavioral model},

  author={Reynolds, Craig W},

  booktitle={Proceedings of the 14th annual conference on Computer graphics and interactive techniques},

  pages={25--34},

  year={1987}

}

@article{diaz2021agent,
  title={An agent-based model of school choice with information asymmetries},
  author={D{\'\i}az, Diego A and Jim{\'e}nez, Ana Mar{\'\i}a and Larroulet, Cristi{\'a}n},
  journal={Journal of Simulation},
  volume={15},
  number={1-2},
  pages={130--147},
  year={2021},
  publisher={Taylor \& Francis}
}

@article{gardener1970mathematical,
  title={MATHEMATICAL GAMES: The fantastic combinations of John Conway's new solitaire game life},
  author={Gardener, Martin},
  journal={Scientific American},
  volume={223},
  number={4},
  pages={120--123},
  year={1970}
}

@article{romanowska2019agent,
  title={Agent-based modeling for archaeologists: Part 1 of 3},
  author={Romanowska, Iza and Crabtree, Stefani A and Harris, Kathryn and Davies, Benjamin},
  journal={Advances in archaeological practice},
  volume={7},
  number={2},
  pages={178--184},
  year={2019},
  publisher={Cambridge University Press}
}

@article{jing2020agent,
  title={Agent-based simulation of autonomous vehicles: A systematic literature review},
  author={Jing, Peng and Hu, Hanbin and Zhan, Fengping and Chen, Yuexia and Shi, Yuji},
  journal={IEEE Access},
  volume={8},
  pages={79089--79103},
  year={2020},
  publisher={IEEE}
}

@article{guerriero2011operational,
  title={Operational research in the management of the operating theatre: a survey},
  author={Guerriero, Francesca and Guido, Rosita},
  journal={Health care management science},
  volume={14},
  number={1},
  pages={89--114},
  year={2011},
  publisher={Springer}
}

@article{duran2007scheduling,
  title={Scheduling the Chilean soccer league by integer programming},
  author={Dur{\'a}n, Guillermo and Guajardo, Mario and Miranda, Jaime and Saur{\'e}, Denis and Souyris, Sebasti{\'a}n and Weintraub, Andres and Wolf, Rodrigo},
  journal={Interfaces},
  volume={37},
  number={6},
  pages={539--552},
  year={2007},
  publisher={INFORMS}
}

@book{sultan2014linear,
  title={Linear programming: An introduction with applications},
  author={Sultan, Alan},
  year={2014},
  publisher={Elsevier}
}

@article{menger1932,
  title={Das botenproblem},
  author={Menger, Karl},
  year={1932},
  journal={Ergebnisse eines Mathematischen Kolloquiums},
  volume={2},
  pages={11-12}
}

@article{braekers2016vehicle,
  title={The vehicle routing problem: State of the art classification and review},
  author={Braekers, Kris and Ramaekers, Katrien and Van Nieuwenhuyse, Inneke},
  journal={Computers \& Industrial Engineering},
  volume={99},
  pages={300--313},
  year={2016},
  publisher={Elsevier}
}

@article{moghdani2021green,
  title={The green vehicle routing problem: A systematic literature review},
  author={Moghdani, Reza and Salimifard, Khodakaram and Demir, Emrah and Benyettou, Abdelkader},
  journal={Journal of Cleaner Production},
  volume={279},
  pages={123691},
  year={2021},
  publisher={Elsevier}
}

@article{lewis2016creating,
  title={Creating seating plans: a practical application},
  author={Lewis, Rhyd and Carroll, Fiona},
  journal={Journal of the Operational Research Society},
  volume={67},
  number={11},
  pages={1353--1362},
  year={2016},
  publisher={Taylor \& Francis}
}

@article{tong2013modeling,
  title={Modeling the habitat suitability for deep-water gorgonian corals based on terrain variables},
  author={Tong, Ruiju and Purser, Autun and Guinan, Janine and Unnithan, Vikram},
  journal={Ecological Informatics},
  volume={13},
  pages={123--132},
  year={2013},
  publisher={Elsevier}
}

@book{bozorg2017meta,
  title={Meta-heuristic and evolutionary algorithms for engineering optimization},
  author={Bozorg-Haddad, Omid and Solgi, Mohammad and Lo{\'a}iciga, Hugo A},
  year={2017},
  publisher={John Wiley \& Sons}
}

@book{nasar2011beautiful,
  title={A beautiful mind},
  author={Nasar, Sylvia},
  year={2011},
  publisher={Simon and Schuster}
}

@article{nash1950equilibrium,
  title={Equilibrium points in n-person games},
  author={Nash, John F and others},
  journal={Proceedings of the national academy of sciences},
  volume={36},
  number={1},
  pages={48--49},
  year={1950},
  publisher={USA}
}

@article{nash1951non,
  title={Non-cooperative games},
  author={Nash, John},
  journal={Annals of mathematics},
  pages={286--295},
  year={1951},
  publisher={JSTOR}
}

@article{deo2011centralized,
  title={Centralized vs. decentralized ambulance diversion: A network perspective},
  author={Deo, Sarang and Gurvich, Itai},
  journal={Management Science},
  volume={57},
  number={7},
  pages={1300--1319},
  year={2011},
  publisher={INFORMS}
}

@article{press2012iterated,
  title={Iterated Prisoner’s Dilemma contains strategies that dominate any evolutionary opponent},
  author={Press, William H and Dyson, Freeman J},
  journal={Proceedings of the National Academy of Sciences},
  volume={109},
  number={26},
  pages={10409--10413},
  year={2012},
  publisher={National Acad Sciences}
}

@article{schreuder1981application,
  title={Application of a location model to fire stations in Rotterdam},
  author={Schreuder, JAM},
  journal={European Journal of Operational Research},
  volume={6},
  number={2},
  pages={212--219},
  year={1981},
  publisher={Elsevier}
}

@article{hifi2010linear,
  title={A linear programming approach for the three-dimensional bin-packing problem},
  author={Hifi, Mhand and Kacem, Imed and N{\`e}gre, St{\'e}phane and Wu, Lei},
  journal={Electronic Notes in Discrete Mathematics},
  volume={36},
  pages={993--1000},
  year={2010},
  publisher={Elsevier}
}

@article{diaz2014survey,
  title={A survey of transportation problems},
  author={D{\'\i}az-Parra, Ocotl{\'a}n and Ruiz-Vanoye, Jorge A and Bern{\'a}be Loranca, Beatriz and Fuentes-Penna, Alejandro and Barrera-C{\'a}mara, Ricardo A},
  journal={Journal of Applied Mathematics},
  volume={2014},
  year={2014},
  publisher={Hindawi}
}

@book{lanchester1916aircraft,
  title={Aircraft in warfare: The dawn of the fourth arm},
  author={Lanchester, Frederick William},
  year={1916},
  publisher={Constable limited}
}

@article{vandergraft1983fluid,
  title={A fluid flow model of networks of queues},
  author={Vandergraft, James S},
  journal={Management Science},
  volume={29},
  number={10},
  pages={1198--1208},
  year={1983},
  publisher={INFORMS}
}

@book{sarkka2019applied,
  title={Applied stochastic differential equations},
  author={S{\"a}rkk{\"a}, Simo and Solin, Arno},
  volume={10},
  year={2019},
  publisher={Cambridge University Press}
}

@article{kerckhoffs1883cryptographie,
  title={La cryptographie militaire. Journal des sciences militaries},
  author={Kerckhoffs, Auguste},
  journal={IX (38)},
  volume={5},
  year={1883}
}

@article{wilson2014best,
  title={Best practices for scientific computing},
  author={Wilson, Greg and Aruliah, Dhavide A and Brown, C Titus and Hong, Neil P Chue and Davis, Matt and Guy, Richard T and Haddock, Steven HD and Huff, Kathryn D and Mitchell, Ian M and Plumbley, Mark D and others},
  journal={PLoS biology},
  volume={12},
  number={1},
  pages={e1001745},
  year={2014},
  publisher={Public Library of Science}
}

@misc{ciwpython,
author = {{{The Ciw library developers}}},
title = {Ciw: 2.2.0},
year = 2021,
doi = {},
url = {http://dx.doi.org/10.5281/zenodo}
}

@Article{palmer2019ciw,
author = {Geraint I. Palmer and Vincent A. Knight and Paul R. Harper and Asyl L. Hawa},
title = {Ciw: An open-source discrete event simulation library},
journal = {Journal of Simulation},
volume = {13},
number = {1},
pages = {68-82},
year = {2019},
publisher = {Taylor & Francis},
doi = {10.1080/17477778.2018.1473909},
}

@Article{meurer2017sympy,
    title = {SymPy: symbolic computing in Python},
    author = {Meurer, Aaron and Smith, Christopher P. and Paprocki, Mateusz and \v{C}ert'{i}k, Ond\v{r}ej and Kirpichev, Sergey B. and Rocklin, Matthew and Kumar, AMiT and Ivanov, Sergiu and Moore, Jason K. and Singh, Sartaj and Rathnayake, Thilina and Vig, Sean and Granger, Brian E. and Muller, Richard P. and Bonazzi, Francesco and Gupta, Harsh and Vats, Shivam and Johansson, Fredrik and Pedregosa, Fabian and Curry, Matthew J. and Terrel, Andy R. and Rou\v{c}ka, \v{S}t\v{e}p'{a}n and Saboo, Ashutosh and Fernando, Isuru and Kulal, Sumith and Cimrman, Robert and Scopatz, Anthony},
    year = 2017,
    month = jan,
    keywords = {Python, Computer algebra system, Symbolics},
    abstract = {
        SymPy is an open source computer algebra system written in pure Python. It is built with a focus on extensibility and ease of use, through both interactive and programmatic applications. These characteristics have led SymPy to become a popular symbolic library for the scientific Python ecosystem. This paper presents the architecture of SymPy, a description of its features, and a discussion of select submodules. The supplementary material provide additional examples and further outline details of the architecture and features of SymPy.
    },
    volume = 3,
    pages = {e103},
    journal = {PeerJ Computer Science},
    issn = {2376-5992},
    url = {https://doi.org/10.7717/peerj-cs.103},
    doi = {10.7717/peerj-cs.103}
}

@misc{simpy,
author = {{{The Simpy developers.}}},
title = {Simpy documentaiton},
year = 2021,
month = oct,
doi = {},
url = {https://simpy.readthedocs.io/en/latest/}
% Citation instructions taken from https://groups.google.com/g/python-simpy/c/chs9dyrRR1w/m/Zsf1_SagBgAJ
}

@Article{harris2020array,
    title = {Array programming with {NumPy}},
    author = {Charles R. Harris and K. Jarrod Millman and St{'{e}}fan J.
        van der Walt and Ralf Gommers and Pauli Virtanen and David
            Cournapeau and Eric Wieser and Julian Taylor and Sebastian
            Berg and Nathaniel J. Smith and Robert Kern and Matti Picus
            and Stephan Hoyer and Marten H. van Kerkwijk and Matthew
            Brett and Allan Haldane and Jaime Fern{'{a}}ndez del
            R{'{i}}o and Mark Wiebe and Pearu Peterson and Pierre
            G{'{e}}rard-Marchant and Kevin Sheppard and Tyler Reddy and
            Warren Weckesser and Hameer Abbasi and Christoph Gohlke and
            Travis E. Oliphant},
    year = {2020},
    month = sep,
    journal = {Nature},
    volume = {585},
    number = {7825},
    pages = {357--362},
    doi = {10.1038/s41586-020-2649-2},
    publisher = {Springer Science and Business Media {LLC}},
    url = {https://doi.org/10.1038/s41586-020-2649-2}
}

@Manual{bache2020magrittr,
    title = {magrittr: A Forward-Pipe Operator for R},
    author = {Stefan Milton Bache and Hadley Wickham},
    year = {2020},
    note = {R package version 2.0.1},
    url = {https://CRAN.R-project.org/package=magrittr},
  }

@Manual{goulet2021expm,
    title = {expm: Matrix Exponential, Log, 'etc'},
    author = {Vincent Goulet and Christophe Dutang and Martin Maechler and David Firth and Marina Shapira and Michael Stadelmann},
    year = {2021},
    note = {R package version 0.999-6},
    url = {https://CRAN.R-project.org/package=expm},
  }

@Manual{borchers2021pracma,
    title = {pracma: Practical Numerical Math Functions},
    author = {Hans W. Borchers},
    year = {2021},
    note = {R package version 2.3.3},
    url = {https://CRAN.R-project.org/package=pracma},
  }

@software{reback2020pandas,
author = {The pandas development team},
title = {pandas-dev/pandas: Pandas},
month = feb,
year = 2020,
publisher = {Zenodo},
version = {latest},
doi = {10.5281/zenodo.3509134},
url = {https://doi.org/10.5281/zenodo.3509134}
}

@InProceedings{mckinney-proc-scipy-2010,
author = { {W}es {M}c{K}inney },
title = { {D}ata {S}tructures for {S}tatistical {C}omputing in {P}ython },
booktitle = { {P}roceedings of the 9th {P}ython in {S}cience {C}onference },
pages = { 56 - 61 },
year = { 2010 },
editor = { {S}t{\'e}fan van der {W}alt and {J}arrod {M}illman },
doi = { 10.25080/Majora-92bf1922-00a }
}

@Article{ucar2019simmer,
title = {{simmer}: Discrete-Event Simulation for {R}},
author = {I{\~n}aki Ucar and Bart Smeets and Arturo Azcorra},
journal = {Journal of Statistical Software},
year = {2019},
volume = {90},
number = {2},
pages = {1--30},
doi = {10.18637/jss.v090.i02},
}

@Article{2020SciPy-NMeth,
    author = {Virtanen, Pauli and Gommers, Ralf and Oliphant, Travis E. and
        Haberland, Matt and Reddy, Tyler and Cournapeau, David and
            Burovski, Evgeni and Peterson, Pearu and Weckesser, Warren and
            Bright, Jonathan and {van der Walt}, St{'e}fan J. and
            Brett, Matthew and Wilson, Joshua and Millman, K. Jarrod and
            Mayorov, Nikolay and Nelson, Andrew R. J. and Jones, Eric and
            Kern, Robert and Larson, Eric and Carey, C J and
            Polat, {.I}lhan and Feng, Yu and Moore, Eric W. and
            {VanderPlas}, Jake and Laxalde, Denis and Perktold, Josef and
        Cimrman, Robert and Henriksen, Ian and Quintero, E. A. and
            Harris, Charles R. and Archibald, Anne M. and
            Ribeiro, Ant{^o}nio H. and Pedregosa, Fabian and
            {van Mulbregt}, Paul and {SciPy 1.0 Contributors}},
    title = {{{SciPy} 1.0: Fundamental Algorithms for Scientific
        Computing in Python}},
    journal = {Nature Methods},
    year = {2020},
    volume = {17},
    pages = {261--272},
    adsurl = {https://rdcu.be/b08Wh},
    doi = {10.1038/s41592-019-0686-2},
}

@Article{soetaert2010solving,
title = {Solving Differential Equations in {R}: Package de{S}olve},
author = {Karline Soetaert and Thomas Petzoldt and R. Woodrow
Setzer},
journal = {Journal of Statistical Software},
volume = {33},
number = {9},
pages = {1--25},
year = {2010},
doi = {10.18637/jss.v033.i09},
keywords = {ordinary differential equations, partial differential
equations, differential algebraic equations, initial value
problems, R, FORTRAN, C},
}

@Article{knight2018nashpy,
    doi = {10.21105/joss.00904},
    url = {https://doi.org/10.21105/joss.00904},
    year = {2018},
    publisher = {The Open Journal},
    volume = {3},
    number = {30},
    pages = {904},
    author = {Vincent Knight and James Campbell},
    title = {Nashpy: A Python library for the computation of Nash equilibria},
    journal = {Journal of Open Source Software}
}

@Manual{oliveira2019recon,
    title = {Recon: Computational Tools for Economics},
    author = {Pedro {Cavalcante Oliveira} and Diego {S. Cardoso} and Marcelo Gelati},
    year = {2019},
    note = {R package version 0.3.0.0},
    url = {https://CRAN.R-project.org/package=Recon},
  }

@Manual{chang2021r6,
    title = {R6: Encapsulated Classes with Reference Semantics},
    author = {Winston Chang},
    year = {2021},
    note = {R package version 2.5.1},
    url = {https://CRAN.R-project.org/package=R6},
  }

@article{mitchell2011pulp,
  title={PuLP: a linear programming toolkit for python},
  author={Mitchell, Stuart and OSullivan, Michael and Dunning, Iain},
  journal={The University of Auckland, Auckland, New Zealand},
  pages={65},
  year={2011}
}

@TechReport{theussl2017roi,
    number = {133},
    month = {October},
    author = {Stefan Theu{\ss}l and Florian Schwendinger and Kurt Hornik},
    address = {Vienna},
    title = {ROI: The R Optimization Infrastructure Package},
    type = {Research Report Series / Department of Statistics and Mathematics},
    institution = {WU Vienna University of Economics and Business},
    year = {2017},
    url = {http://epub.wu.ac.at/5858/},
}

@incollection{forrest2005cbc,
  title={CBC user guide},
  author={Forrest, John and Lougee-Heimer, Robin},
  booktitle={Emerging theory, methods, and applications},
  pages={257--277},
  year={2005},
  publisher={INFORMS}
}

@Manual{shumacher2021rcbc,
    title = {rcbc: COIN CBC MILP Solver Bindings},
    author = {Dirk Schumacher and Jeroen Ooms},
    year = {2021},
    note = {R package version 0.1.0.9001},
  }

@Article{hunter2007matplotlib,
  Author    = {Hunter, J. D.},
  Title     = {Matplotlib: A 2D graphics environment},
  Journal   = {Computing in Science \& Engineering},
  Volume    = {9},
  Number    = {3},
  Pages     = {90--95},
  abstract  = {Matplotlib is a 2D graphics package used for Python for
  application development, interactive scripting, and publication-quality
  image generation across user interfaces and operating systems.},
  publisher = {IEEE COMPUTER SOC},
  doi       = {10.1109/MCSE.2007.55},
  year      = 2007
}

@Book{wickham2016ggplot2,
    author = {Hadley Wickham},
    title = {ggplot2: Elegant Graphics for Data Analysis},
    publisher = {Springer-Verlag New York},
    year = {2016},
    isbn = {978-3-319-24277-4},
    url = {https://ggplot2.tidyverse.org},
  }

@book{axelrod1990evolution,
    title={The Evolution of Co-Operation},
    ISBN={9780140124958},
    publisher={Penguin Books},
    author={Axelrod, Robert}, year={1990}
}

@conference{kluyver2016jupyter,
    Title = {Jupyter Notebooks -- a publishing format for reproducible computational workflows},
    Author = {Thomas Kluyver and Benjamin Ragan-Kelley and Fernando P{\'e}rez and Brian Granger and Matthias Bussonnier and Jonathan Frederic and Kyle Kelley and Jessica Hamrick and Jason Grout and Sylvain Corlay and Paul Ivanov and Dami{\'a}n Avila and Safia Abdalla and Carol Willing},
    Booktitle = {Positioning and Power in Academic Publishing: Players, Agents and Agendas},
    Editor = {F. Loizides and B. Schmidt},
    Organization = {IOS Press},
    Pages = {87 - 90},
    Year = {2016}
}

repository: drvinceknight/amwoss

repo_name: drvinceknight/amwoss

branch_name: refs/heads/main

gha_language: TeX

extension: bib


text:
SUMMARY = "Installer module for the modular initramfs system"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
RDEPENDS_${PN} = "initramfs-framework-base gptfdisk mtools dosfstools rsync e2fsprogs"

SRC_URI = " \
    file://installer \
"

do_install () {
    install -d ${D}/init.d
    install ${WORKDIR}/installer  ${D}/init.d/80-installer
}

FILES_${PN} = "/init.d"

repository: ostroproject/ostro-os-xt

repo_name: ostroproject/ostro-os-xt

gha_language: Shell

extension: bb


text:
package main

import (
	"context"
	"crypto/tls"
	"crypto/x509"
	"encoding/json"
	"github.com/echocat/go-saml/samlsp"
	"net/http"
	"net/url"
	"time"
)

func hello(w http.ResponseWriter, r *http.Request) {
	session := samlsp.SessionFromContext(r.Context())
	w.Header().Set("Content-Type", "application/json")
	encoder := json.NewEncoder(w)
	encoder.SetIndent("", "   ")
	_ = encoder.Encode(session)
}

func main() {
	keyPair, err := tls.LoadX509KeyPair("myservice.cert", "myservice.key")
	if err != nil {
		panic(err)
	}
	keyPair.Leaf, err = x509.ParseCertificate(keyPair.Certificate[0])
	if err != nil {
		panic(err)
	}

	idpMetadataURL, err := url.Parse("https://login.microsoftonline.com/e4a8eac5-60d4-40e6-8b6c-dcde6f9abfb3/federationmetadata/2007-06/federationmetadata.xml?appid=3f676dc5-506e-4fcf-a88b-07c3d507858b")
	if err != nil {
		panic(err)
	}

	rootURL, err := url.Parse("https://localhost:8000")
	if err != nil {
		panic(err)
	}

	idpMetadata, err := samlsp.FetchMetadata(context.TODO(), http.DefaultClient, *idpMetadataURL)
	if err != nil {
		panic(err)
	}

	opts := samlsp.Options{
		URL:         *rootURL,
		Key:         keyPair.PrivateKey,
		Certificate: keyPair.Leaf,
		IDPMetadata: idpMetadata,
	}
	samlSP, _ := samlsp.New(opts)

	samlSP.Session.(*samlsp.CookieSessionProvider).PatternProvider = samlsp.CookieSessionPatternProviderFor(time.Minute * 15)

	app := http.HandlerFunc(hello)
	http.Handle("/hello", samlSP.RequireAccount(app))
	http.Handle("/saml/", samlSP)
	if err := http.ListenAndServeTLS(":8000", "myservice.cert", "myservice.key", nil); err != nil {
		panic(err)
	}
}

repository: echocat/go-saml

repo_name: echocat/go-saml


text:
@inproceedings{winters2020humordetection,
  title={Dutch Humor Detection by Generating Negative Examples},
  author={Winters, Thomas and Delobelle, Pieter},
  booktitle={Proceedings of the 32st Benelux Conference on Artificial Intelligence (BNAIC 2020) and the 29th Belgian Dutch Conference on Machine Learning (Benelearn 2020)},
  year={2020},
  url={https://arxiv.org/pdf/2010.13652}
}

repository: iPieter/peacock

repo_name: iPieter/peacock

gha_language: JavaScript


text:
require squashfs-tools_${PV}.bb

inherit native

PACKAGES = ""

do_stage () {
	install -m 0755 mksquashfs ${STAGING_BINDIR}/
}


text:
require postgresql.inc

LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=3a9c1120056a102a8c8c4013cd828dce"

SRC_URI += "\
    file://remove.autoconf.version.check.patch \
    file://not-check-libperl.patch \
"

SRC_URI[md5sum] = "1171df0426fe4da5a29f6cdaf2e8b812"
SRC_URI[sha256sum] = "7061678bed1981c681ce54c76b98b6ec17743f090a9775104a45e7e1a8826ecf"

PNBLACKLIST[postgresql] ?= "Fails to build with RSS http://errors.yoctoproject.org/Errors/Details/131632/"

repository: bboozzoo/meta-openembedded

repo_name: bboozzoo/meta-openembedded


text:
@inproceedings{Laufer_PANEL_1994,
 address = {Mexico},
 author = {Läufer, Konstantin},
 booktitle = {Proc. Latin American Informatics Conf. (PANEL)},
 month = {September},
 organization = {ITESM-CEM},
 title = {Combining Type Classes and Existential Types},
 year = {1994}
}


text:
package props

//	SourceCustom 表示用户自定义的配置数据源.
type SourceCustom struct {
	props map[string]string
}

//	NewSourceCustom 创建一个 SourceCustom 的数据源对象.
func NewSourceCustom() *SourceCustom {
	return &SourceCustom{
		props: make(map[string]string),
	}
}

//	Find 为 Source 的接口实现，具体功能参见 `Source`.
func (s SourceCustom) Find(key string) (string, bool) {
	val, ok := s.props[key]
	if !ok {
		return "", false
	}

	return val, true
}

//	Set 用于将 key 和 value 放入 SourceCustom 对象中，方便后续通过 Props 的接口获取.
func (s *SourceCustom) Set(key string, val string) {
	s.props[key] = val
}

repository: tinyhubs/props

repo_name: tinyhubs/props


text:
package dsn

import (
	"net/url"
	"reflect"
	"testing"
	"time"

	xtime "github.com/mapgoo-lab/atreus/pkg/time"
)

type config struct {
	Network   string         `dsn:"network"`
	Addresses []string       `dsn:"address"`
	Username  string         `dsn:"username"`
	Password  string         `dsn:"password"`
	Timeout   xtime.Duration `dsn:"query.timeout"`
	Sub       Sub            `dsn:"query.sub"`
	Def       string         `dsn:"query.def,hello"`
}

type Sub struct {
	Foo int `dsn:"query.foo"`
}

func TestBind(t *testing.T) {
	var cfg config
	rawdsn := "tcp://root:toor@172.12.23.34,178.23.34.45?timeout=1s&sub.foo=1&hello=world"
	dsn, err := Parse(rawdsn)
	if err != nil {
		t.Fatal(err)
	}
	values, err := dsn.Bind(&cfg)
	if err != nil {
		t.Error(err)
	}
	if !reflect.DeepEqual(values, url.Values{"hello": {"world"}}) {
		t.Errorf("unexpect values get %v", values)
	}
	cfg2 := config{
		Network:   "tcp",
		Addresses: []string{"172.12.23.34", "178.23.34.45"},
		Password:  "toor",
		Username:  "root",
		Sub:       Sub{Foo: 1},
		Timeout:   xtime.Duration(time.Second),
		Def:       "hello",
	}
	if !reflect.DeepEqual(cfg, cfg2) {
		t.Errorf("unexpect config get %v, expect %v", cfg, cfg2)
	}
}

type config2 struct {
	Network string         `dsn:"network"`
	Address string         `dsn:"address"`
	Timeout xtime.Duration `dsn:"query.timeout"`
}

func TestUnix(t *testing.T) {
	var cfg config2
	rawdsn := "unix:///run/xxx.sock?timeout=1s&sub.foo=1&hello=world"
	dsn, err := Parse(rawdsn)
	if err != nil {
		t.Fatal(err)
	}
	_, err = dsn.Bind(&cfg)
	if err != nil {
		t.Error(err)
	}
	cfg2 := config2{
		Network: "unix",
		Address: "/run/xxx.sock",
		Timeout: xtime.Duration(time.Second),
	}
	if !reflect.DeepEqual(cfg, cfg2) {
		t.Errorf("unexpect config2 get %v, expect %v", cfg, cfg2)
	}
}

repository: mapgoo-lab/atreus

repo_name: mapgoo-lab/atreus


text:
file(REMOVE_RECURSE
  "CMakeFiles/CableGrind_pov_176.dir/pov_176/pov.c.o"
  "../pov/pov_176.pov.pdb"
  "../pov/pov_176.pov"
)

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

repository: siddk/driller-lite

repo_name: siddk/driller-lite


text:
@article{vollbrecht20131,
 author = {Vollbrecht, Lisa and Rush, marie Thérèse and Cottenie, Karl},
 copyright = {All rights reserved},
 file = {vollbrecht_2013_improving_dichotomous_keys_for_undergraduate_teaching.pdf:/Users/karlcottenie/Google Drive/zotero-library/2013/vollbrecht_2013_improving_dichotomous_keys_for_undergraduate_teaching.pdf:application/pdf},
 issn = {2291-1367},
 journal = {SURG Journal},
 language = {en},
 number = {1},
 pages = {23--32},
 title = {Improving dichotomous keys for undergraduate teaching},
 url = {https://journal.lib.uoguelph.ca/index.php/surg/article/view/2750},
 urldate = {2019-04-04},
 volume = {7},
 year = {2013}
}

repository: karl-cottenie/academic-kickstart

repo_name: karl-cottenie/academic-kickstart


text:
package meta

import "github.com/giantliao/beatles-protocol/licenses"

type SessionBuild struct {
	ShadowLen  int32
	CAddress   string
	ShadownLen int32
	CLicense   licenses.License
}

type SessionFastBuild struct {
	ShadowLen int32
	SessionId [32]byte
}

repository: giantliao/beatles-protocol

repo_name: giantliao/beatles-protocol


text:
package json_util

import (
	"encoding/json"
	// "fmt"
	"testing"

	"github.com/bmizerany/assert"
	"github.com/xeipuuv/gojsonschema"
)

func TestGenJsonSchema(t *testing.T) {
	str := `
		{
		"k1":"a",
		"k2":1,
		"k3":[],
		"k4":["a"],
		"k5":[1],
		"k6":[1.1],
		"k7":{},
		"k8":{"a":1},
		"k9":{"a":1,"b":[]},
		"k10":{"a":1,"b":[],"c":{"d":1.1}},
		"k11":{"a":1,"b":[],"c":{"d":1.1,"f":["a"]}},
		"k12":{"a":1,"b":[{"a":1,"b":[1]}]}
		}
	`
	var obj interface{}
	err := json.Unmarshal([]byte(str), &obj)
	assert.Equal(t, err, nil)

	schema, err := GenJsonSchema(obj)
	assert.Equal(t, err, nil)

	_, err = json.MarshalIndent(schema, "", "  ")
	assert.Equal(t, err, nil)
	// fmt.Println(string(bs))

	goSchema, err := gojsonschema.NewSchema(gojsonschema.NewGoLoader(schema))
	assert.Equal(t, err, nil)
	documentLoader := gojsonschema.NewStringLoader(str)
	ret, err := goSchema.Validate(documentLoader)
	assert.Equal(t, err, nil)
	assert.Equal(t, ret.Valid(), true)
}

repository: hidu/goutils

repo_name: hidu/goutils


text:
package main

import (
	"github.com/mitchellh/cli"
	"strings"
)

type NotificationList struct {
}

func NotificationListCommand() (cli.Command, error) {
	return &NotificationList{}, nil
}

func (c *NotificationList) Help() string {
	helpText := `
	`
	return strings.TrimSpace(helpText)
}

func (c *NotificationList) Synopsis() string {
	return "List notifications for a given time range"
}

func (c *NotificationList) Run(args []string) int {
	return 0
}

repository: PagerDuty/go-pagerduty

repo_name: PagerDuty/go-pagerduty


text:
// Package netcat :
// netcat.go is a read-only, TCP-only netcat client
// Inspired by https://notes.shichao.io/gopl/ch8/
// and https://devtheweb.io/blog/2018/07/testing-net-connections-part-one/
package netcat

import (
	"flag"
	"fmt"
	"io"
	"log"
	"net"
	"os"
	"os/signal"
	"strconv"
	"strings"
	"syscall"
	"time"
)

type target struct {
	IPProto   string
	IPaddress string
	port      int
}

func (t *target) getSocketAddr() (socket string) {
	portStr := strconv.Itoa(t.port)
	return t.IPaddress + ":" + portStr
}

func main() {

	// Parse CLI flags
	protoPtr := flag.String("proto", "tcp", "IP Protocol/Layer 4 connection type")
	ipaddrPtr := flag.String("address", "0.0.0.0", "IPv4 Address")
	portPtr := flag.Int("port", 22, "IP Address port")
	waitPtr := flag.Bool("wait", false, "If set to wait, it will wait for a server-side program to send bytes to the receiving end")
	flag.Parse()

	// Build the target struct
	targetNode := target{
		IPProto:   *protoPtr,
		IPaddress: *ipaddrPtr,
		port:      *portPtr,
	}

	// Setup CTRL-C handler
	setupInterruptHandler()

	// Establish connection
	timeout := 5000 * time.Millisecond
	Netcat(&targetNode, timeout, *waitPtr)
}

// Netcat initiate the netcat
func Netcat(t *target, timeout time.Duration, wait bool) (err error) {
	socket := t.getSocketAddr()
	log.Printf("Starting connection to %s port %d", t.IPaddress, t.port)
	go spinner(100 * time.Millisecond) // visual indicator that the program is running
	conn, err := net.DialTimeout(strings.ToLower(t.IPProto), socket, timeout)
	if err != nil {
		return err
	}
	defer conn.Close()
	log.Printf("Connection opened")
	if wait {
		StdOutCopy(os.Stdout, conn)
	}
	return nil
}

// StdOutCopy is a helper function to copy standard output to our conn object
func StdOutCopy(dst io.Writer, src io.Reader) {
	bWritten, err := io.Copy(dst, src)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("wrote %d", bWritten)
}

// spinner is just a cosmetic function to provide
// the user with a visual indication that program is still running
func spinner(delay time.Duration) {
	for {
		for _, r := range `-\|/-` {
			fmt.Printf("\r%c", r)
			time.Sleep(delay)
		}
	}
}

// setupInterruptHandler catch CTRL-C from the terminal
func setupInterruptHandler() {
	c := make(chan os.Signal, 2)
	signal.Notify(c, os.Interrupt, syscall.SIGTERM)
	go func() {
		<-c
		fmt.Println("\rCTRL-C is pressed in Terminal")
		log.Printf("Exiting Program\n")
		os.Exit(0)
	}()
}

repository: GandhiNN/netcat

repo_name: GandhiNN/netcat


text:
package http

import (
	"net/http"
	"time"

	"github.com/gorilla/mux"
	"github.com/stairlin/lego/ctx/app"
	"github.com/stairlin/lego/ctx/journey"
	"github.com/stairlin/lego/log"
)

// Action is an endpoint that handles incoming HTTP requests for a specific route.
// An action is stateless, self contained and should not share its context with other actions.
type Action interface {
	Call(c *Context) Renderer
}

// CallFunc is the contract required to be callable on the call chain
type CallFunc func(c *Context) Renderer

// Context holds the request context that is injected into an action
type Context struct {
	Ctx     journey.Ctx
	Res     http.ResponseWriter
	Req     *http.Request
	Parser  Parser
	Params  map[string]string
	StartAt time.Time

	isDraining func() bool
	action     Action
}

// JSON encodes the given data to JSON
func (c *Context) JSON(code int, data interface{}) Renderer {
	return &RenderJSON{Code: code, V: data}
}

// Head returns a body-less response
func (c *Context) Head(code int) Renderer {
	return &RenderHead{Code: code}
}

// Redirect returns an HTTP redirection response
func (c *Context) Redirect(url string) Renderer {
	return &RenderRedirect{URL: url}
}

type actionHandler struct {
	path       string
	method     string
	a          Action
	app        app.Ctx
	isDraining func() bool
	add        func()
	done       func()
	callChain  CallFunc
}

func (h *actionHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
	// Add to waitgroup
	h.add()
	defer h.done()

	// Assign unique request ID
	journey := journey.New(h.app)
	defer journey.End()

	// Build context
	c := &Context{
		Ctx:        journey,
		Res:        rw,
		Req:        r,
		Params:     mux.Vars(r),
		StartAt:    time.Now(),
		isDraining: h.isDraining,
		action:     h.a,
	}

	// Pick decoder
	if hasBody(r.Method) {
		c.Parser = PickParser(journey, r)
	}

	// Add request ID to response header (useful for debugging)
	rw.Header().Add("X-Request-Id", journey.UUID())

	// Start call chain
	renderer := h.callChain(c)

	// Encode response
	err := renderer.Encode(c)
	if err != nil {
		journey.Error("action.encode.error", "Renderer error", log.Error(err))
		c.Res.WriteHeader(http.StatusInternalServerError)
		return
	}
}

repository: gophersgang/lego

repo_name: gophersgang/lego


text:
file(REMOVE_RECURSE
  "CMakeFiles/test_lrn_forward.dir/main.cpp.o"
  "CMakeFiles/test_lrn_forward.dir/test_lrn_forward.cpp.o"
  "test_lrn_forward.pdb"
  "test_lrn_forward"
)

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

repository: wuhuikx/mkl-dnn-bk

repo_name: wuhuikx/mkl-dnn-bk


text:
###############################################################################
# - Try to find Sqlite3
# Once done this will define
#
#  SQLITE3_FOUND - system has Sqlite3
#  SQLITE3_INCLUDE_DIRS - the Sqlite3 include directory
#  SQLITE3_LIBRARIES - Link these to use Sqlite3
#  SQLITE3_DEFINITIONS - Compiler switches required for using Sqlite3
#
#  Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
#  Copyright (c) 2016-2022, NextGIS <info@nextgis.com>
#
#  Redistribution and use is allowed according to the terms of the New
#  BSD license.
#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
###############################################################################

# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
include(UsePkgConfig)
pkgconfig(sqlite3 _SQLITE3_INCLUDEDIR _SQLITE3_LIBDIR _SQLITE3_LDFLAGS _SQLITE3_CFLAGS)
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_package(PkgConfig)
if (PKG_CONFIG_FOUND)
  pkg_check_modules(_SQLITE3 sqlite3)
endif (PKG_CONFIG_FOUND)
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
find_path(SQLITE3_INCLUDE_DIR
NAMES
  sqlite3.h
PATHS
  ${_SQLITE3_INCLUDEDIR}
  /usr/include
  /usr/local/include
  /opt/local/include
  /sw/include
)

find_library(SQLITE3_LIBRARY
NAMES
  sqlite3
PATHS
  ${_SQLITE3_LIBDIR}
  /usr/lib
  /usr/local/lib
  /opt/local/lib
  /sw/lib
)

# TODO Check version

# Handle the QUIETLY and REQUIRED arguments and set GEOS_FOUND to TRUE
# if all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLite3 DEFAULT_MSG SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)

if(SQLITE3_FOUND)
  set(SQLITE3_LIBRARIES ${SQLITE3_LIBRARY})
  set(SQLITE3_INCLUDE_DIRS ${SQLITE3_INCLUDE_DIR})
endif()

# Hide internal variables
mark_as_advanced(SQLITE3_LIBRARY SQLITE3_INCLUDE_DIR)


text:
@article{PengboImageTifs2018,
 abstract = {Standing objects on planar surfaces are common to see in images, e.g., people on the ground. For most objects to stay stable on the plane, planar contact is a necessary requirement. However, 2D image splicing usually disregards this physical constraint of 3D world, leading to a potential artifact of object not attached to the plane. This paper is the first attempt to use the contact constraint of standing objects as a new clue for image forensics. Accordingly, we propose a novel approach to first reconstruct the 3D poses of standing objects and their supporting plane and then measure the contact conditions for splicing detection. To tackle the problem of unknown object shape for pose estimation, we effectively employ the prior knowledge of 3D morphable model to simultaneously estimate both shape and pose parameters by fitting to image observations. The 3D normal orientation of the supporting plane is estimated given its vanishing line. Dealing with uncertainty factors in estimations, we approximate a distribution of estimates using sampling strategies and then make the final decision. Particularly, we focused our method on the important scenario of human figure splicing detection, and comprehensive experiments on multiple data sets and typical images proved the encouraging effectiveness of the new forensic clue and the proposed approach.},
 author = {Peng, Bo and Wang, Wei and Dong, Jing and Tan, Tieniu},
 doi = {10.1109/TIFS.2017.2752728},
 issn = {15566013},
 journal = {IEEE Transactions on Information Forensics and Security},
 keywords = {3D morphable model,Image forensics,contact constraint,splicing detection},
 month = {feb},
 number = {2},
 pages = {377--392},
 publisher = {IEEE},
 title = {Image Forensics Based on Planar Contact Constraints of 3D Objects},
 url = {http://ieeexplore.ieee.org/document/8038041/},
 volume = {13},
 year = {2018}
}


text:
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
    include ( PermissionList )

    set ( SNAPPY_CONFIG_DIR "${COFFEE_DESKTOP_DIRECTORY}/linux/snappy" CACHE PATH "" )

    set ( SNAPPY_PROGRAM "/usr/bin/snapcraft" CACHE FILEPATH "" )

    set ( SNAPPY_PACKAGING_CAT "linux-snappy" CACHE STRING "" )

    set ( SNAPPY_DEPLOY_DIRECTORY
        "${COFFEE_DEPLOY_DIRECTORY}/${SNAPPY_PACKAGING_CAT}"
        CACHE PATH "" )
    set ( SNAPPY_OUTPUT_DIRECTORY
        "${COFFEE_PACKAGE_DIRECTORY}/${SNAPPY_PACKAGING_CAT}"
        CACHE PATH "" )
endif()

macro ( SNAPPY_TRANSLATE_ARCH_NAME OUTPUT_VAR )
    if("${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "x86_64-linux-gnu")
        set(OUTPUT_VAR "amd64")
    elseif("${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "i386-linux-gnu" OR
            "${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "i686-linux-gnu")
        set(OUTPUT_VAR "i386")
    endif()
endmacro()

macro ( SNAPPY_TRANSLATE_PERMISSIONS PERMISSIONS_LIST PERMISSION_OUTPUT )
    set ( ${PERMISSION_OUTPUT} )

    foreach( PARAM ${PERMISSIONS_LIST} )
        get_permission_flag( ${PARAM} PARAM_ENABLED )
        if( "${PARAM_ENABLED}" STREQUAL "1" )
            set ( PARAM_TRANS )
            # Snapcraft does not like it if we have non-unique elements in the list, we therefore verify this
            if("${PARAM}" MATCHES "SIMPLE_GRAPHICS" OR "${PARAM}" MATCHES "OPENGL")
                # SDL2 needs to create a Unix socket, therefore we need this
                set ( PARAM_TRANS
                    x11
                    opengl
                    network-bind
                    network
                    desktop
                    desktop-legacy
                    home
                    unity7
                    wayland
                    screen-inhibit-control
                    joystick
                    )
            elseif("${PARAM}" MATCHES "AUDIO")
                set ( PARAM_TRANS pulseaudio )
            elseif("${PARAM}" MATCHES "JOYSTICK")
                set ( PARAM_TRANS "system-observe;hardware-observe" )
            elseif("${PARAM}" MATCHES "BROWSER")
                set ( PARAM_TRANS "browser-support" )
            elseif("${PARAM}" MATCHES "NETWORK_ACCESS"
                    AND NOT "${PERMISSIONS_LIST}" MATCHES ".*GRAPHICS.*"
                    AND NOT "${PERMISSIONS_LIST}" MATCHES ".*OPENGL.*"
                    AND NOT "${PERMISSIONS_LIST}" MATCHES ".*NETWORK_CONNECT.*"
                    AND NOT "${PERMISSIONS_LIST}" MATCHES ".*NETWORK_SERVE.*")
                set ( PARAM_TRANS "network" )
            elseif("${PARAM}" MATCHES "NETWORK_CONNECT"
                    OR "${PARAM}" MATCHES "NETWORK_SERVE")
                set ( PARAM_TRANS "network-observe" )
                if(NOT "${PERMISSIONS_LIST}" MATCHES ".*GRAPHICS.*"
                        AND NOT "${PERMISSIONS_LIST}" MATCHES ".*OPENGL.*")
                    set ( PARAM_TRANS "${PARAM_TRANS};network;network-bind" )
                endif()
            endif()
            list ( APPEND ${PERMISSION_OUTPUT} "${PARAM_TRANS}" )
        endif()
    endforeach()
endmacro()

macro ( SNAPPY_PACKAGE
        TARGET
        TITLE SUMMARY
        VERSION COPYRIGHT COMPANY
        DATA
        LIBRARIES LIBRARY_FILES
        EXEC_FILES
        ICON_ASSET
        PERMISSIONS
        )

    set ( SNAPPY_PACKAGE_NAME "${TARGET}" )

    string ( TOLOWER "${SNAPPY_PACKAGE_NAME}" SNAPPY_PACKAGE_NAME )
    string ( REPLACE "_" "-" SNAPPY_PACKAGE_NAME "${SNAPPY_PACKAGE_NAME}" )

    set ( SNAPPY_PKG_DIR "${SNAPPY_DEPLOY_DIRECTORY}/${TARGET}" )
    set ( SNAPPY_FINAL_SNAP "${SNAPPY_OUTPUT_DIRECTORY}/${SNAPPY_PACKAGE_NAME}_${VERSION}_all.snap" )
    set ( SNAPPY_ARCH_DATA
        "amd64) ARCH_STRING=\"x86_64-linux-gnu\" ;;\ni386) ARCH_STRING=\"i386-linux-gnu\" ;;\narmhf) ARCH_STRING=\"arm-linux-gnueabihf\" ;;"
    )

    set ( SNAPCRAFT_FILE "${SNAPPY_PKG_DIR}/snapcraft.yaml" )
    set ( ICON_TARGET "${SNAPPY_PKG_DIR}/meta/gui/icon.svg" )

    set ( SNAPPY_TITLE "${TITLE}" )
    set ( SNAPPY_VERSION "${VERSION}" )
    set ( SNAPPY_ARCHITECTURES "all" )
    set ( SNAPPY_SUMMARY "${SUMMARY}" )

    set ( SNAPPY_GRADE "devel" )
    set ( SNAPPY_CONFINEMENT "devmode" )

    # Retrieve Snappy permissions list
    snappy_translate_permissions( "${PERMISSIONS}" SNAPPY_PERMISSIONS )

    execute_process (
        COMMAND ${CMAKE_COMMAND} -E make_directory "${SNAPPY_PKG_DIR}/snap/gui"
        )
    execute_process (
        COMMAND ${CMAKE_COMMAND} -E make_directory "${SNAPPY_PKG_DIR}/meta/gui"
        )
    execute_process (
        COMMAND ${CMAKE_COMMAND} -E copy "${ICON_ASSET}" "${ICON_TARGET}"
        )
    execute_process (
        COMMAND ${CMAKE_COMMAND} -E make_directory "${SNAPPY_OUTPUT_DIRECTORY}"
        )

    configure_file (
        "${SNAPPY_CONFIG_DIR}/snap.yaml.in"
        "${SNAPCRAFT_FILE}"
        @ONLY
        )

    configure_file (
        "${SNAPPY_CONFIG_DIR}/snap-select.sh"
        "${SNAPPY_PKG_DIR}/snap-select.sh"
        @ONLY
        )

    file ( APPEND "${SNAPCRAFT_FILE}"
        "apps:\n"
        "  game:\n"
        "    command: bin/${TARGET}\n"
        "    plugs:\n"
        )
    foreach( PERM ${SNAPPY_PERMISSIONS})
        file ( APPEND "${SNAPCRAFT_FILE}"
            "      - ${PERM}\n"
            )
    endforeach()
    file ( APPEND "${SNAPCRAFT_FILE}"
        "parts:\n"
        "  binary-import:\n"
        "    plugin: copy\n"
        "    stage-packages:\n"
        "      - libxcursor1\n"
        "      - libxinerama1\n"
        "      - libxrandr2\n"
        "      - libsdl2-2.0-0\n"
        "    files:\n"
        "      \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}\": \"bin/${CMAKE_LIBRARY_ARCHITECTURE}/${TARGET}\"\n"
        "      \"${SNAPPY_PKG_DIR}/snap-select.sh\": \"bin/${TARGET}\"\n"
        )

    foreach(LIB ${LIBRARY_FILES})
        get_filename_component ( SH_LIB "${LIB}" NAME )

        file ( APPEND "${SNAPCRAFT_FILE}"
            "      \"${LIB}\": \"lib/${CMAKE_LIBRARY_ARCHITECTURE}/${SH_LIB}\"\n")
    endforeach()

    foreach(BIN ${EXEC_FILES})
        file ( APPEND "${SNAPCRAFT_FILE}"
            "      \"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${BIN}\": \"bin/${CMAKE_LIBRARY_ARCHITECTURE}/${BIN}\"\n")
    endforeach()

    set ( NUM_IMPORTS "0" )
    foreach ( SRC ${DATA} )
        file ( APPEND "${SNAPCRAFT_FILE}"
            "  resc-import-${NUM_IMPORTS}:\n"
            "    plugin: dump\n"
            "    source: \"${SRC}\"\n"
            "    organize:\n"
            "      \'*\': assets/.\n"
            )
        math ( EXPR NUM_IMPORTS "${NUM_IMPORTS}+1" )
    endforeach()

    target_sources ( ${TARGET}.snap PUBLIC
        "${SNAPCRAFT_FILE}"
        "${ICON_TARGET}"
        "${SNAPPY_PKG_DIR}/snap-select.sh"
        )

    set ( PYTHON_ENCODING_STUFF LC_ALL=C.UTF-8 LANG=C.UTF-8 )

    add_custom_target ( ${TARGET}.snap ALL DEPENDS ${TARGET} )

    add_custom_command ( TARGET ${TARGET}.snap
        POST_BUILD
        COMMAND ${PYTHON_ENCODING_STUFF} ${SNAPPY_PROGRAM} clean
        WORKING_DIRECTORY ${SNAPPY_PKG_DIR}
        USES_TERMINAL
        )
    add_custom_command ( TARGET ${TARGET}.snap
        POST_BUILD
        COMMAND ${PYTHON_ENCODING_STUFF} ${SNAPPY_PROGRAM} build
        WORKING_DIRECTORY ${SNAPPY_PKG_DIR}
        USES_TERMINAL
        )
    add_custom_command ( TARGET ${TARGET}.snap
        POST_BUILD
        COMMAND ${PYTHON_ENCODING_STUFF} ${SNAPPY_PROGRAM} snap -o "${SNAPPY_FINAL_SNAP}"
        WORKING_DIRECTORY ${SNAPPY_PKG_DIR}
        USES_TERMINAL
        )

    install (
        FILES
        "${SNAPPY_FINAL_SNAP}"

        DESTINATION
        "${CMAKE_PACKAGED_OUTPUT_PREFIX}/${SNAPPY_PACKAGING_CAT}"
        )

endmacro()

repository: hbirchtree/coffeecutie

repo_name: hbirchtree/coffeecutie


text:
import request from '@/utils/request';

export async function query() {
  return request('/api/users');
}

export async function queryCurrent() {
  return request('/api/currentUser');
}

// 获取用户数据
export async function queryUserData() {
  return request('/login/user');
}
// 获取权限
export async function getAuth() {
  return request('/authority/user');
}

repository: chenzeng/quick-start-antd

repo_name: chenzeng/quick-start-antd

extension: js


text:
package structure

import kv1 "k8s.io/api/core/v1"

//============================================
// Config
//============================================

// Config Feilds => Exported
type Config struct {
	K8s_ConfigFilePath string            `json:"k8s_ConfigFilePath"`
	K8s_NameSpace      string            `json:"k8s_NameSpace"`
	K8s_NodeName       string            `json:"k8s_NodeName"`
	K8s_Priority       int32             `json:"k8s_Priority"`
	K8s_Labels         map[string]string `json:"k8s_Labels"`
	K8s_Annotations    map[string]string `json:"k8s_Annotations"`

	Rabbit_User         string `json:"rabbit_User"`
	Rabbit_Pass         string `json:"rabbit_Pass"`
	Rabbit_Host         string `json:"rabbit_Host"`
	Rabbit_Port         string `json:"rabbit_Port"`
	Rabbit_CommandQueue string `json:"rabbit_CommandQueue"`
	Rabbit_ResultQueue  string `json:"rabbit_ResultQueue"`

	Alias []map[string]string `json:"alias"`
}

//============================================
// Command Message
//============================================

type CommandType string

const (
	CommandTypeK8sPod   CommandType = "K8sPod"
	CommandTypeReadFile CommandType = "ReadFile"
)

// Command Feilds => Exported
type Command struct {
	Type     CommandType `json:"type"`
	File     string      `json:"file"`
	Commands [][]string  `json:"commands"`
	Args     [][]string  `json:"args"`
}

//============================================
// K8s File
//============================================

// YAML file fields => Exported
type YAML struct {
	APIVersion string `yaml:"apiVersion"`
	Kind       string `yaml:"kind"`
	Metadata   struct {
		Name string
	} `yaml:"metadata"`
	Spec struct {
		Template struct {
			Metadata struct {
				Name string
			} `yaml:"metadata"`
			Spec struct {
				ImagePullSecrets []struct {
					Name string
				} `yaml:"imagePullSecrets"`
				Containers []struct {
					Name         string   `yaml:"name"`
					Image        string   `yaml:"image"`
					Command      []string `yaml:"command"`
					Args         []string `yaml:"args"`
					VolumeMounts []struct {
						MountPath string `yaml:"mountPath"`
						Name      string `yaml:"name"`
					} `yaml:"volumeMounts"`
				} `yaml:"containers"`
				Volumes []struct {
					HostPath struct {
						Path string           `yaml:"path"`
						Type kv1.HostPathType `yaml:"type"`
						Name string           `yaml:"name"`
					} `yaml:"hostPath"`
				} `yaml:"volumes"`
				HostNetwork   bool              `yaml:"hostNetwork"`
				RestartPolicy kv1.RestartPolicy `yaml:"restartPolicy"`
			} `yaml:"spec"`
		} `yaml:"template"`
	} `yaml:"spec"`
}


text:
package flg

import (
	"errors"
	"os"
	"sync"
	"time"

	"github.com/BurntSushi/toml"
	"go.uber.org/zap"
	"go.uber.org/zap/zapcore"
	"gopkg.in/natefinch/lumberjack.v2"
)

const (
	TIMEFORMAT = "2006-01-02 15-04-05.000"
)

//base struct
type Logger struct {
	zlogs   map[string]*zap.Logger
	once    sync.Once
	fconfig *FConfig
}

//format
func currentTimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder) {
	t = t.Local()
	enc.AppendString(t.Format(TIMEFORMAT))
}

//get data
func (l *Logger) GetLogByKey(key string) (*zap.Logger, error) {
	zlog, ok := l.zlogs[key]
	if !ok {
		return nil, errors.New("logger is not exist")
	}
	return zlog, nil
}

//get logger from object
func (l *Logger) LoadFromObject(fconfig *FConfig) error {
	l.once.Do(
		func() {
			l.fconfig = fconfig
			l.zlogs = make(map[string]*zap.Logger)
			err := l.makeLogger()
			if err != nil {
				panic("make logger faild")
			}
		})
	if l.fconfig == nil || len(l.zlogs) == 0 {
		return errors.New("log config not exist or make log faild")
	}
	return nil
}

//get log from toml file
func (l *Logger) LoadFromFile(filename string) error {
	//check file
	_, e := os.Stat(filename)
	if e != nil {
		return errors.New("file not exist")
	}
	l.once.Do(
		func() {
			var fconfig FConfig
			if _, err := toml.DecodeFile(filename, &fconfig); err != nil {
				panic(err)
			}
			l.fconfig = &fconfig
			l.zlogs = make(map[string]*zap.Logger)
			err := l.makeLogger()
			if err != nil {
				panic("make logger faild")
			}
		})

	if l.fconfig == nil || len(l.zlogs) == 0 {
		return errors.New("log config not exist or make log faild")
	}
	return nil
}

//set default config
func setDefaultConfig(zconfig *ZConfig) {
	if len(zconfig.Timekey) == 0 {
		zconfig.Timekey = TIME_KEY
	}

	if len(zconfig.LevelKey) == 0 {
		zconfig.LevelKey = LEVEL_KEY
	}

	if len(zconfig.NameKey) == 0 {
		zconfig.NameKey = NAME_KEY
	}
	if len(zconfig.CallerKey) == 0 {
		zconfig.CallerKey = CALLER_KEY
	}
	if len(zconfig.MessageKey) == 0 {
		zconfig.MessageKey = MESSAGE_KEY
	}
	if len(zconfig.StacktraceKey) == 0 {
		zconfig.StacktraceKey = STACK_TRACE_KEY
	}

}

//build logger
func (l *Logger) makeLogger() error {
	zfgs := l.fconfig.Zfgs

	lj := l.makeLumberjackLog()
	//创建可用的日志对象
	for _, zfg := range zfgs {
		setDefaultConfig(&zfg)
		encoderConfig := l.makeEncoderConfig(&zfg)

		// 设置日志级别
		atomicLevel := zap.NewAtomicLevel()
		atomicLevel.UnmarshalText([]byte(zfg.Level))

		zws := make([]zapcore.WriteSyncer, 0)

		zws = append(zws, zapcore.AddSync(&lj))

		if 1 == (zfg.LogMod & STDOUT_MODE) {
			zws = append(zws, zapcore.AddSync(os.Stdout))
		}

		core := zapcore.NewCore(
			zapcore.NewJSONEncoder(encoderConfig),
			zapcore.NewMultiWriteSyncer(zws...),
			atomicLevel,
		)

		zapOptions := make([]zap.Option, 0)

		//get aller
		caller := zap.AddCaller()
		zapOptions = append(zapOptions, caller)

		if zfg.IsDev {
			//add file and line
			development := zap.Development()
			zapOptions = append(zapOptions, development)
		}

		filed := zap.Fields(zap.String(SERVER_NAME, zfg.ServerName))
		zapOptions = append(zapOptions, filed)

		l.zlogs[zfg.ServerName] = zap.New(core, zapOptions...)
	}
	return nil
}

//make zconfig
func (l *Logger) makeEncoderConfig(zconfig *ZConfig) zapcore.EncoderConfig {
	return zapcore.EncoderConfig{
		TimeKey:        zconfig.Timekey,
		LevelKey:       zconfig.LevelKey,
		NameKey:        zconfig.NameKey,
		CallerKey:      zconfig.CallerKey,
		MessageKey:     zconfig.MessageKey,
		StacktraceKey:  zconfig.StacktraceKey,
		LineEnding:     zapcore.DefaultLineEnding,
		EncodeLevel:    zapcore.LowercaseLevelEncoder,  // 小写编码器
		EncodeTime:     currentTimeEncoder,             // ISO8601 UTC 时间格式
		EncodeDuration: zapcore.SecondsDurationEncoder, //
		EncodeCaller:   zapcore.FullCallerEncoder,      // 全路径编码器
		EncodeName:     zapcore.FullNameEncoder,
	}
}

//get lumber jacklog
func (l *Logger) makeLumberjackLog() lumberjack.Logger {
	lkcfg := l.fconfig.Lfg
	lj := lumberjack.Logger{
		Filename:   lkcfg.Filename,   // 日志文件路径
		MaxSize:    lkcfg.MaxSize,    // 每个日志文件保存的最大尺寸 单位：M
		MaxBackups: lkcfg.MaxBackups, // 日志文件最多保存多少个备份
		MaxAge:     lkcfg.MaxAge,     // 文件最多保存多少天
		Compress:   lkcfg.Compress,   //压缩
	}
	return lj
}

repository: beckbikang/flg

repo_name: beckbikang/flg


text:
DESCRIPTION = "The Enlightenment C-like scripting language for Edje"

inherit efl

LICENSE = "MIT BSD CompuPhase"
LIC_FILES_CHKSUM = "file://COPYING;md5=220a7f1107df42c62428d8ebe559ed14"

BBCLASSEXTEND = "native"

DEPENDS += "eina"

# Some upgrade path tweaking
AUTO_LIBNAME_PKGS = ""

SRC_URI = "\
    ${E_MIRROR}/${SRCNAME}-${SRCVER}.tar.gz \
"

SRC_URI[md5sum] = "8fee23d51be07c72f9a7edf707e1f43f"
SRC_URI[sha256sum] = "fe8af458b2f3e5e561181c7e86b763e2623397a2a4bbbfe08e58be06ed052306"

repository: ExorEmbedded/exor-workspace

repo_name: ExorEmbedded/exor-workspace

gha_language: Python


text:
@article{ISI:000389478400001,
 article-number = {1915},
 author = {Faulkenberry, Thomas J. and Tummolini, Luca},
 doi = {10.3389/fpsyg.2016.01915},
 issn = {1664-1078},
 journal = {FRONTIERS IN PSYCHOLOGY},
 month = {DEC 8},
 orcid-numbers = {Tummolini, Luca/0000-0001-7791-0457},
 researcherid-numbers = {Tummolini, Luca/A-5086-2010},
 title = {Commentary: Is there any Influence of Variations in Context on
Object-Affordance Effects in Schizophrenia? Perception of Property and
Goals of Action},
 unique-id = {ISI:000389478400001},
 volume = {7},
 year = {2016}
}

repository: ideeverdi/website-academic

repo_name: ideeverdi/website-academic


text:
require ${PN}.inc

PV = "${OPIE_GIT_PV}"
PR = "r8"
SRC_URI = "${OPIE_GIT};protocol=git;subpath=pics"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
package core

import (
	"fmt"
	"github.com/jaeles-project/jaeles/libs"
	"github.com/jaeles-project/jaeles/sender"
	"github.com/jaeles-project/jaeles/utils"
	"github.com/thoas/go-funk"
)

var baseFiltering = []string{
	"hopetoget404" + RandomString(6),
	fmt.Sprintf("%s", RandomString(16)+"/"+RandomString(5)),
	fmt.Sprintf("%s.html", RandomString(16)),
	fmt.Sprintf("%%00%s", RandomString(16)),
	fmt.Sprintf("%s.json", RandomString(16)),
}

// BaseCalculateFiltering send couple of requests first to do filtering later
func BaseCalculateFiltering(job *libs.Job, options libs.Options) {
	utils.DebugF("Start Calculate Basic Filtering: %s", job.URL)
	// generated base calculate inputs first
	var baseFilteringURLs []string
	for _, filterPath := range baseFiltering {
		baseFilteringURLs = append(baseFilteringURLs, utils.JoinURL(job.URL, filterPath))
	}
	baseFilteringURLs = funk.UniqString(baseFilteringURLs)

	for _, filteringURL := range baseFilteringURLs {
		var req libs.Request
		req.Method = "GET"
		req.EnableChecksum = true
		req.URL = filteringURL

		res, err := sender.JustSend(options, req)
		// in case of timeout or anything, just ignore it
		if err != nil {
			return
		}

		// store the base result for local analyze if input is not a file
		if (req.URL == job.URL) || (req.URL == fmt.Sprintf("%s/", job.URL)) {
			job.Sign.Response = res
		}

		if res.Checksum != "" {
			utils.DebugF("[Checksum] %s - %s", req.URL, res.Checksum)
			job.Checksums = append(job.Checksums, res.Checksum)
		}
	}
	job.Checksums = funk.UniqString(job.Checksums)
}

func CalculateFiltering(job *libs.Job, options libs.Options) {
	var filteringPaths []string

	// ignore the base result if enabled from signature
	if job.Sign.OverrideFilerPaths {
		job.Sign.Checksums = []string{}
	} else {
		// mean doesn't have --fi in cli
		if len(job.Sign.Checksums) == 0 {
			filteringPaths = append(filteringPaths, baseFiltering...)
		}
	}
	if len(job.Sign.FilteringPaths) > 0 {
		filteringPaths = append(filteringPaths, job.Sign.FilteringPaths...)
	}

	if len(filteringPaths) == 0 {
		return
	}
	utils.DebugF("Start Calculate Custom Filtering: %s", job.URL)
	var FilteringURLs []string
	for _, filterPath := range filteringPaths {
		FilteringURLs = append(FilteringURLs, utils.JoinURL(job.URL, filterPath))
	}
	FilteringURLs = funk.UniqString(FilteringURLs)

	for _, filteringURL := range FilteringURLs {
		var req libs.Request
		req.Method = "GET"
		req.EnableChecksum = true
		req.URL = filteringURL

		res, err := sender.JustSend(options, req)
		// in case of timeout or anything
		if err != nil {
			return
		}

		// store the base result for local analyze if input is not a file
		if (req.URL == job.URL) || (req.URL == fmt.Sprintf("%s/", job.URL)) {
			job.Sign.Response = res
		}

		if res.Checksum != "" {
			utils.DebugF("[Checksum] %s - %s", req.URL, res.Checksum)
			job.Sign.Checksums = append(job.Sign.Checksums, res.Checksum)
		}
	}

	job.Sign.Checksums = funk.UniqString(job.Sign.Checksums)
}

func LocalFileToResponse(job *libs.Job) {
	if !utils.FileExists(job.URL) {
		return
	}
	utils.DebugF("Parsing %s to response", job.URL)

	// @TODO: add burp format here too
	content := utils.GetFileContent(job.URL)
	var res libs.Response

	res.Body = content
	res.Beautify = content

	job.Sign.Response = res
	job.Sign.Local = true
}

repository: sec-js/jaeles

repo_name: sec-js/jaeles


text:
package main

import (
	"database/sql"
	"encoding/json"
	"fmt"
	"os"
)

func getExportData(db *sql.DB) []byte {
	tracks := getAllTracks(db)

	data, err := json.MarshalIndent(tracks, "", "  ")
	if err != nil {
		fmt.Println("Unable to marshal shit, yo", err)
	}

	jsonFile := os.ExpandEnv("${HOME}/.traktor-charts.json")
	fp, err := os.Create(jsonFile)
	if err != nil {
		fmt.Println("Unable to create", jsonFile)
	}
	defer fp.Close()

	fp.Write(data)

	fmt.Println("JSON output is in ~/.traktor-charts.json.")

	fp.Sync()
	return data
}

repository: atmos/traktor-charts

repo_name: atmos/traktor-charts


text:
package inttoroman

import (
	"fmt"
	"testing"
)

var intRomanMap = map[int]string{3: "III", 4: "IV", 9: "IX", 10: "X", 100: "C", 1000: "M", 58: "LVIII", 1994: "MCMXCIV", 3888: "MMMDCCCLXXXVIII"}

func TestIntToRoman(t *testing.T) {
	for k, v := range intRomanMap {
		if intToRoman2(k) != v {
			t.Error(fmt.Sprintf("%d Error", k))
		}
	}
}

repository: smm-goddess/leetcode

repo_name: smm-goddess/leetcode


text:
package log

import (
	"fmt"
	"log"
	"os"
	"path/filepath"
	"time"
)

// LogDebug determines whether debug logs should be output or not.
var LogDebug bool

// LogOutput is the file logs are written to.
var LogOutput *os.File

var logger *log.Logger
var logsDirectory string
var currentDay int

// Startup initialises the package.
func Startup(logOutput *os.File, logPrefix string, logDebug bool) error {
	LogDebug = logDebug
	LogOutput = logOutput

	var err error
	logsDirectory, err = filepath.Abs(filepath.Dir(logOutput.Name()))
	if err != nil {
		return err
	}

	currentDay = time.Now().Day()

	logger = &log.Logger{}
	logger.SetPrefix(logPrefix)
	logger.SetOutput(LogOutput)

	return nil
}

// Info writes an info log.
func Info(message string) {
	writeLog(Data{
		Level:   "[INFO ] ",
		Message: "[" + message + "]",
	})
}

// Infof writes an info log with arguments.
func Infof(message string, args ...interface{}) {
	writeLog(Data{
		Level:   "[INFO ] ",
		Message: fmt.Sprintf("["+message+"]", args...),
	})
}

// Error writes an error log.
func Error(message string) {
	writeLog(Data{
		Level:   "[ERROR] ",
		Message: "[" + message + "]",
	})
}

// Errorf writes an error log with arguments.
func Errorf(message string, args ...interface{}) {
	writeLog(Data{
		Level:   "[ERROR] ",
		Message: fmt.Sprintf("["+message+"]", args...),
	})
}

// Debug writes a debug log.
func Debug(message string) {
	if !LogDebug {
		return
	}

	writeLog(Data{
		Level:   "[DEBUG] ",
		Message: "[" + message + "]",
	})
}

// Debugf writes a debug log with arguments.
func Debugf(message string, args ...interface{}) {
	if !LogDebug {
		return
	}

	writeLog(Data{
		Level:   "[DEBUG] ",
		Message: fmt.Sprintf("["+message+"]", args...),
	})
}

func writeLog(data Data) {
	logger.Println(data.Level + data.Message)

	if currentDay != time.Now().Day() && LogOutput != os.Stdout {
		oldLogFile := LogOutput
		defer oldLogFile.Close()

		logFile, _ := os.OpenFile(logsDirectory+"/"+time.Now().Format("2006-01-02.log"), os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0644)
		logger.SetOutput(logFile)

		currentDay = time.Now().Day()
	}
}

repository: FetchWeb/Log

repo_name: FetchWeb/Log


text:
DESCRIPTION = "QCOM Firmware for DragonBoard 845c"

LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://LICENSE.qcom.txt;md5=cbbe399f2c983ad51768f4561587f000"

SRC_URI = "https://releases.linaro.org/96boards/dragonboard845c/qualcomm/firmware/RB3_firmware_${PV}.zip"
SRC_URI[md5sum] = "ad69855a1275547b16d94a1b5405ac62"
SRC_URI[sha256sum] = "4289d2f2a7124b104d0274879e702aae9b1e50c42eec3747f8584c6744ef65e3"

COMPATIBLE_MACHINE = "(dragonboard-845c)"
PACKAGE_ARCH = "${MACHINE_ARCH}"

S = "${WORKDIR}"

do_compile() {
	:
}

do_install() {
    install -d ${D}${nonarch_base_libdir}/firmware/
    install -d ${D}${nonarch_base_libdir}/firmware/qcom/venus-5.2/
    install -d ${D}${nonarch_base_libdir}/firmware/qcom/sdm845

    install -m 0444 ./17-USB3-201-202-FW/K2026090.mem ${D}${nonarch_base_libdir}/firmware/
    install -m 0444 ./18-adreno-fw/a630*.* ${D}${nonarch_base_libdir}/firmware/
    install -m 0444 ./20-adsp_split/firmware/adsp*.* ${D}${nonarch_base_libdir}/firmware/qcom/sdm845
    install -m 0444 ./21-cdsp_split/firmware/cdsp*.* ${D}${nonarch_base_libdir}/firmware/qcom/sdm845
    install -m 0444 ./33-venus_split/venus.* ${D}${nonarch_base_libdir}/firmware/qcom/venus-5.2/
    install -m 0444 ./37-wlan_FW/wlanmdsp.mbn ${D}${nonarch_base_libdir}/firmware/
    install -m 0444 ./38-bdwlan_split/bdwlan*.* ${D}${nonarch_base_libdir}/firmware/

    install -d ${D}${sysconfdir}/
    install -m 0644 LICENSE.qcom.txt ${D}${sysconfdir}/QCOM-LINUX-BOARD-SUPPORT-LICENSE
}

FILES_${PN} += "${nonarch_base_libdir}/firmware/*"
INSANE_SKIP_${PN} += "arch"

RPROVIDES_${PN} += "linux-firmware-qcom-adreno-a630"
RREPLACES_${PN} += "linux-firmware-qcom-adreno-a630"
RCONFLICTS_${PN} += "linux-firmware-qcom-adreno-a630"

RPROVIDES_${PN} += "linux-firmware-qcom-venus-5.2"
RREPLACES_${PN} += "linux-firmware-qcom-venus-5.2"
RCONFLICTS_${PN} += "linux-firmware-qcom-venus-5.2"

RPROVIDES_${PN} += "linux-firmware-qcom-license"
RREPLACES_${PN} += "linux-firmware-qcom-license"
RCONFLICTS_${PN} += "linux-firmware-qcom-license"

repository: khasim/meta-qcom

repo_name: khasim/meta-qcom


text:
/*

Package internal segments off things that must be public for serialization
but have no place in the main documentation.

Some types are replicated as they can't be imported from the main reign
package due to circular imports.

*/
package internal

import (
	"encoding/gob"
)

func init() {
	var anc AllNodeClaims
	var _ ClusterMessage = (*AllNodeClaims)(nil)
	gob.Register(&anc)

	var dc DestroyConnection
	var _ ClusterMessage = (*DestroyConnection)(nil)
	gob.Register(&dc)

	var imm IncomingMailboxMessage
	var _ ClusterMessage = (*IncomingMailboxMessage)(nil)
	gob.Register(&imm)

	var nnot NotifyNodeOnTerminate
	var _ ClusterMessage = (*NotifyNodeOnTerminate)(nil)
	gob.Register(&nnot)

	var nr NotifyRemote
	var _ ClusterMessage = (*NotifyRemote)(nil)
	gob.Register(&nr)

	var omm OutgoingMailboxMessage
	var _ ClusterMessage = (*OutgoingMailboxMessage)(nil)
	gob.Register(&omm)

	var ph PanicHandler
	var _ ClusterMessage = (*PanicHandler)(nil)
	gob.Register(&ph)

	var ping Ping
	var _ ClusterMessage = (*Ping)(nil)
	gob.Register(&ping)

	var pong Pong
	var _ ClusterMessage = (*Pong)(nil)
	gob.Register(&pong)

	var rn RegisterName
	var _ ClusterMessage = (*RegisterName)(nil)
	gob.Register(&rn)

	var rm RegistryMailbox
	var _ ClusterMessage = (*RegistryMailbox)(nil)
	gob.Register(&rm)

	var rs RegisterRemoteNode
	var _ ClusterMessage = (*RegisterRemoteNode)(nil)
	gob.Register(&rs)

	var rmt RemoteMailboxClosed
	var _ ClusterMessage = (*RemoteMailboxClosed)(nil)
	gob.Register(&rmt)

	var rnnot RemoveNotifyNodeOnClose
	var _ ClusterMessage = (*RemoveNotifyNodeOnClose)(nil)
	gob.Register(&rnnot)

	var ur UnnotifyRemote
	var _ ClusterMessage = (*UnnotifyRemote)(nil)
	gob.Register(&ur)

	var um UnregisterMailbox
	var _ ClusterMessage = (*UnregisterMailbox)(nil)
	gob.Register(&um)

	var un UnregisterName
	var _ ClusterMessage = (*UnregisterName)(nil)
	gob.Register(&un)
}

// ClusterHandshake is part of the cluster connection process.
// This type is sent directly.  Therefore, it does not need to
// implement the ClusterMessage interface, nor be registered with
// gob.
type ClusterHandshake struct {
	ClusterVersion uint16
	MyNodeID       IntNodeID
	YourNodeID     IntNodeID
}

// IntNodeID reflects the NodeID type in the main package.
type IntNodeID byte

// IntMailboxID reflects the internal mailboxID type.
type IntMailboxID uint64

// NodeID returns the node ID corresponding to the current mailbox ID.
func (mID IntMailboxID) NodeID() IntNodeID {
	return IntNodeID(mID & 255)
}

// ClusterMessage is a tag used to identify messages the cluster can send
// across the wire.
type ClusterMessage interface {
	isClusterMessage()
}

// AllNodeClaims is part of the internal registry's private communication.
type AllNodeClaims struct {
	Node   IntNodeID
	Claims map[string]map[IntMailboxID]struct{}
}

func (anc *AllNodeClaims) isClusterMessage() {}

// DestroyConnection is used internally to simulate connection loss.
type DestroyConnection struct{}

func (dc DestroyConnection) isClusterMessage() {}

// IncomingMailboxMessage indicates the embedded message is destined for a local mailbox.
type IncomingMailboxMessage struct {
	Target  IntMailboxID
	Message interface{}
}

func (imm IncomingMailboxMessage) isClusterMessage() {}

// NotifyNodeOnTerminate is an internal message, public only for
// gob's sake.
type NotifyNodeOnTerminate struct {
	IntMailboxID
}

func (nnot *NotifyNodeOnTerminate) isClusterMessage() {}

// NotifyRemote is an internal message, public only for gob's sake.
type NotifyRemote struct {
	Local  IntMailboxID
	Remote IntMailboxID
}

func (lr NotifyRemote) isClusterMessage() {}

// OutgoingMailboxMessage indicates that this wraps an outgoing message.
type OutgoingMailboxMessage struct {
	Target  IntMailboxID
	Message interface{}
}

func (omm OutgoingMailboxMessage) isClusterMessage() {}

// PanicHandler can be sent over the network to cause the receiver
// to panic, simulating whatever may end up doing that.
type PanicHandler struct{}

func (ph PanicHandler) isClusterMessage() {}

// Ping is sent in order to keep the network connection open.
type Ping struct{}

func (p Ping) isClusterMessage() {}

// Pong is sent in reply to a Ping message.  When received, the connection
// deadline is progressed.
type Pong struct{}

func (p Pong) isClusterMessage() {}

// RegisterName is part of the internal registry's private communication.
type RegisterName struct {
	Node      IntNodeID
	Name      string
	MailboxID IntMailboxID
}

func (rn *RegisterName) isClusterMessage() {}

// RegistryMailbox is sent between node registries to populate their
// nodeRegistries map.
type RegistryMailbox struct {
	Node      IntNodeID
	MailboxID IntMailboxID
}

func (rm *RegistryMailbox) isClusterMessage() {}

// RegisterRemoteNode is part of the internal registry's private communication.
type RegisterRemoteNode struct {
	Node      IntNodeID
	MailboxID IntMailboxID
}

func (rs *RegisterRemoteNode) isClusterMessage() {}

// RemoteMailboxClosed is an internal message, public only for gob's
// sake.
type RemoteMailboxClosed struct {
	IntMailboxID
}

func (rmt *RemoteMailboxClosed) isClusterMessage() {}

// RemoveNotifyNodeOnClose is an internal message, public only for
// gob's sake.
type RemoveNotifyNodeOnClose struct {
	IntMailboxID
}

func (rnnot *RemoveNotifyNodeOnClose) isClusterMessage() {}

// UnnotifyRemote is an internal message, public only for gob's sake.
type UnnotifyRemote struct {
	Local  IntMailboxID
	Remote IntMailboxID
}

func (ur UnnotifyRemote) isClusterMessage() {}

// UnregisterMailbox is part of the internal registry's private communication.
type UnregisterMailbox struct {
	Node      IntNodeID
	MailboxID IntMailboxID
}

func (um *UnregisterMailbox) isClusterMessage() {}

// UnregisterName is part of the internal registry's private communication.
type UnregisterName struct {
	Node      IntNodeID
	Name      string
	MailboxID IntMailboxID
}

func (un *UnregisterName) isClusterMessage() {}

repository: awoodbeck/reign

repo_name: awoodbeck/reign


text:
require gssdp.inc

SRC_URI = "http://download.gnome.org/sources/${BPN}/0.12/${BPN}-${PV}.tar.xz"
SRC_URI[md5sum] = "8ac3a544ef0dcf8caaf7c249d2a50dc2"
SRC_URI[sha256sum] = "928aa257815d044fdbfc740f5799530d41897947b5d7854173f636b36d728414"


text:
// Copyright (c) OpenFaaS Author(s) 2019. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

package handlers

import (
	"encoding/json"
	"io/ioutil"
	"net/http"

	log "github.com/sirupsen/logrus"

	typesv1 "github.com/openfaas/faas-provider/types"
)

var functions = map[string]*typesv1.FunctionStatus{}

// MakeDeployHandler creates a handler to create new functions in the cluster
func MakeDeployHandler() http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {

		log.Info("deployment request")
		defer r.Body.Close()

		body, _ := ioutil.ReadAll(r.Body)

		request := typesv1.FunctionDeployment{}
		if err := json.Unmarshal(body, &request); err != nil {
			log.Errorln("error during unmarshal of create function request. ", err)
			w.WriteHeader(http.StatusBadRequest)
			return
		}

		functions[request.Service] = requestToStatus(request)

		log.Infof("deployment request for function %s", request.Service)

		w.WriteHeader(http.StatusOK)
	}
}

repository: openfaas-incubator/faas-memory

repo_name: openfaas-incubator/faas-memory


text:
@inproceedings{yongshan2020contextual,
 author = {Yong Shan, Zekang Li, Jinchao Zhang, Fandong Meng, Yang Feng, Cheng Niu, Jie Zhou},
 booktitle = {Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
 title = {A Contextual Hierarchical Attention Network with Adaptive Objective for Dialogue State Tracking},
 volume = {1},
 year = {2020}
}

repository: lizekang/academic-website

repo_name: lizekang/academic-website


text:
// Copyright 2018 Bull S.A.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package internal

import (
	"context"
	"path"
	"strings"

	"github.com/ystia/yorc/v3/helper/consulutil"
	"github.com/ystia/yorc/v3/tosca"
)

// storePolicies stores topology policies
func storePolicies(ctx context.Context, consulStore consulutil.ConsulStore, topology tosca.Topology, topologyPrefix string) {
	nodesPrefix := path.Join(topologyPrefix, "policies")
	for _, policyMap := range topology.TopologyTemplate.Policies {
		for policyName, policy := range policyMap {
			nodePrefix := nodesPrefix + "/" + policyName
			consulStore.StoreConsulKeyAsString(nodePrefix+"/type", policy.Type)

			if policy.Targets != nil {
				targetPrefix := nodePrefix + "/targets"
				consulStore.StoreConsulKeyAsString(targetPrefix, strings.Join(policy.Targets, ","))
			}
			storeMapValueAssignment(consulStore, path.Join(nodePrefix, "properties"), policy.Properties)
			metadataPrefix := nodePrefix + "/metadata/"
			for metaName, metaValue := range policy.Metadata {
				consulStore.StoreConsulKeyAsString(metadataPrefix+metaName, metaValue)
			}
		}
	}
}

// storePolicyTypes stores topology policy types
func storePolicyTypes(ctx context.Context, consulStore consulutil.ConsulStore, topology tosca.Topology, topologyPrefix, importPath string) {
	for policyName, policyType := range topology.PolicyTypes {
		key := path.Join(topologyPrefix, "types", policyName)
		storeCommonType(consulStore, policyType.Type, key, importPath)
		consulStore.StoreConsulKeyAsString(key+"/name", policyName)
		propertiesPrefix := key + "/properties"
		for propName, propDefinition := range policyType.Properties {
			propPrefix := propertiesPrefix + "/" + propName
			storePropertyDefinition(ctx, consulStore, propPrefix, propName, propDefinition)
		}
		consulStore.StoreConsulKeyAsString(key+"/targets", strings.Join(policyType.Targets, ","))
	}
}

repository: motiteux/yorc

repo_name: motiteux/yorc


text:
// Code generated by entc, DO NOT EDIT.

package predicate

import (
	"github.com/facebook/ent/dialect/sql"
)

// Account is the predicate function for account builders.
type Account func(*sql.Selector)

// Campaign is the predicate function for campaign builders.
type Campaign func(*sql.Selector)

// Organization is the predicate function for organization builders.
type Organization func(*sql.Selector)

license: ISC

repository: wahello/srvgql

repo_name: wahello/srvgql


text:
DESCRIPTION = "A frontend for the nmap port scanner, Qt/Embedded based Palmtop Environments Edition"
SECTION = "opie/applications"
PRIORITY = "optional"
LICENSE = "GPL"
AUTHOR = "Dennis Webb"
APPNAME = "qpenmapfe"
APPTYPE = "binary"
APPDESKTOP = "${WORKDIR}"
PR = "r0"

SRC_URI = "http://home.midsouth.rr.com/zaurus/qpenmapfe_${PV}_src.tar.gz \
           file://qpenmapfe.desktop \
           file://qpenmapfe.png"
S = "${WORKDIR}/qpe-nmapfe"

inherit opie

do_install () {
	install -d ${D}${palmtopdir}/pics/${APPNAME}/
	install -m 0644 ${WORKDIR}/*.png ${D}${palmtopdir}/pics/

}

SRC_URI[md5sum] = "6e913e436a7b0f7572ec1ac77db41fde"
SRC_URI[sha256sum] = "ded3abdab8333aaf7f451963f32465ca1451a38afb173ef64e0f898d907a6e02"