text:
SUMMARY = "Platform support library used by libCEC and binary add-ons for Kodi"
HOMEPAGE = "http://libcec.pulse-eight.com/"

LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://src/util/XMLUtils.cpp;beginline=2;endline=18;md5=dae8e846500e70dd8ecee55f3f018c30"

DEPENDS = "libtinyxml kodi"

PV = "16.0.0"

SRCREV = "15edaf78d6307eaa5e1d17028122d8bce9d55aa2"
SRC_URI = "git://github.com/xbmc/kodi-platform.git \
           file://0001-Fix-build-after-platform-rename.patch \
           file://0001-fix-cross-compile-badness.patch \
           file://kodi-platform-02_no-multi-lib.patch \
          "

S = "${WORKDIR}/git"

inherit cmake

EXTRA_OECMAKE = " -DCMAKE_INSTALL_PREFIX_TOOLCHAIN=${STAGING_DIR_TARGET} "

do_compile_prepend() {
	sed -i -e 's:I/usr/include:I${STAGING_INCDIR}:g' \
	       -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g' \
	          ${B}/CMakeFiles/kodiplatform.dir/flags.make
	sed -i -e 's:-pipe:${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} -pipe:g'\
	          ${B}/CMakeFiles/kodiplatform.dir/link.txt
}

do_install_append() {
	install -d ${D}${libdir}
 	mv ${D}/pkgconfig ${D}${libdir}
	mv ${D}/kodiplatform ${D}${libdir}
}

RPROVIDES_${PN} += "libkodiplatform"
FILES_${PN}-dev += "${libdir}/*platform"

repository: rofehr/meta-dominion

repo_name: rofehr/meta-dominion


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

package main

import (
	"bytes"
	"fmt"
	"log"
	"net/http"
	os "os"

	ocagent "contrib.go.opencensus.io/exporter/ocagent"
	"go.opencensus.io/plugin/ochttp"
	"go.opencensus.io/plugin/ochttp/propagation/tracecontext"
	"go.opencensus.io/trace"
)

func main() {
	// Register trace exporters to export the collected data.
	serviceName := os.Getenv("SERVICE_NAME")
	if len(serviceName) == 0 {
		serviceName = "go-app"
	}
	agentEndpoint := os.Getenv("OCAGENT_TRACE_EXPORTER_ENDPOINT")
	if len(agentEndpoint) == 0 {
		agentEndpoint = fmt.Sprintf("%s:%d", ocagent.DefaultAgentHost, ocagent.DefaultAgentPort)
	}

	exporter, err := ocagent.NewExporter(ocagent.WithInsecure(), ocagent.WithServiceName(serviceName), ocagent.WithAddress(agentEndpoint))
	if err != nil {
		log.Fatalf("Failed to create the agent exporter: %v", err)
	}

	trace.RegisterExporter(exporter)

	trace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()})

	client := &http.Client{Transport: &ochttp.Transport{Propagation: &tracecontext.HTTPFormat{}}}

	http.HandleFunc("/call_aspnetcore_app", func(w http.ResponseWriter, req *http.Request) {
		fmt.Fprintf(w, "hello world from %s", serviceName)

		var jsonStr = []byte(`[ { "url": "http://blank.org", "arguments": [] } ]`)
		r, _ := http.NewRequest("POST", "http://aspnetcore-app/api/forward", bytes.NewBuffer(jsonStr))
		r.Header.Set("Content-Type", "application/json")

		// Propagate the trace header info in the outgoing requests.
		r = r.WithContext(req.Context())
		resp, err := client.Do(r)
		if err != nil {
			log.Println(err)
		} else {
			// TODO: handle response
			resp.Body.Close()
		}
	})
	log.Fatal(http.ListenAndServe(":50030", &ochttp.Handler{Propagation: &tracecontext.HTTPFormat{}}))
}

license: MIT

repository: lmolkova/oc-ai-demo

license_type: permissive

repo_name: lmolkova/oc-ai-demo

branch_name: refs/heads/master

extension: go


text:
// leetcode problem 347
// Top K Frequent Elements
package main

import (
	"fmt"
)

type HeapNode struct {
	Num int
	Fre int
}

func topKFrequent(nums []int, k int) []int {
    freMap := make(map[int]int)
    length := len(nums)
    for i := 0; i < length; i++ {
        freMap[nums[i]]++
		}
		nodes := []HeapNode{}
		for index, value := range freMap {
			nodes = append(nodes,HeapNode{Num: index, Fre: value,})
		}
		heap := &Heap{data: nodes}
		fmt.Println(heap.data)
		length = len(nodes)
		for lastIndex := (length-2)/2; lastIndex >= 0; lastIndex-- {
			heap.SiftDown(lastIndex)
			fmt.Println(heap.data)
		}
		// fmt.Println(heap.data)
		arr := []int{}
		for i:=0; i < k; i++ {
			arr = append(arr, heap.RemoveMax().Num)
		}
		return arr
}

func main() {
	nums := []int{5,-3,9,1,7,7,9,10,2,2,10,10,3,-1,3,7,-9,-1,3,3}
	res := topKFrequent(nums, 3)
	fmt.Println(res)
}

type Heap struct {
	data []HeapNode
}

func (h *Heap) Parent(index int) int {
	return (index - 1) / 2
}

func (h *Heap) LeftChild(index int) int {
	return index * 2 + 1
}

func (h *Heap) RightChild(index int) int {
	return index * 2 + 2
}

func (h *Heap) Add(node HeapNode) {
	h.data = append(h.data, node)
	h.SiftUp()
}

func (h *Heap) SiftUp() {
	curIndex := len(h.data) - 1
	curNode := h.data[curIndex]
	for ; curIndex > 0; {
		parentIndex := h.Parent(curIndex)
		parent := h.data[parentIndex]
		if curNode.Fre > parent.Fre {
			h.swap(curIndex, parentIndex)
			curIndex = parentIndex
		}
		break
	}
}

func (h *Heap) FindMax() HeapNode {
	return h.data[0]
}

func (h *Heap) RemoveMax() HeapNode {
	node := h.FindMax()
	if len(h.data) != 1 {
		lastIndex := len(h.data) - 1
		h.swap(lastIndex, 0)
		h.data = h.data[:len(h.data)-1]
		h.SiftDown(0)
	}

	return node
}

func (h *Heap) swap(index1 int, index2 int) {
	temp := h.data[index1]
	h.data[index1] = h.data[index2]
	h.data[index2] = temp
}

func (h *Heap) SiftDown(index int) {
	curIndex := index
	curNode := h.data[curIndex]
	length := len(h.data)
	for ; h.LeftChild(curIndex) < length; {
		maxIndex := h.LeftChild(curIndex)
		left := h.data[maxIndex]
		if maxIndex + 1 < length && left.Fre < h.data[maxIndex+1].Fre {
			maxIndex++
		}
		if curNode.Fre < h.data[maxIndex].Fre {
			h.swap(curIndex, maxIndex)
			curIndex = maxIndex
		} else {
			break
		}
	}
}

repository: temple-deng/leetcode

repo_name: temple-deng/leetcode


text:
package store

import "time"

// Post represents a Post entity
type Post struct {
	GraphNode

	ID        ID
	Creation  time.Time
	Author    *User
	Title     string
	Contents  string
	Reactions []Reaction
}

gha_license_id: MIT

gha_language: Go


text:
DESCRIPTION = "Music composition program in the style of AMIGA Impulse Tracker"
DEPENDS = "gtk+-1.2"
LICENSE = "GPL"
SECTION = "x11/multimedia"
MAINTAINER = "Michael 'Mickey' Lauer <mickey@Vanille.de>"
SRC_URI = "http://www.soundtracker.org/dl/v0.6/soundtracker-${PV}.tar.gz \
           file://remove-chown.patch;patch=1"

inherit autotools

EXTRA_OECONF = "--disable-asm"

do_configure() {
	oe_runconf
}

repository: Terentyev/familiar-linux

repo_name: Terentyev/familiar-linux

extension: bb


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

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

