text:
SUMMARY = "Script to manage coredump of cortexM4"
HOMEPAGE = "www.st.com"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

DEPENDS = "udev"

SRC_URI = " \
    file://85-m4-dump.rules \
    file://stm32mp-m4fwdump.sh \
    \
    file://stm32mp-coredump-sysfs.sh \
    file://st-m4coredump.service \
    "

S = "${WORKDIR}"

inherit systemd

do_install() {
    install -D -p -m0644 ${WORKDIR}/85-m4-dump.rules \
        ${D}${sysconfdir}/udev/rules.d/85-m4-dump.rules

    install -d ${D}${sbindir}/
    install -m0755 ${WORKDIR}/stm32mp-m4fwdump.sh ${D}${sbindir}/

    sed -i -e "s:#BINDIR#:${sbindir}:g" \
              ${D}${sysconfdir}/udev/rules.d/85-m4-dump.rules

    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
        install -d ${D}${systemd_unitdir}/system
        install -d ${D}${base_sbindir}
        install -m 644 ${WORKDIR}/st-m4coredump.service ${D}${systemd_unitdir}/system/
        install -m 755 ${WORKDIR}/stm32mp-coredump-sysfs.sh ${D}${base_sbindir}/
    fi
}
FILES:${PN} += "${systemd_unitdir}/system"

branch_name: refs/heads/mickledore


text:
DESCRIPTION = "Clone of the classic Paradroid from C64 for Qtopia/Opie - based on SDL"
SECTION = "opie/games"
PRIORITY = "optional"
MAINTAINER = "Michael 'Mickey' Lauer <mickey@Vanille.de>"
LICENSE = "GPL"
HOMEPAGE = "http://freedroid.sourceforge.net/"
DEPENDS = "virtual/libqpe libsdl-qpe libsdl-image"
PR = "r1"

SRC_URI = "${SOURCEFORGE_MIRROR}/freedroid/freedroid-${PV}.tar.gz \
           file://icon.png"

inherit autotools

do_compile() {
	oe_runmake pkgdatadir=${palmtopdir}/share/freedroid
}

