text:
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

//go:build all
// +build all

package controllers

import (
	"context"
	"fmt"
	"strings"
	"testing"

	"github.com/Azure/go-autorest/autorest/to"
	"github.com/stretchr/testify/assert"
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/types"

	"github.com/Azure/azure-service-operator/api/v1alpha1"
	"github.com/Azure/azure-service-operator/api/v1beta1"
	"github.com/Azure/azure-service-operator/pkg/helpers"
	"github.com/Azure/azure-service-operator/pkg/resourcemanager/config"
	"github.com/Azure/azure-service-operator/pkg/secrets"
	kvsecrets "github.com/Azure/azure-service-operator/pkg/secrets/keyvault"
)

// NOTE: Tests in this file are intended to be run twice, once in the v1 secret naming mode
// and once in the v2 secret naming mode. In some instances they parallel tests
// which don't assert on secret name or shape.
// The naming of the tests is important! It's how the makefile knows to run just these tests
// in the old V1 mode.
// Not every resource is included here, only resources which for legacy reasons in the old v1
// secret naming mode had secret naming schemes which were different than the standard.

// This test intentionally mirrors TestAppInsightsController in appinsights_controller_test.go but is
// focused on ensuring the shape of the saved secret is correct
func TestAppInsights_SecretNamedCorrectly(t *testing.T) {
	t.Parallel()
	defer PanicRecover(t)
	ctx := context.Background()

	assert := assert.New(t)

	rgName := tc.resourceGroupName
	rgLocation := tc.resourceGroupLocation
	appInsightsName := GenerateTestResourceNameWithRandom("appinsights", 6)

	// Create an instance of Azure AppInsights
	instance := &v1alpha1.AppInsights{
		ObjectMeta: metav1.ObjectMeta{
			Name:      appInsightsName,
			Namespace: "default",
		},
		Spec: v1alpha1.AppInsightsSpec{
			Kind:            "web",
			Location:        rgLocation,
			ResourceGroup:   rgName,
			ApplicationType: "other",
		},
	}

	EnsureInstance(ctx, t, tc, instance)

	// Make sure the secret is created
	var keyName string
	if tc.secretClient.GetSecretNamingVersion() == secrets.SecretNamingV1 {
		keyName = fmt.Sprintf("appinsights-%s-%s", instance.Spec.ResourceGroup, instance.Name)
	} else {
		keyName = instance.Name
	}

	secretKey := secrets.SecretKey{Name: keyName, Namespace: instance.Namespace, Kind: "appinsights"}

	// Secret is created after reconciliation is in provisioned state
	var secret map[string][]byte
	assert.Eventually(func() bool {
		var err error
		secret, err = tc.secretClient.Get(ctx, secretKey)
		return err == nil
	}, tc.timeoutFast, tc.retry, "should be able to get secret")

	assert.NotEmpty(string(secret["instrumentationKey"]))

	EnsureDelete(ctx, t, tc, instance)
}

// This test intentionally mirrors TestStorageAccountController in storage_controller_test.go but is
// focused on ensuring the shape of the saved secret is correct
func TestStorageAccount_SecretNamedCorrectly(t *testing.T) {
	t.Parallel()
	defer PanicRecover(t)
	ctx := context.Background()

	assert := assert.New(t)

	rgName := tc.resourceGroupName
	rgLocation := tc.resourceGroupLocation
	storageName := "storageacct" + helpers.RandomString(6)

	instance := &v1alpha1.StorageAccount{
		ObjectMeta: metav1.ObjectMeta{
			Name:      storageName,
			Namespace: "default",
		},
		Spec: v1alpha1.StorageAccountSpec{
			Kind:          "BlobStorage",
			Location:      rgLocation,
			ResourceGroup: rgName,
			Sku: v1alpha1.StorageAccountSku{
				Name: "Standard_LRS",
			},
			AccessTier:             "Hot",
			EnableHTTPSTrafficOnly: to.BoolPtr(true),
		},
	}

	EnsureInstance(ctx, t, tc, instance)

	// Make sure the secret is created
	var keyName string
	if tc.secretClient.GetSecretNamingVersion() == secrets.SecretNamingV1 {
		keyName = fmt.Sprintf("storageaccount-%s-%s", instance.Spec.ResourceGroup, instance.Name)
	} else {
		keyName = instance.Name
	}
	secretKey := secrets.SecretKey{Name: keyName, Namespace: instance.Namespace, Kind: "storageaccount"}
	secret, err := tc.secretClient.Get(ctx, secretKey)
	assert.NoError(err)

	assert.NotEmpty(string(secret["StorageAccountName"]))
	assert.NotEmpty(string(secret["connectionString0"]))
	assert.NotEmpty(string(secret["key0"]))
	assert.NotEmpty(string(secret["connectionString1"]))
	assert.NotEmpty(string(secret["key1"]))

	EnsureDelete(ctx, t, tc, instance)
}

func assertSQLServerAdminSecretCreated(ctx context.Context, t *testing.T, sqlServerInstance *v1beta1.AzureSqlServer) {
	if len(sqlServerInstance.Spec.KeyVaultToStoreSecrets) == 0 {
		secret := &v1.Secret{}
		assert.Eventually(t, func() bool {
			var expectedServerSecretName string
			if tc.secretClient.GetSecretNamingVersion() == secrets.SecretNamingV1 {
				expectedServerSecretName = sqlServerInstance.Name
			} else {
				expectedServerSecretName = fmt.Sprintf("%s-%s", "azuresqlserver", sqlServerInstance.Name)
			}
			err := tc.k8sClient.Get(ctx, types.NamespacedName{Namespace: sqlServerInstance.Namespace, Name: expectedServerSecretName}, secret)
			if err != nil {
				return false
			}
			return secret.Name == expectedServerSecretName && secret.Namespace == sqlServerInstance.Namespace
		}, tc.timeoutFast, tc.retry, "wait for server to have secret")
	} else {
		// Check that the user's secret is in the keyvault
		keyVaultSecretClient := kvsecrets.New(
			sqlServerInstance.Spec.KeyVaultToStoreSecrets,
			config.GlobalCredentials(),
			config.SecretNamingVersion(),
			config.PurgeDeletedKeyVaultSecrets(),
			config.RecoverSoftDeletedKeyVaultSecrets())

		assert.Eventually(t, func() bool {
			expectedSecretName := makeSQLServerKeyVaultSecretName(sqlServerInstance)
			result, err := keyVaultSecretClient.KeyVaultClient.GetSecret(ctx, kvsecrets.GetVaultsURL(sqlServerInstance.Spec.KeyVaultToStoreSecrets), expectedSecretName, "")
			if err != nil {
				return false
			}
			secrets := *result.Value

			return len(string(secrets)) > 0
		}, tc.timeoutFast, tc.retry, "wait for keyvault to have secret for server")
	}
}

func TestAzureSqlServerAndUser_SecretNamedCorrectly(t *testing.T) {
	t.Parallel()
	defer PanicRecover(t)
	ctx := context.Background()
	assert := assert.New(t)

	// Add any setup steps that needs to be executed before each test
	rgName := tc.resourceGroupName
	sqlServerName := GenerateTestResourceNameWithRandom("sqlserver1", 10)
	rgLocation := "westus3"

	sqlServerNamespacedName := types.NamespacedName{Name: sqlServerName, Namespace: "default"}
	sqlServerInstance := v1beta1.NewAzureSQLServer(sqlServerNamespacedName, rgName, rgLocation)

	// create and wait
	RequireInstance(ctx, t, tc, sqlServerInstance)

	// verify secret exists in k8s for server 1
	assertSQLServerAdminSecretCreated(ctx, t, sqlServerInstance)

	sqlDatabaseName := GenerateTestResourceNameWithRandom("sqldatabase", 10)
	// Create the SqlDatabase object and expect the Reconcile to be created
	sqlDatabaseInstance := &v1beta1.AzureSqlDatabase{
		ObjectMeta: metav1.ObjectMeta{
			Name:      sqlDatabaseName,
			Namespace: "default",
		},
		Spec: v1beta1.AzureSqlDatabaseSpec{
			Location:      rgLocation,
			ResourceGroup: rgName,
			Server:        sqlServerName,
			Edition:       0,
		},
	}

	EnsureInstance(ctx, t, tc, sqlDatabaseInstance)

	// Create firewall rule
	sqlFirewallRuleNamespacedName := types.NamespacedName{
		Name:      GenerateTestResourceNameWithRandom("sqlfwr-local1", 10),
		Namespace: "default",
	}
	sqlFirewallRule := v1beta1.NewAzureSQLFirewallRule(
		sqlFirewallRuleNamespacedName,
		rgName,
		sqlServerName,
		"1.1.1.1",
		"255.255.255.255",
	)
	EnsureInstance(ctx, t, tc, sqlFirewallRule)

	t.Run("sub test for actions", func(t *testing.T) {
		RunSQLActionHappy(t, sqlServerName)
	})

	var sqlUser *v1alpha1.AzureSQLUser
	var kvSqlUser1 *v1alpha1.AzureSQLUser
	var kvSqlUser2 *v1alpha1.AzureSQLUser

	// Run user subtests
	t.Run("group2", func(t *testing.T) {
		t.Run("set up user in db", func(t *testing.T) {
			t.Parallel()

			// create a sql user and verify it provisions
			username := "user1" + helpers.RandomString(10)
			roles := []string{"db_owner"}
			keyVaultSecretFormats := []string{"adonet"}

			sqlUser = &v1alpha1.AzureSQLUser{
				ObjectMeta: metav1.ObjectMeta{
					Name:      username,
					Namespace: "default",
				},
				Spec: v1alpha1.AzureSQLUserSpec{
					Server:                sqlServerName,
					DbName:                sqlDatabaseName,
					ResourceGroup:         rgName,
					Roles:                 roles,
					KeyVaultSecretFormats: keyVaultSecretFormats,
				},
			}

			EnsureInstance(ctx, t, tc, sqlUser)

			// verify user's secret has been created
			// this test suite defaults to Kube Secrets. They do not support keyvault-specific config but the spec is passed anyway
			// to verify that passing them does not break the service
			assert.Eventually(func() bool {
				key := secrets.SecretKey{Name: sqlUser.Name, Namespace: sqlUser.Namespace, Kind: "azuresqluser"}
				secrets, err := tc.secretClient.Get(ctx, key)

				return err == nil && strings.Contains(string(secrets["azureSqlDatabaseName"]), sqlDatabaseName)
			}, tc.timeoutFast, tc.retry, "wait for secret store to show azure sql user credentials")

			t.Log(sqlUser.Status)
		})

		t.Run("set up user in db with custom keyvault", func(t *testing.T) {
			t.Parallel()

			// create a sql user and verify it provisions
			username := "user2" + helpers.RandomString(10)
			roles := []string{"db_owner"}

			// This test will attempt to persist secrets to the KV that was instantiated as part of the test suite
			kvSqlUser1 = &v1alpha1.AzureSQLUser{
				ObjectMeta: metav1.ObjectMeta{
					Name:      username,
					Namespace: "default",
				},
				Spec: v1alpha1.AzureSQLUserSpec{
					Server:                 sqlServerName,
					DbName:                 sqlDatabaseName,
					ResourceGroup:          rgName,
					Roles:                  roles,
					KeyVaultToStoreSecrets: tc.keyvaultName,
				},
			}

			EnsureInstance(ctx, t, tc, kvSqlUser1)

			// Check that the user's secret is in the keyvault
			keyVaultSecretClient := kvsecrets.New(
				tc.keyvaultName,
				config.GlobalCredentials(),
				config.SecretNamingVersion(),
				config.PurgeDeletedKeyVaultSecrets(),
				config.RecoverSoftDeletedKeyVaultSecrets())

			assert.Eventually(func() bool {
				key := makeSQLUserSecretKey(keyVaultSecretClient, kvSqlUser1)
				secrets, _ := keyVaultSecretClient.Get(ctx, key)

				return strings.Contains(string(secrets["azureSqlDatabaseName"]), sqlDatabaseName)
			}, tc.timeoutFast, tc.retry, "wait for keyvault to show azure sql user credentials")

			t.Log(kvSqlUser1.Status)
		})

		t.Run("set up user in db with custom keyvault and custom formatting", func(t *testing.T) {
			t.Parallel()

			// create a sql user and verify it provisions
			username := "user3" + helpers.RandomString(10)
			roles := []string{"db_owner"}
			formats := []string{"adonet"}

			// This test will attempt to persist secrets to the KV that was instantiated as part of the test suite
			kvSqlUser2 = &v1alpha1.AzureSQLUser{
				ObjectMeta: metav1.ObjectMeta{
					Name:      username,
					Namespace: "default",
				},
				Spec: v1alpha1.AzureSQLUserSpec{
					Server:                 sqlServerName,
					DbName:                 sqlDatabaseName,
					ResourceGroup:          rgName,
					Roles:                  roles,
					KeyVaultToStoreSecrets: tc.keyvaultName,
					KeyVaultSecretFormats:  formats,
				},
			}

			EnsureInstance(ctx, t, tc, kvSqlUser2)

			// Check that the user's secret is in the keyvault
			keyVaultSecretClient := kvsecrets.New(
				tc.keyvaultName,
				config.GlobalCredentials(),
				config.SecretNamingVersion(),
				config.PurgeDeletedKeyVaultSecrets(),
				config.RecoverSoftDeletedKeyVaultSecrets())

			assert.Eventually(func() bool {
				key := makeSQLUserSecretKey(keyVaultSecretClient, kvSqlUser2)
				key.Name = key.Name + "-adonet"
				secrets, err := keyVaultSecretClient.Get(ctx, key, secrets.Flatten(true))
				assert.NoError(err)

				return len(string(secrets["secret"])) > 0
			}, tc.timeoutFast, tc.retry, "wait for keyvault to show azure sql user credentials with custom formats")

			t.Log(kvSqlUser2.Status)
		})
	})

	t.Run("deploy sql action and roll user credentials", func(t *testing.T) {
		keyVaultName := tc.keyvaultName
		keyVaultSecretClient := kvsecrets.New(
			keyVaultName,
			config.GlobalCredentials(),
			config.SecretNamingVersion(),
			config.PurgeDeletedKeyVaultSecrets(),
			config.RecoverSoftDeletedKeyVaultSecrets())

		key := makeSQLUserSecretKey(keyVaultSecretClient, kvSqlUser1)
		oldSecret, err := keyVaultSecretClient.Get(ctx, key)
		assert.NoError(err)

		sqlActionName := GenerateTestResourceNameWithRandom("azuresqlaction-dev", 10)
		sqlActionInstance := &v1alpha1.AzureSqlAction{
			ObjectMeta: metav1.ObjectMeta{
				Name:      sqlActionName,
				Namespace: "default",
			},
			Spec: v1alpha1.AzureSqlActionSpec{
				ResourceGroup:      rgName,
				ServerName:         sqlServerName,
				ActionName:         "rollusercreds",
				DbName:             sqlDatabaseName,
				DbUser:             kvSqlUser1.ObjectMeta.Name,
				UserSecretKeyVault: keyVaultName,
			},
		}

		err = tc.k8sClient.Create(ctx, sqlActionInstance)
		assert.Equal(nil, err, "create sqlaction in k8s")

		sqlActionInstanceNamespacedName := types.NamespacedName{Name: sqlActionName, Namespace: "default"}

		assert.Eventually(func() bool {
			_ = tc.k8sClient.Get(ctx, sqlActionInstanceNamespacedName, sqlActionInstance)
			return sqlActionInstance.Status.Provisioned
		}, tc.timeout, tc.retry, "wait for sql action to be submitted")

		newSecret, err := keyVaultSecretClient.Get(ctx, key)
		assert.NoError(err)

		assert.NotEqual(oldSecret["password"], newSecret["password"], "password should have been updated")
		assert.Equal(oldSecret["username"], newSecret["username"], "usernames should be the same")
	})

	t.Run("delete db users and ensure that their secrets have been cleaned up", func(t *testing.T) {
		EnsureDelete(ctx, t, tc, sqlUser)
		EnsureDelete(ctx, t, tc, kvSqlUser1)
		EnsureDelete(ctx, t, tc, kvSqlUser2)

		// Check that the user's secret is in the keyvault
		keyVaultSecretClient := kvsecrets.New(
			tc.keyvaultName,
			config.GlobalCredentials(),
			config.SecretNamingVersion(),
			config.PurgeDeletedKeyVaultSecrets(),
			config.RecoverSoftDeletedKeyVaultSecrets())

		assert.Eventually(func() bool {
			key := secrets.SecretKey{Name: sqlUser.ObjectMeta.Name, Namespace: sqlUser.ObjectMeta.Namespace, Kind: "azuresqluser"}
			_, err := tc.secretClient.Get(ctx, key)

			// Once the secret is gone, the Kube secret client will return an error
			return err != nil && strings.Contains(err.Error(), "not found")
		}, tc.timeoutFast, tc.retry, "wait for the azuresqluser kube secret to be deleted")

		assert.Eventually(func() bool {
			key := makeSQLUserSecretKey(keyVaultSecretClient, kvSqlUser1)

			_, err := keyVaultSecretClient.Get(ctx, key)

			// Once the secret is gone, the KV secret client will return an err
			return err != nil && strings.Contains(err.Error(), "could not be found")
		}, tc.timeoutFast, tc.retry, "wait for the azuresqluser keyvault secret to be deleted")

		assert.Eventually(func() bool {
			key := makeSQLUserSecretKey(keyVaultSecretClient, kvSqlUser2)
			key.Name = key.Name + "-adonet"
			_, err := keyVaultSecretClient.Get(ctx, key, secrets.Flatten(true))

			// Once the secret is gone, the KV secret client will return an err
			return err != nil && strings.Contains(err.Error(), "could not be found")
		}, tc.timeoutFast, tc.retry, "wait for the azuresqluser custom formatted keyvault secret to be deleted")
	})

	// Delete the SQL server
	EnsureDelete(ctx, t, tc, sqlServerInstance)
}

