text:
/// <reference path="heat_types.ts" />
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
define(["require", "exports", "./core", "./heat_types"], function (require, exports, POETS, heat_types_1) {
    "use strict";
    var assert = POETS.assert;
    var DeviceType = POETS.DeviceType;
    var GenericTypedDataSpec = POETS.GenericTypedDataSpec;
    var InputPort = POETS.InputPort;
    var OutputPort = POETS.OutputPort;
    var CellDeviceProperties = (function () {
        function CellDeviceProperties(nhood, iv, wSelf) {
            if (nhood === void 0) { nhood = 0; }
            if (iv === void 0) { iv = 0; }
            if (wSelf === void 0) { wSelf = 0; }
            this.nhood = nhood;
            this.iv = iv;
            this.wSelf = wSelf;
            this._name_ = "cell_properties";
        }
        ;
        return CellDeviceProperties;
    }());
    ;
    var CellDeviceState = (function () {
        function CellDeviceState(v, t, cs, ca, ns, na) {
            if (v === void 0) { v = 0; }
            if (t === void 0) { t = 0; }
            if (cs === void 0) { cs = 0; }
            if (ca === void 0) { ca = 0; }
            if (ns === void 0) { ns = 0; }
            if (na === void 0) { na = 0; }
            this.v = v;
            this.t = t;
            this.cs = cs;
            this.ca = ca;
            this.ns = ns;
            this.na = na;
            this._name_ = "cell_state";
        }
        ;
        return CellDeviceState;
    }());
    ;
    var CellInitInputPort = (function (_super) {
        __extends(CellInitInputPort, _super);
        function CellInitInputPort() {
            _super.call(this, "__init__", heat_types_1.initEdgeType);
        }
        CellInitInputPort.prototype.onReceive = function (graphPropertiesG, devicePropertiesG, deviceStateG, edgePropertiesG, edgeStateG, messageG, rts) {
            var deviceProperties = devicePropertiesG;
            var deviceState = deviceStateG;
            deviceState.v = deviceProperties.iv;
            deviceState.t = 0;
            deviceState.cs = deviceProperties.nhood; // Force us into the sending ready state
            deviceState.ca = deviceProperties.iv; // This is the first value
            deviceState.ns = 0;
            deviceState.na = 0;
            rts["out"] = deviceState.cs == deviceProperties.nhood;
        };
        return CellInitInputPort;
    }(InputPort));
    ;
    var CellInInputPort = (function (_super) {
        __extends(CellInInputPort, _super);
        function CellInInputPort() {
            _super.call(this, "in", heat_types_1.updateEdgeType);
        }
        CellInInputPort.prototype.onReceive = function (graphPropertiesG, devicePropertiesG, deviceStateG, edgePropertiesG, edgeStateG, messageG, rts) {
            var deviceProperties = devicePropertiesG;
            var deviceState = deviceStateG;
            var edgeProperties = edgePropertiesG;
            var message = messageG;
            //console.log("  w = "+edgeProperties.w);
            if (message.t == deviceState.t) {
                deviceState.cs++;
                deviceState.ca += edgeProperties.w * message.v;
            }
            else {
                assert(message.t == deviceState.t + 1);
                deviceState.ns++;
                deviceState.na += edgeProperties.w * message.v;
            }
            rts["out"] = deviceState.cs == deviceProperties.nhood;
        };
        return CellInInputPort;
    }(InputPort));
    ;
    var CellOutOutputPort = (function (_super) {
        __extends(CellOutOutputPort, _super);
        function CellOutOutputPort() {
            _super.call(this, "out", heat_types_1.updateEdgeType);
        }
        CellOutOutputPort.prototype.onSend = function (graphPropertiesG, devicePropertiesG, deviceStateG, messageG, rts) {
            var graphProperties = graphPropertiesG;
            var deviceProperties = devicePropertiesG;
            var deviceState = deviceStateG;
            var message = messageG;
            if (deviceState.t > graphProperties.maxTime) {
                rts["out"] = false;
                return false;
            }
            else {
                deviceState.v = deviceState.ca;
                deviceState.t++;
                deviceState.cs = deviceState.ns;
                deviceState.ca = deviceState.na + deviceProperties.wSelf * deviceState.v;
                deviceState.ns = 0;
                deviceState.na = 0;
                message.t = deviceState.t;
                message.v = deviceState.v;
                rts["out"] = deviceState.cs == deviceProperties.nhood;
                return true;
            }
        };
        return CellOutOutputPort;
    }(OutputPort));
    ;
    exports.cellDeviceType = new DeviceType("cell", new GenericTypedDataSpec(CellDeviceProperties), new GenericTypedDataSpec(CellDeviceState), [
        new CellInitInputPort(),
        new CellInInputPort()
    ], [
        new CellOutOutputPort()
    ]);
});
//# sourceMappingURL=heat_cell.js.map

repository: paravangular/poets-vis

repo_name: paravangular/poets-vis

extension: js


text:
package main

func main() {
	// Go는 많은 언어들의 장점들을 최대한 수용했고, 따라서 JavaScript의 대표적인 특징인 익명 함수를 지원한다
	func(a, b int, callback func(int)) {
		callback(a + b)
	}(1, 3, func(result int) {
		println(result)
	})
	// 두 수를 더해 콜백에 전달하는 함수를 익명으로 생성하고, 즉시 실행
}

license: MIT

url: https://raw.githubusercontent.com/JoMingyu/--Awesome-Go--/658a725250dbac17100bfde305e3f6f8bd5f729d/020. Function - Anonymous Function/main.go

repository: JoMingyu/--Awesome-Go--

license_type: permissive

repo_name: JoMingyu/--Awesome-Go--

branch_name: refs/heads/master

extension: go


text:
@unpublished{baldassari2023cscd,
  title    = {Conditional score-based diffusion models for {B}ayesian inference in infinite dimensions},
  year     = {2023},
  month    = {05},
  author   = {Lorenzo Baldassari and Ali Siahkoohi and Josselin Garnier and Knut Sølna and Maarten V. de Hoop},
}

extension: bib


text:
package cmd

import (
	"testing"

	"github.com/spf13/cobra"
	"github.com/stretchr/testify/require"
)

func TestRootNoError(t *testing.T) {
	r := require.New(t)
	err := rootCmd.Execute()
	r.Nil(err)
}

func TestRootMissingVerbose(t *testing.T) {
	r := require.New(t)
	cmd := &cobra.Command{}
	err := rootCmd.PersistentPreRunE(cmd, nil)
	r.NotNil(err)
	r.Contains(err.Error(), "flag accessed but not defined: verbose")
}

repository: chanzuckerberg/blessclient

repo_name: chanzuckerberg/blessclient

branch_name: refs/heads/main

gha_license_id: MIT

gha_language: Go


text:
require gstreamer-mm-accel.inc

# Include the base gst-plugins-bad recipe since this recipe is heavily
# derived from that one.
require recipes-multimedia/gstreamer/gstreamer_${PV}.bb

DESCRIPTION = "GStreamer that use multimedia accelerators found on TI devices"

PN = "gstreamer"
B = "${S}"

# Set PROVIDES and RPROVIDES values so that the base recipe names can still
# be used and PREFERRED_PROVIDER can be used to pick between them.
PROVIDES += "gstreamer"
RPROVIDES_${PN} += "gstreamer"
RPROVIDES_${PN}-dev += "gstreamer-dev"
RPROVIDES_${PN}-dbg += "gstreamer-dbg"
RREPLACES_${PN} += "gstreamer"
RREPLACES_${PN}-dev += "gstreamer-dev"
RREPLACES_${PN}-dbg += "gstreamer-dbg"
RCONFLICTS_${PN} += "gstreamer"
RCONFLICTS_${PN}-dev += "gstreamer-dev"
RCONFLICTS_${PN}-dbg += "gstreamer-dbg"

PACKAGE_ARCH = "${MACHINE_ARCH}"

SRC_URI = "gitsm://git.ti.com/glsdk/gstreamer0-10.git;protocol=git"
SRCREV = "e505f4a2ceee3b0328eb2efddb9ec1281d3fd60a"

S = "${WORKDIR}/git"

do_configure_prepend() {
	cd ${S}
	autopoint -f
}

do_install_prepend() {
	cd ${S}
}

FILESPATH .= ":${COREBASE}/meta/recipes-multimedia/gstreamer/gstreamer-${PV}"

repository: varigit/meta-arago-var

repo_name: varigit/meta-arago-var

extension: bb


text:
# - Try to find WASM
# Once done this will define
#  WASM_FOUND - System has WASM

# TODO: Check if compiler is able to generate wasm32

find_file(WASM_LLVM_CONFIG llvm-config HINTS ${WASM_ROOT}/bin)
find_program(WASM_CLANG clang HINTS ${WASM_ROOT}/bin)
find_program(WASM_LLC llc HINTS ${WASM_ROOT}/bin)
find_program(WASM_LLVM_LINK llvm-link HINTS ${WASM_ROOT}/bin)

include(FindPackageHandleStandardArgs)
# handle the QUIETLY and REQUIRED arguments and set EOS_FOUND to TRUE
# if all listed variables are TRUE