do_install() {
        install -d ${D}${palmtopdir}/bin \
		   ${D}${palmtopdir}/apps/Games \
		   ${D}${palmtopdir}/pics \
		   ${D}${palmtopdir}/share/freedroid/graphics \
		   ${D}${palmtopdir}/share/freedroid/map \
		   ${D}${palmtopdir}/share/freedroid/sound
        install -D -m 0755 src/freedroid ${D}${palmtopdir}/bin/freedroid
	install -D -m 0644 ${WORKDIR}/icon.png ${D}${palmtopdir}/pics/freedroid.png

	cp -pPR graphics/* ${D}${palmtopdir}/share/freedroid/graphics
	cp -pPR map/* ${D}${palmtopdir}/share/freedroid/map
	cp -pPR sound/* ${D}${palmtopdir}/share/freedroid/sound

	echo "[Desktop Entry]" >${D}${palmtopdir}/apps/Games/freedroid.desktop
	echo "Comment=A Paradroid Clone" >>${D}${palmtopdir}/apps/Games/freedroid.desktop
	echo "Exec=freedroid" >>${D}${palmtopdir}/apps/Games/freedroid.desktop
	echo "Icon=freedroid" >>${D}${palmtopdir}/apps/Games/freedroid.desktop
	echo "Type=Application" >>${D}${palmtopdir}/apps/Games/freedroid.desktop
	echo "Name=Freedroid" >>${D}${palmtopdir}/apps/Games/freedroid.desktop
}

FILES_${PN} = ""
FILES_${PN} = "${palmtopdir}/"

license: MIT

repository: Terentyev/familiar-linux

license_type: permissive

repo_name: Terentyev/familiar-linux

branch_name: refs/heads/master

extension: bb


text:
@article{spotlight2022,
  title={Spotlight: Distributed-computing for Rietveld analyses using an ensemble of local optimizers},
  author={Biwer, Christopher M and Vogel, Sven C and McKerns, Michael M and Savage, Daniel},
  journal={in prep.},
  year={2022},
}

repository: lanl/spotlight

repo_name: lanl/spotlight

gha_license_id: NOASSERTION

gha_language: Python

extension: bib


text:
@article{goldstein2020a,
	Author = {Goldstein, David M.},
	Date-Added = {2019-05-30 09:04:25 -0700},
	Date-Modified = {2020-07-29 16:46:23 -0700},
	Doi = {10.1111/1467-968X.12192},
	Journal = {Transactions of the Philological Society},
	Keywords = {greek, IE, case, paradigm function morphology, homer, mycenaean, -phi, instrumental, morphology,},
	Langid = {american},
	Language = {english},
	Title = {Homeric -\textit{phi(n)} is an oblique case marker},
	Volume = {118},
	Year = {2020},
	Bdsk-Url-1 = {https://doi.org/10.1111/1467-968X.12192}}

repository: DMGoldstein/academic

repo_name: DMGoldstein/academic


text:
file(REMOVE_RECURSE
  "CMakeFiles/LLVMDebugInfo.dir/DIContext.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFAbbreviationDeclaration.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFCompileUnit.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFContext.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFDebugAbbrev.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFDebugArangeSet.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFDebugAranges.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFDebugFrame.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFDebugInfoEntry.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFDebugLine.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFDebugRangeList.cpp.o"
  "CMakeFiles/LLVMDebugInfo.dir/DWARFFormValue.cpp.o"
  "../libLLVMDebugInfo.pdb"
  "../libLLVMDebugInfo.a"
)

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

license: NCSA

repository: canyuchen/Hacking-on-LLVM

repo_name: canyuchen/Hacking-on-LLVM

extension: cmake


text:
// Machine provides a daemon that does resource accounting and contacts ResourceManager
// for registration.
package machine

import service_pb "github.com/justicezyx/ResourceManager/proto"

func Sum(reservation_group service_pb.ReservationGroup) service_pb.ResourceUnit {
	num_of_unit := len(reservation_group.Machines)
	return service_pb.ResourceUnit{
		Cpu:    int32(num_of_unit) * reservation_group.ResourceUnit.Cpu,
		Memory: int32(num_of_unit) * reservation_group.ResourceUnit.Memory,
		Disk:   int64(num_of_unit) * reservation_group.ResourceUnit.Disk,
	}
}

repository: justicezyx/ResourceManager

repo_name: justicezyx/ResourceManager

extension: go


text:
@book{meilleuressoupes,
      title     = "Les Meilleures Soupes",
      author    = "Combier, Nathalie",
      year      = 2009,
      publisher = "édition Minerva",
      address   = "Gen\`eve, Suisse"
    }

@book{pellaprat,
      title     = "L’Art Culinaire Moderne",
      author    = "Pellaprat, Henri-Paul",
      year      = 1960,
      publisher = "Jacques Kramer",
      address   = "Lugano, Suisse"
    }

@book{vivelepoisson,
      title     = "Vive le Poisson!.",
      author    = "Beauvais, Nathalie",
      year      = 2014,
      publisher = "Trop Mad!",
    }

@book{patisseriepourtous,
      title     = "La patisserie pour tous",
      author    = "Mathiot, Ginette",
      year      = 1973,
      publisher = "Albin Michel",
      address   = "Paris, France"
    }

@book{macuisinedelamer,
      title     = "Ma cuisine de la mer",
      author    = "Guilloux, Guy",
      year      = 2015,
      publisher = "Dialogue",
    }

@book{XX,
      title     = "XX",
      author    = "XX",
      year      = 1970,
      publisher = "XX",
    }

@book{lenotre,
      title     = "Ecole Len\^otre - La Patisserie - Grand Classiques et
        Cr\'eations",
      author    = "Len\^otre, Gaston",
      year      = 2006,
      publisher = "Jerome Vilette",
    }

@book{savoureuseBreizh,
      title     = "Savoureuse BRETAGNE",
      author    = "Charlon, Raymonde",
      year      = 1993,
      publisher = "Ouest France",
      address   = "Rennes, France"
    }

@misc{roellinger,
  author    = "Roellinger, Olivier",
  title = "Ormeaux de plongée à la cancalaise",
  howpublished = "\url{www.roellinger-bricourt.com}",
  urldate = {2021-08-30}
}


text:
@inproceedings {type-your-key-here,
  author = "Sergio Soares and Eduardo Laureano and Paulo Borba",
  booktitle = "17th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA 2002)",
  title = "Implementing distribution and persistence aspects with aspectJ",
  year = "2002",
  pages = "174-190"
}

repository: pauloborba/academic-kickstart

repo_name: pauloborba/academic-kickstart

gha_license_id: MIT


text:
# Module for locating OpenCL.
#
# Customizable variables:
#   OPENCL_ROOT_DIR
#     Specifies OpenCL's root directory. The find module uses this variable to
#     locate OpenCL. The variable will be filled automatically unless explicitly
#     set using CMake's -D command-line option. Instead of setting a CMake
#     variable, an environment variable called OCLROOT can be used.
#     While locating the root directory, the module will try to detect OpenCL
#     implementations provided by AMD's Accelerated Parallel Processing SDK,
#     NVIDIA's GPU Computing Toolkit and Intel's OpenCL SDK by examining the
#     AMDAPPSDKROOT, CUDA_PATH and INTELOCLSDKROOT environment variables,
#     respectively.
#
# Read-only variables:
#   OPENCL_FOUND
#     Indicates whether OpenCL has been found.
#
#   OPENCL_INCLUDE_DIRS
#     Specifies the OpenCL include directories.
#
#   OPENCL_LIBRARIES
#     Specifies the OpenCL libraries that should be passed to
#     target_link_libararies.
#
#
# Copyright (c) 2011 Sergiu Dotenco
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTOPENCLLAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

INCLUDE (FindPackageHandleStandardArgs)

IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
  SET (_OPENCL_POSSIBLE_LIB_SUFFIXES lib/Win64 lib/x86_64 lib/x64)
ELSE (CMAKE_SIZEOF_VOID_P EQUAL 8)
  SET (_OPENCL_POSSIBLE_LIB_SUFFIXES lib/Win32 lib/x86)
ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 8)

LIST (APPEND _OPENCL_POSSIBLE_LIB_SUFFIXES lib/nvidia-current)

FIND_PATH (OPENCL_ROOT_DIR
  NAMES OpenCL/cl.h
        include/CL/cl.h
        include/nvidia-current/CL/cl.h
  PATHS ENV OCLROOT
        ENV AMDAPPSDKROOT
        ENV CUDA_PATH
        ENV INTELOCLSDKROOT
  PATH_SUFFIXES cuda
  DOC "OpenCL root directory")

FIND_PATH (OPENCL_INCLUDE_DIR
  NAMES OpenCL/cl.h CL/cl.h
  HINTS ${OPENCL_ROOT_DIR}
  PATH_SUFFIXES include include/nvidia-current
  DOC "OpenCL include directory")

FIND_LIBRARY (OPENCL_LIBRARY
  NAMES OpenCL
  HINTS ${OPENCL_ROOT_DIR}
  PATH_SUFFIXES ${_OPENCL_POSSIBLE_LIB_SUFFIXES})

SET (OPENCL_INCLUDE_DIRS ${OPENCL_INCLUDE_DIR})
SET (OPENCL_LIBRARIES ${OPENCL_LIBRARY})

IF (OPENCL_INCLUDE_DIR AND OPENCL_LIBRARY)
  SET (_OPENCL_VERSION_TEST_SOURCE
"
#if __APPLE__
#include <OpenCL/cl.h>
#else /* !__APPLE__ */
#include <CL/cl.h>
#endif /* __APPLE__ */

#include <stdio.h>
#include <stdlib.h>

int main()
{
    char *version;
    cl_int result;
    cl_platform_id id;
    size_t n;

    result = clGetPlatformIDs(1, &id, NULL);

    if (result == CL_SUCCESS) {
        result = clGetPlatformInfo(id, CL_PLATFORM_VERSION, 0, NULL, &n);

        if (result == CL_SUCCESS) {
            version = (char*)malloc(n * sizeof(char));

            result = clGetPlatformInfo(id, CL_PLATFORM_VERSION, n, version,
                NULL);

            if (result == CL_SUCCESS) {
                printf(\"%s\", version);
                fflush(stdout);
            }

            free(version);
        }
    }

    return result == CL_SUCCESS ? EXIT_SUCCESS : EXIT_FAILURE;
}
")

  SET (_OPENCL_VERSION_SOURCE
    "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/openclversion.c")

  FILE (WRITE ${_OPENCL_VERSION_SOURCE} "${_OPENCL_VERSION_TEST_SOURCE}\n")

  TRY_RUN (_OPENCL_VERSION_RUN_RESULT _OPENCL_VERSION_COMPILE_RESULT
    ${CMAKE_BINARY_DIR} ${_OPENCL_VERSION_SOURCE}
    RUN_OUTPUT_VARIABLE _OPENCL_VERSION_STRING
    CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${OPENCL_INCLUDE_DIRS}"
                "-DLINK_LIBRARIES:STRING=${OPENCL_LIBRARIES}")

  IF (_OPENCL_VERSION_RUN_RESULT EQUAL 0)
    STRING (REGEX REPLACE "OpenCL[ \t]+([0-9]+)\\.[0-9]+.*" "\\1"
      OPENCL_VERSION_MAJOR "${_OPENCL_VERSION_STRING}")
    STRING (REGEX REPLACE "OpenCL[ \t]+[0-9]+\\.([0-9]+).*" "\\1"
      OPENCL_VERSION_MINOR "${_OPENCL_VERSION_STRING}")

    SET (OPENCL_VERSION_COMPONENTS 2)
    SET (OPENCL_VERSION "${OPENCL_VERSION_MAJOR}.${OPENCL_VERSION_MINOR}")
  ENDIF (_OPENCL_VERSION_RUN_RESULT EQUAL 0)

  IF ("${OPENCL_VERSION}" STREQUAL "")
    MESSAGE (WARNING "Cannot determine OpenCL's version")
  ENDIF ("${OPENCL_VERSION}" STREQUAL "")
ENDIF (OPENCL_INCLUDE_DIR AND OPENCL_LIBRARY)

MARK_AS_ADVANCED (OPENCL_ROOT_DIR OPENCL_INCLUDE_DIR OPENCL_LIBRARY)

FIND_PACKAGE_HANDLE_STANDARD_ARGS (OpenCL REQUIRED_VARS OPENCL_ROOT_DIR
  OPENCL_INCLUDE_DIR OPENCL_LIBRARY VERSION_VAR OPENCL_VERSION)

repository: biometrics/openbr

repo_name: biometrics/openbr


text:
SUMMARY = "Library that parses the file format of AbiWord documents"
HOMEPAGE = "https://wiki.documentfoundation.org/DLP/Libraries/libabw"
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = " \
    file://COPYING.MPL;md5=815ca599c9df247a0c7f619bab123dad \
"

SRC_URI = "http://dev-www.libreoffice.org/src/${BPN}/${BPN}-${PV}.tar.xz"
SRC_URI[md5sum] = "6be55a46078b593ec20cad9bb8730c3e"
SRC_URI[sha256sum] = "cfc698c2dd4ab592138a941ae26e2e18c3dac69bc196b5167df7f5eb88fc217e"

inherit autotools pkgconfig

DEPENDS = "libxml2 librevenge"

BBCLASSEXTEND = "native"

repository: OSSystems/meta-office

repo_name: OSSystems/meta-office


text:
package template

import (
	"fgame/fgame/core/template"
	"fgame/fgame/core/template/validator"
	"fgame/fgame/core/utils"
	playertypes "fgame/fgame/game/player/types"

	"fmt"
)

//首冲配置
type FirstChargeTemplate struct {
	*FirstChargeTemplateVO
	role       playertypes.RoleType
	sex        playertypes.SexType
	rewItemMap map[int32]int32
}

func (t *FirstChargeTemplate) TemplateId() int {
	return t.Id
}

func (t *FirstChargeTemplate) GetSex() playertypes.SexType {
	return t.sex
}

func (t *FirstChargeTemplate) GetRole() playertypes.RoleType {
	return t.role
}

func (t *FirstChargeTemplate) GetRewItemMap() map[int32]int32 {
	return t.rewItemMap
}

func (t *FirstChargeTemplate) Patch() (err error) {
	defer func() {
		if err != nil {
			err = template.NewTemplateError(t.FileName(), t.TemplateId(), err)
			return
		}
	}()

	t.rewItemMap = make(map[int32]int32)
	//验证 rew_item_id
	rewItemIdList, err := utils.SplitAsIntArray(t.RewItemId)
	if err != nil {
		err = fmt.Errorf("[%s] invalid", t.RewItemId)
		return template.NewTemplateFieldError("RewItemId", err)
	}
	rewItemCountList, err := utils.SplitAsIntArray(t.RewItemCount)
	if err != nil {
		err = fmt.Errorf("[%s] invalid", t.RewItemCount)
		return template.NewTemplateFieldError("RewItemCount", err)
	}
	if len(rewItemCountList) != len(rewItemCountList) {
		err = fmt.Errorf("[%s][%s] invalid", t.RewItemId, t.RewItemCount)
		err = template.NewTemplateFieldError("RewItemId or RewItemCount", err)
		return err
	}
	if len(rewItemIdList) > 0 {
		//组合数据
		for index, itemId := range rewItemIdList {
			itemTmpObj := template.GetTemplateService().Get(int(itemId), (*ItemTemplate)(nil))
			if itemTmpObj == nil {
				err = fmt.Errorf("[%s] invalid", t.RewItemId)
				return template.NewTemplateFieldError("RewItemId", err)
			}

			err = validator.MinValidate(float64(rewItemCountList[index]), float64(1), true)
			if err != nil {
				return template.NewTemplateFieldError("RewItemCount", err)
			}

			t.rewItemMap[itemId] = rewItemCountList[index]
		}
	}

	return nil
}

func (t *FirstChargeTemplate) Check() (err error) {
	defer func() {
		if err != nil {
			err = template.NewTemplateError(t.FileName(), t.TemplateId(), err)
			return
		}
	}()

	//角色
	role := playertypes.RoleType(t.Profession)
	if !role.Valid() {
		err = fmt.Errorf("[%d] invalid", t.Profession)
		return template.NewTemplateFieldError("Profession", err)
	}
	t.role = role

	//性别
	sex := playertypes.SexType(t.Gender)
	if !sex.Valid() {
		err = fmt.Errorf("[%d] invalid", t.Gender)
		return template.NewTemplateFieldError("Gender", err)
	}
	t.sex = sex

	//验证 rew_silver
	err = validator.MinValidate(float64(t.RewSilver), float64(0), true)
	if err != nil {
		err = fmt.Errorf("[%d] invalid", t.RewSilver)
		err = template.NewTemplateFieldError("RewSilver", err)
		return
	}

	//验证 rew_gold
	err = validator.MinValidate(float64(t.RewGold), float64(0), true)
	if err != nil {
		err = fmt.Errorf("[%d] invalid", t.RewGold)
		err = template.NewTemplateFieldError("RewGold", err)
		return
	}

	//验证 rew_bind_gold
	err = validator.MinValidate(float64(t.RewGoldBind), float64(0), true)
	if err != nil {
		err = fmt.Errorf("[%d] invalid", t.RewGoldBind)
		err = template.NewTemplateFieldError("RewGoldBind", err)
		return
	}

	return nil
}
func (t *FirstChargeTemplate) PatchAfterCheck() {

}
func (t *FirstChargeTemplate) FileName() string {
	return "tb_firstcharge.json"
}

func init() {
	template.Register((*FirstChargeTemplate)(nil))
}

repository: rebider/Fgame

repo_name: rebider/Fgame


text:
@article{tibshirani_model_1999,
	title = {Model Search by Bootstrap "Bumping"},
	volume = {8},
	issn = {1061-8600},
	url = {http://www.jstor.org/stable/1390820},
	doi = {10.2307/1390820},
	abstract = {Abstract: "We propose a bootstrap-based method for enhancing a search through a space of models. The technique is well suited to complex, adaptively fitted models--it provides a convenient method for finding better local minima and for resistant fitting. Applications to regression, classification, and density estimation are described. We also provide results on the asymptotic behavior of bumping estimates."},
	pages = {671--686},
	number = {4},
	journaltitle = {Journal of Computational and Graphical Statistics},
	author = {Tibshirani, Robert and Knight, Keith},
	urldate = {2011-04-07},
	date = {1999-12-01},
	note = {{ArticleType}: research-article / Full publication date: Dec., 1999 / Copyright (c) 1999 American Statistical Association, Institute of Mathematical Statistics and Interface Foundation of America}
}

repository: pmean/build-website

repo_name: pmean/build-website


text:
package bot

import (
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"net/url"
	"regexp"
	"strings"
	"time"
)

// Podcasts search bot, returns search result via site-api see https://radio-t.com/api-docs/
// GET /search?q=text-to-search&skip=10&limit=5, example: : https://radio-t.com/site-api/search?q=mongo&limit=10
type Podcasts struct {
	client     HTTPClient
	siteAPI    string
	maxResults int
}

type siteAPIResp struct {
	URL        string    `json:"url"`
	Title      string    `json:"title"`
	Date       time.Time `json:"date"`
	Categories []string  `json:"categories"`
	Image      string    `json:"image,omitempty"`
	FileName   string    `json:"file_name,omitempty"`
	ShowNotes  string    `json:"show_notes,omitempty"`
	Body       string    `json:"body"`
	ShowNum    int       `json:"show_num,omitempty"`
}

// NewPodcasts makes new Podcasts bot
func NewPodcasts(client HTTPClient, api string, maxResults int) *Podcasts {
	log.Printf("[INFO] podcasts bot with api %s", api)
	return &Podcasts{client: client, siteAPI: api, maxResults: maxResults}
}

// Help returns help message
func (p *Podcasts) Help() string {
	return GenHelpMsg(p.ReactOn(), "искать в описаниях подкастов, например: search! lambda")
}

// OnMessage returns result of search via https://radio-t.com/site-api/search?
func (p *Podcasts) OnMessage(msg Message) (response Response) {

	defer func() { // to catch possible panics from potentially dangerous makeBotResponse
		if r := recover(); r != nil {
			response.Text = ""
			response.Send = false
		}
	}()

	ok, reqText := p.request(msg.Text)
	if !ok {
		return Response{}
	}

	reqURL := fmt.Sprintf("%s/search?limit=%d&q=%s", p.siteAPI, p.maxResults, url.QueryEscape(reqText))
	req, err := http.NewRequest("GET", reqURL, http.NoBody)
	if err != nil {
		log.Printf("[WARN] failed to make request %s, error=%v", reqURL, err)
		return Response{}
	}

	resp, err := p.client.Do(req)
	if err != nil {
		log.Printf("[WARN] failed to send request %s, error=%v", reqURL, err)
		return Response{}
	}
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		log.Printf("[WARN] request %s returned %s", reqURL, resp.Status)
		return Response{}
	}

	sr := []siteAPIResp{}
	if err := json.NewDecoder(resp.Body).Decode(&sr); err != nil {
		log.Printf("[WARN] failed to parse response from %s, error=%v", reqURL, err)
		return Response{}
	}
	return Response{
		Text: p.makeBotResponse(sr, reqText),
		Send: true,
	}
}

func (p *Podcasts) makeBotResponse(sr []siteAPIResp, reqText string) string {

	makeRepLine := func(nl noteWithLink) string {
		if nl.link != "" {
			return fmt.Sprintf("[%s](%s)", nl.text, nl.link)
		}
		return nl.text
	}

	if len(sr) == 0 {
		return fmt.Sprintf("ничего не нашел на запрос %q", reqText)
	}

	var res string
	for _, s := range sr {
		nls := p.notesWithLinks(s)
		nlsStr := ""
		for _, nl := range nls {

			if strings.Contains(strings.ToLower(nl.text), strings.ToLower(reqText)) {
				nlsStr += "●  " + makeRepLine(nl) + "\n"
				continue
			}

			if strings.Contains(strings.ToLower(nl.link), strings.ToLower(reqText)) {
				nlsStr += "○  " + makeRepLine(nl) + "\n"
				continue
			}
		}

		if nlsStr != "" {
			res += fmt.Sprintf("[Радио-Т #%d](%s) _%s_\n", s.ShowNum, s.URL, s.Date.Format("02 Jan 06"))
			res += nlsStr
			res += "\n"
		}
	}
	return res
}

type noteWithLink struct {
	text string
	link string
}

// linRe is a matching regex for links from href
var linkRe = regexp.MustCompile(`<a\s+(?:[^>]*?\s+)?href="([^"]*)"`)

// notesWithLinks gets notes and matching links from body
func (p *Podcasts) notesWithLinks(s siteAPIResp) (res []noteWithLink) {

	// show notes may start with multiple \n, strip them all
	showNotes := s.ShowNotes
	for i := 0; i < 10; i++ {
		showNotes = strings.TrimPrefix(showNotes, "\n")
	}

	notes := strings.Split(showNotes, "\n")
	links := strings.Split(s.Body, "<li>")[1:] // we don't care what the 0 element was, links starts with <li>
	for i, note := range notes {
		if strings.Contains(note, " лог чата") || strings.Contains(note, "Темы наших слушателей") {
			break
		}
		nl := noteWithLink{text: note}
		if i < len(links) {
			ll := linkRe.FindStringSubmatch(links[i])
			if len(ll) >= 2 {
				nl.link = ll[1]
			}
		}
		res = append(res, nl)
	}
	return res
}

func (p *Podcasts) request(text string) (react bool, reqText string) {

	for _, prefix := range p.ReactOn() {
		if strings.HasPrefix(text, prefix) {
			return true, strings.Replace(strings.TrimSpace(strings.TrimPrefix(text, prefix)), " ", "+", -1)
		}
	}
	return false, ""
}

// ReactOn keys
func (p *Podcasts) ReactOn() []string {
	return []string{"search!", "подкаст!"}
}

repository: radio-t/super-bot

repo_name: radio-t/super-bot

gha_language: Go


text:
package request

import (
	"net/http"
	"net/http/httputil"
	"fmt"
)

func DisplayRequest(r *http.Request) {
	re, err := httputil.DumpRequest(r, true); if err == nil {
		fmt.Println(string(re))
	}
}

func DisplayResponse(resp *http.Response) {
	re, err := httputil.DumpResponse(resp, true); if err == nil {
		fmt.Println(string(re))
	}
}

repository: amstee/easy-cut

repo_name: amstee/easy-cut


text:
@article{amenta_newspaper_2005,
 author = {Amenta, Edwin and Caren, Neal and Olasky, Sheera Joy},
 doi = {10.1525/ctx.2005.4.3.48},
 journal = {contexts},
 number = {3},
 pages = {48--49},
 title = {newspaper coverage of social movement organizations in the 20th century},
 volume = {4},
 year = {2005}
}

repository: nealcaren/academic-kickstart

repo_name: nealcaren/academic-kickstart


text:
/*
Copyright 2020 KubeSphere Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package monitoring

import (
	"fmt"
	"strings"
	"time"
)

type Level int

const (
	LevelCluster = 1 << iota
	LevelNode
	LevelWorkspace
	LevelNamespace
	LevelApplication
	LevelOpenpitrix
	LevelWorkload
	LevelService
	LevelPod
	LevelContainer
	LevelPVC
	LevelComponent
	LevelIngress
)

var MeteringLevelMap = map[string]int{
	"LevelCluster":     LevelCluster,
	"LevelNode":        LevelNode,
	"LevelWorkspace":   LevelWorkspace,
	"LevelNamespace":   LevelNamespace,
	"LevelApplication": LevelApplication,
	"LevelWorkload":    LevelWorkload,
	"LevelService":     LevelService,
	"LevelPod":         LevelPod,
	"LevelContainer":   LevelContainer,
	"LevelPVC":         LevelPVC,
	"LevelComponent":   LevelComponent,
}

type QueryOption interface {
	Apply(*QueryOptions)
}

type Meteroptions struct {
	Start time.Time
	End   time.Time
	Step  time.Duration
}

type QueryOptions struct {
	Level Level

	NamespacedResourcesFilter string
	QueryType                 string
	ResourceFilter            string
	NodeName                  string
	WorkspaceName             string
	NamespaceName             string
	WorkloadKind              string
	WorkloadName              string
	PodName                   string
	ContainerName             string
	StorageClassName          string
	PersistentVolumeClaimName string
	PVCFilter                 string
	ApplicationName           string
	ServiceName               string
	Ingress                   string
	Job                       string
	Duration                  *time.Duration
	MeterOptions              *Meteroptions
}

func NewQueryOptions() *QueryOptions {
	return &QueryOptions{}
}

type ClusterOption struct{}

func (_ ClusterOption) Apply(o *QueryOptions) {
	o.Level = LevelCluster
}

type NodeOption struct {
	ResourceFilter   string
	NodeName         string
	PVCFilter        string
	StorageClassName string
	QueryType        string
}

func (no NodeOption) Apply(o *QueryOptions) {
	o.Level = LevelNode
	o.ResourceFilter = no.ResourceFilter
	o.NodeName = no.NodeName
	o.PVCFilter = no.PVCFilter
	o.StorageClassName = no.StorageClassName
	o.QueryType = no.QueryType
}

type WorkspaceOption struct {
	ResourceFilter   string
	WorkspaceName    string
	PVCFilter        string
	StorageClassName string
}

func (wo WorkspaceOption) Apply(o *QueryOptions) {
	o.Level = LevelWorkspace
	o.ResourceFilter = wo.ResourceFilter
	o.WorkspaceName = wo.WorkspaceName
	o.PVCFilter = wo.PVCFilter
	o.StorageClassName = wo.StorageClassName
}

type NamespaceOption struct {
	ResourceFilter   string
	WorkspaceName    string
	NamespaceName    string
	PVCFilter        string
	StorageClassName string
}

func (no NamespaceOption) Apply(o *QueryOptions) {
	o.Level = LevelNamespace
	o.ResourceFilter = no.ResourceFilter
	o.WorkspaceName = no.WorkspaceName
	o.NamespaceName = no.NamespaceName
	o.PVCFilter = no.PVCFilter
	o.StorageClassName = no.StorageClassName
}

type ApplicationsOption struct {
	NamespaceName    string
	Applications     []string
	StorageClassName string
}

func (aso ApplicationsOption) Apply(o *QueryOptions) {
	// nothing should be done
	//nolint:gosimple
	return
}

type OpenpitrixsOption struct {
	Cluster          string
	NamespaceName    string
	Openpitrixs      []string
	StorageClassName string
}

func (oso OpenpitrixsOption) Apply(o *QueryOptions) {
	// nothing should be done
	//nolint:gosimple
	return
}

// ApplicationsOption & OpenpitrixsOption share the same ApplicationOption struct
type ApplicationOption struct {
	NamespaceName         string
	Application           string
	ApplicationComponents []string
	StorageClassName      string
}

func (ao ApplicationOption) Apply(o *QueryOptions) {
	o.Level = LevelApplication
	o.NamespaceName = ao.NamespaceName
	o.ApplicationName = ao.Application
	o.StorageClassName = ao.StorageClassName

	app_components := strings.Join(ao.ApplicationComponents[:], "|")

	if len(app_components) > 0 {
		o.ResourceFilter = fmt.Sprintf(`namespace="%s", workload=~"%s"`, o.NamespaceName, app_components)
	} else {
		o.ResourceFilter = fmt.Sprintf(`namespace="%s", workload=~"%s"`, o.NamespaceName, ".*")
	}
}

type WorkloadOption struct {
	ResourceFilter string
	NamespaceName  string
	WorkloadKind   string
}

func (wo WorkloadOption) Apply(o *QueryOptions) {
	o.Level = LevelWorkload
	o.ResourceFilter = wo.ResourceFilter
	o.NamespaceName = wo.NamespaceName
	o.WorkloadKind = wo.WorkloadKind
}

type ServicesOption struct {
	NamespaceName string
	Services      []string
}

func (sso ServicesOption) Apply(o *QueryOptions) {
	// nothing should be done
	//nolint:gosimple
	return
}

type ServiceOption struct {
	ResourceFilter string
	NamespaceName  string
	ServiceName    string
	PodNames       []string
}

func (so ServiceOption) Apply(o *QueryOptions) {
	o.Level = LevelService
	o.NamespaceName = so.NamespaceName
	o.ServiceName = so.ServiceName

	pod_names := strings.Join(so.PodNames, "|")

	if len(pod_names) > 0 {
		o.ResourceFilter = fmt.Sprintf(`pod=~"%s", namespace="%s"`, pod_names, o.NamespaceName)
	} else {
		o.ResourceFilter = fmt.Sprintf(`pod=~"%s", namespace="%s"`, ".*", o.NamespaceName)
	}
}

type PodOption struct {
	NamespacedResourcesFilter string
	ResourceFilter            string
	NodeName                  string
	NamespaceName             string
	WorkloadKind              string
	WorkloadName              string
	PodName                   string
}

func (po PodOption) Apply(o *QueryOptions) {
	o.Level = LevelPod
	o.NamespacedResourcesFilter = po.NamespacedResourcesFilter
	o.ResourceFilter = po.ResourceFilter
	o.NodeName = po.NodeName
	o.NamespaceName = po.NamespaceName
	o.WorkloadKind = po.WorkloadKind
	o.WorkloadName = po.WorkloadName
	o.PodName = po.PodName
}

type ContainerOption struct {
	ResourceFilter string
	NamespaceName  string
	PodName        string
	ContainerName  string
}

func (co ContainerOption) Apply(o *QueryOptions) {
	o.Level = LevelContainer
	o.ResourceFilter = co.ResourceFilter
	o.NamespaceName = co.NamespaceName
	o.PodName = co.PodName
	o.ContainerName = co.ContainerName
}

type PVCOption struct {
	ResourceFilter            string
	NamespaceName             string
	StorageClassName          string
	PersistentVolumeClaimName string
}

func (po PVCOption) Apply(o *QueryOptions) {
	o.Level = LevelPVC
	o.ResourceFilter = po.ResourceFilter
	o.NamespaceName = po.NamespaceName
	o.StorageClassName = po.StorageClassName
	o.PersistentVolumeClaimName = po.PersistentVolumeClaimName

	// for meter
	o.PVCFilter = po.PersistentVolumeClaimName
}

type IngressOption struct {
	ResourceFilter string
	NamespaceName  string
	Ingress        string
	Job            string
	Pod            string
	Duration       *time.Duration
}

func (no IngressOption) Apply(o *QueryOptions) {
	o.Level = LevelIngress
	o.ResourceFilter = no.ResourceFilter
	o.NamespaceName = no.NamespaceName
	o.Ingress = no.Ingress
	o.Job = no.Job
	o.PodName = no.Pod
	o.Duration = no.Duration
}

type ComponentOption struct{}

func (_ ComponentOption) Apply(o *QueryOptions) {
	o.Level = LevelComponent
}

type MeterOption struct {
	Start time.Time
	End   time.Time
	Step  time.Duration
}

func (mo MeterOption) Apply(o *QueryOptions) {
	o.MeterOptions = &Meteroptions{
		Start: mo.Start,
		End:   mo.End,
		Step:  mo.Step,
	}
}

repository: kubesphere/kubesphere

repo_name: kubesphere/kubesphere


text:
DESCRIPTION = "Cute Files recipe from scratch"
HOMEPAGE = "http://nodered.org"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=71d98c0a1db42956787b1909c74a86ca"

inherit npm

PR = "r0"

SRC_URI = "\
    npm://registry.npmjs.org;package=cute-files;version=1.0.2 \
    npmsw://${THISDIR}/files/npm-shrinkwrap.json \
"

S = "${WORKDIR}/npm"

branch_name: refs/heads/main


text:
DESCRIPTION = "C-based metadata parser to quickly parse xml metadata into sqlite databases."
HOMEPAGE = "http://linux.duke.edu/projects/yum/download.ptml"
SECTION = "devel/python"
PRIORITY = "optional"
DEPENDS = "python sqlite3 glib-2.0 libxml2"
LICENSE = "GPL"

SRC_URI = "http://linux.duke.edu/projects/yum/download/yum-metadata-parser/yum-metadata-parser-${PV}.tar.gz"
S = "${WORKDIR}/yum-metadata-parser-${PV}"

TARGET_CFLAGS += "-I${STAGING_LIBDIR}/glib-2.0"

inherit distutils

SRC_URI[md5sum] = "13df226ef004ea78eebc59022720b536"
SRC_URI[sha256sum] = "48b87110c3c46ad04209b358fded534eca3bfdc91b396d2549390dd51048be9f"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
package main

import (
	"fmt"
)

type tile struct {
	x       int
	y       int
	visited bool
	name    string
}

var allTiles []tile
var edges map[*tile][]*tile

/*Part1 runs the code for part 1 of this puzzle*/
func Part1(fname string) {
	allTiles = make([]tile, 0)
	edges = make(map[*tile][]*tile)

	maze := GetInput(fname)
	t := parseInput(maze)

	fmt.Println("Parsed maze! ", t)

	depth := bfs(t)
	fmt.Println("[Part 1] The maze exit can be reached in", depth, "steps")
}

func bfs(t *tile) int {

	depth := 0
	queue := make([]*tile, 1)
	queue[0] = t
	nextLayer := make([]*tile, 0)

	for len(queue) > 0 {
		currentTile := queue[0]

		if currentTile.name == "ZZ" {
			return depth
		}

		neighbors := edges[currentTile]
		for _, neighbor := range neighbors {
			if !neighbor.visited {
				nextLayer = append(nextLayer, neighbor)
			}
		}

		currentTile.visited = true

		if len(queue) == 1 {
			queue = nextLayer
			nextLayer = nil
			depth++
		} else {
			queue = queue[1:]
		}
	}

	panic("No exit found!")
}

func parseInput(input [][]string) *tile {

	var entrance *tile

	// first, find all the tiles
	for row := range input {
		for col := range input[row] {
			if input[row][col] == "." {
				allTiles = append(allTiles, tile{x: col, y: row})
			}
		}
	}

	for i := range allTiles {
		t := &allTiles[i]

		right := getRight(t, &input)
		left := getLeft(t, &input)
		up := getUp(t, &input)
		down := getDown(t, &input)

		// names
		if len(right) == 2 {
			t.name = right
			if right != "AA" && right != "ZZ" {
				neighbor := getNamedTile(right)
				addEdge(t, neighbor)
			}
		} else if len(left) == 2 {
			t.name = left
			if left != "AA" && left != "ZZ" {
				neighbor := getNamedTile(left)
				addEdge(t, neighbor)
			}
		} else if len(up) == 2 {
			t.name = up
			if up != "AA" && up != "ZZ" {
				neighbor := getNamedTile(up)
				addEdge(t, neighbor)
			}
		} else if len(down) == 2 {
			t.name = down
			if down != "AA" && down != "ZZ" {
				neighbor := getNamedTile(down)
				addEdge(t, neighbor)
			}
		}

		if t.name == "AA" {
			entrance = t
		}

		if right == "." {
			neighbor := getTile(t.x+1, t.y)
			addEdge(t, neighbor)
		}
		if left == "." {
			neighbor := getTile(t.x-1, t.y)
			addEdge(t, neighbor)
		}
		if up == "." {
			neighbor := getTile(t.x, t.y-1)
			addEdge(t, neighbor)
		}
		if down == "." {
			neighbor := getTile(t.x, t.y+1)
			addEdge(t, neighbor)
		}
	}

	return entrance
}

func addEdge(from *tile, to *tile) {
	if from == nil || to == nil {
		return
	}

	if edges[from] == nil {
		edges[from] = make([]*tile, 0)
	}
	if edges[to] == nil {
		edges[to] = make([]*tile, 0)
	}

	isRegistered := false
	for _, neighbor := range edges[from] {
		if neighbor == to {
			isRegistered = true
			break
		}
	}
	if !isRegistered {
		edges[from] = append(edges[from], to)
	}

	isRegistered = false
	for _, neighbor := range edges[to] {
		if neighbor == from {
			isRegistered = true
			break
		}
	}
	if !isRegistered {
		edges[to] = append(edges[to], from)

	}
}

func getTile(x int, y int) *tile {
	for i := range allTiles {
		if allTiles[i].x == x && allTiles[i].y == y {
			return &allTiles[i]
		}
	}
	panic("Tried to get pointer to nonexistent tile")
}
func getNamedTile(name string) *tile {
	for i := range allTiles {
		if allTiles[i].name == name {
			return &allTiles[i]
		}
	}
	return nil
}

func getRight(t *tile, maze *[][]string) string {
	row := (*maze)[t.y]

	if t.x >= len(row)-1 {
		// we're already at the rightmost edge
		return "#"
	}

	char := row[t.x+1]
	if char == "." || char == "#" {
		return char
	}

	// otherwise, it's a two letter symbol indicating a portal
	return char + row[t.x+2]
}
func getLeft(t *tile, maze *[][]string) string {
	row := (*maze)[t.y]

	if t.x == 0 {
		// we're already at the leftmost edge
		return "#"
	}

	char := row[t.x-1]
	if char == "." || char == "#" {
		return char
	}

	// otherwise, it's a two letter symbol indicating a portal
	return row[t.x-2] + char
}
func getUp(t *tile, maze *[][]string) string {
	if t.y == 0 {
		return "#"
	}

	char := (*maze)[t.y-1][t.x]
	if char == "." || char == "#" {
		return char
	}

	// otherwise, it's a two letter symbol indicating a portal
	return (*maze)[t.y-2][t.x] + char
}
func getDown(t *tile, maze *[][]string) string {
	if t.y >= len(*maze)-1 {
		return "#"
	}

	char := (*maze)[t.y+1][t.x]
	if char == "." || char == "#" {
		return char
	}

	// otherwise, it's a two letter symbol indicating a portal
	return char + (*maze)[t.y+2][t.x]
}


text:
SUMMARY = "BeeKeeper User settings"
DESCRIPTION = "BeeKeeper User settings"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

SRC_URI = " \
            file://README \
            file://dot.profile \
"

S = "${WORKDIR}"

EXCLUDE_FROM_WORLD = "1"

inherit useradd

USERADD_PACKAGES = "${PN}"

USERADD_PARAM_${PN} = "-u 1008 -d /home/beekeeper -r -s /bin/bash -P 'pollen2honey' -g iota beekeeper"

GROUPADD_PARAM_${PN} = "-g 1008 iota"
GROUPADD_PARAP_${PN} = "-g 986 wheel"

do_install () {
	install -d -m 755 ${D}${datadir}/beekeeper

        install -d -m 755 ${D}/home/beekeeper
	install -p -m 644 README ${D}/home/beekeeper
        install -p -m 644 dot.profile ${D}/home/beekeeper/.profile

	chown -R beekeeper ${D}${datadir}/beekeeper
	chown -R beekeeper ${D}/home/beekeeper

	chgrp -R iota ${D}${datadir}/beekeeper
	chgrp -R iota ${D}/home/beekeeper
}

FILES_${PN} = "${exec_prefix}/* /home/*"

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"

pkg_postinst_ontarget_${PN}(){

    # add beekeeper to sudo group
    usermod -aG sudo beekeeper
    usermod -aG wheel beekeeper

    # set password expiry to 0
    chage -d 0 root
    chage -d 0 beekeeper
}