func TestAzureSqlServerKVSecretAndUser_SecretNamedCorrectly(t *testing.T) {
	t.Parallel()
	defer PanicRecover(t)
	ctx := context.Background()
	assert := assert.New(t)

	// Add any setup steps that needs to be executed before each test
	rgName := tc.resourceGroupName
	sqlServerName := GenerateTestResourceNameWithRandom("kvsqlserv", 10)
	rgLocation := "westus3"

	sqlServerNamespacedName := types.NamespacedName{Name: sqlServerName, Namespace: "default"}
	sqlServerInstance := v1beta1.NewAzureSQLServer(sqlServerNamespacedName, rgName, rgLocation)
	sqlServerInstance.Spec.KeyVaultToStoreSecrets = tc.keyvaultName

	// create and wait
	RequireInstance(ctx, t, tc, sqlServerInstance)

	// verify secret exists in k8s for server 1
	assertSQLServerAdminSecretCreated(ctx, t, sqlServerInstance)

	sqlDatabaseName := GenerateTestResourceNameWithRandom("sqldatabase", 10)
	// Create the SqlDatabase object and expect the Reconcile to be created
	sqlDatabaseInstance := &v1beta1.AzureSqlDatabase{
		ObjectMeta: metav1.ObjectMeta{
			Name:      sqlDatabaseName,
			Namespace: "default",
		},
		Spec: v1beta1.AzureSqlDatabaseSpec{
			Location:      rgLocation,
			ResourceGroup: rgName,
			Server:        sqlServerName,
			Edition:       0,
		},
	}

	EnsureInstance(ctx, t, tc, sqlDatabaseInstance)

	// Create firewall rule
	sqlFirewallRuleNamespacedName := types.NamespacedName{
		Name:      GenerateTestResourceNameWithRandom("sqlfwr-local2", 10),
		Namespace: "default",
	}
	sqlFirewallRule := v1beta1.NewAzureSQLFirewallRule(
		sqlFirewallRuleNamespacedName,
		rgName,
		sqlServerName,
		"1.1.1.1",
		"255.255.255.255",
	)
	EnsureInstance(ctx, t, tc, sqlFirewallRule)

	var kvSqlUser1 *v1alpha1.AzureSQLUser

	// Run user subtests
	t.Run("group2", func(t *testing.T) {
		t.Run("set up user in db, specifying adminSecretName", func(t *testing.T) {
			t.Parallel()

			// create a sql user and verify it provisions
			username := "user4" + helpers.RandomString(10)
			roles := []string{"db_owner"}

			var adminSecret string
			if tc.secretClient.GetSecretNamingVersion() == secrets.SecretNamingV1 {
				adminSecret = fmt.Sprintf("%s-%s", sqlServerInstance.Namespace, sqlServerInstance.Name)
			} else {
				adminSecret = sqlServerInstance.Name
			}

			// This test will attempt to persist secrets to the KV that was instantiated as part of the test suite
			kvSqlUser1 = &v1alpha1.AzureSQLUser{
				ObjectMeta: metav1.ObjectMeta{
					Name:      username,
					Namespace: "default",
				},
				Spec: v1alpha1.AzureSQLUserSpec{
					Server:                 sqlServerName,
					DbName:                 sqlDatabaseName,
					ResourceGroup:          rgName,
					Roles:                  roles,
					KeyVaultToStoreSecrets: tc.keyvaultName,
					AdminSecretKeyVault:    tc.keyvaultName,
					AdminSecret:            adminSecret,
				},
			}

			EnsureInstance(ctx, t, tc, kvSqlUser1)

			// Check that the user's secret is in the keyvault
			keyVaultSecretClient := kvsecrets.New(
				tc.keyvaultName,
				config.GlobalCredentials(),
				config.SecretNamingVersion(),
				config.PurgeDeletedKeyVaultSecrets(),
				config.RecoverSoftDeletedKeyVaultSecrets())

			assert.Eventually(func() bool {
				key := makeSQLUserSecretKey(keyVaultSecretClient, kvSqlUser1)
				key.Name = key.Name
				secrets, err := keyVaultSecretClient.Get(ctx, key, secrets.Flatten(true))
				assert.NoError(err)

				return len(string(secrets["secret"])) > 0
			}, tc.timeoutFast, tc.retry, "wait for keyvault to show azure sql user credentials with custom formats")

			t.Log(kvSqlUser1.Status)
		})
	})

	// Delete the SQL server
	EnsureDelete(ctx, t, tc, sqlServerInstance)
}

func makeSQLUserSecretKey(secretClient *kvsecrets.SecretClient, instance *v1alpha1.AzureSQLUser) secrets.SecretKey {
	var keyNamespace string
	if secretClient.GetSecretNamingVersion() == secrets.SecretNamingV1 {
		keyNamespace = "azuresqluser-" + instance.Spec.Server + "-" + instance.Spec.DbName
	} else {
		keyNamespace = instance.Namespace
	}
	return secrets.SecretKey{Name: instance.Name, Namespace: keyNamespace, Kind: "azuresqluser"}
}

func makeSQLServerKeyVaultSecretName(instance *v1beta1.AzureSqlServer) string {
	if tc.secretClient.GetSecretNamingVersion() == secrets.SecretNamingV1 {
		return fmt.Sprintf("%s-%s", instance.Namespace, instance.Name)
	} else {
		return fmt.Sprintf("%s-%s-%s", "azuresqlserver", instance.Namespace, instance.Name)
	}
}

repository: Azure/azure-service-operator

repo_name: Azure/azure-service-operator

branch_name: refs/heads/main


text:
# Copyright © 2014 maxint <NOT_SPAM_lnychina@gmail.com>
#
# Distributed under terms of the MIT license.
#
# Supported (environment) variables:
#
# - SDK_ROOT: SDK root directory
#

# get SDK root
if(NOT SDK_ROOT)
  if(DEFINED ENV{SDK_ROOT})
    set(SDK_ROOT $ENV{SDK_ROOT})
  endif()
  set(SDK_ROOT "${SDK_ROOT}" CACHE PATH "Aldebaran Robotics cross-compiling toolchain location")
endif()
if(NOT SDK_ROOT)
  message(FATAL_ERROR "Please set SDK_ROOT variable to toolchain root directory")
endif()

set(TARGET_ARCH "i686")
set(TARGET_TUPLE "${TARGET_ARCH}-aldebaran-linux-gnu")

# basic setup
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR ${TARGET_ARCH}) # optional

# SDK related directories
set(CROSS_ROOT "${SDK_ROOT}")
set(CMAKE_SYSROOT "${CROSS_ROOT}/${TARGET_TUPLE}/sysroot")
file(GLOB CXX_DIR "${CROSS_ROOT}/${TARGET_TUPLE}/include/c++/*")

# compilers
#find_program(CMAKE_C_COMPILER gcc)
#find_program(CMAKE_CXX_COMPILER g++)
find_program(CMAKE_C_COMPILER ${TARGET_TUPLE}-gcc PATHS "${CROSS_ROOT}/bin" NO_DEFAULT_PATH)
find_program(CMAKE_CXX_COMPILER ${TARGET_TUPLE}-g++ PATHS "${CROSS_ROOT}/bin" NO_DEFAULT_PATH)
find_program(CMAKE_AR ${TARGET_TUPLE}-ar PATH "${CROSS_ROOT}/bin" NO_DEFAULT_PATH)
find_program(CMAKE_RANLIB ${TARGET_TUPLE}-ranlib PATH "${CROSS_ROOT}/bin" NO_DEFAULT_PATH)

# NOTE: fix bug of no -D* passed when checking compilers
# include(CMakeForceCompiler)
# cmake_force_c_compiler(${CMAKE_C_COMPILER} GNU)
# cmake_force_cxx_compiler(${CMAKE_CXX_COMPILER} GNU)

# compiler and linker flags
set(CMAKE_C_FLAGS "-pipe -fomit-frame-pointer")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-align-jumps -fno-align-functions")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-align-labels -fno-align-loops")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -mtune=atom")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mssse3 -mfpmath=sse")
if(IS_DIRECTORY "${CROSS_ROOT}/include")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CROSS_ROOT}/include")
endif()
if(IS_DIRECTORY "${CROSS_ROOT}/../boost")
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${CROSS_ROOT}/..")
endif()

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "C Flags" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -I${CXX_DIR} -I${CXX_DIR}/${TARGET_TUPLE}" CACHE STRING "C++ Flags" FORCE)
set(CMAKE_LINKER_FLAGS "-Wl,--no-undefined -lc -lm -ldl -lrt -lpthread" CACHE STRING "Linker Flags" FORCE)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS    "${CMAKE_LINKER_FLAGS}" CACHE STRING "" FORCE)

# NOTE: (optional) do not contribute to find compiler program, e.g. ar
# search for program in the build host directories, e.g. make
#set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
#set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

# vim:ft=cmake et ts=2 sts=2 sw=2:

license: MIT

repository: fireae/arcbuild

license_type: permissive

repo_name: fireae/arcbuild

branch_name: refs/heads/master

extension: cmake


text:
LICENSE =	"GPL"
DESCRIPTION =	"Buttonbox for gpe"

DEPENDS =	"libgpewidget libgpelaunch"

GPE_TARBALL_SUFFIX= "bz2"
inherit gpe autotools

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

SRC_URI[md5sum] = "c5c4bd13cbe72f05b72f182bdb466d96"
SRC_URI[sha256sum] = "2a40c9cff09def44f3032d9165c0040ff13efef84f6b8a5940c787bd43391311"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD

extension: bb


text:
@article{phan2017dbvar,
 author = {Phan, Lon and Hsu, Jeffrey and Willi, Michaela and Mansour, Tamer and Kai, Yan and Garner, John and Lopez, John and Busby, Ben and others},
 journal = {F1000Research},
 title = {dbVar structural variant cluster set for data analysis and variant comparison},
 volume = {5},
 year = {2017}
}

extension: bib


text:
SUMMARY = "ReadTheDocs.org theme for Sphinx, 2013 version."
SECTION = "devel/python"

