text:
SECTION = "console/network"
DESCRIPTION = "A server-side, HTML-embedded scripting language. This package provides the CGI."
LICENSE = "PHP"
DEPENDS = "zlib libxml2 mysql virtual/libiconv php-native"

SRC_URI = "http://us2.php.net/distributions/php-${PV}.tar.bz2\
	       	file://autotools.patch;patch=1 \
		file://acinclude-xml2-config.patch;patch=1 \
                file://pear-makefile.patch;patch=1 \
	 "
S = "${WORKDIR}/php-${PV}"
PR = "r1"

inherit autotools

export THREADS="pthread"
export LIBS=" -lpthread "

CFLAGS += " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
EXTRA_OECONF = "    --without-iconv \
 		    --enable-discard-path \
		    --enable-sockets \
    		    --enable-memory-limit \
    		    --enable-wddx \
                    --enable-embedded-mysqli \
                    --enable-magic-quotes \
    		    --with-zlib \
                    --with-mysql="${STAGING_DIR}/${TARGET_SYS}" \
                    --with-mysqli="${STAGING_BINDIR_NATIVE}/mysql_config" \
"

# Uncomment the following two lines, and comment the above to enable PEAR
EXTRA_OECONF += " --with-pear-php-cli=${STAGING_BINDIR} --with-libxml-dir=${STAGING_BINDIR}"

export LD_LIBRARY_PATH = "${STAGING_LIBDIR}"
export PHP_NATIVE_DIR="${STAGING_BINDIR_NATIVE}"
export PHP_PEAR_PHP_BIN="/usr/bin/php"

acpaths = ""

do_configure_append() {
    find ${S} -type f | xargs sed -i 's:I/usr/include:I${STAGING_INCDIR}:g'
}

do_install  () {
	oe_runmake 'INSTALL_ROOT=${D}' install
}

PACKAGES = "${PN}-dbg \
            ${PN}-cli \
            ${PN}-pear \
            ${PN}-dev \
            ${PN} \
"

FILES_${PN}-dbg            ="/usr/bin/.debug"

FILES_${PN}-cli            ="/usr/bin/php"

FILES_${PN}-pear            ="/usr/bin/pear* /usr/bin/pecl \
                             /usr/lib/php/PEAR \
                             /usr/lib/php/PEAR.php \
                             /usr/lib/php/System.php /usr/lib/php/peclcmd.php /usr/lib/php/pearcmd.php \
                             /usr/lib/php/.channels  /usr/lib/php/.channels/.alias  \
                             /usr/lib/php/.channels\__uri.reg \
                             /usr/lib/php/.channels\pear.php.net.reg /usr/lib/php/.channels/pecl.php.net.reg \
                             /usr/lib/php/.registry \
                             /usr/lib/php/Archive/Tar.php \
                             /usr/lib/php/Console/Getopt.php /usr/lib/php/OS/Guess.php \
                             /usr/lib/php/.depdb /usr/lib/php/.depdblock /usr/lib/php/.filemap \
                             /usr/lib/php/.lock"

FILES_${PN}-dev            ="/usr/include/php /usr/include/build \
                            /usr/bin/phpize /usr/bin/php-config"

FILES_${PN}                 ="/usr/lib/php"
FILES_${PN}                +="/usr/bin"

RDEPENDS_${PN}-pear         =${PN}
RDEPENDS_${PN}-cli          =${PN}
RDEPENDS_${PN}-dev          =${PN}

repository: jdegges/gumstix-pip-oe

repo_name: jdegges/gumstix-pip-oe


text:
$(document).ready(function() {

    var link;

    $('div.help-modal:ui-dialog').dialog('destroy');

    $('div.help-modal').dialog({
        modal: true,
        autoOpen: false,
        draggable: false,
        resizeable: false,
        closeText: 'Close help',
        dialogClass: 'modal',
        width: 600,
        maxWidth: 600,
        maxHeight: 400,
        show: 'fade',
        hide: 'fade',
        buttons: {
            "OK": function() {
                $(this).dialog('close');
            }
        }
    });

    $('.activate-help-modal').click(function() {
        $('div.help-modal').dialog('open');
        return false;
    });

    $('div.delete-alert-dialog:ui-dialog').dialog('destroy');

    $('div.delete-alert-dialog').dialog({
        modal: true,
        autoOpen: false,
        draggable: false,
        resizeable: false,
        dialogClass: 'modal',
        show: 'fade',
        hide: 'fade',
        buttons : {
            "Yes": function() {
                $(this).dialog('close');
                window.open(link, '_self');
            },
            "No": function() {
                $(this).dialog('close');
            }
        }
    });

    $('a.delete-alert').click(function() {
        link = $(this).attr('href');
        $('div.delete-alert-dialog').dialog('open');
        return false;
    });

    $('div.settings-modal:ui-dialog').dialog('destroy');

    $('div.settings-modal').dialog({
        modal: true,
        autoOpen: false,
        draggable: false,
        resizeable: false,
        dialogClass: 'modal',
        width: 359,
        maxHeight: 400,
        show: 'fade',
        hide: 'fade',
        buttons: {
            "Save": function() {
                if($('form.settings-form').submit()) {
                    alert('Form submits');
                }
                $(this).dialog('close');
            },
            "Cancel": function() {
                $(this).dialog('close');
            }
        },
        create: function() {
	        $(this).closest('.ui-dialog').find('.ui-button:last');
        }
    });

    $('a.activate-settings-modal').click(function() {
        $('div.settings-modal').dialog('open');
        return false;
    });

    $('div.selection-modal:ui-dialog').dialog('destroy');

    $('div.selection-modal').dialog({
	    modal: true,
	    autoOpen: false,
	    draggable: false,
	    dialogClass: 'modal',
	    show: 'fade',
	    hide: 'fade'
    });

    $('a.activate-selection-modal').click(function() {
        $('div.selection-modal').dialog('open');
        return false;
    });

    $('div.accordion').accordion({
	    autoHeight: false
    });

    $('div.buttonset').buttonset();

    $('a.form-button').button();

    $('#nav a.seperator').click(function() {
    	return false;
    });

    $('a.disable-link').click(function() {
		return false;
    });

    dropdown_animation();

});

function dropdown_animation() {
    $("ul#nav li.dropdown ul").hide();
    $("ul#nav li.dropdown").hover(function() {
        $(this).find("ul").effect("slide", { direction: "up" }, 400	);
    },
    function() {
        $(this).find("ul").hide();
    });
}

license: MIT

repository: chrispynegar/ContentExpress-CMS

license_type: permissive

repo_name: chrispynegar/ContentExpress-CMS

branch_name: refs/heads/master

extension: js


text:
include ( cmake/CPM.cmake )

CPMAddPackage(
  NAME freetype
  GITHUB_REPOSITORY aseprite/freetype2
  GIT_TAG fbbcf50367403a6316a013b51690071198962920
)

if( BUILD_PLATFORM STREQUAL "glfw" )
  CPMAddPackage(
    NAME glfw
    GITHUB_REPOSITORY glfw/glfw
    GIT_TAG 0a49ef0a00baa3ab520ddc452f0e3b1e099c5589
    OPTIONS
    "GLFW_BUILD_DOCS OFF"
    "GLFW_INSTALL OFF"
    "GLFW_BUILD_EXAMPLES OFF"
    "GLFW_BUILD_TESTS OFF"
  )

  CPMAddPackage(
    NAME glad
    GITHUB_REPOSITORY Dav1dde/glad
    GIT_TAG de6c39e3040c987323b8ed078c36442f4fb681b3 # 0.1.33
  )
  set( GLFW_DEPENDENCY glfw glad )
endif()

function ( set_dependency target_name target_type )
  message( STATUS "${GLFW_DEPENDENCY}" )
  target_link_libraries( ${target_name} ${target_type}
    ${GLFW_DEPENDENCY}
    freetype
  )

endfunction()

repository: ueberaccelerate/imgui

repo_name: ueberaccelerate/imgui

extension: cmake


text:
%  $Description: Fresnel bibliography$
%
%  $Author: epietrig $
%  $Date: 2005/11/15 09:00:31 $
%  $Revision: 1.1 $

@InProceedings{Quan04,
  author = 	 "Dennis Quan and David Karger",
  title = 	 "{H}ow to {M}ake a {S}emantic {W}eb {B}rowser",
  pages = 	 "255-265",
  booktitle =    "Proceedings of the 13th international conference on World Wide Web",
  year = 	 "2004",
  month = 	 "May"
}

@Misc{Quan05,
  author = 	 "Dennis Quan and David Karger",
  title = 	 "Xenon: {A}n {RDF} {S}tylesheet {O}ntology",
  year = 	 "2004",
  month = "December",
  howpublished = {\url{general@simile.mit.edu} mailing list attachment}
}

@InProceedings{Rutledge05,
  author = 	 "Lloyd Rutledge and Jacco van Ossenbruggen and Lynda Hardman",
  title = 	 "Making {RDF} {P}resentable: {S}election, {S}tructure and {S}urfability for the {S}emantic {W}eb",
  pages = 	 "199-206",
  booktitle =    "Proceedings of the 14th international conference on World Wide Web",
  year = 	 "2005",
  month = 	 "May"
}

@InProceedings{Gassert05,
  author = 	 "Hannes Gassert and Andreas Harth",
  title = 	 "From {G}raph to {GUI}: {D}isplaying {RDF} {D}ata from the {W}eb with {A}rago",
  OPTpages = 	 "",
  booktitle =    "1st workshop on Scripting for the Semantic Web (ESWC)",
  year = 	 "2005"
}

@InProceedings{MindSwap05,
  author = 	 "Aditya Kalyanpur and Bijan Parsia and James Hendler",
  title = 	 "A {T}ool for {W}orking with {W}eb {O}ntologies",
  OPTpages = 	 "",
  booktitle =    "Proceedings of Extreme Markup Languages",
  year = 	 "2004",
  month = 	 "January"
}

