text:
package feed

import (
	"sync"
	"time"

	"github.com/AlexKLWS/youtube-audio-stream/models"
)

type ProgressUpdateFeed struct {
	mu       sync.RWMutex
	updaters []chan models.ProgressUpdate
	closed   bool
}

func New() *ProgressUpdateFeed {
	ps := &ProgressUpdateFeed{}
	return ps
}

func (f *ProgressUpdateFeed) Subscribe() <-chan models.ProgressUpdate {
	f.mu.Lock()
	defer f.mu.Unlock()

	if f.closed {
		return nil
	}

	ch := make(chan models.ProgressUpdate)
	f.updaters = append(f.updaters, ch)
	return ch
}

func (f *ProgressUpdateFeed) Send(update models.ProgressUpdate) {
	f.mu.RLock()
	defer f.mu.RUnlock()

	if f.closed {
		return
	}

	for _, ch := range f.updaters {
		go func(ch chan models.ProgressUpdate) {
			ch <- update
		}(ch)
	}
}

func (f *ProgressUpdateFeed) Close() {
	// TODO: This is a hack to make sure all active channels send updates to clients
	// before closing
	time.Sleep(500 * time.Millisecond)

	f.mu.Lock()
	defer f.mu.Unlock()

	if !f.closed {
		f.closed = true
		for _, ch := range f.updaters {
			go func(c chan models.ProgressUpdate) {
				// We go through all pending channel updates and "pop" the values
				// before closing channel in order to avoid panic
				for {
					noValuesPending := false
					select {
					case _, ok := <-c:
						if !ok {
							noValuesPending = true
						}
					default:
						noValuesPending = true
					}
					if noValuesPending {
						break
					}
				}
				close(c)
			}(ch)
		}
	}
}

repository: AlexKLWS/youtube-audio-stream

repo_name: AlexKLWS/youtube-audio-stream


text:
/*
Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file

SPDX-License-Identifier: Apache-2.0
*/

// Code generated by lister-gen. DO NOT EDIT.

package v1alpha1

import (
	v1alpha1 "github.com/gardener/cert-management/pkg/apis/cert/v1alpha1"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/labels"
	"k8s.io/client-go/tools/cache"
)

// CertificateRevocationLister helps list CertificateRevocations.
// All objects returned here must be treated as read-only.
type CertificateRevocationLister interface {
	// List lists all CertificateRevocations in the indexer.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*v1alpha1.CertificateRevocation, err error)
	// CertificateRevocations returns an object that can list and get CertificateRevocations.
	CertificateRevocations(namespace string) CertificateRevocationNamespaceLister
	CertificateRevocationListerExpansion
}

// certificateRevocationLister implements the CertificateRevocationLister interface.
type certificateRevocationLister struct {
	indexer cache.Indexer
}

// NewCertificateRevocationLister returns a new CertificateRevocationLister.
func NewCertificateRevocationLister(indexer cache.Indexer) CertificateRevocationLister {
	return &certificateRevocationLister{indexer: indexer}
}

// List lists all CertificateRevocations in the indexer.
func (s *certificateRevocationLister) List(selector labels.Selector) (ret []*v1alpha1.CertificateRevocation, err error) {
	err = cache.ListAll(s.indexer, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.CertificateRevocation))
	})
	return ret, err
}

// CertificateRevocations returns an object that can list and get CertificateRevocations.
func (s *certificateRevocationLister) CertificateRevocations(namespace string) CertificateRevocationNamespaceLister {
	return certificateRevocationNamespaceLister{indexer: s.indexer, namespace: namespace}
}

// CertificateRevocationNamespaceLister helps list and get CertificateRevocations.
// All objects returned here must be treated as read-only.
type CertificateRevocationNamespaceLister interface {
	// List lists all CertificateRevocations in the indexer for a given namespace.
	// Objects returned here must be treated as read-only.
	List(selector labels.Selector) (ret []*v1alpha1.CertificateRevocation, err error)
	// Get retrieves the CertificateRevocation from the indexer for a given namespace and name.
	// Objects returned here must be treated as read-only.
	Get(name string) (*v1alpha1.CertificateRevocation, error)
	CertificateRevocationNamespaceListerExpansion
}