find_package_handle_standard_args(WASM DEFAULT_MSG WASM_LLVM_CONFIG WASM_CLANG WASM_LLC WASM_LLVM_LINK)

repository: sephirothg/eos

repo_name: sephirothg/eos

extension: cmake


text:
KBRANCH ?= "dev-4.17"
LINUX_VERSION ?= "4.17.11"

SRCREV="db64579331df4ff9d9c2706601fdb41978192a09"

require linux-fsp2.inc

##### FSP2 Kernel config file
SRC_URI += "file://fsp2_defconfig.cfg"

#### FSP Header files added
SRC_URI += "file://1_headerfiles.patch"

#### FSP fsptrace device driver patch added
SRC_URI += "file://2_fsptrace.patch"

#### FSP NGFSI device driver patch added
SRC_URI += "file://3_ngfsi.patch"

#### FSP NGFSI device driver patch added
SRC_URI += "file://4_pra.patch"

#### FSP Device tree patch
SRC_URI += "file://5_device_tree.patch"

#### FSP pabend patch
SRC_URI += "file://6_pabend.patch"

#### FSP Ethernet device driver patch
#SRC_URI += "file://7_ibm-emac.patch"

#### Segmentation fault Kernel panic patch
SRC_URI += "file://8_SEGFAULT_panic.patch"

#### Segmentation fault Kernel panic patch
SRC_URI += "file://9_compiler_types.patch"

#### Watch dog patch
SRC_URI += "file://10_WATCHDOG_traps.patch"

#### kbuild patch
SRC_URI += "file://11_kconfig.patch"

gha_language: Python


text:
@article{Greene1975,
author = {Greene, Mark},
year = {1975},
month = {01},
pages = {1-10},
title = {An Epidemiologic Assessment of Heroin Use},
volume = {64 Suppl 12},
journal = {American journal of public health},
doi = {10.2105/AJPH.64.12_Suppl.1}
}

repository: HankYe/Solution-to-opioid-crisis

repo_name: HankYe/Solution-to-opioid-crisis


text:
package main

import (
	"fmt"
	"gioui.org/app"
	l "gioui.org/layout"
	jorm "github.com/gioapp/jorm/app"
	"github.com/gioapp/jorm/cfg"
	in "github.com/gioapp/jorm/cfg/ini"
	"github.com/gioapp/jorm/mod/c"
	csrc "github.com/gioapp/jorm/mod/c/src"
	"github.com/p9c/pod/pkg/gui/f"
	"os"
	"time"
)

func main() {
	//coins := c.Coins{}
	in.Init()
	if cfg.Initial {
		fmt.Println("running initial sync")
		csrc.GetCoinSources()
		time.Sleep(time.Second * 2)
	}
	quit := make(chan struct{})

	j := jorm.NewJorm()

	j.Coins = c.ReadAllCoins()

	go func() {
		if err := f.NewWindow().
			Size(800, 600).
			Title("app").
			Open().
			Run(j.Jorm,
				func(gtx l.Context) {},
				func() {
					close(quit)
					os.Exit(0)
				}, quit); Check(err) {
		}
	}()
	app.Main()

	//r := rts.Routes()

	//go func() {
	//}()
	//cr := cron.New()
	//cr.AddFunc("@every 60s", func() {
	//	fmt.Println("Radi kron GetBitNodes")
	//	n.GetBitNodes(coins)
	//})
	//
	//cr.AddFunc("@every 5555s", func() {
	//	csrc.GetCoinSources()
	//})
	//cr.AddFunc("@every 60s", func() {
	//	xsrc.GetExchangeSources()
	//	// dsrc.GetDataSources()
	//})
	//cr.Start()

	//go func() {
	//	go log.Fatal(http.ListenAndServe(":3111", r))
	//}()
	//}()

	// exp.SrcNode().GetAddrs()

}

license: Unlicense

repository: gioapp/jorm

repo_name: gioapp/jorm


text:
package memory_test

import (
	"context"
	"github.com/adamluzsi/testcase"
	"testing"

	"github.com/adamluzsi/frameless/adapters/memory"
	"github.com/adamluzsi/frameless/ports/guard/guardcontracts"
)

func ExampleLocker() {
	l := memory.NewLocker()

	ctx, err := l.Lock(context.Background())
	if err != nil {
		panic(err)
	}

	if err := l.Unlock(ctx); err != nil {
		panic(err)
	}
}

func TestLocker(t *testing.T) {
	guardcontracts.Locker(func(tb testing.TB) guardcontracts.LockerSubject {
		return guardcontracts.LockerSubject{
			Locker:      memory.NewLocker(),
			MakeContext: context.Background,
		}
	}).Test(t)
}

func TestLockerFactory(t *testing.T) {
	guardcontracts.LockerFactory[string](func(tb testing.TB) guardcontracts.LockerFactorySubject[string] {
		return guardcontracts.LockerFactorySubject[string]{
			LockerFactory:     memory.NewLockerFactory[string](),
			MakeContext: context.Background,
			MakeKey:     tb.(*testcase.T).Random.String,
		}
	}).Test(t)
}

func TestNewLockerFactory_race(tt *testing.T) {
	t := testcase.NewT(tt, nil)
	lf := memory.NewLockerFactory[string]()

	const constKey = "const"
	testcase.Race(func() {
		lf.LockerFor(t.Random.String())
	}, func() {
		lf.LockerFor(t.Random.String())
	}, func() {
		lf.LockerFor(constKey)
	}, func() {
		lf.LockerFor(constKey)
	})
}

repository: adamluzsi/frameless

repo_name: adamluzsi/frameless


text:
# Copyright 2017-2018 SECO
# Released under the MIT license (see COPYING.MIT for the terms)

DESCRIPTION = "Minimal Seco Image to Develop on i.MX machines."
LICENSE = "MIT"

require recipes-seco/images/seco-image-minimal.bb

IMAGE_FEATURES += " \
	dbg-pkgs \
	dev-pkgs \
	debug-tweaks \
	tools-debug \
	tools-profile \
	tools-sdk \
	tools-testapps \
"

export IMAGE_BASENAME = "seco-image-minimal-dev"


text:
#
# nonworking, because the c++ template syntax no longer compiles with modern compilers
#
DESCRIPTION = "An Inputmethod for Opie - frontend to the japanese anthy engine"
HOMEPAGE = "http://zaurus-ja.sourceforge.jp/imkit-anthy.html.en"
SECTION = "opie/inputmethods"
LICENSE = "GPL"
RDEPENDS_${PN} = "anthy"
PR = "r1"

SRC_URI = "http://downloads.sourceforge.jp/zaurus-ja/9316/imkit-0.4.5.tar.gz"
S = "${WORKDIR}/imkit-${PV}"

SRC_URI[md5sum] = "de20bff9734595553f9a2b79cf3db719"
SRC_URI[sha256sum] = "3832a7f8ca6ef03c2ea32e364be854a4eb2396053516c5f048fca910d8d8fc08"

inherit palmtop

PARALLEL_MAKE = ""
QMAKE_PROFILES = "imkit.pro"

do_configure_prepend() {
	printf "TEMPLATE=subdirs\nSUBDIRS=libimkit impls/anthy\n" > imkit.pro
}

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
DESCRIPTION = "IPC::ShareLite - Light-weight interface to shared memory"
SECTION = "libs"
LICENSE = "Artistic|GPLv1+"
PR = "r25"

SRC_URI = "http://search.cpan.org/CPAN/authors/id/M/MA/MAURICE/IPC-ShareLite-${PV}.tar.gz"

S = "${WORKDIR}/IPC-ShareLite-${PV}"

inherit cpan

FILES_${PN} = "${PERLLIBDIRS}/auto/IPC/ShareLite/* \
                ${PERLLIBDIRS}/IPC"

BBCLASSEXTEND="native"

SRC_URI[md5sum] = "3942a55cfc5e6d3b612a46cc1a9515b9"
SRC_URI[sha256sum] = "e6dafb82ddf7730ebe7ae2de0ce158d3052d782780b41a14c4fed304e463632e"


text:
file(REMOVE_RECURSE
  "CMakeFiles/DES.dir/Offline/DES.cpp.o"
  "DES.pdb"
  "DES"
)

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

repository: parvd/Problem-Solving-Online-Judges

repo_name: parvd/Problem-Solving-Online-Judges


text:
require recipes-kernel/linux-libc-headers/linux-libc-headers.inc

PR = "r2"

SRC_URI += " \
        file://mips-add-missing-headers.patch \
        file://mips-fix-ptrace-header.patch \
        file://mips-brcm-add-missing-syscalls.patch \
        file://dvb-api-2.6.18-5.3.patch \
        file://fix-linux-futex-h.patch \
        file://mips-fix-64bit-types.patch \
"
SRC_URI[md5sum] = "296a6d150d260144639c3664d127d174"
SRC_URI[sha256sum] = "c95280ff6c5d2a17788f7cc582d23ae8a9a7ba3f202ec6e4238eaadfce7c163d"

repository: kiyala/op

repo_name: kiyala/op


