text:
// Copyright 2019 Tobias Guggenmos
// 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 langserver

import (
	"context"
	"os"

	"github.com/slrtbtfs/go-tools-vendored/jsonrpc2"
	"github.com/slrtbtfs/go-tools-vendored/lsp/protocol"
)

func (s *Server) Initialize(ctx context.Context, params *protocol.ParamInitia) (*protocol.InitializeResult, error) {
	s.stateMu.Lock()
	state := s.state
	s.stateMu.Unlock()
	if state >= serverInitializing {
		return nil, jsonrpc2.NewErrorf(jsonrpc2.CodeInvalidRequest, "server already initialized")
	}
	s.stateMu.Lock()
	s.state = serverInitializing
	s.stateMu.Unlock()

	s.cache.init()

	return &protocol.InitializeResult{
		Capabilities: protocol.ServerCapabilities{
			TextDocumentSync: &protocol.TextDocumentSyncOptions{
				OpenClose: true,
				// Support incremental changes
				Change: 2,
			},
			HoverProvider:                    true,
			CompletionProvider:               nil,
			SignatureHelpProvider:            nil,
			DefinitionProvider:               false,
			ReferencesProvider:               false,
			DocumentHighlightProvider:        false,
			DocumentSymbolProvider:           false,
			CodeActionProvider:               nil,
			WorkspaceSymbolProvider:          false,
			CodeLensProvider:                 nil,
			DocumentFormattingProvider:       false,
			DocumentRangeFormattingProvider:  false,
			DocumentOnTypeFormattingProvider: nil,
			RenameProvider:                   nil,
			DocumentLinkProvider:             nil,
			ExecuteCommandProvider:           nil,
			Experimental:                     nil,
			ImplementationProvider:           false,
			TypeDefinitionProvider:           false,
			Workspace: &struct {
				WorkspaceFolders *struct {
					Supported           bool   "json:\"supported,omitempty\""
					ChangeNotifications string "json:\"changeNotifications,omitempty\""
				} "json:\"workspaceFolders,omitempty\""
			}{
				WorkspaceFolders: &struct {
					Supported           bool   "json:\"supported,omitempty\""
					ChangeNotifications string "json:\"changeNotifications,omitempty\""
				}{
					Supported:           false,
					ChangeNotifications: "",
				},
			},
			ColorProvider:          false,
			FoldingRangeProvider:   false,
			DeclarationProvider:    false,
			SelectionRangeProvider: false,
		},
	}, nil

}

func (s *Server) Initialized(ctx context.Context, params *protocol.InitializedParams) error {
	s.stateMu.Lock()
	s.state = serverInitialized
	s.stateMu.Unlock()

	return nil
}

func (s *Server) Shutdown(ctx context.Context) error {
	s.stateMu.Lock()
	defer s.stateMu.Unlock()
	if s.state < serverInitialized {
		return jsonrpc2.NewErrorf(jsonrpc2.CodeInvalidRequest, "server not initialized")
	}

	s.state = serverShutDown
	return nil
}
func (s *Server) Exit(ctx context.Context) error {
	s.stateMu.Lock()
	defer s.stateMu.Unlock()
	if s.state != serverShutDown {
		os.Exit(1)
	}
	os.Exit(0)
	return nil
}

repository: squat/promql-lsp

repo_name: squat/promql-lsp

gha_license_id: NOASSERTION


text:
package stringsy

import "unicode"

func TitleCasing(s string, runeCaser func(rune) rune) string {
	if len(s) == 0 {
		return s
	}

	r := rune(s[0])
	if !unicode.IsUpper(r) && !unicode.IsLower(r) {
		return s
	}
	return string(runeCaser(r)) + s[1:]
}

repository: micvbang/go-helpy

license_type: permissive

repo_name: micvbang/go-helpy

branch_name: refs/heads/master

gha_language: Go

extension: go


text:
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
  "CXX"
  )
# The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_CXX
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/AlignOfTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/AlignOfTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/AllocatorTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/AllocatorTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/ArrayRecyclerTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/ArrayRecyclerTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/BlockFrequencyTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/BlockFrequencyTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/Casting.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/Casting.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/CommandLineTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/CommandLineTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/CompressionTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/CompressionTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/ConstantRangeTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/ConstantRangeTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/DataExtractorTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/DataExtractorTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/EndianTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/EndianTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/ErrorOrTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/ErrorOrTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/FileOutputBufferTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/FileOutputBufferTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/IntegersSubsetTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/IntegersSubsetTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/LeakDetectorTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/LeakDetectorTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/ManagedStatic.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/ManagedStatic.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/MathExtrasTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/MathExtrasTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/MemoryBufferTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/MemoryBufferTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/MemoryTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/MemoryTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/Path.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/Path.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/ProcessTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/ProcessTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/ProgramTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/ProgramTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/RegexTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/RegexTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/SwapByteOrderTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/SwapByteOrderTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/TimeValue.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/TimeValue.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/ValueHandleTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/ValueHandleTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/YAMLIOTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/YAMLIOTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/YAMLParserTest.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/YAMLParserTest.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/formatted_raw_ostream_test.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/formatted_raw_ostream_test.cpp.o"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/unittests/Support/raw_ostream_test.cpp" "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/unittests/Support/CMakeFiles/SupportTests.dir/raw_ostream_test.cpp.o"
  )
set(CMAKE_CXX_COMPILER_ID "GNU")

# Preprocessor definitions for this target.
set(CMAKE_TARGET_DEFINITIONS_CXX
  "GTEST_HAS_RTTI=0"
  "_DEBUG"
  "_GNU_SOURCE"
  "__STDC_CONSTANT_MACROS"
  "__STDC_FORMAT_MACROS"
  "__STDC_LIMIT_MACROS"
  )

# The include file search paths:
set(CMAKE_CXX_TARGET_INCLUDE_PATH
  "unittests/Support"
  "../unittests/Support"
  "include"
  "../include"
  "../utils/unittest/googletest/include"
  )

# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/lib/IR/CMakeFiles/LLVMCore.dir/DependInfo.cmake"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/lib/Support/CMakeFiles/LLVMSupport.dir/DependInfo.cmake"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/utils/unittest/CMakeFiles/gtest.dir/DependInfo.cmake"
  "/home/ccy/Desktop/experiment/compile/lab1/sever/llvm-3.3/cmake-build-debug/utils/unittest/CMakeFiles/gtest_main.dir/DependInfo.cmake"
  )

# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

license: NCSA

repository: canyuchen/Hacking-on-LLVM

repo_name: canyuchen/Hacking-on-LLVM

extension: cmake


text:
@article{GomezBarrero-morphingTheoreticalEval-IETBiometrics-2018,
 author = {M. Gomez-Barrero and C. Rathgeb and U. Scherhag and C. Busch},
 journal = {IET Biometrics},
 month = {July},
 number = {4},
 pages = {333-341},
 title = {Predicting the Vulnerability of Biometric Systems to Attacks based on Morphed Biometric Information},
 volume = {7},
 year = {2018}
}

license: MIT

repository: mgbarrero/academic-kickstart

repo_name: mgbarrero/academic-kickstart

extension: bib


text:
SUMMARY     = "eCMD plugin with pdbg backend"
DESCRIPTION = "The glue code necessary for pdbg to be used as an eCMD plugin"
PR = "r1"
PV = "1.0+git${SRCPV}"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=34400b68072d710fecd0a2940a0d1658"

inherit meson
inherit pkgconfig

SRC_URI = "git://git@github.com/open-power/ecmd-pdbg.git;branch=master;protocol=https"
SRCREV = "7a5fc053a17691a959296bc092f24153ceeeb136"

S = "${WORKDIR}/git"

DEPENDS = "pdbg zlib libyaml ipl"

FILES:${PN} += "${prefix}/help"

EXTRA_OEMESON = " \
        -Dchip=p10 \
        "

repository: openbmc/openbmc

repo_name: openbmc/openbmc

gha_language: Python

extension: bb


text:
package vsp

import (
	"context"
	"crypto/ed25519"
	"encoding/base64"
	"fmt"
	"net"
	"net/http"
	"sync"

	"github.com/hdfchain/hdfwallet/wallet"
	"github.com/hdfchain/hdfd/chaincfg/chainhash"
	"github.com/hdfchain/hdfd/chaincfg/v3"
	"github.com/hdfchain/hdfd/dcrutil/v3"
	"github.com/hdfchain/hdfd/wire"
)

const (
	apiVSPInfo = "/api/v3/vspinfo"

	serverSignature = "VSP-Server-Signature"
	requiredConfs   = 6 + 2

	protocol = "https://"
)

type PendingFee struct {
	CommitmentAddress dcrutil.Address
	VotingAddress     dcrutil.Address
	FeeAddress        dcrutil.Address
	FeeAmount         dcrutil.Amount
	FeeTx             *wire.MsgTx
}

type VSP struct {
	hostname        string
	pubKey          ed25519.PublicKey
	httpClient      *http.Client
	params          *chaincfg.Params
	c               *wallet.ConfirmationNotificationsClient
	w               *wallet.Wallet
	purchaseAccount uint32
	changeAccount   uint32

	queueMtx sync.Mutex
	queue    chan *QueueEntry

	outpointsMu sync.Mutex
	outpoints   map[chainhash.Hash]*wire.MsgTx

	ticketToFeeMu  sync.Mutex
	feeToTicketMap map[chainhash.Hash]chainhash.Hash
	ticketToFeeMap map[chainhash.Hash]PendingFee
}

type DialFunc func(ctx context.Context, network, addr string) (net.Conn, error)