// certificateRevocationNamespaceLister implements the CertificateRevocationNamespaceLister
// interface.
type certificateRevocationNamespaceLister struct {
	indexer   cache.Indexer
	namespace string
}

// List lists all CertificateRevocations in the indexer for a given namespace.
func (s certificateRevocationNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.CertificateRevocation, err error) {
	err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) {
		ret = append(ret, m.(*v1alpha1.CertificateRevocation))
	})
	return ret, err
}

// Get retrieves the CertificateRevocation from the indexer for a given namespace and name.
func (s certificateRevocationNamespaceLister) Get(name string) (*v1alpha1.CertificateRevocation, error) {
	obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1alpha1.Resource("certificaterevocation"), name)
	}
	return obj.(*v1alpha1.CertificateRevocation), nil
}

repository: gardener/cert-management

license_type: permissive

repo_name: gardener/cert-management

branch_name: refs/heads/master

gha_license_id: NOASSERTION

gha_language: Go

extension: go


text:
@article{DELAROSA2004929,
title = {A land evaluation decision support system (MicroLEIS DSS) for agricultural soil protection: With special reference to the Mediterranean region},
journal = {Environmental Modelling \& Software},
volume = {19},
number = {10},
pages = {929-942},
year = {2004},
issn = {1364-8152},
doi = {10.1016/j.envsoft.2003.10.006},
author = {D {De la Rosa} and F Mayol and E Diaz-Pereira and M Fernandez and D {de la Rosa}},
keywords = {Expert system, GIS-based spatialization, Land attribute database, Land suitability, Land vulnerability, Neural network, Optimization tool},
abstract = {Soil protection requires the improvement of agricultural land use, its planning and its management, in order to achieve a sustainable development. Land evaluation analysis is considered an interface between land resources survey and land use planning and management. The application of information and communication technology has exerted an impact on sustainable land use decision support. Since the early 1990s and following this trend, MicroLEIS (Mediterranean Land Evaluation Information System) has evolved towards an agro-ecological decision support system. The original project corresponds to a set of qualitative land evaluation methods converted to PC computer programs to automate their application. Today, MicroLEIS DSS is a set of useful tools for decision-making which in a wide range of agro-ecological schemes. The design philosophy follows a toolkit approach, integrating many software tools: databases, statistics, expert systems, neural networks, Web and GIS applications, and other information technologies. The MicroLEIS DSS system, in English and Spanish simultaneously, is available ready-for-use from the following website address: www.microleis.com. The new, re-designed MicroLEIS DSS will provide considerable opportunities for greater cooperation in interdisciplinary research and in the application of knowledge to solve problems of soil protection.}
}

@article{ELSHEIKH201398,
title = {Agriculture Land Suitability Evaluator (ALSE): A decision and planning support tool for tropical and subtropical crops},
journal = {Computers and Electronics in Agriculture},
volume = {93},
pages = {98-110},
year = {2013},
issn = {0168-1699},
doi = {10.1016/j.compag.2013.02.003},
author = {Ranya Elsheikh and Abdul Rashid B. {Mohamed Shariff} and Fazel Amiri and Noordin B. Ahmad and Siva Kumar Balasundram and Mohd Amin Mohd Soom},
keywords = {Biophysical modeling, Expert system, GIS, Land evaluation, Land use planning, Multi-criteria analysis},
abstract = {Agricultural land suitability evaluation for crop production is a process that requires specialized geo-environmental information and the expertise of a computer scientist to analyze and interpret the information. This paper presents ALSE, an intelligent system for assessing land suitability for different types of crops in tropical and subtropical regions (e.g. mango, banana, papaya, citrus, and guava) based on geo-environmental factors that automates the process of evaluation and illustrates the results on an attribute table. Its main features include support of GIS capabilities on the digital map of an area with the FAO-SYS framework model with some necessary modifications to suit the local environmental conditions for land evaluation, and the support of expert knowledge through on spatial tools to derive criteria weights with their relative importance. A dynamic program for calculation of eigenvalues and eigenvectors of a weighting matrix is provided. Expertise and knowledge help ensure that ALSE databases represent realistic, practicable and functional systems. It is useful for decision makers to determine the quality of land for agricultural uses and is intended as a decision and planning support. Responsibility for any decisions based partly or wholly on the output of ALSE rests with the decision maker. ALSE ensures that the results are interpreted correctly within the relevant context, and contributes by maximizing land-use planning and decision support.}
}

