text:
@inproceedings{Gyongyi:2004:CWS:1316689.1316740,
 author = {Gy\"{o}ngyi, Zolt\'{a}n and Garcia-Molina, Hector and Pedersen, Jan},
 title = {Combating Web Spam with Trustrank},
 booktitle = {Proceedings of the Thirtieth International Conference on Very Large Data Bases - Volume 30},
 series = {VLDB '04},
 year = {2004},
 isbn = {0-12-088469-0},
 location = {Toronto, Canada},
 pages = {576--587},
 numpages = {12},
 url = {http://dl.acm.org/citation.cfm?id=1316689.1316740},
 acmid = {1316740},
 publisher = {VLDB Endowment},
}

@INPROCEEDINGS{Krishnan06webspam,
    author = {Vijay Krishnan},
    title = {Web spam detection with anti-trust rank},
    booktitle = {In AIRWEB},
    year = {2006},
    pages = {37--40}
}

@inproceedings{Wu:2006:TTU:1135777.1135792,
 author = {Wu, Baoning and Goel, Vinay and Davison, Brian D.},
 title = {Topical TrustRank: Using Topicality to Combat Web Spam},
 booktitle = {Proceedings of the 15th International Conference on World Wide Web},
 series = {WWW '06},
 year = {2006},
 isbn = {1-59593-323-9},
 location = {Edinburgh, Scotland},
 pages = {63--72},
 numpages = {10},
 url = {http://doi.acm.org/10.1145/1135777.1135792},
 doi = {10.1145/1135777.1135792},
 acmid = {1135792},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {PageRank, TrustRank, spam, web search engine},
}

@inproceedings{Caverlee:2007:CWS:1281100.1281124,
 author = {Caverlee, James and Liu, Ling},
 title = {Countering Web Spam with Credibility-based Link Analysis},
 booktitle = {Proceedings of the Twenty-sixth Annual ACM Symposium on Principles of Distributed Computing},
 series = {PODC '07},
 year = {2007},
 isbn = {978-1-59593-616-5},
 location = {Portland, Oregon, USA},
 pages = {157--166},
 numpages = {10},
 url = {http://doi.acm.org/10.1145/1281100.1281124},
 doi = {10.1145/1281100.1281124},
 acmid = {1281124},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {PageRank, credibility, link analysis, spam, web algorithms},
}

@inproceedings{Leon-Suematsu:2011:WSD:2052138.2052339,
 author = {Leon-Suematsu, Yutaka I. and Inui, Kentaro and Kurohashi, Sadao and Kidawara, Yutaka},
 title = {Web Spam Detection by Exploring Densely Connected Subgraphs},
 booktitle = {Proceedings of the 2011 IEEE/WIC/ACM International Conferences on Web Intelligence and Intelligent Agent Technology - Volume 01},
 series = {WI-IAT '11},
 year = {2011},
 isbn = {978-0-7695-4513-4},
 pages = {124--129},
 numpages = {6},
 url = {http://dx.doi.org/10.1109/WI-IAT.2011.152},
 doi = {10.1109/WI-IAT.2011.152},
 acmid = {2052339},
 publisher = {IEEE Computer Society},
 address = {Washington, DC, USA},
 keywords = {Web spam, dense subgraphs, biased pagerank},
}

@inproceedings{Castillo:2007:KYN:1277741.1277814,
 author = {Castillo, Carlos and Donato, Debora and Gionis, Aristides and Murdock, Vanessa and Silvestri, Fabrizio},
 title = {Know Your Neighbors: Web Spam Detection Using the Web Topology},
 booktitle = {Proceedings of the 30th Annual International ACM SIGIR Conference on Research and Development in Information Retrieval},
 series = {SIGIR '07},
 year = {2007},
 isbn = {978-1-59593-597-7},
 location = {Amsterdam, The Netherlands},
 pages = {423--430},
 numpages = {8},
 url = {http://doi.acm.org/10.1145/1277741.1277814},
 doi = {10.1145/1277741.1277814},
 acmid = {1277814},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {content spam, link spam, web spam},
}

@inproceedings{Gyongyi:2006:LSD:1182635.1164166,
 author = {Gyongyi, Zoltan and Berkhin, Pavel and Garcia-Molina, Hector and Pedersen, Jan},
 title = {Link Spam Detection Based on Mass Estimation},
 booktitle = {Proceedings of the 32Nd International Conference on Very Large Data Bases},
 series = {VLDB '06},
 year = {2006},
 location = {Seoul, Korea},
 pages = {439--450},
 numpages = {12},
 url = {http://dl.acm.org/citation.cfm?id=1182635.1164166},
 acmid = {1164166},
 publisher = {VLDB Endowment},
}

@INPROCEEDINGS{Wu05identifyinglink,
    author = {Baoning Wu and Brian D. Davison},
    title = {Identifying Link Farm Spam Pages},
    booktitle = {Proceedings of the 14th International World Wide Web Conference},
    year = {2005},
    pages = {820--829},
    publisher = {ACM Press}
}

@inproceedings{Gan:2007:IWS:1244408.1244412,
 author = {Gan, Qingqing and Suel, Torsten},
 title = {Improving Web Spam Classifiers Using Link Structure},
 booktitle = {Proceedings of the 3rd International Workshop on Adversarial Information Retrieval on the Web},
 series = {AIRWeb '07},
 year = {2007},
 isbn = {978-1-59593-732-2},
 location = {Banff, Alberta, Canada},
 pages = {17--20},
 numpages = {4},
 url = {http://doi.acm.org/10.1145/1244408.1244412},
 doi = {10.1145/1244408.1244412},
 acmid = {1244412},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {classification, link analysis, machine learning, search engines, web mining, web spam detection},
}

@inproceedings{Geng:2008:IWS:1367497.1367685,
 author = {Geng, Guanggang and Wang, Chunheng and Li, Qiudan},
 title = {Improving Web Spam Detection with Re-extracted Features},
 booktitle = {Proceedings of the 17th International Conference on World Wide Web},
 series = {WWW '08},
 year = {2008},
 isbn = {978-1-60558-085-2},
 location = {Beijing, China},
 pages = {1119--1120},
 numpages = {2},
 url = {http://doi.acm.org/10.1145/1367497.1367685},
 doi = {10.1145/1367497.1367685},
 acmid = {1367685},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {content spam, link spam, machine learning, web spam},
}

@inproceedings{Geng:2009:LBS:1526709.1526920,
 author = {Geng, Guang-Gang and Li, Qiudan and Zhang, Xinchang},
 title = {Link Based Small Sample Learning for Web Spam Detection},
 booktitle = {Proceedings of the 18th International Conference on World Wide Web},
 series = {WWW '09},
 year = {2009},
 isbn = {978-1-60558-487-4},
 location = {Madrid, Spain},
 pages = {1185--1186},
 numpages = {2},
 url = {http://doi.acm.org/10.1145/1526709.1526920},
 doi = {10.1145/1526709.1526920},
 acmid = {1526920},
 publisher = {ACM},
 address = {New York, NY, USA},
 keywords = {content spam, link spam, machine learning, web spam},
}

repository: Toolanto/onlineSpamDetection

repo_name: Toolanto/onlineSpamDetection


text:
// Copyright 2014 The Azul3D Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// Code generated by this program is also under
// the above license.

// glwrap is a tool for generating Go OpenGL wrappers.
package main

import (
	"io"
	"text/template"
)

const enumsTemplate = `// Copyright 2014 The Azul3D Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// This source file was automatically generated using glwrap.{{range $tag := .BuildTags}}
// +build {{$tag}}{{end}}

package {{.API}}

const(
{{range $element := .Constants}}	{{.Name}} {{.Type}} = {{.Value}}
{{end}}
)
`

func writeEnums(out io.Writer, tmplData *TmplData) error {
	tmpl := template.Must(template.New("enumsTemplate").Parse(enumsTemplate))
	err = tmpl.Execute(out, map[string]interface{}{
		"BuildTags": tmplData.BuildTags,
		"Constants": tmplData.Constants,
		"Title":     tmplData.Title,
		"API":       tmplData.API,
	})
	if err != nil {
		return err
	}
	return nil
}

license_type: permissive

branch_name: refs/heads/master

extension: go


text:
DESCRIPTION = "Simple Java Swing hello world application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

RDEPENDS_${PN} = "java2-runtime"

SRC_URI = "file://HelloWorldSwing.java"

S = "${WORKDIR}"

inherit java-library

do_compile() {
        mkdir -p build
        javac -d build `find . -name "*.java"`
        fastjar cf ${JARFILENAME} -C build .
}

BBCLASSEXTEND = "native"

license: MIT

extension: bb


text:
file(REMOVE_RECURSE
  "CMakeFiles/timewarp-file.dir/examples/timewarp-file.c.o"
  "CMakeFiles/timewarp-file.dir/examples/audio_out.c.o"
  "timewarp-file.pdb"
  "timewarp-file"
)

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

extension: cmake


text:
SUMMARY = "Phosphor State Management"
DESCRIPTION = "Phosphor State Manager provides a set of system state \
management daemons. It is suitable for use on a wide variety of OpenBMC \
platforms."
HOMEPAGE = "https://github.com/openbmc/phosphor-state-manager"
PR = "r1"
PV = "1.0+git${SRCPV}"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"

include phosphor-state-manager-systemd-links.inc

STATE_MGR_PACKAGES = " \
    ${PN}-host \
    ${PN}-chassis \
    ${PN}-bmc \
    ${PN}-hypervisor \
    ${PN}-discover \
    ${PN}-host-check \
    ${PN}-reset-sensor-states \
    ${PN}-systemd-target-monitor \
    ${PN}-obmc-targets \
    ${PN}-scheduled-host-transition \
    ${PN}-chassis-check-power-status \
    ${PN}-secure-check \
    ${PN}-chassis-poweron-log \
"
PACKAGE_BEFORE_PN += "${STATE_MGR_PACKAGES}"
ALLOW_EMPTY:${PN} = "1"

DBUS_PACKAGES = "${STATE_MGR_PACKAGES}"

SYSTEMD_PACKAGES = "${PN}-discover \
                    ${PN}-reset-sensor-states \
                    ${PN}-systemd-target-monitor \
"

PACKAGECONFIG ??= "no-warm-reboot \
                   only-run-apr-on-power-loss \
                   only-allow-boot-when-bmc-ready"

# Disable warm reboots of host
PACKAGECONFIG[no-warm-reboot] = "-Dwarm-reboot=disabled,-Dwarm-reboot=enabled"

# Only run auto power restore logic if system had ac loss
PACKAGECONFIG[only-run-apr-on-power-loss] = "-Donly-run-apr-on-power-loss=true,-Donly-run-apr-on-power-loss=false"

# Only allow boot operations when BMC is in Ready state
PACKAGECONFIG[only-allow-boot-when-bmc-ready] = "-Donly-allow-boot-when-bmc-ready=true,-Donly-allow-boot-when-bmc-ready=false"

# The host-check function will check if the host is running
# after a BMC reset.
# The reset-sensor-states function will reset the host
# sensors on a BMC reset or system power loss.
# Neither is required for host state function but are
# recommended to deal properly with these reset scenarios.
RRECOMMENDS:${PN}-host = "${PN}-host-check ${PN}-reset-sensor-states"

# The obmc-targets are the base targets required to boot a computer system
RRECOMMENDS:${PN}-host += "${PN}-obmc-targets"

# Make it the default to create an info log when the chassis transitions
# from off to on
RRECOMMENDS:${PN}-chassis:append = " ${PN}-chassis-poweron-log"

inherit meson pkgconfig
inherit obmc-phosphor-dbus-service
inherit obmc-phosphor-systemd

DEPENDS += "sdbusplus"
DEPENDS += "sdeventplus"
DEPENDS += "phosphor-logging"
DEPENDS += "phosphor-dbus-interfaces"
DEPENDS += "libcereal"
DEPENDS += "nlohmann-json"
DEPENDS += "cli11"
DEPENDS += "libgpiod"

RDEPENDS:${PN}-chassis += "bash"
RDEPENDS:${PN}-host += "bash"

EXTRA_OEMESON:append = " -Dtests=disabled"

FILES:${PN}-host = "${bindir}/phosphor-host-state-manager"
FILES:${PN}-host += "${libexecdir}/host-reboot"
DBUS_SERVICE:${PN}-host += "xyz.openbmc_project.State.Host@.service"
DBUS_SERVICE:${PN}-host += "phosphor-reboot-host@.service"
SYSTEMD_SERVICE:${PN}-host += "phosphor-reset-host-reboot-attempts@.service"
SYSTEMD_SERVICE:${PN}-host += "phosphor-clear-one-time@.service"
SYSTEMD_SERVICE:${PN}-host += "phosphor-set-host-transition-to-running@.service"
SYSTEMD_SERVICE:${PN}-host += "phosphor-set-host-transition-to-off@.service"

FILES:${PN}-chassis = "${bindir}/phosphor-chassis-state-manager"
DBUS_SERVICE:${PN}-chassis += "xyz.openbmc_project.State.Chassis@.service"
SYSTEMD_SERVICE:${PN}-chassis += "obmc-power-start@.service"
SYSTEMD_SERVICE:${PN}-chassis += "obmc-power-stop@.service"
SYSTEMD_SERVICE:${PN}-chassis += "obmc-powered-off@.service"
SYSTEMD_SERVICE:${PN}-chassis += "phosphor-reset-chassis-on@.service"
SYSTEMD_SERVICE:${PN}-chassis += "phosphor-reset-chassis-running@.service"

SYSTEMD_SERVICE:${PN}-chassis-poweron-log += "phosphor-create-chassis-poweron-log@.service"

FILES:${PN}-chassis += "${bindir}/obmcutil"

FILES:${PN}-bmc = "${bindir}/phosphor-bmc-state-manager"
FILES:${PN}-bmc += "${sysconfdir}/phosphor-systemd-target-monitor/phosphor-service-monitor-default.json"
DBUS_SERVICE:${PN}-bmc += "xyz.openbmc_project.State.BMC.service"
DBUS_SERVICE:${PN}-bmc += "obmc-bmc-service-quiesce@.target"

FILES:${PN}-secure-check = "${bindir}/phosphor-secure-boot-check"
SYSTEMD_SERVICE:${PN}-secure-check += "phosphor-bmc-security-check.service"

FILES:${PN}-hypervisor = "${bindir}/phosphor-hypervisor-state-manager"
DBUS_SERVICE:${PN}-hypervisor += "xyz.openbmc_project.State.Hypervisor.service"

FILES:${PN}-discover = "${bindir}/phosphor-discover-system-state"
SYSTEMD_SERVICE:${PN}-discover += "phosphor-discover-system-state@.service"

FILES:${PN}-host-check = "${bindir}/phosphor-host-check"
SYSTEMD_SERVICE:${PN}-host-check += "phosphor-reset-host-running@.service"
FILES:${PN}-host-check = "${bindir}/phosphor-host-reset-recovery"
SYSTEMD_SERVICE:${PN}-host-check += "phosphor-reset-host-recovery@.service"

SYSTEMD_SERVICE:${PN}-reset-sensor-states += "phosphor-reset-sensor-states@.service"

FILES:${PN}-systemd-target-monitor = " \
    ${bindir}/phosphor-systemd-target-monitor \
    ${sysconfdir}/phosphor-systemd-target-monitor/phosphor-target-monitor-default.json \
    "
SYSTEMD_SERVICE:${PN}-systemd-target-monitor += "phosphor-systemd-target-monitor.service"

FILES:${PN}-scheduled-host-transition = "${bindir}/phosphor-scheduled-host-transition"
DBUS_SERVICE:${PN}-scheduled-host-transition += "xyz.openbmc_project.State.ScheduledHostTransition@.service"

FILES:${PN}-chassis-check-power-status = "${bindir}/phosphor-chassis-check-power-status"
SYSTEMD_SERVICE:${PN}-chassis-check-power-status += "phosphor-chassis-check-power-status@.service"

# Chassis power synchronization targets
# - start-pre:         Services to run before we start power on process
# - start:             Services to run to do the chassis power on
# - on:                Services to run once power is on
# - stop-pre,stop,off: Same as above but applied to powering off
# - reset-on:          Services to check if chassis power is on after bmc reset
CHASSIS_SYNCH_TARGETS = "start-pre start on stop-pre stop off reset-on"

# Chassis action power targets
# - on:  Services to run to power on the chassis
# - off: Services to run to power off the chassis
# - cycle: Services to run to cycle power to the chassis
# - powered-off: Services to run once chassis power is off
# - reset: Services to check chassis power state and update chassis "on" target
# - hard-off: Services to force an immediate power off of the chassis
# - blackout: Target to enter when chassis experiences blackout
CHASSIS_ACTION_TARGETS = "poweron poweroff powercycle powered-off powerreset hard-poweroff blackout"

# Track all host synchronization point targets
# - start-pre:                 Services to run before we start host boot
# - starting:                  Services to run to do the host boot
# - started:                   Services to run once the host is booted
# - stop-pre,stopping,stopped: Same as above but applied to shutting down the host
# - reset-running:             Services to check if host is running after bmc reset
HOST_SYNCH_TARGETS = "start-pre starting started stop-pre stopping stopped reset-running"

# Track all host action targets
# - start:    Will run startmin target, this target used for any additional
#             services that user needs for an initial power on of host.
#             For example, resetting the host reboot count could be put in
#             this target so on any fresh power on, this count is reset.
# - startmin: Minimum services required to start the host. This target will
#             be called by reboot and start target.
# - stop:     Services to run to shutdown the host
# - quiesce:  Target to enter on host boot failure
# - graceful-quiesce:  Target to enter on host boot failure (allow host graceful shutdown)
# - shutdown: Tell host to shutdown, then stop system
# - reset:   Services to check if host is running and update host "start" target
# - crash:   Target to run when host crashes. it is very much similar to
#            quiesce target but the only delta is that this target contains
#            multiple services and one of them is the quiesce target.
# - timeout: Target to run when host watchdog times out
# - reboot:  Reboot the host with a chassis power cycle included
# - warm-reboot: Reboot the host without a chassis power cycle.
# - force-warm-reboot: Reboot the host without a chassis power cycle and without
#                      notifying the host.
# - diagnostic-mode: This will be entered when the host is collecting diagnostic
#                    data for itself.
HOST_ACTION_TARGETS = "start startmin stop quiesce graceful-quiesce reset shutdown crash timeout "
HOST_ACTION_TARGETS += "reboot warm-reboot force-warm-reboot diagnostic-mode"

CHASSIS_SYNCH_FMT = "obmc-power-{0}@.target"
CHASSIS_ACTION_FMT = "obmc-chassis-{0}@.target"
HOST_SYNCH_FMT = "obmc-host-{0}@.target"
HOST_ACTION_FMT = "obmc-host-{0}@.target"

CHASSIS_LINK_SYNCH_FMT = "${CHASSIS_SYNCH_FMT}:obmc-power-{0}@{1}.target"
CHASSIS_LINK_ACTION_FMT = "${CHASSIS_ACTION_FMT}:obmc-chassis-{0}@{1}.target"
HOST_LINK_SYNCH_FMT = "${HOST_SYNCH_FMT}:obmc-host-{0}@{1}.target"
HOST_LINK_ACTION_FMT = "${HOST_ACTION_FMT}:obmc-host-{0}@{1}.target"
FAN_LINK_FMT = "obmc-fan-control-ready@.target:obmc-fan-control-ready@{0}.target"

# Targets to be executed on checkstop and watchdog timeout
HOST_ERROR_TARGETS = "timeout"

QUIESCE_TMPL = "obmc-host-quiesce@.target"
CRASH_TIMEOUT_TGTFMT = "obmc-host-{0}@{1}.target"
QUIESCE_INSTFMT = "obmc-host-quiesce@{1}.target"
QUIESCE_FMT = "../${QUIESCE_TMPL}:${CRASH_TIMEOUT_TGTFMT}.wants/${QUIESCE_INSTFMT}"

SYSTEMD_SERVICE:${PN}-obmc-targets += " \
        obmc-fans-ready.target \
        obmc-fan-control.target \
        obmc-fan-control-ready@.target \
        obmc-fan-watchdog-takeover.target \
        "

SYSTEMD_SERVICE:${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS')}"
SYSTEMD_SERVICE:${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_ACTION_FMT', 'CHASSIS_ACTION_TARGETS')}"
SYSTEMD_SERVICE:${PN}-obmc-targets += "${@compose_list(d, 'HOST_SYNCH_FMT', 'HOST_SYNCH_TARGETS')}"
SYSTEMD_SERVICE:${PN}-obmc-targets += "${@compose_list(d, 'HOST_ACTION_FMT', 'HOST_ACTION_TARGETS')}"

SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_SYNCH_FMT', 'CHASSIS_SYNCH_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list(d, 'CHASSIS_LINK_ACTION_FMT', 'CHASSIS_ACTION_TARGETS', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_SYNCH_FMT', 'HOST_SYNCH_TARGETS', 'OBMC_HOST_INSTANCES')}"
SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list(d, 'HOST_LINK_ACTION_FMT', 'HOST_ACTION_TARGETS', 'OBMC_HOST_INSTANCES')}"
SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list(d, 'FAN_LINK_FMT', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list(d, 'QUIESCE_FMT', 'HOST_ERROR_TARGETS', 'OBMC_HOST_INSTANCES')}"

# Create target relationships

# Starting the host requires chassis power on
START_TMPL_CTRL = "obmc-chassis-poweron@.target"
START_TGTFMT_CTRL = "obmc-host-startmin@{1}.target"
START_INSTFMT_CTRL = "obmc-chassis-poweron@{0}.target"
START_FMT_CTRL = "../${START_TMPL_CTRL}:${START_TGTFMT_CTRL}.requires/${START_INSTFMT_CTRL}"
SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list_zip(d, 'START_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"

# Chassis off requires host off
STOP_TMPL_CTRL = "obmc-host-stop@.target"
STOP_TGTFMT_CTRL = "obmc-chassis-poweroff@{0}.target"
STOP_INSTFMT_CTRL = "obmc-host-stop@{1}.target"
STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.requires/${STOP_INSTFMT_CTRL}"
SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES', 'OBMC_HOST_INSTANCES')}"

# Hard power off requires chassis off
HARD_OFF_TMPL_CTRL = "obmc-chassis-poweroff@.target"
HARD_OFF_TGTFMT_CTRL = "obmc-chassis-hard-poweroff@{0}.target"
HARD_OFF_INSTFMT_CTRL = "obmc-chassis-poweroff@{0}.target"
HARD_OFF_FMT_CTRL = "../${HARD_OFF_TMPL_CTRL}:${HARD_OFF_TGTFMT_CTRL}.requires/${HARD_OFF_INSTFMT_CTRL}"
SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list_zip(d, 'HARD_OFF_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}"

# Force the standby target to run the chassis reset check target
RESET_TMPL_CTRL = "obmc-chassis-powerreset@.target"
SYSD_TGT = "multi-user.target"
RESET_INSTFMT_CTRL = "obmc-chassis-powerreset@{0}.target"
RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}"
SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}"

SRC_URI = "git://github.com/openbmc/phosphor-state-manager;branch=master;protocol=https"
SRCREV = "7e969cb9464ff6e0919fe2d61f37a3f72feacedf"

S = "${WORKDIR}/git"

repository: openbmc/openbmc

repo_name: openbmc/openbmc

gha_license_id: NOASSERTION

gha_language: Python


text:
// Copyright 2020 PingCAP, Inc.
//
// 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,
// See the License for the specific language governing permissions and
// limitations under the License.

package model

import (
	"fmt"
	"time"

	cjson "github.com/gibson042/canonicaljson-go"
	"github.com/juju/errors"
	"github.com/pingcap/tiup/pkg/logger/log"
	"github.com/pingcap/tiup/pkg/repository/v1manifest"
	"github.com/pingcap/tiup/pkg/utils"
	"github.com/pingcap/tiup/server/store"
)

// Model defines operations on the manifests
type Model interface {
	UpdateComponentManifest(component string, manifest *ComponentManifest) error
	UpdateRootManifest(manifest *RootManifest) error
	UpdateIndexManifest(time.Time, func(*IndexManifest) *IndexManifest) error
	UpdateSnapshotManifest(time.Time, func(*SnapshotManifest) *SnapshotManifest) error
	UpdateTimestampManifest(time.Time) error
}

type model struct {
	txn  store.FsTxn
	keys map[string]*v1manifest.KeyInfo
}

// New returns a object implemented Model
func New(txn store.FsTxn, keys map[string]*v1manifest.KeyInfo) Model {
	return &model{txn, keys}
}

func (m *model) UpdateComponentManifest(component string, manifest *ComponentManifest) error {
	snap, err := m.ReadSnapshotManifest()
	if err != nil {
		return err
	}
	lastVersion := snap.Signed.Meta["/"+manifest.Signed.Filename()].Version
	if manifest.Signed.Version != lastVersion+1 {
		log.Debugf("Component version not expected, expect %d, got %d", lastVersion+1, manifest.Signed.Version)
		return ErrorConflict
	}
	return m.txn.WriteManifest(fmt.Sprintf("%d.%s.json", manifest.Signed.Version, component), manifest)
}

func (m *model) UpdateRootManifest(manifest *RootManifest) error {
	var last RootManifest
	if err := m.txn.ReadManifest(v1manifest.ManifestFilenameRoot, &last); err != nil {
		return err
	}
	if manifest.Signed.Version != last.Signed.Version+1 {
		return ErrorConflict
	}
	if err := m.txn.WriteManifest(v1manifest.ManifestFilenameRoot, manifest); err != nil {
		return err
	}

	return m.txn.WriteManifest(fmt.Sprintf("%d.root.json", manifest.Signed.Version), manifest)
}

func (m *model) UpdateIndexManifest(initTime time.Time, f func(*IndexManifest) *IndexManifest) error {
	snap, err := m.ReadSnapshotManifest()
	if err != nil {
		return err
	}
	lastVersion := snap.Signed.Meta[v1manifest.ManifestURLIndex].Version

	var last IndexManifest
	if err := m.txn.ReadManifest(fmt.Sprintf("%d.index.json", lastVersion), &last); err != nil {
		return err
	}
	manifest := f(&last)
	if manifest == nil {
		return nil
	}
	manifest.Signed.Version = last.Signed.Version + 1
	v1manifest.RenewManifest(&manifest.Signed, initTime)
	manifest.Signatures, err = sign(manifest.Signed, m.keys[v1manifest.ManifestTypeIndex])
	if err != nil {
		return err
	}

	return m.txn.WriteManifest(fmt.Sprintf("%d.index.json", manifest.Signed.Version), manifest)
}

func (m *model) UpdateSnapshotManifest(initTime time.Time, f func(*SnapshotManifest) *SnapshotManifest) error {
	var last SnapshotManifest
	err := m.txn.ReadManifest(v1manifest.ManifestFilenameSnapshot, &last)
	if err != nil {
		return err
	}
	manifest := f(&last)
	if manifest == nil {
		return nil
	}
	v1manifest.RenewManifest(&manifest.Signed, initTime)
	manifest.Signatures, err = sign(manifest.Signed, m.keys[v1manifest.ManifestTypeSnapshot])
	if err != nil {
		return err
	}

	return m.txn.WriteManifest(v1manifest.ManifestFilenameSnapshot, manifest)
}

// ReadSnapshotManifest returns snapshot.json
func (m *model) ReadSnapshotManifest() (*SnapshotManifest, error) {
	var snap SnapshotManifest
	if err := m.txn.ReadManifest(v1manifest.ManifestFilenameSnapshot, &snap); err != nil {
		return nil, err
	}
	return &snap, nil
}

// ReadRootManifest returns root.json
func (m *model) ReadRootManifest() (*RootManifest, error) {
	var root RootManifest
	if err := m.txn.ReadManifest(v1manifest.ManifestFilenameRoot, &root); err != nil {
		return nil, err
	}
	return &root, nil
}

func (m *model) UpdateTimestampManifest(initTime time.Time) error {
	fi, err := m.txn.Stat(v1manifest.ManifestFilenameSnapshot)
	if err != nil {
		return err
	}
	reader, err := m.txn.Read(v1manifest.ManifestFilenameSnapshot)
	if err != nil {
		return err
	}
	sha256, err := utils.SHA256(reader)
	if err != nil {
		reader.Close()
		return err
	}
	reader.Close()

	var manifest TimestampManifest
	err = m.txn.ReadManifest(v1manifest.ManifestFilenameTimestamp, &manifest)
	if err != nil {
		return err
	}
	manifest.Signed.Version++
	manifest.Signed.Meta[v1manifest.ManifestURLSnapshot] = v1manifest.FileHash{
		Hashes: map[string]string{
			v1manifest.SHA256: sha256,
		},
		Length: uint(fi.Size()),
	}
	v1manifest.RenewManifest(&manifest.Signed, initTime)
	manifest.Signatures, err = sign(manifest.Signed, m.keys[v1manifest.ManifestTypeTimestamp])
	if err != nil {
		return err
	}

	return m.txn.WriteManifest(v1manifest.ManifestFilenameTimestamp, &manifest)
}

func sign(signed interface{}, keys ...*v1manifest.KeyInfo) ([]v1manifest.Signature, error) {
	payload, err := cjson.Marshal(signed)
	if err != nil {
		return nil, err
	}

	signs := []v1manifest.Signature{}
	for _, k := range keys {
		if k == nil {
			return nil, ErrorMissingKey
		}
		id, err := k.ID()
		if err != nil {
			return nil, errors.Trace(err)
		}
		sign, err := k.Signature(payload)
		if err != nil {
			return nil, errors.Trace(err)
		}
		signs = append(signs, v1manifest.Signature{
			KeyID: id,
			Sig:   sign,
		})
	}

	return signs, nil
}

repository: Obooman/tiup

repo_name: Obooman/tiup


text:
SUMMARY = "simple dynamic multicast routing daemon that only uses IGMP signalling"
HOMEPAGE = "http://sourceforge.net/projects/igmpproxy/"

LICENSE = "GPL-2.0-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=432040ff3a55670c1dec0c32b209ad69"

SRC_URI = "https://github.com/pali/igmpproxy/releases/download/${PV}/${BP}.tar.gz"
SRC_URI[md5sum] = "5565874d9631103109a72452cecb5ce7"
SRC_URI[sha256sum] = "d1fc244cb2fbbf99f720bda3e841fe59ece9b6919073790b4b892739b1b844eb"

UPSTREAM_CHECK_URI = "https://github.com/pali/${BPN}/releases"

inherit autotools pkgconfig

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_license_id: MIT

gha_language: BitBake


text:
#
# base recipe: meta/recipes-graphics/xorg-app/rgb_1.0.6.bb
# base branch: jethro
#

require xorg-app-common.inc

SUMMARY = "X11 color name database"
DESCRIPTION = "This package includes both the list mapping X color names \
to RGB values (rgb.txt) and, if configured to use a database for color \
lookup, the rgb program to convert the text file into the binary database \
format."

LIC_FILES_CHKSUM = "file://COPYING;md5=ef598adbe241bd0b0b9113831f6e249a"
PE = "1"

DPN = "x11-xserver-utils"
DEPENDS += "xproto util-macros"

S = "${DEBIAN_UNPACK_DIR}/${PN}"

# Apply debian patch by quilt
DEBIAN_PATCH_TYPE = "quilt"

FILES_${PN} += "${datadir}/X11"

repository: nghiaht-tsdv/meta-debian

repo_name: nghiaht-tsdv/meta-debian

branch_name: refs/heads/jethro


text:
require ${PN}-${PV}.inc

RDEPENDS_${PN} = "python-pyqt libanki"
RRECOMMENDS_${PN} = "virtual-japanese-font"

branch_name: refs/heads/fido


text:
package pod

import (
	"bytes"
	"context"
	"io"
	"io/ioutil"
	"strings"
	"testing"
	"time"

	"github.com/pkg/errors"

	"github.com/mongodb/mongodb-kubernetes-operator/pkg/kube/client"
	"github.com/stretchr/testify/assert"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/types"
	"k8s.io/apimachinery/pkg/util/wait"
)

type mockPoller struct{}

func (m mockPoller) Poll(interval, timeout time.Duration, condition wait.ConditionFunc) error {
	elapsedTime := time.Duration(0)
	for timeout >= elapsedTime {
		done, err := condition()
		if err != nil {
			return errors.Errorf("error in condition func: %s", err)
		}
		elapsedTime += interval
		if done {
			return nil
		}
	}
	return errors.Errorf("timed out")
}

func TestWaitForPhase(t *testing.T) {
	mockedClient := client.NewClient(client.NewMockedClient())
	testPod := newPod(corev1.PodRunning)
	err := mockedClient.Update(context.TODO(), &testPod)
	assert.NoError(t, err)
	_, err = waitForPhase(
		mockedClient,
		types.NamespacedName{Name: testPod.Name, Namespace: testPod.Namespace},
		time.Second*5,
		time.Minute*5,
		corev1.PodRunning,
		mockPoller{},
	)
	assert.NoError(t, err)

	testPod = newPod(corev1.PodFailed)
	_ = mockedClient.Update(context.TODO(), &testPod)
	_, err = waitForPhase(mockedClient,
		types.NamespacedName{Name: testPod.Name, Namespace: testPod.Namespace},
		time.Second*5,
		time.Minute*5,
		corev1.PodRunning,
		mockPoller{},
	)
	assert.Error(t, err)
}

func newPod(phase corev1.PodPhase) corev1.Pod {
	return corev1.Pod{
		ObjectMeta: metav1.ObjectMeta{
			Name:      "test-pod",
			Namespace: "test-namespace",
		},

		Spec: corev1.PodSpec{},
		Status: corev1.PodStatus{
			Phase: phase,
		},
	}
}

type mockStreamer struct {
	logs string
}

func (m mockStreamer) Stream() (io.ReadCloser, error) {
	return ioutil.NopCloser(strings.NewReader(m.logs)), nil
}

func TestGetLogs(t *testing.T) {
	tests := []struct {
		expected string
	}{
		{expected: "Hello World"},
		{expected: "Line 1\nLine2\nLine3"},
		{expected: "Some other log line."},
	}
	for _, tt := range tests {
		var b bytes.Buffer
		err := GetLogs(&b, mockStreamer{logs: tt.expected})
		assert.NoError(t, err)
		assert.Equal(t, tt.expected+"\n", b.String())
	}
}

repository: FridMehdi/mongodb-kubernetes-operator

repo_name: FridMehdi/mongodb-kubernetes-operator


text:
@Article{rs13010137,
AUTHOR = {Zekoll, Viktoria and Main-Knorn, Magdalena and Louis, Jerome and Frantz, David and Richter, Rudolf and Pflug, Bringfried},
geo = {Wessling, Germany (1, 5) and Berlin, Germany (2, 4, 6) and Toulouse, France (3)},
TITLE = {Comparison of Masking Algorithms for Sentinel-2 Imagery},
JOURNAL = {Remote Sensing},
VOLUME = {13},
YEAR = {2021},
NUMBER = {1},
ARTICLE-NUMBER = {137},
URL = {https://www.mdpi.com/2072-4292/13/1/137},
ISSN = {2072-4292},
DOI = {10.3390/rs13010137}
}

repository: davidfrantz/academic-kickstart

repo_name: davidfrantz/academic-kickstart

extension: bib


text:
package usecase

import (
	"context"
	"io"

	"github.com/ktr0731/evans/entity"
	"github.com/ktr0731/evans/usecase/port"
	"google.golang.org/grpc/metadata"
)

func Call(
	params *port.CallParams,
	outputPort port.OutputPort,
	inputter port.Inputter,
	grpcPort port.GRPCPort,
	builder port.DynamicBuilder,
	env entity.Environment,
) (io.Reader, error) {
	rpc, err := env.RPC(params.RPCName)
	if err != nil {
		return nil, err
	}
	req, err := inputter.Input(rpc.RequestMessage())
	if err != nil {
		return nil, err
	}

	res := builder.NewMessage(rpc.ResponseMessage())

	data := map[string]string{}
	for _, pair := range env.Headers() {
		data[pair.Key] = pair.Val
	}
	ctx := metadata.NewOutgoingContext(context.Background(), metadata.New(data))

	if err := grpcPort.Invoke(ctx, rpc.FQRN(), req, res); err != nil {
		return nil, err
	}

	return outputPort.Call(res)
}