func New(hostname, pubKeyStr string, purchaseAccount, changeAccount uint32, dialer DialFunc, w *wallet.Wallet, params *chaincfg.Params) (*VSP, error) {
	pubKey, err := base64.StdEncoding.DecodeString(pubKeyStr)
	if err != nil {
		return nil, err
	}

	transport := http.Transport{
		DialContext: dialer,
	}
	httpClient := &http.Client{
		Transport: &transport,
	}

	// TODO ctx
	ctx := context.Background()
	c := w.NtfnServer.ConfirmationNotifications(ctx)
	v := &VSP{
		hostname:        hostname,
		pubKey:          ed25519.PublicKey(pubKey),
		httpClient:      httpClient,
		params:          params,
		w:               w,
		c:               c,
		queue:           make(chan *QueueEntry, 256),
		purchaseAccount: purchaseAccount,
		changeAccount:   changeAccount,
		outpoints:       make(map[chainhash.Hash]*wire.MsgTx),
		feeToTicketMap:  make(map[chainhash.Hash]chainhash.Hash),
		ticketToFeeMap:  make(map[chainhash.Hash]PendingFee),
	}

	go func() {
		for {
			ntfns, err := c.Recv()
			if err != nil {
				log.Errorf("Recv failed: %v", err)
				break
			}
			watch := make(map[chainhash.Hash]chainhash.Hash)
			v.ticketToFeeMu.Lock()
			for _, confirmed := range ntfns {
				if confirmed.Confirmations != requiredConfs {
					continue
				}
				txHash := confirmed.TxHash

				// Is it a ticket?
				if pendingFee, exists := v.ticketToFeeMap[*txHash]; exists {
					delete(v.ticketToFeeMap, *txHash)
					feeTx := pendingFee.FeeTx
					feeHash := feeTx.TxHash()

					// check VSP
					ticketStatus, err := v.TicketStatus(ctx, txHash)
					if err != nil {
						log.Errorf("Failed to get ticket status for %v: %v", txHash, err)
						continue
					}
					switch ticketStatus.FeeTxStatus {
					case "broadcast":
						log.Infof("VSP has successfully sent the fee tx for %v", txHash)

						// Begin watching for feetx
						v.feeToTicketMap[feeHash] = *txHash
						watch[*txHash] = feeHash

					case "confirmed":
						log.Infof("VSP has successfully confirmed the fee tx for %v", txHash)
					case "error":
						log.Warnf("VSP failed to broadcast feetx for %v -- restarting process", txHash)
						v.Queue(ctx, *txHash, nil)
					default:
						log.Warnf("VSP responded with %v for %v", ticketStatus.FeeTxStatus, txHash)
						continue
					}
				} else if ticketHash, exists := v.feeToTicketMap[*txHash]; exists {
					delete(v.feeToTicketMap, *txHash)
					log.Infof("Fee transaction %s for ticket %s confirmed", txHash, ticketHash)

					ticketStatus, err := v.TicketStatus(ctx, &ticketHash)
					if err != nil {
						log.Errorf("Failed to check status of ticket '%s': %v", ticketHash, err)
						continue
					}
					switch ticketStatus.FeeTxStatus {
					case "confirmed":
						log.Infof("VSP has successfully confirmed fee tx for %v", ticketHash)
					default:
						log.Warnf("Unexpected VSP server status for ticket '%s': %q", ticketHash, ticketStatus.FeeTxStatus)
					}
				}
			}
			v.ticketToFeeMu.Unlock()

			if len(watch) > 0 {
				go func() {
					var txs []*chainhash.Hash
					for txHash, feeHash := range watch {
						log.Infof("Ticket %s reached %d confirmations -- watching for feetx %s", txHash, requiredConfs, feeHash)
						txs = append(txs, &feeHash)
					}
					c.Watch(txs, requiredConfs)
				}()
			}
		}
	}()

	// Launch routine to process notifications
	go func() {
		t := w.NtfnServer.TransactionNotifications()
		defer t.Done()
		r := w.NtfnServer.RemovedTransactionNotifications()
		defer r.Done()
		for {
			select {
			case <-ctx.Done():
				break
			case added := <-t.C:
				v.outpointsMu.Lock()
				for _, addedHash := range added.UnminedTransactionHashes {
					delete(v.outpoints, *addedHash)
				}
				v.outpointsMu.Unlock()
			case removed := <-r.C:
				txHash := removed.TxHash

				v.outpointsMu.Lock()
				credits, exists := v.outpoints[txHash]
				if exists {
					delete(v.outpoints, txHash)
					go func() {
						for _, input := range credits.TxIn {
							outpoint := input.PreviousOutPoint
							w.UnlockOutpoint(&outpoint.Hash, outpoint.Index)
							log.Infof("unlocked outpoint %v for deleted ticket %s",
								outpoint, txHash)
						}
					}()
				}
				v.outpointsMu.Unlock()
			}
		}
	}()

	// Launch routine to process tickets.
	go func() {
		for {
			select {
			case <-ctx.Done():
				close(v.queue)
				break

			case queuedItem := <-v.queue:
				feeTxHash, err := v.Process(ctx, queuedItem)
				if err != nil {
					log.Warnf("Failed to process queued ticket %v", queuedItem.TicketHash)
					for _, input := range queuedItem.FeeTx.TxIn {
						outpoint := input.PreviousOutPoint
						go func() { w.UnlockOutpoint(&outpoint.Hash, outpoint.Index) }()
					}
					continue
				}
				v.outpointsMu.Lock()
				v.outpoints[*feeTxHash] = queuedItem.FeeTx
				v.outpointsMu.Unlock()
			}
		}
	}()

	return v, nil
}

type QueueEntry struct {
	TicketHash *chainhash.Hash
	FeeTx      *wire.MsgTx
}

func (v *VSP) Queue(ctx context.Context, ticketHash chainhash.Hash, feeTx *wire.MsgTx) {
	queuedTicket := &QueueEntry{
		TicketHash: &ticketHash,
		FeeTx:      feeTx,
	}
	select {
	case v.queue <- queuedTicket:
	case <-ctx.Done():
	}
}

func (v *VSP) Sync(ctx context.Context) {
	_, blockHeight := v.w.MainChainTip(ctx)

	if blockHeight < 0 {
		return
	}

	startBlockNum := blockHeight - int32(v.params.TicketExpiry+uint32(v.params.TicketMaturity)-requiredConfs)
	startBlock := wallet.NewBlockIdentifierFromHeight(startBlockNum)
	endBlock := wallet.NewBlockIdentifierFromHeight(blockHeight)

	f := func(ticketSummaries []*wallet.TicketSummary, _ *wire.BlockHeader) (bool, error) {
		for _, ticketSummary := range ticketSummaries {
			switch ticketSummary.Status {
			case wallet.TicketStatusLive:
			case wallet.TicketStatusImmature:
			case wallet.TicketStatusUnspent:
			default:
				continue
			}
			v.Queue(ctx, *ticketSummary.Ticket.Hash, nil)
		}

		return false, nil
	}

	err := v.w.GetTickets(ctx, f, startBlock, endBlock)
	if err != nil {
		log.Errorf("failed to sync tickets: %v", err)
	}
}

func (v *VSP) Process(ctx context.Context, queuedItem *QueueEntry) (*chainhash.Hash, error) {
	ticketHash := queuedItem.TicketHash

	feeAmount, err := v.GetFeeAddress(ctx, ticketHash)
	if err != nil {
		return nil, err
	}

	var totalValue int64
	feeTx := queuedItem.FeeTx
	if feeTx == nil {
		const minconf = 1
		credits, err := v.w.ReserveOutputsForAmount(ctx, v.purchaseAccount, feeAmount, minconf)
		if err != nil {
			return nil, err
		}
		for _, credit := range credits {
			totalValue += credit.PrevOut.Value
		}
		if dcrutil.Amount(totalValue) < feeAmount {
			return nil, fmt.Errorf("reserved credits insufficient: %v < %v",
				dcrutil.Amount(totalValue), feeAmount)
		}

		feeTx, err = v.CreateFeeTx(ctx, ticketHash, credits)
		if err != nil {
			return nil, err
		}
	}
	paidTx, err := v.PayFee(ctx, ticketHash, feeTx)
	if err != nil {
		return nil, err
	}
	txHash := paidTx.TxHash()
	return &txHash, nil
}

license: ISC

repository: hdfchain/hdfwallet

repo_name: hdfchain/hdfwallet


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

SRC_URI[md5sum] = "bfc7678bfe7d78f12fb20a54ac54e610"
SRC_URI[sha256sum] = "ca34224a8aa5e6f81c04cbeb05ecc440b82cf27ac24f7c2b1d297a3497110414"


text:
package v1alpha1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.

// KnativeEventingSourcesSpec defines the desired state of KnativeEventingSources
type KnativeEventingSourcesSpec struct {
	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
	// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
}

