text:
DESCRIPTION = "Configuration files for WiFi on Tegra platforms"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "\
    file://tegra-wifi.rules \
"

COMPATIBLE_MACHINE = "tegra"

S = "${WORKDIR}"

do_install() {
    if [ -s ${S}/tegra-wifi.rules ]; then
	install -d ${D}${nonarch_base_libdir}/udev/rules.d
	install -m 0644 ${S}/tegra-wifi.rules ${D}${nonarch_base_libdir}/udev/rules.d/98-tegra-wifi.rules
    fi
}

ALLOW_EMPTY:${PN} = "1"
FILES:${PN} += "${nonarch_base_libdir}/udev/rules.d"
PACKAGE_ARCH = "${MACHINE_ARCH}"

repository: SOL-Space-Operating-Linux/meta-tegra

repo_name: SOL-Space-Operating-Linux/meta-tegra


text:
SUMMARY = "Resin Package Groups"
LICENSE = "Apache-2.0"

PR = "r1"

inherit packagegroup

RESIN_INIT_PACKAGE ?= "resin-init"
RESIN_STAGING_ADDONS = "iozone3 nano"

RDEPENDS_${PN} = " \
    ${@bb.utils.contains('DISTRO_FEATURES', 'resin-staging', '${RESIN_STAGING_ADDONS}', '', d)} \
    ${RESIN_INIT_PACKAGE} \
    linux-firmware-ath9k \
    linux-firmware-ralink \
    linux-firmware-rtl8192cu \
    kernel-modules \
    wireless-tools \
    parted \
    lvm2 \
    openssl \
    dosfstools \
    e2fsprogs \
    connman \
    connman-client \
    btrfs-tools \
    apt \
    rce \
    tar \
    util-linux \
    socat \
    jq curl \
    resin-device-register \
    resin-device-progress \
    resin-device-update \
    resin-btrfs-balance \
    supervisor-init \
    vpn-init \
    bridge-utils \
    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-analyze', '', d)} \
    "

repository: gmacario/meta-resin

license_type: permissive

repo_name: gmacario/meta-resin

branch_name: refs/heads/master

extension: bb


text:
package util

import "time"

var (
	// TimeZoneCST China Standard time zone.
	TimeZoneCST, _ = time.LoadLocation("Asia/Shanghai")
	// TimeFormat time format.
	TimeFormat = "2006/01/02-15:04:05"
)

license: MIT

repository: CSUSTers/csust-got

repo_name: CSUSTers/csust-got

gha_license_id: MIT

gha_language: Go

extension: go


text:
@Article{KAWASAKI1997177,
  title =        "Modeling Spatio-Temporal Patterns Generated byBacillus
                 subtilis",
  journal =      "Journal of Theoretical Biology",
  volume =       "188",
  number =       "2",
  pages =        "177--185",
  year =         "1997",
  note =         "",
  ISSN =         "0022-5193",
  doi =          "http://dx.doi.org/10.1006/jtbi.1997.0462",
  URL =          "http://www.sciencedirect.com/science/article/pii/S0022519397904628",
  author =       "K. Kawasaki and A. Mochizuki and M. Matsushita and T.
                 Umeda and N. Shigesada",
  abstract =     "Colonies of bacteria,Bacillus subtilis, that grow on
                 the surface of thin agar plates show various
                 morphological patterns in response to environmental
                 conditions, such as the nutrient concentration, the
                 solidity of an agar medium and temperature. For
                 instance, the colony pattern shows a dense-branching
                 morphology with a smooth circular envelope (DBM-like)
                 in a nutrient-poor semi-solid agar medium, and it turns
                 to a simple disk-like colony as both the nutrient
                 concentration and the agar's softness increase. These
                 patterns have been shown to involve cell movement
                 inside colonies. In a DBM-like colony, individual cells
                 actively move, particularly in the expanding periphery
                 of the colony, while they become immotile at the inner
                 region of the colony where nutrient is very low. In a
                 disk-like colony, cells are highly active in the whole
                 region of the colony. Based on such experimental
                 observations, we develop a diffusion-reaction model, in
                 which density dependent cell movements are incorporated
                 by the level of nutrient concentration available for
                 the cell. Numerical simulations of the model under
                 different environmental conditions closely reproduce
                 various colony patterns ranging from DBM-like pattern
                 to the homogeneous disk-like one in a unifying manner.
                 The analysis also predicts the growth velocity of a
                 colony as a function of the nutrient concentration.",
}

@Article{doi:10.7566/JPSJ.84.114002,
  author =       "Ryojiro Honda and Jun-ichi Wakita and Makoto Katori",
  title =        "Self-Elongation with Sequential Folding of a Filament
                 of Bacterial Cells",
  journal =      "Journal of the Physical Society of Japan",
  volume =       "84",
  number =       "11",
  pages =        "114002",
  year =         "2015",
  doi =          "10.7566/JPSJ.84.114002",
  URL =          "http://dx.doi.org/10.7566/JPSJ.84.114002",
  eprint =       "http://dx.doi.org/10.7566/JPSJ.84.114002",
}

@Article{PhysRevE.52.5297,
  title =        "Lattice-gas model for collective biological motion",
  author =       "Zolt\'an Csah\'ok and Tam\'as Vicsek",
  journal =      "Phys. Rev. E",
  volume =       "52",
  issue =        "5",
  pages =        "5297--5303",
  numpages =     "0",
  year =         "1995",
  month =        nov,
  publisher =    "American Physical Society",
  doi =          "10.1103/PhysRevE.52.5297",
  URL =          "http://link.aps.org/doi/10.1103/PhysRevE.52.5297",
}

extension: bib


text:
package market

import (
	"github.com/filecoin-project/go-state-types/abi"
	"github.com/filecoin-project/go-state-types/big"
	"github.com/filecoin-project/go-state-types/network"

	"github.com/filecoin-project/specs-actors/actors/builtin"
)

// DealUpdatesInterval is the number of blocks between payouts for deals
const DealUpdatesInterval = builtin.EpochsInDay

// ProvCollateralPercentSupplyNum is the numerator of the percentage of normalized cirulating
// supply that must be covered by provider collateral
var ProvCollateralPercentSupplyNumV0 = big.NewInt(5)
var ProvCollateralPercentSupplyNumV1 = big.NewInt(1)

// ProvCollateralPercentSupplyDenom is the denominator of the percentage of normalized cirulating
// supply that must be covered by provider collateral
var ProvCollateralPercentSupplyDenom = big.NewInt(100)

// Bounds (inclusive) on deal duration
func dealDurationBounds(size abi.PaddedPieceSize) (min abi.ChainEpoch, max abi.ChainEpoch) {
	return abi.ChainEpoch(90 * builtin.EpochsInDay), abi.ChainEpoch(540 * builtin.EpochsInDay) // PARAM_FINISH
}

func dealPricePerEpochBounds(size abi.PaddedPieceSize, duration abi.ChainEpoch) (min abi.TokenAmount, max abi.TokenAmount) {
	return abi.NewTokenAmount(0), builtin.TotalFilecoin // PARAM_FINISH
}

func DealProviderCollateralBounds(pieceSize abi.PaddedPieceSize, verified bool, networkRawPower, networkQAPower, baselinePower abi.StoragePower,
	networkCirculatingSupply abi.TokenAmount, networkVersion network.Version) (min, max abi.TokenAmount) {
	// minimumProviderCollateral = (ProvCollateralPercentSupplyNum / ProvCollateralPercentSupplyDenom) * normalizedCirculatingSupply
	// normalizedCirculatingSupply = FILCirculatingSupply * dealPowerShare
	// dealPowerShare = dealQAPower / max(BaselinePower(t), NetworkQAPower(t), dealQAPower)

	lockTargetNum := big.Mul(ProvCollateralPercentSupplyNumV0, networkCirculatingSupply)
	powerShareNum := dealQAPower(pieceSize, verified)
	powerShareDenom := big.Max(big.Max(networkQAPower, baselinePower), powerShareNum)

	if networkVersion >= network.Version1 {
		lockTargetNum = big.Mul(ProvCollateralPercentSupplyNumV1, networkCirculatingSupply)
		powerShareNum = big.NewIntUnsigned(uint64(pieceSize))
		powerShareDenom = big.Max(big.Max(networkRawPower, baselinePower), powerShareNum)
	}

	lockTargetDenom := ProvCollateralPercentSupplyDenom

	num := big.Mul(lockTargetNum, powerShareNum)
	denom := big.Mul(lockTargetDenom, powerShareDenom)
	minCollateral := big.Div(num, denom)
	return minCollateral, builtin.TotalFilecoin // PARAM_FINISH
}

func DealClientCollateralBounds(pieceSize abi.PaddedPieceSize, duration abi.ChainEpoch) (min abi.TokenAmount, max abi.TokenAmount) {
	return abi.NewTokenAmount(0), builtin.TotalFilecoin // PARAM_FINISH
}

// Penalty to provider deal collateral if the deadline expires before sector commitment.
func collateralPenaltyForDealActivationMissed(providerCollateral abi.TokenAmount) abi.TokenAmount {
	return providerCollateral // PARAM_FINISH
}

// Computes the weight for a deal proposal, which is a function of its size and duration.
func DealWeight(proposal *DealProposal) abi.DealWeight {
	dealDuration := big.NewInt(int64(proposal.Duration()))
	dealSize := big.NewIntUnsigned(uint64(proposal.PieceSize))
	dealSpaceTime := big.Mul(dealDuration, dealSize)
	return dealSpaceTime
}

func dealQAPower(dealSize abi.PaddedPieceSize, verified bool) abi.StoragePower {
	scaledUpQuality := big.Zero() // nolint:ineffassign
	if verified {
		scaledUpQuality = big.Lsh(builtin.VerifiedDealWeightMultiplier, builtin.SectorQualityPrecision)
		scaledUpQuality = big.Div(scaledUpQuality, builtin.QualityBaseMultiplier)
	} else {
		scaledUpQuality = big.Lsh(builtin.DealWeightMultiplier, builtin.SectorQualityPrecision)
		scaledUpQuality = big.Div(scaledUpQuality, builtin.QualityBaseMultiplier)
	}
	scaledUpQAPower := big.Mul(scaledUpQuality, big.NewIntUnsigned(uint64(dealSize)))
	return big.Rsh(scaledUpQAPower, builtin.SectorQualityPrecision)
}


text:
package attributes

import (
	"github.com/ratorx/htmlgo"
)
[[- range .AttributeFuncs ]]

// [[.FuncName]] represents the HTML attribute '[[.AttrName]]'.
func [[.FuncName]](values ...string) htmlgo.Attribute {
	return htmlgo.Attribute{Name: "[[.AttrName]]", Values: values}
}
[[- end ]]

repository: ratorx/htmlgo

repo_name: ratorx/htmlgo


text:
@article{Tan2009Quantum,
 abstract = {We investigate the effects of spontaneously generated interference on the spectrum of quantum fluctuations in phase quadratures of resonant fluorescence emitted from the transition of = 1/2 to = 1/2 of a monochromatically driven four-level atom with antiparallel dipole moments. It is found that the spectrum exhibits obvious characteristics of quantum interference in both cases of weak and strong laser fields. For the Zeeman-degenerate system, strong radiation squeezing in weak atomic excitation can occur at the central frequency of the spectrum, which is quite different from the case without consideration of the interference. Moreover, when we apply an external magnetic field to the atom, we find that the quantum interference can lead to a narrowing spectrum with much stronger squeezing by adjusting the magnetic field strength. These results suggest that the phase-dependent fluorescence spectrum can serve as a probe of the quantum interference effects in a realistic system such as a trapped Hgion or charged quantum dots.},
 author = {Tan, Huatang and Xia, Hongxing and Li, Gaoxiang},
 journal = {Journal of Physics B Atomic},
 keywords = {ab initio calculations;biochemistry;bio-optics;macromolecules;molecular biophysics;oxidation;polymer structure;polymerisation;polymers;solubility},
 number = {12},
 pages = {125502},
 title = {Quantum interference and phase-dependent fluorescence spectrum of a four-level atom with antiparallel dipole moments},
 volume = {42},
 year = {2009}
}

repository: sean-xia/academic-kickstart

repo_name: sean-xia/academic-kickstart