HOMEPAGE = "https://pypi.python.org/pypi/sphinxcontrib-httpdomain"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=51935905ca4aa737a038ba690fbdbdd2"

SRC_URI = "https://pypi.python.org/packages/source/s/sphinx_rtd_theme/sphinx_rtd_theme-${PV}.tar.gz"

SRC_URI[md5sum] = "8df56a300c8c69f17e1ffbee194b2a26"
SRC_URI[sha256sum] = "0f29f544f6d037989fa0c7729a9eab7e4d8ea50d6f0ef37363f472756c1edca6"

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

inherit setuptools

export BUILD_SYS
export HOST_SYS
export STAGING_INCDIR
export STAGING_LIBDIR

BBCLASSEXTEND = "native"

repository: koenkooi/meta-maker

repo_name: koenkooi/meta-maker

gha_license_id: MIT

gha_language: BitBake


text:
SUMMARY = "RULI stands for Resolver User Layer Interface It's a library	built on top of an asynchronous DNS stub resolver"

HOMEPAGE = "http://www.nongnu.org/ruli/"

LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3"

DEPENDS = "liboop"

SRC_URI = "http://download.savannah.gnu.org/releases/ruli/ruli_${PV}.orig.tar.gz \
           file://0001-Fix-build-with-format-string-checks.patch \
           file://0001-src-ruli_addr.c-Add-missing-format-string.patch \
           file://0001-ruli_srv-Mark-prev_addr_list_size-as-unused.patch \
           file://0001-Make-space-for-flags-from-environment.patch \
           file://float-conversion.patch \
           "

SRC_URI[md5sum] = "e73fbfdeadddb68a703a70cea5271468"
SRC_URI[sha256sum] = "11d32def5b514748fbd9ea8c88049ae99e1bb358efc74eb91a4d268a3999dbfa"

EXTRA_OEMAKE = 'CC="${CC}" CPPFLAGS="${CFLAGS}" OOP_BASE_DIR="${STAGING_EXECPREFIXDIR}" \
                INSTALL_BASE_DIR="${D}${exec_prefix}" \
                OOP_LIB_DIR=${STAGING_EXECPREFIXDIR}/${baselib} \
                INSTALL_LIB_DIR=${D}${libdir}'

do_configure() {
    touch configure-stamp
}

do_install() {
    oe_runmake install
}

PACKAGES =+ "${PN}-bin"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded


text:
package api

import (
	"errors"
	"fmt"
	"github.com/cihub/seelog"
	"github.com/denisbakhtin/sitemap"
	"github.com/gin-contrib/sessions"
	"github.com/gin-gonic/gin"
	"github.com/gitlubtaotao/wblog/models"
	"github.com/gitlubtaotao/wblog/repositories"
	"github.com/gitlubtaotao/wblog/system"
	"github.com/gitlubtaotao/wblog/tools/helpers"
	"net/http"
	"os"
	"path"
)

type IBaseApi interface {
	Index(ctx *gin.Context)
	Get(ctx *gin.Context)
	New(ctx *gin.Context)
	Create(ctx *gin.Context)
	Edit(ctx *gin.Context)
	Update(ctx *gin.Context)
	Delete(ctx *gin.Context)
}

type BaseApi struct {
}

//return json 格式
//输出json格式
func (b *BaseApi) WriteJSON(ctx *gin.Context, h gin.H) {
	if _, ok := h["succeed"]; !ok {
		h["succeed"] = false
	}
	ctx.JSON(http.StatusOK, h)
}

//render html
func (b *BaseApi) RenderHtml(ctx *gin.Context, path string, h gin.H) {
	ctx.HTML(http.StatusOK, path, h)
	ctx.Abort()
}

//handler render html comments

func (b *BaseApi) RenderComments(h gin.H) gin.H {
	repository := repositories.NewCommentRepository()
	h["comments"], _ = repository.MustListUnreadComment()
	h["message"] = ""
	return h
}

//操作对于的session
func (b *BaseApi) OperationSession(ctx *gin.Context, Key string, value interface{}) error {
	session := sessions.Default(ctx)
	session.Delete(Key)
	session.Set(Key, value)
	return session.Save()
}

func (b *BaseApi) GetSessionValue(ctx *gin.Context, key string, isDelete bool) (value interface{}, err error) {
	session := sessions.Default(ctx)
	value = session.Get(key)
	if isDelete {
		session.Delete(key)
		_ = session.Save()
	}
	return value, nil
}

func (b *BaseApi) Handle404(c *gin.Context) {
	HandleMessage(c, "Sorry,I lost myself! page")
}

func (b *BaseApi) HandleMessage(c *gin.Context, message string) {
	c.HTML(http.StatusNotFound, "errors/error.html", gin.H{
		"message": message,
	})
	c.Abort()
}

func (b *BaseApi) AdminUser(ctx *gin.Context) (*models.User, error) {
	return b.CurrentUser(ctx, system.GetConfiguration().AdminUser)
}

func (b *BaseApi) ClientUser(ctx *gin.Context) (*models.User, error) {
	fmt.Println(system.GetConfiguration().ClientUser)
	return b.CurrentUser(ctx, system.GetConfiguration().ClientUser)
}

/*
@title: 查询当前用户

*/
func (b *BaseApi) CurrentUser(c *gin.Context, env string) (*models.User, error) {
	sessionUser, exists := c.Get(env)
	if !exists {
		return nil, errors.New("current user is not exist")
	}
	user, ok := sessionUser.(*models.User)
	if !ok {
		return nil, errors.New("server interval error")
	}
	return user, nil
}

//发送邮件
func (b *BaseApi) SendMailHtml(to, subject, body string) error {
	repository := repositories.NewMailRepository(subject, body, "html")
	return repository.SendToMail(to)
}

//系统默认推送方式
func (b *BaseApi) DefaultNoticeMailHtml(subject, body string) error {
	repository := repositories.NewMailRepository(subject, body, "html")
	return repository.SystemDefaultNotify()
}

//处理共同错误信息
func (b *BaseApi) HandlerError(message string, err error) bool {
	if err != nil {
		_ = seelog.Critical(message, err)
		return false
	}
	return true
}

func CreateXMLSitemap() {
	configuration := system.GetConfiguration()
	folder := path.Join(configuration.Public, "sitemap")
	os.MkdirAll(folder, os.ModePerm)
	domain := configuration.Domain
	now := helpers.GetCurrentTime()
	items := make([]sitemap.Item, 0)

	items = append(items, sitemap.Item{
		Loc:        domain,
		LastMod:    now,
		Changefreq: "daily",
		Priority:   1,
	})

	posts, err := models.ListPublishedPost("", 0, 0)
	if err == nil {
		for _, post := range posts {
			items = append(items, sitemap.Item{
				Loc:        fmt.Sprintf("%s/post/%d", domain, post.ID),
				LastMod:    post.UpdatedAt,
				Changefreq: "weekly",
				Priority:   0.9,
			})
		}
	}

	pages, err := models.ListPublishedPage()
	if err == nil {
		for _, page := range pages {
			items = append(items, sitemap.Item{
				Loc:        fmt.Sprintf("%s/page/%d", domain, page.ID),
				LastMod:    page.UpdatedAt,
				Changefreq: "monthly",
				Priority:   0.8,
			})
		}
	}

	if err := sitemap.SiteMap(path.Join(folder, "sitemap1.xml.gz"), items); err != nil {
		return
	}
	if err := sitemap.SiteMapIndex(folder, "sitemap_index.xml", domain+"/static/sitemap/"); err != nil {
		return
	}
}

func WriteJSON(ctx *gin.Context, h gin.H) {
	if _, ok := h["succeed"]; !ok {
		h["succeed"] = false
	}
	ctx.JSON(http.StatusOK, h)
}

func HandleMessage(c *gin.Context, message string) {
	c.HTML(http.StatusNotFound, "errors/error.html", gin.H{
		"message": message,
	})
}

repository: xycfree/wblog

repo_name: xycfree/wblog

extension: go