@InProceedings{Carroll04,
  author = 	 "Jeremy J. Carroll and Patrick Stickler",
  title = 	 "{T}ri{X}: {RDF} triples in {XML}",
  OPTpages = 	 "",
  booktitle =    "In the International Journal on Semantic Web and Information Systems, Vol.1, No.1, Jan-Mar 2005",
  year = 	 "2005",
  month = 	 "January"
}

@InProceedings{mspace2005,
  author = 	 "mc schraefel and Daniel Smith and Alisdair Owens and Alistair Russell and Craig Harris",
  title = 	 "The evolving m{S}pace platform: leveraging the {S}emantic {W}eb on the {T}rail of the {M}emex.",
  pages = 	 "174-183",
  booktitle =    "16th ACM Conference on Hypertext and Hypermedia",
  year = 	 "2005",
  month = 	 "September"
}

@Misc{cocoon05,
  author = 	 "ASF",
  title = 	 "The {A}pache {C}ocoon {P}roject",
  year =	 "2005",
  howpublished = "\url{http://cocoon.apache.org}"
}

@Misc{rdfcas04,
  author = 	 "W3C",
  title = 	 "Resource {D}escription {F}ramework ({RDF}): {C}oncepts and {A}bstract {S}yntax",
  year =	 "2004",
  month =	 "February",
  howpublished = "\url{http://www.w3.org/TR/rdf-concepts/}"
}

@Misc{simile,
  author = "SIMILE",
  year = "2003-2005",
  title = "{L}ongwell {RDF} {B}rowser",
  note =	 "http://simile.mit.edu/longwell/"
}

@Misc{horus,
  author = "Tae Il Erdmann and Chris Bizer",
  year = "2005",
  title = "{Horus RDF Browser}",
  howpublished = "\url{http://www.wiwiss.fu-berlin.de/suhl/bizer/rdfapi/tutorial/horus/}"
}

@Misc{HaystackUI03,
  author = "David Huynh",
  year = "2003",
  title = "{Haystack's User Interface Framework: Tutorial and Reference}",
  howpublished = "\url{http://haystack.lcs.mit.edu/documentation/ui.pdf}"
}

@Misc{foaf,
  author = "{FOAF}ers",
  year = "2001",
  title = "{F}riend-of-a-{F}riend ({FOAF})",
  howpublished = "\url{http://www.foaf-project.org/}"
}

@Misc{sparql05,
  author = "Eric Prud'hommeaux and Andy Seaborne",
  year = "2005",
  month = "April",
  title = "{SPARQL} {Q}uery {L}anguage for {RDF}",
  howpublished = "\url{http://www.w3.org/TR/rdf-sparql-query/}"
}

@Misc{fsl05,
  author = "Emmanuel Pietriga",
  year = "2005",
  month = "July",
  title = "{F}resnel {S}elector {L}anguage for {RDF}",
  howpublished = "\url{http://www.w3.org/2005/04/fresnel-info/fsl-20050726/}"
}

@Misc{fresnel05,
  author = "Chris Bizer and Ryan Lee and Emmanuel Pietriga",
  year = "2005",
  month = "June",
  title = "{F}resnel - {D}isplay {V}ocabulary for {RDF}",
  howpublished = "\url{http://www.w3.org/2005/04/fresnel-info/manual-20050726/}"
}

@Misc{isaviz,
  author = "Emmanuel Pietriga",
  year = "2001-2006",
  title = "{I}sa{V}iz: {A} {V}isual {A}uthoring {T}ool for {RDF}",
  howpublished = "\url{http://www.w3.org/2001/11/IsaViz/}"
}

@Misc{Welkin,
  author = "SIMILE",
  year = "2004-2005",
  title = "Welkin",
  howpublished = "\url{http://simile.mit.edu/welkin/}"
}

