text:
/*
 * File:   RF_DataSample.cpp
 * Author: Martin Simon <martiinsiimon@gmail.com>
 */

#include "RF_DataSample.h"
#include "RF_Utils.h"
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>

/**
 * Class constructor. The name of sample is initialized as empty string.
 */
RF_DataSample::RF_DataSample()
{
    this->_name = "";
}

/**
 * Class destructor.
 */
RF_DataSample::~RF_DataSample()
{
}

/**
 * Add sample channel to internal channel vector. The new channel should have the very same size (width and height) as the original sample and the label.
 *
 * @param m New channel to be add
 * @param i Index in internal channel vector where the new channel will be stored
 */
void RF_DataSample::setChannel(Mat m, int i)
{
    this->_channel[i] = m;
}

/**
 * Return channel at given position in internal channel vector.
 *
 * @param i Index of wanted channel in internal channel vector
 * @return Channel at given index
 * @todo Add check for channel existance to avoid possible exception
 */
Mat RF_DataSample::getChannel(int i)
{
    return this->_channel.at(i);
}

/**
 * Return number of rows of label object
 *
 * @return Height (rows) of label object
 */
int RF_DataSample::getHeight()
{
    return this->_label.rows;
}

/**
 * Return number of cols of label object
 *
 * @return Width (cols) of label object
 */
int RF_DataSample::getWidth()
{
    return this->_label.cols;
}

/**
 * Insert label channel. Should have the very same size (width and height) as the original sample
 *
 * @param m The label matrix
 */
void RF_DataSample::setLabel(Mat m)
{
    this->_label = m;
}

/**
 * Return label matrix.
 *
 * @return Matrix with sample labels
 */
Mat RF_DataSample::getLabel()
{
    return this->_label;
}

/**
 * Set a name of this sample
 *
 * @param s New name of this sample
 */
void RF_DataSample::setName(string s)
{
    this->_name = s;
}

/**
 * Get a name of this sample
 * @return A name of this sample
 */
string RF_DataSample::getName()
{
    return this->_name;
}

/**
 * Create and return new sample with all channels in given region. The region is determined as rextangle with two opposite vertices (low [lx,ly] and high [hx,hy]). Also one element matrix can be returned by setting both vertices the same.
 *
 * @param lx Lower vertex x-coordinate
 * @param ly Lower vertex y-coordinate
 * @param hx Higher vertex x-coordinate
 * @param hy Higher vertex y-coordinate
 * @return New subsample in given region of this sample (with all channels)
 */
RF_DataSample* RF_DataSample::getSubsample(int lx, int ly, int hx, int hy)
{
    RF_DataSample * ds = new RF_DataSample();

    /* Set the same name */
    ds->setName(this->_name);

    /* Get subsample of label */
    if (lx == hx && ly == hy)
    {
        /* Only one element matrix wanted */
        ds->setLabel(Mat(this->_label.at<Vec3b>(ly, lx)));
    }
    else
    {
        /* Rectangle of original sample wanted */
        ds->setLabel(Mat(this->_label, Rect(lx, ly, hx - lx, hy - ly)));
    }

    /* Do the same with all the channels */
    for (map<int, Mat>::iterator it = this->_channel.begin(); it != this->_channel.end(); it++)
    {
        if (it->first == T_CHANNEL_RGB)
            continue;

        if (lx == hx && ly == hy)
        {
            /* Only one element matrix wanted */
            if (it->first == T_CHANNEL_RGB)
            {
                ds->setChannel(Mat(it->second.at<Vec3b>(ly, lx)), it->first);
            }
            else
            {
                ds->setChannel(Mat(1, 1, CV_8UC1, Scalar(it->second.at<uchar>(ly, lx))), it->first);
            }
        }
        else
        {
            /* Rectangle of original sample wanted */
            ds->setChannel(Mat(it->second, Rect(lx, ly, hx - lx, hy - ly)), it->first);
        }
    }
    return ds;
}

/**
 * Generate channel determined by id from enum T_CHANNELS. It contains switch-case statement with hardcoded action what channel should be generated. It does not actully generate the channel, only call the function witch does.
 *
 * @param id ID from T_CHANNELS enum to determine requested channel
 */
void RF_DataSample::generateChannel(int id)
{
    switch (id)
    {
    case T_CHANNEL_RGB:
        break;
    case T_CHANNEL_GRAY:
        this->createGrayscaleChannel();
        break;
    case T_CHANNEL_R:
        this->createRedChannel();
        break;
    case T_CHANNEL_G:
        this->createGreenChannel();
        break;
    case T_CHANNEL_B:
        this->createBlueChannel();
        break;
    default:
        return;
    }
}

/**
 * Generate grayscale channel from the original rgb channel and store it
 */
void RF_DataSample::createGrayscaleChannel()
{
    Mat gray;
    cvtColor(this->_channel[T_CHANNEL_RGB], gray, CV_BGR2GRAY);
    this->_channel[T_CHANNEL_GRAY] = gray;
}

/**
 * Generate only red channel from the original rgb channel and store it
 */
void RF_DataSample::createRedChannel()
{
    Mat channel[3];

    split(this->_channel[T_CHANNEL_RGB], channel); //order BGR

    Mat ch;
    channel[0].convertTo(ch, CV_8UC1);
    this->_channel[T_CHANNEL_R] = ch;
}

/**
 * Generate only green channel from the original rgb channel and store it
 */
void RF_DataSample::createGreenChannel()
{
    Mat channel[3];

    split(this->_channel[T_CHANNEL_RGB], channel); //order BGR

    Mat ch;
    channel[1].convertTo(ch, CV_8UC1);
    this->_channel[T_CHANNEL_G] = ch;
}

/**
 * Generate only blue channel from the original rgb channel and store it
 */
void RF_DataSample::createBlueChannel()
{
    Mat channel[3];

    split(this->_channel[T_CHANNEL_RGB], channel); //order BGR

    Mat ch;
    channel[2].convertTo(ch, CV_8UC1);
    this->_channel[T_CHANNEL_B] = ch;
}

/**
 * Evaluate result. Compare given result DataSample and compare its label with the original one.
 *
 * @param ds DataSample of the result of the classification
 * @return Float value representing percentual similarity of given and real
 */
float RF_DataSample::getSimilarityOflabels(RF_DataSample* ds)
{
    if (this->_label.cols != ds->getLabel().cols || this->_label.rows != ds->getLabel().rows)
    {
        cerr << "Error, these two samples aren't same!" << endl;
        return 0.0f;
    }

    uint sum = 0;
    uint count = 0;

    for (int y = 0; y < this->_label.rows; y++)
    {
        for (int x = 0; x < this->_label.cols; x++)
        {
            if (this->_label.at<Vec3b>(y, x) == Vec3b(0, 0, 0))
                continue;

            if (this->_label.at<Vec3b>(y, x) == ds->_label.at<Vec3b>(y, x))
            {
                sum++;
            }
            count++;
        }
    }

    return (float) sum / (float) count * 100;
}

extension: cpp


text:
package cwb

import (
	"context"
	"net/http"
	"net/url"
)

const (
	// Data set Ids
	// Weather observation data
	StationObsWeatherId = "O-A0001-001"

	// Rainfall observation data
	StationObsRainfallId = "O-A0002-001"
)

type StationObsService service

type StationObsResponse struct {
	Success string `json:"success"`
	Result  Result `json:"result"`
	Records struct {
		Location []StationObsLocation `json:"location"`
	} `json:"records"`
}

type StationObsWeather StationObsResponse

type StationObsLocation struct {
	Lat          string `json:"lat"`
	Lon          string `json:"lon"`
	LocationName string `json:"locationName"`
	StationId    string `json:"stationId"`
	Time         struct {
		ObsTime string `json:"obsTime"`
	} `json:"time"`
	WeatherElement StationObsElements `json:"weatherElement"`
	Parameter      []Parameter        `json:"parameter"`
}

type StationObsElement struct {
	ElementName  string `json:"elementName"`
	ElementValue string `json:"elementValue"`
}

type StationObsElements []StationObsElement

func (es StationObsElements) GetByName(name string) (StationObsElement, error) {
	for _, element := range es {
		if element.ElementName == name {
			return element, nil
		}
	}
	return StationObsElement{}, ErrElementNotFound
}

// GetWeather gets weather observation data.
func (s *StationObsService) GetWeather(ctx context.Context, options url.Values) (*StationObsWeather, *http.Response, error) {
	obs := new(StationObsWeather)
	req, err := s.client.Get(ctx, s.client.generateURL(StationObsWeatherId, options), obs)
	if err != nil {
		return nil, nil, err
	}
	return obs, req, nil
}

type StationObsRainfall StationObsResponse

// GetRainfall gets rainfall observation data.
func (s *StationObsService) GetRainfall(ctx context.Context, options url.Values) (*StationObsRainfall, *http.Response, error) {
	obs := new(StationObsRainfall)
	req, err := s.client.Get(ctx, s.client.generateURL(StationObsRainfallId, options), obs)
	if err != nil {
		return nil, nil, err
	}
	return obs, req, nil
}

license: MIT

repository: minchao/go-cwb

license_type: permissive

repo_name: minchao/go-cwb

branch_name: refs/heads/master

extension: go


text:
package main