text:
@article{Jimnez2000DynamicBP,
  title={Dynamic branch prediction with perceptrons},
  author={Daniel A. Jim{\'e}nez and Calvin Lin},
  journal={Proceedings HPCA Seventh International Symposium on High-Performance Computer Architecture},
  year={2000},
  pages={197-206}
}

@misc{CezeClass,
  title={Computer Systems Architecture Lecture 5},
  author={Luis Ceze},
  year={Spring 2019},
  howpublished = "\url{https://courses.cs.washington.edu/courses/cse548/19sp}"
}


text:
require php.inc

DEPENDS = "zlib libxml2 virtual/libiconv php-native lemon-native mysql5 \
           libc-client openssl"

PR = "${INC_PR}.4"

SRC_URI =     "http://museum.php.net/php5/php-${PV}.tar.bz2;name=src \
               file://acinclude-xml2-config.patch \
               file://php-m4-divert.patch \
	       file://pear-makefile.patch \
	       file://imap-fix-autofoo.patch \
	       file://CVE-2010-0397.patch \
	       file://iconv.patch \
            "

SRC_URI[src.md5sum] = "eb4d0766dc4fb9667f05a68b6041e7d1"
SRC_URI[src.sha256sum] = "2b50a2535e3bb9a98cd4d1633f9452d877276c40b385915261f040d535c7eadb"

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

EXTRA_OECONF = "    --enable-mbstring \
                    --enable-discard-path \
                    --enable-sockets \
                    --enable-shared \
                    --enable-pcntl \
                    --enable-wddx \
                    --disable-embedded-mysqli \
                    --enable-magic-quotes \
                    --enable-fastcgi \
                    --with-imap=${STAGING_DIR_HOST} \
                    --with-imap-ssl=${STAGING_DIR_HOST} \
                    --with-zlib --with-zlib-dir=${STAGING_LIBDIR}/.. \
                    --with-iconv=${STAGING_LIBDIR}/.. \
                    --with-libxml-dir=${STAGING_BINDIR_CROSS} \
                    --with-mysql="${STAGING_DIR_TARGET}${layout_exec_prefix}" \
                    --with-mysqli="${STAGING_BINDIR_CROSS}/mysql_config" \
                    --with-pdo-mysql="${STAGING_BINDIR_CROSS}/mysql_config" \
                    --without-pdo-sqlite \
               "

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

#LDFLAGS += "-lstdc++"

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

# fixme
do_install_append() {
    mv ${D}/${STAGING_DIR_NATIVE}/${sysconfdir} ${D}/${sysconfdir}
    rm -rf ${D}/${STAGING_DIR_NATIVE}
    rm -rf ${D}/.registry
    rm -rf ${D}/.channels
    rm -rf ${D}/.[a-z]*
    sed -i 's:${STAGING_DIR_NATIVE}::g' ${D}/${sysconfdir}/pear.conf
}

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

FILES_${PN}-dbg            =+ "${bindir}/.debug"

FILES_${PN}-doc            += "${libdir}/php/doc"

FILES_${PN}-cli            = "${bindir}/php"
FILES_${PN}-cgi            = "${bindir}/php-cgi"

FILES_${PN}-pear            = "${bindir}/pear* ${bindir}/pecl \
                             ${libdir}/php/PEAR \
                             ${libdir}/php/PEAR.php \
                             ${libdir}/php/System.php ${libdir}php/peclcmd.php ${libdir}/php/pearcmd.php \
                             ${libdir}/php/.channels  ${libdir}/php/.channels/.alias  \
                             ${libdir}/php/.channels\__uri.reg \
                             ${libdir}/php/.channels\pear.php.net.reg ${libdir}/php/.channels/pecl.php.net.reg \
                             ${libdir}/php/.registry \
                             ${libdir}/php/Archive/Tar.php \
                             ${libdir}/php/Console/Getopt.php ${libdir}/php/OS/Guess.php \
                             ${sysconfdir}/pear.conf"

FILES_${PN}-dev            = "${includedir}/php ${libdir}/build \
                             ${bindir}/phpize ${bindir}/php-config \
                             ${libdir}/php/.depdb ${libdir}/php/.depdblock ${libdir}/php/.filemap ${libdir}/php/.lock \
                             ${libdir}/php/test "

FILES_${PN}                 = "${libdir}/php"
FILES_${PN}                += "${bindir}"

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


text:
@InProceedings{jancsary13,
  pdf = {http://jmlr.org/proceedings/papers/v28/jancsary13.pdf},
  number = {3},
  section = {cycle-3},
  title = {Learning Convex QP Relaxations for Structured Prediction},
  author = {Jancsary, Jeremy and Nowozin, Sebastian and Rother, Carsten},
  pages = {915-923},
  abstract = {We introduce a new large margin approach to discriminative training of intractable discrete graphical models. Our approach builds on a convex quadratic programming relaxation of the MAP inference problem. The model parameters are trained directly within this restricted class of energy functions so as to optimize the predictions on the training data. We address the issue of how to parameterize the resulting model and point out its relation to existing approaches. The primary motivation behind our use of the QP relaxation is its computational efficiency; yet, empirically, its predictive accuracy compares favorably to more expensive approaches. This makes it an appealing choice for many practical tasks.},
}

repository: mreid/papersite

repo_name: mreid/papersite

gha_language: TeX


text:
SECTION = "base"
include ipkg_${PV}.bb
inherit native

DEPENDS = "libtool-native automake-native"
FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/ipkg-${PV}"
PROVIDES = ""

repository: BackupTheBerlios/openslug-svn

repo_name: BackupTheBerlios/openslug-svn


text:
DESCRIPTION = "nodeJS Evented I/O for V8 JavaScript"
HOMEPAGE = "http://nodejs.org"
LICENSE = "MIT & BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=672cc6c8dbb3e918277a61ea98f088f6"

DEFAULT_PREFERENCE = "-1"

DEPENDS = "openssl"

SRC_URI = "http://nodejs.org/dist/v${PV}/node-v${PV}.tar.gz"
SRC_URI[md5sum] = "9fd7baa2d27b848c3134e6ae35bb87b2"
SRC_URI[sha256sum] = "e6cbfc5ccdbe10128dbbd4dc7a88c154d80f8a39c3a8477092cf7d25eef78c9c"

S = "${WORKDIR}/node-v${PV}"

# v8 errors out if you have set CCACHE
CCACHE = ""

# Node is way too cool to use proper autotools, so we install two wrappers to forcefully inject proper arch cflags to workaround waf+scons
do_configure () {
  echo '#!/bin/sh' > ${WORKDIR}/gcc
  echo '${CC} $@' >> ${WORKDIR}/gcc

  echo '#!/bin/sh' > ${WORKDIR}/g++
  echo '${CXX} $@'>> ${WORKDIR}/g++

  chmod +x ${WORKDIR}/gcc ${WORKDIR}/g++

  sed -i -e s:\'/usr/lib:\'${STAGING_LIBDIR}:g wscript
  sed -i -e s:\'/usr/local/lib:\'${STAGING_LIBDIR}:g wscript

  export PATH=${WORKDIR}:${PATH}
  export CC=gcc
  export CXX=g++

  ./configure --prefix=${prefix} --without-snapshot
}

do_compile () {
  export PATH=${WORKDIR}:${PATH}
  export CC=gcc
  export CXX=g++
  make
}

do_install () {
  DESTDIR=${D} oe_runmake install
}

RDEPENDS_${PN} = "curl python-shell python-datetime python-subprocess python-crypt python-textutils python-netclient "

FILES_${PN} += "${libdir}/node/wafadmin"
BBCLASSEXTEND = "native"


text:
find_library(GLESv2_LIBRARY GLESv2
             "/usr/lib/x86_64-linux-gnu")

find_path(GLESv2_INCLUDE_DIR "GLES2/gl2.h")

include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLESv2
                                  REQUIRED_VARS GLESv2_LIBRARY GLESv2_INCLUDE_DIR)

repository: szledan/thesis

repo_name: szledan/thesis


text:
@inproceedings{belavadi2021finding,
  title={Finding a Structure: Evaluating Different Modelling Languages Regarding Their Suitability of Designing Agent-Based Models},
  author={Belavadi, Poornima and Burbach, Laura and Ziefle, Martina and Calero Valdez, Andr{\'e}},
  booktitle={International Conference on Human-Computer Interaction},
  pages={201--219},
  year={2021},
  organization={Springer, Cham}
}


text:
DESCRIPTION = "Ref::Util introduces several functions to help identify references in a \
smarter (and usually faster) way. In short:"

SECTION = "libs"
LICENSE = "MIT"
PR = "r0"

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

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "https://cpan.metacpan.org/authors/id/A/AR/ARC/Ref-Util-0.204.tar.gz"

SRC_URI[md5sum] = "add072ed1e481dc43ad6bb8bbe36ab99"
SRC_URI[sha256sum] = "415fa73dbacf44f3d5d79c14888cc994562720ab468e6f71f91cd1f769f105e1"

S = "${WORKDIR}/Ref-Util-${PV}"

inherit cpan allarch

BBCLASSEXTEND = "native"

repository: rehsack/meta-cpan

repo_name: rehsack/meta-cpan


text:
@article{RN877,
 author = {Roth, H. and Millar, J. L. and Cheng, A. C. and Byrne, A. and Evans, S. and Grummet, J.},
 doi = {10.1111/bju.13209},
 journal = {BJU International},
 pages = {49-53},
 title = {The state of TRUS biopsy sepsis: Readmissions to Victorian hospitals with TRUS biopsy-related infection over 5 years},
 type = {Journal Article},
 url = {https://www.scopus.com/inward/record.uri?eid=2-s2.0-84945572507&doi=10.1111%2fbju.13209&partnerID=40&md5=ec6a83d1568c7d0e5c564037e6f25782
http://onlinelibrary.wiley.com/store/10.1111/bju.13209/asset/bju13209.pdf?v=1&t=iwh7zkco&s=8cd7525a077a7b3a1f14dba328f56439250c1ccd},
 volume = {116},
 year = {2015}
}


text:
@inproceedings{khoramshahi2014cognitive,
  title={Cognitive mechanism in synchronized motion: An internal predictive model for manual tracking control (special session)},
  author={Khoramshahi, Mahdi and Shukla, Ashwini and Billard, Aude},
  booktitle={2014 IEEE International Conference on Systems, Man, and Cybernetics (SMC)},
  pages={765--771},
  year={2014},
  organization={IEEE}
}

gha_language: HTML


text:
@inproceedings{CaWa11,
 author = {N. Cao and C. Wang and M. Li and K. Ren and W. Lou},
 booktitle = {Proc. of IEEE INFOCOM},
 title = {Privacy-Preserving Multi-keyword Ranked Search over Encrypted Cloud Data},
 year = {2011}
}


text:
require systemd-image.bb

inherit populate_sdk_qt5

EXTRA_IMAGE_FEATURES += "splash"

IMAGE_INSTALL += " \
	packagegroup-qt5-qtcreator-debug \
	packagegroup-qt5 \
	packagegroup-qt5-apps \
	xinput-calibrator \
	systemd-analyze \
"
export IMAGE_BASENAME = "systemd-QT5-image"

repository: tactical-drone/meta-angstrom

repo_name: tactical-drone/meta-angstrom


text:
package alarm

type LocalAlarm struct {

}

func NewLocalAlarm() Alarm {
	return &LocalAlarm{}
}

func (l *LocalAlarm) Alarm(clusterId uint64, kind AlarmKind, title, content string) error {
	return nil
}

func (l *LocalAlarm) Stop() {

}

repository: apaqi/sharkstore

repo_name: apaqi/sharkstore

gha_language: JavaScript


text:
@online{mioplanet_technologies_inc._pixel_nodate,
	title = {Pixel Ruler: Your free virtual screen ruler},
	url = {http://www.mioplanet.com/products/pixelruler/},
	author = {Mioplanet Technologies, Inc.},
	urldate = {2009-03-04},
	tags = {Website details, pmean}
}

repository: pmean/build-website

repo_name: pmean/build-website


text:
package gohttp

import (
	"bytes"
	"errors"
	"fmt"
	"net/http"
	"testing"
	"time"

	"github.com/zhufuyi/pkg/utils"

	"github.com/gin-gonic/gin"
	"github.com/stretchr/testify/assert"
)

type myBody struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

func runGoHTTPServer() string {
	serverAddr, requestAddr := utils.GetLocalHTTPAddrPairs()

	gin.SetMode(gin.ReleaseMode)
	r := gin.Default()
	oKFun := func(c *gin.Context) {
		uid := c.Query("uid")
		fmt.Printf("request parameters: uid=%s\n", uid)
		c.JSON(200, StdResult{
			Code: 0,
			Msg:  "ok",
			Data: fmt.Sprintf("uid=%v", uid),
		})
	}
	errFun := func(c *gin.Context) {
		uid := c.Query("uid")
		fmt.Printf("request parameters: uid=%s\n", uid)
		c.JSON(401, StdResult{
			Code: 401,
			Msg:  "authorization failure",
			Data: fmt.Sprintf("uid=%v", uid),
		})
	}

	oKPFun := func(c *gin.Context) {
		var body myBody
		c.BindJSON(&body)
		fmt.Println("body data:", body)
		c.JSON(200, StdResult{
			Code: 0,
			Msg:  "ok",
			Data: body,
		})
	}
	errPFun := func(c *gin.Context) {
		var body myBody
		c.BindJSON(&body)
		fmt.Println("body data:", body)
		c.JSON(401, StdResult{
			Code: 401,
			Msg:  "authorization failure",
			Data: nil,
		})
	}

	r.GET("/get", oKFun)
	r.GET("/get_err", errFun)
	r.DELETE("/delete", oKFun)
	r.DELETE("/delete_err", errFun)
	r.POST("/post", oKPFun)
	r.POST("/post_err", errPFun)
	r.PUT("/put", oKPFun)
	r.PUT("/put_err", errPFun)
	r.PATCH("/patch", oKPFun)
	r.PATCH("/patch_err", errPFun)

	go func() {
		err := r.Run(serverAddr)
		if err != nil {
			panic(err)
		}
	}()

	time.Sleep(time.Millisecond * 200)
	return requestAddr
}

// ------------------------------------------------------------------------------------------

func TestGetStandard(t *testing.T) {
	requestAddr := runGoHTTPServer()

	req := Request{}
	req.SetURL(requestAddr + "/get")
	req.SetHeaders(map[string]string{
		"Authorization": "Bearer token",
	})
	req.SetParams(KV{
		"name": "foo",
	})

	resp, err := req.GET()
	if err != nil {
		t.Fatal(err)
	}

	result := &StdResult{}
	err = resp.BindJSON(result)
	if err != nil {
		t.Fatal(err)
	}

	t.Logf("%+v", result)
}

func TestDeleteStandard(t *testing.T) {
	requestAddr := runGoHTTPServer()

	req := Request{}
	req.SetURL(requestAddr + "/delete")
	req.SetHeaders(map[string]string{
		"Authorization": "Bearer token",
	})
	req.SetParams(KV{
		"uid": 123,
	})

	resp, err := req.DELETE()
	if err != nil {
		t.Fatal(err)
	}

	result := &StdResult{}
	err = resp.BindJSON(result)
	if err != nil {
		t.Fatal(err)
	}

	t.Logf("%+v", result)
}

func TestPostStandard(t *testing.T) {
	requestAddr := runGoHTTPServer()

	req := Request{}
	req.SetURL(requestAddr + "/post")
	req.SetHeaders(map[string]string{
		"Authorization": "Bearer token",
	})
	req.SetJSONBody(&myBody{
		Name:  "foo",
		Email: "bar@gmail.com",
	})

	resp, err := req.POST()
	if err != nil {
		t.Fatal(err)
	}

	result := &StdResult{}
	err = resp.BindJSON(result)
	if err != nil {
		t.Fatal(err)
	}

	t.Logf("%+v", result)
}

func TestPutStandard(t *testing.T) {
	requestAddr := runGoHTTPServer()

	req := Request{}
	req.SetURL(requestAddr + "/put")
	req.SetHeaders(map[string]string{
		"Authorization": "Bearer token",
	})
	req.SetJSONBody(&myBody{
		Name:  "foo",
		Email: "bar@gmail.com",
	})

	resp, err := req.PUT()
	if err != nil {
		t.Fatal(err)
	}

	result := &StdResult{}
	err = resp.BindJSON(result)
	if err != nil {
		t.Fatal(err)
	}

	t.Logf("%+v", result)
}

func TestPatchStandard(t *testing.T) {
	requestAddr := runGoHTTPServer()

	req := Request{}
	req.SetURL(requestAddr + "/patch")
	req.SetHeaders(map[string]string{
		"Authorization": "Bearer token",
	})
	req.SetJSONBody(&myBody{
		Name:  "foo",
		Email: "bar@gmail.com",
	})

	resp, err := req.PATCH()
	if err != nil {
		t.Fatal(err)
	}

	result := &StdResult{}
	err = resp.BindJSON(result)
	if err != nil {
		t.Fatal(err)
	}

	t.Logf("%+v", result)
}

// ------------------------------------------------------------------------------------------

func TestGet(t *testing.T) {
	requestAddr := runGoHTTPServer()

	type args struct {
		result interface{}
		url    string
		params KV
	}
	tests := []struct {
		name       string
		args       args
		wantErr    bool
		wantResult *StdResult
	}{
		{
			name: "get success",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/get",
				params: KV{"uid": 123},
			},
			wantErr: false,
			wantResult: &StdResult{
				Code: 0,
				Msg:  "ok",
				Data: "uid=123",
			},
		},
		{
			name: "get err",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/get_err",
				params: KV{"uid": 123},
			},
			wantErr: true,
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
		},
		{
			name: "get not found",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/notfound",
				params: KV{"uid": 123},
			},
			wantErr: true,
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if err := Get(tt.args.result, tt.args.url, tt.args.params); (err != nil) != tt.wantErr {
				t.Errorf("Get() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if tt.args.result.(*StdResult).Msg != tt.wantResult.Msg {
				t.Errorf("gotResult = %v, wantResult =  %v", tt.args.result, tt.wantResult)
			}
		})
	}
}

func TestDelete(t *testing.T) {
	requestAddr := runGoHTTPServer()

	type args struct {
		result interface{}
		url    string
		params KV
	}
	tests := []struct {
		name       string
		args       args
		wantErr    bool
		wantResult *StdResult
	}{
		{
			name: "delete success",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/delete",
				params: KV{"uid": 123},
			},
			wantErr: false,
			wantResult: &StdResult{
				Code: 0,
				Msg:  "ok",
				Data: "uid=123",
			},
		},
		{
			name: "delete err",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/delete_err",
				params: KV{"uid": 123},
			},
			wantErr: true,
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
		},
		{
			name: "delete not found",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/notfound",
				params: KV{"uid": 123},
			},
			wantErr: true,
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if err := Delete(tt.args.result, tt.args.url, tt.args.params); (err != nil) != tt.wantErr {
				t.Errorf("Delete() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if tt.args.result.(*StdResult).Msg != tt.wantResult.Msg {
				t.Errorf("gotResult = %v, wantResult =  %v", tt.args.result, tt.wantResult)
			}
		})
	}
}

func TestPost(t *testing.T) {
	requestAddr := runGoHTTPServer()

	type args struct {
		result interface{}
		url    string
		body   interface{}
	}
	tests := []struct {
		name       string
		args       args
		wantResult *StdResult
		wantErr    bool
	}{
		{
			name: "post success",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/post",
				body: &myBody{
					Name:  "foo",
					Email: "bar@gmail.com",
				},
			},
			wantResult: &StdResult{
				Code: 0,
				Msg:  "ok",
				Data: nil,
			},
			wantErr: false,
		},
		{
			name: "post error",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/post_err",
				body: &myBody{
					Name:  "foo",
					Email: "bar@gmail.com",
				},
			},
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
			wantErr: true,
		},
		{
			name: "post not found",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/notfound",
				body: &myBody{
					Name:  "foo",
					Email: "bar@gmail.com",
				},
			},
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
			wantErr: true,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if err := Post(tt.args.result, tt.args.url, tt.args.body); (err != nil) != tt.wantErr {
				t.Errorf("Post() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if tt.args.result.(*StdResult).Msg != tt.wantResult.Msg {
				t.Errorf("gotResult = %v, wantResult =  %v", tt.args.result, tt.wantResult)
			}
		})
	}
}