@article{Zenodo2020,
author = {Russell, W Alton},
doi = {10.5281/zenodo.4068495},
journal = {Zenodo},
month = {oct},
title = {{Code and data repository for estimating rate of adverse outcomes from transfusion-transmitted Zika in the 50 U.S. states}},
url = {doi.ogr/10.5281/zenodo.4068495},
year = {2020}
}
@misc{BPAC2019,
address = {Silver Spring},
author = {{U.S. Food and Drug Administration Center for Biologics Evaluation and Research}},
file = {::},
institution = {U.S. Food and Drug Administration},
keywords = {2019 Meeting Transcript- Topic 1,Biologics,Blood Products Advisory Committee March 20,CBER},
month = {mar},
title = {{Transcript of the March 20 Blood Products Advisory Committee meeting; topic I: evaluating strategies to reduce the risk of Zika virus transmission by blood and blood components}},
url = {www.fda.gov/media/128648/download},
urldate = {2020-12-20},
year = {2019}
}
@misc{CDC_ZIKV2020,
author = {{Centers for Disease Control and Prevention National Center for Emerging and Zoonotic Diseases}},
month = {apr},
title = {{Zika virus statistics and maps}},
url = {https://www.cdc.gov/zika/reporting/index.html},
urldate = {2020-12-20},
year = {2020}
}
@article{Longo2019,
abstract = {T h e ne w e ngl a nd jou r na l o f m e dicine n engl j med 381;15 nejm. Z ika virus (ZIKV) was discovered in Africa in 1947 and was first detected in Asia in 1966, yet its potential effect on public health was not recognized until the virus caused outbreaks in the Pacific from 2007 to 2015 and began spreading throughout the Americas in 2015. 1,2 The ability of ZIKV to cause congenital defects in fetuses and infants, as exemplified by the microcephaly epidemic in Brazil, is an unprecedented feature in a mosquito-borne viral infection. 2-4 Although transmission of ZIKV has declined in the Americas, outbreaks and infection clusters continue to occur in some regions, such as India and Southeast Asia, where there are large populations of women of childbearing age who are susceptible to the virus. 5 We review the body of information that was acquired during the pandemic and discuss the epidemiologic trends, current knowledge about the transmission and natural history of ZIKV infection and its sequelae, and the principles of diagnosis and clinical management. Epidemiol ogic Fe at ur es ZIKV is a positive-sense RNA flavivirus in the family Flaviviridae, which also includes dengue (DENV), West Nile, yellow fever, and Japanese encephalitis viruses. 6 ZIKV was first isolated in 1947 in the Zika Forest in Uganda (Fig. 1), 7 where transmission of the ancestral African lineage of ZIKV was limited to enzootic circulation between nonhuman primates and sylvatic aedes mosquitoes, with sporadic spillover infection to humans. 2 As ZIKV migrated to Asia, the Asian lineage of the virus emerged (Fig. 2), which was capable of being transmitted by human-adapted aedes mosquitoes (e.g., Aedes aegypti). 1,2 Results of serologic and entomologic investigations suggest that ZIKV had an extensive geographic distribution in Africa and Asia before 2007. 1,9 However, fewer than 20 cases in humans were reported before 2007, and all had mild, self-limiting clinical manifestations. 1,2,10 The first indications of a change in the epidemiology of ZIKV were the outbreaks reported in the Pacific in the Yap Islands, Micronesia, in 2007 and French Polyne-sia in 2013 and 2014, which were followed by pandemic spread of the virus to the Figure 1 (facing page). Emergence and Spread of ZIKV and Timeline of the Zika Virus Pandemic. Panel A shows the major epidemiologic events in the emergence and spread of Zika virus (ZIKV) from its discovery in 1947 through 2018, including outbreaks during which cases of ZIKV-associated birth defects were identified in newborns (*). Panel B is a map of regions where confirmed cases of ZIKV infections have occurred from 2007 through 2018 (red) and areas where Aedes aegypti is endemic but where ZIKV had not yet been identified (pink) as of 2018. Also shown is the migration of African (blue arrow) and Asian (purple arrows) lineages of ZIKV during its global emergence. The epidemiologic events associated with the spread of ZIKV are described in detail in Figure S1 and Table S1 in the Supplementary Appendix.},
author = {Longo, Dan L and Musso, Didier and Ko, Albert I and Baud, David},
doi = {10.1056/NEJMra1808246},
file = {::},
journal = {N Engl J Med},
pages = {1444--57},
title = {{Zika Virus Infection-After the Pandemic}},
volume = {381},
year = {2019}
}
@article{Kobres2019,
abstract = {Introduction Epidemic forecasting and prediction tools have the potential to provide actionable information in the midst of emerging epidemics. While numerous predictive studies were published during the 2016–2017 Zika Virus (ZIKV) pandemic, it remains unknown how timely, reproducible, and actionable the information produced by these studies was. Methods To improve the functional use of mathematical modeling in support of future infectious disease outbreaks, we conducted a systematic review of all ZIKV prediction studies published during the recent ZIKV pandemic using the PRISMA guidelines. Using MEDLINE, EMBASE, and grey literature review, we identified studies that forecasted, predicted, or simulated ecological or epidemiological phenomena related to the Zika pandemic that were published as of March 01, 2017. Eligible studies underwent evaluation of objectives, data sources, methods, timeliness, reproducibility, accessibility, and clarity by independent reviewers. Results 2034 studies were identified, of which n = 73 met the eligibility criteria. Spatial spread, R0 (basic reproductive number), and epidemic dynamics were most commonly predicted, with few studies predicting Guillain-Barr{\'{e}} Syndrome burden (4{\%}), sexual transmission risk (4{\%}), and intervention impact (4{\%}). Most studies specifically examined populations in the Americas (52{\%}), with few African-specific studies (4{\%}). Case count (67{\%}), vector (41{\%}), and demographic data (37{\%}) were the most common data sources. Real-time internet data and pathogen genomic information were used in 7{\%} and 0{\%} of studies, respectively, and social science and behavioral data were typically absent in modeling efforts. Deterministic models were favored over stochastic approaches. Forty percent of studies made model data entirely available, 29{\%} provided all relevant model code, 43{\%} presented uncertainty in all predictions, and 54{\%} provided sufficient methodological detail to allow complete reproducibility. Fifty-one percent of predictions were published after the epidemic peak in the Americas. While the use of preprints improved the accessibility of ZIKV predictions by a median of 119 days sooner than journal publication dates, they were used in only 30{\%} of studies. Conclusions Many ZIKV predictions were published during the 2016–2017 pandemic. The accessibility, reproducibility, timeliness, and incorporation of uncertainty in these published predictions varied and indicates there is substantial room for improvement. To enhance the utility of analytical tools for outbreak response it is essential to improve the sharing of model data, code, and preprints for future outbreaks, epidemics, and pandemics.},
author = {Kobres, Pei Ying and Chretien, Jean Paul and Johansson, Michael A. and Morgan, Jeffrey J. and Whung, Pai Yei and Mukundan, Harshini and {Del Valle}, Sara Y. and Forshey, Brett M. and Quandelacy, Talia M. and Biggerstaff, Matthew and Viboud, Cecile and Pollett, Simon},
doi = {10.1371/journal.pntd.0007451},
file = {::},
issn = {19352735},
journal = {PLoS Neglected Tropical Diseases},
keywords = {Databases,Disease Outbreaks / statistics {\&} numerical data,Factual,Forecasting*,Guillain-Barre Syndrome / epidemiology,Guillain-Barre Syndrome / virology,Humans,Jean-Paul Chretien,MEDLINE,Models,NCBI,NIH,NLM,National Center for Biotechnology Information,National Institutes of Health,National Library of Medicine,PMC6805005,Pandemics,Pei-Ying Kobres,PubMed Abstract,Public Health*,Reproducibility of Results,Simon Pollett,Statistical,Systematic Review,Theoretical,Zika Virus Infection / epidemiology*,Zika Virus Infection / virology,Zika Virus*,doi:10.1371/journal.pntd.0007451,pmid:31584946},
number = {10},
pmid = {31584946},
publisher = {Public Library of Science},
title = {{A systematic review and evaluation of Zika virus forecasting and prediction research during a public health emergency of international concern}},
url = {https://pubmed.ncbi.nlm.nih.gov/31584946/},
volume = {13},
year = {2019}
}
@article{Russell2019,
abstract = {Background: In 2016, universal individual donation nucleic acid testing (ID-NAT) of donated blood for Zika virus began in U.S. states and territories. Objective: To assess the cost-effectiveness of universal ID-NAT in the first year of screening compared with alternatives for the 50 states and separately for Puerto Rico. Design: Microsimulation that captured Zika-related harms to transfusion recipients, sexual partners, and their infants. Data Sources: National testing results compiled by AABB and costs, utilities, and outcome probabilities estimated from the literature. Target Population: Transfusion recipients. Time Horizon: Lifetime. Perspective: Societal. Intervention: Universal ID-NAT, universal mini-pool NAT (MP-NAT), and ID-NAT exclusively for components transfused to women of childbearing age. Seasonally targeted strategies in Puerto Rico and geographically targeted strategies in the 50 states were also considered. Outcome Measures: Costs, quality-adjusted life-years (QALYs), and outcomes. Results of Base-Case Analysis: In Puerto Rico, MP-NAT exclusively during high mosquito season was cost-effective at {\$}81 123 per QALY (95{\%} CI, {\$}49 138 to {\$}978 242 per QALY). No screening policy was cost-effective in the 50 states. Universal ID-NAT cost {\$}341 million per QALY (CI, {\$}125 million to {\$}2.90 billion per QALY) compared with no screening in the 50 states. Results of Sensitivity Analysis: In Puerto Rico, MP-NAT only during the season of high mosquito activity was most cost-effective in 64{\%} of probabilistic sensitivity analysis iterations. In the 50 states, no intervention was cost-effective in 99.99{\%} of iterations. Cost-effectiveness was highly dependent on the rate of assumed infectious donations. Limitation: Data were limited on the component-specific trans-missibility of Zika and long-term sequelae of infection. Conclusion: Screening was cost-effective only in the high mosquito season in Puerto Rico, and no evaluated screening policy was cost-effective in the 50 states. During periods with lower rates of Zika-infectious donations, the cost-effectiveness of screening will be even less favorable. Primary Funding Source: None.},
author = {Russell, W. Alton and Stramer, Susan L. and Busch, Michael P. and Custer, Brian},
doi = {10.7326/M18-2238},
file = {:C$\backslash$:/Users/alton/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/Russell et al. - 2019 - Screening the Blood Supply for Zika Virus in the 50 U.S. States and Puerto Rico A Cost-Effectiveness Analysis.pdf:pdf},
issn = {15393704},
journal = {Annals of Internal Medicine},
keywords = {arterial,blood supply,cost effectiveness,puerto rico,transfusion,vascular flow,vascular network,zika virus},
number = {3},
pages = {164--174},
pmid = {30615781},
title = {{Screening the blood supply for Zika virus in the 50 U.S. States and Puerto Rico: A cost-effectiveness analysis}},
url = {http://annals.org/aim/fullarticle/2720163/screening-blood-supply-zika-virus-50-u-s-states-puerto},
volume = {170},
year = {2019}
}
@misc{FDAGuidance2018,
abstract = {This guidance is for immediate implementation.},
author = {{U.S. Food and Drug Administration}},
file = {:C$\backslash$:/Users/alton/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/US Food and Drug Adm. - 2018 - Revised Recommendations for Reducing the Risk of Zika Virus Transmission by Blood and Blood Components Gu.pdf:pdf},
title = {{Revised recommendations for reducing the risk of Zika virus transmission by blood and blood components; guidance for industry}},
url = {www.regulations.gov/document?D=FDA-2016-D-0545-0098},
urldate = {2020-12-20},
year = {2018}
}

gha_language: Python

extension: bib


text:
package capability

import (
	"fmt"
	"os"

	check "gopkg.in/check.v1"
)

var _ = check.Suite(&SuiteCapabilities{})

func (s *SuiteCapabilities) TestDefaultAgent(c *check.C) {
	os.Unsetenv("GO_GIT_USER_AGENT_EXTRA")
	ua := DefaultAgent()
	c.Assert(ua, check.Equals, userAgent)
}

func (s *SuiteCapabilities) TestEnvAgent(c *check.C) {
	os.Setenv("GO_GIT_USER_AGENT_EXTRA", "abc xyz")
	ua := DefaultAgent()
	c.Assert(ua, check.Equals, fmt.Sprintf("%s %s", userAgent, "abc xyz"))
}

repository: go-git/go-git

repo_name: go-git/go-git


text:
@incollection{goldstein2014c,
	Address = {Leiden},
	Author = {Goldstein, David M.},
	Booksubtitle = {G--{O}},
	Booktitle = {Encyclopedia of ancient {Greek} language and linguistics},
	Date-Added = {2014-04-02 13:59:23 +0000},
	Date-Modified = {2019-09-16 10:06:28 -0700},
	Doi = {10.1163/2214-448X_eagll_SIM_00000499},
	Editor = {Giannakis, Georgios K.},
	Pages = {468--469},
	Publisher = {Brill},
	Title = {Movable consonants},
	Volume = {2},
	Volumes = {3},
	Year = {2014},
	Bdsk-Url-1 = {https://doi.org/10.1163/2214-448X_eagll_SIM_00000499}}

repository: DMGoldstein/academic

repo_name: DMGoldstein/academic


text:
@online{ CV01,
    author = {Skand Hurkat},
    title  = {CarDetect},
    year   = {2011},
    url    = {https://github.com/skandhurkat/CarDetect}
}

@online{ CV02,
    author = {Liz},
    title  = {Facial recognition: OpenCV on the camera board},
    year   = {2013},
    month  = {June},
    url    = {Facial recognition: OpenCV on the camera board}
}

@online{ CV03,
    author = {UMass Graphics and Vision Research},
    title  = {Realtime Tracking With a Pan-Tilt Camera},
    year   = {2010},
    month  = {July},
    url    = {http://umassgv.blogspot.com.au/2010/07/realtime-tracking-with-pan-tilt-camera.html}
}

@online{ CV04,
    author = {Chet Corcos},
    title  = {Learning OpenCV with Xcode},
    year   = {2012},
    month  = {February},
    url    = {https://sites.google.com/site/learningopencv1/installing-opencv}
}

@online{ CV05,
    author = {Robin Hewitt},
    title  = {How OpenCV's Face Tracker Works},
    year   = {2007},
    month  = {March},
    url    = {http://www.cognotics.com/opencv/servo_2007_series/part_3/sidebar.html}
}

@online{ CV06,
    author = {OpenCV dev team},
    title  = {Cascade Classifier},
    year   = {2013},
    month  = {July},
    url    = {http://docs.opencv.org/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.html}
}

@online{ CV07,
    author = {Evangelos Georgiou},
    title  = {Tutorial: OpenCV 2.4.3 Face Tracking | Detection using VS 2010 C++},
    year   = {2013},
    month  = {February},
    url    = {http://mymobilerobots.com/myblog/academic/tutorial-opencv-2-4-3-face-tracking-detection-using-vs-2010-c/}
}

@online{ CV08,
    author = {Pierre},
    title  = {OpenCV and Pi Camera Board !},
    year   = {2013},
    month  = {May},
    url    = {http://thinkrpi.wordpress.com/2013/05/22/opencv-and-camera-board-csi/}
}

@online{ CV09,
    author = {OpenCV dev team},
    title  = {GPU Module Introduction},
    year   = {2013},
    month  = {July},
    url    = {http://docs.opencv.org/modules/gpu/doc/introduction.html}
}

@online{ CV10,
    author = {Malakai},
    title  = {Raspberry Pi Camera Extended documentation},
    year   = {2013},
    month  = {June},
    url    = {http://www.raspians.com/raspberry-pi-camera-extended-documentation/}
}

@online{ CV11,
    author = {Wikipedia},
    title  = {OpenMAX},
    url    = {http://en.wikipedia.org/wiki/OpenMAX}
}

@online{ CV12,
    author = {Philipp Wagner},
    title  = {OpenCV Face Recognition Lag},
    year   = {2012},
    month  = {October},
    url    = {http://answers.opencv.org/question/3334/opencv-face-recognition-lag/}
}

repository: vly/rpy-dictaphone

repo_name: vly/rpy-dictaphone


text:
file(REMOVE_RECURSE
  "CMakeFiles/LongestConsecutiveSubsequenceInArray.dir/main.cpp.obj"
  "LongestConsecutiveSubsequenceInArray.pdb"
  "LongestConsecutiveSubsequenceInArray.exe"
  "LongestConsecutiveSubsequenceInArray.exe.manifest"
  "libLongestConsecutiveSubsequenceInArray.dll.a"
)

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

extension: cmake


text:
package utils

import (
	"github.com/twinj/uuid"
)

type ErrorValidateResponse struct {
	FailedField string
	Tag         string
	Value       string
}

func ValidateUuid(data string) bool {
	_, err := uuid.Parse(data)

	return err == nil
}

repository: PickHD/bookstore-api

repo_name: PickHD/bookstore-api

branch_name: refs/heads/main


text:
@ARTICLE{Lin2007,
  author = {Chun-Cheng Lin and Hsu-Chun Yen},
  title = {On Balloon Drawings of Rooted Trees},
  journal = {Journal of Graph Algorithms and Applications},
  year = {2007},
  volume = {11},
  pages = {431--452},
  number = {2},
  abstract = {Among various styles of tree drawing reported in the literature, balloon drawing enjoys a desirable feature of displaying tree structures in a rather balanced fashion. Each subtree in the balloon drawing of a tree is enclosed in a circle. Along any path from the root node, the radius of each circle reflects the number of descendants associated with the root node of the subtree. In this paper, we investigate various issues related to balloon drawings of rooted trees from the algorithmic viewpoint. First, we design an efficient algorithm to optimize the angular resolution and the aspect ratio for the balloon drawings of rooted unordered trees. For the case of ordered trees for which the center of the enclosing circle of a subtree need not coincide with the root of the subtree, flipping the drawing of a subtree (along the axis from the parent to the root of the subtree) might change both the aspect ratio and the angular resolution of the drawing. We show that optimizing the angular resolution as well as the aspect ratio with respect to this type of rooted ordered trees is reducible to the perfect matching problem for bipartite graphs, which is solvable in polynomial time. In addition, a related problem concerning the optimization of the drawing area can be modelled as a specific type of nonlinear programming for which there exist several robust algorithms in practice. With a slight modification to the balloon drawing, we are able to generate the drawings of galaxy systems, H-trees, and sparse graphs, which are of practical interest.},
  doi = {10.7155/jgaa.00153}
}

repository: vis-au/treevisnet

repo_name: vis-au/treevisnet

gha_language: TeX


text:
/*
 * SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * SPDX-License-Identifier: Apache-2.0
 *
 * 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 auxnetdevice

import (
	"fmt"

	"github.com/golang/glog"
	"github.com/jaypipes/ghw"

	"github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/devices"
	"github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/infoprovider"
	"github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/types"
	"github.com/k8snetworkplumbingwg/sriov-network-device-plugin/pkg/utils"
)

// auxNetDevice extends HostDevice and embedds GenNetDevice
type auxNetDevice struct {
	types.HostDevice
	devices.GenNetDevice
	auxType string
}

// NewAuxNetDevice returns an instance of AciNetDevice interface
func NewAuxNetDevice(dev *ghw.PCIDevice, deviceID string, rFactory types.ResourceFactory,
	rc *types.ResourceConfig, selectorIndex int) (types.AuxNetDevice, error) {
	var nf *types.AuxNetDeviceSelectors
	driverName, err := utils.GetDriverName(dev.Address)
	if err != nil {
		return nil, err
	}

	infoProviders := rFactory.GetDefaultInfoProvider(deviceID, driverName)
	isRdma := false
	ok := false
	if selectorIndex >= 0 && selectorIndex < len(rc.SelectorObjs) {
		nf, ok = rc.SelectorObjs[selectorIndex].(*types.AuxNetDeviceSelectors)
	}
	if ok {
		if nf.IsRdma {
			rdmaSpec := rFactory.GetRdmaSpec(types.AuxNetDeviceType, deviceID)
			if rdmaSpec.IsRdma() {
				isRdma = true
				infoProviders = append(infoProviders, infoprovider.NewRdmaInfoProvider(rdmaSpec))
			} else {
				glog.Warningf("RDMA resources for %s not found. Are RDMA modules loaded?", deviceID)
			}
		}
	}

	hostDev, err := devices.NewHostDeviceImpl(dev, deviceID, rFactory, rc, infoProviders)
	if err != nil {
		return nil, err
	}

	netDev, err := devices.NewGenNetDevice(deviceID, types.AuxNetDeviceType, isRdma)
	if err != nil {
		return nil, err
	}

	auxType := utils.ParseAuxDeviceType(deviceID)
	if auxType == "" {
		return nil, fmt.Errorf("device ID %s doesn't represent auxuliary device", deviceID)
	}

	return &auxNetDevice{
		HostDevice:   hostDev,
		GenNetDevice: *netDev,
		auxType:      auxType,
	}, nil
}

func (ad *auxNetDevice) GetAuxType() string {
	return ad.auxType
}

repository: openshift/sriov-network-device-plugin

repo_name: openshift/sriov-network-device-plugin


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

package operators

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

import (
	"net/http"

	"github.com/go-openapi/runtime"

	"github.com/openshift/assisted-service/models"
)

// V2ReportMonitoredOperatorStatusOKCode is the HTTP code returned for type V2ReportMonitoredOperatorStatusOK
const V2ReportMonitoredOperatorStatusOKCode int = 200

/*
V2ReportMonitoredOperatorStatusOK Success.

swagger:response v2ReportMonitoredOperatorStatusOK
*/
type V2ReportMonitoredOperatorStatusOK struct {
}

// NewV2ReportMonitoredOperatorStatusOK creates V2ReportMonitoredOperatorStatusOK with default headers values
func NewV2ReportMonitoredOperatorStatusOK() *V2ReportMonitoredOperatorStatusOK {

	return &V2ReportMonitoredOperatorStatusOK{}
}

// WriteResponse to the client
func (o *V2ReportMonitoredOperatorStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses

	rw.WriteHeader(200)
}

// V2ReportMonitoredOperatorStatusBadRequestCode is the HTTP code returned for type V2ReportMonitoredOperatorStatusBadRequest
const V2ReportMonitoredOperatorStatusBadRequestCode int = 400

/*
V2ReportMonitoredOperatorStatusBadRequest Bad Request

swagger:response v2ReportMonitoredOperatorStatusBadRequest
*/
type V2ReportMonitoredOperatorStatusBadRequest struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
}

// NewV2ReportMonitoredOperatorStatusBadRequest creates V2ReportMonitoredOperatorStatusBadRequest with default headers values
func NewV2ReportMonitoredOperatorStatusBadRequest() *V2ReportMonitoredOperatorStatusBadRequest {

	return &V2ReportMonitoredOperatorStatusBadRequest{}
}

// WithPayload adds the payload to the v2 report monitored operator status bad request response
func (o *V2ReportMonitoredOperatorStatusBadRequest) WithPayload(payload *models.Error) *V2ReportMonitoredOperatorStatusBadRequest {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the v2 report monitored operator status bad request response
func (o *V2ReportMonitoredOperatorStatusBadRequest) SetPayload(payload *models.Error) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *V2ReportMonitoredOperatorStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(400)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

// V2ReportMonitoredOperatorStatusUnauthorizedCode is the HTTP code returned for type V2ReportMonitoredOperatorStatusUnauthorized
const V2ReportMonitoredOperatorStatusUnauthorizedCode int = 401

/*
V2ReportMonitoredOperatorStatusUnauthorized Unauthorized.

swagger:response v2ReportMonitoredOperatorStatusUnauthorized
*/
type V2ReportMonitoredOperatorStatusUnauthorized struct {

	/*
	  In: Body
	*/
	Payload *models.InfraError `json:"body,omitempty"`
}

// NewV2ReportMonitoredOperatorStatusUnauthorized creates V2ReportMonitoredOperatorStatusUnauthorized with default headers values
func NewV2ReportMonitoredOperatorStatusUnauthorized() *V2ReportMonitoredOperatorStatusUnauthorized {

	return &V2ReportMonitoredOperatorStatusUnauthorized{}
}

// WithPayload adds the payload to the v2 report monitored operator status unauthorized response
func (o *V2ReportMonitoredOperatorStatusUnauthorized) WithPayload(payload *models.InfraError) *V2ReportMonitoredOperatorStatusUnauthorized {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the v2 report monitored operator status unauthorized response
func (o *V2ReportMonitoredOperatorStatusUnauthorized) SetPayload(payload *models.InfraError) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *V2ReportMonitoredOperatorStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(401)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

// V2ReportMonitoredOperatorStatusForbiddenCode is the HTTP code returned for type V2ReportMonitoredOperatorStatusForbidden
const V2ReportMonitoredOperatorStatusForbiddenCode int = 403

/*
V2ReportMonitoredOperatorStatusForbidden Forbidden.

swagger:response v2ReportMonitoredOperatorStatusForbidden
*/
type V2ReportMonitoredOperatorStatusForbidden struct {

	/*
	  In: Body
	*/
	Payload *models.InfraError `json:"body,omitempty"`
}

// NewV2ReportMonitoredOperatorStatusForbidden creates V2ReportMonitoredOperatorStatusForbidden with default headers values
func NewV2ReportMonitoredOperatorStatusForbidden() *V2ReportMonitoredOperatorStatusForbidden {

	return &V2ReportMonitoredOperatorStatusForbidden{}
}

// WithPayload adds the payload to the v2 report monitored operator status forbidden response
func (o *V2ReportMonitoredOperatorStatusForbidden) WithPayload(payload *models.InfraError) *V2ReportMonitoredOperatorStatusForbidden {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the v2 report monitored operator status forbidden response
func (o *V2ReportMonitoredOperatorStatusForbidden) SetPayload(payload *models.InfraError) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *V2ReportMonitoredOperatorStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(403)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

// V2ReportMonitoredOperatorStatusNotFoundCode is the HTTP code returned for type V2ReportMonitoredOperatorStatusNotFound
const V2ReportMonitoredOperatorStatusNotFoundCode int = 404

/*
V2ReportMonitoredOperatorStatusNotFound Error.

swagger:response v2ReportMonitoredOperatorStatusNotFound
*/
type V2ReportMonitoredOperatorStatusNotFound struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
}

// NewV2ReportMonitoredOperatorStatusNotFound creates V2ReportMonitoredOperatorStatusNotFound with default headers values
func NewV2ReportMonitoredOperatorStatusNotFound() *V2ReportMonitoredOperatorStatusNotFound {

	return &V2ReportMonitoredOperatorStatusNotFound{}
}

// WithPayload adds the payload to the v2 report monitored operator status not found response
func (o *V2ReportMonitoredOperatorStatusNotFound) WithPayload(payload *models.Error) *V2ReportMonitoredOperatorStatusNotFound {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the v2 report monitored operator status not found response
func (o *V2ReportMonitoredOperatorStatusNotFound) SetPayload(payload *models.Error) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *V2ReportMonitoredOperatorStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(404)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

// V2ReportMonitoredOperatorStatusMethodNotAllowedCode is the HTTP code returned for type V2ReportMonitoredOperatorStatusMethodNotAllowed
const V2ReportMonitoredOperatorStatusMethodNotAllowedCode int = 405

/*
V2ReportMonitoredOperatorStatusMethodNotAllowed Method Not Allowed.

swagger:response v2ReportMonitoredOperatorStatusMethodNotAllowed
*/
type V2ReportMonitoredOperatorStatusMethodNotAllowed struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
}

// NewV2ReportMonitoredOperatorStatusMethodNotAllowed creates V2ReportMonitoredOperatorStatusMethodNotAllowed with default headers values
func NewV2ReportMonitoredOperatorStatusMethodNotAllowed() *V2ReportMonitoredOperatorStatusMethodNotAllowed {

	return &V2ReportMonitoredOperatorStatusMethodNotAllowed{}
}

// WithPayload adds the payload to the v2 report monitored operator status method not allowed response
func (o *V2ReportMonitoredOperatorStatusMethodNotAllowed) WithPayload(payload *models.Error) *V2ReportMonitoredOperatorStatusMethodNotAllowed {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the v2 report monitored operator status method not allowed response
func (o *V2ReportMonitoredOperatorStatusMethodNotAllowed) SetPayload(payload *models.Error) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *V2ReportMonitoredOperatorStatusMethodNotAllowed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(405)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

// V2ReportMonitoredOperatorStatusConflictCode is the HTTP code returned for type V2ReportMonitoredOperatorStatusConflict
const V2ReportMonitoredOperatorStatusConflictCode int = 409

/*
V2ReportMonitoredOperatorStatusConflict Error.

swagger:response v2ReportMonitoredOperatorStatusConflict
*/
type V2ReportMonitoredOperatorStatusConflict struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
}

// NewV2ReportMonitoredOperatorStatusConflict creates V2ReportMonitoredOperatorStatusConflict with default headers values
func NewV2ReportMonitoredOperatorStatusConflict() *V2ReportMonitoredOperatorStatusConflict {

	return &V2ReportMonitoredOperatorStatusConflict{}
}

// WithPayload adds the payload to the v2 report monitored operator status conflict response
func (o *V2ReportMonitoredOperatorStatusConflict) WithPayload(payload *models.Error) *V2ReportMonitoredOperatorStatusConflict {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the v2 report monitored operator status conflict response
func (o *V2ReportMonitoredOperatorStatusConflict) SetPayload(payload *models.Error) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *V2ReportMonitoredOperatorStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(409)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

// V2ReportMonitoredOperatorStatusInternalServerErrorCode is the HTTP code returned for type V2ReportMonitoredOperatorStatusInternalServerError
const V2ReportMonitoredOperatorStatusInternalServerErrorCode int = 500

/*
V2ReportMonitoredOperatorStatusInternalServerError Error.

swagger:response v2ReportMonitoredOperatorStatusInternalServerError
*/
type V2ReportMonitoredOperatorStatusInternalServerError struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
}

// NewV2ReportMonitoredOperatorStatusInternalServerError creates V2ReportMonitoredOperatorStatusInternalServerError with default headers values
func NewV2ReportMonitoredOperatorStatusInternalServerError() *V2ReportMonitoredOperatorStatusInternalServerError {

	return &V2ReportMonitoredOperatorStatusInternalServerError{}
}

// WithPayload adds the payload to the v2 report monitored operator status internal server error response
func (o *V2ReportMonitoredOperatorStatusInternalServerError) WithPayload(payload *models.Error) *V2ReportMonitoredOperatorStatusInternalServerError {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the v2 report monitored operator status internal server error response
func (o *V2ReportMonitoredOperatorStatusInternalServerError) SetPayload(payload *models.Error) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *V2ReportMonitoredOperatorStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(500)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

// V2ReportMonitoredOperatorStatusServiceUnavailableCode is the HTTP code returned for type V2ReportMonitoredOperatorStatusServiceUnavailable
const V2ReportMonitoredOperatorStatusServiceUnavailableCode int = 503

/*
V2ReportMonitoredOperatorStatusServiceUnavailable Unavailable.

swagger:response v2ReportMonitoredOperatorStatusServiceUnavailable
*/
type V2ReportMonitoredOperatorStatusServiceUnavailable struct {

	/*
	  In: Body
	*/
	Payload *models.Error `json:"body,omitempty"`
}

// NewV2ReportMonitoredOperatorStatusServiceUnavailable creates V2ReportMonitoredOperatorStatusServiceUnavailable with default headers values
func NewV2ReportMonitoredOperatorStatusServiceUnavailable() *V2ReportMonitoredOperatorStatusServiceUnavailable {

	return &V2ReportMonitoredOperatorStatusServiceUnavailable{}
}

// WithPayload adds the payload to the v2 report monitored operator status service unavailable response
func (o *V2ReportMonitoredOperatorStatusServiceUnavailable) WithPayload(payload *models.Error) *V2ReportMonitoredOperatorStatusServiceUnavailable {
	o.Payload = payload
	return o
}

// SetPayload sets the payload to the v2 report monitored operator status service unavailable response
func (o *V2ReportMonitoredOperatorStatusServiceUnavailable) SetPayload(payload *models.Error) {
	o.Payload = payload
}

// WriteResponse to the client
func (o *V2ReportMonitoredOperatorStatusServiceUnavailable) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {

	rw.WriteHeader(503)
	if o.Payload != nil {
		payload := o.Payload
		if err := producer.Produce(rw, payload); err != nil {
			panic(err) // let the recovery middleware deal with this
		}
	}
}

repository: openshift/assisted-service

repo_name: openshift/assisted-service


text:
@article{Kirpich2018-cg,
 abstract = {Metabolomics has the promise to transform the area of
personalized medicine with the rapid development of high
throughput technology for untargeted analysis of metabolites.
Open access, easy to use, analytic tools that are broadly
accessible to the biological community …},
 author = {Kirpich, A S and Ibarra, M and others},
 issn = {0269-3879},
 journal = {Biomed. Chromatogr.},
 publisher = {bmcbioinformatics.biomedcentral …},
 title = {SECIMTools: a suite of metabolomics data analysis tools},
 url = {https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-018-2134-1},
 year = {2018}
}


text:
DESCRIPTION = "Terminal multiplexer"
HOMEPAGE = "http://tmux.sourceforge.net"
SECTION = "console/utils"

LICENSE = "ISC"
LIC_FILES_CHKSUM = "file://tmux.c;beginline=3;endline=17;md5=8685b4455330a940fab1ff451aa941a0"

DEPENDS = "ncurses libevent sed-native"

SRC_URI = "${SOURCEFORGE_MIRROR}/tmux/${P}.tar.gz"
SRC_URI[md5sum] = "3e37db24aa596bf108a0442a81c845b3"
SRC_URI[sha256sum] = "faee08ba1bd8c22537cd5b7458881d1bdb4985df88ed6bc5967c56881a7efbd6"

inherit autotools

do_configure_prepend () {
    sed -i -e 's:-I/usr/local/include::' Makefile.am || bb_fatal "sed failed"
}

repository: ExorEmbedded/exor-workspace

repo_name: ExorEmbedded/exor-workspace


text:
DESCRIPTION = "The C/Vala implementation of the freesmartphone.org framework APIs"
HOMEPAGE = "http://www.freesmartphone.org/"
AUTHOR = "Sudharshan S"
SECTION = "console/network"
DEPENDS = "dbus dbus-glib libnl vala-native"
# for pygobject-codegen
DEPENDS += "python-pygtk"
LICENSE = "LGPL"
PV = "0.1+gitr${SRCREV}"
PR = "r1"

inherit autotools pkgconfig update-rc.d distutils-base

EXTRA_OECONF = "--enable-python --with-python-includes=${STAGING_INCDIR}/.."

INITSCRIPT_NAME = "fsod"
INITSCRIPT_PARAMS = "defaults 21"

SRC_URI = "\
  ${FREESMARTPHONE_GIT}/openmoko-gsoc2008.git;protocol=git;branch=master \
  file://autofoo.patch;patch=1 \
#  file://fsod \
"
S = "${WORKDIR}/git/fsod"

do_install_append() {
#        install -d ${D}${sysconfdir}/init.d
#        install -m 0755 ${WORKDIR}/fsod ${D}${sysconfdir}/init.d/
}

RCONFLICTS_${PN} = "frameworkd"
RREPLACES_${PN} = "frameworkd"

FILES_${PN} += "${sysconfdir} ${datadir}"
FILES_${PN}-dbg += "\
  ${bindir}/.debug \
  ${libdir}/fsod/subsystems/.debug \
  ${libdir}/fsod/subsystems/*/.debug \
"


text:
package services

import (
	"github.com/jinzhu/copier"
	"github.com/pkg/errors"
	"openscrm/app/models"
	"openscrm/app/requests"
	"openscrm/app/responses"
	"openscrm/common/app"
	"openscrm/common/id_generator"
)

type Role struct {
	model models.Role
}

func NewRole() *Role {
	return &Role{model: models.Role{}}
}

func (o *Role) Query(req requests.QueryRoleReq, extCorpID string, sorter *app.Sorter, pager *app.Pager) (items []responses.Role, total int64, err error) {
	param := models.Role{}
	err = copier.Copy(&param, req)
	if err != nil {
		err = errors.Wrap(err, "copier.Copy failed")
		return
	}

	var roles []models.Role
	roles, total, err = o.model.Query(param, extCorpID, sorter, pager)
	if err != nil {
		err = errors.Wrap(err, "o.model.Query failed")
		return
	}

	counts := make([]struct {
		RoleID string
		Total  int64
	}, 0)

	err = models.DB.Model(&models.Staff{}).Where("ext_corp_id = ?", extCorpID).Group("role_id").Select("count(*) as total,role_id").Scan(&counts).Error
	if err != nil {
		err = errors.Wrap(err, "count Staff failed")
		return
	}

	countMap := make(map[string]int64, 0)
	for _, count := range counts {
		countMap[count.RoleID] = count.Total
	}

	for _, role := range roles {
		item := responses.Role{
			Role:  role,
			Count: countMap[role.ID],
		}
		items = append(items, item)
	}

	return
}

func (o *Role) Get(id string) (item responses.Role, err error) {
	role, err := o.model.Get(id)
	if err != nil {
		err = errors.Wrap(err, "get role failed")
		return
	}

	item.Role = role
	item.Permissions, err = (&models.Permission{}).BatchGetByIdentities(role.PermissionIDs...)
	if err != nil {
		err = errors.Wrap(err, "get Permission failed")
		return
	}

	return
}

func (o *Role) Create(param requests.CreateRoleReq, extCorpID string) (item models.Role, err error) {
	err = copier.Copy(&item, param)
	if err != nil {
		err = errors.Wrap(err, "copier.Copy failed")
		return
	}
	item.ID = id_generator.StringID()

	return o.model.Create(item, extCorpID)
}

func (o *Role) Update(id string, param requests.UpdateRoleReq) (item models.Role, err error) {
	err = copier.Copy(&item, param)
	if err != nil {
		err = errors.Wrap(err, "copier.Copy failed")
		return
	}

	return o.model.Update(id, item)
}

func (o *Role) AssignToStaffs(extStaffIDs []string, roleID string) (total int64, err error) {
	return o.model.AssignToStaffs(extStaffIDs, roleID)
}

func (o *Role) QueryStaffs(req requests.QueryRoleStaffsReq, extCorpID string, sorter *app.Sorter, pager *app.Pager) (items []models.Staff, total int64, err error) {
	param := models.Staff{}
	err = copier.Copy(&param, req)
	if err != nil {
		err = errors.Wrap(err, "copier.Copy failed")
		return
	}

	param.ExtID = req.ExtStaffID
	param.ID = req.StaffID

	return o.model.QueryStaffs(param, extCorpID, sorter, pager)
}

repository: coder-layne/api-server

repo_name: coder-layne/api-server


text:
@Article{gisterek2011prognostic,
  title = {Prognostic role of c-met expression in breast cancer patients},
  author = {Iwona Gisterek and Ewelina Lata and Agnieszka Halon and Rafal Matkowski and Jolanta Szelachowska and Przemyslaw Biecek and Jan Kornafel},
  journal = {Reports of Practical Oncology \& Radiotherapy},
  volume = {16},
  number = {5},
  pages = {173--177},
  year = {2011},
  publisher = {Elsevier},
}


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

package session

import (
	"testing"
)

func Test_gob(t *testing.T) {
	a := make(map[interface{}]interface{})
	a["username"] = "astaxie"
	a[12] = 234
	a["user"] = User{"asta", "xie"}
	b, err := EncodeGob(a)
	if err != nil {
		t.Error(err)
	}
	c, err := DecodeGob(b)
	if err != nil {
		t.Error(err)
	}
	if len(c) == 0 {
		t.Error("decodeGob empty")
	}
	if c["username"] != "astaxie" {
		t.Error("decode string error")
	}
	if c[12] != 234 {
		t.Error("decode int error")
	}
	if c["user"].(User).Username != "asta" {
		t.Error("decode struct error")
	}
}

type User struct {
	Username string
	NickName string
}

repository: astaxie/beego

repo_name: astaxie/beego

branch_name: refs/heads/develop

gha_license_id: NOASSERTION


text:
SECTION = "unknown"
LICENSE = "http://creativecommons.org/licenses/by-sa/2.5/"
inherit autotools pkgconfig

SRC_URI = "http://tango.freedesktop.org/releases/${PN}-${PV}.tar.gz \
	   file://no-icon-naming-utils.patch"
EXTRA_OECONF = "--disable-icon-framing"
FILES_${PN} += "${datadir}/icons"

SRC_URI[md5sum] = "caaceaec7b61f1cbda0db9842f9db281"
SRC_URI[sha256sum] = "b9252179ea2c546e6bb065281d51373f0ae06081e5a98d4255249af4fa8b33db"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
DESCRIPTION = "Tools for managing memory technology devices."
SECTION = "base"
DEPENDS = "e2fsprogs-libs zlib lzo"
HOMEPAGE = "http://www.linux-mtd.infradead.org/"
LICENSE = "GPLv2"
PR = "r3"

ARM_INSTRUCTION_SET = "arm"

# This is the default package, thus we lock to a specific git version so
# upstream changes will not break builds.

TAG = "ea429635388f7bb53f62c41ec3d5ccf5fa207370"

SRC_URI = "git://git.infradead.org/mtd-utils.git;protocol=git;tag=${TAG} \
	   file://add-exclusion-to-mkfs-jffs2-git-2.patch;patch=1 \
	   file://fix-ignoreerrors-git.patch;patch=1 \
	   file://lzo_1x-git.patch;patch=1"

S = "${WORKDIR}/git/"

EXTRA_OEMAKE = "'CC=${CC}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR'"

do_configure_prepend() {
	for i in $(find . -name "Makefile") ; do
		sed -i -e s:lzo2:lzo:g $i
	done
	sed -i -e s:lzo/::g mkfs.ubifs/compr.c
}

do_stage () {
	install -d ${STAGING_INCDIR}/mtd
	for f in ${S}/include/mtd/*.h; do
		install -m 0644 $f ${STAGING_INCDIR}/mtd/
	done
	for binary in ${mtd_utils}; do
		install -m 0755 $binary ${STAGING_BINDIR}
	done
}

mtd_utils = " docfdisk \
	doc_loadbios \
	flashcp \
	flash_erase \
	flash_eraseall \
	flash_info \
	flash_lock \
	flash_otp_dump \
	flash_otp_info \
	flash_unlock \
	ftl_check \
	ftl_format \
	jffs2dump \
	mkfs.jffs2 \
	mtd_debug \
	nanddump \
	nandtest \
	nandwrite \
	nftldump \
	nftl_format \
	recv_image \
	rfddump \
	rfdformat \
	serve_image \
	sumtool \
	mkfs.ubifs/mkfs.ubifs \
	ubi-utils/bin2nand \
	ubi-utils/mkbootenv \
	ubi-utils/nand2bin \
	ubi-utils/pddcustomize \
	ubi-utils/pfi2bin \
	ubi-utils/pfiflash \
	ubi-utils/ubigen \
	ubi-utils/ubimirror \
	ubi-utils/unubi \
	ubi-utils/new-utils/ubiattach \
	ubi-utils/new-utils/ubicrc32 \
	ubi-utils/new-utils/ubidetach \
	ubi-utils/new-utils/ubiformat \
	ubi-utils/new-utils/ubimkvol \
	ubi-utils/new-utils/ubinfo \
	ubi-utils/new-utils/ubinize \
	ubi-utils/new-utils/ubirmvol \
	ubi-utils/new-utils/ubiupdatevol"

do_install () {
	install -d ${D}${bindir}
	install -d ${D}${includedir}/mtd
	for binary in ${mtd_utils}; do
		install -m 0755 $binary ${D}${bindir}
	done
	for f in ${S}/include/mtd/*.h; do
		install -m 0644 $f ${D}${includedir}/mtd
	done
}

PACKAGES =+ "mkfs-jffs mkfs-jffs2"
FILES_mkfs-jffs = "${bindir}/mkfs.jffs"
FILES_mkfs-jffs2 = "${bindir}/mkfs.jffs2"


text:
# Arago TI SDK base image
# gives you an image with Qt/E and other common packages shared by all TI SDKs.

require arago-image.inc
inherit remove-net-rules

COMPATIBLE_MACHINE = "omap3|omapl138|ti33x|ti43x|omap4|omap-a15|keystone"

IMAGE_INSTALL += "\
    packagegroup-arago-base \
    packagegroup-arago-console \
    packagegroup-arago-base-tisdk \
    "

BAD_RECOMMENDATIONS += " \
    ti-llvm3.6-dev \
    opencl-monitor-dev \
    libulm-dev \
    gdbserver-c6x-dev \
    coreutils \
    coreutils-dev \
"

export IMAGE_BASENAME = "arago-base-tisdk-image"


text:
SUMMARY = "Helpers for AV applications using DLNA"
LICENSE = "LGPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
                    file://libgupnp-dlna/gupnp-dlna-profile.h;beginline=1;endline=22;md5=1b85459f65cb1e73a885ca137aab6274"

DEPENDS = "libxml2 glib-2.0"

SRC_URI = "http://download.gnome.org/sources/${BPN}/0.12/${BPN}-${PV}.tar.xz"
SRC_URI[sha256sum] = "3d53b96f85bc5628d33e367ec9bf2adb38ef2b34d7ad0434a6ba0cf4ad9048e6"

inherit meson pkgconfig gobject-introspection vala

PACKAGECONFIG ?= "gstreamer"
PACKAGECONFIG[gstreamer] = "-Dgstreamer_backend=enabled,-Dgstreamer_backend=disabled,gstreamer1.0 gstreamer1.0-plugins-base"

FILES:${PN} += "${datadir}/gupnp-dlna-2.0/dlna-profiles"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake


text:
include resin-edison.inc

# Get some specific configuration for staging/production build
IMAGE_FEATURES_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'resin-staging', 'debug-tweaks', '', d)}"
IMAGE_INSTALL_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'resin-staging', 'nano htop', '', d)}"

repository: gmacario/meta-resin

repo_name: gmacario/meta-resin


text:
# Distributed under the OSI-approved Apache 2.0. See the LICENSE file in
# FoundationDB source code

#[=======================================================================[.rst:
FindSphinx
-------

Find Sphinx, the Python documentation generator

Sphinx_ROOT variable can be used for HINTS for different version of Sphinx.

Result variables
^^^^^^^^^^^^^^^^

This module will set the following variables in your project:

``Sphinx_EXECUTABLE``
  The executable of Sphinx
``Sphinx_FOUND``
  If false, Sphinx is not available
#]=======================================================================]

include(FindPackageHandleStandardArgs)

if(NOT Sphinx_ROOT)
  set(Sphinx_ROOT $ENV{Sphinx_ROOT})
endif()

find_program(
  Sphinx_EXECUTABLE
  NAMES sphinx-build
  HINTS ${Sphinx_ROOT}
  DOC "Sphinx-build tool")

if(Sphinx_EXECUTABLE)
  execute_process(
    COMMAND ${Sphinx_EXECUTABLE} --version
    OUTPUT_VARIABLE _Sphinx_VERSION_STRING
    OUTPUT_STRIP_TRAILING_WHITESPACE)
  # Strip the leading "sphinx-build " e.g. sphinx-build 5.1.1
  string(SUBSTRING ${_Sphinx_VERSION_STRING} 13 -1 Sphinx_VERSION)
endif()

find_package_handle_standard_args(
  Sphinx
  FOUND_VAR Sphinx_FOUND
  REQUIRED_VARS Sphinx_EXECUTABLE Sphinx_VERSION)
mark_as_advanced(Sphinx_FOUND Sphinx_VERSION Sphinx_EXECUTABLE)

repository: apple/foundationdb

repo_name: apple/foundationdb


text:
@article{zhang1993headspace,
  title={Headspace solid-phase microextraction},
  author={Zhang, Zhouyao and Pawliszyn, Janusz},
  journal={Analytical chemistry},
  volume={65},
  number={14},
  pages={1843--1852},
  year={1993},
  publisher={ACS Publications}
}

@book{leveque1992numerical,
  title={Numerical methods for conservation laws},
  author={LeVeque, Randall J},
  volume={3},
  year={1992},
  publisher={Springer}
}

repository: pedrospeixoto/SimEx

repo_name: pedrospeixoto/SimEx


text:
@online{cite1,
  title = {Link 1},
  author = {Author, One and others},
  url = {http://example.com},
  urldate = {2017-01-01}
}

@online{cite2,
  title = {Link 2},
  author = {Author, Two and others},
  url = {http://example.com},
  urldate = {2017-01-01}
}

repository: isakhammer/vimrc

repo_name: isakhammer/vimrc

gha_language: Vim script


text:
package mqtt

import (
	"bytes"
	"testing"
)

func TestSendPublish(t *testing.T) {
	expectedBytes := []byte{
		0x3D, 0x18, 0x00, 0x0A, 0x74, 0x65, 0x73, 0x74, 0x20, 0x74, 0x6F, 0x70, 0x69, 0x63, 0x00, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
	}

	p := Publish{
		Topic:   "test topic",
		Payload: []byte{1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
		QOS:     2,
		Retain:  true,
		DUP:     true,
	}

	b := bytes.NewBuffer(nil)
	err := p.Send(b)
	if err != nil {
		t.Fatalf("unexpected err: %s\n", err)
	}

	if bytes.Compare(expectedBytes, b.Bytes()) != 0 {
		t.Fatalf("bytes are different [% 02X]", b.Bytes())
	}
}

func TestReceivePublish(t *testing.T) {
	b := []byte{
		0x3D, 0x18, 0x00, 0x0A, 0x74, 0x65, 0x73, 0x74, 0x20, 0x74, 0x6F, 0x70, 0x69, 0x63, 0x00, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A,
	}

	r := bytes.NewBuffer(b[2:])

	p, err := ReceivePublish(r, b[0], int(b[1]))
	if err != nil {
		t.Fatalf("unexpected err: %s\n", err)
	}

	if p.Topic != "test topic" {
		t.Fatalf("unexpected topic: %s", p.Topic)
	}
	if p.DUP != true {
		t.Fatalf("expected to be DUP")
	}
	if p.Retain != true {
		t.Fatalf("expected to be Retain")
	}
	if p.QOS != 2 {
		t.Fatalf("expected to be QOS 2 [%d]", p.QOS)
	}

	if bytes.Compare(p.Payload, b[16:]) != 0 {
		t.Fatalf("unexpected payload bytes")
	}
}

repository: jnewmano/mqtt-nsq

repo_name: jnewmano/mqtt-nsq


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

package nestedflagset

import (
	"flag"
	"fmt"

	"testing"

	. "github.com/smartystreets/goconvey/convey"
)

func TestNestedFlagSet(t *testing.T) {
	Convey("Given a multi-field FlagSet object", t, func() {
		nfs := FlagSet{}
		s := nfs.F.String("field-str", "", "String field.")
		i := nfs.F.Int("field-int", 0, "Integer field.")
		d := nfs.F.String("field-default", "default",
			"Another string field.")

		Convey("When parsed with a valid field set", func() {
			err := nfs.Parse("field-str=foo,field-int=123")
			Convey("It should parse without error.", FailureHalts, func() {
				So(err, ShouldBeNil)
			})

			Convey("It should parse 'field-str' as 'foo'", func() {
				So(*s, ShouldEqual, "foo")
			})

			Convey("It should parse 'field-int' as 123", func() {
				So(*i, ShouldEqual, 123)
			})

			Convey("It should leave 'field-default' to its default value, 'default'", func() {
				So(*d, ShouldEqual, "default")
			})
		})

		Convey("When parsed with an unexpected field", func() {
			err := nfs.Parse("field-invalid=foo")

			Convey("It should error.", FailureHalts, func() {
				So(err, ShouldNotBeNil)
			})
		})

		Convey("It should return a valid usage string.", func() {
			So(nfs.Usage(), ShouldEqual, "help[,field-default][,field-int][,field-str]")
		})

		Convey(`When installed as a flag`, func() {
			fs := flag.NewFlagSet("test", flag.PanicOnError)
			fs.Var(&nfs, "flagset", "The FlagSet instance.")

			Convey(`Accepts the FlagSet as a parameter.`, func() {
				fs.Parse([]string{"-flagset", `field-str="hello",field-int=20`})
				So(*s, ShouldEqual, "hello")
				So(*i, ShouldEqual, 20)
				So(*d, ShouldEqual, "default")
			})
		})
	})
}

// ExampleFlagSet demonstrates nestedflagset.FlagSet usage.
func ExampleFlagSet() {
	nfs := &FlagSet{}
	s := nfs.F.String("str", "", "Nested string option.")
	i := nfs.F.Int("int", 0, "Nested integer option.")

	if err := nfs.Parse(`str="Hello, world!",int=10`); err != nil {
		panic(err)
	}
	fmt.Printf("Parsed str=[%s], int=%d.\n", *s, *i)

	// Output:
	// Parsed str=[Hello, world!], int=10.
}

repository: luci/luci-go

repo_name: luci/luci-go


text:
// export by github.com/goplus/interp/cmd/qexp

package user

import (
	"os/user"

	"github.com/goplus/interp"
)

func init() {
	interp.RegisterPackage("os/user", extMap, typList)
}

var extMap = map[string]interface{}{
	"(*os/user.User).GroupIds":            (*user.User).GroupIds,
	"(os/user.UnknownGroupError).Error":   (user.UnknownGroupError).Error,
	"(os/user.UnknownGroupIdError).Error": (user.UnknownGroupIdError).Error,
	"(os/user.UnknownUserError).Error":    (user.UnknownUserError).Error,
	"(os/user.UnknownUserIdError).Error":  (user.UnknownUserIdError).Error,
	"os/user.Current":                     user.Current,
	"os/user.Lookup":                      user.Lookup,
	"os/user.LookupGroup":                 user.LookupGroup,
	"os/user.LookupGroupId":               user.LookupGroupId,
	"os/user.LookupId":                    user.LookupId,
}

var typList = []interface{}{
	(*user.Group)(nil),
	(*user.UnknownGroupError)(nil),
	(*user.UnknownGroupIdError)(nil),
	(*user.UnknownUserError)(nil),
	(*user.UnknownUserIdError)(nil),
	(*user.User)(nil),
}

repository: socialsky-io/interp

repo_name: socialsky-io/interp


text:
SUMMARY = "Image editing components"
LICENSE = "BSD-2-Clause & CC0-1.0 & LGPL-2.1-or-later"
LIC_FILES_CHKSUM = " \
    file://LICENSES/BSD-2-Clause.txt;md5=63d6ee386b8aaba70b1bf15a79ca50f2 \
    file://LICENSES/CC0-1.0.txt;md5=6fd064768b8d61c31ddd0540570fbd33 \
    file://LICENSES/LGPL-2.1-or-later.txt;md5=2a4f4fd2128ea2f65047ee63fbca9f68 \
"

DEPENDS = "qtdeclarative"

inherit kde-base gettext

SRC_URI = "${KDE_MIRROR}/stable/${BPN}/${BP}.tar.xz"
SRC_URI[sha256sum] = "3cfba775498e031f6963669ee0e4426d4fddd48a244b9583620de4d312ba92ca"
PV = "0.2.0"

FILES:${PN} += " \
    ${OE_QMAKE_PATH_QML} \
"


text:
# Copyright (C) 2015 Freescale Semiconductor
# Copyright 2017-2018 NXP
# Released under the MIT license (see COPYING.MIT for the terms)

DESCRIPTION = "Freescale Image to validate i.MX machines. \
This image contains everything used to test i.MX machines including GUI, \
demos and lots of applications. This creates a very large image, not \
suitable for production."
LICENSE = "MIT"

IMAGE_FSTYPES_append = " wic wic.xz"
IMAGE_FSTYPES_remove = "tar tar.bz2 ext4 sdcard sdcard.bz2 sdcard.xz sdcard.md5sum"
WKS_FILE = "tn-spl-uboot-fit.wks.in"
WKS_FILE_mx8 = "tn-imx8-imxboot-fit.wks.in"
#WKS_FILE_DEPENDS += ""
IMAGE_BOOT_FILES = "fitImage-${INITRAMFS_IMAGE}-${MACHINE}.bin;tnrescue.itb"
IMAGE_BOOT_FILES_append_arm = " u-boot-${MACHINE}.${UBOOT_SUFFIX};u-boot.img"

# We do not want to install anything, only need the wic packaging"
IMAGE_INSTALL_remove = "packagegroup-core-boot packagegroup-base-extended get-support-info packagegroup-tn-wlan packagegroup-tn-tools packagegroup-tn-voicehat packagegroup-tn-nfc"

# Do not pollute the initrd image with rootfs features
IMAGE_FEATURES = ""

IMAGE_LINGUAS = ""

LICENSE = "MIT"

inherit core-image

# Following is for appearance as we are only building /boot vfat partition
IMAGE_ROOTFS_SIZE = "0"
IMAGE_ROOTFS_EXTRA_SPACE = "0"
IMAGE_OVERHEAD_FACTOR = "1.0"

python do_check_initramfs_image () {
    initramfs_image = d.getVar("INITRAMFS_IMAGE", True)
    if initramfs_image is None or initramfs_image != "tn-image-rescue-initramfs":
        bb.fatal("Must set INITRAMFS_IMAGE = \"tn-image-rescue-initramfs\" in local.conf to build tn-image-rescue-fitimage")
}
addtask check_initramfs_image before do_rootfs

RDEPENDS_${PN} += "bash"

repository: sshyran/meta-tn-imx-bsp-TechNexion

repo_name: sshyran/meta-tn-imx-bsp-TechNexion


text:
// Copyright 2020 Anapaya Systems
//
// 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 gateway

import (
	"context"

	"github.com/scionproto/scion/go/lib/addr"
	"github.com/scionproto/scion/go/lib/metrics"
	"github.com/scionproto/scion/go/pkg/gateway/control"
	"github.com/scionproto/scion/go/pkg/gateway/pathhealth"
	"github.com/scionproto/scion/go/pkg/gateway/pathhealth/policies"
)

// PathMonitor implements control.PathMonitor using a pathhealth path monitor.
type PathMonitor struct {
	*pathhealth.Monitor
	revStore              pathhealth.RevocationStore
	sessionPathsAvailable metrics.Gauge
}

func (pm *PathMonitor) Register(
	ctx context.Context,
	remote addr.IA,
	policies *policies.Policies,
	policyID string,
) control.PathMonitorRegistration {

	reg := pm.Monitor.Register(remote, &pathhealth.FilteringPathSelector{
		PathPolicy:      policies.PathPolicy,
		PathCount:       policies.PathCount,
		RevocationStore: pm.revStore,
	})
	return &registration{
		Registration: reg,
		sessionPathsAvailable: metrics.GaugeWith(
			pm.sessionPathsAvailable,
			"remote_isd_as", remote.String(),
			"policy_id", policyID,
		),
	}
}

type registration struct {
	*pathhealth.Registration
	sessionPathsAvailable metrics.Gauge
}

func (r *registration) Get() pathhealth.Selection {
	selection := r.Registration.Get()
	if r.sessionPathsAvailable != nil {
		r.sessionPathsAvailable.With("status", "alive").Set(float64(selection.PathsAlive))
		r.sessionPathsAvailable.With("status", "timeout").Set(float64(selection.PathsDead))
		r.sessionPathsAvailable.With("status", "rejected").Set(float64(selection.PathsRejected))
	}
	return selection
}

repository: netsec-ethz/scion

repo_name: netsec-ethz/scion

branch_name: refs/heads/scionlab


text:
@article{WiesmuellerAgaimyPerrakisetal.2019,
  author    = {Felix Wiesmueller and Abbas Agaimy and Aristotelis Perrakis and Andreas Arkudas and Raymund E. Horch and Robert Gr{\"u}tzmann and Nikolaos Vassos},
  title     = {Dermatofibrosarcoma protuberans: surgical management of a challenging mesenchymal tumor},
  journal   = {World Journal of Surgical Oncology},
  volume    = {17},
  doi       = {10.1186/s12957-019-1627-3},
  year      = {2019},
}
@phdthesis{Reinfelder2019,
  author      = {Lena Reinfelder},
  title       = {User Interaction with Smartphone Security and Privacy Mechanisms},
  type        = {doctoralthesis},
  school      = {Friedrich-Alexander-Universit{\"a}t Erlangen-N{\"u}rnberg (FAU)},
  year        = {2019},
}
@phdthesis{Pakala2019,
  author      = {Lalitha Pakala},
  title       = {Kalman Filtering for Mitigation of Optical Fiber Transmission Impairments},
  type        = {doctoralthesis},
  pages       = {135},
  school      = {Friedrich-Alexander-Universit{\"a}t Erlangen-N{\"u}rnberg (FAU)},
  year        = {2019},
}
@article{Schoentag2019b,
  author    = {Roger Sch{\"o}ntag},
  title     = {Sprachraumbildung in Abh{\"a}ngigkeit von Geofaktoren und sozio-politischen Ver{\"a}nderungen. Eine neue Perspektive der Geolinguistik: Die Skizzierung einer Geofaktoriellen Linguistik anhand der Fallbeispiele des Kornischen, des Saterfriesischen und des Ladinischen},
  journal   = {Beitr{\"a}ge zur bayerischen Geschichte, Sprache und Kultur},
  volume    = {2},
  year      = {2019},
}
@article{KoeglMullBaderschneideretal.2019,
  author    = {Matthias Koegl and Christopher Mull and Kevin Baderschneider and Jan Wislicenus and Stefan Will and Lars Zigan},
  title     = {Characterization of Nile Red as a Tracer for Laser-Induced Fluorescence Spectroscopy of Gasoline and Kerosene and Their Mixture with Biofuels},
  journal   = {Sensors},
  volume    = {19},
  number    = {12},
  doi       = {10.3390/s19122822},
  year      = {2019},
}
@article{GieseNeumeierBergholzetal.2019,
  author    = {Sven Giese and Steffen Neumeier and Jan Bergholz and Dmitry Naumenko and Willem J. Quadakkers and Robert Vaßen and Mathias G{\"o}ken},
  title     = {Influence of Different Annealing Atmospheres on the Mechanical Properties of Freestanding MCrAlY Bond Coats Investigated by Micro-Tensile Creep Tests},
  journal   = {Metals},
  volume    = {9},
  number    = {6},
  doi       = {10.3390/met9060692},
  year      = {2019},
}
@article{MuehleWagnerFaerberetal.2019,
  author    = {Christiane M{\"u}hle and Claudia Johanna Wagner and Katharina F{\"a}rber and Tanja Richter-Schmidinger and Erich Gulbins and Bernd Lenz and Johannes Kornhuber},
  title     = {Secretory Acid Sphingomyelinase in the Serum of Medicated Patients Predicts the Prospective Course of Depression},
  journal   = {Journal of Clinical Medicine},
  volume    = {8},
  number    = {6},
  doi       = {10.3390/jcm8060846},
  year      = {2019},
}
@article{LehmannPfahlbergSandmannetal.2019,
  author    = {Maria Lehmann and Annette B. Pfahlberg and Henner Sandmann and Wolfgang Uter and Olaf Gefeller},
  title     = {Public Health Messages Associated with Low UV Index Values Need Reconsideration},
  journal   = {International Journal of Environmental Research and Public Health},
  volume    = {16},
  number    = {12},
  doi       = {10.3390/ijerph16122067},
  year      = {2019},
}
@article{MichlerShiSchellenbergeretal.2019,
  author    = {Fabian Michler and Kilin Shi and Sven Schellenberger and Tobias Steigleder and Anke Malessa and Laura Hameyer and Nina Neumann and Fabian Lurz and Christoph Ostgathe and Robert Weigel and Alexander Koelpin},
  title     = {A Clinically Evaluated Interferometric Continuous-Wave Radar System for the Contactless Measurement of Human Vital Parameters},
  journal   = {Sensors},
  volume    = {19},
  number    = {11},
  doi       = {10.3390/s19112492},
  year      = {2019},
}
@phdthesis{Schmitt2019,
  author      = {Christine Schmitt},
  title       = {Modellbasierte Ver{\"a}nderung der Transport-Spezifit{\"a}t rekombinanter Porine},
  type        = {doctoralthesis},
  school      = {Friedrich-Alexander-Universit{\"a}t Erlangen-N{\"u}rnberg (FAU)},
  year        = {2019},
}


text:
@article{2017-NZRB,
 abstract = {Analyzing massive graphs poses challenges due to the vast amount of data available. Extracting smaller relevant subgraphs allows for further visualization and analysis that would otherwise be too computationally intensive. Furthermore, many real data sets are constantly changing, and require algorithms to update as the graph evolves. This work addresses the topic of local community detection, or seed set expansion, using personalized centrality measures, specifically PageRank and Katz centrality. We present a method to efficiently update local communities in dynamic graphs. By updating the personalized ranking vectors, we can incrementally update the corresponding local community. Applying our methods to real-world graphs, we are able to obtain speedups of up to 60× compared to static recomputation while maintaining an average recall of 0.94 of the highly ranked vertices returned. Next, we investigate how approximations of a centrality vector affect the resulting local community. Specifically, our method guarantees that the vertices returned in the community are the highly ranked vertices from a personalized centrality metric.},
 author = {Eisha Nathan and Anita Zakrzewska and E. Jason Riedy and David A. Bader},
 bibsource = {dblp computer science bibliography, https://dblp.org},
 biburl = {https://dblp.org/rec/bib/journals/algorithms/NathanZRB17},
 doi = {10.3390/a10030102},
 groups = {Edited},
 journal = {Algorithms},
 number = {3},
 pages = {102--128},
 timestamp = {Tue, 14 Aug 2018 01:00:00 +0200},
 title = {Local Community Detection in Dynamic Graphs Using Personalized Centrality},
 url = {https://doi.org/10.3390/a10030102},
 volume = {10},
 year = {2017}
}

gha_language: Shell


text:
@inproceedings{insafutdinov18pointclouds,
 address = {Montréal, Canada},
 author = {Insafutdinov, Eldar and Dosovitskiy, Alexey},
 booktitle = {Advances in Neural Information Processing Systems 31 (NeurIPS 2018)},
 editor = {Bengio, S. and Wallach, H. and Larochelle, H. and Grauman, K. and Cesa-Bianchi, N. and Garnett, R.},
 language = {eng},
 marginalmark = {$\bullet$},
 pages = {2804--2814},
 publisher = {Curran Associates},
 title = {Unsupervised Learning of Shape and Pose with Differentiable Point Clouds},
 year = {2018}
}

repository: eldar/personal-website

repo_name: eldar/personal-website


text:
@Book{xie2015,
  title = {Dynamic Documents with {R} and knitr},
  author = {Yihui Xie},
  publisher = {Chapman and Hall/CRC},
  address = {Boca Raton, Florida},
  year = {2015},
  edition = {2nd},
  note = {ISBN 978-1498716963},
  url = {http://yihui.name/knitr/},
}

@article{ellison2004primer,
  title={A primer of ecological statistics},
  author={Ellison, GN and Gotelli, NJ},
  journal={Sinauer, Sunderland, Massachusetts, USA},
  year={2004}
}

@book{wickham2016r,
  title={R for data science: import, tidy, transform, visualize, and model data},
  author={Wickham, Hadley and Grolemund, Garrett},
  year={2016},
  publisher={" O'Reilly Media, Inc."},
  url = {http://r4ds.had.co.nz/}
}

@article{broman2018data,
  title={Data organization in spreadsheets},
  author={Broman, Karl W and Woo, Kara H},
  journal={The American Statistician},
  volume={72},
  number={1},
  pages={2--10},
  year={2018},
  publisher={Taylor \& Francis}
}

@article{parra2007tendencias,
  title={Tendencias Gen{\'e}ticas y Fenot{\'\i}picas de Caracter{\'\i}sticas de Crecimiento en el Ganado Brahman de Registro de M{\'e}xico.},
  author={Parra-Bracamonte, Gaspar Manuel and Mart{\'\i}nez-Gonz{\'a}lez, Juan Carlos and Garc{\'\i}a-Esquivel, Francisco Javier and Gonz{\'a}lez-Reyna, Arnoldo and Briones-Encinia, Florencio and Cienfuegos-Rivas, Eugenia Guadalupe},
  journal={Revista Cient{\'\i}fica},
  volume={17},
  number={3},
  pages={262--267},
  year={2007},
  publisher={Universidad del Zulia}
}

@article{madden2009assessing,
  title={Assessing heterogeneity in the relationship between wheat yield and fusarium head blight intensity using random-coefficient mixed models},
  author={Madden, LV and Paul, PA},
  journal={Phytopathology},
  volume={99},
  number={7},
  pages={850--860},
  year={2009},
  publisher={Am Phytopath Society}
}

@article{10.1371/journal.pbio.1002128,
    author = {Weissgerber, Tracey L. AND Milic, Natasa M. AND Winham, Stacey J. AND Garovic, Vesna D.},
    journal = {PLOS Biology},
    publisher = {Public Library of Science},
    title = {Beyond Bar and Line Graphs: Time for a New Data Presentation Paradigm},
    year = {2015},
    month = {04},
    volume = {13},
    url = {https://doi.org/10.1371/journal.pbio.1002128},
    pages = {1-10},
    abstract = {A systematic review of research articles reveals widespread poor practice in the presentation of continuous data. The authors recommend training for investigators and supply templates for easy use.},
    number = {4},
    doi = {10.1371/journal.pbio.1002128}
}

@article{doi:10.1111/j.1476-5381.2011.01251.x,
author = {Drummond, GB and Vowler, SL},
title = {Show the data, don't conceal them},
journal = {British Journal of Pharmacology},
volume = {163},
number = {2},
pages = {208-210},
keywords = {data presentation, graphical display, distrubution of data, confidence limits, standard deviation, standard error of mean},
doi = {10.1111/j.1476-5381.2011.01251.x},
url = {https://bpspubs.onlinelibrary.wiley.com/doi/abs/10.1111/j.1476-5381.2011.01251.x},
eprint = {https://bpspubs.onlinelibrary.wiley.com/doi/pdf/10.1111/j.1476-5381.2011.01251.x},
year = {2011}
}

@article{madden2007study,
  title={The study of plant disease epidemics},
  author={Madden, Laurence V and Hughes, Gareth and Van Den Bosch, Frank},
  year={2007},
  publisher={Am Phytopath Society}
}


text:
package nat

import (
	"github.com/NebulousLabs/go-upnp"
)

// LocalPortMappingInfo denotes a single port being forwarde on the
// UPnP interface.
type LocalPortMappingInfo struct {
	LocalPort      uint16
	ExternalPort   uint16
	ExternalIP     string
	RouterLocation string
}

// Close clears a port from remaining open.
func (m *LocalPortMappingInfo) Close() error {
	gateway, err := upnp.Load(m.RouterLocation)
	if err == nil {
		return gateway.Clear(m.ExternalPort)
	}

	return err
}

// ForwardPort accesses the UPnP interface (should it be available) and port-forwards
// a specified local port.
func ForwardPort(localPort uint16) (*LocalPortMappingInfo, error) {
	gateway, err := upnp.Discover()
	if err != nil {
		return nil, err
	}

	ip, err := gateway.ExternalIP()
	if err != nil {
		return nil, err
	}

	err = gateway.Forward(localPort, "Noise")
	if err != nil {
		return nil, err
	}

	return &LocalPortMappingInfo{
		LocalPort:      localPort,
		ExternalPort:   localPort, // TODO: Allow mapping to a different port
		ExternalIP:     ip,
		RouterLocation: gateway.Location(),
	}, nil
}

repository: abbychau/noise

repo_name: abbychau/noise


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

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

@article{Donahue2014,
abstract = {We evaluate whether features extracted from the activation of a deep convolutional network trained in a fully supervised fashion on a large, fixed set of object recognition tasks can be re-purposed to novel generic tasks. Our generic tasks may differ significantly from the originally trained tasks and there may be insufficient labeled or unlabeled data to conventionally train or adapt a deep architecture to the new tasks. We investigate and visualize the semantic clustering of deep convolutional features with respect to a variety of such tasks, including scene recognition, domain adaptation, and fine-grained recognition challenges. We compare the efficacy of relying on various network levels to define a fixed feature, and report novel results that significantly outperform the state-of-the-art on several important vision challenges. We are releasing DeCAF, an open-source implementation of these deep convolutional activation features, along with all associated network parameters to enable vision researchers to be able to conduct experimentation with deep representations across a range of visual concept learning paradigms.},
archivePrefix = {arXiv},
arxivId = {1310.1531},
author = {Donahue, Jeff and Jia, Yangqing and Vinyals, Oriol and Hoffman, Judy and Zhang, Ning and Tzeng, Eric and Darrell, Trevor},
eprint = {1310.1531},
file = {:Users/sepmein/Qsync/Papers/Donahue et al.{\_}2014{\_}DeCAF A Deep Convolutional Activation Feature for Generic Visual Recognition.pdf:pdf},
isbn = {9781634393973},
journal = {Icml},
pages = {647--655},
title = {{DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition}},
url = {http://arxiv.org/abs/1310.1531},
volume = {32},
year = {2014}
}

license: Unlicense

repository: sepmein/references

repo_name: sepmein/references


text:
---
---

@string{}

@book{einstein1956investigations,
 bibtex_show={true},
 title={Investigations on the Theory of the Brownian Movement},
 author={Einstein, Albert},
 year={1956},
 publisher={Courier Corporation,}
}

@article{einstein1950meaning,
 abbr={AJP},
 bibtex_show={true},
 title={The meaning of relativity},
 author={Einstein, Albert and Taub, AH},
 journal={American Journal of Physics,},
 volume={18},
 number={6},
 pages={403--404},
 year={1950},
 publisher={American Association of Physics Teachers,}
}

@article{einstein1905molekularkinetischen,
 title={{\"U}ber die von der molekularkinetischen Theorie der W{\"a}rme geforderte Bewegung von in ruhenden Fl{\"u}ssigkeiten suspendierten Teilchen},
 author={Einstein, A.},
 journal={Annalen der physik,},
 volume={322},
 number={8},
 pages={549--560},
 year={1973},
 publisher={Wiley Online Library}
}

@article{einstein1905movement,
 abbr={Ann. Phys.},
 title={Un the movement of small particles suspended in statiunary liquids required by the molecular-kinetic theory 0f heat},
 author={Einstein, A.},
 journal={Ann. Phys.,},
 volume={17},
 pages={549--560},
 year={1973}
}

@article{einstein1905electrodynamics,
 title={On the electrodynamics of moving bodies},
 author={Einstein, A.},
 year={1973}
}


text:
package hashcat

import (
	"fmt"
	"os"
	"path/filepath"
	"runtime"
	"unsafe"

	"github.com/fireeye/gocat"
	"github.com/fireeye/gocat/hcargp"
	"github.com/fireeye/gocat/restoreutil"
	"github.com/fireeye/gocrack/opencl"
	"github.com/fireeye/gocrack/server/rpc"
	"github.com/fireeye/gocrack/server/storage"
	"github.com/fireeye/gocrack/shared"
	"github.com/fireeye/gocrack/worker"

	"github.com/rs/zerolog/log"
)

// HashcatVersion contains the version of hashcat linked into the worker binary.
// It is set via a linkerflag
var HashcatVersion string

// HashcatEngine implements engines.EngineImpl with Hashcat as the password cracker.
type HashcatEngine struct {
	TaskID            string
	HashcatSharedPath string
	SessionPath       string

	// Task Options
	TaskFilePath   string
	DictionaryFile string
	MasksFile      string
	RulesFile      string
	Options        shared.HashcatUserOptions
	Upstream       rpc.GoCrackRPC
	CLDevices      storage.CLDevices

	engine *gocat.Hashcat
	// if isBruteForce is true, we'll allow for a checkpoint
	isBruteForce bool
}

// Initialize the hashcat engine
func (s *HashcatEngine) Initialize() error {
	hc, err := gocat.New(gocat.Options{
		SharedPath: s.HashcatSharedPath,
	}, s.callback())

	if err != nil {
		return err
	}
	s.engine = hc
	return nil
}

func (s *HashcatEngine) callback() gocat.EventCallback {
	return func(hc unsafe.Pointer, payload interface{}) {
		switch pl := payload.(type) {
		case gocat.LogPayload:
			fmt.Printf("LOG [%s] %s\n", pl.Level, pl.Message)
		case gocat.ActionPayload:
			fmt.Printf("ACTION [%d] %s\n", pl.HashcatEvent, pl.Message)
		case gocat.CrackedPayload:
			s.Upstream.SavedCrackedPassword(rpc.CrackedPasswordRequest{
				TaskID:    s.TaskID,
				Hash:      pl.Hash,
				Value:     pl.Value,
				CrackedAt: pl.CrackedAt,
			})
		case gocat.FinalStatusPayload:
			if pl.AllHashesCracked {
				if err := s.Upstream.ChangeTaskStatus(rpc.ChangeTaskStatusRequest{
					TaskID:    s.TaskID,
					NewStatus: storage.TaskStatusFinished,
				}); err != nil {
					log.Error().Err(err).Msg("All hashes cracked but failed to set final status")
				}
				return
			}

			// Safeguard us from panic'ing here when the task fails to start
			if pl.Status == nil {
				return
			}

			var tstatus storage.TaskStatus
			// https://github.com/hashcat/hashcat/blob/master/src/status.c#L22-L35
			switch pl.Status.Status {
			case "Cracked":
				tstatus = storage.TaskStatusFinished
			case "Exhausted":
				tstatus = storage.TaskStatusExhausted
			case "Unknown! Bug!":
				tstatus = storage.TaskStatusError
			case "Quit", "Aborted", "Paused", "Aborted (Checkpoint)", "Aborted (Runtime)":
				fallthrough
			default:
				tstatus = storage.TaskStatusStopped
			}

			if err := s.Upstream.ChangeTaskStatus(rpc.ChangeTaskStatusRequest{
				TaskID:    s.TaskID,
				NewStatus: tstatus,
			}); err != nil {
				log.Error().Err(err).Str("new_status", string(tstatus)).Msg("Failed to change task status")
			}

			if err := s.Upstream.SendTaskStatus(rpc.TaskStatusUpdate{
				TaskID:  s.TaskID,
				Payload: pl.Status,
				Engine:  storage.WorkerHashcatEngine,
				Final:   true,
			}); err != nil {
				log.Error().Err(err).Msg("Failed to send task status update to server")
			}
		}
	}
}

// Start the hashcat engine
func (s *HashcatEngine) Start() error {
	var opts hcargp.HashcatSessionOptions

	restoreFilePath := filepath.Join(s.SessionPath, fmt.Sprintf("%s.restore", s.TaskID))
	outFilePath := filepath.Join(s.SessionPath, fmt.Sprintf("%s.outfile", s.TaskID))

	// Get a list of active devices on this machine
	machDevices, err := worker.GetAvailableDevices()
	if err != nil {
		return err
	}

	// Grab the checkpoint from the server if one exists
	if err := getCheckpoint(s.Upstream, s.TaskID, restoreFilePath); err != nil && err != rpc.ErrNoCheckpoint {
		return err
	}

	// If the restore file exists, set the restore flag
	if _, err := os.Stat(restoreFilePath); !os.IsNotExist(err) {
		// When restoring, we can really only set restore related options
		opts = hcargp.HashcatSessionOptions{
			RestoreSession:         hcargp.GetBoolPtr(true),
			SessionName:            hcargp.GetStringPtr(s.TaskID),
			RestoreFilePath:        hcargp.GetStringPtr(restoreFilePath),
			OptimizedKernelEnabled: hcargp.GetBoolPtr(true),
		}

		checkpoint, err := restoreutil.ReadRestoreFile(restoreFilePath)
		if err != nil {
			return err
		}

		log.Debug().
			Uint32("version", checkpoint.Version).
			Uint32("argc", checkpoint.ArgCount).
			Strs("args", checkpoint.Args).
			Msg("Parsed Restore File")

		changed, err := ModifyRestoreFileDevices(&checkpoint, s.CLDevices, machDevices)
		if err != nil {
			return err
		}

		if changed {
			if err := changeLocalCheckpoint(checkpoint, restoreFilePath); err != nil {
				return err
			}
		}
	} else {
		// Not a restore
		opts = hcargp.HashcatSessionOptions{
			AttackMode:             hcargp.GetIntPtr(int(s.Options.AttackMode)),
			HashType:               hcargp.GetIntPtr(s.Options.HashType),
			PotfileDisable:         hcargp.GetBoolPtr(true),
			InputFile:              s.TaskFilePath,
			SessionName:            hcargp.GetStringPtr(s.TaskID),
			RestoreFilePath:        hcargp.GetStringPtr(restoreFilePath),
			OutfilePath:            hcargp.GetStringPtr(outFilePath),
			OptimizedKernelEnabled: hcargp.GetBoolPtr(true),
		}

		if s.MasksFile != "" && s.Options.AttackMode == shared.AttackModeBruteForce {
			opts.DictionaryMaskDirectoryInput = hcargp.GetStringPtr(s.MasksFile)
			s.isBruteForce = true
		}

		if s.RulesFile != "" && s.Options.AttackMode == shared.AttackModeStraight {
			opts.RulesFile = hcargp.GetStringPtr(s.RulesFile)
		}

		if s.DictionaryFile != "" && s.Options.AttackMode == shared.AttackModeStraight {
			opts.DictionaryMaskDirectoryInput = hcargp.GetStringPtr(s.DictionaryFile)
		}

		if len(s.CLDevices) > 0 {
			var devTypes []int
			var dGPUAdded, dCPUAdded bool

			for _, requestedDevice := range s.CLDevices {
				dev, ok := machDevices[requestedDevice]
				if !ok {
					return fmt.Errorf("`%d` is not an available device on this platform", requestedDevice)
				}

				switch dev.Type {
				case opencl.DeviceTypeCPU:
					if !dCPUAdded {
						devTypes = append(devTypes, 1)
						dCPUAdded = true
					}
				case opencl.DeviceTypeGPU:
					if !dGPUAdded {
						devTypes = append(devTypes, 2)
						dGPUAdded = true
					}
				}
			}

			opts.OpenCLDevices = hcargp.GetStringPtr(s.CLDevices.String())
			opts.OpenCLDeviceTypes = hcargp.GetStringPtr(shared.IntSliceToString(devTypes))
		}
	}

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	defer saveCheckpoint(s.Upstream, s.TaskID, restoreFilePath)
	return s.engine.RunJobWithOptions(opts)
}

// Stop the hashcat engine. If the engine is brute forcing, we attempt to stop at a checkpoint otherwise we abort
func (s *HashcatEngine) Stop() error {
	if s.engine == nil {
		return nil
	}

	if s.isBruteForce {
		// Attempt to checkpoint... if we cant, immediately abort
		if err := s.engine.StopAtCheckpoint(); err != nil {
			s.engine.AbortRunningTask()
			return err
		}
	}
	s.engine.AbortRunningTask()
	return nil
}

// GetStatus returns the status of the engine
func (s *HashcatEngine) GetStatus() interface{} {
	return s.engine.GetStatus()
}

// Cleanup releases the engine and cleans up any allocated resources
func (s *HashcatEngine) Cleanup() {
	s.engine.Free()
}

repository: FDlucifer/gocrack

repo_name: FDlucifer/gocrack


text:
DESCRIPTION = "User-space keyboard daemon for external keyboards"
HOMEPAGE = "http://project.linuxtogo.org/projects/kbdd"
SECTION = "console/utils"
LICENSE = "GPLv2"
DEPENDS = "virtual/kernel"
RRECOMMENDS_${PN} = "kernel-module-keybdev kernel-module-uinput"
SRCDATE = "20061019"
PV = "0.12+svn${SRCDATE}"
PR = "r0"

SRC_URI = "svn://projects.linuxtogo.org/svn/kbdd;module=trunk;proto=svn \
           file://kbdd.init \
           file://kbdd.conf \
           file://kbdd-modules"
S = "${WORKDIR}/trunk"

inherit update-rc.d

INITSCRIPT_NAME = "kbdd"
INITSCRIPT_PARAMS = "defaults"

do_compile() {
	oe_runmake CFLAGS="${CFLAGS} -DVERSION=\\\"${PV}\\\""
}

do_install() {
	install -d ${D}${sbindir}
	install -d ${D}${docdir}/kbdd/
	install -m 0755 kbdd ${D}${sbindir}/
	install -m 0644 README ${D}${docdir}/kbdd/
	install -d ${D}${sysconfdir}
	install -m 0644 ${WORKDIR}/kbdd.conf ${D}${sysconfdir}
	install -d ${D}${sysconfdir}/init.d
	install -m 0755 ${WORKDIR}/kbdd.init ${D}${sysconfdir}/init.d/kbdd
	install -d ${D}${sysconfdir}/modutils
	install -m 0644 ${WORKDIR}/kbdd-modules ${D}${sysconfdir}/modutils/
}

pkg_postinst () {
	update-modules
}

pkg_postrm () {
	update-modules
}


text:
package main

import (
	"context"
	"fmt"
	"gitlab.com/NebulousLabs/go-upnp"
	"log"
)

func main() {
	device, err := upnp.DiscoverCtx(context.Background())
	if err != nil {
		log.Fatal(err)
	}

	ip, err := device.ExternalIP()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println("External IP address:", ip)

	err = device.Forward(9001, "go-upnp-forward-port")
	if err != nil {
		log.Fatal(err)
	}
}

repository: awsassets/go-upnp-forward-port

repo_name: awsassets/go-upnp-forward-port


text:
@article{jia2022deep,
  title={Deep learning and physics-based modeling for the optimization of ice-based thermal energy systems in cooling plants},
  author={Jia, Lizhi and Liu, Junjie and Chong, Adrian and Dai, Xilei},
  journal={Applied Energy},
  volume={322},
  pages={119443},
  year={2022},
  doi={https://doi.org/10.1016/j.apenergy.2022.119443},
  publisher={Elsevier}
}

repository: ideas-lab-nus/lab-website

repo_name: ideas-lab-nus/lab-website

gha_language: HTML


text:
// Copyright 2019 tree xie
//
// 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 server

import (
	"context"
	"testing"

	"github.com/stretchr/testify/assert"
	"github.com/vicanso/tiny/pb"
)

func TestDoOptim(t *testing.T) {
	gs := &GRPCServer{}
	t.Run("output type is invalid", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Equal(errOutputTypeIsInvalid, err)
		assert.Nil(reply)
	})

	t.Run("data is nil", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Output: pb.Type_GZIP,
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Equal(errDataIsNil, err)
		assert.Nil(reply)
	})

	t.Run("output type is invalid", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Source:  pb.Type_JPEG,
			Output:  pb.Type_GZIP,
			Data:    jpegData,
			Quality: 10,
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Equal(errOutputTypeIsInvalid, err)
		assert.Nil(reply)
	})

	t.Run("optim to jpeg", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Source:  pb.Type_JPEG,
			Output:  pb.Type_JPEG,
			Data:    jpegData,
			Quality: 10,
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Nil(err)
		assert.Equal(pb.Type_JPEG, reply.Output)
		assert.NotNil(reply.Data)
	})

	t.Run("optim to png", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Source:  pb.Type_JPEG,
			Output:  pb.Type_PNG,
			Data:    jpegData,
			Quality: 10,
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Nil(err)
		assert.Equal(pb.Type_PNG, reply.Output)
		assert.NotNil(reply.Data)
	})

	t.Run("optim to webp", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Source:  pb.Type_JPEG,
			Output:  pb.Type_WEBP,
			Data:    jpegData,
			Quality: 10,
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Nil(err)
		assert.Equal(pb.Type_WEBP, reply.Output)
		assert.NotNil(reply.Data)
	})

	t.Run("optim to gzip", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Output:  pb.Type_GZIP,
			Data:    []byte("abcd"),
			Quality: 6,
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Nil(err)
		assert.Equal(pb.Type_GZIP, reply.Output)
		assert.NotNil(reply.Data)
	})

	t.Run("optim to br", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Output:  pb.Type_BR,
			Data:    []byte("abcd"),
			Quality: 6,
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Nil(err)
		assert.Equal(pb.Type_BR, reply.Output)
		assert.NotNil(reply.Data)
	})

	t.Run("optim to snappy", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Output: pb.Type_SNAPPY,
			Data:   []byte("abcd"),
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Nil(err)
		assert.Equal(pb.Type_SNAPPY, reply.Output)
		assert.NotNil(reply.Data)
	})
	t.Run("optim to lz4", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Output:  pb.Type_LZ4,
			Data:    []byte("abcd"),
			Quality: 6,
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Nil(err)
		assert.Equal(pb.Type_LZ4, reply.Output)
		assert.NotNil(reply.Data)
	})

	t.Run("optim to zstd", func(t *testing.T) {
		assert := assert.New(t)
		req := &pb.OptimRequest{
			Output:  pb.Type_ZSTD,
			Data:    []byte("abcd"),
			Quality: 6,
		}
		ctx := context.Background()
		reply, err := gs.DoOptim(ctx, req)
		assert.Nil(err)
		assert.Equal(pb.Type_ZSTD, reply.Output)
		assert.NotNil(reply.Data)
	})
}

repository: vicanso/tiny

repo_name: vicanso/tiny


text:
package test

import (
	"time"

	"github.com/juntaki/transparent"
)

// NewSource returns Source
func NewSource(wait time.Duration) transparent.Layer {
	test := NewStorage(wait)
	layer, _ := transparent.NewLayerSource(test)
	return layer
}