text:
@InProceedings{kukleva2019balls,
author="Kukleva, Anna
and Khan, Mohammad Asif
and Farazi, Hafez
and Behnke, Sven",
title="Utilizing Temporal Information in Deep Convolutional Network for Efficient Soccer Ball Detection and Tracking",
booktitle="RoboCup 2019: Robot World Cup XXIII",
year="2019",
publisher="Springer International Publishing",
address="Cham",
pages="112--125",
isbn="978-3-030-35699-6"
}


text:
LICENSE = "GPL"
DEPENDS = "zlib"

PR = "r3"

SRC_URI = "\
    http://download.savannah.gnu.org/releases/qemu/qemu-${PV}.tar.gz;name=qemu-${PV} \
    file://06_exit_segfault.patch;striplevel=0 \
    file://11_signal_sigaction.patch;striplevel=0 \
    file://22_net_tuntap_stall.patch \
    file://31_syscalls.patch;striplevel=0 \
    file://32_syscall_sysctl.patch;striplevel=0 \
    file://52_ne2000_return.patch \
    file://63_sparc_build.patch;striplevel=0 \
    file://64_ppc_asm_constraints.patch \
    file://66_tls_ld.patch;striplevel=0 \
    file://91-oh-sdl-cursor.patch;striplevel=0 \
    file://fix_segfault.patch \
    file://fix_baum_c_compilation.patch \
    file://fix_fortify_source_compilation.patch \
    file://3f26c1227e3b08010f2a65379cecf4cb4b5933fa.patch \
    file://c5883be23519921254c6940873ee8db04979c20a.patch \
    file://fallback.to.safe.mmap_min_addr.patch \
    "

SRC_URI[qemu-0.12.3.sha256sum] = "3ce26f8fb0a59418b2064a26bac4b40ea4e493acbc3df7ad5932635477fade4b"
SRC_URI[qemu-0.12.3.md5sum] = "d215e4568650e8019816397174c090e1"

BBCLASSEXTEND="native"

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

EXTRA_OECONF += " --disable-curl --disable-sdl --disable-strip"

EXTRA_OECONF_append_virtclass-native = " --extra-cflags="-I${STAGING_INCDIR_NATIVE}""

inherit autotools

do_configure() {
	${S}/configure --prefix=${prefix} ${EXTRA_OECONF}
}


text:
@article{Razavi-2019-VARS-TOOL:,
    title = "VARS-TOOL: A toolbox for comprehensive, efficient, and robust sensitivity and uncertainty analysis",
    author = "Razavi, Saman  and
      Sheikholeslami, Razi  and
      Gupta, Hoshin V.  and
      Haghnegahdar, Amin",
    journal = "Environmental Modelling {\&} Software, Volume 112",
    volume = "112",
    year = "2019",
    publisher = "Elsevier BV",
    url = "https://aclanthology.org/G19-146001",
    doi = "10.1016/j.envsoft.2018.10.005",
    pages = "95--107",
    abstract = "Abstract VARS-TOOL is a software toolbox for sensitivity and uncertainty analysis. Developed primarily around the {``}Variogram Analysis of Response Surfaces{''} framework, VARS-TOOL adopts a multi-method approach that enables simultaneous generation of a range of sensitivity indices, including ones based on derivative, variance, and variogram concepts, from a single sample. Other special features of VARS-TOOL include (1) novel tools for time-varying and time-aggregate sensitivity analysis of dynamical systems models, (2) highly efficient sampling techniques, such as Progressive Latin Hypercube Sampling (PLHS), that maximize robustness and rapid convergence to stable sensitivity estimates, (3) factor grouping for dealing with high-dimensional problems, (4) visualization for monitoring stability and convergence, (5) model emulation for handling model crashes, and (6) an interface that allows working with any model in any programming language and operating system. As a test bed for training and research, VARS-TOOL provides a set of mathematical test functions and the (dynamical) HBV-SASK hydrologic model.",
}

repository: gwf-uwaterloo/gwf-publications

repo_name: gwf-uwaterloo/gwf-publications


text:
@online{beamer,
  author = {Tantau, Till and Miletić, Medran and Wright, Joseph},
  title = {beamer},
  subtitle = {A \LaTeX class for producing presentations and slides},
  url = {https://ctan.org/pkg/beamer},
  urldate = {2020-01-23}
}

repository: llueder/beamerthemeHAW

repo_name: llueder/beamerthemeHAW


text:
@article{Lestandi2020,
abstract = {},
author = {Lestandi, Lucas},
doi = {},
issn = {},
journal = {Submitted to Journal of scientific computing},
month = {han},
number = {1},
pages = {},
title = {{Numerical Study of Low Rank Approximation Methods for Multidimensional Physics and its Analysis}},
url = {},
volume = {},
year = {2020}
}

repository: llestand/academic-kickstart

repo_name: llestand/academic-kickstart


text:
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package sumologicexporter

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestEscapeGraphiteString(t *testing.T) {
	gf := newGraphiteFormatter("%{k8s.cluster}.%{k8s.namespace}.%{k8s.pod}.%{_metric_}")

	value := gf.escapeGraphiteString("this.is_example&metric.value")
	expected := "this_is_example&metric_value"

	assert.Equal(t, expected, value)
}

func TestGraphiteFormat(t *testing.T) {
	gf := newGraphiteFormatter("%{k8s.cluster}.%{k8s.namespace}.%{k8s.pod}.%{_metric_}")

	fs := fieldsFromMap(map[string]string{
		"k8s.cluster":   "test_cluster",
		"k8s.namespace": "sumologic",
		"k8s.pod":       "example_pod",
	})

	expected := "test_cluster.sumologic.example_pod.test_metric"
	result := gf.format(fs, "test_metric")

	assert.Equal(t, expected, result)
}

func TestGraphiteMetricTypeIntGauge(t *testing.T) {
	gf := newGraphiteFormatter("%{cluster}.%{namespace}.%{pod}.%{_metric_}")

	metric := exampleIntGaugeMetric()
	metric.attributes.PutStr("cluster", "my_cluster")
	metric.attributes.PutStr("namespace", "default")
	metric.attributes.PutStr("pod", "some pod")

	result := gf.metric2String(metric)
	expected := `my_cluster.default.some_pod.gauge_metric_name 124 1608124661
my_cluster.default.some_pod.gauge_metric_name 245 1608124662`
	assert.Equal(t, expected, result)
}

func TestGraphiteMetricTypeDoubleGauge(t *testing.T) {
	gf := newGraphiteFormatter("%{cluster}.%{namespace}.%{pod}.%{_metric_}")

	metric := exampleDoubleGaugeMetric()
	metric.attributes.PutStr("cluster", "my_cluster")
	metric.attributes.PutStr("namespace", "default")
	metric.attributes.PutStr("pod", "some pod")

	result := gf.metric2String(metric)
	expected := `my_cluster.default.some_pod.gauge_metric_name_double_test 33.4 1608124661
my_cluster.default.some_pod.gauge_metric_name_double_test 56.8 1608124662`
	assert.Equal(t, expected, result)
}

func TestGraphiteNoattribute(t *testing.T) {
	gf := newGraphiteFormatter("%{cluster}.%{namespace}.%{pod}.%{_metric_}")

	metric := exampleDoubleGaugeMetric()
	metric.attributes.PutStr("cluster", "my_cluster")
	metric.attributes.PutStr("pod", "some pod")

	result := gf.metric2String(metric)
	expected := `my_cluster..some_pod.gauge_metric_name_double_test 33.4 1608124661
my_cluster..some_pod.gauge_metric_name_double_test 56.8 1608124662`
	assert.Equal(t, expected, result)
}

func TestGraphiteMetricTypeIntSum(t *testing.T) {
	gf := newGraphiteFormatter("%{cluster}.%{namespace}.%{pod}.%{_metric_}")

	metric := exampleIntSumMetric()
	metric.attributes.PutStr("cluster", "my_cluster")
	metric.attributes.PutStr("namespace", "default")
	metric.attributes.PutStr("pod", "some pod")

	result := gf.metric2String(metric)
	expected := `my_cluster.default.some_pod.sum_metric_int_test 45 1608124444
my_cluster.default.some_pod.sum_metric_int_test 1238 1608124699`
	assert.Equal(t, expected, result)
}

func TestGraphiteMetricTypeDoubleSum(t *testing.T) {
	gf := newGraphiteFormatter("%{cluster}.%{namespace}.%{pod}.%{_metric_}")

	metric := exampleDoubleSumMetric()
	metric.attributes.PutStr("cluster", "my_cluster")
	metric.attributes.PutStr("namespace", "default")
	metric.attributes.PutStr("pod", "some pod")

	result := gf.metric2String(metric)
	expected := `my_cluster.default.some_pod.sum_metric_double_test 45.6 1618124444
my_cluster.default.some_pod.sum_metric_double_test 1238.1 1608424699`
	assert.Equal(t, expected, result)
}

func TestGraphiteMetricTypeSummary(t *testing.T) {
	gf := newGraphiteFormatter("%{cluster}.%{namespace}.%{pod}.%{_metric_}")

	metric := exampleSummaryMetric()
	metric.attributes.PutStr("cluster", "my_cluster")
	metric.attributes.PutStr("namespace", "default")
	metric.attributes.PutStr("pod", "some pod")

	result := gf.metric2String(metric)
	expected := ``
	assert.Equal(t, expected, result)

	metric = buildExampleSummaryMetric(false)
	result = gf.metric2String(metric)
	assert.Equal(t, expected, result)
}

func TestGraphiteMetricTypeHistogram(t *testing.T) {
	gf := newGraphiteFormatter("%{cluster}.%{namespace}.%{pod}.%{_metric_}")

	metric := exampleHistogramMetric()
	metric.attributes.PutStr("cluster", "my_cluster")
	metric.attributes.PutStr("namespace", "default")
	metric.attributes.PutStr("pod", "some pod")

	result := gf.metric2String(metric)
	expected := ``
	assert.Equal(t, expected, result)

	metric = buildExampleHistogramMetric(false)
	result = gf.metric2String(metric)
	assert.Equal(t, expected, result)
}


text:
PR = "r2"

MAP_NAME = "London"
require om-maps.inc

MAP_FN = "om-maps-london-${PV}.eet"
MAP_VER = "${PV}"

SRC_URI[md5sum] = "fa05427d09f98ea6cbceaa4c88f4c51d"
SRC_URI[sha256sum] = "1776ba1ec93984d0ff755a677a769e200a6e435fd1385e699e106c9cec83b04c"


text:
// Code generated by smithy-go-codegen DO NOT EDIT.

package applicationautoscaling

import (
	"context"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/applicationautoscaling/types"
	smithy "github.com/aws/smithy-go"
	"github.com/aws/smithy-go/middleware"
)

type validateOpDeleteScalingPolicy struct {
}

func (*validateOpDeleteScalingPolicy) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpDeleteScalingPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*DeleteScalingPolicyInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpDeleteScalingPolicyInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpDeleteScheduledAction struct {
}

func (*validateOpDeleteScheduledAction) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpDeleteScheduledAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*DeleteScheduledActionInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpDeleteScheduledActionInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpDeregisterScalableTarget struct {
}

func (*validateOpDeregisterScalableTarget) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpDeregisterScalableTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*DeregisterScalableTargetInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpDeregisterScalableTargetInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpDescribeScalableTargets struct {
}

func (*validateOpDescribeScalableTargets) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpDescribeScalableTargets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*DescribeScalableTargetsInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpDescribeScalableTargetsInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpDescribeScalingActivities struct {
}

func (*validateOpDescribeScalingActivities) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpDescribeScalingActivities) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*DescribeScalingActivitiesInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpDescribeScalingActivitiesInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpDescribeScalingPolicies struct {
}