func TestPut(t *testing.T) {
	requestAddr := runGoHTTPServer()

	type args struct {
		result interface{}
		url    string
		body   interface{}
	}
	tests := []struct {
		name       string
		args       args
		wantResult *StdResult
		wantErr    bool
	}{
		{
			name: "put success",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/put",
				body: &myBody{
					Name:  "foo",
					Email: "bar@gmail.com",
				},
			},
			wantResult: &StdResult{
				Code: 0,
				Msg:  "ok",
				Data: nil,
			},
			wantErr: false,
		},
		{
			name: "put error",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/put_err",
				body: &myBody{
					Name:  "foo",
					Email: "bar@gmail.com",
				},
			},
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
			wantErr: true,
		},
		{
			name: "post not found",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/notfound",
				body: &myBody{
					Name:  "foo",
					Email: "bar@gmail.com",
				},
			},
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
			wantErr: true,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if err := Put(tt.args.result, tt.args.url, tt.args.body); (err != nil) != tt.wantErr {
				t.Errorf("Put() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if tt.args.result.(*StdResult).Msg != tt.wantResult.Msg {
				t.Errorf("gotResult = %v, wantResult =  %v", tt.args.result, tt.wantResult)
			}
		})
	}
}

func TestPatch(t *testing.T) {
	requestAddr := runGoHTTPServer()

	type args struct {
		result interface{}
		url    string
		body   interface{}
	}
	tests := []struct {
		name       string
		args       args
		wantResult *StdResult
		wantErr    bool
	}{
		{
			name: "patch success",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/patch",
				body: &myBody{
					Name:  "foo",
					Email: "bar@gmail.com",
				},
			},
			wantResult: &StdResult{
				Code: 0,
				Msg:  "ok",
				Data: nil,
			},
			wantErr: false,
		},
		{
			name: "patch error",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/patch_err",
				body: &myBody{
					Name:  "foo",
					Email: "bar@gmail.com",
				},
			},
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
			wantErr: true,
		},
		{
			name: "post not found",
			args: args{
				result: &StdResult{},
				url:    requestAddr + "/notfound",
				body: &myBody{
					Name:  "foo",
					Email: "bar@gmail.com",
				},
			},
			wantResult: &StdResult{
				Code: 0,
				Msg:  "",
				Data: nil,
			},
			wantErr: true,
		},
	}

	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if err := Patch(tt.args.result, tt.args.url, tt.args.body); (err != nil) != tt.wantErr {
				t.Errorf("Put() error = %v, wantErr %v", err, tt.wantErr)
				return
			}
			if tt.args.result.(*StdResult).Msg != tt.wantResult.Msg {
				t.Errorf("gotResult = %v, wantResult =  %v", tt.args.result, tt.wantResult)
			}
		})
	}
}

func TestRequest_Reset(t *testing.T) {
	req := &Request{
		method: http.MethodGet,
	}
	req.Reset()
	assert.Equal(t, "", req.method)
}

func TestRequest_Do(t *testing.T) {
	req := &Request{
		method: http.MethodGet,
		url:    "http://",
	}

	_, err := req.Do(http.MethodOptions, "")
	assert.Error(t, err)

	_, err = req.Do(http.MethodGet, map[string]interface{}{"foo": "bar"})
	assert.Error(t, err)
	_, err = req.Do(http.MethodDelete, "foo=bar")
	assert.Error(t, err)

	_, err = req.Do(http.MethodPost, &myBody{
		Name:  "foo",
		Email: "bar@gmail.com",
	})
	assert.Error(t, err)

	_, err = req.Response()
	assert.Error(t, err)

	err = requestErr(err)
	assert.Error(t, err)

	err = jsonParseErr(err)
	assert.Error(t, err)
}

func TestResponse_BodyString(t *testing.T) {
	resp := &Response{
		Response: nil,
		err:      nil,
	}

	_, err := resp.BodyString()
	assert.Error(t, err)

	resp.err = errors.New("error test")
	_, err = resp.BodyString()
	assert.Error(t, err)

	err = resp.Error()
	assert.Error(t, err)
}

func TestError(t *testing.T) {
	req := &Request{}
	req.SetParam("foo", "bar")
	req.SetParam("foo3", make(chan string))
	req.SetParams(map[string]interface{}{"foo2": "bar2"})
	req.SetBody("foo")
	req.SetTimeout(time.Second * 10)
	req.CustomRequest(func(req *http.Request, data *bytes.Buffer) {
		fmt.Println("customRequest")
	})
	req.SetURL("http://127.0.0.1:0")

	resp, err := req.pull()
	assert.Error(t, err)

	req.method = http.MethodPost
	resp, err = req.push()
	assert.Error(t, err)

	_, err = resp.ReadBody()
	assert.Error(t, err)

	err = resp.BindJSON(nil)
	assert.Error(t, err)

	err = notOKErr(resp)
	assert.Error(t, err)

	err = do(http.MethodPost, nil, "", nil)
	assert.Error(t, err)
	err = do(http.MethodPost, &StdResult{}, "http://127.0.0.1:0", nil, KV{"foo": "bar"})
	assert.Error(t, err)

	err = gDo(http.MethodGet, nil, "http://127.0.0.1:0", nil)
	assert.Error(t, err)
}

repository: zhufuyi/pkg

repo_name: zhufuyi/pkg

gha_language: Go


text:
package scaleToSeconds

import (
	"context"
	"strconv"

	"github.com/go-graphite/carbonapi/expr/helper"
	"github.com/go-graphite/carbonapi/expr/interfaces"
	"github.com/go-graphite/carbonapi/expr/types"
	"github.com/go-graphite/carbonapi/pkg/parser"
)

type scaleToSeconds struct {
	interfaces.FunctionBase
}

func GetOrder() interfaces.Order {
	return interfaces.Any
}

func New(configFile string) []interfaces.FunctionMetadata {
	res := make([]interfaces.FunctionMetadata, 0)
	f := &scaleToSeconds{}
	functions := []string{"scaleToSeconds"}
	for _, n := range functions {
		res = append(res, interfaces.FunctionMetadata{Name: n, F: f})
	}
	return res
}

// scaleToSeconds(seriesList, seconds)
func (f *scaleToSeconds) Do(ctx context.Context, e parser.Expr, from, until int64, values map[parser.MetricRequest][]*types.MetricData) ([]*types.MetricData, error) {
	if e.ArgsLen() < 2 {
		return nil, parser.ErrMissingArgument
	}

	arg, err := helper.GetSeriesArg(ctx, e.Arg(0), from, until, values)
	if err != nil {
		return nil, err
	}
	seconds, err := e.GetFloatArg(1)
	if err != nil {
		return nil, err
	}
	secondsStr := strconv.Itoa(int(seconds))

	results := make([]*types.MetricData, len(arg))

	for j, a := range arg {
		r := a.CopyLink()
		r.Name = "scaleToSeconds(" + a.Name + "," + secondsStr + ")"
		r.Values = make([]float64, len(a.Values))
		r.Tags["scaleToSeconds"] = secondsStr

		factor := seconds / float64(a.StepTime)

		for i, v := range a.Values {
			r.Values[i] = v * factor
		}

		results[j] = r
	}
	return results, nil
}

// Description is auto-generated description, based on output of https://github.com/graphite-project/graphite-web
func (f *scaleToSeconds) Description() map[string]types.FunctionDescription {
	return map[string]types.FunctionDescription{
		"scaleToSeconds": {
			Description: "Takes one metric or a wildcard seriesList and returns \"value per seconds\" where\nseconds is a last argument to this functions.\n\nUseful in conjunction with derivative or integral function if you want\nto normalize its result to a known resolution for arbitrary retentions",
			Function:    "scaleToSeconds(seriesList, seconds)",
			Group:       "Transform",
			Module:      "graphite.render.functions",
			Name:        "scaleToSeconds",
			Params: []types.FunctionParam{
				{
					Name:     "seriesList",
					Required: true,
					Type:     types.SeriesList,
				},
				{
					Name:     "seconds",
					Required: true,
					Type:     types.Integer,
				},
			},
			NameChange:   true, // name changed
			ValuesChange: true, // values changed
		},
	}
}

repository: ihard/carbonapi

repo_name: ihard/carbonapi


text:
@article{Baudron2019d,
 abstract = {It remains unclear how agricultural landscapes can best serve multiple purposes such as simultaneously maintaining agricultural productivity and conserving biodiversity.},
 author = {Baudron, Frédéric and Schultner, Jannik and Duriaux, Jean-Yves and Gergel, Sarah E. and Sunderland, Terry},
 doi = {10.1007/s10980-019-00770-6},
 file = {:C$\backslash$:/Users/FBaudron/AppData/Local/Mendeley Ltd./Mendeley Desktop/Downloaded/Baudron et al. - 2019 - Agriculturally productive yet biodiverse human benefits and conservation values along a forest-agriculture gradi.pdf:pdf},
 isbn = {1098001900770},
 issn = {0921-2973},
 journal = {Landscape Ecology},
 keywords = {ecosystem services,land sparing,multi-functional landscapes},
 number = {2},
 pages = {341--356},
 title = {Agriculturally productive yet biodiverse: Human benefits and conservation values along a forest-agriculture gradient in Southern Ethiopia},
 volume = {34},
 year = {2019}
}

repository: FBaudron/starter-academic

repo_name: FBaudron/starter-academic


text:
package command

import (
	"math/rand"
	"regexp"
	"time"

	"github.com/rafaelbreno/go-bot/internal"
)

// CommandCtx stores data to prepare
// the messages to be sent
type CommandCtx struct {
	Ctx *internal.Context
	H   *CmdHelper
}

// Command store commands
type Command struct {
	Key         string
	Answer      string
	Options     []string
	Type        int
	HasCooldown bool
	Cooldown    time.Duration
	ExpireAt    int64
}

type Action struct {
	SentBy string
}

var commands = map[string]*Command{
	"!hello": {
		Key:         "!hello",
		Type:        Simple,
		Answer:      "Hello, {user}!",
		HasCooldown: true,
		Cooldown:    time.Duration(15 * time.Second),
		ExpireAt:    0,
	},
	"!signo": {
		Key:         "!signo",
		Type:        Random,
		HasCooldown: false,
		Answer:      "/me {user} decidiu trocar de signo, agora seu novo signo é: {answer}",
		Options:     lstSigno,
	},
	"!cupido": {
		Key:         "!cupido",
		Type:        Cupido,
		HasCooldown: false,
		Answer:      "/me {user} sua alma gêmea é: @{user_list}",
	},
}

var (
	cmdRegex = regexp.MustCompile(`^(!)[a-zA-Z0-9]{1,}`)
)

// GetAnswer receives a message to be sent
func (c *CommandCtx) GetAnswer(sentBy, inMessage string) string {
	cmdKey := string(cmdRegex.Find([]byte(inMessage)))

	var cmd *Command
	var ok bool

	if cmd, ok = commands[cmdKey]; !ok {
		return ""
	}

	action := &Action{
		SentBy: sentBy,
	}

	return cmd.prepare(action, c)
}

type keyMap map[string]string

func (c *Command) prepare(act *Action, ctx *CommandCtx) string {
	timeNow := time.Now()
	timeNowUnix := timeNow.Unix()

	rand.Seed(timeNowUnix)

	if c.HasCooldown {
		if !(c.ExpireAt == 0 || c.ExpireAt <= timeNowUnix) {
			return ""
		}
		c.ExpireAt = timeNow.Add(c.Cooldown).Unix()
	}

	switch c.Type {
	case Simple:
		return replace(c.Answer, keyMap{
			"{user}": act.SentBy,
		})
	case Random:
		if act.SentBy == "rafiusky" {
			return replace(c.Answer, keyMap{
				"{user}":   act.SentBy,
				"{answer}": "O Glorioso",
			})
		}
		if act.SentBy == "lajurubeba" {
			return replace(c.Answer, keyMap{
				"{user}":   act.SentBy,
				"{answer}": "espirro de loli",
			})
		}
		return replace(c.Answer, keyMap{
			"{user}":   act.SentBy,
			"{answer}": random(c.Options),
		})
	case Cupido:
		ans := ""

		ans = random(ctx.H.fetchUserList(), append(modBlacklist, "lajurubeba", "rafiusky", "rafiuskybot", act.SentBy)...)

		return replace(c.Answer, keyMap{
			"{user}":      act.SentBy,
			"{user_list}": ans,
		})
	default:
		return ""
	}
}

repository: rafaelbreno/go-bot

repo_name: rafaelbreno/go-bot


text:
% Example bibliography for BibTeX
% Help available at http://en.wikibooks.org/wiki/LaTeX/Bibliography_Management

% KIRJAT

@book{rubin2008handbook,
  title={Handbook of usability testing: how to plan, design and conduct effective tests},
  author={Rubin, Jeffrey and Chisnell, Dana},
  year={2008},
  publisher={John Wiley \& Sons}
}

@book{dumas1999practical,
  title={A practical guide to usability testing},
  author={Dumas, Joseph S and Redish, Janice},
  year={1999},
  publisher={Intellect books}
}

@book{albert2013measuring,
  title={Measuring the user experience: collecting, analyzing, and presenting usability metrics},
  author={Albert, William and Tullis, Thomas},
  year={2013},
  publisher={Newnes}
}

@book{
Solr-oula.410573,
title = {Usability inspection methods},
editor = {Nielsen, Jakob},
editor = {Mack, Robert L.},
address = {New York},
publisher = {Wiley},
year = {1994},
}

% ARTIKKELIT

@article{dis20099241,
  title={9241-210: 2010. Ergonomics of human system interaction-Part 210: Human-centred design for interactive systems},
  author={DIS, ISO},
  journal={International Standardization Organization (ISO). Switzerland},
  year={2009}
}