import (
	"regexp"
	"testing"

	"github.com/gruntwork-io/terratest/modules/helm"
	"github.com/stretchr/testify/require"
	extensions "k8s.io/api/extensions/v1beta1"
	networkingv1 "k8s.io/api/networking/v1"
	networkingv1beta "k8s.io/api/networking/v1beta1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

func TestIngressTemplate_ModSecurity(t *testing.T) {
	templates := []string{"templates/ingress.yaml"}
	modSecuritySnippet := "SecRuleEngine DetectionOnly\n"
	modSecuritySnippetWithSecRules := modSecuritySnippet + `SecRule REQUEST_HEADERS:User-Agent \"scanner\" \"log,deny,id:107,status:403,msg:\'Scanner Identified\'\"
SecRule REQUEST_HEADERS:Content-Type \"text/plain\" \"log,deny,id:\'20010\',status:403,msg:\'Text plain not allowed\'\"
`
	defaultAnnotations := map[string]string{
		"kubernetes.io/ingress.class": "nginx",
		"kubernetes.io/tls-acme":      "true",
	}
	defaultModSecurityAnnotations := map[string]string{
		"nginx.ingress.kubernetes.io/modsecurity-transaction-id": "$server_name-$request_id",
	}
	modSecurityAnnotations := make(map[string]string)
	secRulesAnnotations := make(map[string]string)
	mergeStringMap(modSecurityAnnotations, defaultAnnotations)
	mergeStringMap(modSecurityAnnotations, defaultModSecurityAnnotations)
	mergeStringMap(secRulesAnnotations, defaultAnnotations)
	mergeStringMap(secRulesAnnotations, defaultModSecurityAnnotations)
	modSecurityAnnotations["nginx.ingress.kubernetes.io/modsecurity-snippet"] = modSecuritySnippet
	secRulesAnnotations["nginx.ingress.kubernetes.io/modsecurity-snippet"] = modSecuritySnippetWithSecRules

	tcs := []struct {
		name       string
		valueFiles []string
		values     map[string]string
		meta       metav1.ObjectMeta
	}{
		{
			name: "defaults",
			meta: metav1.ObjectMeta{Annotations: defaultAnnotations},
		},
		{
			name:   "with modSecurity enabled without custom secRules",
			values: map[string]string{"ingress.modSecurity.enabled": "true"},
			meta:   metav1.ObjectMeta{Annotations: modSecurityAnnotations},
		},
		{
			name:       "with custom secRules",
			valueFiles: []string{"../testdata/modsecurity-ingress.yaml"},
			meta:       metav1.ObjectMeta{Annotations: secRulesAnnotations},
		},
	}

	for _, tc := range tcs {
		t.Run(tc.name, func(t *testing.T) {
			opts := &helm.Options{
				ValuesFiles: tc.valueFiles,
				SetValues:   tc.values,
			}
			output := helm.RenderTemplate(t, opts, helmChartPath, "modsecurity-test-release", templates)

			ingress := new(extensions.Ingress)
			helm.UnmarshalK8SYaml(t, output, ingress)

			require.Equal(t, tc.meta.Annotations, ingress.ObjectMeta.Annotations)
		})
	}
}

func TestIngressTemplate_DifferentTracks(t *testing.T) {
	templates := []string{"templates/ingress.yaml"}
	tcs := []struct {
		name        string
		releaseName string
		values      map[string]string

		expectedName                     string
		expectedLabels                   map[string]string
		expectedSelector                 map[string]string
		expectedAnnotations              map[string]string
		expectedInexistentAnnotationKeys []string
		expectedErrorRegexp              *regexp.Regexp
	}{
		{
			name:                             "defaults",
			releaseName:                      "production",
			expectedName:                     "production-auto-deploy",
			expectedAnnotations:              map[string]string{"kubernetes.io/ingress.class": "nginx"},
			expectedInexistentAnnotationKeys: []string{"nginx.ingress.kubernetes.io/canary"},
		},
		{
			name:                             "with canary track",
			releaseName:                      "production-canary",
			values:                           map[string]string{"application.track": "canary"},
			expectedName:                     "production-canary-auto-deploy",
			expectedAnnotations:              map[string]string{"nginx.ingress.kubernetes.io/canary": "true", "nginx.ingress.kubernetes.io/canary-by-header": "canary", "kubernetes.io/ingress.class": "nginx"},
			expectedInexistentAnnotationKeys: []string{"nginx.ingress.kubernetes.io/canary-weight"},
		},
		{
			name:                "with canary weight",
			releaseName:         "production-canary",
			values:              map[string]string{"application.track": "canary", "ingress.canary.weight": "25"},
			expectedName:        "production-canary-auto-deploy",
			expectedAnnotations: map[string]string{"nginx.ingress.kubernetes.io/canary-weight": "25"},
		},
	}

	for _, tc := range tcs {
		t.Run(tc.name, func(t *testing.T) {
			output, ret := renderTemplate(t, tc.values, tc.releaseName, templates, tc.expectedErrorRegexp)

			if ret == false {
				return
			}

			ingress := new(extensions.Ingress)
			helm.UnmarshalK8SYaml(t, output, ingress)
			require.Equal(t, tc.expectedName, ingress.ObjectMeta.Name)
			for key, value := range tc.expectedAnnotations {
				require.Equal(t, ingress.ObjectMeta.Annotations[key], value)
			}
			for _, key := range tc.expectedInexistentAnnotationKeys {
				require.Empty(t, ingress.ObjectMeta.Annotations[key])
			}
		})
	}
}

func TestIngressTemplate_TLS(t *testing.T) {
	templates := []string{"templates/ingress.yaml"}
	releaseName := "ingress-tls-test"
	tcs := []struct {
		name   string
		values map[string]string

		expectedAnnotations map[string]string
		expectedIngressTLS  []extensions.IngressTLS
		expectedErrorRegexp *regexp.Regexp
	}{
		{
			name:                "defaults",
			expectedAnnotations: map[string]string{"kubernetes.io/ingress.class": "nginx", "kubernetes.io/tls-acme": "true"},
			expectedIngressTLS: []extensions.IngressTLS{
				extensions.IngressTLS{
					Hosts:      []string{"my.host.com"},
					SecretName: releaseName + "-auto-deploy-tls",
				},
			},
		},
		{
			name:                "with tls disabled",
			values:              map[string]string{"ingress.tls.enabled": "false"},
			expectedAnnotations: map[string]string{"kubernetes.io/ingress.class": "nginx"},
			expectedIngressTLS:  []extensions.IngressTLS(nil),
		},
	}

	for _, tc := range tcs {
		t.Run(tc.name, func(t *testing.T) {
			output, ret := renderTemplate(t, tc.values, releaseName, templates, tc.expectedErrorRegexp)

			if ret == false {
				return
			}

			ingress := new(extensions.Ingress)
			helm.UnmarshalK8SYaml(t, output, ingress)
			require.Equal(t, tc.expectedAnnotations, ingress.ObjectMeta.Annotations)
			require.Equal(t, tc.expectedIngressTLS, ingress.Spec.TLS)
		})
	}
}

func TestIngressTemplate_Disable(t *testing.T) {
	templates := []string{"templates/ingress.yaml"}
	releaseName := "ingress-disable-test"
	tcs := []struct {
		name   string
		values map[string]string

		expectedName        string
		expectedErrorRegexp *regexp.Regexp
	}{
		{
			name:         "defaults",
			expectedName: releaseName + "-auto-deploy",
		},
		{
			name:         "with ingress.enabled key undefined, but service is enabled",
			values:       map[string]string{"ingress.enabled": "null", "service.enabled": "true"},
			expectedName: releaseName + "-auto-deploy",
		},
		{
			name:                "with service disabled and track stable",
			values:              map[string]string{"service.enabled": "false", "application.track": "stable"},
			expectedErrorRegexp: regexp.MustCompile("Error: could not find template templates/ingress.yaml in chart"),
		},
		{
			name:                "with service disabled and track non-stable",
			values:              map[string]string{"service.enabled": "false", "application.track": "non-stable"},
			expectedErrorRegexp: regexp.MustCompile("Error: could not find template templates/ingress.yaml in chart"),
		},
		{
			name:                "with ingress disabled",
			values:              map[string]string{"ingress.enabled": "false"},
			expectedErrorRegexp: regexp.MustCompile("Error: could not find template templates/ingress.yaml in chart"),
		},
		{
			name:                "with ingress enabled and service disabled",
			values:              map[string]string{"ingress.enabled": "true", "service.enabled": "false"},
			expectedErrorRegexp: regexp.MustCompile("Error: could not find template templates/ingress.yaml in chart"),
		},
		{
			name:                "with ingress disabled and service enabled and track stable",
			values:              map[string]string{"ingress.enabled": "false", "service.enabled": "true", "application.track": "stable"},
			expectedErrorRegexp: regexp.MustCompile("Error: could not find template templates/ingress.yaml in chart"),
		},
	}

	for _, tc := range tcs {
		t.Run(tc.name, func(t *testing.T) {
			opts := &helm.Options{
				SetValues: tc.values,
			}
			output, err := helm.RenderTemplateE(t, opts, helmChartPath, releaseName, templates)

			if tc.expectedErrorRegexp != nil {
				require.Regexp(t, tc.expectedErrorRegexp, err.Error())
				return
			}
			if err != nil {
				t.Error(err)
				return
			}

			ingress := new(extensions.Ingress)
			helm.UnmarshalK8SYaml(t, output, ingress)
			require.Equal(t, tc.expectedName, ingress.ObjectMeta.Name)
		})
	}
}

func TestIngressTemplate_HTTPPath(t *testing.T) {
	templates := []string{"templates/ingress.yaml"}
	releaseName := "ingress-http-path-test"
	tcs := []struct {
		name   string
		values map[string]string

		expectedpath string
	}{
		{
			name:         "defaults",
			expectedpath: "/",
		},
		{
			name:         "with /*",
			values:       map[string]string{"ingress.path": "/*"},
			expectedpath: "/*",
		},
		{
			name:         "with /myapi",
			values:       map[string]string{"ingress.path": "/myapi"},
			expectedpath: "/myapi",
		},
	}

	for _, tc := range tcs {
		t.Run(tc.name, func(t *testing.T) {
			opts := &helm.Options{
				SetValues: tc.values,
			}
			output := helm.RenderTemplate(t, opts, helmChartPath, releaseName, templates)

			ingress := new(extensions.Ingress)

			helm.UnmarshalK8SYaml(t, output, ingress)
			require.Equal(t, tc.expectedpath, ingress.Spec.Rules[0].IngressRuleValue.HTTP.Paths[0].Path)
		})
	}
}

func TestIngressTemplate_TLSSecret(t *testing.T) {
	templates := []string{"templates/ingress.yaml"}
	releaseName := "ingress-secret-name-test"
	tcs := []struct {
		name   string
		values map[string]string

		expectedsecretname string
	}{
		{
			name:               "default condition from values - use the provided secretName",
			expectedsecretname: releaseName + "-auto-deploy-tls",
		},
		{
			name:               "don't set the secretName, use the default secret/cert",
			values:             map[string]string{"ingress.tls.useDefaultSecret": "true"},
			expectedsecretname: "",
		},
		{
			name:               "use the provided secretName",
			values:             map[string]string{"ingress.useDefaultSecret": "false"},
			expectedsecretname: releaseName + "-auto-deploy-tls",
		},
	}

	for _, tc := range tcs {
		t.Run(tc.name, func(t *testing.T) {
			opts := &helm.Options{
				SetValues: tc.values,
			}
			output := helm.RenderTemplate(t, opts, helmChartPath, releaseName, templates)

			ingress := new(extensions.Ingress)

			helm.UnmarshalK8SYaml(t, output, ingress)
			require.Equal(t, tc.expectedsecretname, ingress.Spec.TLS[0].SecretName)
		})
	}
}

func TestIngressTemplate_NetworkingV1Beta1(t *testing.T) {
	templates := []string{"templates/ingress.yaml"}
	releaseName := "ingress-networking-v1beta1"
	tcs := []struct {
		name                           string
		values                         map[string]string
		expectedIngressClassAnnotation string
	}{
		{
			name:                           "defaults",
			expectedIngressClassAnnotation: "nginx",
		},
		{
			name: "custom ingress.className",
			values: map[string]string{
				"ingress.className": "custom",
			},
			expectedIngressClassAnnotation: "custom",
		},
	}
	for _, tc := range tcs {
		t.Run(tc.name, func(t *testing.T) {
			opts := &helm.Options{
				SetValues: tc.values,
			}
			output := helm.RenderTemplate(t, opts, helmChartPath, releaseName, templates, "--api-versions", "networking.k8s.io/v1beta1/Ingress")
			ingress := new(networkingv1beta.Ingress)
			helm.UnmarshalK8SYaml(t, output, ingress)
			require.Equal(t, "networking.k8s.io/v1beta1", ingress.APIVersion)
			require.Equal(t, tc.expectedIngressClassAnnotation, ingress.Annotations["kubernetes.io/ingress.class"])
		})
	}
}

func TestIngressTemplate_NetworkingV1(t *testing.T) {
	templates := []string{"templates/ingress.yaml"}
	releaseName := "ingress-networking-v1"
	tcs := []struct {
		name                           string
		values                         map[string]string
		expectedIngressClassName       string
		expectedIngressClassAnnotation string
	}{
		{
			name:                           "defaults",
			expectedIngressClassAnnotation: "nginx",
		},
		{
			name: "custom ingress.className",
			values: map[string]string{
				"ingress.className": "custom",
			},
			expectedIngressClassName:       "custom",
			expectedIngressClassAnnotation: "custom",
		},
	}
	for _, tc := range tcs {
		t.Run(tc.name, func(t *testing.T) {
			opts := &helm.Options{
				SetValues: tc.values,
			}
			output := helm.RenderTemplate(t, opts, helmChartPath, releaseName, templates, "--api-versions", "networking.k8s.io/v1/Ingress")
			ingress := new(networkingv1.Ingress)
			helm.UnmarshalK8SYaml(t, output, ingress)
			require.Equal(t, "networking.k8s.io/v1", ingress.APIVersion)
			if tc.expectedIngressClassName == "" {
				require.Nil(t, ingress.Spec.IngressClassName)
			} else {
				require.Equal(t, tc.expectedIngressClassName, *ingress.Spec.IngressClassName)
			}
			require.Equal(t, tc.expectedIngressClassAnnotation, ingress.Annotations["kubernetes.io/ingress.class"])
		})
	}
}

func TestIngressTemplate_Extensions(t *testing.T) {
	templates := []string{"templates/ingress.yaml"}
	releaseName := "ingress-extensions-v1beta1"
	opts := &helm.Options{
		SetValues: map[string]string{"ingress.enabled": "true"},
	}
	output := helm.RenderTemplate(t, opts, helmChartPath, releaseName, templates, "--api-versions", "extensions/v1beta1/Ingress")
	ingress := new(extensions.Ingress)
	helm.UnmarshalK8SYaml(t, output, ingress)
	require.Equal(t, "extensions/v1beta1", ingress.APIVersion)
	require.Equal(t, "nginx", ingress.Annotations["kubernetes.io/ingress.class"])
}

repository: clayrisser/charts

repo_name: clayrisser/charts

branch_name: refs/heads/main

gha_license_id: MIT

gha_language: Mustache


text:
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=bf1229cd7425b302d60cdb641b0ce5fb"
DEPENDS = "wpewebkit libsoup-2.4 glib-2.0 ninja-native"

SRCREV = "b6d621af5d444fa3a2b78cc6da41463c33a78cc2"
SRC_URI = "git://github.com/aperezdc/dinghy.git;protocol=https;branch=master"

inherit cmake

S = "${WORKDIR}/git"
B = "${S}"

EXTRA_OECMAKE += " \
    -DDY_USE_MODE_MONITOR=ON -DDY_USE_DRM_MODE_MONITOR=ON \
    -G Ninja \
"

repository: psaavedra/meta-webkit

repo_name: psaavedra/meta-webkit

extension: bb


text:
package subsumption_test

import (
	"errors"
	. "github.com/cad-san/go-subsumption"
	gomock "github.com/golang/mock/gomock"
	"testing"
)

func TestCreate(t *testing.T) {
	agent := Agent{}

	if agent.Size() != 0 {
		t.Errorf("agent.Size() should be 0")
	}
}

func TestAddBehavior(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	behabior := NewMockBehavior(ctrl)
	agent := Agent{}

	agent.AddBehavior(behabior)

	if agent.Size() != 1 {
		t.Errorf("agent.Size() should be 1")
	}
}

func TestInit(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	behabior := NewMockBehavior(ctrl)
	behabior.EXPECT().Init()

	agent := Agent{}
	agent.AddBehavior(behabior)

	agent.Init()
}

func TestPerform(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	behabior := NewMockBehavior(ctrl)
	behabior.EXPECT().Sense().Return(true, nil)
	behabior.EXPECT().Perform().Return(true, nil)

	agent := Agent{}
	agent.AddBehavior(behabior)

	ret, err := agent.Perform()

	if err != nil {
		t.Errorf("unexpected agent.Perform() fail with : %v", err)
	}
	if ret != true {
		t.Errorf("agent.Perform() should be true because behabior is active")
	}
}

func TestPerformMulti(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	first := NewMockBehavior(ctrl)
	first.EXPECT().Sense().Return(false, nil)

	second := NewMockBehavior(ctrl)
	second.EXPECT().Sense().Return(true, nil)
	second.EXPECT().Perform().Return(true, nil)

	agent := Agent{}
	agent.AddBehavior(first)
	agent.AddBehavior(second)

	ret, err := agent.Perform()

	if err != nil {
		t.Errorf("agent.Perform() failed with : %v", err)
	}
	if ret != true {
		t.Errorf("agent.Perform() should be false because [second] behabior is active")
	}
}

func TestSenceError(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	behabior := NewMockBehavior(ctrl)
	behabior.EXPECT().Sense().Return(false, errors.New("unknown error"))

	agent := Agent{}
	agent.AddBehavior(behabior)

	ret, err := agent.Perform()

	if err != nil {
		t.Errorf("unexpected agent.Perform() fail with : %v", err)
	}
	if ret != false {
		t.Errorf("agent.Perform() should be false because no behavior is active")
	}
}

func TestPerformNoActive(t *testing.T) {
	ctrl := gomock.NewController(t)
	defer ctrl.Finish()

	first := NewMockBehavior(ctrl)
	first.EXPECT().Sense().Return(false, nil)

	second := NewMockBehavior(ctrl)
	second.EXPECT().Sense().Return(false, nil)

	agent := Agent{}
	agent.AddBehavior(first)
	agent.AddBehavior(second)

	ret, err := agent.Perform()

	if err != nil {
		t.Errorf("agent.Perform() failed with : %v", err)
	}
	if ret != false {
		t.Errorf("agent.Perform() should be false because no behavior is active")
	}
}

repository: cad-san/go-subsumption

repo_name: cad-san/go-subsumption


text:
package nav_msgs //nolint:golint

import (
	"github.com/aler9/goroslib/pkg/msg"
	"github.com/aler9/goroslib/pkg/msgs/geometry_msgs"
	"github.com/aler9/goroslib/pkg/msgs/std_msgs"
)

type GridCells struct { //nolint:golint
	msg.Package `ros:"nav_msgs"`
	Header      std_msgs.Header       //nolint:golint
	CellWidth   float32               //nolint:golint
	CellHeight  float32               //nolint:golint
	Cells       []geometry_msgs.Point //nolint:golint
}

repository: gwaxG/goroslib

repo_name: gwaxG/goroslib


text:
#include <iostream>
#include <string>
using std::cout;
using std::endl;
using std::string;
int main()
{
    string* sp = new string("a value"); // allocate and initialize a string
    cout << *sp << endl;
    sp->~string();                      // destroy but not deallocate the string
    new (sp) string("another value");   // reconstruct the string
    cout << *sp << endl;
    delete sp;                          // destroy and deallocate the string
    return 0;
}


text:
// Stream contains bigquery-specific code for the recorder.
package main

import (
	"context"
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"time"

	"cloud.google.com/go/bigquery"
	"google.golang.org/api/iterator"
)

// Connect sets up a google bigquery client.
func (r *Recorder) Connect(ctx context.Context, dataset, table string) error {
	if dataset == "" || table == "" {
		return errors.New("must specify both dataset and table")
	}

	project := ""
	// Get the bigquery credentials as set.
	if credFile := os.Getenv("GOOGLE_APPLICATION_CREDENTIALS"); len(credFile) > 0 {
		f, err := ioutil.ReadFile(credFile)
		if err != nil {
			return err
		}
		type credFile struct {
			ProjectID string `json:"project_id"`
		}
		var creds credFile
		if err := json.Unmarshal(f, &creds); err != nil {
			return err
		}
		project = creds.ProjectID
	} else if proj := os.Getenv("GOOGLE_APPLICATION_PROJECT_ID"); len(proj) > 0 {
		project = proj
	}

	if project == "" {
		return errors.New("could not determine project from environment")
	}

	client, err := bigquery.NewClient(ctx, project)
	if err != nil {
		return err
	}
	r.Client = client
	r.nodeStream = make(chan *Node, 5)
	r.trialStream = make(chan []*Trial, 5)

	go r.insert(ctx, dataset, table+"_node", table+"_trial")
	return nil
}

// setupBigquery creates tables with schemas if they do not yet exist for the given table prefix
func (r *Recorder) setupBigquery(c context.Context, dataset, table string, create bool) error {
	ds := r.Client.Dataset(dataset)
	nt := ds.Table(table + "_node")
	if _, err := nt.Metadata(c); err != nil {
		if !create {
			return err
		}
		ns, err := bigquery.InferSchema(new(Node))
		if err != nil {
			return err
		}
		err = nt.Create(c, &bigquery.TableMetadata{
			Name:             "IPFS crawler observed Nodes",
			Description:      fmt.Sprintf("Node observations created %s version %s", time.Now(), Version),
			Schema:           ns,
			TimePartitioning: &bigquery.TimePartitioning{Field: "observed"},
		})
		if err != nil {
			return err
		}
	}

	tt := ds.Table(table + "_trial")
	if _, err := tt.Metadata(c); err != nil {
		if !create {
			return err
		}
		ts, err := bigquery.InferSchema(new(TrialSchema))
		if err != nil {
			return err
		}
		err = tt.Create(c, &bigquery.TableMetadata{
			Name:             "IPFS crawler connection attempts",
			Description:      fmt.Sprintf("Trial observations created %s version %s", time.Now(), Version),
			Schema:           ts,
			TimePartitioning: &bigquery.TimePartitioning{Field: "observed"},
		})
		if err != nil {
			return err
		}
	}
	return nil
}

func (r *Recorder) getMultiAddrs(ctx context.Context, dataset, table string, where time.Duration) ([]string, error) {
	var q *bigquery.Query
	if where == 0 {
		q = r.Client.Query(fmt.Sprintf("SELECT DISTINCT peer_id, multi_address FROM %s.%s", dataset, table))
	} else {
		q = r.Client.Query(fmt.Sprintf("SELECT DISTINCT peer_id, multi_address FROM %s.%s, UNNEST(results) r WHERE r.Success = true AND observed > @ts_value", dataset, table))
		q.Parameters = []bigquery.QueryParameter{
			{
				Name:  "ts_value",
				Value: time.Now().Add(-1 * where),
			},
		}
	}
	job, err := q.Run(ctx)
	if err != nil {
		return nil, err
	}
	status, err := job.Wait(ctx)
	if err != nil {
		return nil, err
	}
	if err := status.Err(); err != nil {
		return nil, err
	}

	iter, err := q.Read(ctx)
	if err != nil {
		return nil, err
	}

	var row TrialSchema
	err = iter.Next(&row)
	if err == iterator.Done {
		r.log.Warnf("No rows matched query: %s", q.Q)
		return []string{}, nil
	}
	if err != nil {
		return nil, err
	}

	out := make([]string, 0, iter.TotalRows)
	ma, err := row.MAString()
	if err != nil {
		r.log.Debugf("Failed to re-generate address for peer: %v", err)
	} else {
		out = append(out, ma)
	}

	for {
		err := iter.Next(&row)
		if err == iterator.Done {
			return out, nil
		}
		if err != nil {
			return nil, err
		}
		ma, err = row.MAString()
		if err != nil {
			r.log.Debugf("Failed to re-generate address for peer: %v", err)
		} else {
			out = append(out, ma)
		}
	}
}

func (r *Recorder) insert(ctx context.Context, dataset, nodeTable, trialTable string) {
	nodeInserter := r.Client.Dataset(dataset).Table(nodeTable).Inserter()
	trialInserter := r.Client.Dataset(dataset).Table(trialTable).Inserter()
	r.wg.Add(1)
	defer r.wg.Done()

	done := ctx.Done()

	for {
		if r.nodeStream == nil && r.trialStream == nil {
			return
		}

		select {
		case n, ok := <-r.nodeStream:
			if !ok {
				r.nodeStream = nil
				continue
			}
			if err := nodeInserter.Put(ctx, n); err != nil {
				r.log.Warnf("Failed to upload %v: %v", n, err)
			}
		case t, ok := <-r.trialStream:
			if !ok {
				r.trialStream = nil
				continue
			}
			if err := trialInserter.Put(ctx, t); err != nil {
				r.log.Warnf("Failed to upload trial %v: %v", t, err)
			}
		case <-done:
			close(r.nodeStream)
			close(r.trialStream)
			done = nil
		}
	}
}

// Finish closes out remaining uploads for the recorder.
func (r *Recorder) Finish() error {
	if r.trialStream != nil {
		trials := make([]*Trial, 0, 1000)
		i := 0
		r.dials.Range(func(_, val interface{}) bool {
			trials = append(trials, val.(*Trial))
			i++
			if len(trials) > 1000 {
				r.trialStream <- trials
				trials = make([]*Trial, 0, 1000)
			}
			return true
		})
		r.trialStream <- trials
		r.log.Info("Total trials: ", i)
	}
	r.log.Info("Closing context...")
	time.Sleep(time.Second)
	r.cancel()
	r.log.Info("Waiting for all queries to finish...")
	r.wg.Wait()
	if r.Client != nil {
		return r.Client.Close()
	}
	return nil
}


text:
package parsers

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

var dateFormats = []string{
	"02.01.2006",
	"2.1.2006",
	"2.Jan.2006",
	"02.Jan.2006",
	"02 01 2006",
	"2 1 2006",
	"2 Jan 2006",
	"02 Jan 2006",
	"02.01.06",
	"2.1.06",
	"2.Jan.06",
	"02.Jan.06",
	"2.January.2006",
	"02.January.2006",
	time.ANSIC,
	time.UnixDate,
	time.RubyDate,
	time.RFC822,
	time.RFC822Z,
	time.RFC850,
	time.RFC1123,
	time.RFC1123Z,
	time.RFC3339,
	time.RFC3339Nano,
	time.Kitchen,
	time.Stamp,
	time.StampMilli,
	time.StampMicro,
	time.StampNano,
	http.TimeFormat,
}

func ParseDate(date string) (time.Time, error) {
	var (
		format   string
		dateTime time.Time
		err      error
	)

	for _, format = range dateFormats {
		if dateTime, err = time.Parse(format, date); err == nil {
			return dateTime, nil
		}
	}
	return time.Time{}, fmt.Errorf("Could not parse date '%s'", date)

}

repository: msgpo/paperless-office

repo_name: msgpo/paperless-office


text:
package finance

import (
	"testing"

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

func Test_FetchCSV(t *testing.T) {

	// Given that we want to download a csv
	ts := startTestServer("request_csv_fixture.csv")
	defer ts.Close()

	// When we request the csv,
	table, err := fetchCSV(ts.URL)
	assert.Nil(t, err)

	// Then the returned table should have 1 row.
	assert.Len(t, table, 1)
	// And the first cell should be
	assert.Equal(t, "foo", table[0][0])
	// Then the second cell should be
	assert.Equal(t, "bar", table[0][1])
}

func Test_BuildURL(t *testing.T) {

	//Given we have a base url and a set of query params,
	base := "http://example.com/d/quotes.csv"
	params := map[string]string{
		"s": "AAPL",
	}

	// When we convert it to a url,
	url := buildURL(base, params)

	// Then the url should equal-
	assert.Equal(t, "http://example.com/d/quotes.csv?s=AAPL", url)
}

func Test_Fetch(t *testing.T) {
	// Given that we want to download options data
	// ts := startTestServer("request_fixture.txt")
	// defer ts.Close()
	//
	// // When we request the malformed json text,
	// response, err := fetchOptions(ts.URL)
	// assert.Nil(t, err)

	// Then the returned string should be-
	//assert.Equal(t, "{\"test\":{\"foo\":bar}}\n\n", string(response))

}

repository: ellimist/go-finance

repo_name: ellimist/go-finance


text:
package daemon

import (
	"fmt"
	"os"
	"os/exec"
	"os/signal"
)

const (
	// EnvName Identify the name of the environment variable that is the child process.
	// A simple method is to set an environment variable so that the program can determine whether it is created by its own parent process after getting it.
	EnvName = "DAEMON"
)

// Worker The interface that the working program must implement
type Worker interface {
	// PidSavePath pid file save path
	PidSavePath() string
	// Name pid file name
	Name() string
	// Start Program startup entry method
	Start()
	// Stop Program stop handle
	Stop() error
	// Restart Program restart handle
	Restart() error
}

type (
	// system signal handlers
	signalHandlers map[os.Signal]func()
	// Process a service process info
	Process struct {
		Pipeline       [3]*os.File // input/output pipe, 0->input, 1->output, 2->err
		Pid            *Pid        // pid pid info
		worker         Worker      // worker
		DaemonTag      string
		SignalHandlers signalHandlers // signal handlers
	}
)

// Listen listen all system signals
func (handlers signalHandlers) Listen() {
	var sig = make(chan os.Signal)
	signal.Notify(sig)
	for {
		received := <-sig
		if handler, ok := handlers[received]; ok {
			handler()
		}
	}
}

// NewProcess create a process instance with Worker
func NewProcess(worker Worker) *Process {
	process := &Process{
		Pipeline: [3]*os.File{os.Stdin, os.Stdout, os.Stderr},
		Pid: &Pid{
			ServicesName: worker.Name(),
			SavePath:     worker.PidSavePath(),
			Pid:          os.Getpid(),
		},
		worker:    worker,
		DaemonTag: EnvName,
	}
	process.registerDefaultInterruptHandle()
	process.registerDefaultStopHandle()
	process.registerDefaultRestartHandle()
	return process
}

// SetPipeline set standard i/o pipeline, 0 -> stdin(generally give up directly, you can send nil), 1 -> stdout, 2 -> stderr
// of course, you can choose not to set it.
func (process *Process) SetPipeline(pipes ...*os.File) *Process {
	if len(pipes) > 3 {
		pipes = pipes[0:3]
	}
	for index, pipe := range pipes {
		process.Pipeline[index] = pipe
	}
	return process
}

// SetDaemonTag custom DAEMON env name
func (process *Process) SetDaemonTag(name string) *Process {
	process.DaemonTag = name
	return process
}

// On register the signal handling method of the custom child process. The method registered here is actually running on the child process.
// The real program logic runs in a co-program of the child process, and the signal monitoring method of the main co-program running of the child process
func (process *Process) On(signal os.Signal, fn func()) {
	if process.SignalHandlers == nil {
		process.SignalHandlers = make(signalHandlers)
	}
	process.SignalHandlers[signal] = fn
}

// monitor interrupt signal operation
func (process *Process) registerDefaultInterruptHandle() {
	process.On(os.Interrupt, func() {
		err := process.worker.Stop()
		if err != nil {
			_, _ = process.Pipeline[1].WriteString(err.Error())
		}
		process.Pid.Remove()
		os.Exit(0)
	})
}

// register the default stop method and listen for USR1 signals
func (process *Process) registerDefaultStopHandle() {
	process.On(SIGUSR1, func() {
		err := process.worker.Stop()
		if err != nil {
			_, _ = process.Pipeline[1].WriteString(err.Error())
		}
		process.Pid.Remove()
		os.Exit(0)
	})
}

// register the default restart method and listen for USR2 signals
func (process *Process) registerDefaultRestartHandle() {
	process.On(SIGUSR2, func() {
		process.Pid.Remove()
		var done = make(chan bool)
		go func() {
			err := process.worker.Restart()
			if err != nil {
				_, _ = process.Pipeline[1].WriteString(err.Error())
			}
			done <- true
		}()
		_ = os.Unsetenv(process.DaemonTag)
		err := process.Run()
		if err != nil {
			_, _ = process.Pipeline[1].WriteString(err.Error())
		}
		<-done
		os.Exit(0)
	})
}

// IsChild To determine whether it is started in a child process, according to the environment variable DAEMON
func (process *Process) IsChild() bool {
	return os.Getenv(process.DaemonTag) == "true"
}

// Run Run the program, the main logic runs in the cooperative program, and the main cooperative program runs the system signal listener.
func (process *Process) Run() error {
	if process.IsChild() {
		if err := process.Pid.Save(); err != nil {
			return err
		}
		go process.worker.Start()
		process.SignalHandlers.Listen()
		return nil
	}

	cmd := exec.Command(os.Args[0], os.Args[1:]...)
	cmd.Env = append(os.Environ(), fmt.Sprintf("%s=true", process.DaemonTag))
	cmd.Stdin, cmd.Stdout, cmd.Stderr = process.Pipeline[0], process.Pipeline[1], process.Pipeline[2]

	err := cmd.Start()
	if err != nil {
		return err
	}
	return cmd.Process.Release()

}

repository: kenretto/daemon

repo_name: kenretto/daemon


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="9.6.0">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.1" unitdist="mm" unit="mm" style="lines" multiple="1" display="no" altdistance="5" altunitdist="mil" altunit="mm"/>
<layers>
<layer number="1" name="Top" color="4" fill="1" visible="yes" active="yes"/>
<layer number="2" name="Route2" color="16" fill="1" visible="no" active="no"/>
<layer number="3" name="Route3" color="17" fill="1" visible="no" active="no"/>
<layer number="4" name="Route4" color="18" fill="1" visible="no" active="no"/>
<layer number="5" name="Route5" color="19" fill="1" visible="no" active="no"/>
<layer number="6" name="Route6" color="25" fill="1" visible="no" active="no"/>
<layer number="7" name="Route7" color="26" fill="1" visible="no" active="no"/>
<layer number="8" name="Route8" color="27" fill="1" visible="no" active="no"/>
<layer number="9" name="Route9" color="28" fill="1" visible="no" active="no"/>
<layer number="10" name="Route10" color="29" fill="1" visible="no" active="no"/>
<layer number="11" name="Route11" color="30" fill="1" visible="no" active="no"/>
<layer number="12" name="Route12" color="20" fill="1" visible="no" active="no"/>
<layer number="13" name="Route13" color="21" fill="1" visible="no" active="no"/>
<layer number="14" name="Route14" color="22" fill="1" visible="no" active="no"/>
<layer number="15" name="Route15" color="23" fill="1" visible="no" active="no"/>
<layer number="16" name="Bottom" color="1" fill="1" visible="yes" active="yes"/>
<layer number="17" name="Pads" color="2" fill="1" visible="yes" active="yes"/>
<layer number="18" name="Vias" color="2" fill="1" visible="yes" active="yes"/>
<layer number="19" name="Unrouted" color="6" fill="1" visible="yes" active="yes"/>
<layer number="20" name="Dimension" color="24" fill="1" visible="yes" active="yes"/>
<layer number="21" name="tPlace" color="7" fill="1" visible="yes" active="yes"/>
<layer number="22" name="bPlace" color="7" fill="1" visible="yes" active="yes"/>
<layer number="23" name="tOrigins" color="15" fill="1" visible="yes" active="yes"/>
<layer number="24" name="bOrigins" color="15" fill="1" visible="yes" active="yes"/>
<layer number="25" name="tNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="26" name="bNames" color="7" fill="1" visible="yes" active="yes"/>
<layer number="27" name="tValues" color="7" fill="1" visible="yes" active="yes"/>
<layer number="28" name="bValues" color="7" fill="1" visible="yes" active="yes"/>
<layer number="29" name="tStop" color="7" fill="3" visible="no" active="yes"/>
<layer number="30" name="bStop" color="7" fill="6" visible="no" active="yes"/>
<layer number="31" name="tCream" color="7" fill="4" visible="no" active="yes"/>
<layer number="32" name="bCream" color="7" fill="5" visible="no" active="yes"/>
<layer number="33" name="tFinish" color="6" fill="3" visible="no" active="yes"/>
<layer number="34" name="bFinish" color="6" fill="6" visible="no" active="yes"/>
<layer number="35" name="tGlue" color="7" fill="4" visible="no" active="yes"/>
<layer number="36" name="bGlue" color="7" fill="5" visible="no" active="yes"/>
<layer number="37" name="tTest" color="7" fill="1" visible="no" active="yes"/>
<layer number="38" name="bTest" color="7" fill="1" visible="no" active="yes"/>
<layer number="39" name="tKeepout" color="4" fill="11" visible="yes" active="yes"/>
<layer number="40" name="bKeepout" color="1" fill="11" visible="yes" active="yes"/>
<layer number="41" name="tRestrict" color="4" fill="10" visible="yes" active="yes"/>
<layer number="42" name="bRestrict" color="1" fill="10" visible="yes" active="yes"/>
<layer number="43" name="vRestrict" color="2" fill="10" visible="yes" active="yes"/>
<layer number="44" name="Drills" color="7" fill="1" visible="no" active="yes"/>
<layer number="45" name="Holes" color="7" fill="1" visible="no" active="yes"/>
<layer number="46" name="Milling" color="3" fill="1" visible="no" active="yes"/>
<layer number="47" name="Measures" color="7" fill="1" visible="no" active="yes"/>
<layer number="48" name="Document" color="7" fill="1" visible="yes" active="yes"/>
<layer number="49" name="Reference" color="7" fill="1" visible="yes" active="yes"/>
<layer number="51" name="tDocu" color="7" fill="1" visible="yes" active="yes"/>
<layer number="52" name="bDocu" color="7" fill="1" visible="yes" active="yes"/>
<layer number="88" name="SimResults" color="9" fill="1" visible="no" active="no"/>
<layer number="89" name="SimProbes" color="9" fill="1" visible="no" active="no"/>
<layer number="90" name="Modules" color="5" fill="1" visible="no" active="no"/>
<layer number="91" name="Nets" color="2" fill="1" visible="no" active="no"/>
<layer number="92" name="Busses" color="1" fill="1" visible="no" active="no"/>
<layer number="93" name="Pins" color="2" fill="1" visible="no" active="no"/>
<layer number="94" name="Symbols" color="4" fill="1" visible="no" active="no"/>
<layer number="95" name="Names" color="7" fill="1" visible="no" active="no"/>
<layer number="96" name="Values" color="7" fill="1" visible="no" active="no"/>
<layer number="97" name="Info" color="7" fill="1" visible="no" active="no"/>
<layer number="98" name="Guide" color="6" fill="1" visible="no" active="no"/>
</layers>
<board>
<plain>
<wire x1="0" y1="0" x2="21.6" y2="0" width="0" layer="20"/>
<wire x1="21.6" y1="0" x2="21.6" y2="33.5" width="0" layer="20"/>
<wire x1="21.6" y1="33.5" x2="0" y2="33.5" width="0" layer="20"/>
<wire x1="0" y1="33.5" x2="0" y2="0" width="0" layer="20"/>
<text x="16.7" y="4.9" size="1.27" layer="49" rot="R90">BM28B0.6-24DS/2-0.35V(51)
BREAKOUT</text>
<text x="4.6" y="0.5" size="1.778" layer="49">EZ</text>
</plain>
<libraries>
<library name="pinhead" urn="urn:adsk.eagle:library:325">
<description>Pin Header Connectors

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="1X12" urn="urn:adsk.eagle:footprint:22384/1" library_version="4">
<description>PIN HEADER</description>
<wire x1="8.255" y1="1.27" x2="9.525" y2="1.27" width="0.1524" layer="21"/>
<wire x1="9.525" y1="1.27" x2="10.16" y2="0.635" width="0.1524" layer="21"/>
<wire x1="10.16" y1="0.635" x2="10.16" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="10.16" y1="-0.635" x2="9.525" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="10.16" y1="0.635" x2="10.795" y2="1.27" width="0.1524" layer="21"/>
<wire x1="10.795" y1="1.27" x2="12.065" y2="1.27" width="0.1524" layer="21"/>
<wire x1="12.065" y1="1.27" x2="12.7" y2="0.635" width="0.1524" layer="21"/>
<wire x1="12.7" y1="0.635" x2="12.7" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="12.7" y1="-0.635" x2="12.065" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="12.065" y1="-1.27" x2="10.795" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="10.795" y1="-1.27" x2="10.16" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="5.08" y1="0.635" x2="5.715" y2="1.27" width="0.1524" layer="21"/>
<wire x1="5.715" y1="1.27" x2="6.985" y2="1.27" width="0.1524" layer="21"/>
<wire x1="6.985" y1="1.27" x2="7.62" y2="0.635" width="0.1524" layer="21"/>
<wire x1="7.62" y1="0.635" x2="7.62" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="7.62" y1="-0.635" x2="6.985" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="6.985" y1="-1.27" x2="5.715" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="5.715" y1="-1.27" x2="5.08" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="8.255" y1="1.27" x2="7.62" y2="0.635" width="0.1524" layer="21"/>
<wire x1="7.62" y1="-0.635" x2="8.255" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="9.525" y1="-1.27" x2="8.255" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="0.635" y1="1.27" x2="1.905" y2="1.27" width="0.1524" layer="21"/>
<wire x1="1.905" y1="1.27" x2="2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="2.54" y1="0.635" x2="2.54" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="2.54" y1="-0.635" x2="1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="2.54" y1="0.635" x2="3.175" y2="1.27" width="0.1524" layer="21"/>
<wire x1="3.175" y1="1.27" x2="4.445" y2="1.27" width="0.1524" layer="21"/>
<wire x1="4.445" y1="1.27" x2="5.08" y2="0.635" width="0.1524" layer="21"/>
<wire x1="5.08" y1="0.635" x2="5.08" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="5.08" y1="-0.635" x2="4.445" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="4.445" y1="-1.27" x2="3.175" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="3.175" y1="-1.27" x2="2.54" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="0.635" x2="-1.905" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-1.905" y1="1.27" x2="-0.635" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="1.27" x2="0" y2="0.635" width="0.1524" layer="21"/>
<wire x1="0" y1="0.635" x2="0" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="0" y1="-0.635" x2="-0.635" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="-1.27" x2="-1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-1.905" y1="-1.27" x2="-2.54" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="0.635" y1="1.27" x2="0" y2="0.635" width="0.1524" layer="21"/>
<wire x1="0" y1="-0.635" x2="0.635" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="1.905" y1="-1.27" x2="0.635" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-6.985" y1="1.27" x2="-5.715" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-5.715" y1="1.27" x2="-5.08" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="0.635" x2="-5.08" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="-0.635" x2="-5.715" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="0.635" x2="-4.445" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-4.445" y1="1.27" x2="-3.175" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-3.175" y1="1.27" x2="-2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="0.635" x2="-2.54" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="-0.635" x2="-3.175" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-3.175" y1="-1.27" x2="-4.445" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-4.445" y1="-1.27" x2="-5.08" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-10.16" y1="0.635" x2="-9.525" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-9.525" y1="1.27" x2="-8.255" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-8.255" y1="1.27" x2="-7.62" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-7.62" y1="0.635" x2="-7.62" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-7.62" y1="-0.635" x2="-8.255" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-8.255" y1="-1.27" x2="-9.525" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-9.525" y1="-1.27" x2="-10.16" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-6.985" y1="1.27" x2="-7.62" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-7.62" y1="-0.635" x2="-6.985" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-5.715" y1="-1.27" x2="-6.985" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-14.605" y1="1.27" x2="-13.335" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-13.335" y1="1.27" x2="-12.7" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-12.7" y1="0.635" x2="-12.7" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-12.7" y1="-0.635" x2="-13.335" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-12.7" y1="0.635" x2="-12.065" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-12.065" y1="1.27" x2="-10.795" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-10.795" y1="1.27" x2="-10.16" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-10.16" y1="0.635" x2="-10.16" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-10.16" y1="-0.635" x2="-10.795" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-10.795" y1="-1.27" x2="-12.065" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-12.065" y1="-1.27" x2="-12.7" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-15.24" y1="0.635" x2="-15.24" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-14.605" y1="1.27" x2="-15.24" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-15.24" y1="-0.635" x2="-14.605" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-13.335" y1="-1.27" x2="-14.605" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="12.7" y1="0.635" x2="13.335" y2="1.27" width="0.1524" layer="21"/>
<wire x1="13.335" y1="1.27" x2="14.605" y2="1.27" width="0.1524" layer="21"/>
<wire x1="14.605" y1="1.27" x2="15.24" y2="0.635" width="0.1524" layer="21"/>
<wire x1="15.24" y1="0.635" x2="15.24" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="15.24" y1="-0.635" x2="14.605" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="14.605" y1="-1.27" x2="13.335" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="13.335" y1="-1.27" x2="12.7" y2="-0.635" width="0.1524" layer="21"/>
<pad name="1" x="-13.97" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="2" x="-11.43" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="3" x="-8.89" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="4" x="-6.35" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="5" x="-3.81" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="6" x="-1.27" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="7" x="1.27" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="8" x="3.81" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="9" x="6.35" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="10" x="8.89" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="11" x="11.43" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="12" x="13.97" y="0" drill="1.016" shape="long" rot="R90"/>
<text x="-15.3162" y="1.8288" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-15.24" y="-3.175" size="1.27" layer="27">>VALUE</text>
<rectangle x1="11.176" y1="-0.254" x2="11.684" y2="0.254" layer="51"/>
<rectangle x1="8.636" y1="-0.254" x2="9.144" y2="0.254" layer="51"/>
<rectangle x1="6.096" y1="-0.254" x2="6.604" y2="0.254" layer="51"/>
<rectangle x1="3.556" y1="-0.254" x2="4.064" y2="0.254" layer="51"/>
<rectangle x1="1.016" y1="-0.254" x2="1.524" y2="0.254" layer="51"/>
<rectangle x1="-1.524" y1="-0.254" x2="-1.016" y2="0.254" layer="51"/>
<rectangle x1="-4.064" y1="-0.254" x2="-3.556" y2="0.254" layer="51"/>
<rectangle x1="-6.604" y1="-0.254" x2="-6.096" y2="0.254" layer="51"/>
<rectangle x1="-9.144" y1="-0.254" x2="-8.636" y2="0.254" layer="51"/>
<rectangle x1="-11.684" y1="-0.254" x2="-11.176" y2="0.254" layer="51"/>
<rectangle x1="-14.224" y1="-0.254" x2="-13.716" y2="0.254" layer="51"/>
<rectangle x1="13.716" y1="-0.254" x2="14.224" y2="0.254" layer="51"/>
</package>
<package name="1X02" urn="urn:adsk.eagle:footprint:22309/1" library_version="4">
<description>PIN HEADER</description>
<wire x1="-1.905" y1="1.27" x2="-0.635" y2="1.27" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="1.27" x2="0" y2="0.635" width="0.1524" layer="21"/>
<wire x1="0" y1="0.635" x2="0" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="0" y1="-0.635" x2="-0.635" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="0.635" x2="-2.54" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="-1.905" y1="1.27" x2="-2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="-0.635" x2="-1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="-0.635" y1="-1.27" x2="-1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="0" y1="0.635" x2="0.635" y2="1.27" width="0.1524" layer="21"/>
<wire x1="0.635" y1="1.27" x2="1.905" y2="1.27" width="0.1524" layer="21"/>
<wire x1="1.905" y1="1.27" x2="2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="2.54" y1="0.635" x2="2.54" y2="-0.635" width="0.1524" layer="21"/>
<wire x1="2.54" y1="-0.635" x2="1.905" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="1.905" y1="-1.27" x2="0.635" y2="-1.27" width="0.1524" layer="21"/>
<wire x1="0.635" y1="-1.27" x2="0" y2="-0.635" width="0.1524" layer="21"/>
<pad name="1" x="-1.27" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="2" x="1.27" y="0" drill="1.016" shape="long" rot="R90"/>
<text x="-2.6162" y="1.8288" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-2.54" y="-3.175" size="1.27" layer="27">>VALUE</text>
<rectangle x1="-1.524" y1="-0.254" x2="-1.016" y2="0.254" layer="51"/>
<rectangle x1="1.016" y1="-0.254" x2="1.524" y2="0.254" layer="51"/>
</package>
</packages>
<packages3d>
<package3d name="1X12" urn="urn:adsk.eagle:package:22487/2" type="model" library_version="4">
<description>PIN HEADER</description>
<packageinstances>
<packageinstance name="1X12"/>
</packageinstances>
</package3d>
<package3d name="1X02" urn="urn:adsk.eagle:package:22435/2" type="model" library_version="4">
<description>PIN HEADER</description>
<packageinstances>
<packageinstance name="1X02"/>
</packageinstances>
</package3d>
</packages3d>
</library>
<library name="myLib" urn="urn:adsk.eagle:library:18157174">
<packages>
<package name="BM28B0.6-24DS/2-0.35V(51)" urn="urn:adsk.eagle:footprint:18157383/1" library_version="3">
<smd name="1" x="0" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="3" x="0.35" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="5" x="0.7" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="7" x="1.05" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="9" x="1.4" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="11" x="1.75" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="13" x="2.1" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="15" x="2.45" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="17" x="2.8" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="19" x="3.15" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="21" x="3.5" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="23" x="3.85" y="0" dx="0.18" dy="0.41" layer="1"/>
<smd name="24" x="3.85" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="22" x="3.5" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="20" x="3.15" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="18" x="2.8" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="16" x="2.45" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="14" x="2.1" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="12" x="1.75" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="10" x="1.4" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="8" x="1.05" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="6" x="0.7" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="4" x="0.35" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="2" x="0" y="1.59" dx="0.18" dy="0.41" layer="1"/>
<smd name="H3" x="4.555" y="0.05" dx="0.53" dy="0.31" layer="1"/>
<smd name="H4" x="4.555" y="1.54" dx="0.53" dy="0.31" layer="1"/>
<smd name="H2" x="-0.705" y="1.54" dx="0.53" dy="0.31" layer="1"/>
<smd name="H1" x="-0.705" y="0.05" dx="0.53" dy="0.31" layer="1"/>
<rectangle x1="-0.44" y1="0.205" x2="4.29" y2="1.385" layer="39"/>
<text x="-1.05" y="2.45" size="1.27" layer="25">>NAME</text>
</package>
</packages>
<packages3d>
<package3d name="BM28B0.6-24DS/2-0.35V(51)" urn="urn:adsk.eagle:package:18157385/2" type="model" library_version="3">
<packageinstances>
<packageinstance name="BM28B0.6-24DS/2-0.35V(51)"/>
</packageinstances>
</package3d>
</packages3d>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
</classes>
<designrules name="default">
<description language="de">EAGLE Design Rules

Die Standard-Design-Rules sind so gewählt, dass sie für
die meisten Anwendungen passen. Sollte ihre Platine
besondere Anforderungen haben, treffen Sie die erforderlichen
Einstellungen hier und speichern die Design Rules unter
einem neuen Namen ab.</description>
<description language="en">EAGLE Design Rules

The default Design Rules have been set to cover
a wide range of applications. Your particular design
may have different requirements, so please make the
necessary adjustments and save your customized
design rules under a new name.</description>
<param name="layerSetup" value="(1*16)"/>
<param name="mtCopper" value="0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm"/>
<param name="mtIsolate" value="1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm"/>
<param name="mdWireWire" value="6mil"/>
<param name="mdWirePad" value="6mil"/>
<param name="mdWireVia" value="6mil"/>
<param name="mdPadPad" value="6mil"/>
<param name="mdPadVia" value="6mil"/>
<param name="mdViaVia" value="6mil"/>
<param name="mdSmdPad" value="6mil"/>
<param name="mdSmdVia" value="6mil"/>
<param name="mdSmdSmd" value="6mil"/>
<param name="mdViaViaSameLayer" value="6mil"/>
<param name="mnLayersViaInSmd" value="2"/>
<param name="mdCopperDimension" value="40mil"/>
<param name="mdDrill" value="6mil"/>
<param name="mdSmdStop" value="0mil"/>
<param name="msWidth" value="6mil"/>
<param name="msDrill" value="0.35mm"/>
<param name="msMicroVia" value="9.99mm"/>
<param name="msBlindViaRatio" value="0.5"/>
<param name="rvPadTop" value="0.25"/>
<param name="rvPadInner" value="0.25"/>
<param name="rvPadBottom" value="0.25"/>
<param name="rvViaOuter" value="0.25"/>
<param name="rvViaInner" value="0.25"/>
<param name="rvMicroViaOuter" value="0.25"/>
<param name="rvMicroViaInner" value="0.25"/>
<param name="rlMinPadTop" value="10mil"/>
<param name="rlMaxPadTop" value="20mil"/>
<param name="rlMinPadInner" value="10mil"/>
<param name="rlMaxPadInner" value="20mil"/>
<param name="rlMinPadBottom" value="10mil"/>
<param name="rlMaxPadBottom" value="20mil"/>
<param name="rlMinViaOuter" value="8mil"/>
<param name="rlMaxViaOuter" value="20mil"/>
<param name="rlMinViaInner" value="8mil"/>
<param name="rlMaxViaInner" value="20mil"/>
<param name="rlMinMicroViaOuter" value="4mil"/>
<param name="rlMaxMicroViaOuter" value="20mil"/>
<param name="rlMinMicroViaInner" value="4mil"/>
<param name="rlMaxMicroViaInner" value="20mil"/>
<param name="psTop" value="-1"/>
<param name="psBottom" value="-1"/>
<param name="psFirst" value="-1"/>
<param name="psElongationLong" value="100"/>
<param name="psElongationOffset" value="100"/>
<param name="mvStopFrame" value="1"/>
<param name="mvCreamFrame" value="0"/>
<param name="mlMinStopFrame" value="4mil"/>
<param name="mlMaxStopFrame" value="4mil"/>
<param name="mlMinCreamFrame" value="0mil"/>
<param name="mlMaxCreamFrame" value="0mil"/>
<param name="mlViaStopLimit" value="0mil"/>
<param name="srRoundness" value="0"/>
<param name="srMinRoundness" value="0mil"/>
<param name="srMaxRoundness" value="0mil"/>
<param name="slThermalIsolate" value="10mil"/>
<param name="slThermalsForVias" value="0"/>
<param name="dpMaxLengthDifference" value="10mm"/>
<param name="dpGapFactor" value="2.5"/>
<param name="checkAngle" value="0"/>
<param name="checkFont" value="1"/>
<param name="checkRestrict" value="1"/>
<param name="checkStop" value="0"/>
<param name="checkValues" value="0"/>
<param name="checkNames" value="1"/>
<param name="checkWireStubs" value="1"/>
<param name="checkPolygonWidth" value="0"/>
<param name="useDiameter" value="13"/>
<param name="maxErrors" value="50"/>
</designrules>
<autorouter>
<pass name="Default">
<param name="RoutingGrid" value="50mil"/>
<param name="AutoGrid" value="1"/>
<param name="Efforts" value="0"/>
<param name="TopRouterVariant" value="1"/>
<param name="tpViaShape" value="round"/>
<param name="PrefDir.1" value="a"/>
<param name="PrefDir.2" value="0"/>
<param name="PrefDir.3" value="0"/>
<param name="PrefDir.4" value="0"/>
<param name="PrefDir.5" value="0"/>
<param name="PrefDir.6" value="0"/>
<param name="PrefDir.7" value="0"/>
<param name="PrefDir.8" value="0"/>
<param name="PrefDir.9" value="0"/>
<param name="PrefDir.10" value="0"/>
<param name="PrefDir.11" value="0"/>
<param name="PrefDir.12" value="0"/>
<param name="PrefDir.13" value="0"/>
<param name="PrefDir.14" value="0"/>
<param name="PrefDir.15" value="0"/>
<param name="PrefDir.16" value="a"/>
<param name="cfVia" value="8"/>
<param name="cfNonPref" value="5"/>
<param name="cfChangeDir" value="2"/>
<param name="cfOrthStep" value="2"/>
<param name="cfDiagStep" value="3"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="1"/>
<param name="cfMalusStep" value="1"/>
<param name="cfPadImpact" value="4"/>
<param name="cfSmdImpact" value="4"/>
<param name="cfBusImpact" value="0"/>
<param name="cfHugging" value="3"/>
<param name="cfAvoid" value="4"/>
<param name="cfPolygon" value="10"/>
<param name="cfBase.1" value="0"/>
<param name="cfBase.2" value="1"/>
<param name="cfBase.3" value="1"/>
<param name="cfBase.4" value="1"/>
<param name="cfBase.5" value="1"/>
<param name="cfBase.6" value="1"/>
<param name="cfBase.7" value="1"/>
<param name="cfBase.8" value="1"/>
<param name="cfBase.9" value="1"/>
<param name="cfBase.10" value="1"/>
<param name="cfBase.11" value="1"/>
<param name="cfBase.12" value="1"/>
<param name="cfBase.13" value="1"/>
<param name="cfBase.14" value="1"/>
<param name="cfBase.15" value="1"/>
<param name="cfBase.16" value="0"/>
<param name="mnVias" value="20"/>
<param name="mnSegments" value="9999"/>
<param name="mnExtdSteps" value="9999"/>
<param name="mnRipupLevel" value="10"/>
<param name="mnRipupSteps" value="100"/>
<param name="mnRipupTotal" value="100"/>
</pass>
<pass name="Follow-me" refer="Default" active="yes">
</pass>
<pass name="Busses" refer="Default" active="yes">
<param name="cfNonPref" value="4"/>
<param name="cfBusImpact" value="4"/>
<param name="cfHugging" value="0"/>
<param name="mnVias" value="0"/>
</pass>
<pass name="Route" refer="Default" active="yes">
</pass>
<pass name="Optimize1" refer="Default" active="yes">
<param name="cfVia" value="99"/>
<param name="cfExtdStep" value="10"/>
<param name="cfHugging" value="1"/>
<param name="mnExtdSteps" value="1"/>
<param name="mnRipupLevel" value="0"/>
</pass>
<pass name="Optimize2" refer="Optimize1" active="yes">
<param name="cfNonPref" value="0"/>
<param name="cfChangeDir" value="6"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="2"/>
<param name="cfMalusStep" value="2"/>
<param name="cfPadImpact" value="2"/>
<param name="cfSmdImpact" value="2"/>
<param name="cfHugging" value="0"/>
</pass>
<pass name="Optimize3" refer="Optimize2" active="yes">
<param name="cfChangeDir" value="8"/>
<param name="cfPadImpact" value="0"/>
<param name="cfSmdImpact" value="0"/>
</pass>
<pass name="Optimize4" refer="Optimize3" active="yes">
<param name="cfChangeDir" value="25"/>
</pass>
</autorouter>
<elements>
<element name="JP1" library="pinhead" library_urn="urn:adsk.eagle:library:325" package="1X12" package3d_urn="urn:adsk.eagle:package:22487/2" value="" x="19.05" y="16.51" smashed="yes" rot="R270">
<attribute name="NAME" x="20.5562" y="33.3012" size="1.27" layer="25" ratio="10" rot="R180"/>
<attribute name="POPULARITY" value="28" x="16.51" y="-12.7" size="1.778" layer="27" rot="R270" display="off"/>
<attribute name="VALUE" x="15.875" y="31.75" size="1.27" layer="27" rot="R270"/>
</element>
<element name="JP2" library="pinhead" library_urn="urn:adsk.eagle:library:325" package="1X12" package3d_urn="urn:adsk.eagle:package:22487/2" value="" x="2.54" y="16.51" smashed="yes" rot="R90">
<attribute name="NAME" x="1.1238" y="32.0688" size="1.27" layer="25" ratio="10"/>
<attribute name="POPULARITY" value="28" x="11.43" y="45.72" size="1.778" layer="27" rot="R90" display="off"/>
<attribute name="VALUE" x="5.715" y="1.27" size="1.27" layer="27" rot="R90"/>
</element>
<element name="CONN" library="myLib" library_urn="urn:adsk.eagle:library:18157174" package="BM28B0.6-24DS/2-0.35V(51)" package3d_urn="urn:adsk.eagle:package:18157385/2" value="BM28B0.6-24DS/2-0.35V(51)" x="11.87" y="15.24" smashed="yes" rot="R90">
<attribute name="NAME" x="8.62" y="14.49" size="1.27" layer="25" rot="R90"/>
</element>
<element name="JP3" library="pinhead" library_urn="urn:adsk.eagle:library:325" package="1X02" package3d_urn="urn:adsk.eagle:package:22435/2" value="" x="11.02" y="2.54" smashed="yes">
<attribute name="NAME" x="8.4038" y="4.3688" size="1.27" layer="25" ratio="10"/>
<attribute name="POPULARITY" value="98" x="11.02" y="2.54" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="8.48" y="-0.635" size="1.27" layer="27"/>
</element>
<element name="JP4" library="pinhead" library_urn="urn:adsk.eagle:library:325" package="1X02" package3d_urn="urn:adsk.eagle:package:22435/2" value="" x="11.02" y="30.48" smashed="yes">
<attribute name="NAME" x="8.4038" y="27.2288" size="1.27" layer="25" ratio="10"/>
<attribute name="POPULARITY" value="98" x="11.02" y="30.48" size="1.778" layer="27" display="off"/>
<attribute name="VALUE" x="8.48" y="27.305" size="1.27" layer="27"/>
</element>
</elements>
<signals>
<signal name="N$1">
<contactref element="CONN" pad="2"/>
<contactref element="JP2" pad="1"/>
<wire x1="9.34" y1="15.24" x2="10.28" y2="15.24" width="0.1524" layer="1"/>
<wire x1="2.54" y1="2.54" x2="4.34" y2="2.54" width="0.1524" layer="1"/>
<wire x1="5.4144" y1="3.6144" x2="5.4144" y2="11.3144" width="0.1524" layer="1"/>
<wire x1="4.34" y1="2.54" x2="5.4144" y2="3.6144" width="0.1524" layer="1"/>
<wire x1="5.4144" y1="11.3144" x2="9.34" y2="15.24" width="0.1524" layer="1"/>
</signal>
<signal name="N$2">
<contactref element="JP2" pad="2"/>
<contactref element="CONN" pad="4"/>
<wire x1="9.25894375" y1="15.59" x2="10.28" y2="15.59" width="0.1524" layer="1"/>
<wire x1="2.54" y1="5.08" x2="2.56" y2="5.1" width="0.1524" layer="1"/>
<wire x1="2.56" y1="5.1" x2="4.3" y2="5.1" width="0.1524" layer="1"/>
<wire x1="4.3" y1="5.1" x2="5.1096" y2="5.9096" width="0.1524" layer="1"/>
<wire x1="5.1096" y1="5.9096" x2="5.1096" y2="11.44065625" width="0.1524" layer="1"/>
<wire x1="5.1096" y1="11.44065625" x2="9.25894375" y2="15.59" width="0.1524" layer="1"/>
</signal>
<signal name="N$3">
<contactref element="JP2" pad="3"/>
<contactref element="CONN" pad="6"/>
<wire x1="10.28" y1="15.94" x2="9.1778875" y2="15.94" width="0.1524" layer="1"/>
<wire x1="4.8048" y1="11.5669125" x2="9.1778875" y2="15.94" width="0.1524" layer="1"/>
<wire x1="2.54" y1="7.62" x2="4.32" y2="7.62" width="0.1524" layer="1"/>
<wire x1="4.32" y1="7.62" x2="4.8048" y2="8.1048" width="0.1524" layer="1"/>
<wire x1="4.8048" y1="8.1048" x2="4.8048" y2="11.5669125" width="0.1524" layer="1"/>
</signal>
<signal name="N$4">
<contactref element="CONN" pad="8"/>
<contactref element="JP2" pad="4"/>
<wire x1="10.28" y1="16.29" x2="9.09683125" y2="16.29" width="0.1524" layer="1"/>
<wire x1="2.54" y1="10.16" x2="4.36" y2="10.16" width="0.1524" layer="1"/>
<wire x1="4.5" y1="10.3" x2="4.36" y2="10.16" width="0.1524" layer="1"/>
<wire x1="4.5" y1="11.69316875" x2="4.5" y2="10.3" width="0.1524" layer="1"/>
<wire x1="9.09683125" y1="16.29" x2="4.5" y2="11.69316875" width="0.1524" layer="1"/>
</signal>
<signal name="N$5">
<contactref element="JP2" pad="5"/>
<contactref element="CONN" pad="10"/>
<wire x1="9.015775" y1="16.64" x2="10.28" y2="16.64" width="0.1524" layer="1"/>
<wire x1="2.54" y1="12.7" x2="4.4" y2="12.7" width="0.1524" layer="1"/>
<wire x1="6.6352" y1="14.9352" x2="7.310975" y2="14.9352" width="0.1524" layer="1"/>
<wire x1="4.4" y1="12.7" x2="6.6352" y2="14.9352" width="0.1524" layer="1"/>
<wire x1="7.310975" y1="14.9352" x2="9.015775" y2="16.64" width="0.1524" layer="1"/>
</signal>
<signal name="N$6">
<contactref element="CONN" pad="12"/>
<contactref element="JP2" pad="6"/>
<wire x1="10.28" y1="16.99" x2="8.93471875" y2="16.99" width="0.1524" layer="1"/>
<wire x1="7.18471875" y1="15.24" x2="2.54" y2="15.24" width="0.1524" layer="1"/>
<wire x1="8.93471875" y1="16.99" x2="7.18471875" y2="15.24" width="0.1524" layer="1"/>
</signal>
<signal name="N$7">
<contactref element="JP2" pad="7"/>
<contactref element="CONN" pad="14"/>
<wire x1="10.28" y1="17.34" x2="9.00471875" y2="17.34" width="0.1524" layer="1"/>
<wire x1="8.56471875" y1="17.78" x2="2.54" y2="17.78" width="0.1524" layer="1"/>
<wire x1="9.00471875" y1="17.34" x2="8.56471875" y2="17.78" width="0.1524" layer="1"/>
</signal>
<signal name="N$8">
<contactref element="CONN" pad="16"/>
<contactref element="JP2" pad="8"/>
<wire x1="9.085775" y1="17.69" x2="10.28" y2="17.69" width="0.1524" layer="1"/>
<wire x1="2.54" y1="20.32" x2="6.455775" y2="20.32" width="0.1524" layer="1"/>
<wire x1="6.455775" y1="20.32" x2="9.085775" y2="17.69" width="0.1524" layer="1"/>
</signal>
<signal name="N$9">
<contactref element="JP2" pad="9"/>
<contactref element="CONN" pad="18"/>
<wire x1="9.16683125" y1="18.04" x2="10.28" y2="18.04" width="0.1524" layer="1"/>
<wire x1="2.54" y1="22.86" x2="4.34683125" y2="22.86" width="0.1524" layer="1"/>
<wire x1="4.34683125" y1="22.86" x2="9.16683125" y2="18.04" width="0.1524" layer="1"/>
</signal>
<signal name="N$10">
<contactref element="CONN" pad="20"/>
<contactref element="JP2" pad="10"/>
<wire x1="10.28" y1="18.39" x2="9.2478875" y2="18.39" width="0.1524" layer="1"/>
<wire x1="4.8" y1="22.8378875" x2="4.8" y2="25" width="0.1524" layer="1"/>
<wire x1="4.8" y1="25" x2="4.4" y2="25.4" width="0.1524" layer="1"/>
<wire x1="9.2478875" y1="18.39" x2="4.8" y2="22.8378875" width="0.1524" layer="1"/>
<wire x1="4.4" y1="25.4" x2="2.54" y2="25.4" width="0.1524" layer="1"/>
</signal>
<signal name="N$11">
<contactref element="JP2" pad="11"/>
<contactref element="CONN" pad="22"/>
<wire x1="10.28" y1="18.74" x2="9.32894375" y2="18.74" width="0.1524" layer="1"/>
<wire x1="9.32894375" y1="18.74" x2="7.834471875" y2="20.234471875" width="0.1524" layer="1"/>
<wire x1="7.834471875" y1="20.234471875" x2="7.784471875" y2="20.284471875" width="0.1524" layer="1"/>
<wire x1="2.54" y1="27.94" x2="2.58" y2="27.9" width="0.1524" layer="1"/>
<wire x1="2.58" y1="27.9" x2="4.3" y2="27.9" width="0.1524" layer="1"/>
<wire x1="4.3" y1="27.9" x2="5.1048" y2="27.0952" width="0.1524" layer="1"/>
<wire x1="5.1048" y1="22.96414375" x2="7.784471875" y2="20.284471875" width="0.1524" layer="1"/>
<wire x1="5.1048" y1="27.0952" x2="5.1048" y2="22.96414375" width="0.1524" layer="1"/>
</signal>
<signal name="N$12">
<contactref element="CONN" pad="24"/>
<contactref element="JP2" pad="12"/>
<wire x1="10.28" y1="19.09" x2="9.41" y2="19.09" width="0.1524" layer="1"/>
<wire x1="5.4096" y1="23.0904" x2="5.4096" y2="26.5" width="0.1524" layer="1"/>
<wire x1="5.4096" y1="26.5" x2="5.4096" y2="26.6" width="0.1524" layer="1"/>
<wire x1="9.41" y1="19.09" x2="5.4096" y2="23.0904" width="0.1524" layer="1"/>
<wire x1="2.54" y1="30.48" x2="4.32" y2="30.48" width="0.1524" layer="1"/>
<wire x1="5.4096" y1="29.3904" x2="5.4096" y2="26.6" width="0.1524" layer="1"/>
<wire x1="4.32" y1="30.48" x2="5.4096" y2="29.3904" width="0.1524" layer="1"/>
</signal>
<signal name="N$17">
<contactref element="CONN" pad="23"/>
<contactref element="JP1" pad="1"/>
<wire x1="11.87" y1="19.09" x2="13.19" y2="19.09" width="0.1524" layer="1"/>
<wire x1="19.05" y1="30.48" x2="17.38" y2="30.48" width="0.1524" layer="1"/>
<wire x1="15.8856" y1="28.9856" x2="17.38" y2="30.48" width="0.1524" layer="1"/>
<wire x1="13.19" y1="19.09" x2="15.8856" y2="21.7856" width="0.1524" layer="1"/>
<wire x1="15.8856" y1="21.7856" x2="15.8856" y2="28.9856" width="0.1524" layer="1"/>
</signal>
<signal name="N$18">
<contactref element="JP1" pad="2"/>
<contactref element="CONN" pad="21"/>
<wire x1="11.87" y1="18.74" x2="13.27105625" y2="18.74" width="0.1524" layer="1"/>
<wire x1="16.1904" y1="21.65934375" x2="16.1904" y2="24" width="0.1524" layer="1"/>
<wire x1="16.1904" y1="24" x2="16.1904" y2="24.1" width="0.1524" layer="1"/>
<wire x1="13.27105625" y1="18.74" x2="16.1904" y2="21.65934375" width="0.1524" layer="1"/>
<wire x1="19.05" y1="27.94" x2="17.14" y2="27.94" width="0.1524" layer="1"/>
<wire x1="16.1904" y1="26.9904" x2="16.1904" y2="24.1" width="0.1524" layer="1"/>
<wire x1="17.14" y1="27.94" x2="16.1904" y2="26.9904" width="0.1524" layer="1"/>
</signal>
<signal name="N$19">
<contactref element="CONN" pad="19"/>
<contactref element="JP1" pad="3"/>
<wire x1="11.87" y1="18.39" x2="13.3521125" y2="18.39" width="0.1524" layer="1"/>
<wire x1="16.4952" y1="21.5330875" x2="13.3521125" y2="18.39" width="0.1524" layer="1"/>
<wire x1="19.05" y1="25.4" x2="17.2" y2="25.4" width="0.1524" layer="1"/>
<wire x1="17.2" y1="25.4" x2="16.4952" y2="24.6952" width="0.1524" layer="1"/>
<wire x1="16.4952" y1="24.6952" x2="16.4952" y2="21.5330875" width="0.1524" layer="1"/>
</signal>
<signal name="N$20">
<contactref element="JP1" pad="4"/>
<contactref element="CONN" pad="17"/>
<wire x1="11.87" y1="18.04" x2="13.43316875" y2="18.04" width="0.1524" layer="1"/>
<wire x1="19.05" y1="22.86" x2="17.26" y2="22.86" width="0.1524" layer="1"/>
<wire x1="16.8" y1="22.4" x2="17.26" y2="22.86" width="0.1524" layer="1"/>
<wire x1="16.8" y1="21.40683125" x2="16.8" y2="22.4" width="0.1524" layer="1"/>
<wire x1="13.43316875" y1="18.04" x2="16.8" y2="21.40683125" width="0.1524" layer="1"/>
</signal>
<signal name="N$21">
<contactref element="CONN" pad="15"/>
<contactref element="JP1" pad="5"/>
<wire x1="11.87" y1="17.69" x2="13.514225" y2="17.69" width="0.1524" layer="1"/>
<wire x1="16.144225" y1="20.32" x2="19.05" y2="20.32" width="0.1524" layer="1"/>
<wire x1="13.514225" y1="17.69" x2="16.144225" y2="20.32" width="0.1524" layer="1"/>
</signal>
<signal name="N$22">
<contactref element="JP1" pad="6"/>
<contactref element="CONN" pad="13"/>
<wire x1="11.87" y1="17.34" x2="13.59528125" y2="17.34" width="0.1524" layer="1"/>
<wire x1="13.59528125" y1="17.34" x2="14.077640625" y2="17.822359375" width="0.1524" layer="1"/>
<wire x1="14.077640625" y1="17.822359375" x2="19.007640625" y2="17.822359375" width="0.1524" layer="1"/>
<wire x1="19.007640625" y1="17.822359375" x2="19.05" y2="17.78" width="0.1524" layer="1"/>
</signal>
<signal name="N$23">
<contactref element="CONN" pad="11"/>
<contactref element="JP1" pad="7"/>
<wire x1="11.87" y1="16.99" x2="13.36528125" y2="16.99" width="0.1524" layer="1"/>
<wire x1="15.11528125" y1="15.24" x2="19.05" y2="15.24" width="0.1524" layer="1"/>
<wire x1="13.36528125" y1="16.99" x2="15.11528125" y2="15.24" width="0.1524" layer="1"/>
</signal>
<signal name="N$24">
<contactref element="JP1" pad="8"/>
<contactref element="CONN" pad="9"/>
<wire x1="13.284225" y1="16.64" x2="11.87" y2="16.64" width="0.1524" layer="1"/>
<wire x1="19.05" y1="12.7" x2="17.224225" y2="12.7" width="0.1524" layer="1"/>
<wire x1="17.224225" y1="12.7" x2="13.284225" y2="16.64" width="0.1524" layer="1"/>
</signal>
<signal name="N$25">
<contactref element="CONN" pad="7"/>
<contactref element="JP1" pad="9"/>
<wire x1="11.87" y1="16.29" x2="13.20316875" y2="16.29" width="0.1524" layer="1"/>
<wire x1="19.05" y1="10.16" x2="17.34" y2="10.16" width="0.1524" layer="1"/>
<wire x1="16.9" y1="10.6" x2="17.34" y2="10.16" width="0.1524" layer="1"/>
<wire x1="16.9" y1="12.59316875" x2="16.9" y2="10.6" width="0.1524" layer="1"/>
<wire x1="13.20316875" y1="16.29" x2="16.9" y2="12.59316875" width="0.1524" layer="1"/>
</signal>
<signal name="N$26">
<contactref element="JP1" pad="10"/>
<contactref element="CONN" pad="5"/>
<wire x1="11.87" y1="15.94" x2="13.1221125" y2="15.94" width="0.1524" layer="1"/>
<wire x1="16.5952" y1="12.4669125" x2="13.1221125" y2="15.94" width="0.1524" layer="1"/>
<wire x1="19.05" y1="7.62" x2="17.38" y2="7.62" width="0.1524" layer="1"/>
<wire x1="17.38" y1="7.62" x2="16.5952" y2="8.4048" width="0.1524" layer="1"/>
<wire x1="16.5952" y1="8.4048" x2="16.5952" y2="12.4669125" width="0.1524" layer="1"/>
</signal>
<signal name="N$27">
<contactref element="CONN" pad="3"/>
<contactref element="JP1" pad="11"/>
<wire x1="11.87" y1="15.59" x2="13.04105625" y2="15.59" width="0.1524" layer="1"/>
<wire x1="17.22" y1="5.08" x2="19.05" y2="5.08" width="0.1524" layer="1"/>
<wire x1="16.2904" y1="12.34065625" x2="16.2904" y2="6.0096" width="0.1524" layer="1"/>
<wire x1="13.04105625" y1="15.59" x2="16.2904" y2="12.34065625" width="0.1524" layer="1"/>
<wire x1="16.2904" y1="6.0096" x2="17.22" y2="5.08" width="0.1524" layer="1"/>
</signal>
<signal name="N$28">
<contactref element="JP1" pad="12"/>
<contactref element="CONN" pad="1"/>
<wire x1="11.87" y1="15.24" x2="12.96" y2="15.24" width="0.1524" layer="1"/>
<wire x1="15.9856" y1="12.2144" x2="12.96" y2="15.24" width="0.1524" layer="1"/>
<wire x1="19.05" y1="2.54" x2="17.26" y2="2.54" width="0.1524" layer="1"/>
<wire x1="17.26" y1="2.54" x2="15.9856" y2="3.8144" width="0.1524" layer="1"/>
<wire x1="15.9856" y1="3.8144" x2="15.9856" y2="12.2144" width="0.1524" layer="1"/>
</signal>
<signal name="N$13">
<contactref element="CONN" pad="H3"/>
<contactref element="JP4" pad="2"/>
<wire x1="11.82" y1="19.795" x2="11.82" y2="26.12" width="0.2" layer="1"/>
<wire x1="12.29" y1="26.59" x2="12.29" y2="30.48" width="0.2" layer="1"/>
<wire x1="11.82" y1="26.12" x2="12.29" y2="26.59" width="0.2" layer="1"/>
</signal>
<signal name="N$14">
<contactref element="JP4" pad="1"/>
<contactref element="CONN" pad="H4"/>
<wire x1="10.33" y1="19.795" x2="10.33" y2="26.07" width="0.2" layer="1"/>
<wire x1="9.75" y1="26.65" x2="9.75" y2="30.48" width="0.2" layer="1"/>
<wire x1="10.33" y1="26.07" x2="9.75" y2="26.65" width="0.2" layer="1"/>
</signal>
<signal name="N$15">
<contactref element="CONN" pad="H2"/>
<contactref element="JP3" pad="1"/>
<wire x1="10.33" y1="14.535" x2="10.33" y2="9.23" width="0.2" layer="1"/>
<wire x1="9.75" y1="8.65" x2="9.75" y2="2.54" width="0.2" layer="1"/>
<wire x1="10.33" y1="9.23" x2="9.75" y2="8.65" width="0.2" layer="1"/>
</signal>
<signal name="N$16">
<contactref element="JP3" pad="2"/>
<contactref element="CONN" pad="H1"/>
<wire x1="11.82" y1="14.535" x2="11.82" y2="9.28" width="0.2" layer="1"/>
<wire x1="12.29" y1="8.81" x2="12.29" y2="2.54" width="0.2" layer="1"/>
<wire x1="11.82" y1="9.28" x2="12.29" y2="8.81" width="0.2" layer="1"/>
</signal>
</signals>
<mfgpreviewcolors>
<mfgpreviewcolor name="soldermaskcolor" color="0xC8008000"/>
<mfgpreviewcolor name="silkscreencolor" color="0xFFFEFEFE"/>
<mfgpreviewcolor name="backgroundcolor" color="0xFF282828"/>
<mfgpreviewcolor name="coppercolor" color="0xFFFFBF00"/>
<mfgpreviewcolor name="substratecolor" color="0xFF786E46"/>
</mfgpreviewcolors>
</board>
</drawing>
<compatibility>
<note version="6.3" minversion="6.2.2" severity="warning">
Since Version 6.2.2 text objects can contain more than one line,
which will not be processed correctly with this version.
</note>
<note version="8.2" severity="warning">
Since Version 8.2, EAGLE supports online libraries. The ids
of those online libraries will not be understood (or retained)
with this version.
</note>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports URNs for individual library
assets (packages, symbols, and devices). The URNs of those assets
will not be understood (or retained) with this version.
</note>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports the association of 3D packages
with devices in libraries, schematics, and board files. Those 3D
packages will not be understood (or retained) with this version.
</note>
</compatibility>
</eagle>

extension: brd


text:
SUMMARY = "DLNA renderer libraries"
DESCRIPTION = "dleyna-renderer is a library for implementing services \
that allow clients to discover and manipulate Digital Media Renderers. \
An implementation of such a service for linux is also included."
HOMEPAGE = "https://01.org/dleyna/"

LICENSE = "LGPL-2.1-or-later"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
                    file://libdleyna/renderer/server.c;endline=21;md5=f51acd4757fb6a779a87122c43cf1346"

DEPENDS = "glib-2.0 gssdp gupnp gupnp-av gupnp-dlna libsoup-2.4 dleyna-core"
RDEPENDS:${PN} = "dleyna-connector-dbus"

SRC_URI = "git://github.com/01org/${BPN}.git;branch=master;protocol=https \
           file://0001-add-gupnp-1.2-API-support.patch \
          "
SRCREV = "50fd1ec9d51328e7dea98874129dc8d6fe3ea1dd"
S = "${WORKDIR}/git"

inherit autotools pkgconfig

CFLAGS += " -I${S}"

FILES:${PN} += "${datadir}/dbus-1"
FILES:${PN}-dev += "${libdir}/${BPN}/*.so"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded

gha_language: BitBake


text:
package goflow

import (
	"fmt"
	"reflect"
	"strconv"
	"strings"
)

// address is a full port accessor including the index part.
type address struct {
	proc  string // Process name
	port  string // Component port name
	key   string // Port key (only for map ports)
	index int    // Port index (only for array ports)
}

func (a address) String() string {
	if a.key != "" {
		return fmt.Sprintf("%s.%s[%s]", a.proc, a.port, a.key)
	}

	return fmt.Sprintf("%s.%s", a.proc, a.port)
}

// connection stores information about a connection within the net.
type connection struct {
	src     address
	tgt     address
	channel reflect.Value
	buffer  int
}

// Connect a sender to a receiver and create a channel between them using BufferSize graph configuration.
// Normally such a connection is unbuffered but you can change by setting flow.DefaultBufferSize > 0 or
// by using ConnectBuf() function instead.
// It returns true on success or panics and returns false if error occurs.
func (n *Graph) Connect(senderName, senderPort, receiverName, receiverPort string) error {
	return n.ConnectBuf(senderName, senderPort, receiverName, receiverPort, n.conf.BufferSize)
}

// ConnectBuf connects a sender to a receiver using a channel with a buffer of a given size.
// It returns true on success or panics and returns false if error occurs.
func (n *Graph) ConnectBuf(senderName, senderPort, receiverName, receiverPort string, bufferSize int) error {
	sendAddr := parseAddress(senderName, senderPort)

	sendPort, err := n.getProcPort(senderName, sendAddr.port, reflect.SendDir)
	if err != nil {
		return fmt.Errorf("connect: %w", err)
	}

	recvAddr := parseAddress(receiverName, receiverPort)

	recvPort, err := n.getProcPort(receiverName, recvAddr.port, reflect.RecvDir)
	if err != nil {
		return fmt.Errorf("connect: %w", err)
	}

	isNewChan := false // tells if a new channel will need to be created for this connection
	// Try to find an existing outbound channel from the same sender,
	// so it can be used as fan-out FIFO
	ch := n.findExistingChan(sendAddr, reflect.SendDir)
	if !ch.IsValid() || ch.IsNil() {
		// Then try to find an existing inbound channel to the same receiver,
		// so it can be used as a fan-in FIFO
		ch = n.findExistingChan(recvAddr, reflect.RecvDir)
		if ch.IsValid() && !ch.IsNil() {
			// Increase the number of listeners on this already used channel
			n.incChanListenersCount(ch)
		} else {
			isNewChan = true
		}
	}

	if ch, err = attachPort(sendPort, sendAddr, reflect.SendDir, ch, bufferSize); err != nil {
		return fmt.Errorf("connect '%s.%s': %w", senderName, senderPort, err)
	}

	if _, err = attachPort(recvPort, recvAddr, reflect.RecvDir, ch, bufferSize); err != nil {
		return fmt.Errorf("connect '%s.%s': %w", receiverName, receiverPort, err)
	}

	if isNewChan {
		// Register the first listener on a newly created channel
		n.incChanListenersCount(ch)
	}

	// Add connection info
	n.connections = append(n.connections, connection{
		src:     sendAddr,
		tgt:     recvAddr,
		channel: ch,
		buffer:  bufferSize,
	})

	return nil
}

// getProcPort finds an assignable port field in one of the subprocesses.
func (n *Graph) getProcPort(procName, portName string, dir reflect.ChanDir) (reflect.Value, error) {
	nilValue := reflect.ValueOf(nil)
	// Check if process exists
	proc, ok := n.procs[procName]
	if !ok {
		return nilValue, fmt.Errorf("getProcPort: process '%s' not found", procName)
	}

	// Check if process is settable
	val := reflect.ValueOf(proc)
	if val.Kind() == reflect.Ptr && val.IsValid() {
		val = val.Elem()
	}

	if !val.CanSet() {
		return nilValue, fmt.Errorf("getProcPort: process '%s' is not settable", procName)
	}

	// Get the port value
	var (
		portVal reflect.Value
		err     error
	)

	// Check if sender is a net
	net, ok := val.Interface().(Graph)
	if ok {
		// Sender is a net
		var ports map[string]port
		if dir == reflect.SendDir {
			ports = net.outPorts
		} else {
			ports = net.inPorts
		}

		p, ok := ports[portName]
		if !ok {
			return nilValue, fmt.Errorf("getProcPort: subgraph '%s' does not have inport '%s'", procName, portName)
		}

		portVal, err = net.getProcPort(p.addr.proc, p.addr.port, dir)
	} else {
		// Sender is a proc
		portVal = val.FieldByName(portName)
	}

	if err == nil && (!portVal.IsValid()) {
		err = fmt.Errorf("process '%s' does not have a valid port '%s'", procName, portName)
	}

	if err != nil {
		return nilValue, fmt.Errorf("getProcPort: %w", err)
	}

	return portVal, nil
}

func attachPort(port reflect.Value, addr address, dir reflect.ChanDir, ch reflect.Value, bufSize int) (reflect.Value, error) {
	if addr.index > -1 {
		return attachArrayPort(port, addr.index, dir, ch, bufSize)
	}

	if addr.key != "" {
		return attachMapPort(port, addr.key, dir, ch, bufSize)
	}

	return attachChanPort(port, dir, ch, bufSize)
}

func attachChanPort(port reflect.Value, dir reflect.ChanDir, ch reflect.Value, bufSize int) (reflect.Value, error) {
	if err := validateChanDir(port.Type(), dir); err != nil {
		return ch, err
	}

	if err := validateCanSet(port); err != nil {
		return ch, err
	}

	ch = selectOrMakeChan(ch, port, port.Type().Elem(), bufSize)
	port.Set(ch)

	return ch, nil
}

func attachMapPort(port reflect.Value, key string, dir reflect.ChanDir, ch reflect.Value, bufSize int) (reflect.Value, error) {
	if err := validateChanDir(port.Type().Elem(), dir); err != nil {
		return ch, err
	}

	kv := reflect.ValueOf(key)
	item := port.MapIndex(kv)
	ch = selectOrMakeChan(ch, item, port.Type().Elem().Elem(), bufSize)

	if port.IsNil() {
		m := reflect.MakeMap(port.Type())
		port.Set(m)
	}

	port.SetMapIndex(kv, ch)

	return ch, nil
}

func attachArrayPort(port reflect.Value, key int, dir reflect.ChanDir, ch reflect.Value, bufSize int) (reflect.Value, error) {
	if err := validateChanDir(port.Type().Elem(), dir); err != nil {
		return ch, err
	}

	if port.IsNil() {
		m := reflect.MakeSlice(port.Type(), 0, 32)
		port.Set(m)
	}

	if port.Cap() <= key {
		port.SetCap(2 * key)
	}

	if port.Len() <= key {
		port.SetLen(key + 1)
	}

	item := port.Index(key)
	ch = selectOrMakeChan(ch, item, port.Type().Elem().Elem(), bufSize)
	item.Set(ch)

	return ch, nil
}

func validateChanDir(portType reflect.Type, dir reflect.ChanDir) error {
	if portType.Kind() != reflect.Chan {
		return fmt.Errorf("not a channel")
	}

	if portType.ChanDir()&dir == 0 {
		return fmt.Errorf("channel does not support direction %s", dir.String())
	}

	return nil
}

func validateCanSet(portVal reflect.Value) error {
	if !portVal.CanSet() {
		return fmt.Errorf("port is not assignable")
	}

	return nil
}

func selectOrMakeChan(new, existing reflect.Value, t reflect.Type, bufSize int) reflect.Value {
	if !new.IsValid() || new.IsNil() {
		if existing.IsValid() && !existing.IsNil() {
			return existing
		}

		chanType := reflect.ChanOf(reflect.BothDir, t)
		new = reflect.MakeChan(chanType, bufSize)
	}

	return new
}

// parseAddress unfolds a string port name into parts, including array index or hashmap key.
func parseAddress(proc, port string) address {
	n := address{
		proc:  proc,
		port:  port,
		index: -1,
	}
	keyPos := 0
	key := ""

	for i, r := range port {
		if r == '[' {
			keyPos = i + 1
			n.port = port[0:i]
		}

		if r == ']' {
			key = port[keyPos:i]
		}
	}

	n.port = capitalizePortName(n.port)

	if key == "" {
		return n
	}

	if i, err := strconv.Atoi(key); err == nil {
		n.index = i
	} else {
		n.key = key
	}

	n.key = key

	return n
}

// capitalizePortName converts port names defined in UPPER or lower case to Title case,
// which is more common for structs in Go.
func capitalizePortName(name string) string {
	lower := strings.ToLower(name)
	upper := strings.ToUpper(name)

	if name == lower || name == upper {
		return strings.Title(lower)
	}

	return name
}

// findExistingChan returns a channel attached to receiver if it already exists among connections.
func (n *Graph) findExistingChan(addr address, dir reflect.ChanDir) reflect.Value {
	var channel reflect.Value
	// Find existing channel attached to the receiver
	for i := range n.connections {
		var a address
		if dir == reflect.SendDir {
			a = n.connections[i].src
		} else {
			a = n.connections[i].tgt
		}

		if a == addr {
			channel = n.connections[i].channel
			break
		}
	}

	return channel
}

// incChanListenersCount increments SendChanRefCount.
// The count is needed when multiple senders are connected
// to the same receiver. When the network is terminated and
// senders need to close their output port, this counter
// can help to avoid closing the same channel multiple times.
func (n *Graph) incChanListenersCount(c reflect.Value) {
	n.chanListenersCountLock.Lock()
	defer n.chanListenersCountLock.Unlock()

	ptr := c.Pointer()
	cnt := n.chanListenersCount[ptr]
	cnt++
	n.chanListenersCount[ptr] = cnt
}

// decChanListenersCount decrements SendChanRefCount
// It returns true if the RefCount has reached 0.
func (n *Graph) decChanListenersCount(c reflect.Value) bool {
	n.chanListenersCountLock.Lock()
	defer n.chanListenersCountLock.Unlock()

	ptr := c.Pointer()
	cnt := n.chanListenersCount[ptr]

	if cnt == 0 {
		return true // yes you may try to close a nonexistent channel, see what happens...
	}

	cnt--
	n.chanListenersCount[ptr] = cnt

	return cnt == 0
}

// // Disconnect removes a connection between sender's outport and receiver's inport.
// func (n *Graph) Disconnect(senderName, senderPort, receiverName, receiverPort string) bool {
// 	var sender, receiver interface{}
// 	var ok bool
// 	sender, ok = n.procs[senderName]
// 	if !ok {
// 		return false
// 	}
// 	receiver, ok = n.procs[receiverName]
// 	if !ok {
// 		return false
// 	}
// 	res := unsetProcPort(sender, senderPort, true)
// 	res = res && unsetProcPort(receiver, receiverPort, false)
// 	return res
// }

// // Unsets an port of a given process
// func unsetProcPort(proc interface{}, portName string, isOut bool) bool {
// 	v := reflect.ValueOf(proc)
// 	var ch reflect.Value
// 	if v.Elem().FieldByName("Graph").IsValid() {
// 		if subnet, ok := v.Elem().FieldByName("Graph").Addr().Interface().(*Graph); ok {
// 			if isOut {
// 				ch = subnet.getOutPort(portName)
// 			} else {
// 				ch = subnet.getInPort(portName)
// 			}
// 		} else {
// 			return false
// 		}
// 	} else {
// 		ch = v.Elem().FieldByName(portName)
// 	}
// 	if !ch.IsValid() {
// 		return false
// 	}
// 	ch.Set(reflect.Zero(ch.Type()))
// 	return true
// }

repository: unbxd/goflow

repo_name: unbxd/goflow

branch_name: refs/heads/unx-master


text:
SUMMARY = "WIB applications"
LICENSE="CLOSED"
SECTION = "PETALINUX/apps"

DEPENDS = "glibc zeromq cppzmq protobuf protobuf-native protobuf-c"

SRC_URI = "file://* \
          "
TARGET_CC_ARCH += "${LDFLAGS}"

do_fetch[nostamp] = "1"
do_compile[nostamp] = "1"
do_install[nostamp] = "1"

S = "${WORKDIR}"
do_compile() {
        make clean
        oe_runmake
}
do_install() {
        install -d ${D}/bin/
        install -m 0755 ${S}/wib_server ${D}/bin/
        install -d ${D}/etc/rc5.d/
        install -m 0755 ${S}/extras/wib_init.sh ${D}/etc/rc5.d/S99wib_init.sh
}

repository: DUNE-DAQ/dune-wib-firmware

repo_name: DUNE-DAQ/dune-wib-firmware

gha_language: Verilog