func (*validateOpDescribeScalingPolicies) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpDescribeScalingPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*DescribeScalingPoliciesInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpDescribeScalingPoliciesInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpDescribeScheduledActions struct {
}

func (*validateOpDescribeScheduledActions) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpDescribeScheduledActions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*DescribeScheduledActionsInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpDescribeScheduledActionsInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpPutScalingPolicy struct {
}

func (*validateOpPutScalingPolicy) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpPutScalingPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*PutScalingPolicyInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpPutScalingPolicyInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpPutScheduledAction struct {
}

func (*validateOpPutScheduledAction) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpPutScheduledAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*PutScheduledActionInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpPutScheduledActionInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

type validateOpRegisterScalableTarget struct {
}

func (*validateOpRegisterScalableTarget) ID() string {
	return "OperationInputValidation"
}

func (m *validateOpRegisterScalableTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
	out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
	input, ok := in.Parameters.(*RegisterScalableTargetInput)
	if !ok {
		return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
	}
	if err := validateOpRegisterScalableTargetInput(input); err != nil {
		return out, metadata, err
	}
	return next.HandleInitialize(ctx, in)
}

func addOpDeleteScalingPolicyValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpDeleteScalingPolicy{}, middleware.After)
}

func addOpDeleteScheduledActionValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpDeleteScheduledAction{}, middleware.After)
}

func addOpDeregisterScalableTargetValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpDeregisterScalableTarget{}, middleware.After)
}

func addOpDescribeScalableTargetsValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpDescribeScalableTargets{}, middleware.After)
}

func addOpDescribeScalingActivitiesValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpDescribeScalingActivities{}, middleware.After)
}

func addOpDescribeScalingPoliciesValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpDescribeScalingPolicies{}, middleware.After)
}

func addOpDescribeScheduledActionsValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpDescribeScheduledActions{}, middleware.After)
}

func addOpPutScalingPolicyValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpPutScalingPolicy{}, middleware.After)
}

func addOpPutScheduledActionValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpPutScheduledAction{}, middleware.After)
}

func addOpRegisterScalableTargetValidationMiddleware(stack *middleware.Stack) error {
	return stack.Initialize.Add(&validateOpRegisterScalableTarget{}, middleware.After)
}

func validateCustomizedMetricSpecification(v *types.CustomizedMetricSpecification) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "CustomizedMetricSpecification"}
	if v.MetricName == nil {
		invalidParams.Add(smithy.NewErrParamRequired("MetricName"))
	}
	if v.Namespace == nil {
		invalidParams.Add(smithy.NewErrParamRequired("Namespace"))
	}
	if v.Dimensions != nil {
		if err := validateMetricDimensions(v.Dimensions); err != nil {
			invalidParams.AddNested("Dimensions", err.(smithy.InvalidParamsError))
		}
	}
	if len(v.Statistic) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("Statistic"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateMetricDimension(v *types.MetricDimension) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "MetricDimension"}
	if v.Name == nil {
		invalidParams.Add(smithy.NewErrParamRequired("Name"))
	}
	if v.Value == nil {
		invalidParams.Add(smithy.NewErrParamRequired("Value"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateMetricDimensions(v []types.MetricDimension) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "MetricDimensions"}
	for i := range v {
		if err := validateMetricDimension(&v[i]); err != nil {
			invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validatePredefinedMetricSpecification(v *types.PredefinedMetricSpecification) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "PredefinedMetricSpecification"}
	if len(v.PredefinedMetricType) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("PredefinedMetricType"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateStepAdjustment(v *types.StepAdjustment) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "StepAdjustment"}
	if v.ScalingAdjustment == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ScalingAdjustment"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateStepAdjustments(v []types.StepAdjustment) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "StepAdjustments"}
	for i := range v {
		if err := validateStepAdjustment(&v[i]); err != nil {
			invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateStepScalingPolicyConfiguration(v *types.StepScalingPolicyConfiguration) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "StepScalingPolicyConfiguration"}
	if v.StepAdjustments != nil {
		if err := validateStepAdjustments(v.StepAdjustments); err != nil {
			invalidParams.AddNested("StepAdjustments", err.(smithy.InvalidParamsError))
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateTargetTrackingScalingPolicyConfiguration(v *types.TargetTrackingScalingPolicyConfiguration) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "TargetTrackingScalingPolicyConfiguration"}
	if v.TargetValue == nil {
		invalidParams.Add(smithy.NewErrParamRequired("TargetValue"))
	}
	if v.PredefinedMetricSpecification != nil {
		if err := validatePredefinedMetricSpecification(v.PredefinedMetricSpecification); err != nil {
			invalidParams.AddNested("PredefinedMetricSpecification", err.(smithy.InvalidParamsError))
		}
	}
	if v.CustomizedMetricSpecification != nil {
		if err := validateCustomizedMetricSpecification(v.CustomizedMetricSpecification); err != nil {
			invalidParams.AddNested("CustomizedMetricSpecification", err.(smithy.InvalidParamsError))
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpDeleteScalingPolicyInput(v *DeleteScalingPolicyInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DeleteScalingPolicyInput"}
	if v.PolicyName == nil {
		invalidParams.Add(smithy.NewErrParamRequired("PolicyName"))
	}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if v.ResourceId == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceId"))
	}
	if len(v.ScalableDimension) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ScalableDimension"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpDeleteScheduledActionInput(v *DeleteScheduledActionInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DeleteScheduledActionInput"}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if v.ScheduledActionName == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ScheduledActionName"))
	}
	if v.ResourceId == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceId"))
	}
	if len(v.ScalableDimension) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ScalableDimension"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpDeregisterScalableTargetInput(v *DeregisterScalableTargetInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DeregisterScalableTargetInput"}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if v.ResourceId == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceId"))
	}
	if len(v.ScalableDimension) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ScalableDimension"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpDescribeScalableTargetsInput(v *DescribeScalableTargetsInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DescribeScalableTargetsInput"}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpDescribeScalingActivitiesInput(v *DescribeScalingActivitiesInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DescribeScalingActivitiesInput"}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpDescribeScalingPoliciesInput(v *DescribeScalingPoliciesInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DescribeScalingPoliciesInput"}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpDescribeScheduledActionsInput(v *DescribeScheduledActionsInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "DescribeScheduledActionsInput"}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpPutScalingPolicyInput(v *PutScalingPolicyInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "PutScalingPolicyInput"}
	if v.PolicyName == nil {
		invalidParams.Add(smithy.NewErrParamRequired("PolicyName"))
	}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if v.ResourceId == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceId"))
	}
	if len(v.ScalableDimension) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ScalableDimension"))
	}
	if v.StepScalingPolicyConfiguration != nil {
		if err := validateStepScalingPolicyConfiguration(v.StepScalingPolicyConfiguration); err != nil {
			invalidParams.AddNested("StepScalingPolicyConfiguration", err.(smithy.InvalidParamsError))
		}
	}
	if v.TargetTrackingScalingPolicyConfiguration != nil {
		if err := validateTargetTrackingScalingPolicyConfiguration(v.TargetTrackingScalingPolicyConfiguration); err != nil {
			invalidParams.AddNested("TargetTrackingScalingPolicyConfiguration", err.(smithy.InvalidParamsError))
		}
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpPutScheduledActionInput(v *PutScheduledActionInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "PutScheduledActionInput"}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if v.ScheduledActionName == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ScheduledActionName"))
	}
	if v.ResourceId == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceId"))
	}
	if len(v.ScalableDimension) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ScalableDimension"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}