@inproceedings{nielsen1995usability,
  title={Usability inspection methods},
  author={Nielsen, Jakob},
  booktitle={Conference companion on Human factors in computing systems},
  pages={377--378},
  year={1995},
  organization={ACM}
}

@inproceedings{hollingsed2007usability,
  title={Usability inspection methods after 15 years of research and practice},
  author={Hollingsed, Tasha and Novick, David G},
  booktitle={Proceedings of the 25th annual ACM international conference on Design of communication},
  pages={249--255},
  year={2007},
  organization={ACM}
}

@article{holzinger2005usability,
  title={Usability engineering methods for software developers},
  author={Holzinger, Andreas},
  journal={Communications of the ACM},
  volume={48},
  number={1},
  pages={71--74},
  year={2005},
  publisher={ACM}
}

@article{trimble2014reconfigurable,
  title={Reconfigurable Software for Mission Operations},
  author={Trimble, Jay},
  year={2014}
}

@article{trimble2016open,
  title={Open Source Next Generation Visualization Software for Interplanetary Missions},
  author={Trimble, Jay and Rinker, George},
  year={2016}
}

@inproceedings{escoubet2001introduction,
  title={Introduction the cluster mission},
  author={Escoubet, CP and Fehringer, M and Goldstein, M},
  booktitle={Annales Geophysicae},
  volume={19},
  number={10/12},
  pages={1197--1200},
  year={2001}
}