@article{Ihaka,
author = { Ross   Ihaka  and  Robert   Gentleman },
title = {R: A Language for Data Analysis and Graphics},
journal = {Journal of Computational and Graphical Statistics},
volume = {5},
number = {3},
pages = {299-314},
year  = {1996},
publisher = {Taylor \& Francis},
doi = {10.1080/10618600.1996.10474713},
eprint = {
        https://www.tandfonline.com/doi/pdf/10.1080/10618600.1996.10474713

}

}
@article{KALOGIROU200289,
title = {Expert systems and GIS: an application of land suitability evaluation},
journal = {Computers, Environment and Urban Systems},
volume = {26},
number = {2},
pages = {89-112},
year = {2002},
issn = {0198-9715},
doi = {10.1016/S0198-9715(01)00031-X},
author = {S Kalogirou},
keywords = {Physical and Economic land evaluation, Expert Systems in Agriculture, Custom GIS},
abstract = {In this paper expert systems and geographical information systems technologies are combined to help with an implementation of a land suitability evaluation model. The result is the LEIGIS software, which allows empirical work within the framework of this paper. The model used is based on the FAO land classification for crops, and data which describe an agricultural area in terms of soil mechanics and environment. The land evaluation has two parts; the physical evaluation and the economic evaluation. For the physical evaluation of the land, data for 17 land characteristics have been used and a Boolean classification method has been applied. The implementation includes models for general cultivation and five (wheat, barley, maize, seed cotton, sugar beet) specific crops. A new interpolation function is introduced to map values to scores in terms of land characteristics. The economic evaluation includes income-maximization taking into account market restrictions. The expert system has been designed to help with the evaluation of land and to allow alteration in its rules based on different performance observed in local areas. The GIS functions help in managing the spatial data and visualizing the results. The software developed allows the evaluation and presentation of any equivalent spatial dataset and does not require special computer skills.}
}

@article{ZADEH1965338,
title = {Fuzzy sets},
journal = {Information and Control},
volume = {8},
number = {3},
pages = {338-353},
year = {1965},
issn = {0019-9958},
doi = {10.1016/S0019-9958(65)90241-X},
author = {L.A. Zadeh},
abstract = {A fuzzy set is a class of objects with a continuum of grades of membership. Such a set is characterized by a membership (characteristic) function which assigns to each object a grade of membership ranging between zero and one. The notions of inclusion, union, intersection, complement, relation, convexity, etc., are extended to such sets, and various properties of these notions in the context of fuzzy sets are established. In particular, a separation theorem for convex fuzzy sets is proved without requiring that the fuzzy sets be disjoint.}
}

@Manual{rmanual,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2020},
}

@article{JohnsonFuzzy,
title = {Development of a simulation based land evaluation system using crop modelling, expert systems and risk analysis},
journal = {Soil Use and Management},
volume = {7},
year = {1991},
doi = {10.1111/j.1475-2743.1991.tb00881.x},
author = {A. K. L. Johnson and R. A. Cramb},
abstract = {Current methods of agricultural land evaluation in Queensland and other parts of Australia have been criticized for their inflexibility and lack of attention to costs (both private and social) associated with particular land uses. These deficiencies can limit the usefulness of land evaluation procedures in defining land capability and suitability for farm and regional land use planning. This paper outlines a new method based on soil potential ratings, that incorporates biophysical crop simulation modelling, expert systems and risk analysis. The technique is able to integrate biophysical and economic data in a measure which can be readily computed, updated and communicated to land managers.
TI - Development of a simulation based land evaluation system using crop modelling, expert systems and risk analysis}
}

@manual{YenLuset,
title = {LUSET: Land Use Suitability Evaluation Tool User’s Guide},
organization = {International Rice Research Institute},
year = {2006},
author = {B.T. Yen and K.S. Pheng and C.T. Hoanh},
}
@manual{SysLand,
title = {Land Evaluation Part III – Crop Requirement},
organization = {Belgium General Administration for Development Cooperation. Agricultural Productions No. 7},
year = {1993},
author = {Ir. C. Sys and E. Van Ranst and J. Debaveve and F. Beernaert},
}

license: MIT

repository: alstat/ALUES

repo_name: alstat/ALUES

gha_language: R

extension: bib