text:
set_source_files_properties( ${CD_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) #DO NOT COMPILE CS FILES
target_link_libraries( ${PROJECT_NAME} ${QT_LIBRARIES} ${OpenCV_LIBS} Utils SignLogger SignTransformer )
set_target_properties( ${PROJECT_NAME} PROPERTIES LINK_FLAGS ${LARGEADDRESSAWARE} )
set_target_properties( ${PROJECT_NAME} PROPERTIES FOLDER Src )
set_target_properties( ${PROJECT_NAME} PROPERTIES VS_KEYWORD Qt4VSv1.0 )
install( TARGETS ${PROJECT_NAME} DESTINATION bin )

repository: lshappylife/snippet-manager

repo_name: lshappylife/snippet-manager

extension: cmake


text:
//
// DISCLAIMER
//
// Copyright 2020 ArangoDB GmbH, Cologne, Germany
//
// 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.
//
// Copyright holder is ArangoDB GmbH, Cologne, Germany
//
// Author Ewout Prangsma
//

package reconcile

import (
	"context"

	backupApi "github.com/arangodb/kube-arangodb/pkg/apis/backup/v1"

	"github.com/arangodb/arangosync-client/client"
	driver "github.com/arangodb/go-driver"
	"github.com/arangodb/go-driver/agency"
	api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
	"github.com/arangodb/kube-arangodb/pkg/util/k8sutil"
	v1 "k8s.io/api/core/v1"
)

// Context provides methods to the reconcile package.
type Context interface {
	// GetAPIObject returns the deployment as k8s object.
	GetAPIObject() k8sutil.APIObject
	// GetSpec returns the current specification of the deployment
	GetSpec() api.DeploymentSpec
	// GetStatus returns the current status of the deployment
	GetStatus() (api.DeploymentStatus, int32)
	// UpdateStatus replaces the status of the deployment with the given status and
	// updates the resources in k8s.
	UpdateStatus(status api.DeploymentStatus, lastVersion int32, force ...bool) error
	// UpdateMember updates the deployment status wrt the given member.
	UpdateMember(member api.MemberStatus) error
	// GetDatabaseClient returns a cached client for the entire database (cluster coordinators or single server),
	// creating one if needed.
	GetDatabaseClient(ctx context.Context) (driver.Client, error)
	// GetServerClient returns a cached client for a specific server.
	GetServerClient(ctx context.Context, group api.ServerGroup, id string) (driver.Client, error)
	// GetAgencyClients returns a client connection for every agency member.
	// If the given predicate is not nil, only agents are included where the given predicate returns true.
	GetAgencyClients(ctx context.Context, predicate func(id string) bool) ([]driver.Connection, error)
	// GetAgency returns a connection to the entire agency.
	GetAgency(ctx context.Context) (agency.Agency, error)
	// GetSyncServerClient returns a cached client for a specific arangosync server.
	GetSyncServerClient(ctx context.Context, group api.ServerGroup, id string) (client.API, error)
	// CreateEvent creates a given event.
	// On error, the error is logged.
	CreateEvent(evt *k8sutil.Event)
	// CreateMember adds a new member to the given group.
	// If ID is non-empty, it will be used, otherwise a new ID is created.
	// Returns ID, error
	CreateMember(group api.ServerGroup, id string) (string, error)
	// DeletePod deletes a pod with given name in the namespace
	// of the deployment. If the pod does not exist, the error is ignored.
	DeletePod(podName string) error
	// DeletePvc deletes a persistent volume claim with given name in the namespace
	// of the deployment. If the pvc does not exist, the error is ignored.
	DeletePvc(pvcName string) error
	// RemovePodFinalizers removes all the finalizers from the Pod with given name in the namespace
	// of the deployment. If the pod does not exist, the error is ignored.
	RemovePodFinalizers(podName string) error
	// GetOwnedPods returns a list of all pods owned by the deployment.
	GetOwnedPods() ([]v1.Pod, error)
	// UpdatePvc update PVC with given name in the namespace
	// of the deployment.
	UpdatePvc(pvc *v1.PersistentVolumeClaim) error
	// GetPvc gets a PVC by the given name, in the samespace of the deployment.
	GetPvc(pvcName string) (*v1.PersistentVolumeClaim, error)
	// GetPv returns PV info about PV with given name.
	GetPv(pvName string) (*v1.PersistentVolume, error)
	// GetTLSKeyfile returns the keyfile encoded TLS certificate+key for
	// the given member.
	GetTLSKeyfile(group api.ServerGroup, member api.MemberStatus) (string, error)
	// DeleteTLSKeyfile removes the Secret containing the TLS keyfile for the given member.
	// If the secret does not exist, the error is ignored.
	DeleteTLSKeyfile(group api.ServerGroup, member api.MemberStatus) error
	// GetTLSCA returns the TLS CA certificate in the secret with given name.
	// Returns: publicKey, privateKey, ownerByDeployment, error
	GetTLSCA(secretName string) (string, string, bool, error)
	// DeleteSecret removes the Secret with given name.
	// If the secret does not exist, the error is ignored.
	DeleteSecret(secretName string) error
	// GetDeploymentHealth returns a copy of the latest known state of cluster health
	GetDeploymentHealth() (driver.ClusterHealth, error)
	// GetShardSyncStatus returns true if all shards are in sync
	GetShardSyncStatus() bool
	// InvalidateSyncStatus resets the sync state to false and triggers an inspection
	InvalidateSyncStatus()
	// DisableScalingCluster disables scaling DBservers and coordinators
	DisableScalingCluster() error
	// EnableScalingCluster enables scaling DBservers and coordinators
	EnableScalingCluster() error
	// GetAgencyData object for key path
	GetAgencyData(ctx context.Context, i interface{}, keyParts ...string) error
	// Renders Pod definition for member
	RenderPodForMember(spec api.DeploymentSpec, status api.DeploymentStatus, memberID string, imageInfo api.ImageInfo) (*v1.Pod, error)
	// SelectImage select currently used image by pod
	SelectImage(spec api.DeploymentSpec, status api.DeploymentStatus) (api.ImageInfo, bool)
	// WithStatusUpdate update status of ArangoDeployment with defined modifier. If action returns True action is taken
	WithStatusUpdate(action func(s *api.DeploymentStatus) bool, force ...bool) error
	// SecretsInterface return secret interface
	SecretsInterface() k8sutil.SecretInterface
	// GetBackup receives information about a backup resource
	GetBackup(backup string) (*backupApi.ArangoBackup, error)
}

repository: iMoses/kube-arangodb

repo_name: iMoses/kube-arangodb


text:
# Copyright (C) 2012 Khem Raj <raj.khem@gmail.com>
# Released under the MIT license (see COPYING.MIT for the terms)

require kmod.inc

DEPENDS += "zlib"
PROVIDES += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
RPROVIDES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
RCONFLICTS_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"
RREPLACES_${PN} += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"

# to force user to remove old module-init-tools and replace them with kmod variants
RCONFLICTS_libkmod2 += "module-init-tools-insmod-static module-init-tools-depmod module-init-tools"

# autotools set prefix to /usr, however we want them in /bin and /sbin
EXTRA_OECONF += " --bindir=${base_bindir} --sbindir=${base_sbindir}"

do_install_append () {
        install -dm755 ${D}${base_bindir}
        install -dm755 ${D}${base_sbindir}
        # add symlinks to kmod
        lnr ${D}${base_bindir}/kmod ${D}${base_bindir}/lsmod
        for tool in insmod rmmod depmod modinfo modprobe; do
                lnr ${D}${base_bindir}/kmod ${D}${base_sbindir}/${tool}
        done
        # configuration directories
        install -dm755 ${D}${base_libdir}/depmod.d
        install -dm755 ${D}${base_libdir}/modprobe.d
        install -dm755 ${D}${sysconfdir}/depmod.d
        install -dm755 ${D}${sysconfdir}/modprobe.d

        # install depmod.d file for search/ dir
        install -Dm644 "${WORKDIR}/depmod-search.conf" "${D}${base_libdir}/depmod.d/search.conf"
}

do_compile_prepend() {
            sed -i 's/ac_pwd=/#ac_pwd=/' config.status ; sed -i "/#ac_pwd=/a\ac_pwd='.'" config.status
}

inherit update-alternatives bash-completion

ALTERNATIVE_PRIORITY = "60"

ALTERNATIVE_kmod = "insmod modprobe rmmod modinfo bin-lsmod lsmod depmod"

ALTERNATIVE_LINK_NAME[insmod] = "${base_sbindir}/insmod"
ALTERNATIVE_LINK_NAME[modprobe] = "${base_sbindir}/modprobe"
ALTERNATIVE_LINK_NAME[rmmod] = "${base_sbindir}/rmmod"
ALTERNATIVE_LINK_NAME[modinfo] = "${base_sbindir}/modinfo"
ALTERNATIVE_LINK_NAME[bin-lsmod] = "${base_bindir}/lsmod"

ALTERNATIVE_LINK_NAME[lsmod] = "${base_sbindir}/lsmod"
ALTERNATIVE_TARGET[lsmod] = "${base_bindir}/lsmod.${BPN}"

ALTERNATIVE_LINK_NAME[depmod] = "${base_sbindir}/depmod"

PACKAGES =+ "libkmod"

FILES_libkmod = "${base_libdir}/libkmod*${SOLIBS} ${libdir}/libkmod*${SOLIBS}"
FILES_${PN} += "${base_libdir}/depmod.d ${base_libdir}/modprobe.d"

repository: meta-debian/meta-debian

repo_name: meta-debian/meta-debian

branch_name: refs/heads/warrior

gha_language: BitBake


text:
@misc{Bernuzzi,
  title = {S. {{Bernuzzi}}},
  file = {/Users/jim/Zotero/storage/WZUIXDIY/index.html},
  howpublished = {https://www.tpi.uni-jena.de/\textasciitilde bernuzzi/index.html}
}

@article{bernuzziModelingCompleteGravitational2015,
  title = {Modeling the {{Complete Gravitational Wave Spectrum}} of {{Neutron Star Mergers}}},
  author = {Bernuzzi, Sebastiano and Dietrich, Tim and Nagar, Alessandro},
  year = {2015},
  month = aug,
  volume = {115},
  pages = {091101},
  publisher = {{American Physical Society}},
  doi = {10.1103/PhysRevLett.115.091101},
  abstract = {In the context of neutron star mergers, we study the gravitational wave spectrum of the merger remnant using numerical relativity simulations. Postmerger spectra are characterized by a main peak frequency f2 related to the particular structure and dynamics of the remnant hot hypermassive neutron star. We show that f2 is correlated with the tidal coupling constant {$\kappa$}T2 that characterizes the binary tidal interactions during the late-inspiral merger. The relation f2({$\kappa$}T2) depends very weakly on the binary total mass, mass ratio, equation of state, and thermal effects. This observation opens up the possibility of developing a model of the gravitational spectrum of every merger unifying the late-inspiral and postmerger descriptions.},
  file = {/Users/jim/Zotero/storage/BISIT4UW/Bernuzzi et al. - 2015 - Modeling the Complete Gravitational Wave Spectrum .pdf;/Users/jim/Zotero/storage/IW4RDKD6/PhysRevLett.115.html},
  journal = {Physical Review Letters},
  number = {9}
}

@article{bernuzziModelingDynamicsTidally2015,
  title = {Modeling the {{Dynamics}} of {{Tidally Interacting Binary Neutron Stars}} up to the {{Merger}}},
  author = {Bernuzzi, Sebastiano and Nagar, Alessandro and Dietrich, Tim and Damour, Thibault},
  year = {2015},
  month = apr,
  volume = {114},
  pages = {161103},
  publisher = {{American Physical Society}},
  doi = {10.1103/PhysRevLett.114.161103},
  abstract = {The data analysis of the gravitational wave signals emitted by coalescing neutron star binaries requires the availability of an accurate analytical representation of the dynamics and waveforms of these systems. We propose an effective-one-body model that describes the general relativistic dynamics of neutron star binaries from the early inspiral up to the merger. Our effective-one-body model incorporates an enhanced attractive tidal potential motivated by recent analytical advances in the post-Newtonian and gravitational self-force description of relativistic tidal interactions. No fitting parameters are introduced for the description of tidal interaction in the late, strong-field dynamics. We compare the model energetics and the gravitational wave phasing with new high-resolution multiorbit numerical relativity simulations of equal-mass configurations with different equations of state. We find agreement within the uncertainty of the numerical data for all configurations. Our model is the first semianalytical model that captures the tidal amplification effects close to merger. It thereby provides the most accurate analytical representation of binary neutron star dynamics and waveforms currently available.},
  file = {/Users/jim/Zotero/storage/K5RFQ8HL/Bernuzzi et al. - 2015 - Modeling the Dynamics of Tidally Interacting Binar.pdf;/Users/jim/Zotero/storage/GAZ9PAR3/PhysRevLett.114.html},
  journal = {Physical Review Letters},
  number = {16}
}

@article{bernuzziNeutronStarMerger2020,
  title = {Neutron {{Star Merger Remnants}}},
  author = {Bernuzzi, Sebastiano},
  year = {2020},
  month = aug,
  abstract = {Binary neutron star mergers observations are a unique way to constrain fundamental physics and astrophysics at the extreme. The interpretation of gravitational-wave events and their electromagnetic counterparts crucially relies on general-relativistic models of the merger remnants. Quantitative models can be obtained only by means of numerical relativity simulations in 3+1 dimensions including detailed input physics for the nuclear matter, electromagnetic and weak interactions. This review summarizes the current understanding of merger remnants focusing on some of the aspects that are relevant for multimessenger observations.},
  archiveprefix = {arXiv},
  eprint = {2004.06419},
  eprinttype = {arxiv},
  file = {/Users/jim/Zotero/storage/LN89VUUE/Bernuzzi - 2020 - Neutron Star Merger Remnants.pdf;/Users/jim/Zotero/storage/4IPCQT27/2004.html},
  journal = {arXiv:2004.06419 [astro-ph, physics:gr-qc]},
  keywords = {Astrophysics - High Energy Astrophysical Phenomena,General Relativity and Quantum Cosmology},
  primaryclass = {astro-ph, physics:gr-qc}
}

repository: JWKennington/colloquia

repo_name: JWKennington/colloquia


text:
DESCRIPTION = "Broadcom Bluetooth patch utility (based on Intel Edison tree)"
SECTION = "connectivity"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://brcm_patchram_plus.c;md5=1428ee036a462b072ab6698573efe80c"

SRC_URI = "file://brcm_patchram_plus.c"
S = "${WORKDIR}/"

do_compile() {
	${CC} -O2 -Wall -o brcm_patchram_plus brcm_patchram_plus.c
}

do_install() {
	install -v -d  ${D}/usr/sbin/
	install -m 0755 brcm_patchram_plus ${D}/usr/sbin/
}

INSANE_SKIP_${PN} = "ldflags"


text:
package payload

type Payload struct {
	header header // payload header
	data   []byte // payload data
}

type header struct {
	size          uint32 // size of payload, without header
	extSize       uint16 // file extension size
	fileExtension string // output file extension
}

func (p *Payload) Size() uint32 {
	return p.header.size
}

func (p *Payload) ExtSize() uint16 {
	return p.header.extSize
}

func (p *Payload) FileExtension() string {
	return p.header.fileExtension
}

func (p *Payload) Data() []byte {
	return p.data
}

branch_name: refs/heads/main


text:
// +build windows

package color

// Apply applies text styling to a string.
// On Windows, this isn't supported for compatibility reasons.
//
// ANSI Color codes in conhost.exe (the default terminal emulator) requires Windows 10 and an explicit call to
// Kernel32.dll!SetConsoleMode with the ENABLE_VIRTUAL_TERMINAL_INPUT flag.
//
// https://docs.microsoft.com/en-us/windows/console/setconsolemode
func (s Style) Apply(str string) string {
	return str
}

repository: TrendingTechnology/go-clout

repo_name: TrendingTechnology/go-clout


text:
LINUX_VERSION_EXTENSION ?= "-adv7511-bistromath"
PV = "${LINUX_VERSION}${LINUX_VERSION_EXTENSION}+git${SRCPV}"

inherit kernel
require recipes-kernel/linux/linux-yocto.inc

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI = " \
    git://github.com/analogdevicesinc/linux.git;protocol=https;branch=2018_R2 \
    file://video.cfg \
    "

DESCRIPTION = "Analog devices kernel"

# FIXME Use upstream defconfig
# KBUILD_DEFCONFIG_zedboard-zynq7-adv7511 = "zynq_xcomm_adv7511_defconfig"
# KCONFIG_MODE_zedboard_zynq7-adv7511 = "--alldefconfig"

LINUX_VERSION = "4.14.0"
LINUX_VERSION_EXTENSION = "-adi"

SRCREV_zedboard-zynq7-adv7511 = "8e15598a78781b4bdd731b1876eb6e38496bbba8"

COMPATIBLE_MACHINE = "zedboard-zynq7-adv7511"


text:
SUMMARY = "Resource monitor that shows usage and stats for processor, memory, disks, network and processes."
HOMEPAGE = "https://github.com/aristocratos/bashtop"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \
                    file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

RDEPENDS_${PN} += "bash grep procps sed gawk lmsensors-sensors"

SRC_URI = "git://github.com/aristocratos/bashtop.git"
SRCREV = "v0.8.29"

S = "${WORKDIR}/git"

do_configuration[noexec] = "1"
do_compile[noexec] = "1"

do_install() {
    # Copy bashtop to ${sbindir} i.e. /usr/sbin
    install -d ${D}${sbindir}
    install -m 0755 ${S}/bashtop ${D}${sbindir}
}

FILES_${PN} += "${sbindir}/bashtop"

repository: sshyran/meta-tn-imx-bsp-TechNexion

repo_name: sshyran/meta-tn-imx-bsp-TechNexion


text:
package responses

import (
	"github.com/nlopes/slack"
	"github.com/perthgophers/puddle/messagerouter"
	"testing"
)

type ResponseTester struct {
	cr messagerouter.CommandRequest
	w  messagerouter.ResponseWriter
}
type CommandRequest struct {
	Username string
	Text     string
	Message  *slack.Msg
}
type TestResponseWriter struct {
	ExpectedMessage string
	ActualMessage   string
}

func (w *TestResponseWriter) Write(text string) error {
	w.ActualMessage = text

	return nil
}

func (w *TestResponseWriter) WriteChannel(errText, errText2 string) error {
	return nil
}

func (w *TestResponseWriter) WriteError(errText string) error {
	return w.Write(":poop: " + errText + " :poop:")
}

func TestPing(t *testing.T) {

	cr := messagerouter.CommandRequest{
		Username: "fakeuser",
		Text:     "!ping",
		Message:  new(slack.Msg),
	}

	w := TestResponseWriter{
		ExpectedMessage: "pong!",
	}

	Ping(&cr, &w)

	if w.ExpectedMessage != w.ActualMessage {
		t.Error(
			"For", "!ping",
			"expected", w.ExpectedMessage,
			"got", w.ActualMessage,
		)
	}
}

repository: perthgophers/puddle

repo_name: perthgophers/puddle


text:
@inproceedings{Harper2009cr,
 abstract = {One of the most significant advances behind World Wide Web (Web) 2.0 is the ability to allow parts of a Web page to be updated independently. This can provide an exciting, interactive experience for sighted users, who are used to dealing with complex visual information. For visually impaired users, however, these pages may be confusing: updates are sometimes not recognised by screen readers, while in other cases they may interrupt the user inappropriately. The SASWAT project aims to develop a model of how sighted users interact with dynamic updates, and use this to identify the most effective ways of presenting updates through an audio information stream. Here, we describe a 'thin slice' through this project, focusing on one form of update --- the auto-suggest list. These provide the user with suggestions for entry into an input text field, updating with each character typed. Experiments with sighted users suggest that the suggestions receive considerable attention, and appear to offer reassurance that the input is reasonable. Suggestions that are further down the list are less likely to be viewed, and receive fewer and shorter fixations than those at the top. We therefore propose an implementation which presents the first 3 suggestions immediately and allows browsing of the rest.
},
 address = {New York, NY, USA},
 author = {Brown, Andy and Jay, Caroline and Harper, Simon},
 booktitle = {W4A '09: Proceedings of the 2009 International Cross-Disciplinary Conference on Web Accessibililty (W4A)},
 doi = {http://dx.doi.org/10.1145/1535654.1535667},
 isbn = {978-1-60558-561-1},
 keywords = {Accessibility,Human Centred Web,SASWAT,Web 2.0},
 month = {apr},
 pages = {58--61},
 publisher = {ACM},
 title = {Audio presentation of auto-suggest lists},
 url = {http://www.simonharper.info/publications/Harper2009cr.pdf},
 year = {2009}
}

repository: sharpic/academic-kickstart

repo_name: sharpic/academic-kickstart


text:
set(OpenCV_HAL_FOUND TRUE)
set(OpenCV_HAL_VERSION "0.0.1")
set(OpenCV_HAL_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/libslow_hal.a")
set(OpenCV_HAL_HEADERS "impl.hpp")
set(OpenCV_HAL_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}")

repository: HENRDS/opencv

repo_name: HENRDS/opencv


text:
package forum

import (
	"database/sql"
	"log"
	"time"

	"github.com/mcbernie/t3-scheduler/db"
)

//Forum - Typo3Forum
type Forum struct {
	forums []forumModel
	dbConn db.Database
}

//Create a new Forum
func Create(dbConnectionString string) Forum {
	return Forum{
		dbConn: db.Create(dbConnectionString),
	}
}

//Run loading data and check database
func (f *Forum) Run() {
	log.Println("Load all Typo3 Forum data from Database")
	f.getForums()

	log.Println("Generate and Make database updates")
	affRows := f.makeUpdates()

	log.Printf("Datbase update Complete! %d affected rows.", affRows)

}

func (f *Forum) makeUpdates() int64 {
	var affectedRows int64
	for _, tF := range f.forums {
		if tF.lastPostUpdated == true || tF.lastTopicUpdated == true {
			for _, updateQuery := range tF.UpdateSQL() {
				affectedRows += f.executeUpdate(updateQuery)
			}
		}
	}

	return affectedRows
}

func (f *Forum) executeUpdate(query string) int64 {
	var affectedRows int64
	f.dbConn.DatabaseOperation(func(d *sql.DB) interface{} {
		res, err := d.Exec(query)

		if err != nil {
			panic(err.Error())
		}
		affectedRows, err = res.RowsAffected()
		return true
	})
	return affectedRows
}

func (f *Forum) getForums() {
	f.dbConn.DatabaseOperation(func(d *sql.DB) interface{} {
		rows, err := d.Query(
			"select uid, pid, forum, title, description, topics, topic_count, post_count," +
				"last_topic, last_post, tstamp, crdate, deleted, hidden from tx_typo3forum_domain_model_forum_forum")

		if err != nil {
			panic(err.Error())
		}

		for rows.Next() {
			var tF forumModel
			if err := rows.Scan(
				&tF.uid,
				&tF.pid,
				&tF.parentForumID,
				&tF.title, &tF.description,
				&tF.topicsCnt, &tF.topicCount, &tF.postCount,
				&tF.rawLastTopic, &tF.rawLastPost,
				&tF.rawTstamp, &tF.rawCrdate, &tF.deleted, &tF.hidden); err != nil {
				log.Fatal(err)
			}

			tF.crdate = time.Unix(tF.rawCrdate, 0)
			tF.tstamp = time.Unix(tF.rawTstamp, 0)

			tF.loadTopics(d)

			if found, updated := tF.loadLastPost(); updated == true {
				if found == false {
					log.Printf("Forum Check: last Post for Forum (%d) not found and updated!", tF.uid)
				} else {
					log.Printf("Forum Check: last Post (%d) for Forum (%d) updated!", tF.rawLastPost, tF.uid)
				}
			}

			if found, updated := tF.loadLastTopic(); updated == true {
				if found == false {
					log.Printf("Forum Check: last Topic for Forum (%d) not found and updated!", tF.uid)
				} else {
					log.Printf("Forum Check: last Topic (%d) for Forum (%d) updated!", tF.rawLastTopic, tF.uid)
				}
			}

			f.forums = append(f.forums, tF)
		}
		return true
	})

}


text:
# FIXME, consider using kernel staging directory instead of KERNEL_SOURCE which is
# located in the work directory.  see modules.bbclass

SECTION = "x11/base"
PR = "r3"
LICENSE = "MIT"

SRC_URI = "${FREEDESKTOP_CVS}/dri;module=drm;method=pserver \
	file://make.patch"

inherit module-base

PV = "0.0+cvs${SRCDATE}"
S = "${WORKDIR}/drm"

do_compile() {
        unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
	oe_runmake -C linux-core LINUXDIR="${KERNEL_SOURCE}" MAKE="make -e" CC="${KERNEL_CC}" LD="${KERNEL_LD}"
}

do_install() {
	install -d ${D}${base_libdir}/modules/${KERNEL_VERSION}/drm
	cd linux-core
	for i in *.ko; do install -m 0644 $i ${D}${base_libdir}/modules/${KERNEL_VERSION}/drm/; done
}

PACKAGES_DYNAMIC = "drm-module-*"

python populate_packages_prepend () {
	root = bb.data.expand('/lib/modules/${KERNEL_VERSION}/drm', d)

        do_split_packages(d, root, '^(.*)\.ko$',
			   output_pattern='drm-module-%s',
			   description='DRM driver module for %s',
			   extra_depends='')
}

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
package main

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"github.com/gocolly/colly"
)

// Userprofile store twitter user data
type Userprofile struct {
	FullName string
	UserName string
	AccountVerified string
	Bio string
	Location string
	Website string
	JoinDate string
	Tweets string
	Following string
	Followers string
	Likes string
	Lists string
	Moments string
}

var (
	tempuserprofile = Userprofile{};
)
func main() {
	// Instantiate default collector
	c := colly.NewCollector(
		// Cache responses to prevent multiple download of pages
		// even if the collector is restarted
		//colly.CacheDir("./cache"),
	)

	userprofiles := make([]Userprofile, 0, 1000)
	// On ProfileHeaderCard class
	c.OnHTML(".ProfileHeaderCard", func(e *colly.HTMLElement) {
			tempuserprofile.FullName = e.ChildText(".ProfileHeaderCard-nameLink")
      tempuserprofile.UserName = e.ChildText(".ProfileHeaderCard-screenname")
			tempuserprofile.AccountVerified = e.ChildText("div#page-container > div:nth-of-type(2) > div > div > div > div > div > div > div > h1 > span > a > span > span")
			tempuserprofile.Bio = e.ChildText(".ProfileHeaderCard-bio")
			tempuserprofile.Location = e.ChildText(".ProfileHeaderCard-locationText")
			tempuserprofile.Website = e.ChildText("div.ProfileHeaderCard-url")
			tempuserprofile.JoinDate = e.ChildAttr(".ProfileHeaderCard-joinDateText","title")
	})

		c.OnHTML("div.ProfileNav", func(e *colly.HTMLElement) {
			tempuserprofile.Tweets = e.ChildAttr("ul.ProfileNav-list > li.ProfileNav-item--tweets > a > span:nth-of-type(3)","data-count")
			if tempuserprofile.Tweets == "" {
				tempuserprofile.Tweets = "No Tweets found"
			}
			tempuserprofile.Following = e.ChildAttr("ul.ProfileNav-list > li.ProfileNav-item--following > a > span:nth-of-type(3)","data-count")
			if tempuserprofile.Following == "" {
				tempuserprofile.Following = "No Following found"
			}
			tempuserprofile.Followers = e.ChildAttr("ul.ProfileNav-list > li.ProfileNav-item--followers > a > span:nth-of-type(3)","data-count")
			if tempuserprofile.Followers == "" {
				tempuserprofile.Followers = "No Followers found"
			}
			tempuserprofile.Likes = e.ChildAttr("ul.ProfileNav-list > li.ProfileNav-item--favorites > a > span:nth-of-type(3)","data-count")
			if tempuserprofile.Likes == "" {
				tempuserprofile.Likes = "No Likes found"
			}
			tempuserprofile.Lists = e.ChildText("ul.ProfileNav-list > li.ProfileNav-item--lists > a > span:nth-of-type(3)")
			if tempuserprofile.Lists == "" {
				tempuserprofile.Lists = "No Lists found"
			}
			tempuserprofile.Moments = e.ChildText("ul.ProfileNav-list > li.ProfileNav-item--moments > a > span:nth-of-type(3)")
			if tempuserprofile.Moments == "" {
				tempuserprofile.Moments = "No Moments found"
			}
			userprofiles = append(userprofiles, tempuserprofile)
			fmt.Println(tempuserprofile)
			//more url here
			//c.Visit("https://twitter.com/" + "bharatsewani199")

})

	// Start scraping on https://twitter.com/BetaList
	c.Visit("https://twitter.com/" + "bharatsewani199")
	//c.Visit("https://twitter.com/BetaList")

	// Convert results to JSON data if the scraping job has finished
	jsonData, err := json.MarshalIndent(userprofiles, "", "  ")
	if err != nil {
		panic(err)
	}

	// Dump json to the standard output (can be redirected to a file)
	fmt.Println(string(jsonData))
	err = ioutil.WriteFile("output.json", jsonData, 0644)
}


text:
@article{hall2013,
  author  = {Bill Hall and James Jones and Mark Tood},
  title   = {A Good article},
  journal = {Computer},
  volume  = {280},
  number  = {10},
  pages   = {1-100},
  year    = {2013}
}

@misc{latex,
  author       = {Somenone},
  title        = {LaTex - A documment preparation systeam},
  howpublished = {http://www.latex-project.org/},
  year         = {2015}
}

@book{smith2012,
  author    = {Tom Smith},
  pages     = {500},
  editor    = {Someone},
  location  = {City, State},
  title     = {A Super Book},
  publisher = {PubCo},
  year      = {2012}
}


text:
package libwallet

import (
	"crypto/sha256"
	"testing"

	"github.com/btcsuite/btcd/btcec"
	"github.com/btcsuite/btcd/chaincfg"
)

const (
	// m
	vector1PrivKey = "xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi"
	vector1PubKey  = "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8"

	vector1FirstPath = "m/0'/1"
	vector1FirstPriv = "xprv9wTYmMFdV23N2TdNG573QoEsfRrWKQgWeibmLntzniatZvR9BmLnvSxqu53Kw1UmYPxLgboyZQaXwTCg8MSY3H2EU4pWcQDnRnrVA1xe8fs"
	vector1FirstPub  = "xpub6ASuArnXKPbfEwhqN6e3mwBcDTgzisQN1wXN9BJcM47sSikHjJf3UFHKkNAWbWMiGj7Wf5uMash7SyYq527Hqck2AxYysAA7xmALppuCkwQ"

	vector1SecondPath = "m/0'/1/2'/2"
	vector1SecondPriv = "xprvA2JDeKCSNNZky6uBCviVfJSKyQ1mDYahRjijr5idH2WwLsEd4Hsb2Tyh8RfQMuPh7f7RtyzTtdrbdqqsunu5Mm3wDvUAKRHSC34sJ7in334"
	vector1SecondPub  = "xpub6FHa3pjLCk84BayeJxFW2SP4XRrFd1JYnxeLeU8EqN3vDfZmbqBqaGJAyiLjTAwm6ZLRQUMv1ZACTj37sR62cfN7fe5JnJ7dh8zL4fiyLHV"

	vector2PrivKey = "xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U"
	vector2PubKey  = "xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB"

	vector2FirstPath = "m/0"
	vector2FirstPriv = "xprv9vHkqa6EV4sPZHYqZznhT2NPtPCjKuDKGY38FBWLvgaDx45zo9WQRUT3dKYnjwih2yJD9mkrocEZXo1ex8G81dwSM1fwqWpWkeS3v86pgKt"
	vector2FirstPub  = "xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH"

	vector2SecondPath = "m/0/2147483647'/1"
	vector2SecondPriv = "xprv9zFnWC6h2cLgpmSA46vutJzBcfJ8yaJGg8cX1e5StJh45BBciYTRXSd25UEPVuesF9yog62tGAQtHjXajPPdbRCHuWS6T8XA2ECKADdw4Ef"
	vector2SecondPub  = "xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon"

	vector2ThirdPath = "m/0/2147483647'/1/2147483646'"
	vector2ThirdPriv = "xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc"
	vector2ThirdPub  = "xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL"

	vector3PrivKey = "xprv9s21ZrQH143K25QhxbucbDDuQ4naNntJRi4KUfWT7xo4EKsHt2QJDu7KXp1A3u7Bi1j8ph3EGsZ9Xvz9dGuVrtHHs7pXeTzjuxBrCmmhgC6"
	vector3PubKey  = "xpub661MyMwAqRbcEZVB4dScxMAdx6d4nFc9nvyvH3v4gJL378CSRZiYmhRoP7mBy6gSPSCYk6SzXPTf3ND1cZAceL7SfJ1Z3GC8vBgp2epUt13"

	vector3FirstPath = "m/0'"
	vector3FirstPriv = "xprv9uPDJpEQgRQfDcW7BkF7eTya6RPxXeJCqCJGHuCJ4GiRVLzkTXBAJMu2qaMWPrS7AANYqdq6vcBcBUdJCVVFceUvJFjaPdGZ2y9WACViL4L"
	vector3FirstPub  = "xpub68NZiKmJWnxxS6aaHmn81bvJeTESw724CRDs6HbuccFQN9Ku14VQrADWgqbhhTHBaohPX4CjNLf9fq9MYo6oDaPPLPxSb7gwQN3ih19Zm4Y"

	symmetricPrivKey = "xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U"
	symmetricPubKey  = "xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB"

	symmetricFirstPath = "m/0"
	symmetricFirstPriv = "xprv9vHkqa6EV4sPZHYqZznhT2NPtPCjKuDKGY38FBWLvgaDx45zo9WQRUT3dKYnjwih2yJD9mkrocEZXo1ex8G81dwSM1fwqWpWkeS3v86pgKt"
	symmetricFirstPub  = "xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH"

	symmetricSecondPath = "m/0/2147483647'/1"
	symmetricSecondPriv = "xprv9zFnWC6h2cLgpmSA46vutJzBcfJ8yaJGg8cX1e5StJh45BBciYTRXSd25UEPVuesF9yog62tGAQtHjXajPPdbRCHuWS6T8XA2ECKADdw4Ef"
	symmetricSecondPub  = "xpub6DF8uhdarytz3FWdA8TvFSvvAh8dP3283MY7p2V4SeE2wyWmG5mg5EwVvmdMVCQcoNJxGoWaU9DCWh89LojfZ537wTfunKau47EL2dhHKon"

	symmetricThirdPath = "m/0/2147483647'/1/2147483646'"
	symmetricThirdPriv = "xprvA1RpRA33e1JQ7ifknakTFpgNXPmW2YvmhqLQYMmrj4xJXXWYpDPS3xz7iAxn8L39njGVyuoseXzU6rcxFLJ8HFsTjSyQbLYnMpCqE2VbFWc"
	symmetricThirdPub  = "xpub6ERApfZwUNrhLCkDtcHTcxd75RbzS1ed54G1LkBUHQVHQKqhMkhgbmJbZRkrgZw4koxb5JaHWkY4ALHY2grBGRjaDMzQLcgJvLJuZZvRcEL"
)

var (
	network = Regtest()
)

func TestNewHDPrivateKeySerialization(t *testing.T) {

	t.Run("bad key generation", func(t *testing.T) {
		badKey, err := NewHDPrivateKey(randomBytes(1), network)
		if badKey != nil || err == nil {
			t.Errorf("keys with only 1 byte should return error, got %v, %v", badKey, err)
		}
	})

	t.Run("invalid key deserialization", func(t *testing.T) {
		badKey, err := NewHDPrivateKeyFromString("fooo", "m", Regtest())
		if badKey != nil || err == nil {
			t.Errorf("bad key should only return error returned %v, %v", badKey, err)
		}

		badKey, err = NewHDPrivateKeyFromString(vector1FirstPub, "m", Regtest())
		if badKey != nil || err == nil {
			t.Errorf("expected failure when parsing pub key as priv key, got %v, %v", badKey, err)
		}

		badPubKey, err := NewHDPublicKeyFromString(vector1FirstPriv, "m", Regtest())
		if badPubKey != nil || err == nil {
			t.Errorf("expected failure when parsing priv key as pub key, got %v, %v", badPubKey, err)
		}
	})

	t.Run("test regtest address serialization", func(t *testing.T) {
		// Create a new key and set regtest as chain
		randomKey, _ := NewHDPrivateKey(randomBytes(16), network)
		randomKey.key.SetNet(&chaincfg.RegressionNetParams)

		// Parsing it should fail since we check we know the chain
		key, err := NewHDPrivateKeyFromString(randomKey.String(), "m", Regtest())
		if key == nil || err != nil {
			t.Errorf("failed to parse regtest key, got err %v", err)
		}
	})

	t.Run("Random key serialization", func(t *testing.T) {
		seed := randomBytes(16)
		randomKey, err := NewHDPrivateKey(seed, network)
		if err != nil {
			t.Fatalf("couldn't generate priv key")
		}

		serialized := randomKey.String()
		deserialized, err := NewHDPrivateKeyFromString(serialized, "m", Regtest())
		if err != nil {
			t.Fatalf("failed to deserialize key")
		}

		if serialized != deserialized.String() {
			t.Errorf("keys are different")
		}
	})

	t.Run("Child key serialization", func(t *testing.T) {
		root, err := NewHDPrivateKeyFromString(
			"tprv8ZgxMBicQKsPdGCzsJ31BsQnFL1TSQ82dfsZYTtsWJ1T8g7xTfnV19gf8nYPqzkzk6yLL9kzDYshmUrYyXt7uXsGbk9eN7juRxg9sjaxSjn", "m", Regtest())
		if err != nil {
			t.Fatalf("failed to parse root key")
		}

		key1, _ := root.DerivedAt(1, true)
		key2, _ := key1.DerivedAt(1, true)

		const encodedKey = "tprv8e8vMhwEcLr1ZfZETKTQSpxJ6KfZuczALe8KrRCDLpSbXPwp7PY1ZVHtqUkFsYZETPRcfjVSCv8DiYP9RyAZrFhnLE8aYdaSaZEWyT5c8Ji"
		if key2.String() != encodedKey {
			t.Fatalf("derived key doesn't match serialized")
		}

		decodedKey, _ := NewHDPrivateKeyFromString(encodedKey, "m", Regtest())

		if decodedKey.String() != encodedKey {
			t.Fatalf("decoded key doesn't match encoded string")
		}

	})
}

// These tests are based on the test vectors in BIP 32
// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#test-vectors
func TestKeyDerivation(t *testing.T) {

	testPath := func(t *testing.T, privKey *HDPrivateKey, path, priv, pub string) {
		key, _ := privKey.DeriveTo(path)
		if key.String() != priv {
			t.Errorf("%v priv doesn't match", path)
		}

		if key.PublicKey().String() != pub {
			t.Errorf("%v pub doesn't match", path)
		}
	}

	t.Run("vector1", func(t *testing.T) {
		privKey, _ := NewHDPrivateKeyFromString(vector1PrivKey, "m", Regtest())
		if privKey.PublicKey().String() != vector1PubKey {
			t.Errorf("pub key doesnt match")
		}

		testPath(t, privKey, vector1FirstPath, vector1FirstPriv, vector1FirstPub)
		testPath(t, privKey, vector1SecondPath, vector1SecondPriv, vector1SecondPub)
	})

	t.Run("vector2", func(t *testing.T) {
		privKey, _ := NewHDPrivateKeyFromString(vector2PrivKey, "m", Regtest())
		if privKey.PublicKey().String() != vector2PubKey {
			t.Errorf("pub key doesnt match")
		}

		testPath(t, privKey, vector2FirstPath, vector2FirstPriv, vector2FirstPub)
		testPath(t, privKey, vector2SecondPath, vector2SecondPriv, vector2SecondPub)
		testPath(t, privKey, vector2ThirdPath, vector2ThirdPriv, vector2ThirdPub)
	})

	t.Run("vector3", func(t *testing.T) {
		privKey, _ := NewHDPrivateKeyFromString(vector3PrivKey, "m", Regtest())
		if privKey.PublicKey().String() != vector3PubKey {
			t.Errorf("pub key doesnt match")
		}

		testPath(t, privKey, vector3FirstPath, vector3FirstPriv, vector3FirstPub)
	})
}

func TestSymmetricDerivation(t *testing.T) {

	privKey, _ := NewHDPrivateKeyFromString(symmetricPrivKey, "m", Regtest())
	pubKey := privKey.PublicKey()

	t.Run("basic check", func(t *testing.T) {
		if pubKey.String() != symmetricPubKey {
			t.Fatalf("pub key doesn't match")
		}
	})

	t.Run("first path", func(t *testing.T) {
		newPriv, _ := privKey.DeriveTo(symmetricFirstPath)
		if newPriv.String() != symmetricFirstPriv {
			t.Errorf("priv key doesn't match")
		}

		if newPriv.PublicKey().String() != symmetricFirstPub {
			t.Errorf("pub key doesn't match")
		}

		newPub, _ := pubKey.DeriveTo(symmetricFirstPath)
		if newPub.String() != newPriv.PublicKey().String() {
			t.Errorf("extracted and derived pub key don't match")
		}
	})

	t.Run("second path", func(t *testing.T) {
		newPriv, _ := privKey.DeriveTo(symmetricSecondPath)
		if newPriv.String() != symmetricSecondPriv {
			t.Errorf("priv key doesn't match")
		}

		if newPriv.PublicKey().String() != symmetricSecondPub {
			t.Errorf("pub key doesn't match")
		}

		hPriv, _ := privKey.DeriveTo("m/0/2147483647'")
		newPub, _ := hPriv.PublicKey().DeriveTo(symmetricSecondPath)
		if newPub.String() != newPriv.PublicKey().String() {
			t.Errorf("extracted and derived pub key don't match")
		}
	})

	t.Run("third path", func(t *testing.T) {
		newPriv, _ := privKey.DeriveTo(symmetricThirdPath)
		if newPriv.String() != symmetricThirdPriv {
			t.Errorf("priv key doesn't match")
		}

		if newPriv.PublicKey().String() != symmetricThirdPub {
			t.Errorf("pub key doesn't match")
		}
	})

	testBadDerivation := func(t *testing.T, path string) {
		privKey, _ := NewHDPrivateKeyFromString(vector1PrivKey, "m/123", Regtest())
		pubKey := privKey.PublicKey()

		badKey, err := privKey.DeriveTo(path)
		if badKey != nil || err == nil {
			t.Errorf("derivation should fail got %v, %v", badKey, err)
		}

		badPubKey, err := pubKey.DeriveTo(path)
		if badPubKey != nil || err == nil {
			t.Errorf("derivation should fail got %v, %v", badPubKey, err)
		}
	}

	t.Run("new path is not prefix of old path", func(t *testing.T) {
		testBadDerivation(t, "m/45")
	})

	t.Run("derivation path is invalid", func(t *testing.T) {
		testBadDerivation(t, "m/123/asd45")
	})
}

func TestHDPrivateKeySign(t *testing.T) {
	seed := randomBytes(32)
	privKey, err := NewHDPrivateKey(seed, Regtest())
	if err != nil {
		t.Fatal(err)
	}
	data := []byte("foobar")
	sigBytes, err := privKey.Sign(data)
	if err != nil {
		t.Fatal(err)
	}
	sig, err := btcec.ParseSignature(sigBytes, btcec.S256())
	if err != nil {
		t.Fatal(err)
	}
	pubKey, err := privKey.key.ECPubKey()
	if err != nil {
		t.Fatal(err)
	}
	hash := sha256.Sum256(data)
	if ok := sig.Verify(hash[:], pubKey); !ok {
		t.Fatal(err)
	}
}

repository: muun/apollo

repo_name: muun/apollo

gha_language: Java


text:
package diff

import (
	"bufio"
	"errors"
	"fmt"
	"io"
	"net/http"
	"regexp"
	"strings"
	"unicode"
	"unicode/utf8"

	"github.com/MakeNowJust/heredoc"
	"github.com/cli/cli/v2/api"
	"github.com/cli/cli/v2/internal/browser"
	"github.com/cli/cli/v2/internal/ghinstance"
	"github.com/cli/cli/v2/internal/ghrepo"
	"github.com/cli/cli/v2/internal/text"
	"github.com/cli/cli/v2/pkg/cmd/pr/shared"
	"github.com/cli/cli/v2/pkg/cmdutil"
	"github.com/cli/cli/v2/pkg/iostreams"
	"github.com/spf13/cobra"
	"golang.org/x/text/transform"
)

type DiffOptions struct {
	HttpClient func() (*http.Client, error)
	IO         *iostreams.IOStreams
	Browser    browser.Browser

	Finder shared.PRFinder

	SelectorArg string
	UseColor    bool
	Patch       bool
	NameOnly    bool
	BrowserMode bool
}

func NewCmdDiff(f *cmdutil.Factory, runF func(*DiffOptions) error) *cobra.Command {
	opts := &DiffOptions{
		IO:         f.IOStreams,
		HttpClient: f.HttpClient,
		Browser:    f.Browser,
	}

	var colorFlag string

	cmd := &cobra.Command{
		Use:   "diff [<number> | <url> | <branch>]",
		Short: "View changes in a pull request",
		Long: heredoc.Doc(`
			View changes in a pull request.

			Without an argument, the pull request that belongs to the current branch
			is selected.

			With '--web', open the pull request diff in a web browser instead.
		`),
		Args: cobra.MaximumNArgs(1),
		RunE: func(cmd *cobra.Command, args []string) error {
			opts.Finder = shared.NewFinder(f)

			if repoOverride, _ := cmd.Flags().GetString("repo"); repoOverride != "" && len(args) == 0 {
				return cmdutil.FlagErrorf("argument required when using the `--repo` flag")
			}

			if len(args) > 0 {
				opts.SelectorArg = args[0]
			}

			switch colorFlag {
			case "always":
				opts.UseColor = true
			case "auto":
				opts.UseColor = opts.IO.ColorEnabled()
			case "never":
				opts.UseColor = false
			default:
				return fmt.Errorf("unsupported color %q", colorFlag)
			}

			if runF != nil {
				return runF(opts)
			}
			return diffRun(opts)
		},
	}

	cmdutil.StringEnumFlag(cmd, &colorFlag, "color", "", "auto", []string{"always", "never", "auto"}, "Use color in diff output")
	cmd.Flags().BoolVar(&opts.Patch, "patch", false, "Display diff in patch format")
	cmd.Flags().BoolVar(&opts.NameOnly, "name-only", false, "Display only names of changed files")
	cmd.Flags().BoolVarP(&opts.BrowserMode, "web", "w", false, "Open the pull request diff in the browser")

	return cmd
}

func diffRun(opts *DiffOptions) error {
	findOptions := shared.FindOptions{
		Selector: opts.SelectorArg,
		Fields:   []string{"number"},
	}

	if opts.BrowserMode {
		findOptions.Fields = []string{"url"}
	}

	pr, baseRepo, err := opts.Finder.Find(findOptions)
	if err != nil {
		return err
	}

	if opts.BrowserMode {
		openUrl := fmt.Sprintf("%s/files", pr.URL)
		if opts.IO.IsStdoutTTY() {
			fmt.Fprintf(opts.IO.ErrOut, "Opening %s in your browser.\n", text.DisplayURL(openUrl))
		}
		return opts.Browser.Browse(openUrl)
	}

	httpClient, err := opts.HttpClient()
	if err != nil {
		return err
	}

	if opts.NameOnly {
		opts.Patch = false
	}

	diffReadCloser, err := fetchDiff(httpClient, baseRepo, pr.Number, opts.Patch)
	if err != nil {
		return fmt.Errorf("could not find pull request diff: %w", err)
	}
	defer diffReadCloser.Close()

	var diff io.Reader = diffReadCloser
	if opts.IO.IsStdoutTTY() {
		diff = sanitizedReader(diff)
	}

	if err := opts.IO.StartPager(); err == nil {
		defer opts.IO.StopPager()
	} else {
		fmt.Fprintf(opts.IO.ErrOut, "failed to start pager: %v\n", err)
	}

	if opts.NameOnly {
		return changedFilesNames(opts.IO.Out, diff)
	}

	if !opts.UseColor {
		_, err = io.Copy(opts.IO.Out, diff)
		return err
	}

	return colorDiffLines(opts.IO.Out, diff)
}

func fetchDiff(httpClient *http.Client, baseRepo ghrepo.Interface, prNumber int, asPatch bool) (io.ReadCloser, error) {
	url := fmt.Sprintf(
		"%srepos/%s/pulls/%d",
		ghinstance.RESTPrefix(baseRepo.RepoHost()),
		ghrepo.FullName(baseRepo),
		prNumber,
	)
	acceptType := "application/vnd.github.v3.diff"
	if asPatch {
		acceptType = "application/vnd.github.v3.patch"
	}

	req, err := http.NewRequest("GET", url, nil)
	if err != nil {
		return nil, err
	}

	req.Header.Set("Accept", acceptType)

	resp, err := httpClient.Do(req)
	if err != nil {
		return nil, err
	}
	if resp.StatusCode != 200 {
		return nil, api.HandleHTTPError(resp)
	}

	return resp.Body, nil
}

const lineBufferSize = 4096

var (
	colorHeader   = []byte("\x1b[1;38m")
	colorAddition = []byte("\x1b[32m")
	colorRemoval  = []byte("\x1b[31m")
	colorReset    = []byte("\x1b[m")
)

func colorDiffLines(w io.Writer, r io.Reader) error {
	diffLines := bufio.NewReaderSize(r, lineBufferSize)
	wasPrefix := false
	needsReset := false

	for {
		diffLine, isPrefix, err := diffLines.ReadLine()
		if err != nil {
			if errors.Is(err, io.EOF) {
				break
			}
			return fmt.Errorf("error reading pull request diff: %w", err)
		}

		var color []byte
		if !wasPrefix {
			if isHeaderLine(diffLine) {
				color = colorHeader
			} else if isAdditionLine(diffLine) {
				color = colorAddition
			} else if isRemovalLine(diffLine) {
				color = colorRemoval
			}
		}

		if color != nil {
			if _, err := w.Write(color); err != nil {
				return err
			}
			needsReset = true
		}

		if _, err := w.Write(diffLine); err != nil {
			return err
		}

		if !isPrefix {
			if needsReset {
				if _, err := w.Write(colorReset); err != nil {
					return err
				}
				needsReset = false
			}
			if _, err := w.Write([]byte{'\n'}); err != nil {
				return err
			}
		}
		wasPrefix = isPrefix
	}
	return nil
}

var diffHeaderPrefixes = []string{"+++", "---", "diff", "index"}

func isHeaderLine(l []byte) bool {
	dl := string(l)
	for _, p := range diffHeaderPrefixes {
		if strings.HasPrefix(dl, p) {
			return true
		}
	}
	return false
}

func isAdditionLine(l []byte) bool {
	return len(l) > 0 && l[0] == '+'
}

func isRemovalLine(l []byte) bool {
	return len(l) > 0 && l[0] == '-'
}

func changedFilesNames(w io.Writer, r io.Reader) error {
	diff, err := io.ReadAll(r)
	if err != nil {
		return err
	}

	pattern := regexp.MustCompile(`(?:^|\n)diff\s--git.*\sb/(.*)`)
	matches := pattern.FindAllStringSubmatch(string(diff), -1)

	for _, val := range matches {
		name := strings.TrimSpace(val[1])
		if _, err := w.Write([]byte(name + "\n")); err != nil {
			return err
		}
	}

	return nil
}

func sanitizedReader(r io.Reader) io.Reader {
	return transform.NewReader(r, sanitizer{})
}

// sanitizer replaces non-printable characters with their printable representations
type sanitizer struct{ transform.NopResetter }

// Transform implements transform.Transformer.
func (t sanitizer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
	for r, size := rune(0), 0; nSrc < len(src); {
		if r = rune(src[nSrc]); r < utf8.RuneSelf {
			size = 1
		} else if r, size = utf8.DecodeRune(src[nSrc:]); size == 1 && !atEOF && !utf8.FullRune(src[nSrc:]) {
			// Invalid rune.
			err = transform.ErrShortSrc
			break
		}

		if isPrint(r) {
			if nDst+size > len(dst) {
				err = transform.ErrShortDst
				break
			}
			for i := 0; i < size; i++ {
				dst[nDst] = src[nSrc]
				nDst++
				nSrc++
			}
			continue
		} else {
			nSrc += size
		}

		replacement := fmt.Sprintf("\\u{%02x}", r)

		if nDst+len(replacement) > len(dst) {
			err = transform.ErrShortDst
			break
		}

		for _, c := range replacement {
			dst[nDst] = byte(c)
			nDst++
		}
	}
	return
}

// isPrint reports if a rune is safe to be printed to a terminal
func isPrint(r rune) bool {
	return r == '\n' || r == '\r' || r == '\t' || unicode.IsPrint(r)
}

repository: cli/cli

repo_name: cli/cli

branch_name: refs/heads/trunk


text:
package main

import (
	"net/url"
	"path"
	"regexp"
	"strconv"
)

// Build the video api request given the user input.
// User input could be just the video_id or the complete URL.
func getVideoID(input string) (string, error) {
	_, err := strconv.Atoi(input)
	if err == nil { // This is probably just the video_id
		return input, nil
	} else {
		if isTwitchVod(input) { // This is probably a Twitch VOD URL
			u, _ := url.Parse(input)
			videoID, err := strconv.Atoi(path.Base(u.Path))
			if err != nil {
				return "", ErrInvalidVodUrl
			}
			return strconv.Itoa(videoID), nil
		} else {
			return "", ErrInvalidVodUrl
		}
	}
}

// Check if an input URL is a Twitch VOD.
func isTwitchVod(input string) bool {
	re := regexp.MustCompile(`twitch\.tv/videos/[0-9]+`)
	return re.MatchString(input)
}

repository: DennisPing/Twitch-Chat-Downloader

repo_name: DennisPing/Twitch-Chat-Downloader


text:
@article{Kaufman:2011aa,
 author = {Kaufman, Jay S and Harper, Sam and King, Nicholas B},
 bdsk-url-1 = {https://doi.org/10.1016/j.amjmed.2010.11.016},
 date-added = {2020-09-24 17:40:52 -0400},
 date-modified = {2020-09-24 17:40:52 -0400},
 doi = {10.1016/j.amjmed.2010.11.016},
 journal = {Am J Med},
 journal-full = {The American journal of medicine},
 mesh = {Adult; African Americans; Age Distribution; Cardiovascular Diseases; European Continental Ancestry Group; Health Status Disparities; Humans; Middle Aged; Population Surveillance; Prevalence; United States},
 month = {May},
 number = {5},
 pages = {e5-6; reply e7},
 pmid = {21531221},
 pst = {ppublish},
 title = {A more complete picture of higher cardiovascular disease prevalence among blacks compared to whites},
 volume = {124},
 year = {2011}
}


text:
% Encoding: UTF-7
@Article{Patil2001,
  author    = {Mayuresh J. Patil and Dewey H. Hodges and Carlos E. S. Cesnik},
  title     = {Nonlinear Aeroelasticity and Flight Dynamics of High-Altitude Long-Endurance Aircraft},
  journal   = {Journal of Aircraft},
  year      = {2001},
  volume    = {38},
  number    = {1},
  pages     = {88--94},
  month     = {jan},
  doi       = {10.2514/2.2738},
  groups    = {IFASD 2019},
  publisher = {American Institute of Aeronautics and Astronautics ({AIAA})},
}

@InProceedings{Simpson2013,
  author    = {Robert J. Simpson and Rafael Palacios},
  title     = {Numerical aspects of nonlinear flexible aircraft flight dynamics modeling},
  booktitle = {54th {AIAA}/{ASME}/{ASCE}/{AHS}/{ASC} Structures, Structural Dynamics, and Materials Conference},
  year      = {2013},
  month     = {apr},
  publisher = {American Institute of Aeronautics and Astronautics},
  doi       = {10.2514/6.2013-1634},
  groups    = {IFASD 2019},
}

@Article{Jones2015,
  author    = {J. R. Jones and C. E. S. Cesnik},
  title     = {Preliminary flight test correlations of the {X-HALE} aeroelastic experiment},
  journal   = {The Aeronautical Journal},
  year      = {2015},
  volume    = {119},
  number    = {1217},
  pages     = {855--870},
  month     = {jul},
  doi       = {10.1017/s0001924000010952},
  groups    = {IFASD 2019},
  publisher = {Cambridge University Press ({CUP})},
}

@PhdThesis{Jones2017,
  author = {Jessica Renee Jones},
  title  = {Development of a Very Flexible Testbed Aircraft for the Validation of Nonlinear Aeroelastic Codes},
  school = {University of Michigan},
  year   = {2017},
  groups = {IFASD 2019},
}

@InProceedings{Cesnik2011,
  author    = {Carlos Cesnik and Weihua Su},
  title     = {Nonlinear Aeroelastic Simulation of X-{HALE}: a Very Flexible {UAV}},
  booktitle = {49th {AIAA} Aerospace Sciences Meeting including the New Horizons Forum and Aerospace Exposition},
  year      = {2011},
  month     = {jan},
  publisher = {American Institute of Aeronautics and Astronautics},
  doi       = {10.2514/6.2011-1226},
  groups    = {IFASD 2019},
}

@inproceedings{Drela1999,
  doi = {10.2514/6.1999-1394},
  url = {https://doi.org/10.2514/6.1999-1394},
  year = {1999},
  month = apr,
  publisher = {American Institute of Aeronautics and Astronautics},
  author = {Mark Drela},
  title = {Integrated simulation model for preliminary aerodynamic,  structural,  and control-law design of aircraft},
  booktitle = {{40th Structures,  Structural Dynamics,  and Materials Conference and Exhibit}}
}

@PhdThesis{Shearer2006,
  author = {Christopher M. Shearer},
  title  = {Coupled nonlinear flight dynamics, aeroelasticity, and control of very flexible aircraft},
  school = {University of Michigan},
  year   = {2006},
  groups = {IFASD 2019},
}

@Article{Cesnik2012,
  author    = {Carlos E. S. Cesnik and Patrick J. Senatore and Weihua Su and Ella M. Atkins and Christopher M. Shearer},
  title     = {X-{HALE}: A Very Flexible Unmanned Aerial Vehicle for Nonlinear Aeroelastic Tests},
  journal   = {{AIAA} Journal},
  year      = {2012},
  volume    = {50},
  number    = {12},
  pages     = {2820--2833},
  month     = {dec},
  doi       = {10.2514/1.j051392},
  groups    = {IFASD 2019},
  publisher = {American Institute of Aeronautics and Astronautics ({AIAA})},
}

@Article{Cesnik2014,
  author    = {Carlos E. S. Cesnik and Rafael Palacios and Eric Y. Reichenbach},
  title     = {Reexamined Structural Design Procedures for Very Flexible Aircraft},
  journal   = {Journal of Aircraft},
  year      = {2014},
  volume    = {51},
  number    = {5},
  pages     = {1580--1591},
  month     = {sep},
  doi       = {10.2514/1.c032464},
  groups    = {IFASD 2019},
  publisher = {American Institute of Aeronautics and Astronautics ({AIAA})},
}

@Article{Su2011,
  author    = {Weihua Su and Carlos E. S. Cesnik},
  title     = {Dynamic Response of Highly Flexible Flying Wings},
  journal   = {{AIAA} Journal},
  year      = {2011},
  volume    = {49},
  number    = {2},
  pages     = {324--339},
  month     = {feb},
  doi       = {10.2514/1.j050496},
  groups    = {IFASD 2019},
  publisher = {American Institute of Aeronautics and Astronautics ({AIAA})},
}

@InProceedings{Dillsaver2013,
  author    = {Matthew Dillsaver and Carlos E. S. Cesnik and Ilya Kolmanovsky},
  title     = {Trajectory Control of Very Flexible Aircraft with Gust Disturbance},
  booktitle = {{AIAA} Atmospheric Flight Mechanics ({AFM}) Conference},
  year      = {2013},
  month     = {aug},
  publisher = {American Institute of Aeronautics and Astronautics},
  doi       = {10.2514/6.2013-4745},
  groups    = {IFASD 2019},
}

@article{Murua2012a,
author = {Murua, Joseba and Palacios, Rafael and Graham, J. Michael R.},
doi = {10.1016/j.paerosci.2012.06.001},
journal = {Progress in Aerospace Sciences},
month = {nov},
pages = {46--72},
title = {{Applications of the unsteady vortex-lattice method in aircraft aeroelasticity and flight dynamics}},
volume = {55},
year = {2012}
}

@ARTICLE{deskos2019,
       author = {{Deskos}, Georgios and {del Carre}, Alfonso and {Palacios}, Rafael},
        title = "{Assessment of low-altitude atmospheric turbulence models for aircraft aeroelasticity}",
      journal = {arXiv e-prints},
     keywords = {Physics - Fluid Dynamics},
         year = "2019",
        month = "Aug",
          eid = {arXiv:1908.00372},
        pages = {arXiv:1908.00372},
archivePrefix = {arXiv},
       eprint = {1908.00372},
 primaryClass = {physics.flu-dyn},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2019arXiv190800372D},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@Article{Palacios2010,
  author    = {Rafael Palacios and Joseba Murua and Robert Cook},
  title     = {Structural and Aerodynamic Models in Nonlinear Flight Dynamics of Very Flexible Aircraft},
  journal   = {{AIAA} Journal},
  year      = {2010},
  volume    = {48},
  number    = {11},
  pages     = {2648--2659},
  month     = {nov},
  doi       = {10.2514/1.j050513},
  groups    = {IFASD 2019},
  publisher = {American Institute of Aeronautics and Astronautics ({AIAA})},
}

@InProceedings{Teixeira2018,
  author    = {Patricia Teixeira and Carlos E. S. Cesnik},
  title     = {Propeller Effects on the Dynamic Response of {HALE} Aircraft},
  booktitle = {2018 {AIAA}/{ASCE}/{AHS}/{ASC} Structures, Structural Dynamics, and Materials Conference},
  year      = {2018},
  month     = {jan},
  publisher = {American Institute of Aeronautics and Astronautics},
  doi       = {10.2514/6.2018-1202},
  groups    = {IFASD 2019},
}

@Article{Cook2013,
  author    = {Robert G. Cook and Rafael Palacios and Paul Goulart},
  title     = {Robust Gust Alleviation and Stabilization of Very Flexible Aircraft},
  journal   = {{AIAA} Journal},
  year      = {2013},
  volume    = {51},
  number    = {2},
  pages     = {330--340},
  month     = {feb},
  doi       = {10.2514/1.j051697},
  publisher = {American Institute of Aeronautics and Astronautics ({AIAA})},
}

@InProceedings{Patil2006,
  author    = {Mayuresh Patil and Dana Taylor},
  title     = {Gust Response of Highly Flexible Aircraft},
  booktitle = {47th AIAA/ASME/ASCE/AHS/ASC Structures, Structural Dynamics, and Materials Conference Newport, Rhode Island},
  year      = {2006},
  month     = {may},
  publisher = {American Institute of Aeronautics and Astronautics},
  doi       = {10.2514/6.2002-1719},
}

@InProceedings{Cesnik2005,
  author    = {Cesnik, Carlos E. S. and Brown, Eric L.},
  title     = {Modelling of High Aspect Ratio Active Flexible Wings for Roll Control},
  booktitle = {43rd Structures, Structural Dynamics, and Material Conference},
  year      = {2002},
  month     = {apr},
  publisher = {American Institute of Aeronautics and Astronautics},
  doi       = {10.2514/6.2006-1638},
  address = {Denver, CO},
}

@article{Hesse2014a,
abstract = {This paper investigates the linearization, using perturbation methods, of the structural deformations in the nonlinear flight dynamic response of aircraft with slender, flexible wings. The starting point is the coupling of a displacement-based geometrically nonlinear flexible-body dynamics formulation with a three-dimensional unsteady vortex lattice method. This is followed by a linearization of the structural degrees of freedom, which are assumed to be small in a body-fixed reference frame. The translations and rotations of that reference frame and their time derivatives, which describe the vehicle flight dynamics, can still be arbitrarily large. The resulting system preserves all couplings between rigid and elastic motions and can be projected onto a few vibration modes of the unconstrained aircraft with geometrically nonlinear static deflections at a trim condition. Equally, the unsteady aerodynamics can be approximated on a fixed lattice defined by the deformed static geometry. Numerical studies on a representative highaltitude long-endurance aircraft are presented to illustrate the approach. The results show an improvement compared to those obtained using the mean-axes approximation. {\textcopyright} 2013 by Henrik Hesse, Rafael Palacios, and Joseba Murua.},
author = {Hesse, Henrik and Palacios, Rafael and Murua, Joseba},
doi = {10.2514/1.J052316},
journal = {AIAA Journal},
month = {mar},
number = {3},
pages = {528--538},
title = {Consistent Structural Linearization in Flexible Aircraft Dynamics with Large Rigid-Body Motion},
volume = {52},
year = {2014}
}

@article{Su2011b,
abstract = {},
author = {Su, Weihua and Cesnik, Carlos E. S.},
doi = {10.1016/j.ijsolstr.2011.04.012},
journal = {International Journal of Solids and Structures},
pages = {2349–-2360},
title = {{Strain-based Geometrically Nonlinear Beam Formulation for Modeling Very Flexible Aircraft}},
url = {http://arc.aiaa.org/doi/10.2514/1.C032477},
volume = {48},
year = {2012}
}

@article{Su2012,
abstract = {A strain-based geometrically nonlinear beam formulation for structural dynamic and aeroelastic analysis of slender beams and wings has been successfully applied to study the coupled nonlinear aeroelasticity and flight dynamics of different very flexible aircraft. As an extension to the solution technique based on the nonlinear finite element developed by the authors, a modal-based approach is discussed in this paper to solve the strain-based nonlinear beam equations. The modal approach is applied to study geometrically nonlinear static and transient problems of constrained and free slender beams, subject to external structural or aero-dynamic excitations. The efficiency of the modal solution is also compared to that of the finite-element approach.},
author = {Su, Weihua and Cesnik, Carlos E. S.},
doi = {10.2514/1.C032477},
isbn = {9781600869372 (ISBN)},
issn = {0021-8669},
journal = {Journal of Aircraft},
number = {3},
pages = {890--903},
title = {{Strain-Based Analysis for Geometrically Nonlinear Beams: A Modal Approach}},
url = {http://arc.aiaa.org/doi/10.2514/1.C032477},
volume = {51},
year = {2012}
}
@article{Su2010,
abstract = {Blended-wing-body (BWB) aircraft with high-aspect-ratio wings is an important configu- ration for high-altitude long-endurance unmanned aerial vehicles (HALE UAV). Recently, Northrop Grumann created a wind tunnel model under the Air Force's High Lift over Drag Active (HiLDA) Wing program to study the aeroelastic characteristics of blended-wing-body for a potential Sensorcraft concept. This paper presents a study on the coupled aeroelastic / flight dynamics stability and response of a BWB aircraft that is modified from the HiLDA experimental model. An effective method is used to model very flexible BWB vehicles based on a low-order aeroelastic formulation that is capable of capturing the important structural nonlinear effects and couplings with the flight dynamics degrees of freedom. A nonlinear strain-based beam finite element formulation is used. Finite-state unsteady subsonic aerodynamic loads are incorporated to be coupled with all lifting surfaces, including the flexible body. Based on the proposed model, body-freedom flutter is studied, and is compared with the flutter results with all or partial rigid-body degrees of freedom constrained. The applicability of wind tunnel aeroelastic results (where the rigid-body motion is limited) is discussed in view of the free flight conditions (with all 6 rigid-body degrees of freedom). Furthermore, effects of structural and aerodynamic nonlinearities as well as wing bending/torsion rigidity coupling on the stability and gust response are also studied in this paper. I.},
author = {Su, Weihua and Cesnik, Carlos E. S.},
doi = {10.2514/1.47317},
isbn = {9781563479731},
issn = {0021-8669},
journal = {Journal of Aircraft},
number = {5},
pages = {1539--1553},
title = {{Nonlinear Aeroelasticity of a Very Flexible Blended-Wing-Body Aircraft}},
url = {http://arc.aiaa.org/doi/10.2514/1.47317},
volume = {47},
year = {2010}
}
@article{Shearer2007,
author = {Shearer, Christopher M. and Cesnik, Carlos E.S.},
doi = {10.2514/1.27606},
isbn = {0021-8669},
issn = {0021-8669},
journal = {Journal of Aircraft},
number = {5},
pages = {1528--1545},
title = {{Nonlinear Flight Dynamics of Very Flexible Aircraft}},
url = {http://arc.aiaa.org/doi/10.2514/1.27606},
volume = {44},
year = {2007}
}
@article{Teixeira2017,
author = {Teixeira, Patr{\'{i}}cia C and Cesnik, Carlos E S},
journal = {International Forum on Aeroelasticity and Structural Dynamics (IFASD)},
keywords = {abstract,aerodynamic propeller effects,aerovironments helios,aircraft,although propeller propulsion is,coupled nonlinear,e,etc,g,long-endurance,of such vehicles for,of the propeller slipstream,on the aeroelastic behavior,particle vortex aerodynamics,present in many high-altitude,s x-hale uas,the effect,university of michigan,very flexible wing},
number = {June},
pages = {1--18},
title = {{Inclusion of Propeller Effects on Aeroelastic Behavior of Very Flexible Aircraft}},
year = {2017}
}

@article{Peters1994,
author = {A. Peters, David and J. Johnson, Mark},
year = {1994},
month = {01},
pages = {1-28},
title = {Finite-state airloads for deformable airfoils on fixed and rotating wings},
volume = {44},
booktitle = {American Society of Mechanical Engineers, Aerospace Division (Publication) AD}
}
@phdthesis{Skujins2012,
address = {Ann Arbor, MI},
author = {Skujins, Torstens},
booktitle = {Aerospace Engineering},
publisher = {University of Michigan},
title = {{Reduced-Order Modeling of Unsteady Aerodynamics Across Multiple Mach Regimes}},
volume = {Ph. D.},
year = {2012}
}

@book{geradin2001,
  title={Flexible multibody dynamics: a finite element approach},
  author={G{\'e}radin, M. and Cardona, A.},
  isbn={9780471489900},
  lccn={00043685},
  year={2001},
  publisher={John Wiley}
}

@phdthesis{Murua2012,
  title={Flexible aircraft dynamics with a geometrically-nonlinear description of the unsteady aerodynamics},
  author={Murua, Joseba},
  year={2012},
  school={Imperial College London}
}

@MISC{eigenweb,
  author = {Ga\"{e}l Guennebaud and Beno\^{i}t Jacob and others},
  title = {Eigen v3},
  howpublished = {http://eigen.tuxfamily.org},
  year = {2010}
 }
 @article{Hesse2016,
  doi = {10.2514/1.g000715},
  url = {https://doi.org/10.2514/1.g000715},
  year = {2016},
  month = apr,
  publisher = {American Institute of Aeronautics and Astronautics ({AIAA})},
  volume = {39},
  number = {4},
  pages = {801--813},
  author = {Henrik Hesse and Rafael Palacios},
  title = {Dynamic Load Alleviation in Wake Vortex Encounters},
  journal = {Journal of Guidance,  Control,  and Dynamics}
 }

@inproceedings{del2019efficient,
  title={Low-Altitude Dynamics of Very Flexible Aircraft},
  author={Del Carre, Alfonso and Palacios, Rafael},
  address={San Diego, California},
  year={2019},
  publisher = {American Institute of Aeronautics and Astronautics},
  doi={10.2514/6.2019-2038},
  crossref={scitech19}
}

@proceedings{scitech19,
  title={{AIAA SciTech 2019 Forum}},
  publisher = {American Institute of Aeronautics and Astronautics},
  venue={San Diego, California},
  year={2019}
}

@article{melin2013tornado,
  title={Tornado},
  author={Melin, Tomas},
  journal={KTH, Stockholm, Sweden, Masters Thesis and continued development. {http://www.flyg.kth.se/divisions/aero/software/tornado}},
  year={2013}
}

@article{Murua2012-2,
author = {Murua, Joseba and Palacios, Rafael and R. Graham, J. Michael},
title = {Assessment of Wake-Tail Interference Effects on the Dynamics of Flexible Aircraft},
journal = {AIAA Journal},
volume = {50},
number = {7},
pages = {1575-1585},
year = {2012},
doi = {10.2514/1.J051543},
URL = {
        https://doi.org/10.2514/1.J051543
},
eprint = {
        https://doi.org/10.2514/1.J051543
}
}

@article{Simpson2013-2,
author = {Simpson, Robert J. S. and Palacios, Rafael and Murua, Joseba},
title = {Induced-Drag Calculations in the Unsteady Vortex Lattice Method},
journal = {AIAA Journal},
volume = {51},
number = {7},
pages = {1775-1779},
year = {2013},
doi = {10.2514/1.J052136},

URL = {
        https://doi.org/10.2514/1.J052136

},
eprint = {
        https://doi.org/10.2514/1.J052136

}
}

@book{Katz2001,
  title={Low-Speed Aerodynamics},
  author={Katz, J. and Plotkin, A.},
  isbn={9781107717428},
  series={{Cambridge Aerospace Series}},
  year={2001},
  publisher={Cambridge University Press}
}

@book{etkin1982dynamics,
  title={Dynamics of flight: stability and control},
  author={Etkin, B.},
  isbn={9780471089360},
  lccn={81013058},
  url={https://books.google.co.uk/books?id=4n5TAAAAMAAJ},
  year={1982},
  publisher={John Wiley \& Sons Australia, Limited}
}

@inbook{DeMarco2007,
author = {Agostino De Marco and Eugene Duke and Jon Berndt},
title = {A General Solution to the Aircraft Trim Problem},
booktitle = {AIAA Modeling and Simulation Technologies Conference and Exhibit},
chapter = {},
year={2007},
pages = {},
doi = {10.2514/6.2007-6703},
URL = {https://arc.aiaa.org/doi/abs/10.2514/6.2007-6703},
eprint = {https://arc.aiaa.org/doi/pdf/10.2514/6.2007-6703}
}

@book{wiener1950,
  title={Extrapolation, interpolation, and smoothing of stationary time series: with engineering applications},
  author={Wiener, Norbert and Mass.) Massachusetts Institute of Technology (Cambridge},
  year={1950},
  publisher={Technology Press}
}

@article{broyden1965class,
  title={A class of methods for solving nonlinear simultaneous equations},
  author={Broyden, Charles G},
  journal={Mathematics of computation},
  volume={19},
  number={92},
  pages={577--593},
  year={1965},
  publisher={JSTOR}
}

@Article{faa,
  title   = {Dynamic Gust Loads - {AC 25.341-1}},
  author={{FAA}},
  journal = {{FAA} Advisory Circular},
  year    = {2014}
}

 @inproceedings{del2019ifasd,
  title={Nonlinear response of a very flexible aircraft under lateal gust},
  author={Del Carre, Alfonso and Teixeira, Patricia, and Cesnik, Carlos E. S. and Palacios, Rafael},
  booktitle={{IFASD 2019 Forum}},
  address={Savannah, Georgia},
  year={2019},
  publisher = {},
  doi={}
}

@Article{vonKarman1948,
  author  = {von K{\'a}rm{\'a}n, Theodore},
  title   = {Progress in the Statistical Theory of Turbulence.},
  journal = {Proceedings of the National Academy of Sciences of the United States of America},
  year    = {1948},
  volume  = {11},
  number  = {34},
  pages   = {530-539},
  issn    = {0027-8424},
}

@article{KaimalEtAl1972,
author = {Kaimal, J. C. and Wyngaard, J. C. and Izumi, Y. and Coté, O. R.},
title = {Spectral characteristics of surface-layer turbulence},
journal = {Quarterly Journal of the Royal Meteorological Society},
volume = {98},
number = {417},
pages = {563-589},
doi = {10.1002/qj.49709841707},
abstract = {Abstract The behaviour of spectra and cospectra of turbulence in the surface layer is described within the framework of similarity theory using wind and temperature fluctuation data obtained in the 1968 AFCRL Kansas experiments. With appropriate normalization, the spectra and cospectra are each reduced to a family of curves which spread out according to z/L at low frequencies but converge to a single universal curve in the inertial subrange. The paper compares these results with data obtained by other investigators over both land and water. Spectral constants for velocity and temperature are determined and the variability in the recent estimates of the constants is discussed. The high-frequency behaviour is consistent with local isotropy. In the inertial subrange, where the spectra fall as n−5/3, the cospectra fall faster: uω and ωθ as n−7/3, and uθ, on the average, as n−5/2. The 4/3 ratio between the transverse and longitudinal spectral levels is observed at wavelengths of the order of the height above ground under unstable conditions and at wavelengths of the order of L/10 under stable conditions. This lower isotropic limit is shown to be governed by the combined effects of shear and buoyancy on small-scale eddies.},
year = {1972}
}

@Article{GonzaleEtAl2018,
  author   = {Jes\'{u}s Gonzalo and Deibi L\'{o}pez and Diego Dom\'{i}nguez and Adri\'{a}n Garc\'{i}a and Alberto Escapa},
  title    = {On the capabilities and limitations of high altitude pseudo-satellites},
  journal  = {Progress in Aerospace Sciences},
  year     = {2018},
  volume   = {98},
  pages    = {37 - 56},
  issn     = {0376-0421},
  doi      = {https://doi.org/10.1016/j.paerosci.2018.03.006},
  abstract = {The idea of self-sustaining air vehicles that excited engineers in the seventies has nowadays become a reality as proved by several initiatives worldwide. High altitude platforms, or Pseudo-satellites (HAPS), are unmanned vehicles that take advantage of weak stratospheric winds and solar energy to operate without interfering with current commercial aviation and with enough endurance to provide long-term services as satellites do. Target applications are communications, Earth observation, positioning and science among others. This paper reviews the major characteristics of stratospheric flight, where airplanes and airships will compete for best performance. The careful analysis of involved technologies and their trends allow budget models to shed light on the capabilities and limitations of each solution. Aerodynamics and aerostatics, structures and materials, propulsion, energy management, thermal control, flight management and ground infrastructures are the critical elements revisited to assess current status and expected short-term evolutions. Stratospheric airplanes require very light wing loading, which has been demonstrated to be feasible but currently limits their payload mass to few tenths of kilograms. On the other hand, airships need to be large and operationally complex but their potential to hover carrying hundreds of kilograms with reasonable power supply make them true pseudo-satellites with enormous commercial interest. This paper provides useful information on the relative importance of the technology evolutions, as well as on the selection of the proper platform for each application or set of payload requirements. The authors envisage prompt availability of both types of HAPS, aerodynamic and aerostatic, providing unprecedented services.},
  keywords = {High altitude platforms, Pseudo-satellite, HAPS, Stratospheric flight, Long endurance, Solar-powered},
}

@article{Maraniello2019,
    title = {State-Space Realizations and Internal Balancing in Potential-Flow Aerodynamics with Arbitrary Kinematics},
    year = {2019},
    journal = {AIAA Journal},
    author = {Maraniello, Salvatore and Palacios, Rafael},
    number = {6},
    pages = {1--14},
    volume = {57},
    url = {https://arc.aiaa.org/doi/10.2514/1.J058153},
    doi = {10.2514/1.J058153},
    issn = {0001-1452}
}

@misc{openfast,
    title = {{NWTC Information Portal (OpenFAST)}},
    author = {{National Wind Technology Center (NWTC)}},
    url = {https://nwtc.nrel.gov/OpenFAST},
    note = {Accessed: 2019-11-25}}

repository: ImperialCollegeLondon/sharpy

repo_name: ImperialCollegeLondon/sharpy

gha_language: Python


text:
/*
Copyright 2011 Google Inc.

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

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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 s3

import (
	"net/http"
	"os"
	"reflect"
	"strings"
	"testing"

	"go4.org/syncutil"
)

var tc *Client

func getTestClient(t *testing.T) bool {
	accessKey := os.Getenv("AWS_ACCESS_KEY_ID")
	secret := os.Getenv("AWS_ACCESS_KEY_SECRET")
	if accessKey == "" || secret == "" {
		t.Logf("Skipping test; no AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY_SECRET set in environment")
		return false
	}
	tc = &Client{
		Auth:      &Auth{AccessKey: accessKey, SecretAccessKey: secret},
		Transport: http.DefaultTransport,
		PutGate:   syncutil.NewGate(5),
	}
	return true
}

func TestBuckets(t *testing.T) {
	if !getTestClient(t) {
		return
	}
	tc.Buckets()
}

func TestParseBuckets(t *testing.T) {
	res := "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<ListAllMyBucketsResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\"><Owner><ID>ownerIDField</ID><DisplayName>bobDisplayName</DisplayName></Owner><Buckets><Bucket><Name>bucketOne</Name><CreationDate>2006-06-21T07:04:31.000Z</CreationDate></Bucket><Bucket><Name>bucketTwo</Name><CreationDate>2006-06-21T07:04:32.000Z</CreationDate></Bucket></Buckets></ListAllMyBucketsResult>"
	buckets, err := parseListAllMyBuckets(strings.NewReader(res))
	if err != nil {
		t.Fatal(err)
	}
	if g, w := len(buckets), 2; g != w {
		t.Errorf("num parsed buckets = %d; want %d", g, w)
	}
	want := []*Bucket{
		{Name: "bucketOne", CreationDate: "2006-06-21T07:04:31.000Z"},
		{Name: "bucketTwo", CreationDate: "2006-06-21T07:04:32.000Z"},
	}
	dump := func(v []*Bucket) {
		for i, b := range v {
			t.Logf("Bucket #%d: %#v", i, b)
		}
	}
	if !reflect.DeepEqual(buckets, want) {
		t.Error("mismatch; GOT:")
		dump(buckets)
		t.Error("WANT:")
		dump(want)
	}
}

func TestValidBucketNames(t *testing.T) {
	m := []struct {
		in   string
		want bool
	}{
		{"myawsbucket", true},
		{"my.aws.bucket", true},
		{"my-aws-bucket.1", true},
		{"my---bucket.1", true},
		{".myawsbucket", false},
		{"-myawsbucket", false},
		{"myawsbucket.", false},
		{"myawsbucket-", false},
		{"my..awsbucket", false},
	}

	for _, bt := range m {
		got := IsValidBucket(bt.in)
		if got != bt.want {
			t.Errorf("func(%q) = %v; want %v", bt.in, got, bt.want)
		}
	}
}

repository: DavidBenko/gateway

repo_name: DavidBenko/gateway

branch_name: refs/heads/develop


text:
@Article{Mohammed_2016,
author={Mohammed, Ali I.
and Gritton, Howard J.
and Tseng, Hua-an
and Bucklin, Mark E.
and Yao, Zhaojie
and Han, Xue},
title={An integrative approach for analyzing hundreds of neurons in task performing mice using wide-field calcium imaging},
journal={Scientific Reports},
year={2016},
month={Feb},
day={08},
publisher={The Author(s) SN  -},
volume={6},
pages={20986 EP  -},
note={Article},
url={https://doi.org/10.1038/srep20986}
}

repository: markbucklin/dissertation-latex

repo_name: markbucklin/dissertation-latex


text:
// Copyright 1999-2021. Plesk International GmbH.

package api

import "github.com/plesk/pleskapp/plesk/internal/types"

type DomainManagement interface {
	CreateDomain(domain string, ipAddresses types.ServerIPAddresses) (*DomainInfo, error)
	AddDomainFeatures(domain string, features []string, isWin bool) error
	RemoveDomain(domain string) error
	GetDomain(domain string) (DomainInfo, error)
	ListDomains() ([]DomainInfo, error)
}

type DomainInfo struct {
	ID             int
	Name           string
	HostingType    string
	ParentDomainID int
	GUID           string
	WWWRoot        string
	Sysuser        string
}

type FTPManagement interface {
	ListDomainFtpUsers(domain string, user types.FtpUser) ([]FTPUserInfo, error)
	CreateFtpUser(domain string, user types.FtpUser) (*FTPUserInfo, error)
	UpdateFtpUser(domain string, user string, userNew types.FtpUser) error
	DeleteFtpUser(domain string, user types.FtpUser) error
}

type FTPUserInfo struct {
	Name           string
	Home           string
	Quota          int
	ParentDomainID int
}

type DatabaseManagement interface {
	ListDatabases() ([]DatabaseInfo, error)
	ListDomainDatabases(domain string) ([]DatabaseInfo, error)
	ListDatabaseServers() ([]DatabaseServerInfo, error)
	CreateDatabase(domain types.Domain, database types.NewDatabase, server types.DatabaseServer) (*DatabaseInfo, error)
	RemoveDatabase(database types.Database) error
	DeployDatabase(database types.Database, dbuser types.DatabaseUser, server types.DatabaseServer, filename string, isWindows bool, sysuser *string) error
}

type DatabaseInfo struct {
	ID               int
	Name             string
	Type             string
	ParentDomainID   int
	DatabaseServerID int
}

type DatabaseServerInfo struct {
	ID        int
	Host      string
	Port      int
	Type      string
	Status    string
	IsDefault bool
	IsLocal   bool
}

type DatabaseUserManagement interface {
	CreateDatabaseUser(database types.Database, dbuser types.NewDatabaseUser) (*DatabaseUserInfo, error)
	RemoveDatabaseUser(dbuser types.DatabaseUser) error
	ListDatabaseUsers(database types.Database) ([]DatabaseUserInfo, error)
}

type DatabaseUserInfo struct {
	ID         int
	Login      string
	DatabaseID int
}

type Authentication interface {
	GetAPIKey(auth Auth) (string, error)
	GetLoginLink(auth Auth) (string, error)
	RemoveAPIKey(auth Auth) (string, error)
}

type Server interface {
	GetInfo() (ServerInfo, error)
	GetIPAddresses() (types.ServerIPAddresses, error)
}

type ServerInfo struct {
	IsWindows bool
	Version   string
}

type AuthClient interface {
	GetIgnoreSsl() bool
}

type Auth interface {
	GetAddress() string
	GetPort() string
	GetIgnoreSsl() bool
	GetIsWindows() bool
	GetAPIKey() *string
	GetLogin() *string
	GetPassword() *string
}

repository: simhaonline/pleskapp

repo_name: simhaonline/pleskapp


text:
#
# base recipe: https://github.com/joelagnel/meta-openembedded/blob/master/\
#	       meta-oe/recipes-support/rng-tools/rng-tools_2.bb
# base branch: master
# base commit: 7fd47b69000367319886af45151581c0ecd88310
#

SUMMARY = "Random number generator daemon"
DESCRIPTION = " rngd is a daemon that runs conditioning tests (from FIPS 140-2,\
		edition of 2002-10-10) on a source of random data, and if that \
		data passes the FIPS test,feeds it back as trusted entropy to the\
		in-kernel entropy pool.  Thus, it increases the amount of true \
		random data the kernel has available."

PR = "r0"
inherit debian-package

LICENSE = "GPL-2.0+"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"

# source format is 3.0 (quilt) but there is no debian patch
DEBIAN_QUILT_PATCHES = ""

inherit autotools

do_install_append() {
	#Create new folders
	install -d ${D}${sysconfdir}
	install -d ${D}${sysconfdir}/default
	install -d ${D}${sysconfdir}/init.d
	install -d ${D}${sysconfdir}/logcheck
	install -d ${D}${sysconfdir}/logcheck/ignore.d.server
	install -d ${D}${sysconfdir}/logcheck/violations.ignore.d

	install -m 0644 ${S}/debian/rng-tools.default 			\
			${D}${sysconfdir}/default/rng-tools

	install -m 0755 ${S}/debian/rng-tools.init 			\
			${D}${sysconfdir}/init.d/rng-tools

	install -m 0644 ${S}/debian/logcheck.ignore 			\
			${D}${sysconfdir}/logcheck/ignore.d.server/rng-tools

	cp ${D}${sysconfdir}/logcheck/ignore.d.server/rng-tools 	\
		${D}${sysconfdir}/logcheck/violations.ignore.d/rng-tools
}

repository: nghiaht-tsdv/meta-debian

repo_name: nghiaht-tsdv/meta-debian

branch_name: refs/heads/jethro


text:
DESCRIPTION = "nose extends the test loading and running features of unittest, \
making it easier to write, find and run tests."
SECTION = "devel/python"
LICENSE = "LGPLv2.1"
LIC_FILES_CHKSUM = "file://lgpl.txt;md5=a6f89e2100d9b6cdffcea4f398e37343"

SRC_URI = "http://pypi.python.org/packages/source/n/nose/nose-${PV}.tar.gz"

SRC_URI[md5sum] = "735e3f1ce8b07e70ee1b742a8a53585a"
SRC_URI[sha256sum] = "2171e9202d118d302d5db1decb52dd862b79e2a626ca19653a6914574a6ca7d9"

S = "${WORKDIR}/nose-${PV}"

inherit distutils

repository: ExorEmbedded/exor-workspace

repo_name: ExorEmbedded/exor-workspace


text:
SUMMARY = "Stalker Middleware Client for enigma2"
LICENSE = "CC-BY-NC-SA-3.0 | DreamProperty"
LIC_FILES_CHKSUM = "file://LICENSE.md;md5=32537e3540aaefc28cb3edf82c2696cf"

GITHUB_PROJECT = "enigma2-plugin-stalkerclient"

SRCREV = "${@opendreambox_srcrev('f07e41cd8086714b84ba0fd6d915d5181b064b1e', d)}"

inherit autotools opendreambox-github

RDEPENDS_${PN} = " \
        python-json \
        python-twisted-web \
"

require enigma2-plugin.inc

repository: opendreambox/opendreambox

repo_name: opendreambox/opendreambox

branch_name: refs/heads/pyro

gha_license_id: NOASSERTION


text:
file(REMOVE_RECURSE
  "CMakeFiles/laz.dir/singleton/classical_singleton.cpp.obj"
  "laz.exe"
  "laz.exe.manifest"
  "laz.pdb"
  "liblaz.dll.a"
)

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


text:
package main

import (
	"fmt"
)

func bubbleSort(array_input []int) {
	swapped := true
	for swapped {
		swapped = false
		for i := 0; i < len(array_input)-1; i++ {
			if array_input[i+1] < array_input[i] {
				Swap(array_input, i, i+1)
				swapped = true
			}
		}
	}
}
func Swap(array_input []int, i, j int) {
	tmp := array_input[j]
	array_input[j] = array_input[i]
	array_input[i] = tmp
}
func main() {

	array_input := []int{1, 6, 2, 4, 9, 0, 5, 3, 7, 8}
	fmt.Println("Unsorted array: ", array_input)
	bubbleSort(array_input)
	fmt.Println("Sorted array: ", array_input)

}

repository: beingfranklin/Go-Algorithms

repo_name: beingfranklin/Go-Algorithms


text:
package dbdiff

import (
	"database/sql"
	"errors"
)

// Get all table name from db
func GetAllTables(db DbHolder, config *Configuration) ([]string, error) {
	var err error
	var tableNames []string
	var rows *sql.Rows
	switch config.Db.DbType {
	case "postgresql":
		rows, err = db.Query("SELECT relname AS TABLE_NAME FROM pg_stat_user_tables ORDER BY TABLE_NAME")
	case "mysql":
		rows, err = db.Query("SELECT TABLE_NAME FROM information_schema.tables WHERE table_schema=database() ORDER BY TABLE_NAME")
	case "mssql":
		rows, err = db.Query("SELECT name AS TABLENAME FROM sys.objects WHERE type = 'U' ORDER BY TABLENAME")
	default:
		rows = nil
		err = errors.New("unsupported dbtype [" + config.Db.DbType + "]")
	}
	if err != nil {
		return []string{}, err
	}

	for rows.Next() {
		var tableName string
		err = rows.Scan(&tableName)
		if err != nil {
			return []string{}, err
		}
		tableNames = append(tableNames, tableName)
	}
	rows.Close()
	return tableNames, nil
}

// Get Primary key information
func GetPksOfTables(db DbHolder, config *Configuration, tableNames []string) (map[string][]string, error) {
	var err error
	schema := config.Db.Schema

	var stmt *sql.Stmt
	switch config.Db.DbType {
	case "postgresql":
		stmt, err = db.Prepare(`
		SELECT
		       kcu.ordinal_position AS PkOrder,
		       ccu.column_name AS ColumnName
		FROM
		     information_schema.table_constraints tb_con
		       INNER JOIN information_schema.constraint_column_usage ccu
		         ON tb_con.constraint_catalog = ccu.constraint_catalog
		              AND tb_con.constraint_schema = ccu.constraint_schema
		              AND tb_con.constraint_name = ccu.constraint_name
		       INNER JOIN information_schema.key_column_usage kcu
		         ON tb_con.constraint_catalog = kcu.constraint_catalog
		              AND tb_con.constraint_schema = kcu.constraint_schema
		              AND tb_con.constraint_name = kcu.constraint_name
		              AND ccu.column_name = kcu.column_name
		WHERE
		     tb_con.table_name = $1
		  AND tb_con.constraint_type = 'PRIMARY KEY'
		ORDER BY
		         tb_con.table_catalog
		    , tb_con.table_name
		    , tb_con.constraint_name
		    , kcu.ordinal_position
		`)
	case "mysql":
		stmt, err = db.Prepare(`
		SELECT
			ORDINAL_POSITION, COLUMN_NAME
		FROM
			information_schema.columns
		WHERE
			table_schema=database()
			AND TABLE_NAME = ?
			AND COLUMN_KEY = 'PRI'
		ORDER BY
			ORDINAL_POSITION
		`)
	case "mssql":
		stmt, err = db.Prepare(`
		SELECT
		       kcu.ordinal_position AS PkOrder,
		       ccu.column_name AS ColumnName
		FROM
		     information_schema.table_constraints tb_con
		       INNER JOIN information_schema.constraint_column_usage ccu
		         ON tb_con.constraint_catalog = ccu.constraint_catalog
		              AND tb_con.constraint_schema = ccu.constraint_schema
		              AND tb_con.constraint_name = ccu.constraint_name
		       INNER JOIN information_schema.key_column_usage kcu
		         ON tb_con.constraint_catalog = kcu.constraint_catalog
		              AND tb_con.constraint_schema = kcu.constraint_schema
		              AND tb_con.constraint_name = kcu.constraint_name
		              AND ccu.column_name = kcu.column_name
		WHERE
		     tb_con.table_name = @p1
		  AND tb_con.constraint_type = 'PRIMARY KEY'
		ORDER BY
		         tb_con.table_catalog
		    , tb_con.table_name
		    , tb_con.constraint_name
		    , kcu.ordinal_position
		`)
	}
	if err != nil || stmt == nil {
		return nil, err
	}
	defer stmt.Close()

	// PK取得(ORDER BYに使う)
	tablePks := make(map[string][]string, len(tableNames))
	for _, tableName := range tableNames {
		rows, err := stmt.Query(tableName)
		if err != nil {
			return nil, err
		}

		var columns []string
		for rows.Next() {
			var order int
			var columnName string
			err = rows.Scan(&order, &columnName)
			if err != nil {
				return nil, err
			}
			columns = append(columns, columnName)
		}
		rows.Close()

		if len(columns) == 0 {
			columns, err = GetAllColumnsOnTable(db, tableName, schema)
			if err != nil {
				return nil, err
			}
		}
		tablePks[tableName] = columns
	}

	return tablePks, nil
}

func GetAllColumnsOnTable(db DbHolder, tableName string, schema string) ([]string, error) {
	var columns []string

	// Pkがないので、対象テーブルの全カラム情報を取得して全カラムPKとみなす
	astQuery, err := db.Query("SELECT * FROM " + schema + tableName + " LIMIT 1")
	if err != nil {
		return nil, err
	}
	defer astQuery.Close()

	for astQuery.Next() {
		cols, err := astQuery.Columns()
		if err != nil {
			return nil, err
		}
		columns = append(columns, cols...)
	}
	return columns, nil
}