@article{hassenzahl2010needs,
  title={Needs, affect, and interactive products--Facets of user experience},
  author={Hassenzahl, Marc and Diefenbach, Sarah and G{\"o}ritz, Anja},
  journal={Interacting with computers},
  volume={22},
  number={5},
  pages={353--362},
  year={2010},
  publisher={Oxford University Press}
}

@inproceedings{bevan2009difference,
  title={What is the difference between the purpose of usability and user experience evaluation methods},
  author={Bevan, Nigel},
  booktitle={Proceedings of the Workshop UXEM},
  volume={9},
  pages={1--4},
  year={2009}
}

@article{vaananen2008towards,
  title={Towards practical user experience evaluation methods},
  author={V{\"a}{\"a}n{\"a}nen-Vainio-Mattila, Kaisa and Roto, Virpi and Hassenzahl, Marc},
  journal={Meaningful measures: valid useful user experience measurement (VUUM)},
  pages={19--22},
  year={2008}
}

@inproceedings{laugwitz2008construction,
  title={Construction and evaluation of a user experience questionnaire},
  author={Laugwitz, Bettina and Held, Theo and Schrepp, Martin},
  booktitle={Symposium of the Austrian HCI and Usability Engineering Group},
  pages={63--76},
  year={2008},
  organization={Springer}
}

@article{battleson2001usability,
  title={Usability testing of an academic library web site: a case study},
  author={Battleson, Brenda and Booth, Austin and Weintrop, Jane},
  journal={The Journal of Academic Librarianship},
  volume={27},
  number={3},
  pages={188--198},
  year={2001},
  publisher={Elsevier}
}

@article{van2003retrospective,
  title={Retrospective vs. concurrent think-aloud protocols: testing the usability of an online library catalogue},
  author={Van Den Haak, Maaike and De Jong, Menno and Jan Schellens, Peter},
  journal={Behaviour \& information technology},
  volume={22},
  number={5},
  pages={339--351},
  year={2003},
  publisher={Taylor \& Francis}
}

@article{bevanevaluation,
author = {Petrie, Helen and Bevan, Nigel},
year = {2009},
month = {06},
pages = {},
title = {The Evaluation of Accessibility, Usability, and User Experience},
booktitle = {C Stepanidis}
}

@article{bevaniso,
author = {Bevan, Nigel and Carter, Jim and Earthy, Jonathan and Geis, Thomas and Harker, Susan},
year = {2016},
month = {07},
pages = {268-278},
title = {New ISO Standards for Usability, Usability Reports and Usability Measures},
volume = {9731},
isbn = {978-3-319-39509-8}
}

@article{bevanstandard,
author = {Bevan, Nigel},
year = {2009},
month = {05},
pages = {106-},
title = {International Standards for Usability Should Be More Widely Used},
volume = {4},
booktitle = {Journal Of Usability Studies}
}

@INPROCEEDINGS{4839639,
author={M. McCurdy},
booktitle={2009 IEEE Aerospace conference},
title={Planning tools for Mars surface operations: Human-Computer Interaction lessons learned},
year={2009},
pages={1-12},
keywords={Mars;aerospace computing;aerospace control;human computer interaction;planetary rovers;software engineering;Mars Science Laboratory;Mars Science Laboratory Mission;Mars exploration rovers;Mars surface operations;Phoenix Mars Lander mission;activity planning tools;human-computer interaction;planning tools;software tools;Human computer interaction;Laboratories;Land use planning;Mars;Orbital robotics;Resource management;Rough surfaces;Space vehicles;Surface roughness;Uncertainty},
doi={10.1109/AERO.2009.4839639},
ISSN={1095-323X},
month={March},}

@inproceedings{silva2000visualization,
  title={Visualization of linear time-oriented data: a survey},
  author={Silva, S{\^o}nia Fernandes and Catarci, Tiziana},
  booktitle={Web Information Systems Engineering, 2000. Proceedings of the First International Conference on},
  volume={1},
  pages={310--319},
  year={2000},
  organization={IEEE}
}

@article{friendly2008brief,
  title={A brief history of data visualization},
  author={Friendly, Michael},
  journal={Handbook of data visualization},
  pages={15--56},
  year={2008},
  publisher={Springer}
}

@article{hassenzahl2006user,
  title={User Experience-Towards a unified view},
  author={Hassenzahl, Marc and Law, E Lai-Chong and Hvannberg, Ebba Thora},
  journal={Ux Ws Nordichi},
  volume={6},
  pages={1--3},
  year={2006}
}

@article{likert1932technique,
  title={A technique for the measurement of attitudes.},
  author={Likert, Rensis},
  journal={Archives of psychology},
  year={1932}
}

@article{hornbaek2006current,
  title={Current practice in measuring usability: Challenges to usability studies and research},
  author={Hornb{\ae}k, Kasper},
  journal={International journal of human-computer studies},
  volume={64},
  number={2},
  pages={79--102},
  year={2006},
  publisher={Elsevier}
}

@incollection{hassenzahl2003attrakdiff,
  title={AttrakDiff: Ein Fragebogen zur Messung wahrgenommener hedonischer und pragmatischer Qualit{\"a}t},
  author={Hassenzahl, Marc and Burmester, Michael and Koller, Franz},
  booktitle={Mensch \& Computer 2003},
  pages={187--196},
  year={2003},
  publisher={Springer}
}

@article{chin1988questionnaire,
  title={Questionnaire for user interface satisfaction},
  author={Chin, JP and Diehl, VA and Norman, KL},
  journal={World Wide Web (http://www. acm. org/\~{} perlam/guestions. cgi},
  year={1988}
}

@article{brooke1996sus,
  title={SUS-A quick and dirty usability scale},
  author={Brooke, John and others},
  journal={Usability evaluation in industry},
  volume={189},
  number={194},
  pages={4--7},
  year={1996},
  publisher={London, United kingdom}
}

@inproceedings{schrepp2014applying,
  title={Applying the User Experience Questionnaire (UEQ) in different evaluation scenarios},
  author={Schrepp, Martin and Hinderks, Andreas and Thomaschewski, J{\"o}rg},
  booktitle={International Conference of Design, User Experience, and Usability},
  pages={383--392},
  year={2014},
  organization={Springer}
}

@article{rauschenberger2013efficient,
  title={Efficient measurement of the user experience of interactive products. How to use the user experience questionnaire (ueq). Example: spanish language version},
  author={Rauschenberger, Maria and Schrepp, Martin and Cota, Manuel P{\'e}rez and Olschner, Siegfried and Thomaschewski, J{\"o}rg},
  journal={International Journal of Artificial Intelligence and Interactive Multimedia. 2013; 2 (1): 39-45},
  year={2013},
  publisher={Universidad Internacional de La Rioja (UNIR)}
}

@inproceedings{tullis2004comparison,
  title={A comparison of questionnaires for assessing website usability},
  author={Tullis, Thomas S and Stetson, Jacqueline N},
  booktitle={Usability professional association conference},
  pages={1--12},
  year={2004}
}

@article{schrepp2017construction,
  title={Construction of a Benchmark for the User Experience Questionnaire (UEQ).},
  author={Schrepp, Martin and Hinderks, Andreas and Thomaschewski, J{\"o}rg},
  journal={IJIMAI},
  volume={4},
  number={4},
  pages={40--44},
  year={2017}
}

@article{hassenzahl2004interplay,
  title={The interplay of beauty, goodness, and usability in interactive products},
  author={Hassenzahl, Marc},
  journal={Human-computer interaction},
  volume={19},
  number={4},
  pages={319--349},
  year={2004},
  publisher={L. Erlbaum Associates Inc.}
}

@article{beck2001manifesto,
  title={Manifesto for agile software development},
  author={Beck, Kent and Beedle, Mike and Van Bennekum, Arie and Cockburn, Alistair and Cunningham, Ward and Fowler, Martin and Grenning, James and Highsmith, Jim and Hunt, Andrew and Jeffries, Ron and others},
  year={2001}
}

@article{grenning2002planning,
  title={Planning poker or how to avoid analysis paralysis while release planning},
  author={Grenning, James},
  journal={Hawthorn Woods: Renaissance Software Consulting},
  volume={3},
  year={2002}
}

@article{farber2016automation,
  title={Automation of Ground Station Scheduling for the Cluster Mission using an Artificial Intelligence Framework},
  author={F{\"a}rber, Nicolas},
  year={2016}
}

@article{abran2003usability,
  title={Usability meanings and interpretations in ISO standards},
  author={Abran, Alain and Khelifi, Adel and Suryn, Witold and Seffah, Ahmed},
  journal={Software Quality Journal},
  volume={11},
  number={4},
  pages={325--338},
  year={2003},
  publisher={Springer}
}

@incollection{winter2008comprehensive,
  title={A comprehensive model of usability},
  author={Winter, Sebastian and Wagner, Stefan and Deissenboeck, Florian},
  booktitle={Engineering interactive systems},
  pages={106--122},
  year={2008},
  publisher={Springer}
}

@article{student1908probable,
  title={The probable error of a mean},
  author={Student},
  journal={Biometrika},
  pages={1--25},
  year={1908},
  publisher={JSTOR}
}

@article{cronbach1951coefficient,
  title={Coefficient alpha and the internal structure of tests},
  author={Cronbach, Lee J},
  journal={psychometrika},
  volume={16},
  number={3},
  pages={297--334},
  year={1951},
  publisher={Springer}
}

%
%    MUUT
%

@misc{esasci,
  organization = {European Space Agency},
  title = {ESA Science \& Technology: Cluster},
  url = {http://sci.esa.int/cluster/},
  note = "Accessed 29.8.2017.",
}

@misc{esacluster,
  organization = {European Space Agency},
  title = {Cluster II Operations},
  url = {http://www.esa.int/Our_Activities/Operations/Cluster_II_operations},
  note = "Accessed 29.8.2017"
}

@misc{boss,
  organization = {Solenix GmbH},
  title = {BOSS Dashboard},
  url = {https://www.solenix.ch/boss},
  note = "Accessed 17.12.2017"
}

@misc{visjs,
  organization = {vis.js},
  title = {timeline - vis.js - A dynamic, browser based visualization library.},
  url = {http://visjs.org/docs/timeline/},
  note = "Accessed 29.8.2017"
}

@misc{scrum,
  author = {Ken Schwaber and Jeff Sutherland},
  title = {The Scrum Guide},
  url = {http://www.scrumguides.org/docs/scrumguide/v2016/2016-Scrum-Guide-US.pdf},
  year = {2016},
  note = "Accessed 10.11.2017"
}

@misc{ibm_timeline,
  author = {Iftekharul Islam},
  title = {Creating a timeline of events based on customer feedback},
  url = {https://medium.com/design-ibm/creating-a-timeline-of-events-based-on-customer-feedback-79e6d3d50575},
  year = {2017},
  note = "Accessed 30.8.2017"
}

@misc{attrakdiff,
  author = {User Interface Design GmbH},
  title = {AttrakDiff},
  url = {http://attrakdiff.de/index-en.html},
  note = "Accessed 22.9.2017"
}

@misc{mousotron,
  author = {Blacksun Software},
  title = {Mousotron: Mouse and keyboard usage counter},
  url = {http://www.blacksunsoftware.com/mousotron.html},
  note = "Accessed 28.9.2017"
}

@misc{taiga,
  title = {Taiga.io},
  url = {https://taiga.io/},
  note = "Accessed 16.11.2017"
}

@misc{angular,
  title = {Angular},
  url = {https://angular.io/},
  note = "Accessed 16.11.2017"
}

@misc{django,
  title = {Django REST Framework},
  url = {http://www.django-rest-framework.org/},
  year = {2017},
  note = "Accessed 16.11.2017"
}

@misc{d3js,
  title = {D3.js - Data-Driven Documents},
  url = {https://d3js.org/},
  note = "Accessed 16.11.2017"
}

@misc{mariadb,
  title = {MariaDB.org - Supporting continuity and open collaboration},
  url = {https://mariadb.org/},
  note = "Accessed 17.11.2017"
}

@misc{jwt,
  title = {Django REST framework JWT},
  url = {https://getblimp.github.io/django-rest-framework-jwt/},
  note = "Accessed 18.11.2017"
}

@misc{t_test,
  title = {Social Research Methods - Knowledge Base - The T-Test},
  url = {http://www.socialresearchmethods.net/kb/stat_t.php},
  note = "Accessed 21.01.2018"
}

repository: Karriz/thesis

repo_name: Karriz/thesis


text:
DESCRIPTION = "Connect to IBM Watson Internet of Things Plaform as a Device or Gateway"
AUTHOR = "Nick O'Leary"
HOMEPAGE = "https://github.com/ibm-watson-iot/node-red-contrib-ibm-watson-iot"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=9812725859172d1c78fb60518d16fe64"

inherit npm

RDEPENDS_${PN} = "\
    bash \
    node-red \
"

SRC_URI = "npm://registry.npmjs.org;name=${BPN};version=${PV}"

PR = "r1"

NPMPN = "${BPN}"
NPM_LOCKDOWN := "${THISDIR}/${BPN}/package-lock.json"
NPM_SHRINKWRAP := "${THISDIR}/${BPN}/npm-shrinkwrap.json"

repository: farnerup/meta-iot-cloud

repo_name: farnerup/meta-iot-cloud


text:
package p488

func findMinStep(board string, hand string) int {

	m := len(hand)

	for i := 1; i <= m; i++ {
		used := make([]bool, m)
		if try(0, i, m, used, &hand, board) {
			return i
		}
	}

	return -1
}

func try(i, tot, lim int, used []bool, hand *string, board string) bool {

	if i == tot {
		if board == "" {
			return true
		} else {
			return false
		}
	}

	for k := 0; k < lim; k++ {
		if !used[k] {
			used[k] = true
			for j := 0; j <= len(board); j++ {
				// There is no point breaking a continous chain
				if j > 0 && j < len(board) && board[j] == board[j-1] {
					continue
				}
				// Key optimization:
				// only insert (*hand)[k] when it is the same color with one neighbor
				if (j < len(board) && board[j] == (*hand)[k]) || (j > 0 && board[j-1] == (*hand)[k]) {
					t := board[:j] + string((*hand)[k]) + board[j:]
					t = shrink(t)

					if try(i+1, tot, lim, used, hand, t) {
						return true
					}
				}

			}
			used[k] = false
		}
	}

	return false
}

func shrink(s string) string {
	n := len(s)
	if n == 0 {
		return ""
	}
	if n < 3 {
		return s
	}

	for i := 0; i < n-2; i++ {
		if s[i] == s[i+1] && s[i] == s[i+2] {
			j := i + 3
			for j < n && s[j] == s[i] {
				j++
			}
			t := s[:i] + s[j:]
			return shrink(t)
		}
	}
	return s
}


text:
require devio.inc

SRC_URI[md5sum] = "5d332c2bffc0791367bcf3368ba1a0d1"
SRC_URI[sha256sum] = "a71e87f49f52cd90dbd45431f65e83d18e073fb2669f91c29c59019b175cd5a8"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty


text:
package mongo

import (
	"time"

	"github.com/spf13/cobra"
	"github.com/wal-g/tracelog"
	"github.com/wal-g/wal-g/internal"
	"github.com/wal-g/wal-g/internal/databases/mongo"
	"github.com/wal-g/wal-g/internal/databases/mongo/archive"
)

const (
	retainAfterFlag  = "retain-after"
	retainCountFlag  = "retain-count"
	purgeOplogFlag   = "purge-oplog"
	purgeGarbageFlag = "purge-garbage"
)

var (
	confirmed    bool
	purgeOplog   bool
	purgeGarbage bool
	retainAfter  string
	retainCount  uint
)

// deleteCmd represents the delete command
var deleteCmd = &cobra.Command{
	Use:   "delete",
	Short: "Clears old backups and oplog",
	Run:   runPurge,
}

func runPurge(cmd *cobra.Command, args []string) {
	opts := []mongo.PurgeOption{
		mongo.PurgeDryRun(!confirmed),
		mongo.PurgeOplog(purgeOplog),
		mongo.PurgeGarbage(purgeGarbage)}
	if cmd.Flags().Changed(retainAfterFlag) {
		retainAfterTime, err := time.Parse(time.RFC3339, retainAfter)
		tracelog.ErrorLogger.FatalfOnError("Can not parse retain time: %v", err)
		opts = append(opts, mongo.PurgeRetainAfter(retainAfterTime))
	} else if cmd.Flags().Changed(purgeOplogFlag) {
		tracelog.ErrorLogger.Fatalf("Flag %q requires %q to be passed\n", purgeOplogFlag, retainAfterFlag)
	}

	if cmd.Flags().Changed(retainCountFlag) {
		opts = append(opts, mongo.PurgeRetainCount(int(retainCount)))
	}

	// set up storage downloader client
	downloader, err := archive.NewStorageDownloader(archive.NewDefaultStorageSettings())
	tracelog.ErrorLogger.FatalOnError(err)

	// set up storage downloader client
	purger, err := archive.NewStoragePurger(archive.NewDefaultStorageSettings())
	tracelog.ErrorLogger.FatalOnError(err)

	err = mongo.HandlePurge(downloader, purger, opts...)
	tracelog.ErrorLogger.FatalOnError(err)
}

func init() {
	cmd.AddCommand(deleteCmd)
	deleteCmd.Flags().BoolVar(&confirmed, internal.ConfirmFlag, false, "Confirms backup, garbage and oplog deletion."+
		" If `retainAfterFlag` and `retainCountFlag` are not specified then all backups will be retained.")

	deleteCmd.Flags().BoolVar(&purgeOplog, purgeOplogFlag, false, "Purge oplog archives")
	deleteCmd.Flags().BoolVar(&purgeGarbage, purgeGarbageFlag, false, "Purge garbage in backup folder")
	deleteCmd.Flags().StringVar(&retainAfter, retainAfterFlag, "", "Keep backups newer")
	deleteCmd.Flags().UintVar(&retainCount, retainCountFlag, 0, "Keep minimum count, except permanent backups")
}

repository: wal-g/wal-g

repo_name: wal-g/wal-g

gha_license_id: NOASSERTION


text:
SECTION = "x11/libs"
inherit gpe
LICENSE = "LGPL"
DEPENDS = "esound"

do_stage() {
	install -d ${STAGING_INCDIR}/gpe
	install -m 0644 gpe/soundgen.h ${STAGING_INCDIR}/gpe/soundgen.h
	oe_libinstall -so libsoundgen ${STAGING_LIBDIR}
}

do_install_append() {
	oe_runmake DESTDIR="${D}" PREFIX="${prefix}" install-devel
}

SRC_URI[md5sum] = "5a36bc38b8b70a0951fb3acc479503f5"
SRC_URI[sha256sum] = "d74ed600fab1bf5bab86a4815a5170157607317030bd9316e587486e29e815f8"


text:
DESCRIPTION = "Simple DirectMedia Layer - QtE-based Palmtop Environments Edition"
SECTION = "opie/libs"
PRIORITY = "optional"
MAINTAINER = "Michael 'Mickey' Lauer <mickey@Vanille.de>"
DEPENDS = "virtual/libqpe libopie2"
PROVIDES = "virtual/libsdl"
LICENSE = "LGPL"
PR = "r4"

SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \
           file://agawa-piro-mickey.patch;patch=1 \
           file://pygame.patch;patch=1 \
           file://gcc34.patch;patch=1 \
           file://mouse.patch;patch=1 \
	   file://kill-stdc++.patch;patch=1 \
	   file://ipaq.patch;patch=1 "
S = "${WORKDIR}/SDL-${PV}"

inherit autotools

EXTRA_OECONF = "--disable-debug --enable-cdrom --enable-threads --enable-timers --enable-endian \
                --enable-file --enable-oss --disable-alsa --disable-esd --disable-arts \
                --disable-diskaudio --disable-nas --disable-esd-shared --disable-esdtest \
                --disable-mintaudio --disable-nasm --disable-video-x11 --disable-video-dga \
                --disable-video-fbcon --disable-video-directfb --disable-video-ps2gs \
                --disable-video-xbios --disable-video-gem --disable-video-dummy \
                --disable-video-opengl --enable-input-events --enable-pthreads \
                --disable-video-picogui --enable-video-qtopia --enable-dlopen"

do_stage() {
	oe_libinstall -so -C src libSDL ${STAGING_LIBDIR}
	ln -sf libSDL.so ${STAGING_LIBDIR}/libSDL-1.2.so
	install -m 0655 src/main/libSDLmain.a src/main/.libs/
	oe_libinstall -a -C src/main libSDLmain ${STAGING_LIBDIR}

	install -d ${STAGING_INCDIR}/SDL
	for f in include/*.h
	do
		install -m 0644 $f ${STAGING_INCDIR}/SDL/
	done

	cat sdl-config | sed -e "s,-I/usr/include/SDL,-I${STAGING_INCDIR}/SDL," \
	               | sed -e "s,libdirs ,mickey_is_cool ," \
                       | sed -e "s,-lSDL ,-lSDL-1.2 , "> ${STAGING_BINDIR}/sdl-config
        chmod a+rx ${STAGING_BINDIR}/sdl-config
}


text:
@article{Rogers-2021-Daily,
    title = "Daily leaf area index from photosynthetically active radiation for long term records of canopy structure and leaf phenology",
    author = "Rogers, Cheryl  and
      Chen, Jing M.  and
      Croft, Holly  and
      Gonsamo, Alemu  and
      Luo, Xiangzhong  and
      Bartlett, Paul  and
      Staebler, Ralf M.",
    journal = "Agricultural and Forest Meteorology, Volume 304-305",
    volume = "304",
    year = "2021",
    publisher = "Elsevier BV",
    url = "https://aclanthology.org/G21-14001",
    doi = "10.1016/j.agrformet.2021.108407",
    pages = "108407",
}

repository: gwf-uwaterloo/gwf-publications

repo_name: gwf-uwaterloo/gwf-publications

gha_language: Python


text:
@article{mckinnon_tropical_2014,
 abstract = {Tropical marginal seas (TMSs) are natural subregions of tropical oceans containing biodiverse ecosystems with conspicuous, valued, and vulnerable biodiversity assets. They are focal points for global marine conservation because they occur in regions where human populations are rapidly expanding. Our review of 11 TMSs focuses on three key ecosystems—coral reefs and emergent atolls, deep benthic systems, and pelagic biomes—and synthesizes, illustrates, and contrasts knowledge of biodiversity, ecosystem function, interaction between adjacent habitats, and anthropogenic pressures. TMSs vary in the extent that they have been subject to human inﬂuence—from the nearly pristine Coral Sea to the heavily exploited South China and Caribbean Seas—but we predict that they will all be similarly complex to manage because most span multiple national jurisdictions. We conclude that developing a structured process to identify ecologically and biologically signiﬁcant areas that uses a set of globally agreed criteria is a tractable ﬁrst step toward effective multinational and transboundary ecosystem management of TMSs.},
 author = {McKinnon, A. David and Williams, Alan and Young, Jock and Ceccarelli, Daniela and Dunstan, Piers and Brewin, Robert J.W. and Watson, Reg and Brinkman, Richard and Cappo, Mike and Duggan, Samantha and Kelley, Russell and Ridgway, Ken and Lindsay, Dhugal and Gledhill, Daniel and Hutton, Trevor and Richardson, Anthony J.},
 doi = {10.1146/annurev-marine-010213-135042},
 file = {McKinnon et al. - 2014 - Tropical Marginal Seas Priority Regions for Manag.pdf:/Users/ric325/Zotero/storage/8QHBLJZ3/McKinnon et al. - 2014 - Tropical Marginal Seas Priority Regions for Manag.pdf:application/pdf},
 issn = {1941-1405, 1941-0611},
 journal = {Annual Review of Marine Science},
 language = {en},
 month = {January},
 number = {1},
 pages = {415--437},
 shorttitle = {Tropical Marginal Seas},
 title = {Tropical Marginal Seas: Priority Regions for Managing Marine Biodiversity and Ecosystem Function},
 url = {http://www.annualreviews.org/doi/10.1146/annurev-marine-010213-135042},
 urldate = {2019-10-24},
 volume = {6},
 year = {2014}
}


text:
package main

import (
	"flag"
	"fmt"
	"log"
	"net"
	"os"
)

var (
	logger = log.New(os.Stdout, "[udp-server] ", log.LstdFlags)

	host = flag.String("host", "0.0.0.0", "host to listen on")
	port = flag.Int("port", 0, "port to listen on")

	blockSize = flag.Int("size", 1024, "block size to read packets on")
)

func main() {
	flag.Parse()

	ip := net.ParseIP(*host)
	listener, err := net.ListenUDP("udp", &net.UDPAddr{IP: ip, Port: *port})
	if err != nil {
		fmt.Println(err)
		return
	}

	logger.Printf("listening on addr=%s with block size=%d", listener.LocalAddr(), *blockSize)

	data := make([]byte, *blockSize)
	for {
		n, remoteAddr, err := listener.ReadFrom(data)
		if err != nil {
			logger.Fatalf("error during read: %s", err)
		}

		logger.Printf("<%s> %s", remoteAddr, data[:n])

		_, err = listener.WriteTo(data[:n], remoteAddr)
		if err != nil {
			logger.Fatalf("error during write: %s", err)
		}
	}
}

repository: VicRen/go-playground

repo_name: VicRen/go-playground


text:
FILE(REMOVE_RECURSE
  "CMakeFiles/inline.dir/inline.c.o"
  "../../lib/libinline.pdb"
  "../../lib/libinline.so"
)

# Per-language clean rules from dependency scanning.
FOREACH(lang C)
  INCLUDE(CMakeFiles/inline.dir/cmake_clean_${lang}.cmake OPTIONAL)
ENDFOREACH(lang)

repository: melbshark/DynamoRIO-for-ARM

repo_name: melbshark/DynamoRIO-for-ARM


text:
@book{graphtheory,
  title={Graph Theory 1736-1936},
  author={Norman L. Biggs, E. Keith Lloyd, and Robin J. Wilson},
  isbn={978-0-19-853916-2},
  url={http://ukcatalogue.oup.com/product/9780198539162.do},
  year={11 December 1986},
  publisher={Clarendon Press}
}

@article{optimization,
   TITLE   = {Optimization, Learning and Natural Algorithms},
   AUTHOR  = {Durigo Marco},
   YEAR    = {1992},
   JOURNAL = {Ph.D.Thesis},
   url = {http://iridia.ulb.ac.be/dorigo/pub_x_subj.html#Ants}
}

@article{Randall20021421,
    title = "A Parallel Implementation of Ant Colony Optimization",
    journal = "Journal of Parallel and Distributed Computing",
    volume = "62",
    number = "9",
    pages = "1421 - 1432",
    year = "2002",
    note = "",
    issn = "0743-7315",
    doi = "10.1006/jpdc.2002.1854",
    url = "http://www.sciencedirect.com/science/article/pii/S074373150291854X",
    author = "Marcus Randall and Andrew Lewis",
    keywords = "ant colony optimization",
    keywords = "parallelization",
    keywords = "travelling salesman problem."
}

@article{Bruxelles2006,
    title = {Parallel Ant Colony Optimization for the Traveling Salesman Problem},
    year = {2006},
    url = {http://code.ulb.ac.be/dbfiles/ManBirStuDor2006ants.pdf},
    author = {Max Manfrin, Mauro Birattari, Thomas St\"{u}tzle, and Marco Dorigo},
}

repository: dpatti/parallel-tsp

repo_name: dpatti/parallel-tsp


text:
package impl

import (
	"errors"
	"fmt"
	"testing"

	. "github.com/smartystreets/goconvey/convey"
	"github.com/ttacon/pouch"
)

func TestDynamicPouch(t *testing.T) {
	Convey("given a dynamic pouch", t, func() {
		d := NewDynamicPouch(map[string]string{
			"dynamo:foo": "spinach",
			"dynamo:bar": "kale",
			"dynamo:baz": "mocha",
		})
		Convey("with no defined functions", func() {
			Convey("it should error out when trying to do anything", func() {
				err := d.Find(nil)
				So(err, ShouldNotBeNil)
				So(err.Error(), ShouldEqual, "no Find function has been defined")
			})
		})

		Convey("with only find defined", func() {
			d.SetFind(func(f pouch.Findable, i interface{}) error {
				var m, ok = i.(map[string]string)
				if !ok {
					return errors.New("unexpected data backer")
				}
				_, vals := f.IdentifiableFields()
				id := fmt.Sprintf(f.Table(), vals...)

				v, ok := m[id]
				if !ok {
					return errors.New("failed to find desired entity")
				}
				fields := f.GetFieldsFor([]string{"col"})
				field := fields[0].(*string)
				*field = v
				return nil
			})

			t0 := &dynamicTestStruct{
				id: "foo",
			}

			err := d.Find(t0)
			So(err, ShouldBeNil)
			So(t0.field, ShouldEqual, "spinach")

			Convey("but if we try to create something, it won't work", func() {
				t0 := &dynamoTestWrapper{
					id:    "yolo",
					field: "yoloBuds",
				}
				err := d.Create(t0)
				So(err, ShouldNotBeNil)
				So(err.Error(), ShouldEqual, "no Create function has been defined")
			})
		})
		Convey("with only findAll defined", func() {
			t0 := &dynamicTestStruct{id: "foo"}
			t1 := &dynamicTestStruct{id: "bar"}
			t2 := &dynamicTestStruct{id: "baz"}
			fs := []pouch.Findable{t0, t1, t2}
			err := d.FindAll(fs)
			So(err, ShouldNotBeNil)
			So(err.Error(), ShouldEqual, "no FindAll function has been defined")

			d.SetFindAll(func(fs []pouch.Findable, i interface{}) error {
				var m, ok = i.(map[string]string)
				if !ok {
					return errors.New("unexpected data backer")
				}

				for _, f := range fs {
					_, vals := f.IdentifiableFields()
					id := fmt.Sprintf(f.Table(), vals...)

					v, ok := m[id]
					if !ok {
						return errors.New("failed to find desired entity")
					}
					fields := f.GetFieldsFor([]string{"col"})
					field := fields[0].(*string)
					*field = v
				}
				return nil
			})

			err = d.FindAll(fs)
			So(err, ShouldBeNil)
			So(t0.field, ShouldEqual, "spinach")
			So(t1.field, ShouldEqual, "kale")
			So(t2.field, ShouldEqual, "mocha")

			Convey("but if we try to create something, it won't work", func() {
				t0 := &dynamoTestWrapper{
					id:    "yolo",
					field: "yoloBuds",
				}
				err := d.Create(t0)
				So(err, ShouldNotBeNil)
				So(err.Error(), ShouldEqual, "no Create function has been defined")
			})
		})
		Convey("with only create defined", func() {
			t0 := &dynamoTestWrapper{id: "olaf"}
			err := d.Create(t0)
			So(err, ShouldNotBeNil)
			So(err.Error(), ShouldEqual, "no Create function has been defined")

			d.SetCreate(func(c pouch.Createable, i interface{}) error {
				var m, ok = i.(map[string]string)
				if !ok {
					return errors.New("unexpected data backer")
				}

				_, fields := c.InsertableFields()
				field, ok := fields[0].(string)
				if !ok {
					return errors.New("invalid insertable field type")
				}

				m[c.Table()] = field
				return nil
			})
			err = d.Create(t0)
			So(err, ShouldBeNil)
		})
		Convey("with only createAll defined", func() {
			t0 := &dynamoTestWrapper{id: "olaf"}
			t1 := &dynamoTestWrapper{id: "bar"}
			t2 := &dynamoTestWrapper{id: "baz"}
			cs := []pouch.Createable{t0, t1, t2}
			err := d.CreateAll(cs)
			So(err, ShouldNotBeNil)
			So(err.Error(), ShouldEqual, "no CreateAll function has been defined")

			d.SetCreateAll(func(cs []pouch.Createable, i interface{}) error {
				var m, ok = i.(map[string]string)
				if !ok {
					return errors.New("unexpected data backer")
				}
				for _, c := range cs {
					_, fields := c.InsertableFields()
					field, ok := fields[0].(string)
					if !ok {
						return errors.New("invalid insertable field type")
					}

					m[c.Table()] = field
				}
				return nil
			})
			err = d.CreateAll(cs)
			So(err, ShouldBeNil)
		})
		Convey("with only update defined", func() {
			t0 := &dynamoTestWrapper{
				id:    "baz",
				field: "vanillaLatte",
			}
			err := d.Update(t0)
			So(err, ShouldNotBeNil)
			So(err.Error(), ShouldEqual, "no Update function has been defined")

			d.SetUpdate(func(c pouch.Updateable, i interface{}) error {
				var m, ok = i.(map[string]string)
				if !ok {
					return errors.New("unexpected data backer")
				}

				_, fields := c.InsertableFields()
				field, ok := fields[0].(string)
				if !ok {
					return errors.New("invalid insertable field type")
				}

				if _, ok := m[c.Table()]; !ok {
					return errors.New("entity does not exist, refusing to update")
				}

				m[c.Table()] = field
				return nil
			})

			err = d.Update(t0)
			So(err, ShouldBeNil)
		})
		Convey("with only updateAll defined", func() {
			t0 := &dynamoTestWrapper{
				id:    "baz",
				field: "vanillaLatte",
			}
			t1 := &dynamoTestWrapper{
				id:    "bar",
				field: "blueBerries",
			}
			err := d.UpdateAll([]pouch.Updateable{t0, t1})
			So(err, ShouldNotBeNil)
			So(err.Error(), ShouldEqual, "no UpdateAll function has been defined")

			d.SetUpdateAll(func(cs []pouch.Updateable, i interface{}) error {
				var m, ok = i.(map[string]string)
				if !ok {
					return errors.New("unexpected data backer")
				}
				for _, c := range cs {
					_, fields := c.InsertableFields()
					field, ok := fields[0].(string)
					if !ok {
						return errors.New("invalid insertable field type")
					}

					if _, ok := m[c.Table()]; !ok {
						return errors.New("entity does not exist, refusing to update")
					}

					m[c.Table()] = field
				}
				return nil
			})

			err = d.UpdateAll([]pouch.Updateable{t0, t1})
			So(err, ShouldBeNil)
		})
		Convey("with only dlete defined", func() {
			t0 := &dynamoTestWrapper{id: "baz"}

			err := d.Delete(t0)
			So(err, ShouldNotBeNil)
			So(err.Error(), ShouldEqual, "no Delete function has been defined")

			d.SetDlete(func(d pouch.Deleteable, i interface{}) error {
				var m, ok = i.(map[string]string)
				if !ok {
					return errors.New("unexpected data backer")
				}

				if _, ok := m[d.Table()]; !ok {
					return errors.New("entity does not exist, can't delete")
				}

				delete(m, d.Table())
				return nil
			})

			err = d.Delete(t0)
			So(err, ShouldBeNil)
		})
		Convey("with only dleteAll defined", func() {
			t0 := &dynamoTestWrapper{id: "baz"}
			t1 := &dynamoTestWrapper{id: "bar"}

			err := d.DeleteAll([]pouch.Deleteable{t0, t1})
			So(err, ShouldNotBeNil)
			So(err.Error(), ShouldEqual, "no DeleteAll function has been defined")

			d.SetDleteAll(func(ds []pouch.Deleteable, i interface{}) error {
				var m, ok = i.(map[string]string)
				if !ok {
					return errors.New("unexpected data backer")
				}
				for _, d := range ds {
					if _, ok := m[d.Table()]; !ok {
						return errors.New("entity does not exist, can't delete")
					}

					delete(m, d.Table())
				}
				return nil
			})

			err = d.DeleteAll([]pouch.Deleteable{t0, t1})
			So(err, ShouldBeNil)
		})
	})
}

type dynamicTestStruct struct {
	id    string
	field string
}

func (d *dynamicTestStruct) GetFieldsFor(cols []string) []interface{} {
	return []interface{}{&d.field}
}

func (d *dynamicTestStruct) GetAllFields() ([]string, []interface{}) {
	return nil, nil
}

func (d *dynamicTestStruct) Table() string {
	return "dynamo:%s"
}

func (d *dynamicTestStruct) FindableCopy() pouch.Findable {
	return nil
}

func (d *dynamicTestStruct) IdentifiableFields() ([]string, []interface{}) {
	return nil, []interface{}{d.id}
}

type dynamoTestWrapper dynamicTestStruct

func (d *dynamoTestWrapper) IdentifiableFields() ([]string, []interface{}) {
	return nil, []interface{}{d.id}
}

func (d *dynamoTestWrapper) FieldsFor(s []string) []interface{} {
	return nil
}

func (d *dynamoTestWrapper) InsertableFields() ([]string, []interface{}) {
	return []string{"field"}, []interface{}{d.field}
}

func (d *dynamoTestWrapper) SetIdentifier(i interface{}) error {
	return nil
}

func (d *dynamoTestWrapper) Table() string {
	return "dynamo:" + d.id
}

repository: ttacon/pouch

repo_name: ttacon/pouch


text:
@article{Karl2019,
author = {Karl, Johannes and Walsh, Amy T and Robinson, Kealagh and Twitichin, Samuel},
journal = {Psychology Aotearoa},
number = {1},
pages = {46--49},
title = {{Developing the credibility of psychological science: Graduate student reflections on open science}},
volume = {11},
year = {2019}
}

repository: Jo-Karl/JoKarl

repo_name: Jo-Karl/JoKarl


text:
DESCRIPTION = "iCommand bluez binding"
LICENSE = "LGPL"
SECTION = "libs"
HOMEPAGE = "http://sourceforge.net/projects/nxtcommand/"
AUTHOR = "Brian Bagnall <bbagnall at users.sourceforge.net>"

inherit java

SRC_URI = "\
    svn://nxtcommand.svn.sourceforge.net/svnroot/nxtcommand;module=icommand-projects/trunk/icommand-bluez;rev=134;proto=https \
    file://makefile.patch \
    "

DEPENDS = "bluez-libs"

S = "${WORKDIR}/icommand-projects/trunk/icommand-bluez/Release"

do_compile() {
  oe_runmake -f makefile clean
  oe_runmake -f makefile all \
    INCLUDES="-I${STAGING_INCDIR}/classpath " \
    LIBS="-lbluetooth"
}

do_install() {
  oe_libinstall -so libicmdbluez  ${D}${libdir_jni}
}

PACKAGES = "${PN}-jni ${PN}-jni-dbg"

RDEPENDS_${PN}-jni = "bluez-libs"

FILES_${PN}-jni = "${libdir_jni}/lib*.so"
FILES_${PN}-jni-dbg = "${libdir_jni}/.debug/lib*.so"


text:
DESCRIPTION = "Firmware files for RTL8723BS and RTL8723CS"
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://README.md;md5=779f37dae32d47374b491836b4c5d94d"

COMPATIBLE_MACHINE = "pine-a64-lts|sopine-a64"

inherit module

SRCREV = "cc77e7b6092c54500058cd027b679421b9399905"
SRC_URI = " \
    git://github.com/hadess/rtl8723bs.git;protocol=git;branch=master \
"

S = "${WORKDIR}/git"

do_configure() {
}

#do_compile() {
#}

do_install() {
    install -d ${D}/lib/firmware/rtlwifi/
    install -m 0644 ${S}/rtl8723bs_nic.bin ${D}/lib/firmware/rtlwifi/rtl8723bs_nic.bin
    install -m 0644 ${S}/rtl8723bs_wowlan.bin ${D}/lib/firmware/rtlwifi/rtl8723bs_wowlan.bin
}

FILES_${PN} = "/lib/firmware/rtlwifi"


text:
@Manual{R-lavaan,
  title = {lavaan: Latent Variable Analysis},
  author = {Yves Rosseel and Terrence D. Jorgensen and Nicholas Rockwood},
  year = {2020},
  note = {R package version 0.6-7.1570},
  url = {http://lavaan.org},
}

@Article{lavaan2012,
  title = {{lavaan}: An {R} Package for Structural Equation Modeling},
  author = {Yves Rosseel},
  journal = {Journal of Statistical Software},
  year = {2012},
  volume = {48},
  number = {2},
  pages = {1--36},
  url = {http://www.jstatsoft.org/v48/i02/},
}

repository: aaronpeikert/croons

repo_name: aaronpeikert/croons