func validateOpRegisterScalableTargetInput(v *RegisterScalableTargetInput) error {
	if v == nil {
		return nil
	}
	invalidParams := smithy.InvalidParamsError{Context: "RegisterScalableTargetInput"}
	if len(v.ServiceNamespace) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace"))
	}
	if v.ResourceId == nil {
		invalidParams.Add(smithy.NewErrParamRequired("ResourceId"))
	}
	if len(v.ScalableDimension) == 0 {
		invalidParams.Add(smithy.NewErrParamRequired("ScalableDimension"))
	}
	if invalidParams.Len() > 0 {
		return invalidParams
	} else {
		return nil
	}
}


text:
DESCRIPTION = "X print extension library."
SECTION = "libs"
#MAINTAINER = ""
LICENSE = "MIT"

DEPENDS = "libx11 libxext xextproto libxau printproto"

XORG_PN = "libXp"

include xorg-xlibs.inc

CFLAGS_append += " -I ${S}/include/X11/XprintUtil -I ${S}/include/X11/extensions"
EXTRA_OECONF="--enable-malloc0returnsnull"

repository: BackupTheBerlios/openslug-svn

repo_name: BackupTheBerlios/openslug-svn


text:
@article{ghannay-2018-EndToEnd2,
  title={End-to-end named entity extraction from speech},
  author={Ghannay, Sahar and Caubri{\`e}re, Antoine and Esteve, Yannick and Laurent, Antoine and Morin, Emmanuel},
  journal={arXiv preprint arXiv:1805.12045},
  year={2018}
}

repository: saharghannay/academic-kickstart

repo_name: saharghannay/academic-kickstart


text:
@article{,
  author = {Koop, C Everett},
  chemicals = {Formates, Carbon Dioxide, Aldehyde Oxidoreductases, Methanol},
  citation-subset = {IM},
  completed = {1976-01-16},
  country = {UNITED STATES},
  created = {1976-01-16},
  issn = {0006-2944},
  issn-linking = {0006-2944},
  issue = {2},
  journal = {Biochemical medicine},
  journal-abbreviation = {Biochem Med},
  keywords = {apnea syndrome; cardiovascular disease; self management},
  nlm-id = {0151424},
  owner = {NLM},
  pages = {25--138},
  pmid = {10097079},
  pubmodel = {Print},
  pubstate = {ppublish},
  revised = {2013-11-21},
  status = {MEDLINE},
  title = {Formate assay in body fluids: application in methanol poisoning.},
  volume = {13},
  year = {1999}
}

repository: JabRef/jabref

repo_name: JabRef/jabref

gha_language: Java


text:
SUMMARY = "Hardware Diagnostics for POWER Systems"

DESCRIPTION = \
    "In the event of a system fatal error reported by the internal system \
    hardware (processor chips, memory chips, I/O chips, system memory, etc.), \
    POWER Systems have the ability to diagnose the root cause of the failure \
    and perform any service action needed to avoid repeated system failures."

HOMEPAGE = "https://github.com/openbmc/openpower-hw-diags"

LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"

PR = "r1"
PV = "0.1+git${SRCPV}"

SRC_URI = "git://github.com/openbmc/openpower-hw-diags;branch=master;protocol=https"
SRCREV = "c62813d4de33804c7ba5d82fe8ddc4a0f722c5ed"

S = "${WORKDIR}/git"

inherit pkgconfig meson systemd

SYSTEMD_SERVICE:${PN} = "attn_handler.service"

DEPENDS = "boost libgpiod pdbg phosphor-logging sdbusplus openpower-libhei \
           nlohmann-json valijson fmt"

# This is required so that libhei is installed with the chip data files.
RDEPENDS:${PN} += "openpower-libhei"

# Conditionally pull in PHAL APIs, if available.
PACKAGECONFIG ??= "${@bb.utils.filter('MACHINE_FEATURES', 'phal', d)}"
PACKAGECONFIG[phal] = "-Dphal=enabled, -Dphal=disabled, ipl pdata"

# Don't build CI tests
EXTRA_OEMESON = "-Dtests=disabled"

pkg_postinst:${PN}() {
    mkdir -p $D$systemd_system_unitdir/obmc-host-startmin@0.target.wants
    LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/attn_handler.service"
    TARGET="../attn_handler.service"
    ln -s $TARGET $LINK
}

pkg_prerm:${PN}() {
    LINK="$D$systemd_system_unitdir/obmc-host-startmin@0.target.wants/attn_handler.service"
    rm $LINK
}

repository: openbmc/openbmc

repo_name: openbmc/openbmc

gha_license_id: NOASSERTION


text:
package main

import (
	"fmt"
	"net"
	"time"
)

func main() {

	// get the sushi config

	// check if chef-client is installed

	// check if client.rb is configured

	// check if the chef server is available
	if serverAvailable("chef.example.com:443") {
		// if chef server is available, run in server mode

		// shell out and run chef-client with client-server.rb

	} else {
		// if chef server is NOT available, run in solo mode

		// check if the sushi repo is available
		if serverAvailable("sushi.example.com:443") {
			// if sushi repo is available, check the current version and save the expiration

			// compare local repo version, if needed download latest version

			// shell out and run chef-client with client-solo.rb
		} else {
			// if sushi repo is NOT available, check if our local repo has expired
			if localRepoExpired() {
				// if the local repo has expired, exit without running chef

			} else {
				// shell out and run chef-client with client-solo.rb
			}
		}
	}
}

func serverAvailable(serverURL string) bool {
	// needs to add support for file:/// urls
	timeout := 1 * time.Second
	conn, err := net.DialTimeout("tcp", serverURL, timeout)
	if err != nil {
		fmt.Println(conn)
		fmt.Println("Site unreachable, error: ", err)
		return false
	}
	return true
}

func localRepoExpired() bool {
	return false
}


text:
package app

import (
	"fmt"
	"myTool/ffmpeg"
	"myTool/mylog"
	"path/filepath"
)

//生成字幕文件
func (a *App) createSrtWithVideo(videoPath string, suf string) {

	if !ffmpeg.IsVideo(videoPath) {
		return
	}

	// 1. 提取音频文件
	bjmPath := ffmpeg.ExtractBgm(a.FCmd, videoPath)

	// 2. 上传到oss
	remoteUrl, err := a.AliYunOss.UploadObject(bjmPath, filepath.Base(bjmPath))
	if err != nil {
		mylog.LogDebug("文件上传失败", err)
	}

	// 3.阿里云录音文件识别
	AudioResult := a.AliYunCloud.AliYunAudioRecognition(remoteUrl, a.IntelligentBlock)

	// 4.生成字幕文件
	a.AliYunCloud.AliyunAudioResultMakeSubtitleFile(videoPath, AudioResult, suf)

}

func (a *App) createSrtWithAudio(audioPath string, suf string) {

	fmt.Println("进行字幕生成...")
	// 2. 上传到oss
	remoteUrl, err := a.AliYunOss.UploadObject(audioPath, filepath.Base(audioPath))
	if err != nil {
		mylog.LogDebug("文件上传失败", err)
		return
	}

	// 3.阿里云录音文件识别
	AudioResult := a.AliYunCloud.AliYunAudioRecognition(remoteUrl, a.IntelligentBlock)

	// 4.生成字幕文件
	a.AliYunCloud.AliyunAudioResultMakeSubtitleFile(audioPath, AudioResult, suf)

}

func (a *App)createSrtWithUrl(videoPath,url string, suf string)  {
	// 3.阿里云录音文件识别
	AudioResult := a.AliYunCloud.AliYunAudioRecognition(url, a.IntelligentBlock)

	// 4.生成字幕文件
	a.AliYunCloud.AliyunAudioResultMakeSubtitleFile(videoPath, AudioResult, suf)
}

repository: johnnyjiao/videoMaker

repo_name: johnnyjiao/videoMaker


text:
IEEEexample.bib
\bibliographystyle{./IEEEtran}
\bibliography{./IEEEabrv,./IEEEexample}

note: double {{}} are needed so the title next is not converted into lowercase

@ARTICLE{HyperbolicGeoNetworks,
       Author = {Krioukov, D. and Papadopoulos, F. and Kitsak, M. and Vahdat, A. and Boguñá, M.},
       Title = {{Hyperbolic Geometry of Complex Networks}},
       Journal = {Physical Review E},
       Volume = {82},
       Number = {036106},
       Month = {Oct},
       Year = {2010},
       Keywords = {routing   topology   network geometry}
}

@ARTICLE{MolnarOnburst,
    Author = {Sándor Molnár and György Miklós},
    Title = {On Burst And Correlation Structure of Teletraffic Models},
    Journal = {{5th IFIP Workshop on Performance Modelling and Evaluation of ATM Networks}},
    Month = {July},
    Year = {1997}
}


text:
Automatically generated by Mendeley Desktop 1.19.4
Any changes to this file will be lost if it is regenerated by Mendeley.

BibTeX export options can be customized via Preferences -> BibTeX in Mendeley Desktop

@article{Karim2012a,
abstract = {BACKGROUND {\&} OBJECTIVES: Transmission of dengue virus depends on the presence of Aedes mosquito. Mosquito generation and development is known to be influenced by the climate. This study was carried out to examine whether the climatic factors data can be used to predict yearly dengue cases of Dhaka city, Bangladesh.$\backslash$n$\backslash$nMETHODS: Monthly reported dengue cases and climate data for the years 2000-2008 were obtained from the Directorate General of Health Services (DGHS) and Meteorological Department of Dhaka, Bangladesh, respectively. Data for the period 2000 to 2007 were used for development of a model through multiple linear regressions. Retrospective validation of the model was done with 2001, 2003, 2005 and 2008 data. Log transformation of the dependent variable was done to normalize data for linear regression. Average monthly humidity, rainfall, minimum and maximum temperature were used as independent variables and number of dengue cases reported monthly was used as dependent variable. Accuracy of the model for predicting outbreak was assessed through receiver operative characteristics (ROC) curve.$\backslash$n$\backslash$nRESULTS: Climatic factors, i.e. rainfall, maximum temperature and relative humidity were significantly correlated with monthly reported dengue cases. The model incorporating climatic data of two-lag month explained 61 per cent of variation in number of reported dengue cases and this model was found to predict dengue outbreak (≥ 200 cases) with considerable accuracy [area under ROC curve = 0.89, 95{\%}CI = (0.89-0.98)].$\backslash$n$\backslash$nINTERPRETATION {\&} CONCLUSIONS: Our results showed that the climate had a major effect on the occurrence of dengue infection in Dhaka city. Though the prediction model had some limitations in predicting the monthly number of dengue cases, it could forecast possible outbreak two months in advance with considerable accuracy.},
author = {Karim, Md Nazmul and Munshi, Saif Ullah and Anwar, Nazneen and Alam, Md Shah},
doi = {IndianJMedRes_2012_136_1_32_99557 [pii]},
file = {:Users/sepmein/Qsync/Papers//Karim et al.{\_}2012{\_}Climatic factors influencing dengue cases in Dhaka city A model for dengue prediction.pdf:pdf},
isbn = {0971-5916 (Print)$\backslash$r0971-5916 (Linking)},
issn = {09715916},
journal = {Indian Journal of Medical Research},
keywords = {Climate,Dengue,Humidity,Outbreak,Prediction model,Rainfall,Temperature},
number = {1},
pages = {32--39},
pmid = {22885261},
title = {{Climatic factors influencing dengue cases in Dhaka city: A model for dengue prediction}},
volume = {136},
year = {2012}
}

repository: sepmein/references

repo_name: sepmein/references


text:
@article{khadem2020autonomous,
 author = {Khadem, M. and O'Neill, J. and Mitros, Z. and Da Cruz*, L. and Bergeles*, C.},
 journal = {IEEE Trans. Robotics},
 pages = {1--8},
 title = {Autonomous steering of concentric tube robots via nonlinear model predictive control},
 year = {2020}
}

repository: cbergeles/rvimlab-website

repo_name: cbergeles/rvimlab-website


text:
# /AccelerateTarget.cmake
#
# CMake macro which provides a function called psq_accelerate_target, which
# effectively sets up cotire on it, handles linking requirements between unity
# builds, and adds the correct dependencies to the unity build target.
#
# See /LICENCE.md for Copyright information

if (POLICY CMP0059)

    cmake_policy (SET CMP0059 OLD)

endif ()

if (NOT CMAKE_SCRIPT_MODE_FILE)
    include ("cmake/cotire/cotire")
endif ()

include ("cmake/cmake-multi-targets/ParallelBuildTargetUtils")
include ("cmake/tooling-cmake-util/PolysquareToolingUtil")

# psq_accelerate_target:
#
# For a target TARGET, adds a prefix header with all found headers used
# in this TARGET, cause it to be included when building TARGET and precompile
# the prefix header before building TARGET. Also adds a new target
# TARGET_unity with a single-source file which includes every other source
# file in one compilation unit.
#
# The TARGET_unity target will be set up to depend on any libraries this
# TARGET links to, and will prefer _unity versions of those libraries if
# available.
#
# TARGET: Target to accelerate
# [Optional] NO_UNITY_BUILD: Don't generate TARGET_unity
# [Optional] NO_PRECOMPILED_HEADERS: Don't generate a precompiled header
# [Optional] DEPENDS: Dependencies of this TARGET to add to TARGET_unity
function (psq_accelerate_target TARGET)

    set (ACCELERATE_OPTION_ARGS
         NO_UNITY_BUILD
         NO_PRECOMPILED_HEADERS)
    set (ACCELERATE_SINGLEVAR_ARGS
         "")
    set (ACCELERATE_MULTIVAR_ARGS
         DEPENDS)

    cmake_parse_arguments (ACCELERATION
                           "${ACCELERATE_OPTION_ARGS}"
                           "${ACCELERATE_SINGLEVAR_ARGS}"
                           "${ACCELERATE_MULTIVAR_ARGS}"
                           ${ARGN})

    set (COTIRE_PROPERTIES)
    psq_add_switch (COTIRE_PROPERTIES
                    ACCELERATION_NO_UNITY_BUILD
                    ON "COTIRE_ADD_UNITY_BUILD OFF"
                    OFF "COTIRE_ADD_UNITY_BUILD ON")
    psq_add_switch (COTIRE_PROPERTIES
                    ACCELERATION_NO_PRECOMPILED_HEADERS
                    ON "COTIRE_ENABLE_PRECOMPILED_HEADER OFF"
                    OFF "COTIRE_ENABLE_PRECOMPILED_HEADER ON")
    string (REPLACE " " ";" COTIRE_PROPERTIES "${COTIRE_PROPERTIES}")

    set_target_properties (${TARGET} PROPERTIES
                           POLYSQUARE_ACCELERATED ON
                           ${COTIRE_PROPERTIES})

    # Clear COTIRE_PREFIX_HEADER_IGNORE_PATH
    set_target_properties (${TARGET} PROPERTIES
                           COTIRE_PREFIX_HEADER_IGNORE_PATH
                           "")

    cotire (${TARGET})

    # Add dependencies to unity target
    if (NOT ACCELERATION_NO_UNITY_BUILD)

        psq_forward_options (ACCELERATION WIRE_DEPS_OPTIONS
                             MULTIVAR_ARGS DEPENDS)
        psq_wire_mirrored_build_target_dependencies (${TARGET}
                                                     unity
                                                     ${WIRE_DEPS_OPTIONS})

    endif ()

endfunction ()

repository: polysquare/accelerate-target-cmake

repo_name: polysquare/accelerate-target-cmake

gha_language: CMake


text:
package run

import (
	"strings"

	"github.com/urfave/cli"

	"github.com/rackerlabs/maestro/pkg/context"
	"github.com/rackerlabs/maestro/pkg/ec2utils"
	"github.com/rackerlabs/maestro/pkg/middleware"
	. "github.com/rackerlabs/maestro/ui"
)

func instanceList(c *cli.Context) []string {
	return strings.Split(c.String("instances"), ",")
}

// Detect Platform of a group of EC2 instances
func detectPlatform(c *cli.Context) (string, error) {
	UI.Debug("Attempting to determine the platform")

	context := context.New(middleware.GetSession(c))
	if c.String("instances") != "" {
		return ec2utils.DetectPlatformForInstances(
			context,
			instanceList(c),
		)
	}

	if c.String("autoscale-group") != "" {
		UI.Debug("Determining Autoscale Group Platform")
		return ec2utils.DetectPlatformForAutoscaleGroup(
			context,
			c.String("autoscale-group"),
		)
	}

	return ec2utils.DetectPlatformForTag(
		context,
		c.String("tag-key"),
		c.String("tag-value"),
	)
}

repository: rackerlabs/maestro

repo_name: rackerlabs/maestro


text:
require recipes-core/images/core-image-minimal.bb

DESCRIPTION = "A small image just capable of allowing a device to boot and \
run Axon."

IMAGE_INSTALL += "\
    axon \
    "

repository: joaohf/meta-nerves

repo_name: joaohf/meta-nerves


text:
require xorg-driver-video.inc

DESCRIPTION = "X.Org X server -- MGA display driver"
PE = "1"
SRC_URI[archive.md5sum] = "3e80cfb84b62866d2f94774ecbf3e46c"
SRC_URI[archive.sha256sum] = "e8efee8d5269eb29f9bd499db3d47a6a4d3c320d4b0a24874cdf7b598ad77a5c"


text:
package data

import (
	"github.com/jibitters/kiosk/errors"
	"github.com/jibitters/kiosk/models"
)

// UpdateTicketRequest model definition.
type UpdateTicketRequest struct {
	ID              int64                        `json:"ID"`
	Subject         string                       `json:"subject"`
	Metadata        string                       `json:"metadata"`
	ImportanceLevel models.TicketImportanceLevel `json:"importanceLevel"`
	Status          models.TicketStatus          `json:"status"`
}

// Validate validates the request.
func (r *UpdateTicketRequest) Validate() *errors.Type {
	if r.ID <= 0 {
		return errors.InvalidArgument("ID.invalid", "")
	}

	if len(r.Subject) == 0 {
		return errors.InvalidArgument("subject.is_required", "")
	}

	if len(r.Subject) > 255 {
		return errors.InvalidArgument("subject.invalid_length", "")
	}

	if r.ImportanceLevel != models.TicketImportanceLevelLow &&
		r.ImportanceLevel != models.TicketImportanceLevelMedium &&
		r.ImportanceLevel != models.TicketImportanceLevelHigh &&
		r.ImportanceLevel != models.TicketImportanceLevelCritical {

		return errors.InvalidArgument("importanceLevel.not_valid", "")
	}

	if r.Status != models.TicketStatusReplied &&
		r.Status != models.TicketStatusResolved &&
		r.Status != models.TicketStatusClosed &&
		r.Status != models.TicketStatusBlocked {

		return errors.InvalidArgument("status.not_valid", "")
	}

	return nil
}

// AsTicket converts this request model into ticket model.
func (r *UpdateTicketRequest) AsTicket() *models.Ticket {
	return &models.Ticket{
		Model:           models.Model{ID: r.ID},
		Subject:         r.Subject,
		Metadata:        r.Metadata,
		ImportanceLevel: r.ImportanceLevel,
		Status:          r.Status,
	}
}

repository: rizalgowandy/kiosk

repo_name: rizalgowandy/kiosk


text:
@Misc{compactem_software,
  author = {Abhishek Ghose},
  title = {{compactem}: build accurate small models},
  url = {https://compactem.readthedocs.io},
  version = {0.9.6},
  year = {2021},
  type = {Computer Software},
  howpublished = "\url{https://compactem.readthedocs.io}"
}

@ARTICLE{frontiers_density_tree,
AUTHOR={Ghose, Abhishek and Ravindran, Balaraman},
TITLE={Interpretability With Accurate Small Models},
JOURNAL={Frontiers in Artificial Intelligence},
VOLUME={3},
PAGES={3},
YEAR={2020},
URL={https://www.frontiersin.org/article/10.3389/frai.2020.00003},
DOI={10.3389/frai.2020.00003},
ISSN={2624-8212}
}

@article{10.2307/659935,
 ISSN = {00027294, 15481433},
 URL = {http://www.jstor.org/stable/659935},
 author = {L. Leland Locke},
 journal = {American Anthropologist},
 number = {2},
 pages = {325--332},
 publisher = {[American Anthropological Association, Wiley]},
 title = {The Ancient Quipu, a Peruvian Knot Record},
 volume = {14},
 year = {1912}
}

repository: abhishek-ghose/blog

repo_name: abhishek-ghose/blog


text:
set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR "ARM64")

set(CMAKE_CROSSCOMPILING TRUE)

set(LLVM_TARGET_ARCH AArch64)

repository: awakecoding/llvm-prebuilt

repo_name: awakecoding/llvm-prebuilt


text:
@article{Shimanaka2018,
 address = {Stroudsburg, PA, USA},
 author = {Shimanaka, Hiroki and Kajiwara, Tomoyuki and Komachi, Mamoru},
 doi = {10.18653/v1/W18-6456},
 journal = {Proceedings of the Third Conference on Machine Translation: Shared Task Papers},
 pages = {751--758},
 publisher = {Association for Computational Linguistics},
 title = {RUSE: Regressor Using Sentence Embeddings for Automatic Machine Translation Evaluation},
 url = {http://aclweb.org/anthology/W18-6456},
 year = {2018}
}

repository: conscienceli/islab-website

repo_name: conscienceli/islab-website


text:
package cmd

import (
	"fmt"

	"github.com/spf13/cobra"
	"github.com/couchbase/go-blip"
	"encoding/json"
	"log"
)

// https://github.com/couchbase/couchbase-lite-core/blob/master/modules/docs/pages/replication-protocol.adoc#changes
var changesCmd = &cobra.Command{
	Use:   "changes [sync gateway url]",
	Short: "Send changes",
	Long:  `Send changes.`,
	Run:   changesRun,
	Args:  cobra.MinimumNArgs(1),
}

func init() {
	rootCmd.AddCommand(changesCmd)
}

func changesRun(cmd *cobra.Command, args []string) {

	serverUrl := args[0]

	sgBlipContext, err := NewSgBlipContext(serverUrl)
	if err != nil {
		panic(fmt.Sprintf("Error creeating sgblip context: %v", err))
	}
	defer sgBlipContext.BlipSender.Close()

	// TODO: this should be passed via the command line, either as raw data from stdio, or via file
	changesStr := `
		[
			[99, "docID", "revID", false],
			[100, "docID2", "revID2", false]
		]`

	changes := []interface{}{}
	err = json.Unmarshal([]byte(changesStr), &changes)
	if err != nil {
		panic(fmt.Sprintf("Error unmarshalling changes: %v", err))
	}

	changesRequest := blip.NewRequest()
	changesRequest.SetProfile("changes")
	changesRequest.SetJSONBody(changes)
	changesRequest.SetCompressed(false)

	sent := sgBlipContext.BlipSender.Send(changesRequest)
	if !sent {
			panic(fmt.Sprintf("Unable to subscribe to changes."))
	}

	// read the response
	response := changesRequest.Response()
	log.Printf("response properties: %+v", response.Properties)
	body, err := response.Body()
	if err != nil {
		panic(fmt.Sprintf("Error reading response body: %v", err))
	}
	log.Printf("response body: %s", body)

}

repository: couchbaselabs/sg-blip

repo_name: couchbaselabs/sg-blip


text:
(function (configStore, _, $) {
    "use strict";
    configStore.controller(
        'ConfigItemsEditCtrl',
        ['$scope', '$window', '$modal', 'AppService', '$rootScope',
            function ($scope, $window, $modal, AppService, $rootScope) {
                $scope.globalItemCounter = 0;
                $scope.states = {};
                $scope.viewType = 'edit';

                var self = this;

                this.copyRightToLeft = function (key) {
                    var leftConf = this.getConfig($scope.application.config_items, key);
                    var rightConfig = this.getConfig($scope.otherApplication.config_items, key);

                    if (typeof leftConf == "undefined") {
                        leftConf = _.clone(rightConfig, true);
                        $scope.application.config_items[leftConf.key] = leftConf;
                        $scope.application.config_items[leftConf.key].index = $scope.globalItemCounter;
                        $scope.globalItemCounter += 1;
                    } else {
                        leftConf.value = rightConfig.value;
                    }

                    this.updateStates();
                };

                this.delete = function (key) {
                    //$scope.application.config_items = _.reject($scope.application.config_items, {'key': key});
                    delete $scope.application.config_items[key];

                    this.updateStates();
                };

                this.addConfigModalOpen = function () {
                    var modalInstance = $modal.open({
                        templateUrl: 'addConfig.html',
                        controller: 'AddConfigModalCtrl',
                        resolve: {
                            checkExistingConfigKey: function () {
                                return self.checkExistingConfigKey;
                            }
                        }
                    });

                    modalInstance.result.then(function (newConfig) {
                        self.addConfig(newConfig);
                    });
                };

                this.dispatchConfigModalOpen = function (config) {
                    var modalInstance = $modal.open({
                        templateUrl: '/templates/modals/DispatchConfigModal.html',
                        controller: 'DispatchConfigModalCtrl',
                        resolve: {
                            config: function () {
                                return config;
                            },
                            app: function () {
                                return $scope.application;
                            },
                            groupId: function () {
                                return $scope.group ? $scope.group.id : 'other';
                            }
                        }
                    });

                    modalInstance.result.then(function () {
                        window.location.reload();
                    });
                };

                this.openHelpTutorial = function () {
                    $modal.open({
                        templateUrl: '/templates/modals/HelpModal.html',
                        controller: function ($scope, $modalInstance) {
                            $scope.close = function () {
                                $modalInstance.dismiss('close');
                            };
                        }
                    });
                };

                this.checkExistingConfigKey = function (key) {
                    return !_.contains(_.keys($scope.application.config_items), key);
                };

                this.addConfig = function (newConfig) {
                    var key = newConfig.key;
                    var value = newConfig.value;

                    $scope.application.config_items[key] = {
                        'key': key,
                        'value': value,
                        'index': $scope.globalItemCounter
                    };
                    $scope.globalItemCounter += 1;

                    this.updateStates();
                };

                this.updateStates = function () {
                    var statesKeys;

                    if (typeof $scope.otherApplication != 'undefined') {
                        statesKeys = _.union(_.keys($scope.application.config_items), _.keys($scope.otherApplication.config_items));
                    } else {
                        statesKeys = _.keys($scope.application.config_items);
                    }

                    $scope.states = {};

                    _.each(statesKeys, function (key) {
                        if ($scope.viewType == 'edit') {
                            $scope.states[key] = 'edit';
                            return;
                        }

                        if ($scope.application.config_items.hasOwnProperty(key) && !$scope.otherApplication.config_items.hasOwnProperty(key)) {
                            $scope.states[key] = 'missing_right';
                        } else if (!$scope.application.config_items.hasOwnProperty(key) && $scope.otherApplication.config_items.hasOwnProperty(key)) {
                            $scope.states[key] = 'missing_left';
                        } else {
                            if ($scope.application.config_items[key].value === $scope.otherApplication.config_items[key].value) {
                                $scope.states[key] = 'identical';
                            } else {
                                $scope.states[key] = 'different';
                            }
                        }
                    });
                };

                this.saveConfig = function (callback) {
                    AppService.editApp($scope.application)
                        .then(function (data) {
                            if (typeof callback === 'undefined') {
                                window.location.reload();
                            } else {
                                callback();
                            }
                        }, function (data) {
                            var errorMessage;
                            if (angular.isObject(data)) {
                                errorMessage = data.error;
                            } else {
                                errorMessage = data;
                            }

                            $rootScope.$broadcast('alert', { type: 'danger', msg: errorMessage });
                        });
                };

                this.getBackLinkUrl = function () {
                    if ($scope.application.group) {
                        return '/groups/' + $scope.application.group.id + '/apps';
                    } else {
                        return '/groups/other/apps';
                    }
                };

                this.saveConfigAndClose = function () {
                    this.saveConfig(function () {
                        window.location.href = self.getBackLinkUrl();
                    });
                };

                this.getConfig = function (configItems, key) {
                    return _.find(configItems, {'key': key});
                };

                $scope.getConfig = this.getConfig;

                this.init = function () {
                    $scope.application = $scope.app;

                    if (!$scope.group && $scope.application.group) {
                        $scope.group = $scope.application.group;
                    }

                    if ($scope.group && !$scope.application.group) {
                        $scope.application.group = $scope.group;
                    }

                    $scope.application.config_items = _.reduce($scope.application.config_items, function (results, config) {
                        config.index = $scope.globalItemCounter;
                        $scope.globalItemCounter += 1;
                        results[config.key] = config;

                        return results;
                    }, {});

                    $scope.changeComparedApp($scope.comparedApp);

                    if (typeof $scope.displaySearch === 'undefined') {
                        $scope.displaySearch = false;
                    }

                    if (typeof $scope.filters === 'undefined') {
                        $scope.filters = {
                            query: "",
                            states: []
                        };
                    }

                    if (typeof $scope.actionBar === 'undefined') {
                        $scope.actionBar = 'light';
                    }

                    this.updateStates();

                    $scope.$watch("comparedApp", function (value) {
                        $scope.changeComparedApp(value);
                    });

                    var origOffsetY;
                    var searchBar;

                    function scroll() {
                        if ($($window).scrollTop() >= origOffsetY) {
                            searchBar.addClass('sticky');
                            $('.config-items-edit-container').addClass('config-items-edit-search-padding');
                        } else {
                            searchBar.removeClass('sticky');
                            $('.config-items-edit-container').removeClass('config-items-edit-search-padding');
                        }
                    }

                    if ($scope.displaySearch) {
                        searchBar = $('.config-items-edit-search');
                        origOffsetY = searchBar.offset().top;

                        document.onscroll = scroll;
                    }
                };

                $scope.changeComparedApp = function (comparedApp) {
                    var viewType = 'edit';
                    $scope.comparedApp = comparedApp;

                    if (typeof $scope.comparedApp != 'undefined' && $scope.comparedApp !== null) {
                        $scope.otherApplication = $scope.comparedApp;

                        $scope.otherApplication.config_items = _.reduce($scope.otherApplication.config_items, function (results, config) {
                            results[config.key] = config;
                            return results;
                        }, {});

                        viewType = 'diff';
                    }

                    $scope.viewType = viewType;

                    self.updateStates();
                };

                this.objectSize = function (obj) {
                    var size = 0, key;
                    for (key in obj) {
                        if (obj.hasOwnProperty(key)) size++;
                    }
                    return size;
                };
            }]);

    configStore.controller('DiffEntryCtrl', ['$scope', function ($scope) {
        // I determine if the current line item should be
        // hidden from view due to the current search filter.
        $scope.isExcludedByFilter = applySearchFilter($scope.filters);

        // Any time the search filter changes, we may have to
        // alter the visual exlcusion of our line item.
        $scope.$watch(
            "filters.query",
            function (newName, oldName) {
                if (newName === oldName) {
                    return;
                }
                applySearchFilter($scope.filters);
            }
        );

        function applySearchFilter(filters) {
            var filter = filters.query.toLowerCase();
            var config;

            var watchedFields = [$scope.key.toLowerCase()];

            if ($scope.state != 'missing_left') {
                config = $scope.application.config_items[$scope.key];
                if (typeof config.value !== 'undefined') {
                    watchedFields.push(config.value.toLowerCase());
                }
            }

            if ($scope.state != 'missing_right' && typeof $scope.otherApplication !== 'undefined') {
                config = $scope.getConfig($scope.otherApplication.config_items, $scope.key);
                if (typeof config.value !== 'undefined') {
                    watchedFields.push(config.value.toLowerCase());
                }
            }

            var isSubstring = false;
            watchedFields.forEach(function (item) {
                if (isSubstring === false) {
                    isSubstring = (item.indexOf(filter) !== -1);
                }
            });

            // If the filter value is not a substring of the
            // name, we have to exclude it from view.
            var isExcludedByFilter = !isSubstring;

            if (filters.states.length > 0) {
                isExcludedByFilter = isExcludedByFilter || filters.states.indexOf($scope.states[$scope.key]) == -1;
            }

            $scope.isExcludedByFilter = isExcludedByFilter;

            return $scope.isExcludedByFilter;
        }
    }]);
})(window.config_store, _, $);

repository: Swop/config-store

repo_name: Swop/config-store


text:
SECTION = "devel/chicken"
DESCRIPTION = "Inline Markdown documentation for your code with REPL support and generated files for public export."
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://mdcd.meta;md5=a97140b38fb872e4d0f4bd84cfc2c296"
DEPENDS_append_class-cross = " chicken-egg-directory-utils-cross chicken-egg-regex-cross chicken-egg-filepath-cross"
DEPENDS_append_class-crosssdk = " chicken-egg-directory-utils-crosssdk chicken-egg-regex-crosssdk chicken-egg-filepath-crosssdk"
DEPENDS_append_class-nativesdk = " nativesdk-chicken-egg-directory-utils nativesdk-chicken-egg-regex nativesdk-chicken-egg-filepath chicken-egg-directory-utils-crosssdk chicken-egg-regex-crosssdk chicken-egg-filepath-crosssdk"
DEPENDS = " chicken-egg-directory-utils chicken-egg-regex chicken-egg-filepath chicken-egg-directory-utils-cross chicken-egg-regex-cross chicken-egg-filepath-cross chicken-egg-mdcd-cross"
RDEPENDS_${PN} = " chicken-egg-directory-utils chicken-egg-regex chicken-egg-filepath"

SRC_URI = "http://code.call-cc.org/egg-tarballs/4/mdcd/mdcd-${PV}.tar.gz"

SRC_URI[md5sum] = "28a413556edaaf0673901c3392ce17ea"
SRC_URI[sha256sum] = "815f5adec91865e73fe322269c837a5b001c23abea30cffacea0bfd842ef61f7"

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

inherit chicken_install

BBCLASSEXTEND = "cross crosssdk nativesdk"

repository: OSSystems/meta-chicken

repo_name: OSSystems/meta-chicken


text:
find_package(Python3 COMPONENTS Interpreter)
set(OIF_VENV_PATH ${CMAKE_CURRENT_BINARY_DIR}/venv)
execute_process(COMMAND "${Python3_EXECUTABLE}" -m venv ${OIF_VENV_PATH})

# Here is the trick update the environment with VIRTUAL_ENV variable (mimic the
# activate script)
set(ENV{VIRTUAL_ENV} "${CMAKE_CURRENT_BINARY_DIR}/venv")
# change the context of the search
set(Python3_FIND_VIRTUALENV FIRST)
# unset Python3_EXECUTABLE because it is also an input variable (see
# documentation, Artifacts Specification section)
unset(Python3_EXECUTABLE)
# Launch a new search
find_package(Python3 COMPONENTS Interpreter Development)

execute_process(
  COMMAND
    "${Python3_EXECUTABLE}" -m pip install -qr
    ${PROJECT_SOURCE_DIR}/requirements.txt --cache-dir
    ${CMAKE_CURRENT_BINARY_DIR}/pip_cache)
set(OIF_PYTEST ${OIF_VENV_PATH}/bin/python -m pytest)