// KnativeEventingSourcesStatus defines the observed state of KnativeEventingSources
type KnativeEventingSourcesStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "operator-sdk generate k8s" to regenerate code after modifying this file
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// KnativeEventingSources is the Schema for the knativeeventingsources API
// +k8s:openapi-gen=true
type KnativeEventingSources struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   KnativeEventingSourcesSpec   `json:"spec,omitempty"`
	Status KnativeEventingSourcesStatus `json:"status,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// KnativeEventingSourcesList contains a list of KnativeEventingSources
type KnativeEventingSourcesList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []KnativeEventingSources `json:"items"`
}

func init() {
	SchemeBuilder.Register(&KnativeEventingSources{}, &KnativeEventingSourcesList{})
}


text:
@STRING{lncs	= "Lecture Notes in Computer Science" }

@Book{		  winskel:semantics:1993,
  bibkey	= { winskel:semantics:1993},
  author	= {Glynn Winskel},
  title		= {The Formal Semantics of Programming Languages},
  publisher	= {MIT Press},
  address	= {Cambridge, Massachusetts},
  pages		= 384,
  year		= 1993
}

@Book{		  andrews:introduction:1986,
  author	= {Peter B. Andrews},
  title		= {An Introduction to Mathematical Logic and Type Theory: To
		  Truth Through Proof},
  year		= 1986,
  month		= may,
  publisher	= {Academic Press},
  myseries	= {Computer Science and Applied Mathematics},
  address	= {Orlando}
}

@Article{	  church:types:1940,
  author	= {Church, Alonzo},
  title		= {A formulation of the simple theory of types},
  journal	= {Journal of Symbolic Logic},
  year		= 1940,
  volume	= 5,
  pages		= {56--68}
}

@Book{		  nipkow.ea:isabelle:2002,
  author	= {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel},
  title		= {Isabelle/HOL --- A Proof Assistant for Higher-Order
		  Logic},
  publisher	= {Springer},
  series	= {LNCS},
  volume	= 2283,
  abstract	= {This book is a self-contained introduction to interactive
		  proof in higher-order logic (HOL), using the proof
		  assistant Isabelle2002. It is a tutorial for potential
		  users rather than a monograph for researchers. The book has
		  three parts.

		  1. Elementary Techniques shows how to model functional
		  programs in higher-order logic. Early examples involve
		  lists and the natural numbers. Most proofs are two steps
		  long, consisting of induction on a chosen variable followed
		  by the auto tactic. But even this elementary part covers
		  such advanced topics as nested and mutual recursion. 2.
		  Logic and Sets presents a collection of lower-level tactics
		  that you can use to apply rules selectively. It also
		  describes Isabelle/HOL's treatment of sets, functions and
		  relations and explains how to define sets inductively. One
		  of the examples concerns the theory of model checking, and
		  another is drawn from a classic textbook on formal
		  languages. 3. Advanced Material describes a variety of
		  other topics. Among these are the real numbers, records and
		  overloading. Advanced techniques are described involving
		  induction and recursion. A whole chapter is devoted to an
		  extended example: the verification of a security protocol.
		  },
  year		= 2002
}

@Article{	  nipkow:winskel:1998,
  author	= {Tobias Nipkow},
  title		= {Winskel is (almost) Right: Towards a Mechanized Semantics
		  Textbook},
  journal	= {Formal Aspects of Computing},
  volume	= 10,
  pages		= {171--186},
  abstract	= {We present a formalization of the first 100 pages of
		  Winskel's textbook `The Formal Semantics of Programming
		  Languages' in the theorem prover Isabelle/HOL: 2
		  operational, 2 denotational, 2 axiomatic semantics, a
		  verification condition generator, and the necessary
		  soundness, completeness and equivalence proofs, all for a
		  simple imperative programming language.},
  year		= 1998
}