@Misc{Steer03,
  author = 	 "Damian Steer",
  title = 	 "{B}rown{S}auce: {A}n {RDF} {B}rowser",
  year =	 "2003",
  howpublished = {\url{http://www.xml.com/pub/a/2003/02/05/brownsauce.html}},
  note = {{XML}.com}
}

@Misc{N3,
  author = "Tim Berners-Lee",
  year = "2005",
  title = "{P}rimer: {G}etting into {RDF} \& {S}emantic {W}eb using {N3}",
  howpublished = "\url{http://www.w3.org/2000/10/swap/Primer.html}"
}

@InProceedings{xpr06,
  author = 	 "S. Cohen-Boulakia and C. Froidevaux and Emmanuel Pietriga",
  title = 	 "{S}electing {B}iological {D}ata {S}ources and {T}ools with {XPR}, a {P}ath {L}anguage for {RDF}",
  pages = 	 "116-127",
  booktitle =    "Pacific Symposium on Biocomputing ({PSB}), Maui, Hawaii.",
  year = 	 "2006",
  month = 	 "January"
}

@InProceedings{huynh05,
  author = 	 "David Huynh and Stefano Mazzocchi and David Karger",
  title = 	 "{Piggy Bank: Experience the Semantic Web Inside Your Web Browser}",
  pages = 	 "413-430",
  booktitle =    "Proceedings of the 4th International Semantic Web Conference (ISWC)",
  year = 	 "2005",
  month = 	 "November"
}

@InProceedings{Quan03,
  author = 	 "Dennis Quan and David Huynh and David R. Karger",
  title = 	 "{Haystack: A Platform for Authoring End User Semantic Web Applications}",
  pages = 	 "738-753",
  booktitle =    "2nd International Semantic Web Conference (ISWC)",
  year = 	 "2003",
  month = 	 "October"
}

@Misc{xpath,
  author = 	 "J. Clark and S. DeRose",
  title = 	 "{XML Path Language (XPath) version 1.0}",
  year =	 "1999",
  month =	 "November",
  howpublished = "\url{http://www.w3.org/TR/xpath}"
}

@inproceedings{bier93,
 author = {Eric A. Bier and Maureen C. Stone and Ken Pier and William Buxton and Tony D. DeRose},
 title = {Toolglass and magic lenses: the see-through interface},
 booktitle = {SIGGRAPH '93: Proc. of the 20th conference on Computer graphics and interactive techniques},
 year = {1993},
 pages = {73--80},
 publisher = {ACM Press}
 }

 @inproceedings{furnas06,
 author = {George W. Furnas},
 title = {A fisheye follow-up: further reflections on focus + context},
 booktitle = {CHI '06: Proceedings of the SIGCHI conference on Human Factors in computing systems},
 year = {2006},
 pages = {999--1008},
 publisher = {ACM Press}
 }

 @inproceedings{pietriga05,
  author = "Emmanuel Pietriga",
  title = "{A Toolkit for Addressing HCI Issues in Visual Language Environments}",
  pages= "145-152",
  booktitle = "{IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC'05)}",
  year = "2005",
  month = "September",
  address = "Dallas, USA"
}

@inproceedings{timbl06,
  author = "Tim Berners-Lee and Yuhsin Chen and Lydia Chilton and Dan Connolly and Ruth Dhanaraj and James Hollenbach and Adam Lerer and David Sheets",
  title = "{Tabulator: Exploring and Analyzing linked data on the Semantic Web}",
  booktitle = "Proceedings of the 3rd Int. Semantic Web User Interaction Workshop",
  year = "2006",
  month = "November",
  address = "Athens, USA"
}

@inproceedings{pietriga06b,
  author = "Emmanuel Pietriga",
  title = "{Semantic Web Data Visualization with Graph Style Sheets}",
  booktitle = "{Proceedings of the ACM Symposium on Software Visualization (SoftVis'06)}",
  year = "2006",
  month = "September",
  address = "Brighton, UK"
}

repository: mes/marbles

repo_name: mes/marbles

extension: bib


text:
@article{cereq2016,
  title={Typologie sectorielle des modes de gestion de la main-d'oeuvre},
  author={d'Agostino, Alexandra and Delanoë, Anne},
  journal={Cereq Net.Doc},
  Number = 157,
  year={2016}
}

@article{gonzalez2002incidence,
  title={L’incidence du recours {\`a} l’int{\'e}rim sur la mesure de la productivit{\'e} du travail des branches industrielles; suivi d'un commentaire de Ferhat Mihoubi},
  author={Gonzalez, Lucie and Mihoubi, Ferhat},
  journal={{\'E}conomie et statistique},
  volume={357},
  number={1},
  pages={103--137},
  year={2002},
  publisher={Pers{\'e}e-Portail des revues scientifiques en SHS}
}

@article{allouche2005meta,
  title={A meta-analytical investigation of the relationship between corporate social and financial performance},
  author={Allouche, Jos{\'e} and Laroche, Patrice},
  journal={Revue de gestion des ressources humaines},
  number={57},
  pages={18},
  year={2005}
}

@book{lebart2006statistique,
  title={Statistique exploratoire multidimensionnelle},
  author={Lebart, Ludovic and Morineau, Alain and Piron, Marie},
  year={2006},
  publisher={Dunod}
}
@book{datchary2011dispersion,
title={La dispersion au travail},
author={Datchary.C},
year={2011},
publisher={Octarès Editions}

}

@inproceedings{arthur2007k,
  title={k-means++: The advantages of careful seeding},
  author={Arthur, David and Vassilvitskii, Sergei},
  booktitle={Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms},
  pages={1027--1035},
  year={2007},
  organization={Society for Industrial and Applied Mathematics}
}

@inproceedings{meilua2006uniqueness,
  title={The uniqueness of a good optimum for k-means},
  author={Meil{\u{a}}, Marina},
  booktitle={Proceedings of the 23rd international conference on Machine learning},
  pages={625--632},
  year={2006},
  organization={ACM}
}

@article{lachman2010,
  title={Bien-être et efficacité au travail},
  author={Lachmann, H and Larose, C and Penicaud, M},
  journal={Rapport pour l'Agence nationale pour l'amélioration des conditions de travail},

  year={2010}
}

@article{INSEE_secteurs,
  title={Unités légales selon le nombre de salariés et l'activité en 2013},
  author={{INSEE}},

  year={2013}
}

@article{granger1969causality,
ISSN = {00129682, 14680262},
URL = {http://www.jstor.org/stable/1912791},
abstract = {There occurs on some occasions a difficulty in deciding the direction of causality between
two related variables and also whether or not feedback is occurring. Testable definitions of causality
and feedback are proposed and illustrated by use of simple two-variable models. The important
problem of apparent instantaneous causality is discussed and it is suggested that the problem often
arises due to slowness in recording information or because a sufficiently wide class of possible causal
variables has not been used. It can be shown that the cross spectrum between two variables can be
decomposed into two parts, each relating to a single causal arm of a feedback situation. Measures of
causal lag and causal strength can then be constructed. A generalisation of this result with the partial
cross spectrum is suggested.},
author = {C. W. J. Granger},
journal = {Econometrica},
number = {3},
pages = {424-438},
publisher = {[Wiley, Econometric Society]},
title = {Investigating Causal Relations by Econometric Models and Cross-spectral Methods},
volume = {37},
year = {1969}
}

@article{sparckjones1972,
doi = "10.1108/eb026526",
issn = "0022-0418",
title = "A statistical interpretation of term specificity and its application in retrival",
journal = "Journal of Documentation",
publisher = "Emerald",
number = "1",
volume = "28",
pages = "11-21",
author = "Karen Spark Jones",
year = "1972",
month = "01"
}

@ARTICLE{lopez-paz2015learningcausality,
   author = {{Lopez-Paz}, D. and {Muandet}, K. and {Sch{\"o}lkopf}, B. and
	{Tolstikhin}, I.},
    title = "{Towards a Learning Theory of Cause-Effect Inference}",
  journal = {ArXiv e-prints},
archivePrefix = "arXiv",
   eprint = {1502.02398},
 primaryClass = "stat.ML",
 keywords = {Statistics - Machine Learning, Mathematics - Probability, Mathematics - Statistics Theory},
     year = 2015,
    month = feb,
}

@ARTICLE{follonosa2016causalityvar,
   author = {{Fonollosa}, J.~A.~R.},
    title = "{Conditional distribution variability measures for causality detection}",
  journal = {ArXiv e-prints},
archivePrefix = "arXiv",
   eprint = {1601.06680},
 primaryClass = "stat.ML",
 keywords = {Statistics - Machine Learning, Computer Science - Learning},
     year = 2016,
    month = jan,
}
@book{bourdu2016qvt,
author={Bourdu, \'Emilie and Péretié, Marie-Madeleine and Richer, Martin},
title="{La qualité de vie au travail : un levier de compétitivité}",
year=2016,
publisher="La Fabrique de l'industrie",

}

@article{statnikov2012new,
  title={New methods for separating causes from effects in genomics data},
  author={Statnikov, Alexander},
  journal={BMC genomics},
  volume={13},
  number={8},
  pages={1},
  year={2012},
  publisher={BioMed Central}
}

@article{pearl2000causal,
  title={Causal inference without counterfactuals: Comment},
  author={Pearl, Judea},
  journal={Journal of the American Statistical Association},
  volume={95},
  number={450},
  pages={428--431},
  year={2000},
  publisher={JSTOR}
}
@inproceedings{stegle2010probabilistic,
  title={Probabilistic latent variable models for distinguishing between cause and effect},
  author={Stegle, Oliver and Janzing, Dominik and Zhang, Kun and Mooij, Joris M and Sch{\"o}lkopf, Bernhard},
  booktitle={Advances in Neural Information Processing Systems},
  pages={1687--1695},
  year={2010}
}
@article{barzel2013network,
  title={Network link prediction by global silencing of indirect correlations},
  author={Barzel, Baruch and Barab{\'a}si, Albert-L{\'a}szl{\'o}},
  journal={Nature biotechnology},
  volume={31},
  number={8},
  pages={720--725},
  year={2013},
  publisher={Nature Publishing Group}
}
@article{feizi2013network,
  title={Network deconvolution as a general method to distinguish direct dependencies in networks},
  author={Feizi, Soheil and Marbach, Daniel and M{\'e}dard, Muriel and Kellis, Manolis},
  journal={Nature biotechnology},
  volume={31},
  number={8},
  pages={726--733},
  year={2013},
  publisher={Nature Publishing Group}
}

@article{aliferis2010local,
  title={Local causal and markov blanket induction for causal discovery and feature selection for classification part i: Algorithms and empirical evaluation},
  author={Aliferis, Constantin F and Statnikov, Alexander and Tsamardinos, Ioannis and Mani, Subramani and Koutsoukos, Xenofon D},
  journal={Journal of Machine Learning Research},
  volume={11},
  number={Jan},
  pages={171--234},
  year={2010}
}

@article{breiman2001random,
  title={Random forests},
  author={Breiman, Leo},
  journal={Machine learning},
  volume={45},
  number={1},
  pages={5--32},
  year={2001},
  publisher={Springer}
}

repository: Diviyan-Kalainathan/causal-humans

repo_name: Diviyan-Kalainathan/causal-humans


text:
package providers

import (
	"github.com/banzaicloud/satellite/defaults"
	"github.com/sirupsen/logrus"
)

// IdentifySlow struct holds the logger
type IdentifySlow struct {
	Log logrus.FieldLogger
}

// Identify tries to identify the provider via calling the metadata service
func (s *IdentifySlow) Identify() (string, error) {

	detected := make(chan string)
	defer close(detected)

	prov := []func(chan<- string, logrus.FieldLogger){
		IdentifyOracleViaMetadataServer,
		IdentifyDigitalOceanViaMetadataServer,
		IdentifyAlibabaViaMetadataServer,
		IdentifyAmazonViaMetadataServer,
		IdentifyAzureViaMetadataServer,
		IdentifyGoogleViaMetadataServer,
	}

	for _, functions := range prov {
		go functions(detected, s.Log)
	}
	for range prov {
		d := <-detected
		if d != defaults.Unknown {
			return d, nil
		}
	}
	return defaults.Unknown, nil
}

repository: banzaicloud/satellite

repo_name: banzaicloud/satellite

gha_language: Go

extension: go


text:
// Copyright (C) 2018 rameshvk. All rights reserved.
// Use of this source code is governed by a MIT-style license
// that can be found in the LICENSE file.

package ops

import (
	"context"

	"github.com/dotchain/dot/changes"
)

// Transformed takes a store of raw operations and converts them to a
// transformed version that can be applied in sequence.
//
// The transformed Store only modifies the GetSince method.
//
// Every operation has a Basis (last server acknowledged server
// operation applied before) and a Parent (the previous client
// operation on top of which the current operation is applied)
//
// An operation is written into the Store in the order it is received
// but this implies that a bunch of operations may have been appended
// into the store between the parent/basis and the current version.
//
// Applying this operation directly onto the last version can lead to
// incorrect results.  The transformed operation merges the operation
// against all intervening operations, so applying it on top of the
// previous version will reflect the intent of the original operation.
//
// The cache is required for efficiency reasons.
func Transformed(raw Store, cache Cache) Store {
	return transformer{raw, cache}
}

type transformer struct {
	Store
	Cache
}

func (t transformer) GetSince(ctx context.Context, version, count int) ([]Op, error) {
	ops, err := t.Store.GetSince(ctx, version, count)
	if err != nil || len(ops) == 0 {
		return ops, err
	}

	result := make([]Op, len(ops))
	for kk := range ops {
		// Transform all the returned operations
		op, _, err := t.xform(ctx, ops[kk])
		if err != nil {
			return nil, err
		}
		result[kk] = op
	}
	return result, nil
}

// xform transforms a single operation, recursively calling itself on
// other operations it needs. The cache is used to "memoize" such
// prior results to avoid redoing them.
//
// The returned opInfo includes the the transformed version as well as
// the collection of merge operations. The merge operations can be
// used to get the client state (after it had applied the raw
// operation) to the converged state (i.e. by sequental application of
// all the transformed operations until this raw operation).
func (t transformer) xform(ctx context.Context, op Op) (Op, []Op, error) {
	basis, version := op.Basis(), op.Version()

	// if the operation is available in the cache, just return it
	if x, merge := t.Load(version); x != nil {
		return x, merge, nil
	}

	// if this operation is based on the last operation in the
	// store, there is no transformation needed
	gap := version - basis - 1
	if gap == 0 {
		t.Cache.Store(version, op, nil)
		return op, nil, nil
	}

	// fetch all the operations since the basis
	ops, err := t.Store.GetSince(ctx, basis+1, gap)
	if err != nil {
		return nil, nil, err
	}

	// skip all those before the parent of the current op
	for op.Parent() != nil && ops[0].ID() != op.Parent() {
		ops = ops[1:]
	}

	// The current op is on top of the parent op and so
	// the parent op should first be transformed against the
	// "merge chain" of the parent op
	x, merge, err := t.getMergeChain(ctx, op, ops)
	if err != nil {
		return nil, nil, err
	}

	if op.Parent() != nil {
		// skip parent op
		ops = ops[1:]
	}

	// The residual op needs to be merged against all ops
	// since the "parent" or "basis".  For each of these,
	// we need the transformed version first
	for _, opx := range ops {
		opx, _, err = t.xform(ctx, opx)
		if err != nil {
			return nil, nil, err
		}
		x, opx = t.merge(opx, x)
		merge = append(merge, opx)
	}

	// stash the result to avoid calculating this again
	t.Cache.Store(version, x, merge)
	return x, merge, nil
}

// getMergeChain gets the merge chain for the op and transforms the
// current op against that to get the updated current op as well as
// its merge chain
func (t transformer) getMergeChain(ctx context.Context, op Op, ops []Op) (Op, []Op, error) {
	parent, basis := op.Parent(), op.Basis()

	if parent == nil {
		return op, nil, nil
	}

	_, merge, err := t.xform(ctx, ops[0])
	if err != nil {
		return nil, nil, err
	}

	for len(merge) > 0 && merge[0].Version() <= basis {
		merge = merge[1:]
	}

	mergeChain := []Op(nil)
	for _, opx := range merge {
		op, opx = t.merge(opx, op)
		mergeChain = append(mergeChain, opx)
	}

	return op, mergeChain, nil
}

// merge merges the changes in two operations
func (t transformer) merge(left, right Op) (Op, Op) {
	lx, rx := changes.Merge(left.Changes(), right.Changes())
	return right.WithChanges(lx), left.WithChanges(rx)
}

repository: piotr-lipiarz/dot

repo_name: piotr-lipiarz/dot


text:
@article{wild2007proceedings,
 author = {Wild, Fridolin and Kalz, Marco and Van Bruggen, Jan and Koper, Rob},
 title = {Proceedings of the First European Workshop on Latent Semantic Analysis in Technology Enhanced Learning},
 year = {2007}
}

repository: mkalz/mkalz-academic

repo_name: mkalz/mkalz-academic


text:
require u-boot-socfpga-common.inc
require u-boot-socfpga-env.inc
require ${COREBASE}/meta/recipes-bsp/u-boot/u-boot.inc

FILESEXTRAPATHS =. "${THISDIR}/files/v2016.11:"

# This revision corresponds to the tag "v2016.11"
# We use the revision in order to avoid having to fetch it from the
# repo during parse
SRCREV = "29e0cfb4f77f7aa369136302cee14a91e22dca71"

PR = "r1"

SRC_URI_append = "\
	file://de0-nano-soc.env \
	file://cyclone5-socdk.env \
	"

DEPENDS += "dtc-native"
DEPENDS += "u-boot-mkimage-native"

gha_language: Python

extension: bb


text:
@article{DBLP:journals/tvcg/XuMR017,
  author    = {Panpan Xu and
               Honghui Mei and
               Liu Ren and
               Wei Chen},
  title     = {ViDX: Visual Diagnostics of Assembly Line Performance in Smart Factories},
  journal   = {{IEEE} Trans. Vis. Comput. Graph.},
  volume    = {23},
  number    = {1},
  pages     = {291--300},
  year      = {2017},
  url       = {https://doi.org/10.1109/TVCG.2016.2598664},
  doi       = {10.1109/TVCG.2016.2598664},
  timestamp = {Wed, 14 Nov 2018 10:22:04 +0100},
  biburl    = {https://dblp.org/rec/bib/journals/tvcg/XuMR017},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}


text:
DESCRIPTION = "Linux Integrity Measurement Architecture (IMA) subsystem"

include packagegroup-ima.inc

DEPENDS += "\
    ima-evm-utils-native \
    attr-native \
"

RDEPENDS:${PN} += "\
    attr \
    ima-inspect \
    util-linux-switch-root.static \
"

# Note any private key is not available if user key signing model used.
RRECOMMENDS:${PN} += "\
    key-store-ima-cert \
    key-store-system-trusted-cert \
"

gha_license_id: MIT

gha_language: BitBake


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

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


text:
HOMEPAGE = "http://github.com/openbmc/phosphor-ipmi-blobs-binarystore"
SUMMARY = "BMC Generic Binary Blob Store via OEM IPMI Blob Transport"
DESCRIPTION = "This package provides a read/write/serialize abstraction for storing binary data through IPMI blobs"
PR = "r1"
PV = "1.0+git${SRCPV}"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"

inherit autotools pkgconfig
inherit obmc-phosphor-ipmiprovider-symlink

DEPENDS += "autoconf-archive-native"
DEPENDS += "phosphor-ipmi-blobs"
DEPENDS += "phosphor-logging"
DEPENDS += "protobuf-native"
DEPENDS += "protobuf"

PACKAGECONFIG ??= ""
PACKAGECONFIG[blobtool] = ",--disable-blobtool"

S = "${WORKDIR}/git"
SRC_URI = "git://github.com/openbmc/phosphor-ipmi-blobs-binarystore"
SRCREV = "a21027dcb1a0396e57347ab1066821c4d8ba30b2"

FILES:${PN}:append = " ${libdir}/ipmid-providers/lib*${SOLIBS}"
FILES:${PN}:append = " ${libdir}/blob-ipmid/lib*${SOLIBS}"
FILES:${PN}-dev:append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la"

BLOBIPMI_PROVIDER_LIBRARY += "libbinarystore.so"

repository: Intel-BMC/openbmc

repo_name: Intel-BMC/openbmc

gha_license_id: NOASSERTION


text:
require recipes-kernel/linux/linux-riscv-common.inc

LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=bbea815ee2795b2f4230826c0c6b8814"

LINUX_VERSION ?= "4.17-rc2"

BRANCH = "riscv-all"
SRCREV = "98d9b42f35ff124df8bc9a466c3fb2b41547a94d"

repository: InnoThoughts/meta-riscv

repo_name: InnoThoughts/meta-riscv


text:
@inproceedings{yoshida_first_2016,
 author = {Yoshida, Yuki and Kitayama, Ken-Ichi and Kai, Yutaka and Nishihara, Masato and Okabe, Ryo and Tanaka, Toshiki and Takahara, Tomoo and Rasmussen, Jens C. and Yoshikane, Noboru and Cao, Xiaoyuan and Tsuritani, Takehiro and Morita, Itsuro and Mayoral López de Lerma, Arturo and Fabrega, Josep and Vilalta, Ricard and Casellas, Ramon and Martínez, Ricardo and Moreolo, Michela S. and Muñoz, Raul and Habel, Kai and Freund, Ronald and Lopez, Victor and Aguado, Alejandro and Yan, Shuangyi and Simeonidou, Dimitra and Szyrkowiec, Thomas and Autenrieth, Achim and Shiraiwa, Masaki and Awaji, Yoshinari and Wada, Naoya},
 booktitle = {OFC 2016},
 date = {2016},
 doi = {10.1364/OFC.2016.Th5B.2},
 eventtitle = {Optical Fiber Communication Conference},
 file = {/Users/sy13201/Zotero/storage/P6EIUHG3/Yoshida et al_2016_First demonstration of cognitive SDN orchestration.pdf;/Users/sy13201/Zotero/storage/FCYPSH3G/7537862.html},
 isbn = {978-1-943580-08-8},
 keywords = {application program interfaces,bit rate 400 Gbit/s,Cognition,cognitive SDN orchestration,cognitive systems,congestion-aware provisioning,end-to-end real-time services,extended transport API,flexi-WDM OCS networks,monitoring,OFDM,OFDM modulation,OFDM transponders,OFDM-based OPS,optical circuit switching,Optical Circuit Switching,optical packet switching,optical switches,optical transceivers,Optical transmitters,orthogonal frequency division multiplexing,packet switching,real-time congestion-aware services,Real-time systems,software defined networking,software-defined network,telecommunication congestion control,Transponders,Wavelength Division Multiplexing},
 langid = {english},
 location = {Anaheim},
 pages = {Th5B.2},
 publisher = {OSA},
 shorttitle = {First Demonstration of Cognitive SDN Orchestration},
 title = {First Demonstration of Cognitive SDN Orchestration: A Real-Time Congestion-Aware Services Provisioning over OFDM-Based 400G OPS and Flexi-WDM OCS Networks},
 url = {https://www.osapublishing.org/abstract.cfm?URI=OFC-2016-Th5B.2},
 urldate = {2016-04-17}
}


text:
package saml

import (
	"crypto"
	"crypto/rsa"
	"crypto/sha1" // #nosec G505
	"crypto/sha256"
	"crypto/sha512"
	"crypto/x509"
	"encoding/base64"
	"errors"
	"fmt"
	"net/url"

	dsig "github.com/russellhaering/goxmldsig"
)

type reqType string

const (
	samlRequest  reqType = "SAMLRequest"
	samlResponse reqType = "SAMLResponse"
)

var (
	// ErrInvalidQuerySignature is returned when the query signature is invalid
	ErrInvalidQuerySignature = errors.New("invalid query signature")
	// ErrNoQuerySignature is returned when the query does not contain a signature
	ErrNoQuerySignature = errors.New("query Signature or SigAlg not found")
)

// Sign Query with the SP private key.
// Returns provided query with the SigAlg and Signature parameters added.
func (sp *ServiceProvider) signQuery(reqT reqType, query, body, relayState string) (string, error) {
	signingContext, err := GetSigningContext(sp)

	// Encode Query as standard demands. query.Encode() is not standard compliant
	toHash := string(reqT) + "=" + url.QueryEscape(body)
	if relayState != "" {
		toHash += "&RelayState=" + url.QueryEscape(relayState)
	}

	toHash += "&SigAlg=" + url.QueryEscape(sp.SignatureMethod)

	if err != nil {
		return "", err
	}

	sig, err := signingContext.SignString(toHash)
	if err != nil {
		return "", err
	}

	query += "&SigAlg=" + url.QueryEscape(sp.SignatureMethod)
	query += "&Signature=" + url.QueryEscape(base64.StdEncoding.EncodeToString(sig))

	return query, nil
}

// validateSig validation of the signature of the Redirect Binding in query values
// Query is valid if return is nil
func (sp *ServiceProvider) validateQuerySig(query url.Values) error {
	sig := query.Get("Signature")
	alg := query.Get("SigAlg")
	if sig == "" || alg == "" {
		return ErrNoQuerySignature
	}

	certs, err := sp.getIDPSigningCerts()
	if err != nil {
		return err
	}

	respType := ""
	if query.Get("SAMLResponse") != "" {
		respType = "SAMLResponse"
	} else if query.Get("SAMLRequest") != "" {
		respType = "SAMLRequest"
	} else {
		return fmt.Errorf("No SAMLResponse or SAMLRequest found in query")
	}

	// Encode Query as standard demands.
	// query.Encode() is not standard compliant
	// as query encoding order matters
	res := respType + "=" + url.QueryEscape(query.Get(respType))

	relayState := query.Get("RelayState")
	if relayState != "" {
		res += "&RelayState=" + url.QueryEscape(relayState)
	}

	res += "&SigAlg=" + url.QueryEscape(alg)

	// Signature is base64 encoded
	sigBytes, err := base64.StdEncoding.DecodeString(sig)
	if err != nil {
		return fmt.Errorf("failed to decode signature: %w", err)
	}

	var (
		hashed  []byte
		hashAlg crypto.Hash
		sigAlg  x509.SignatureAlgorithm
	)

	// Hashed Query
	switch alg {
	case dsig.RSASHA256SignatureMethod:
		hashed256 := sha256.Sum256([]byte(res))
		hashed = hashed256[:]
		hashAlg = crypto.SHA256
		sigAlg = x509.SHA256WithRSA
	case dsig.RSASHA512SignatureMethod:
		hashed512 := sha512.Sum512([]byte(res))
		hashed = hashed512[:]
		hashAlg = crypto.SHA512
		sigAlg = x509.SHA512WithRSA
	case dsig.RSASHA1SignatureMethod:
		hashed1 := sha1.Sum([]byte(res)) // #nosec G401
		hashed = hashed1[:]
		hashAlg = crypto.SHA1
		sigAlg = x509.SHA1WithRSA
	default:
		return fmt.Errorf("unsupported signature algorithm: %s", alg)
	}

	// validate signature
	for _, cert := range certs {
		// verify cert is RSA
		if cert.SignatureAlgorithm != sigAlg {
			continue
		}

		if err := rsa.VerifyPKCS1v15(cert.PublicKey.(*rsa.PublicKey), hashAlg, hashed, sigBytes); err == nil {
			return nil
		}
	}

	return ErrInvalidQuerySignature
}

repository: grafana/saml

repo_name: grafana/saml

branch_name: refs/heads/main


text:
package logr

const (
	// ColourReset code
	ColourReset = "\x1B[0m"
)

type MetaData map[string]interface{}

// Message used to send log message to logger goroutine
type Message struct {
	Type Type          `json:"type"`
	Time string        `json:"time"`
	Code string        `json:"code"`
	Desc string        `json:"description"`
	Meta MetaData      `json:"metadata,omitempty"`
	done chan struct{} `json:"-"`
}

// Reset the message object for later reuse
func (m *Message) Reset() {
	m.Type = None
	m.Time = ""
	m.Code = ""
	m.Desc = ""
	m.Meta = nil
	m.done = nil
}

repository: mertenvg/logr

repo_name: mertenvg/logr


text:
@inproceedings{cao2020unsupervised,
  title={Unsupervised Domain Adaptation on Reading Comprehension},
  author={Yu Cao and Meng Fang and Baosheng Yu and Joey Tianyi Zhou},
  booktitle={AAAI},
  year={2020}
}

url: https://raw.githubusercontent.com/Hugh-Shi/DL-NLP-Readings/924e4d189e5660c5b5d4854278f3df755ae2231d/Bibtex/Unsupervised Domain Adaptation on Reading Comprehension.bib

repository: Hugh-Shi/DL-NLP-Readings

repo_name: Hugh-Shi/DL-NLP-Readings


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

package models

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

import (
	"encoding/json"
	"strconv"

	strfmt "github.com/go-openapi/strfmt"

	"github.com/go-openapi/errors"
	"github.com/go-openapi/swag"
	"github.com/go-openapi/validate"
)

// DataExtractsProviderAccount DataExtractsProviderAccount
// swagger:model DataExtractsProviderAccount
type DataExtractsProviderAccount struct {

	// The source through which the providerAccount is added in the system.

Endpoints:

GET providerAccounts

POST providerAccounts

PUT providerAccounts/{providerAccountId}

GET providerAccounts/{providerAccountId}

Applicable Values

	// * SYSTEM: Accounts that are pre-populated by the customers on behalf of their users in to the Yodlee system.

	// * USER: Accounts that are added by the user.

	// Read Only: true
	// Enum: [SYSTEM USER]
	AggregationSource string `json:"aggregationSource,omitempty"`

	// The date on when the provider account is created in the system.

Endpoints:

GET providerAccounts

POST providerAccounts

PUT providerAccounts/{providerAccountId}

GET providerAccounts/{providerAccountId}

	// Read Only: true
	CreatedDate string `json:"createdDate,omitempty"`

	// Logical grouping of dataset attributes into datasets such as Basic Aggregation Data, Account Profile and Documents.

Endpoints:

GET providerAccounts

POST providerAccounts

PUT providerAccounts/{providerAccountId}

GET providerAccounts/{providerAccountId}

	// Read Only: true
	Dataset []*AccountDataset `json:"dataset"`

	// Unique identifier for the provider account resource. This is created during account addition.

Endpoints:

GET providerAccounts

POST providerAccounts

PUT providerAccounts/{providerAccountId}

GET providerAccounts/{providerAccountId}

	// Read Only: true
	ID int64 `json:"id,omitempty"`

	// Indicates whether account is a manual or aggregated provider account.

Endpoints:

GET providerAccounts

POST providerAccounts

PUT providerAccounts/{providerAccountId}

GET providerAccounts/{providerAccountId}

	// Read Only: true
	IsManual *bool `json:"isManual,omitempty"`

	// Unique identifier for the provider resource. This denotes the provider for which the provider account id is generated by the user.

Endpoints:

GET providerAccounts

POST providerAccounts

PUT providerAccounts/{providerAccountId}

GET providerAccounts/{providerAccountId}

	// Read Only: true
	ProviderID int64 `json:"providerId,omitempty"`

	// Unique id generated to indicate the request.

Endpoints:

GET providerAccounts

POST providerAccounts

PUT providerAccounts/{providerAccountId}

GET providerAccounts/{providerAccountId}

	// Read Only: true
	RequestID string `json:"requestId,omitempty"`

	// The status of last update attempted for the account.

Endpoints:

GET providerAccounts

POST providerAccounts

PUT providerAccounts/{providerAccountId}

GET providerAccounts/{providerAccountId}

Applicable Values

	// * LOGIN_IN_PROGRESS: Login to provider site is in progress.

	// * USER_INPUT_REQUIRED: Additional authentication information is needed from the user.

	// * IN_PROGRESS: Login is successful and data aggregation is in progress.

	// * PARTIAL_SUCCESS: Data is partially retrieved.

	// * SUCCESS: Data is retrieved successfully.

	// * FAILED: Additional authentication information is needed from the user.

	// Read Only: true
	// Enum: [LOGIN_IN_PROGRESS USER_INPUT_REQUIRED IN_PROGRESS PARTIAL_SUCCESS SUCCESS FAILED]
	Status string `json:"status,omitempty"`
}

// Validate validates this data extracts provider account
func (m *DataExtractsProviderAccount) Validate(formats strfmt.Registry) error {
	var res []error

	if err := m.validateAggregationSource(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateDataset(formats); err != nil {
		res = append(res, err)
	}

	if err := m.validateStatus(formats); err != nil {
		res = append(res, err)
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}

var dataExtractsProviderAccountTypeAggregationSourcePropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["SYSTEM","USER"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		dataExtractsProviderAccountTypeAggregationSourcePropEnum = append(dataExtractsProviderAccountTypeAggregationSourcePropEnum, v)
	}
}

const (

	// DataExtractsProviderAccountAggregationSourceSYSTEM captures enum value "SYSTEM"
	DataExtractsProviderAccountAggregationSourceSYSTEM string = "SYSTEM"

	// DataExtractsProviderAccountAggregationSourceUSER captures enum value "USER"
	DataExtractsProviderAccountAggregationSourceUSER string = "USER"
)

// prop value enum
func (m *DataExtractsProviderAccount) validateAggregationSourceEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, dataExtractsProviderAccountTypeAggregationSourcePropEnum); err != nil {
		return err
	}
	return nil
}

func (m *DataExtractsProviderAccount) validateAggregationSource(formats strfmt.Registry) error {

	if swag.IsZero(m.AggregationSource) { // not required
		return nil
	}

	// value enum
	if err := m.validateAggregationSourceEnum("aggregationSource", "body", m.AggregationSource); err != nil {
		return err
	}

	return nil
}

func (m *DataExtractsProviderAccount) validateDataset(formats strfmt.Registry) error {

	if swag.IsZero(m.Dataset) { // not required
		return nil
	}

	for i := 0; i < len(m.Dataset); i++ {
		if swag.IsZero(m.Dataset[i]) { // not required
			continue
		}

		if m.Dataset[i] != nil {
			if err := m.Dataset[i].Validate(formats); err != nil {
				if ve, ok := err.(*errors.Validation); ok {
					return ve.ValidateName("dataset" + "." + strconv.Itoa(i))
				}
				return err
			}
		}

	}

	return nil
}

var dataExtractsProviderAccountTypeStatusPropEnum []interface{}

func init() {
	var res []string
	if err := json.Unmarshal([]byte(`["LOGIN_IN_PROGRESS","USER_INPUT_REQUIRED","IN_PROGRESS","PARTIAL_SUCCESS","SUCCESS","FAILED"]`), &res); err != nil {
		panic(err)
	}
	for _, v := range res {
		dataExtractsProviderAccountTypeStatusPropEnum = append(dataExtractsProviderAccountTypeStatusPropEnum, v)
	}
}

const (

	// DataExtractsProviderAccountStatusLOGININPROGRESS captures enum value "LOGIN_IN_PROGRESS"
	DataExtractsProviderAccountStatusLOGININPROGRESS string = "LOGIN_IN_PROGRESS"

	// DataExtractsProviderAccountStatusUSERINPUTREQUIRED captures enum value "USER_INPUT_REQUIRED"
	DataExtractsProviderAccountStatusUSERINPUTREQUIRED string = "USER_INPUT_REQUIRED"

	// DataExtractsProviderAccountStatusINPROGRESS captures enum value "IN_PROGRESS"
	DataExtractsProviderAccountStatusINPROGRESS string = "IN_PROGRESS"

	// DataExtractsProviderAccountStatusPARTIALSUCCESS captures enum value "PARTIAL_SUCCESS"
	DataExtractsProviderAccountStatusPARTIALSUCCESS string = "PARTIAL_SUCCESS"

	// DataExtractsProviderAccountStatusSUCCESS captures enum value "SUCCESS"
	DataExtractsProviderAccountStatusSUCCESS string = "SUCCESS"

	// DataExtractsProviderAccountStatusFAILED captures enum value "FAILED"
	DataExtractsProviderAccountStatusFAILED string = "FAILED"
)

// prop value enum
func (m *DataExtractsProviderAccount) validateStatusEnum(path, location string, value string) error {
	if err := validate.Enum(path, location, value, dataExtractsProviderAccountTypeStatusPropEnum); err != nil {
		return err
	}
	return nil
}

func (m *DataExtractsProviderAccount) validateStatus(formats strfmt.Registry) error {

	if swag.IsZero(m.Status) { // not required
		return nil
	}

	// value enum
	if err := m.validateStatusEnum("status", "body", m.Status); err != nil {
		return err
	}

	return nil
}

// MarshalBinary interface implementation
func (m *DataExtractsProviderAccount) MarshalBinary() ([]byte, error) {
	if m == nil {
		return nil, nil
	}
	return swag.WriteJSON(m)
}

// UnmarshalBinary interface implementation
func (m *DataExtractsProviderAccount) UnmarshalBinary(b []byte) error {
	var res DataExtractsProviderAccount
	if err := swag.ReadJSON(b, &res); err != nil {
		return err
	}
	*m = res
	return nil
}

repository: propertechnologies/yodlee-go

repo_name: propertechnologies/yodlee-go


text:
@inproceedings{jagtap2017quest,
  title={QUEST: A tool for state-space quantization-free synthesis of symbolic controllers},
  author={Jagtap, Pushpak and Zamani, Majid},
  booktitle={International Conference on Quantitative Evaluation of Systems},
  pages={309--313},
  year={2017},
  organization={Springer}
}


text:
SECTION = "x11/network"
DESCRIPTION = "Mail user agent"
DEPENDS = "gtk+ libetpan openssl aspell"
LICENSE = "GPL"
PR = "r0"

SRC_URI = "\
	${SOURCEFORGE_MIRROR}/sylpheed-claws/claws-mail-${PV}.tar.bz2	\
	file://desktop.patch;patch=1				\
	"

FILES_${PN} = "${bindir} ${datadir}/pixmaps ${datadir}/applications"

EXTRA_OECONF = "--disable-aspell-test 		\
		--enable--aspell 		\
		--disable-manual		\
		--disable-crash-dialog		\
		--disable-jpilot		\
		--disable-trayicon-plugin	\
		--disable-spamassassin-plugin	\
		--disable-bogofilter-plugin	\
		--disable-pgpcore-plugin	\
		--disable-pgpmime-plugin	\
		--disable-pgpinline-plugin	\
  		--disable-dillo-viewer-plugin	\
		--disable-clamav-plugin		\
		--disable-gnomeprint		\
		--disable-valgrind		\
		"

inherit autotools pkgconfig

do_install_append() {
	install -d ${D}${datadir}/applications
	install -m 0644 claws-mail.desktop ${D}${datadir}/applications/
	install -d ${D}${datadir}/pixmaps
	install -m 0644 claws-mail.png ${D}${datadir}/pixmaps/
}

do_stage () {
	autotools_stage_all
}


text:
@inproceedings{2016-Bad,
 abstract = {Emerging real-world graph problems include: detecting community structure in large social networks; improving the resilience of the electric power grid; and detecting and preventing disease in human populations. Unlike traditional applications in computational science and engineering, solving these problems at scale often raises new challenges because of the sparsity and lack of locality in the data, the need for additional research on scalable algorithms and development of frameworks for solving these problems on high performance computers, and the need for improved models that also capture the noise and bias inherent in the torrential data streams. In this talk, I will discuss opportunities and challenges in massive data-intensive computing for applications in computational science and engineering.},
 address = {Los Alamitos, CA},
 author = {David A. Bader},
 bibsource = {dblp computer science bibliography, https://dblp.org},
 biburl = {https://dblp.org/rec/bib/conf/ipps/Bader16},
 booktitle = {2016 IEEE International Parallel and Distributed Processing Symposium Workshops, IPDPS Workshops 2016, Chicago, IL, USA, May 23-27, 2016},
 doi = {10.1109/IPDPSW.2016.234},
 groups = {Edited},
 pages = {856},
 publisher = {IEEE Computer Society},
 timestamp = {Wed, 24 May 2017 01:00:00 +0200},
 title = {GABB 2016 Keynote},
 url = {https://doi.org/10.1109/IPDPSW.2016.234},
 year = {2016}
}

gha_language: Shell


text:
@inproceedings{Ojeda-Hernández202162,
author={Ojeda-Hernández, M. and Pérez-Gámez, F. and Bonilla, Á.M. and López-Rodríguez, D.},
title={Using logic to determine key items in math education},
booktitle={15th International Conference e-Learning, EL 2021 - Held at the 15th Multi-Conference on Computer Science and Information Systems, MCCSIS 2021},
year={2021},
pages={62-69},
note={cited By 0; Conference of 15th International Conference e-Learning, EL 2021 - Held at the 15th Multi-Conference on Computer Science and Information Systems, MCCSIS 2021 ; Conference Date: 20 July 2021 Through 23 July 2021;  Conference Code:172206},
url={https://www.scopus.com/inward/record.uri?eid=2-s2.0-85117688099&partnerID=40&md5=85bb65037a2dc1d70fbb879fe2b905e2},
abstract={Due to the COVID-19 restrictions, high-schools in Spain are having both online and in-class lectures. As a result, the students can use not only the information provided by the teachers in class, but they can also use several other methods such as videos and online examples that allow the students to have materials from different places. In this paper, we analyse the Mathematics results of the first two terms in a secondary school from Andalusia. This analysis can help find the central units of the subject found, that is, giving enough background knowledge to keep up with the module. When these are found, the teachers can improve the learning and the results in the following years. © 15th International Conference e-Learning, EL 2021 - Held at the 15th Multi-Conference on Computer Science and Information Systems, MCCSIS 2021. All rights reserved.},
author_keywords={E-Learning Assessment Tools;  Formal Concept Analysis;  Implications;  Knowledge Mining},
keywords={Data mining;  Formal concept analysis;  Information systems;  Information use;  Students, Assessment tool;  E - learning;  E-learning assessment tool;  Formal concepts analysis;  Higher School;  Implication;  In-class lectures;  Knowledge mining;  Learning assessment;  Teachers', E-learning},
publisher={IADIS},
isbn={9789898704290},
document_type={Conference Paper},
source={Scopus},
}

gha_language: HTML


text:
@article{jiang2017joint,
  title={Joint salient object detection and existence prediction},
  author={Jiang, Huaizu and Cheng, Ming-Ming and Li, Shi-Jie and Borji, Ali and Wang, Jingdong},
  journal={Frontiers of Computer Science},
  pages={1--11},
  year={2017},
  publisher={Springer}
}


text:
// +build windows
package main

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"math"
	"net/http"
	"os"
	"os/exec"
	"path/filepath"
	"strconv"
	"strings"
	"sync/atomic"
	"syscall"
	"time"
	"unicode/utf16"
	"unsafe"

	"github.com/gorilla/mux"
	"github.com/tylerb/graceful"
	"github.com/urfave/negroni"
	"golang.org/x/sys/windows/svc"
	"golang.org/x/sys/windows/svc/debug"
	"golang.org/x/sys/windows/svc/eventlog"
)

var elog debug.Log

type svcContext struct {
	conf string
	busy int32 // 0 = idle; 1 = busy
}

// readLines reads a whole file into memory and returns a slice of its lines.
func readLines(path string) ([]string, error) {
	file, err := os.Open(path)
	if err != nil {
		return nil, err
	}

	defer file.Close()
	var lines []string
	scanner := bufio.NewScanner(file)
	for scanner.Scan() {
		lines = append(lines, scanner.Text())
	}

	return lines, scanner.Err()
}

// Get the full name (with path) of the executing module.
func getModuleFileName() (string, error) {
	var sysproc = syscall.MustLoadDLL("kernel32.dll").MustFindProc("GetModuleFileNameW")
	b := make([]uint16, syscall.MAX_PATH)
	r, _, err := sysproc.Call(0, uintptr(unsafe.Pointer(&b[0])), uintptr(len(b)))
	n := uint32(r)
	if n == 0 {
		return "", err
	}

	return string(utf16.Decode(b[0:n])), nil
}

func localExec(args []string) (string, error) {
	var outStr string
	var out bytes.Buffer
	var err error
	switch len(args) {
	case 1:
		c := exec.Command(args[0])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 2:
		c := exec.Command(args[0], args[1])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 3:
		c := exec.Command(args[0], args[1], args[2])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 4:
		c := exec.Command(args[0], args[1], args[2], args[3])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 5:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 6:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 7:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5], args[6])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 8:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 9:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 10:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 11:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 12:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 13:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 14:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	case 15:
		c := exec.Command(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14])
		c.Stdout = &out
		if err = c.Run(); err != nil {
			trace(err.Error())
		} else {
			outStr = out.String()
		}
	}

	return outStr, err
}

func setUpdateSelfAfterReboot(old string, new string) error {
	var MOVEFILE_DELAY_UNTIL_REBOOT = 0x4
	var sysproc = syscall.MustLoadDLL("kernel32.dll").MustFindProc("MoveFileExW")
	o, err := syscall.UTF16PtrFromString(old)
	if err != nil {
		trace(err.Error())
	}

	n, err := syscall.UTF16PtrFromString(new)
	if err != nil {
		trace(err.Error())
	}

	_, _, _ = sysproc.Call(uintptr(unsafe.Pointer(o)), 0, uintptr(MOVEFILE_DELAY_UNTIL_REBOOT))
	_, _, _ = sysproc.Call(uintptr(unsafe.Pointer(n)), uintptr(unsafe.Pointer(o)), uintptr(MOVEFILE_DELAY_UNTIL_REBOOT))
	_, _, _ = sysproc.Call(uintptr(unsafe.Pointer(n)), 0, uintptr(MOVEFILE_DELAY_UNTIL_REBOOT))

	return nil
}

func rebootSystem() error {
	c := exec.Command("shutdown", "/r", "/t", "10")
	if err := c.Run(); err != nil {
		trace(err.Error())
		return err
	}

	return nil
}

func restartSelf() error {
	// Todo
	return nil
}

func handlePostUpdateGitlabRunner(m *svcContext) http.HandlerFunc {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		r.ParseMultipartForm(32 << 20)
		file, handler, err := r.FormFile("uploadfile")
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		defer file.Close()
		str := fmt.Sprintf("Handler.Header: %v", handler.Header)
		trace(str)
		path, _ := getModuleFileName()
		_, fstr := filepath.Split(handler.Filename)
		fstr = filepath.Dir(path) + `\` + fstr
		f, err := os.Create(fstr)
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		defer f.Close()
		io.Copy(f, file)

		// Replace the runner exe
		retry := 10
		runner := `c:\runner\gitlab-ci-multi-runner-windows-amd64.exe`
		trace(runner + ` --> ` + fstr)
		for i := 0; i < retry; i++ {
			c := exec.Command(runner, "stop")
			if err := c.Run(); err != nil {
				trace("retry:", i, err)
				if i >= retry-1 {
					http.Error(w, "stop: "+err.Error(), 500)
					return
				}
			} else {
				break
			}
		}

		for i := 0; i < retry; i++ {
			c := exec.Command("cmd", "/c", "copy", "/Y", fstr, filepath.Dir(runner)+`\`)
			if err := c.Run(); err != nil {
				trace("retry:", i, err)
				if i >= retry-1 {
					http.Error(w, "copy: "+err.Error(), 500)
					return
				}
			} else {
				break
			}
		}

		// Restart service regardless of update result status
		defer func() {
			for i := 0; i < retry; i++ {
				c := exec.Command(runner, "start")
				if err := c.Run(); err != nil {
					trace("retry:", i, err)
					if i >= retry-1 {
						http.Error(w, "start: "+err.Error(), 500)
						return
					}
				} else {
					break
				}
			}
		}()

		fmt.Fprintf(w, "GitLab runner updated.")
	})
}

func handlePostUpdateConf(m *svcContext) http.HandlerFunc {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		r.ParseMultipartForm(32 << 20)
		file, handler, err := r.FormFile("uploadfile")
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		defer file.Close()
		atomic.StoreInt32(&m.busy, 1)
		defer atomic.StoreInt32(&m.busy, 0)
		str := fmt.Sprintf("Handler.Header: %v", handler.Header)
		trace(str)
		path, _ := getModuleFileName()
		_, fstr := filepath.Split(handler.Filename)
		fstr = filepath.Dir(path) + `\` + fstr
		f, err := os.Create(fstr)
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		defer f.Close()
		io.Copy(f, file)
		fmt.Fprintf(w, "Config file updated.")
	})
}

func handlePostUpdateSelf(m *svcContext) http.HandlerFunc {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		q := r.URL.Query()
		// By default, we reboot after setup update. To cancel, we need reboot=false param.
		reboot := true
		rb, ok := q["reboot"]
		if ok {
			if rb[0] == "false" {
				reboot = false
			}
		}

		r.ParseMultipartForm(32 << 20)
		file, handler, err := r.FormFile("uploadfile")
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		defer file.Close()
		str := fmt.Sprintf("Handler.Header: %v", handler.Header)
		trace(str)
		path, _ := getModuleFileName()
		_, fstr := filepath.Split(handler.Filename)
		fstr = filepath.Dir(path) + `\` + fstr + `_new`
		f, err := os.Create(fstr)
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		defer f.Close()
		io.Copy(f, file)
		fmt.Fprintf(w, "Self update applied after reboot.")
		trace(path + ` --> ` + fstr)
		err = setUpdateSelfAfterReboot(path, fstr)
		if reboot {
			trace("Rebooting system...")
			rebootSystem()
		}
	})
}

func handleGetInternalVersion(m *svcContext) http.HandlerFunc {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		fmt.Fprintf(w, internalVersion)
	})
}

// This is quite dangerous since we can execute virtually any command, considering that this service
// is running as SYSTEM account in session 0.
func handlePostExec(m *svcContext) http.HandlerFunc {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		body, err := ioutil.ReadAll(r.Body)
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		defer r.Body.Close()
		cmd := fmt.Sprintf("%s", body)
		trace(cmd)
		args := strings.Split(cmd, " ")
		res, err := localExec(args)
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		fmt.Fprintf(w, `[`+cmd+`]`+"\n"+res)
	})
}

func handleGetFileStat(m *svcContext) http.HandlerFunc {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		var out string
		body, err := ioutil.ReadAll(r.Body)
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		defer r.Body.Close()
		files := fmt.Sprintf("%s", body)
		trace(files)
		fl := strings.Split(files, ",")
		for _, f := range fl {
			trace(f)
			out += `[` + f + `]` + "\n"
			stats, err := os.Stat(f)
			if err != nil {
				out += err.Error()
			} else {
				out += "Name: " + stats.Name() + "\n"
				out += "Size: " + fmt.Sprintf("%v", stats.Size()) + "\n"
				out += "Mode: " + fmt.Sprintf("%v", stats.Mode()) + "\n"
				out += "ModTime: " + fmt.Sprintf("%v", stats.ModTime()) + "\n"
				out += "IsDir: " + fmt.Sprintf("%v", stats.IsDir()) + "\n"
			}

			fmt.Fprintf(w, out)
		}
	})
}

func handleGetReadFile(m *svcContext) http.HandlerFunc {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		var out string
		body, err := ioutil.ReadAll(r.Body)
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		defer r.Body.Close()
		file := fmt.Sprintf("%s", body)
		trace(file)
		trace(file)
		out += `[` + file + `]` + "\n"
		data, err := ioutil.ReadFile(file)
		if err != nil {
			http.Error(w, err.Error(), 500)
			return
		}

		// Write file contents
		w.Write(data)
	})
}

// Main service function.
func handleMainExecute(m *svcContext, count uint64) error {
	atomic.StoreInt32(&m.busy, 1)
	defer atomic.StoreInt32(&m.busy, 0)

	path, err := getModuleFileName()
	if err != nil {
		trace(err.Error())
		return err
	}

	dir, _ := filepath.Abs(filepath.Dir(path))
	lines, err := readLines(dir + "\\run.conf")
	if err != nil {
		trace(err.Error())
		return err
	}

	var start, end []int
	for _, str := range lines {
		s := strings.TrimSpace(str)
		var s2 []string
		// Skip blank lines
		if len(str) == 0 {
			continue
		}

		// and comments
		if s[0] == '#' {
			continue
		}

		trace(s)
		items := strings.Split(s, " ")
		val, err := strconv.ParseUint(items[0], 10, 64)
		if err != nil {
			trace("Invalid minute value: ", items[0])
			continue
		}

		for i, e := range items {
			if len(e) == 0 {
				continue
			}

			if e[0] == '"' {
				start = append(start, i)
			}

			if e[len(e)-1] == '"' {
				end = append(end, i)
			}
		}

		// Extract double-quoted arguments
		trace("Double-quoted arguments indeces:")
		tr := fmt.Sprintf("  start:%v, end:%v", start, end)
		trace(tr)
		for i, e := range start {
			s2 = append(s2, strings.Join(items[e:end[i]+1], " "))
		}

		// Reconstruct arguments list
		var items2 []string
		skip := false
		j := 0
		for _, e := range items {
			if len(e) == 0 {
				continue
			}

			if e[0] == '"' {
				items2 = append(items2, s2[j])
				j += 1
				skip = true
			} else {
				if e[len(e)-1] == '"' {
					skip = false
				} else {
					if !skip {
						items2 = append(items2, e)
					}
				}
			}
		}

		trace("Arguments list:")
		items2 = append(items2[:0], items2[1:]...)
		for _, e := range items2 {
			trace("  " + e)
		}

		// Run the command line
		if math.Mod(float64(count), float64(val)) == 0 {
			_, err := localExec(items2)
			if err != nil {
				trace(err)
			}
		}

		s2 = nil
		start = nil
		end = nil
		trace("\n")
	}

	return nil
}

func (m *svcContext) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (ssec bool, errno uint32) {
	const cmdsAccepted = svc.AcceptStop | svc.AcceptShutdown | svc.AcceptPauseAndContinue
	changes <- svc.Status{State: svc.StartPending}
	tickdef := 1 * time.Minute
	var cntr uint64
	var busy int32

	// Start our main http interface
	go func() {
		mux := mux.NewRouter()
		// API version 1
		v1 := mux.PathPrefix("/api/v1").Subrouter()
		v1.Methods("GET").Path("/version").Handler(handleGetInternalVersion(m))
		v1.Methods("GET").Path("/filestat").Handler(handleGetFileStat(m))
		v1.Methods("GET").Path("/readfile").Handler(handleGetReadFile(m))
		v1.Methods("GET").Path("/exec").Handler(handlePostExec(m))
		v1.Methods("POST").Path("/update/self").Handler(handlePostUpdateSelf(m))
		v1.Methods("POST").Path("/update/runner").Handler(handlePostUpdateGitlabRunner(m))
		v1.Methods("POST").Path("/update/conf").Handler(handlePostUpdateConf(m))
		n := negroni.Classic()
		n.UseHandler(mux)
		trace("Launching http interface...")
		graceful.Run(":8080", 5*time.Second, n)
	}()

	cntr = 0
	maintick := time.Tick(tickdef)
	slowtick := time.Tick(2 * time.Second)
	tick := maintick
	changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted}
loop:
	for {
		select {
		case <-tick:
			cntr = cntr + 1
			if cntr == math.MaxUint64 {
				cntr = 1
			}

			busy = atomic.LoadInt32(&m.busy)
			if busy == 0 {
				go func(m *svcContext, count uint64) {
					handleMainExecute(m, count)
				}(m, cntr)
			}
		case c := <-r:
			switch c.Cmd {
			case svc.Interrogate:
				changes <- c.CurrentStatus
				// Testing deadlock from https://code.google.com/p/winsvc/issues/detail?id=4
				time.Sleep(100 * time.Millisecond)
				changes <- c.CurrentStatus
			case svc.Stop, svc.Shutdown:
				break loop
			case svc.Pause:
				changes <- svc.Status{State: svc.Paused, Accepts: cmdsAccepted}
				tick = slowtick
			case svc.Continue:
				changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted}
				tick = maintick
			default:
				elog.Error(1, fmt.Sprintf("unexpected control request #%d", c))
			}
		}
	}

	changes <- svc.Status{State: svc.StopPending}
	return
}

func runService(name string, conf string, isDebug bool) {
	var err error
	if isDebug {
		elog = debug.New(name)
	} else {
		elog, err = eventlog.Open(name)
		if err != nil {
			return
		}
	}

	defer elog.Close()
	elog.Info(1, fmt.Sprintf("starting %s service", name))
	run := svc.Run
	if isDebug {
		run = debug.Run
	}

	err = run(name, &svcContext{conf: conf, busy: 0})
	if err != nil {
		elog.Error(1, fmt.Sprintf("%s service failed: %v", name, err))
		return
	}

	elog.Info(1, fmt.Sprintf("%s service stopped", name))
}

repository: leobcn/holly

repo_name: leobcn/holly


text:
package urls

import (
	"testing"

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

func TestIsTarArchive(t *testing.T) {
	assert.False(t, IsTarArchive("http://domain.com/artefact"))
	assert.False(t, IsTarArchive("http://domain.com/artefact.txt"))

	assert.True(t, IsTarArchive("http://domain.com/artefact.tar"))
	assert.True(t, IsTarArchive("http://domain.com/artefact.tgz"))
	assert.True(t, IsTarArchive("http://domain.com/artefact.tar.gz"))
	assert.True(t, IsTarArchive("http://domain.com/artefact.tar.gz?key=value"))
}

func TestIsZipArchive(t *testing.T) {
	assert.False(t, IsZipArchive("http://domain.com/artefact"))
	assert.False(t, IsZipArchive("http://domain.com/artefact.txt"))

	assert.True(t, IsZipArchive("http://domain.com/artefact.zip"))
	assert.True(t, IsZipArchive("http://domain.com/artefact.zip?key=value"))
}

repository: dgageot/getme

repo_name: dgageot/getme


text:
@article{li2020invested,
  title={Invested or Indebted: Ex-ante and Ex-post Reciprocity in Online Knowledge Sharing Communities},
  author={Li, Hongfei and Shankar, Ramesh and Stallaert, Jan},
  journal={ACM Transactions on Management Information Systems (TMIS)},
  volume={11},
  number={1},
  pages={1--26},
  year={2020},
  publisher={ACM New York, NY, USA}
}

repository: HongfeiUconn/webpage

repo_name: HongfeiUconn/webpage


text:
@article{Xu_2011,
 author = {Xu, Fang and Ince, {\. {I}}kbal Agah and Boeren, Sjef and Vlak, Just M. and van Oers, Monique M.},
 title = {Protein composition of the occlusion derived virus of Chrysodeixis chalcites nucleopolyhedrovirus},
 journal = {Virus Research},
 publisher = {Elsevier {BV}},
 year = {2011},
 month = {jun},
 number = {1-2},
 volume = {158},
 pages = {1--7},
 url = {https://doi.org/10.1016%2Fj.virusres.2011.02.014},
 doi = {10.1016/j.virusres.2011.02.014}
}


text:
package main

import (
	"bytes"
	"context"
	"errors"
	"flag"
	"fmt"
	"log"
	"os"
	"path"
	"regexp"
	"strconv"
	"strings"
	"text/template"
	"time"
)

func main() {
	logger := log.New(os.Stderr, "", 0)

	var (
		bitbucketServer = flag.String("bitbucket-server", "", "BitBucket Server `URL`")
		username        = flag.String("username", "", "BitBucket Server username")
		password        = flag.String("password", "", "BitBucket Server password")
		projectName     = flag.String("project", "", "Project name")
		repositoryName  = flag.String("repository", "", "Repository name")
		fromBranchName  = flag.String("from", "", "from `branch name`")
		toBranchName    = flag.String("to", "", "to `branch name`")
		timeoutSec      = flag.Int("timeout", 3, "set context timesout `Seconds`")
	)
	flag.Parse()

	if len(*bitbucketServer) == 0 ||
		len(*username) == 0 ||
		len(*password) == 0 ||
		len(*projectName) == 0 ||
		len(*repositoryName) == 0 ||
		len(*fromBranchName) == 0 ||
		len(*toBranchName) == 0 {
		flag.PrintDefaults()
		logger.Fatalln("Required parameters are missing")
	}

	ctx, cancel := context.WithTimeout(context.Background(), time.Duration(*timeoutSec)*time.Second)
	defer cancel()

	api, err := NewBitBucketAPI(*bitbucketServer, *username, *password)
	if err != nil {
		logger.Fatalln(err)
	}

	// Find release pull-request
	prChan, errChan := api.GetPullRequests(ctx, *projectName, *repositoryName)
	releasePullRequest := func() *PullRequest {
		for {
			select {
			case pr, ok := <-prChan:
				if !ok {
					return nil
				}
				if pr.FromRef.DisplayID == *fromBranchName && pr.ToRef.DisplayID == *toBranchName && pr.Open {
					return &pr
				}
			case err, ok := <-errChan:
				if ok {
					logger.Fatalln(err)
				}
			}
		}
	}()

	// Create new release pull-request
	if releasePullRequest == nil {
		pullRequest, err := api.CreatePullRequest(ctx, *projectName, *repositoryName, *fromBranchName, *toBranchName)
		if err != nil {
			logger.Fatalln(err)
		}
		releasePullRequest = pullRequest
	}

	// Find merge commits
	commitChan, errChan := api.GetPullRequestCommits(ctx, *projectName, *repositoryName, releasePullRequest)
	mergeCommits := func() []Commit {
		commits := make([]Commit, 0)
		for {
			select {
			case commit, ok := <-commitChan:
				if !ok {
					return commits
				}
				if strings.HasPrefix(commit.Message, "Merge pull request ") {
					commits = append(commits, commit)
				}
			case err, ok := <-errChan:
				if ok {
					logger.Fatalln(err)
				}
			}
		}
	}()
	pullRequestIDs := make([]int, 0)
	mergeCommitMessage := regexp.MustCompile(`^Merge pull request #(\d+) `)
	for _, commit := range mergeCommits {
		group := mergeCommitMessage.FindStringSubmatch(commit.Message)
		if len(group) <= 1 {
			logger.Fatalln(errors.New("cannot extract pull-request ID"))
		}
		prID, err := strconv.Atoi(group[1])
		if err != nil {
			logger.Fatalln(err)
		}
		pullRequestIDs = append(pullRequestIDs, prID)
	}

	// Retrieve merged pull-requests
	mergedPullRequests := make([]PullRequest, 0)
	for _, prID := range pullRequestIDs {
		pr, err := api.GetPullRequest(ctx, *projectName, *repositoryName, prID)
		if err != nil {
			logger.Fatalln(err)
		}
		mergedPullRequests = append(mergedPullRequests, *pr)
	}

	// Compose description
	type DescriptionParameters struct {
		PullRequests []PullRequest
	}
	params := DescriptionParameters{PullRequests: mergedPullRequests}
	tmpl, err := template.New("description").Parse(`{{range $pr := .PullRequests}}
- #{{$pr.ID}} {{$pr.Title}} (@{{$pr.Author.User.Name}}){{end}}`)
	if err != nil {
		logger.Fatalln(err)
	}
	descBuf := new(bytes.Buffer)
	if err := tmpl.Execute(descBuf, params); err != nil {
		logger.Fatalln(err)
	}
	description := descBuf.String()

	// Update pull-request
	now := time.Now()
	releasePullRequest, err = api.UpdatePullRequest(ctx, *projectName, *repositoryName, releasePullRequest, map[string]interface{}{
		"version":     releasePullRequest.Version,
		"title":       fmt.Sprintf("Release (%s)", now.Format("2006/01/02 15:04:05 JST")),
		"description": description,
	})
	if err != nil {
		logger.Fatalln(err)
	}
	fmt.Println(path.Join(*bitbucketServer, fmt.Sprintf("/projects/%s/repos/%s/pull-requests/%d", *projectName, *repositoryName, releasePullRequest.ID)))
}

repository: cockscomb/bitbucket-server-pr-request

repo_name: cockscomb/bitbucket-server-pr-request