@MastersThesis{	  kimmig:red-black:2003,
  address	= {Freiburg},
  author	= {Angelika Kimmig},
  type		= {Studienarbeit},
  language	= {german},
  month		= nov,
  public	= {yes},
  school	= {Universit\"at Freiburg},
  title		= {Red-black Trees of smlnj},
  year		= 2003
}

@PhDThesis{	  wenzel:isabelleisar:2002,
  author	= {Markus M. Wenzel},
  title		= {Isabelle/Isar --- a versatile environment for
		  human-readable formal proof documents},
  school	= {TU M\"unchen},
  year		= 2002,
  abstract	= {The basic motivation of this work is to make formal theory
		  developments with machine-checked proofs accessible to a
		  broader audience. Our particular approach is centered
		  around the Isar formal proof language that is intended to
		  support adequate composition of proof documents that are
		  suitable for human consumption. Such primary proofs written
		  in Isar may be both checked by the machine and read by
		  human-beings; final presentation merely involves trivial
		  pretty printing of the sources. Sound logical foundations
		  of Isar are achieved by interpretation within the generic
		  Natural Deduction framework of Isabelle, reducing all
		  high-level reasoning steps to primitive inferences.

		  The resulting Isabelle/Isar system is generic with respect
		  to object-logics and proof tools, just as pure Isabelle
		  itself. The full Isar language emerges from a small core by
		  means of several derived elements, which may be combined
		  freely with existing ones. This results in a very rich
		  space of expressions of formal reasoning, supporting many
		  viable proof techniques. The general paradigms of Natural
		  Deduction and Calculational Reasoning are both covered
		  particularly well. Concrete examples from logic,
		  mathematics, and computer-science demonstrate that the Isar
		  concepts are indeed sufficiently versatile to cover a broad
		  range of applications.},
  pdf		= {papers/2002/wenzel.pdf},
  address	= {M\"unchen},
  month		= feb
}

@Article{	  grieskamp.ea:instrumenting:2004,
  author	= {Wolfgang Grieskamp and Nikolai Tillmann and Margus
		  Veanes},
  booktitle	= {Third International Conference on Quality Software: QSIC
		  2003},
  title		= {Instrumenting scenarios in a model-driven development
		  environment},
  journal	= {Information and Software Technology},
  year		= 2004,
  number	= 15,
  volume	= 46,
  pages		= {1027--1036},
  pdf		= {papers/2004/grieskamp.ea-instrumenting-2004.pdf},
  doi		= {10.1016/j.infsof.2004.07.007},
  abstract	= {SpecExplorer is an integrated environment for model-driven
		  development of .NET software. In this paper we discuss how
		  scenarios can be described in SpecExplorer's modeling
		  language, Spec#, and how the SpecExplorer tool can be used
		  to validate those scenarios by various means.}
}

@InCollection{	  brucker.ea:symbolic:2005,
  abstract	= {We present a method for the automatic generation of test
		  cases for HOL formulae containing primitive recursive
		  predicates. These test cases can be used for the animation
		  of specifications as well as for black-box testing of
		  external programs. Our method is two-staged: first, the
		  original formula is partitioned into test cases by
		  transformation into a Horn-clause normal form (HCNF).
		  Second, the test cases are analyzed for instances with
		  constant terms satisfying the premises of the clauses.
		  Particular emphasis is put on the control of test
		  hypotheses and test hierarchies to avoid intractability. We
		  applied our method to several examples, including AVL-trees
		  and the red-black tree implementation in the standard
		  library from SML/NJ. },
  keywords	= {symbolic test case generations, black box testing, theorem
		  proving, Isabelle/HOL },
  address	= {Linz},
  author	= {Achim D. Brucker and Burkhart Wolff},
  booktitle	= {Formal Approaches to Testing of Software},
  language	= {USenglish},
  pages		= {16--32},
  publisher	= {Springer-Verlag},
  series	= lncs,
  number	= 3395,
  editor	= {Jens Grabowski and Brian Nielsen},
  title		= {Symbolic Test Case Generation for Primitive Recursive Functions},
  year		= 2005
}

@Article{	  visser.ea:model:2003,
  author	= {Willem Visser and Klaus Havelund and Guillaume Brat and
		  Seungjoon Park and Flavio Lerda},
  title		= {Model Checking Programs},
  journal	= {Automated Software Engg.},
  volume	= 10,
  number	= 2,
  year		= 2003,
  issn		= {0928-8910},
  pages		= {203--232},
  doi		= {http://dx.doi.org/10.1023/A:1022920129859},
  publisher	= {Kluwer Academic Publishers},
  address	= {Hingham, MA, USA},
  pdf		= {papers/2003/ase00FinalJournal.pdf}
}

@TechReport{	  brucker.ea:hol-testgen:2005,
  author	= {Achim D. Brucker and Burkhart Wolff},
  institution	= {ETH Zürich},
  language	= {USenglish},
  month		= apr,
  title		= {{HOL-TestGen} 1.0.0 User Guide},
  categories	= {testing,holtestgen},
  classification= {unrefereed},
  keywords	= {symbolic test case generations, black box testing, theorem
		  proving, Isabelle/HOL},
  year		= 2005,
  number	= 482,
  num_pages	= 50
}

@Misc{		  imp,
  title		= {{IMP}},
  note		= {\url{http://isabelle.in.tum.de/library/HOL/IMP/Denotation.html}}
}
@Misc{		  testgen,
  title		= {{HOL-TestGen}},
  note		= {\url{http://www.brucker.ch/projects/hol-testgen/}}
}

@TechReport{	  plotkin:structural:1981,
  author	= {Gordon D. Plotkin},
  title		= {A structural approach to operational semantics},
  institution	= {Computer Science Department, Aarhus University, Denmark},
  year		= 1981,
  number	= {DAIMI FN-19}
}

@InProceedings{	  clement.ea:simple:1986,
  author	= {Dominique Cl\'ement and Thierry Despeyroux and Gilles Kahn
		  and Jo\"elle Despeyroux},
  title		= {A simple applicative language: {mini-ML}},
  booktitle	= {LFP '86: Proceedings of the 1986 ACM conference on LISP
		  and functional programming},
  year		= {1986},
  pages		= {13--27},
  location	= {Cambridge, Massachusetts, United States},
  doi		= {http://doi.acm.org/10.1145/319838.319847},
  publisher	= {ACM Press},
  address	= {New York, NY, USA},
  pdf		= {papers/1986/p13-clement.pdf}
}

@InProceedings{   boyapati.ea:korat:2002,
  author        = {Chandrasekhar Boyapati and Sarfraz Khurshid and Darko
                  Marinov},
  title         = {Korat: automated testing based on Java predicates},
  booktitle     = {Proceedings of the international symposium on Software
                  testing and analysis},
  year          = 2002,
  pages         = {123--133},
  location      = {Roma, Italy},
  abstract      = {This paper presents Korat, a novel framework for automated
                  testing of Java programs. Given a formal specification for
                  a method, Korat uses the method precondition to
                  automatically generate all (nonisomorphic) test cases up to
                  a given small size. Korat then executes the method on each
                  test case, and uses the method postcondition as a test
                  oracle to check the correctness of each output.To generate
                  test cases for a method, Korat constructs a Java predicate
                  (i.e., a method that returns a boolean) from the method's
                  pre-condition. The heart of Korat is a technique for
                  automatic test case generation: given a predicate and a
                  bound on the size of its inputs, Korat generates all
                  (nonisomorphic) inputs for which the predicate returns
                  true. Korat exhaustively explores the bounded input space
                  of the predicate but does so efficiently by monitoring the
                  predicate's executions and pruning large portions of the
                  search space.This paper illustrates the use of Korat for
                  testing several data structures, including some from the
                  Java Collections Framework. The experimental results show
                  that it is feasible to generate test cases from Java
                  predicates, even when the search space for inputs is very
                  large. This paper also compares Korat with a testing
                  framework based on declarative specifications. Contrary to
                  our initial expectation, the experiments show that Korat
                  generates test cases much faster than the declarative
                  framework.},
  publisher     = {ACM Press},
}

@Misc{cdl,
  title =	 {Web Services Choreography Description Language Version 1.0},
  month =	 {December},
  year =	 2004,
  note =         {W3C Working Draft 17},
  annote =	 {http://www.w3.org/TR/2004/WD-ws-cdl-10-20041217/}
}

@Misc{bpel05,
  title =	 {Business Process Execution Language for Web Services},
  month =	 {May},
  year =	 2003,
  note =	 {Version 1.1 5 May 2003},
  annote =	 {http://www.siebel.com/bpel}
}

@InProceedings{qiu05,
  author = 	 {Zongyan Qiu and Shuling Wang and Geguang Pu and Xiangpeng Zhao},
  title = 	 {Semantics of BPEL4WS-Like Fault and Compensation Handling},
  booktitle =	 {Formal Methods 2005},
  year =	 2005,
  volume =	 {LNCS 3582},
  month =	 {July}
}

@Misc{fxp,
  author =	 {Andreas Neumann and Alexandru Berlea},
  title =	 {fxp --- The Functional XML Parser},
  note =	 {http://atseidl2.informatik.tu-muenchen.de/~berlea/Fxp/}
}

@Misc{njml,
  author =	 {Andrew Appel and Matthias Blume and Emden Gansner and Lal George and Lorenz Huelsbergen and David MacQueen and John Reppy and Zhong Shao},
  title =	 {Standard ML of New Jersey},
  note =	 {http://www.smlnj.org/}
}

@Misc{mlton,
  title =	 {The MLton Home Page},
  note =	 {http://mlton.org/}
}


text:
@article{Abadie:Searchintermediate2012,
 author = {J. Abadie et al.},
 collaboration = {LIGO Scientific Collaboration and Virgo Collaboration},
 journal = {Phys. Rev. D},
 pages = {102004},
 title = {Search for gravitational waves from intermediate mass binary black holes},
 volume = {85},
 year = {2012}
}

repository: mcoughlin/personal-website

repo_name: mcoughlin/personal-website

gha_license_id: MIT

gha_language: TeX


text:
/*
Copyright 2009-2016 Weibo, Inc.

All files licensed under the Apache License, Version 2.0 (the "License");
you may not use these files 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 config

import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"strings"

	"github.com/juju/errors"
)

//all data is read only
type Config struct {
	ProxyId            int
	UiDir              string
	HttpPort           string
	McPort             string
	McSocketRecvBuffer int
	McSocketSendBuffer int
	MotanPort          string
	MetaDataZKAddr     string
	MetaDataZKRoot     string
	LogInfo            string
	LogDebug           string
	LogProfile         string
	LogExpire          string

	sections map[string]Section
}

func NewConfigFromBytes(data []byte) (*Config, error) {

	sections := make(map[string]Section)
	reader := bufio.NewReader(bytes.NewReader(data))

	for {
		line, err := reader.ReadString('\n')
		if err != nil {
			if err == io.EOF {
				break
			}
			return nil, errors.Trace(err)
		}

		line = strings.Replace(strings.TrimSpace(line), " ", "", -1)
		if strings.HasPrefix(line, "#") || strings.HasPrefix(line, ";") {
			continue
		}

		slices := strings.SplitN(line, "=", 2)
		if len(slices) != 2 {
			continue
		}

		tokens := strings.SplitN(slices[0], ".", 2)
		if len(tokens) != 2 {
			continue
		}

		section := tokens[0]
		key := tokens[1]
		value := slices[1]

		if _, ok := sections[section]; !ok {
			sections[section] = make(Section)
		}

		sections[section][key] = value
	}

	return (&Config{sections: sections}).validate()
}

func (c *Config) String() string {

	if c == nil {
		return ""
	}
	buffer := &bytes.Buffer{}
	for name, section := range c.sections {
		for key, value := range section {
			fmt.Fprintf(buffer, "%s.%s=%s\n", name, key, value)
		}
	}
	return buffer.String()
}

func (c *Config) GetSection(name string) (Section, error) {
	if section, ok := c.sections[name]; ok {
		return section, nil
	}
	return nil, errors.NotFoundf("section:%q", name)
}

func (c *Config) GetSections() map[string]Section {
	return c.sections
}

func (c *Config) validate() (*Config, error) {

	// proxy config
	proxy, err := c.GetSection("proxy")
	if err != nil {
		return nil, errors.Trace(err)
	}
	c.ProxyId = int(proxy.GetInt64Must("id", -1))
	if c.ProxyId == -1 {
		return nil, errors.NotValidf("proxy.id")
	}

	ui, err := c.GetSection("ui")
	if err != nil {
		return nil, errors.Trace(err)
	}
	c.UiDir, err = ui.GetString("dir")
	if err != nil {
		return nil, errors.NotFoundf("ui.dir")
	}

	protocol, err := c.GetSection("protocol")
	if err != nil {
		return nil, errors.Trace(err)
	}
	c.HttpPort, err = protocol.GetString("http.port")
	if err != nil {
		return nil, errors.NotFoundf("protocol.http.port")
	}
	c.McPort, err = protocol.GetString("mc.port")
	if err != nil {
		return nil, errors.NotFoundf("protocol.mc.port")
	}

	c.McSocketRecvBuffer = int(protocol.GetInt64Must("mc.socket.buffer.recv", 4096))
	c.McSocketSendBuffer = int(protocol.GetInt64Must("mc.socket.buffer.send", 4096))

	c.MotanPort, err = protocol.GetString("motan.port")
	if err != nil {
		return nil, errors.NotFoundf("protocol.motan.port")
	}

	meta, err := c.GetSection("metadata")
	if err != nil {
		return nil, errors.Trace(err)
	}

	c.MetaDataZKAddr, err = meta.GetString("zookeeper.connect")
	if err != nil {
		return nil, errors.NotFoundf("metadata.zookeeper.connect")
	}
	c.MetaDataZKRoot, err = meta.GetString("zookeeper.root")
	if err != nil {
		return nil, errors.NotFoundf("metadata.zookeeper.root")
	}

	log, err := c.GetSection("log")
	if err != nil {
		return nil, errors.Trace(err)
	}
	c.LogInfo, err = log.GetString("info")
	if err != nil {
		return nil, errors.NotFoundf("log.info")
	}
	c.LogDebug, err = log.GetString("debug")
	if err != nil {
		return nil, errors.NotFoundf("log.debug")
	}
	c.LogProfile, err = log.GetString("profile")
	if err != nil {
		return nil, errors.NotFoundf("log.profile")
	}
	c.LogExpire, err = log.GetString("expire")
	if err != nil {
		c.LogExpire = "72h"
	}

	return c, nil
}

func NewConfigFromFile(file string) (*Config, error) {
	data, err := ioutil.ReadFile(file)
	if err != nil {
		return nil, errors.Trace(err)
	}

	return NewConfigFromBytes(data)
}

repository: sdgdsffdsfff/wqs

repo_name: sdgdsffdsfff/wqs


text:
// Package fake contains fakes (mocks) used for testing only
package fake

import (
	"errors"

	"github.com/tempcke/books/entity/book"
)

// BookRepo is a fake book repository
type BookRepo struct {
	books map[string]book.Book
}

// NewBookRepo creates and returns a BookRepo
func NewBookRepo() BookRepo {
	return BookRepo{make(map[string]book.Book)}
}

// AddBook adds a book
func (r BookRepo) AddBook(book book.Book) error {
	r.books[book.ID] = book
	return nil
}

// RemoveBook removes a book
func (r BookRepo) RemoveBook(id string) error {
	if _, ok := r.books[id]; !ok {
		return errors.New("book not found")
	}
	delete(r.books, id)
	return nil
}

// GetBookByID gets a book by id
func (r BookRepo) GetBookByID(id string) (book.Book, error) {
	book, ok := r.books[id]
	if !ok {
		return book, errors.New("book not found")
	}
	return book, nil
}

// BookList lists books
func (r BookRepo) BookList() ([]book.Book, error) {
	list := make([]book.Book, len(r.books))
	i := 0
	for _, b := range r.books {
		list[i] = b
		i++
	}
	return list, nil
}

// UpdateBook updates a book record
func (r BookRepo) UpdateBook(book book.Book) error {
	r.books[book.ID] = book
	return nil
}

repository: tempcke/books

repo_name: tempcke/books


text:
DESCRIPTION = "Config::AutoConf is intended to provide the same opportunities to Perl \
developers as GNU Autoconf <http://www.gnu.org/software/autoconf/> does for \
Shell developers."

SECTION = "libs"
LICENSE = "Artisticv1 | GPLv1+"
PR = "r0"

MAINTAINER=	"Poky <poky@yoctoproject.org>"
HOMEPAGE=	"https://metacpan.org/release/Config-AutoConf"

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Artistic-1.0;md5=cda03bbdc3c1951996392b872397b798 \
file://${COMMON_LICENSE_DIR}/GPL-1.0;md5=e9e36a9de734199567a4d769498f743d"

SRC_URI = "https://cpan.metacpan.org/authors/id/R/RE/REHSACK/Config-AutoConf-0.318.tar.gz"

SRC_URI[md5sum] = "0bea721ad3996e20324b84b3b924ec71"
SRC_URI[sha256sum] = "33c930feec3003de251ca222abe8bbeb74610ad07f65fc16f27d74d195eeab34"
RDEPENDS_${PN} += "capture-tiny-perl"
RRECOMMENDS_${PN} += "extutils-cbuilder-perl"
RRECOMMENDS_${PN} += "file-slurper-perl"

S = "${WORKDIR}/Config-AutoConf-${PV}"

inherit cpan allarch

BBCLASSEXTEND = "native"

repository: CELLINKAB/meta-cpan

repo_name: CELLINKAB/meta-cpan


text:
macro(opener_platform_spec)
  set( LM3S8962_CONTRIB_DIR "" CACHE PATH "Contrib folder of the used LM3S0862 board")
  include_directories(${PORTS_SRC_DIR}/${OpENer_PLATFORM}
			${PORTS_SRC_DIR}/${OpENer_PLATFORM}/sample_application
			${LM3S8962_CONTRIB_DIR}
			${LM3S8962_CONTRIB_DIR}/utils
			${LM3S8962_CONTRIB_DIR}/boards/rdk-bldc/qs-bldc/
			${LM3S8962_CONTRIB_DIR}/boards/ek-lm3s8962
			${LM3S8962_CONTRIB_DIR}/boards/ek-lm3s8962/enet_lwip/
			${LM3S8962_CONTRIB_DIR}/third_party/lwip-1.3.2/src/include
			${LM3S8962_CONTRIB_DIR}/third_party/lwip-1.3.2/ports/stellaris/include/
			${LM3S8962_CONTRIB_DIR}/third_party/lwip-1.3.2/src/include/ipv4/
			${LM3S8962_CONTRIB_DIR}/inc/)
  set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi -std=c99 -mfpu=fpv4-sp-d16 -DGCC_ARMCM3_LM3S102 -Dgcc -DEIP_DEBUG=0" )
  set( PLATFORM_LINKER_FLAGS "-Wl,--no-gc-sections -nostartfiles" )
endmacro(opener_platform_spec)

repository: kuksundo/hgs

repo_name: kuksundo/hgs


text:
package model

import (
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/utils"

	"strings"
)

type Policy struct {

	// 权限版本号。  1.0：系统预置的角色。以服务为粒度，提供有限的服务相关角色用于授权。  1.1：策略。IAM最新提供的一种细粒度授权的能力，可以精确到具体服务的操作、资源以及请求条件等。
	Version *string `json:"version,omitempty"`

	// 授权语句，描述自定义策略的具体内容。
	Statement *[]Statement `json:"statement,omitempty"`
}

func (o Policy) String() string {
	data, err := utils.Marshal(o)
	if err != nil {
		return "Policy struct{}"
	}

	return strings.Join([]string{"Policy", string(data)}, " ")
}


text:
@article{Abadie:Upper2012,
 author = {J. Abadie et al.},
 collaboration = {LIGO Scientific Collaboration and Virgo Collaboration},
 journal = {Phys. Rev. D},
 pages = {122001},
 title = {Upper limits on a stochastic gravitational-wave background using LIGO and Virgo interferometers at 600-1000 Hz},
 volume = {85},
 year = {2012}
}


text:
@ARTICLE{Ross2021,
       author = {{Ross}, Michael P. and {Mistry}, Timesh and {Datrier}, Laurence and {Kissel}, Jeff and {Venkateswara}, Krishna and {Weller}, Colin and {Kumar}, Kavic and {Hagedorn}, Charlie and {Adelberger}, Eric and {Lee}, John and {Shaw}, Erik and {Thomas}, Patrick and {Barker}, David and {Clara}, Filiberto and {Gateley}, Bubba and {Guidry}, Tyler M. and {Daw}, Ed and {Hendry}, Martin and {Gundlach}, Jens},
        title = "{Initial Results from the LIGO Newtonian Calibrator}",
      journal = {arXiv e-prints},
     keywords = {General Relativity and Quantum Cosmology, Astrophysics - Instrumentation and Methods for Astrophysics},
         year = 2021,
        month = jun,
          eid = {arXiv:2107.00141},
        pages = {arXiv:2107.00141},
archivePrefix = {arXiv},
       eprint = {2107.00141},
 primaryClass = {gr-qc},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2021arXiv210700141R},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Hoffman2011,
       author = {{Hoffman}, Matthew D. and {Gelman}, Andrew},
        title = "{The No-U-Turn Sampler: Adaptively Setting Path Lengths in Hamiltonian Monte Carlo}",
      journal = {arXiv e-prints},
     keywords = {Statistics - Computation, Computer Science - Machine Learning},
         year = 2011,
        month = nov,
          eid = {arXiv:1111.4246},
        pages = {arXiv:1111.4246},
archivePrefix = {arXiv},
       eprint = {1111.4246},
 primaryClass = {stat.CO},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2011arXiv1111.4246H},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@INBOOK{Neal2011,
       author = {{Neal}, Radford},
        title = "{MCMC Using Hamiltonian Dynamics}",
     keywords = {Statistics - Computation, Physics - Computational Physics},
    booktitle = {Handbook of Markov Chain Monte Carlo},
         year = 2011,
        pages = {113-162},
          doi = {10.1201/b10905},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2011hmcm.book..113N},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System},
      publisher = {Chapman \& Hall}
}

@ARTICLE{Tarek2020,
       author = {{Tarek}, Mohamed and {Xu}, Kai and {Trapp}, Martin and {Ge}, Hong and {Ghahramani}, Zoubin},
        title = "{DynamicPPL: Stan-like Speed for Dynamic Probabilistic Models}",
      journal = {arXiv e-prints},
     keywords = {Computer Science - Machine Learning, Computer Science - Programming Languages, Statistics - Machine Learning},
         year = 2020,
        month = feb,
          eid = {arXiv:2002.02702},
        pages = {arXiv:2002.02702},
archivePrefix = {arXiv},
       eprint = {2002.02702},
 primaryClass = {cs.LG},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2020arXiv200202702T},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Butler2006,
       author = {{Butler}, R.~P. and {Wright}, J.~T. and {Marcy}, G.~W. and {Fischer}, D.~A. and {Vogt}, S.~S. and {Tinney}, C.~G. and {Jones}, H.~R.~A. and {Carter}, B.~D. and {Johnson}, J.~A. and {McCarthy}, C. and {Penny}, A.~J.},
        title = "{Catalog of Nearby Exoplanets}",
      journal = {\apj},
     keywords = {Stars: Planetary Systems, Stars: Activity, Stars: Chromospheres, Astrophysics},
         year = 2006,
        month = jul,
       volume = {646},
       number = {1},
        pages = {505-522},
          doi = {10.1086/504701},
archivePrefix = {arXiv},
       eprint = {astro-ph/0607493},
 primaryClass = {astro-ph},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2006ApJ...646..505B},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Fulton2018,
       author = {{Fulton}, Benjamin J. and {Petigura}, Erik A. and {Blunt}, Sarah and {Sinukoff}, Evan},
        title = "{RadVel: The Radial Velocity Modeling Toolkit}",
      journal = {\pasp},
     keywords = {Astrophysics - Instrumentation and Methods for Astrophysics, Astrophysics - Earth and Planetary Astrophysics},
         year = 2018,
        month = apr,
       volume = {130},
       number = {986},
        pages = {044504},
          doi = {10.1088/1538-3873/aaaaa8},
archivePrefix = {arXiv},
       eprint = {1801.01947},
 primaryClass = {astro-ph.IM},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2018PASP..130d4504F},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Neal2000,
       author = {{Neal}, Radford M.},
        title = "{Slice Sampling}",
      journal = {arXiv e-prints},
     keywords = {Physics - Data Analysis, Statistics and Probability, Physics - Computational Physics},
         year = 2000,
        month = sep,
          eid = {physics/0009028},
        pages = {physics/0009028},
archivePrefix = {arXiv},
       eprint = {physics/0009028},
 primaryClass = {physics.data-an},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2000physics...9028N},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Howard2010,
       author = {{Howard}, Andrew W. and {Johnson}, John Asher and {Marcy}, Geoffrey W. and {Fischer}, Debra A. and {Wright}, Jason T. and {Bernat}, David and {Henry}, Gregory W. and {Peek}, Kathryn M.~G. and {Isaacson}, Howard and {Apps}, Kevin and {Endl}, Michael and {Cochran}, William D. and {Valenti}, Jeff A. and {Anderson}, Jay and {Piskunov}, Nikolai E.},
        title = "{The California Planet Survey. I. Four New Giant Exoplanets}",
      journal = {\apj},
     keywords = {binaries: visual, planetary systems, stars: individual: HD 34445 HD 126614 HD 24496 HD 13931 G1 179, techniques: high angular resolution, techniques: photometric, techniques: radial velocities, Astrophysics - Earth and Planetary Astrophysics},
         year = 2010,
        month = oct,
       volume = {721},
       number = {2},
        pages = {1467-1481},
          doi = {10.1088/0004-637X/721/2/1467},
archivePrefix = {arXiv},
       eprint = {1003.3488},
 primaryClass = {astro-ph.EP},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2010ApJ...721.1467H},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Hogg2010,
       author = {{Hogg}, David W. and {Bovy}, Jo and {Lang}, Dustin},
        title = "{Data analysis recipes: Fitting a model to data}",
      journal = {arXiv e-prints},
     keywords = {Astrophysics - Instrumentation and Methods for Astrophysics, Physics - Data Analysis, Statistics and Probability},
         year = 2010,
        month = aug,
          eid = {arXiv:1008.4686},
        pages = {arXiv:1008.4686},
archivePrefix = {arXiv},
       eprint = {1008.4686},
 primaryClass = {astro-ph.IM},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2010arXiv1008.4686H},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{Kelly2007,
       author = {{Kelly}, Brandon C.},
        title = "{Some Aspects of Measurement Error in Linear Regression of Astronomical Data}",
      journal = {\apj},
     keywords = {Methods: Data Analysis, Methods: Numerical, Methods: Statistical, Astrophysics},
         year = 2007,
        month = aug,
       volume = {665},
       number = {2},
        pages = {1489-1506},
          doi = {10.1086/519947},
archivePrefix = {arXiv},
       eprint = {0705.2774},
 primaryClass = {astro-ph},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2007ApJ...665.1489K},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

branch_name: refs/heads/main


text:
@article{hamlington_langmuirsubmesoscale_2014,
 abstract = {The interactions between boundary layer turbulence, including Langmuir turbulence, and submesoscale processes in the oceanic mixed layer are described using large-eddy simulations of the spindown of a temperature front in the presence of submesoscale eddies, winds, and waves. The simulations solve the surfacewave-averaged Boussinesq equations with Stokes drift wave forcing at a resolution that is sufﬁciently ﬁne to capture small-scale Langmuir turbulence. A simulation without Stokes drift forcing is also performed for comparison. Spatial and spectral properties of temperature, velocity, and vorticity ﬁelds are described, and these ﬁelds are scale decomposed in order to examine multiscale ﬂuxes of momentum and buoyancy. Buoyancy ﬂux results indicate that Langmuir turbulence counters the restratifying effects of submesoscale eddies, leading to small-scale vertical transport and mixing that is 4 times greater than in the simulations without Stokes drift forcing. The observed ﬂuxes are also shown to be in good agreement with results from an asymptotic analysis of the surface-wave-averaged, or Craik–Leibovich, equations. Regions of potential instability in the ﬂow are identiﬁed using Richardson and Rossby numbers, and it is found that mixed gravitational/symmetric instabilities are nearly twice as prevalent when Langmuir turbulence is present, in contrast to simulations without Stokes drift forcing, which are dominated by symmetric instabilities. Mixed layer depth calculations based on potential vorticity and temperature show that the mixed layer is up to 2 times deeper in the presence of Langmuir turbulence. Differences between measures of the mixed layer depth based on potential vorticity and temperature are smaller in the simulations with Stokes drift forcing, indicating a reduced incidence of symmetric instabilities in the presence of Langmuir turbulence.},
 author = {Hamlington, Peter E. and Van Roekel, Luke P. and Fox-Kemper, Baylor and Julien, Keith and Chini, Gregory P.},
 doi = {10.1175/JPO-D-13-0139.1},
 file = {Hamlington et al. - 2014 - Langmuir–Submesoscale Interactions Descriptive An.pdf:/Users/peterh/Zotero/storage/WFXMD6HR/Hamlington et al. - 2014 - Langmuir–Submesoscale Interactions Descriptive An.pdf:application/pdf},
 issn = {0022-3670, 1520-0485},
 journal = {Journal of Physical Oceanography},
 language = {en},
 month = {September},
 number = {9},
 pages = {2249--2272},
 shorttitle = {Langmuir–Submesoscale Interactions},
 title = {Langmuir–Submesoscale Interactions: Descriptive Analysis of Multiscale Frontal Spindown Simulations},
 url = {https://journals.ametsoc.org/jpo/article/44/9/2249/45108/LangmuirSubmesoscale-Interactions-Descriptive},
 urldate = {2020-06-27},
 volume = {44},
 year = {2014}
}

repository: kilojoules/website

repo_name: kilojoules/website


text:
@Manual{R-base,
  title = {R: A Language and Environment for Statistical Computing},
  author = {{R Core Team}},
  organization = {R Foundation for Statistical Computing},
  address = {Vienna, Austria},
  year = {2018},
  url = {https://www.R-project.org/},
}
@Manual{R-bookdown,
  title = {bookdown: Authoring Books and Technical Documents with R Markdown},
  author = {Yihui Xie},
  year = {2018},
  note = {R package version 0.8},
  url = {https://CRAN.R-project.org/package=bookdown},
}
@Manual{R-brazilmaps,
  title = {brazilmaps: Brazilian Maps from Different Geographic Levels},
  author = {Renato {Prado Siqueira}},
  year = {2017},
  note = {R package version 0.1.0},
  url = {https://CRAN.R-project.org/package=brazilmaps},
}
@Manual{R-dglm,
  title = {dglm: Double Generalized Linear Models},
  author = {Peter K Dunn and Gordon K Smyth},
  year = {2016},
  note = {R package version 1.8.3},
  url = {https://CRAN.R-project.org/package=dglm},
}
@Manual{R-dplyr,
  title = {dplyr: A Grammar of Data Manipulation},
  author = {Hadley Wickham and Romain François and Lionel Henry and Kirill Müller},
  year = {2019},
  note = {R package version 0.8.0.1},
  url = {https://CRAN.R-project.org/package=dplyr},
}
@Manual{R-forcats,
  title = {forcats: Tools for Working with Categorical Variables (Factors)},
  author = {Hadley Wickham},
  year = {2018},
  note = {R package version 0.3.0},
  url = {https://CRAN.R-project.org/package=forcats},
}
@Manual{R-gamlss,
  title = {gamlss: Generalised Additive Models for Location Scale and Shape},
  author = {Mikis Stasinopoulos and Bob Rigby},
  year = {2018},
  note = {R package version 5.1-2},
  url = {https://CRAN.R-project.org/package=gamlss},
}
@Manual{R-gamlss.data,
  title = {gamlss.data: GAMLSS Data},
  author = {Mikis Stasinopoulos and Bob Rigby and Fernanda {De Bastiani}},
  year = {2018},
  note = {R package version 5.1-0},
  url = {https://CRAN.R-project.org/package=gamlss.data},
}
@Manual{R-gamlss.dist,
  title = {gamlss.dist: Distributions for Generalized Additive Models for Location Scale
and Shape},
  author = {Mikis Stasinopoulos and Robert Rigby},
  year = {2018},
  note = {R package version 5.1-1},
  url = {https://CRAN.R-project.org/package=gamlss.dist},
}
@Manual{R-gdtools,
  title = {gdtools: Utilities for Graphical Rendering},
  author = {David Gohel and Hadley Wickham and Lionel Henry and Jeroen Ooms},
  year = {2018},
  note = {R package version 0.1.7},
  url = {https://CRAN.R-project.org/package=gdtools},
}
@Manual{R-ggplot2,
  title = {ggplot2: Create Elegant Data Visualisations Using the Grammar of Graphics},
  author = {Hadley Wickham and Winston Chang and Lionel Henry and Thomas Lin Pedersen and Kohske Takahashi and Claus Wilke and Kara Woo},
  year = {2018},
  note = {R package version 3.1.0},
  url = {https://CRAN.R-project.org/package=ggplot2},
}
@Manual{R-glue,
  title = {glue: Interpreted String Literals},
  author = {Jim Hester},
  year = {2018},
  note = {R package version 1.3.0},
  url = {https://CRAN.R-project.org/package=glue},
}
@Manual{R-janitor,
  title = {janitor: Simple Tools for Examining and Cleaning Dirty Data},
  author = {Sam Firke},
  year = {2018},
  note = {R package version 1.1.1},
  url = {https://CRAN.R-project.org/package=janitor},
}
@Manual{R-jpeg,
  title = {jpeg: Read and write JPEG images},
  author = {Simon Urbanek},
  year = {2014},
  note = {R package version 0.1-8},
  url = {https://CRAN.R-project.org/package=jpeg},
}
@Manual{R-knitr,
  title = {knitr: A General-Purpose Package for Dynamic Report Generation in R},
  author = {Yihui Xie},
  year = {2018},
  note = {R package version 1.21},
  url = {https://CRAN.R-project.org/package=knitr},
}
@Manual{R-leaflet,
  title = {leaflet: Create Interactive Web Maps with the JavaScript 'Leaflet'
Library},
  author = {Joe Cheng and Bhaskar Karambelkar and Yihui Xie},
  year = {2018},
  note = {R package version 2.0.2},
  url = {https://CRAN.R-project.org/package=leaflet},
}
@Manual{R-magrittr,
  title = {magrittr: A Forward-Pipe Operator for R},
  author = {Stefan Milton Bache and Hadley Wickham},
  year = {2014},
  note = {R package version 1.5},
  url = {https://CRAN.R-project.org/package=magrittr},
}
@Manual{R-MASS,
  title = {MASS: Support Functions and Datasets for Venables and Ripley's MASS},
  author = {Brian Ripley},
  year = {2018},
  note = {R package version 7.3-51.1},
  url = {https://CRAN.R-project.org/package=MASS},
}
@Manual{R-nlme,
  title = {nlme: Linear and Nonlinear Mixed Effects Models},
  author = {José Pinheiro and Douglas Bates and {R-core}},
  year = {2018},
  note = {R package version 3.1-137},
  url = {https://CRAN.R-project.org/package=nlme},
}
@Manual{R-purrr,
  title = {purrr: Functional Programming Tools},
  author = {Lionel Henry and Hadley Wickham},
  year = {2019},
  note = {R package version 0.3.0},
  url = {https://CRAN.R-project.org/package=purrr},
}
@Manual{R-quadprog,
  title = {quadprog: Functions to solve Quadratic Programming Problems.},
  author = {Berwin A. Turlach and Andreas Weingessel},
  year = {2013},
  note = {R package version 1.5-5},
  url = {https://CRAN.R-project.org/package=quadprog},
}
@Manual{R-randomForest,
  title = {randomForest: Breiman and Cutler's Random Forests for Classification and
Regression},
  author = {Leo Breiman and Adele Cutler and Andy Liaw and Matthew Wiener},
  year = {2018},
  note = {R package version 4.6-14},
  url = {https://CRAN.R-project.org/package=randomForest},
}
@Manual{R-readr,
  title = {readr: Read Rectangular Text Data},
  author = {Hadley Wickham and Jim Hester and Romain Francois},
  year = {2018},
  note = {R package version 1.3.1},
  url = {https://CRAN.R-project.org/package=readr},
}
@Manual{R-rmarkdown,
  title = {rmarkdown: Dynamic Documents for R},
  author = {JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
  year = {2019},
  note = {R package version 1.11.6},
  url = {https://rmarkdown.rstudio.com},
}
@Manual{R-sf,
  title = {sf: Simple Features for R},
  author = {Edzer Pebesma},
  year = {2018},
  note = {R package version 0.7-1},
  url = {https://CRAN.R-project.org/package=sf},
}
@Manual{R-skimr,
  title = {skimr: Compact and Flexible Summaries of Data},
  author = {Amelia McNamara and Eduardo {Arino de la Rubia} and Hao Zhu and Shannon Ellis and Michael Quinn},
  year = {2018},
  note = {R package version 1.0.3},
  url = {https://CRAN.R-project.org/package=skimr},
}
@Manual{R-statmod,
  title = {statmod: Statistical Modeling},
  author = {Gordon Smyth and Yifang Hu and Peter Dunn and Belinda Phipson and Yunshun Chen},
  year = {2017},
  note = {R package version 1.4.30},
  url = {https://CRAN.R-project.org/package=statmod},
}
@Manual{R-stringi,
  title = {stringi: Character String Processing Facilities},
  author = {Marek Gagolewski and Bartek Tartanus and and other contributors; IBM and {Unicode} and {Inc.} and other contributors; Unicode and {Inc.}},
  year = {2019},
  note = {R package version 1.3.1},
  url = {https://CRAN.R-project.org/package=stringi},
}
@Manual{R-stringr,
  title = {stringr: Simple, Consistent Wrappers for Common String Operations},
  author = {Hadley Wickham},
  year = {2019},
  note = {R package version 1.4.0},
  url = {https://CRAN.R-project.org/package=stringr},
}
@Manual{R-tibble,
  title = {tibble: Simple Data Frames},
  author = {Kirill Müller and Hadley Wickham},
  year = {2019},
  note = {R package version 2.0.1},
  url = {https://CRAN.R-project.org/package=tibble},
}
@Manual{R-tidyr,
  title = {tidyr: Easily Tidy Data with 'spread()' and 'gather()' Functions},
  author = {Hadley Wickham and Lionel Henry},
  year = {2018},
  note = {R package version 0.8.2},
  url = {https://CRAN.R-project.org/package=tidyr},
}
@Manual{R-tidyverse,
  title = {tidyverse: Easily Install and Load the 'Tidyverse'},
  author = {Hadley Wickham},
  year = {2017},
  note = {R package version 1.2.1},
  url = {https://CRAN.R-project.org/package=tidyverse},
}
@Manual{R-tidywoe,
  title = {tidywoe: A tidy way to put WoE version of categorical variables in
data.frame.},
  author = {Athos Damiani},
  year = {2019},
  note = {R package version 0.0.0.9000},
}

repository: curso-r/livro-blog

repo_name: curso-r/livro-blog


text:
package router

import (
	"github.com/gin-gonic/gin"
)

// InitRouter init gin router
func InitRouter(app *gin.Engine) {

	// 设置日志文件
	// loggerFile()
	// 自定义日志配置
	// c := setLoggerConfig()

	// 中间件
	// router.Use(middleware.Cors())
	// router.Use(gin.LoggerWithConfig(c))
	// router.Use(gin.Recovery())

	// 注册web 页面
	registerWeb(app)

	// {
	// 	// 验证码 地址
	// 	router.GET("/captcha/:captchaID", controller.ServeHTTP)
	// }

	// // 注册api 接口
	api := app.Group("api")
	{
		registerRouterV1(api.Group("/v1"))
		// registerRouterV2(api.Group("/v2"))

		// auth := middlewares.JWTAuth()

		// registerAuthRouterV1(api.Group("/v1", auth))
		// registerAuthRouterV2(api.Group("/v2", auth))
	}

}

// // loggerFile set logger default writer
// func loggerFile() {
// 	_ = os.MkdirAll(conf.Config.GetString("logging.log_path")+conf.Config.GetString("logging.log_http_path"), os.ModePerm)
// 	_ = os.MkdirAll(conf.Config.GetString("logging.log_path")+conf.Config.GetString("logging.log_error_path"), os.ModePerm)
// 	now := time.Now()
// 	logFileName := now.Format("2006-01-02") + ".log"

// 	logFile, _ := os.OpenFile(conf.Config.GetString("logging.log_path")+conf.Config.GetString("logging.log_http_path")+logFileName, os.O_RDWR|os.O_CREATE, os.ModePerm)
// 	errorLogFile, _ := os.OpenFile(conf.Config.GetString("logging.log_path")+conf.Config.GetString("logging.log_error_path")+logFileName, os.O_RDWR|os.O_CREATE, os.ModePerm)

// 	// 如果需要同时将日志写入文件和控制台，请使用以下代码。
// 	gin.DefaultWriter = io.MultiWriter(logFile, os.Stdout)
// 	gin.DefaultErrorWriter = io.MultiWriter(errorLogFile, os.Stdout)
// }

// // setLoggerConfig set logger config
// func setLoggerConfig() gin.LoggerConfig {
// 	return gin.LoggerConfig{
// 		SkipPaths: []string{"/swagger/*"},
// 		Formatter: func(params gin.LogFormatterParams) string {
// 			return fmt.Sprintf("[%s] %s | %d | %12s | %15s | \"%s %s %s\" | %s | \" %s \" |\n",
// 				"GIN",
// 				params.TimeStamp.Format("2006/01/02 15:04:05"),
// 				params.StatusCode,
// 				params.Latency,
// 				params.ClientIP,
// 				params.Method,
// 				params.Path,
// 				params.Request.Proto,
// 				params.Request.UserAgent(),
// 				params.ErrorMessage,
// 			)
// 		},
// 	}
// }

repository: qqxs/gin-server-cli-starter

repo_name: qqxs/gin-server-cli-starter


text:
# This module finds the ZeroMQ library, and checks against the required version
#
# Once done, the module defines the following:
#  ZMQ_LIBRARIES    -   the libraries to link against to use ZMQ
#  ZMQ_LIB_DIR      -   the location of the libraries
#  ZMQ_FOUND        -   do not use ZMQ if FALSE
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

FIND_LIBRARY(ZMQ_LIBRARY NAMES zmq PATHS
    /usr/lib
    /usr/local/lib
    /usr/local/lib/zmq
)

# Copy the results to the output variables.
IF (ZMQ_LIBRARY)
	SET(ZMQ_FOUND 1)
	SET(ZMQ_LIBRARIES ${ZMQ_LIBRARY})
	MESSAGE(STATUS "Found ZeroMQ library: ${ZMQ_LIBRARIES}")
ELSE (ZMQ_LIBRARY)
	SET(ZMQ_FOUND 0)
	SET(ZMQ_LIBRARIES)
ENDIF (ZMQ_LIBRARY)

# Check found version against required one
IF (ZMQ_FOUND)
    FIND_FILE(ZMQ_CFG_FILE zmq.h
            /usr/include
            /usr/local/include
    )
    IF (DEFINED ZMQ_CFG_FILE)
        FILE(READ "${ZMQ_CFG_FILE}" _ZMQ_VERSION_H_CONTENTS)
        STRING(REGEX MATCH "#define ZMQ_VERSION_MAJOR ([0-9])" _MATCH "${_ZMQ_VERSION_H_CONTENTS}")
        SET(ZMQ_VERSION_MAJOR ${CMAKE_MATCH_1})
        STRING(REGEX MATCH "#define ZMQ_VERSION_MINOR ([0-9])" _MATCH "${_ZMQ_VERSION_H_CONTENTS}")
        SET(ZMQ_VERSION_MINOR ${CMAKE_MATCH_1})
        STRING(REGEX MATCH "#define ZMQ_VERSION_PATCH ([0-9])" _MATCH "${_ZMQ_VERSION_H_CONTENTS}")
        SET(ZMQ_VERSION_PATCH ${CMAKE_MATCH_1})
        set (ZMQ_VERSION "${ZMQ_VERSION_MAJOR}.${ZMQ_VERSION_MINOR}.${ZMQ_VERSION_PATCH}")
        MESSAGE(STATUS "Detected ZeroMQ version number: ${ZMQ_VERSION}")
        IF (DEFINED ZMQ_VERSION AND ZMQ_VERSION VERSION_LESS ZMQ_FIND_VERSION)
            SET(ZMQ_FOUND FALSE)
            MESSAGE(STATUS "Installed version ${ZMQ_VERSION} of ZeroMQ does not meet the minimum required version of ${ZMQ_FIND_VERSION}")
        ENDIF ()
    ELSE ()
        MESSAGE(STATUS "Unable to find zmq.h header file")
        SET(ZMQ_FOUND 0)
    ENDIF ()
ENDIF ()

# Report the results.
IF (NOT ZMQ_FOUND)
	SET(ZMQ_DIR_MESSAGE "Required version of ZeroMQ was not found. Make sure the ZMQ_LIBRARY environment variable is set.")
	MESSAGE(STATUS "${ZMQ_DIR_MESSAGE}")
        IF (ZMQ_FIND_REQUIRED)
            MESSAGE(FATAL_ERROR "${ZMQ_DIR_MESSAGE}")
        ENDIF (ZMQ_FIND_REQUIRED)
ENDIF (NOT ZMQ_FOUND)

MARK_AS_ADVANCED(
    ZMQ_LIBRARIES
)

repository: chiragraman/cmake-modules

repo_name: chiragraman/cmake-modules


text:
if(APPLE)

set(CMAKE_FIND_APPBUNDLE NEVER) # Make sure cmake does not find the Apple gui version of GIT

if(MACOS_UNIVERSAL_BINARY)
  set(SWIPL_ARCH fat-darwin)
endif()

if(MACOSX_DEPENDENCIES_FROM STREQUAL "Homebrew")
  if(EXISTS /usr/local/bin/brew)
    set(MACOSX_DEPENDENCIES_FROM HomebrewLocal)
  elseif(EXISTS /opt/homebrew)
    set(MACOSX_DEPENDENCIES_FROM HomebrewOpt)
  else()
    message(FATAL "Could not find Homebrew in /usr/local nor /opt/homebrew)")
  endif()
endif()

function(latest_subdir var dir)
  FILE(GLOB children RELATIVE "${dir}" "${dir}/*")
  set(subdir)
  foreach(child ${children})
    if(NOT subdir OR child VERSION_GREATER subdir)
      set(subdir "${child}")
    endif()
  endforeach()
  set(${var} ${dir}/${subdir} PARENT_SCOPE)
endfunction()

if(NOT MACOSX_DEPENDENCIES_FROM)
  if(EXISTS /opt/local/bin/port)
    set(MACOSX_DEPENDENCIES_FROM Macports)
  elseif(EXISTS /usr/local/bin/brew)
	  set(MACOSX_DEPENDENCIES_FROM HomebrewLocal)
  elseif(EXISTS /opt/homebrew)
	  set(MACOSX_DEPENDENCIES_FROM HomebrewOpt)
  else()
    set(MACOSX_DEPENDENCIES_FROM None)
    message(WARNING "Could not find Macport or Homebrew to provide dependencies \
		     trying to configure with default search paths")
  endif()
  set(MACOSX_DEPENDENCIES_FROM ${MACOSX_DEPENDENCIES_FROM}
      CACHE STRING "Get dependencies from Macports or HomeBrew")
endif()

if(MACOSX_DEPENDENCIES_FROM STREQUAL "Macports")
  message("-- Using Macports packages from /opt/local")
  set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
      /opt/local/lib)
  set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
      /opt/local/include)
  set(CMAKE_FRAMEWORK_PATH /opt/local/Library/Frameworks)
  if(EXISTS /opt/local/libexec/jpeg)
    set(JPEG_ROOT /opt/local/libexec/jpeg)
  endif()
elseif(MACOSX_DEPENDENCIES_FROM STREQUAL "HomebrewLocal")
  message("-- Using Homebrew packages from /usr/local")
  set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
      /usr/local/lib)
  set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
      /usr/local/include)

  if(IS_DIRECTORY /usr/local/opt/openssl)
    set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
  elseif(IS_DIRECTORY /usr/local/opt/openssl@1.1)
    set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl@1.1")
  else()
    set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
  endif()

  set(LibArchive_ROOT /usr/local/opt/libarchive)
  set(Readline_ROOT /usr/local/opt/readline)
elseif(MACOSX_DEPENDENCIES_FROM STREQUAL "HomebrewOpt")
  message("-- Using Homebrew packages from /opt/homebrew")
  set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
      /opt/homebrew/lib)
  set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
      /opt/homebrew/include)

  # JW: Not sure we need to use the Cellar
  latest_subdir(OPENSSL_ROOT_DIR /opt/homebrew/Cellar/openssl@3/)
  latest_subdir(LibArchive_ROOT /opt/homebrew/Cellar/libarchive)
  latest_subdir(Readline_ROOT /opt/homebrew/Cellar/readline)
elseif(MACOSX_DEPENDENCIES_FROM STREQUAL None)
  message("-- Trying to build without Macports or Homebrew dependencies")
elseif(MACOSX_DEPENDENCIES_FROM MATCHES "/.*")
  message("-- Trying to build with dependencies from ${MACOSX_DEPENDENCIES_FROM}")
  set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
      "${MACOSX_DEPENDENCIES_FROM}/lib")
  set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
      "${MACOSX_DEPENDENCIES_FROM}/include")
  set(CMAKE_IGNORE_PATH
      /opt/local/lib
      /opt/local/include
      /opt/local/bin
      /usr/local/lib
      /usr/local/include
      /usr/local/bin
      /opt/homebrew/lib
      /opt/homebrew/include
      /opt/homebrew/bin)
else()
  message(FATAL_ERROR "Invalid MACOSX_DEPENDENCIES_FROM: ${MACOSX_DEPENDENCIES_FROM}")
endif()

if(BUILD_MACOS_BUNDLE)
  set(MACOS_APP "SWI-Prolog")

  if(MACOS_UNIVERSAL_BINARY)
    set(SWIPL_CPACK_ARCH fat)
  endif()

# These definitions must be here rather than in CPack.cmake as that
# file is loaded after attaching packages/swipl-win and thus isn't picked
# up.  See URL below for the defined variables.
# https://cmake.org/cmake/help/latest/prop_tgt/MACOSX_BUNDLE_INFO_PLIST.html

  set(MACOSX_BUNDLE_BUNDLE_NAME "SWI-Prolog")
  set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${SWIPL_VERSION_STRING}")

  set(X11_ROOT /opt/X11)
  set(Freetype_ROOT /opt/X11)
  set(FontConfig_ROOT /opt/X11)

  find_program(MACOS_DEPLOYQT NAMES macdeployqt)
  if(NOT MACOS_DEPLOYQT)
    find_package(Qt5 COMPONENTS Widgets REQUIRED)

    get_target_property(uic_location Qt5::uic IMPORTED_LOCATION)
    get_filename_component( _dir ${uic_location} DIRECTORY)
    set(MACOS_DEPLOYQT "${_dir}/macdeployqt")
    if(NOT EXISTS ${MACOS_DEPLOYQT})
      message(FATAL_ERROR "Failed to locate macdeployqt executable: [${MACOS_DEPLOYQT}]")
    endif()
  endif()

  set(CPACK_GENERATOR "DragNDrop")

  function(deployqt)
    set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME ZZRuntime)
    install(FILES ${CMAKE_SOURCE_DIR}/man/macosx/SWIapp.html
	    DESTINATION .
	    RENAME Readme.html)
    install(FILES ${CMAKE_SOURCE_DIR}/man/macosx/License.html
	    DESTINATION .)

    install(CODE "set(deployqt \"${MACOS_DEPLOYQT}\")
                  set(fixup_script \"${CMAKE_SOURCE_DIR}/scripts/macosx_bundle_fixup.sh\")
                 ")
    install(CODE [===[
      execute_process(COMMAND ln -sf SWI-Prolog swipl-win
		      WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/SWI-Prolog.app/Contents/MacOS)
      message("Deploying Qt to ${CMAKE_INSTALL_PREFIX}/SWI-Prolog.app")
      execute_process(COMMAND "${deployqt}"
		      "${CMAKE_INSTALL_PREFIX}/SWI-Prolog.app")
      file(WRITE "${CMAKE_INSTALL_PREFIX}/SWI-Prolog.app/Contents/swipl.home" "swipl\n")

      message("Adding dependencies for modules to bundle")
      execute_process(COMMAND ${fixup_script} "${CMAKE_INSTALL_PREFIX}/SWI-Prolog.app")
    ]===])
  endfunction()

  deployqt()
endif()

set(CMAKE_MACOSX_RPATH ON)

# Prefer sem_open() over deprecated sem_init()
set(USE_SEM_OPEN 1)
set(SO_PATH DYLD_LIBRARY_PATH)

endif(APPLE)

repository: SWI-Prolog/swipl-devel

repo_name: SWI-Prolog/swipl-devel

gha_language: C