text:
11.684" y2="-3.429" width="0.0508" layer="21"/>
<wire x1="11.684" y1="-3.429" x2="11.684" y2="3.429" width="0.0508" layer="21"/>
<wire x1="11.684" y1="3.429" x2="-11.684" y2="3.429" width="0.0508" layer="21"/>
<wire x1="-11.684" y1="3.429" x2="-11.684" y2="-3.429" width="0.0508" layer="21"/>
<wire x1="-11.684" y1="-3.429" x2="-2.032" y2="-3.429" width="0.0508" layer="21"/>
<wire x1="-2.032" y1="-3.429" x2="-2.032" y2="-4.445" width="0.127" layer="21"/>
<wire x1="5.588" y1="-3.429" x2="5.588" y2="-3.937" width="0.127" layer="21"/>
<wire x1="5.588" y1="-3.937" x2="5.08" y2="-3.937" width="0.127" layer="21"/>
<wire x1="7.112" y1="-3.429" x2="7.112" y2="-3.937" width="0.127" layer="21"/>
<wire x1="7.112" y1="-3.937" x2="5.588" y2="-3.937" width="0.127" layer="21"/>
<wire x1="-2.032" y1="-4.445" x2="-6.858" y2="-4.445" width="0.127" layer="21"/>
<wire x1="-6.858" y1="-4.318" x2="-6.858" y2="-4.445" width="0.127" layer="21"/>
<wire x1="-6.858" y1="-4.318" x2="-8.382" y2="-4.318" width="0.127" layer="21"/>
<wire x1="-8.382" y1="-4.445" x2="-8.382" y2="-4.318" width="0.127" layer="21"/>
<wire x1="-8.382" y1="-4.445" x2="-12.7" y2="-4.445" width="0.127" layer="21"/>
<pad name="1" x="-7.62" y="-1.27" drill="0.9144" shape="octagon"/>
<pad name="2" x="-7.62" y="1.27" drill="0.9144" shape="octagon"/>
<pad name="3" x="-5.08" y="-1.27" drill="0.9144" shape="octagon"/>
<pad name="4" x="-5.08" y="1.27" drill="0.9144" shape="octagon"/>
<pad name="5" x="-2.54" y="-1.27" drill="0.9144" shape="octagon"/>
<pad name="6" x="-2.54" y="1.27" drill="0.9144" shape="octagon"/>
<pad name="7" x="0" y="-1.27" drill="0.9144" shape="octagon"/>
<pad name="8" x="0" y="1.27" drill="0.9144" shape="octagon"/>
<pad name="9" x="2.54" y="-1.27" drill="0.9144" shape="octagon"/>
<pad name="10" x="2.54" y="1.27" drill="0.9144" shape="octagon"/>
<pad name="11" x="5.08" y="-1.27" drill="0.9144" shape="octagon"/>
<pad name="12" x="5.08" y="1.27" drill="0.9144" shape="octagon"/>
<pad name="13" x="7.62" y="-1.27" drill="0.9144" shape="octagon"/>
<pad name="14" x="7.62" y="1.27" drill="0.9144" shape="octagon"/>
<text x="-12.7" y="5.08" size="1.778" layer="25" ratio="10">>NAME</text>
<text x="0" y="5.08" size="1.778" layer="27" ratio="10">>VALUE</text>
<text x="-1.016" y="-4.064" size="1.27" layer="21" ratio="10">14</text>
<text x="-10.16" y="-1.905" size="1.27" layer="21" ratio="10">1</text>
<text x="-10.16" y="0.635" size="1.27" layer="21" ratio="10">2</text>
<rectangle x1="7.366" y1="1.016" x2="7.874" y2="1.524" layer="51"/>
<rectangle x1="4.826" y1="1.016" x2="5.334" y2="1.524" layer="51"/>
<rectangle x1="4.826" y1="-1.524" x2="5.334" y2="-1.016" layer="51"/>
<rectangle x1="7.366" y1="-1.524" x2="7.874" y2="-1.016" layer="51"/>
<rectangle x1="-5.334" y1="1.016" x2="-4.826" y2="1.524" layer="51"/>
<rectangle x1="-7.874" y1="1.016" x2="-7.366" y2="1.524" layer="51"/>
<rectangle x1="-2.794" y1="1.016" x2="-2.286" y2="1.524" layer="51"/>
<rectangle x1="2.286" y1="1.016" x2="2.794" y2="1.524" layer="51"/>
<rectangle x1="-0.254" y1="1.016" x2="0.254" y2="1.524" layer="51"/>
<rectangle x1="-5.334" y1="-1.524" x2="-4.826" y2="-1.016" layer="51"/>
<rectangle x1="-7.874" y1="-1.524" x2="-7.366" y2="-1.016" layer="51"/>
<rectangle x1="-2.794" y1="-1.524" x2="-2.286" y2="-1.016" layer="51"/>
<rectangle x1="2.286" y1="-1.524" x2="2.794" y2="-1.016" layer="51"/>
<rectangle x1="-0.254" y1="-1.524" x2="0.254" y2="-1.016" layer="51"/>
</package>
</packages>
<symbols>
<symbol name="14P">
<wire x1="3.81" y1="-10.16" x2="-3.81" y2="-10.16" width="0.4064" layer="94"/>
<wire x1="-3.81" y1="10.16" x2="-3.81" y2="-10.16" width="0.4064" layer="94"/>
<wire x1="-3.81" y1="10.16" x2="3.81" y2="10.16" width="0.4064" layer="94"/>
<wire x1="3.81" y1="-10.16" x2="3.81" y2="10.16" width="0.4064" layer="94"/>
<wire x1="2.54" y1="5.08" x2="3.175" y2="5.08" width="0.1524" layer="94"/>
<wire x1="1.27" y1="2.54" x2="2.54" y2="2.54" width="0.6096" layer="94"/>
<wire x1="1.27" y1="0" x2="2.54" y2="0" width="0.6096" layer="94"/>
<wire x1="1.27" y1="-2.54" x2="2.54" y2="-2.54" width="0.6096" layer="94"/>
<wire x1="1.27" y1="-5.08" x2="2.54" y2="-5.08" width="0.6096" layer="94"/>
<wire x1="1.27" y1="-7.62" x2="2.54" y2="-7.62" width="0.6096" layer="94"/>
<wire x1="-2.54" y1="2.54" x2="-1.27" y2="2.54" width="0.6096" layer="94"/>
<wire x1="-2.54" y1="0" x2="-1.27" y2="0" width="0.6096" layer="94"/>
<wire x1="-2.54" y1="-2.54" x2="-1.27" y2="-2.54" width="0.6096" layer="94"/>
<wire x1="-2.54" y1="-5.08" x2="-1.27" y2="-5.08" width="0.6096" layer="94"/>
<wire x1="-2.54" y1="-7.62" x2="-1.27" y2="-7.62" width="0.6096" layer="94"/>
<wire x1="1.27" y1="5.08" x2="2.54" y2="5.08" width="0.6096" layer="94"/>
<wire x1="1.27" y1="7.62" x2="2.54" y2="7.62" width="0.6096" layer="94"/>
<wire x1="-2.54" y1="5.08" x2="-1.27" y2="5.08" width="0.6096" layer="94"/>
<wire x1="-2.54" y1="7.62" x2="-1.27" y2="7.62" width="0.6096" layer="94"/>
<text x="-3.81" y="-12.7" size="1.778" layer="96">>VALUE</text>
<text x="-3.81" y="10.922" size="1.778" layer="95">>NAME</text>
<pin name="1" x="7.62" y="-7.62" visible="pad" length="middle" direction="pas" rot="R180"/>
<pin name="3" x="7.62" y="-5.08" visible="pad" length="middle" direction="pas" rot="R180"/>
<pin name="5" x="7.62" y="-2.54" visible="pad" length="middle" direction="pas" rot="R180"/>
<pin name="7" x="7.62" y="0" visible="pad" length="middle" direction="pas" rot="R180"/>
<pin name="9" x="7.62" y="2.54" visible="pad" length="middle" direction="pas" rot="R180"/>
<pin name="11" x="7.62" y="5.08" visible="pad" length="middle" direction="pas" rot="R180"/>
<pin name="13" x="7.62" y="7.62" visible="pad" length="middle" direction="pas" rot="R180"/>
<pin name="2" x="-7.62" y="-7.62" visible="pad" length="middle" direction="pas"/>
<pin name="4" x="-7.62" y="-5.08" visible="pad" length="middle" direction="pas"/>
<pin name="6" x="-7.62" y="-2.54" visible="pad" length="middle" direction="pas"/>
<pin name="12" x="-7.62" y="5.08" visible="pad" length="middle" direction="pas"/>
<pin name="14" x="-7.62" y="7.62" visible="pad" length="middle" direction="pas"/>
<pin name="8" x="-7.62" y="0" visible="pad" length="middle" direction="pas"/>
<pin name="10" x="-7.62" y="2.54" visible="pad" length="middle" direction="pas"/>
</symbol>
</symbols>
<devicesets>
<deviceset name="ML14" prefix="SV" uservalue="yes">
<description><b>HARTING</b></description>
<gates>
<gate name="1" symbol="14P" x="0" y="0"/>
</gates>
<devices>
<device name="" package="ML14">
<connects>
<connect gate="1" pin="1" pad="1"/>
<connect gate="1" pin="10" pad="10"/>
<connect gate="1" pin="11" pad="11"/>
<connect gate="1" pin="12" pad="12"/>
<connect gate="1" pin="13" pad="13"/>
<connect gate="1" pin="14" pad="14"/>
<connect gate="1" pin="2" pad="2"/>
<connect gate="1" pin="3" pad="3"/>
<connect gate="1" pin="4" pad="4"/>
<connect gate="1" pin="5" pad="5"/>
<connect gate="1" pin="6" pad="6"/>
<connect gate="1" pin="7" pad="7"/>
<connect gate="1" pin="8" pad="8"/>
<connect gate="1" pin="9" pad="9"/>
</connects>
<technologies>
<technology name="">
<attribute name="MF" value="" constant="no"/>
<attribute name="MPN" value="" constant="no"/>
<attribute name="OC_FARNELL" value="unknown" constant="no"/>
<attribute name="OC_NEWARK" value="unknown" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
</classes>
<parts>
<part name="U$1" library="TI_MSP430_v16" deviceset="F24[X/10]---PM64" device=""/>
<part name="GND2" library="SparkFun" deviceset="GND" device=""/>
<part name="+3V1" library="supply1" deviceset="+3V3" device=""/>
<part name="SV3" library="con-ml" deviceset="ML14" device="" value="14 PIN JTAG"/>
<part name="+3V8" library="supply1" deviceset="+3V3" device=""/>
<part name="GND35" library="SparkFun" deviceset="GND" device=""/>
<part name="JP18" library="SparkFun-Connectors" deviceset="M03" device="SCREW" value="VRAILS"/>
</parts>
<sheets>
<sheet>
<plain>
</plain>
<instances>
<instance part="U$1" gate="G$1" x="119.38" y="63.5"/>
<instance part="GND2" gate="1" x="104.14" y="116.84" rot="R180"/>
<instance part="+3V1" gate="G$1" x="76.2" y="88.9" smashed="yes"/>
<instance part="SV3" gate="1" x="118.11" y="139.7" smashed="yes">
<attribute name="VALUE" x="110.49" y="127" size="1.778" layer="96"/>
<attribute name="NAME" x="114.3" y="150.622" size="1.778" layer="95"/>
</instance>
<instance part="+3V8" gate="G$1" x="101.6" y="111.76" smashed="yes"/>
<instance part="GND35" gate="1" x="109.22" y="111.76" rot="R180"/>
<instance part="JP18" gate="G$1" x="64.77" y="129.54"/>
</instances>
<busses>
</busses>
<nets>
<net name="GND" class="0">
<segment>
<pinref part="U$1" gate="G$1" pin="63"/>
<wire x1="104.14" y1="101.6" x2="104.14" y2="114.3" width="0.127" layer="91"/>
<pinref part="GND2" gate="1" pin="GND"/>
</segment>
<segment>
<pinref part="SV3" gate="1" pin="9"/>
<wire x1="125.73" y1="142.24" x2="130.81" y2="142.24" width="0.1524" layer="91"/>
<label x="130.81" y="142.24" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="U$1" gate="G$1" pin="62"/>
<wire x1="106.68" y1="101.6" x2="106.68" y2="106.68" width="0.1524" layer="91"/>
<wire x1="106.68" y1="106.68" x2="109.22" y2="106.68" width="0.1524" layer="91"/>
<pinref part="GND35" gate="1" pin="GND"/>
<wire x1="109.22" y1="106.68" x2="109.22" y2="109.22" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="JP18" gate="G$1" pin="1"/>
<wire x1="72.39" y1="127" x2="77.47" y2="127" width="0.1524" layer="91"/>
<label x="77.47" y="127" size="1.778" layer="95"/>
</segment>
</net>
<net name="+12V" class="0">
<segment>
<pinref part="JP18" gate="G$1" pin="3"/>
<wire x1="72.39" y1="132.08" x2="77.47" y2="132.08" width="0.1524" layer="91"/>
<label x="77.47" y="132.08" size="1.778" layer="95"/>
</segment>
</net>
<net name="+3V3" class="0">
<segment>
<pinref part="U$1" gate="G$1" pin="1"/>
<wire x1="78.74" y1="78.74" x2="76.2" y2="78.74" width="0.1524" layer="91"/>
<pinref part="+3V1" gate="G$1" pin="+3V3"/>
<wire x1="76.2" y1="78.74" x2="76.2" y2="86.36" width="0.1524" layer="91"/>
<label x="76.2" y="88.9" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="SV3" gate="1" pin="2"/>
<wire x1="110.49" y1="132.08" x2="105.41" y2="132.08" width="0.1524" layer="91"/>
<label x="100.33" y="132.08" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="U$1" gate="G$1" pin="64"/>
<wire x1="101.6" y1="101.6" x2="101.6" y2="109.22" width="0.1524" layer="91"/>
<pinref part="+3V8" gate="G$1" pin="+3V3"/>
<label x="99.06" y="109.22" size="1.778" layer="95" rot="R90"/>
</segment>
<segment>
<pinref part="JP18" gate="G$1" pin="2"/>
<wire x1="72.39" y1="129.54" x2="77.47" y2="129.54" width="0.1524" layer="91"/>
<label x="77.47" y="129.54" size="1.778" layer="95"/>
</segment>
</net>
<net name="TDO" class="0">
<segment>
<pinref part="SV3" gate="1" pin="1"/>
<wire x1="125.73" y1="132.08" x2="130.81" y2="132.08" width="0.1524" layer="91"/>
<label x="130.81" y="132.08" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="U$1" gate="G$1" pin="54"/>
<wire x1="127" y1="101.6" x2="127" y2="106.68" width="0.1524" layer="91"/>
<label x="127" y="106.68" size="1.778" layer="95" rot="R90"/>
</segment>
</net>
<net name="TCK" class="0">
<segment>
<pinref part="SV3" gate="1" pin="7"/>
<wire x1="125.73" y1="139.7" x2="130.81" y2="139.7" width="0.1524" layer="91"/>
<label x="130.81" y="139.7" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="U$1" gate="G$1" pin="57"/>
<wire x1="119.38" y1="101.6" x2="119.38" y2="106.68" width="0.1524" layer="91"/>
<label x="119.38" y="106.68" size="1.778" layer="95" rot="R90"/>
</segment>
</net>
<net name="RST/NMI" class="0">
<segment>
<pinref part="SV3" gate="1" pin="11"/>
<wire x1="125.73" y1="144.78" x2="130.81" y2="144.78" width="0.1524" layer="91"/>
<label x="130.81" y="144.78" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="U$1" gate="G$1" pin="58"/>
<wire x1="116.84" y1="101.6" x2="116.84" y2="106.68" width="0.1524" layer="91"/>
<label x="116.84" y="106.68" size="1.778" layer="95" rot="R90"/>
</segment>
</net>
<net name="TMS" class="0">
<segment>
<pinref part="U$1" gate="G$1" pin="56"/>
<wire x1="121.92" y1="101.6" x2="121.92" y2="106.68" width="0.1524" layer="91"/>
<label x="121.92" y="106.68" size="1.778" layer="95" rot="R90"/>
</segment>
<segment>
<pinref part="SV3" gate="1" pin="5"/>
<wire x1="125.73" y1="137.16" x2="130.81" y2="137.16" width="0.1524" layer="91"/>
<label x="130.81" y="137.16" size="1.778" layer="95"/>
</segment>
</net>
<net name="TDI" class="0">
<segment>
<pinref part="U$1" gate="G$1" pin="55"/>
<wire x1="124.46" y1="101.6" x2="124.46" y2="106.68" width="0.1524" layer="91"/>
<label x="124.46" y="106.68" size="1.778" layer="95" rot="R90"/>
</segment>
<segment>
<pinref part="SV3" gate="1" pin="3"/>
<wire x1="125.73" y1="134.62" x2="130.81" y2="134.62" width="0.1524" layer="91"/>
<label x="130.81" y="134.62" size="1.778" layer="95"/>
</segment>
</net>
</nets>
</sheet>
</sheets>
<errors>
<approved hash="104,1,101.6,101.6,U$1,64,+3V3,,,"/>
<approved hash="104,1,104.14,101.6,U$1,63,GND,,,"/>
<approved hash="104,1,106.68,101.6,U$1,62,GND,,,"/>
<approved hash="202,1,129.54,101.6,U$1,53,,,,"/>
<approved hash="104,1,78.74,78.74,U$1,1,+3V3,,,"/>
<approved hash="202,1,78.74,53.34,U$1,11,,,,"/>
</errors>
</schematic>
</drawing>
</eagle>


text:
PR = "r0"

inherit gpe

DESCRIPTION = "GPE infrared communication applet"
DEPENDS = "gtk+ libgpewidget libmimedir libgpevtype openobex irda-utils dbus"
RDEPENDS = "irda-utils"
SECTION = "gpe"
PRIORITY = "optional"
MAINTAINER = "Florian Boor <florian@kernelconcepts.de>"
LICENSE = "GPL"

SRC_URI += "file://dbus-new-api.patch;patch=1"

license: MIT

repository: BackupTheBerlios/openslug-svn

license_type: permissive

repo_name: BackupTheBerlios/openslug-svn

branch_name: refs/heads/master

extension: bb


text:
package proxy

import "github.com/sirupsen/logrus"

func DefaultLogger() *logrus.Logger {
	log := logrus.New()
	log.Formatter = &logrus.JSONFormatter{}
	return log
}

repository: Roman-Mitusov/middleware

repo_name: Roman-Mitusov/middleware

branch_name: refs/heads/main

extension: go


text:
package pgtype_test

import (
	"context"
	"reflect"
	"testing"

	"github.com/jackc/pgx/v5/pgtype"
	"github.com/jackc/pgx/v5/pgxtest"
	"github.com/stretchr/testify/require"
)

func TestUUIDCodec(t *testing.T) {
	pgxtest.RunValueRoundTripTests(context.Background(), t, defaultConnTestRunner, nil, "uuid", []pgxtest.ValueRoundTripTest{
		{
			pgtype.UUID{Bytes: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, Valid: true},
			new(pgtype.UUID),
			isExpectedEq(pgtype.UUID{Bytes: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, Valid: true}),
		},
		{
			"00010203-0405-0607-0809-0a0b0c0d0e0f",
			new(pgtype.UUID),
			isExpectedEq(pgtype.UUID{Bytes: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, Valid: true}),
		},
		{
			"000102030405060708090a0b0c0d0e0f",
			new(pgtype.UUID),
			isExpectedEq(pgtype.UUID{Bytes: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, Valid: true}),
		},
		{
			pgtype.UUID{Bytes: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, Valid: true},
			new(string),
			isExpectedEq("00010203-0405-0607-0809-0a0b0c0d0e0f"),
		},
		{pgtype.UUID{}, new([]byte), isExpectedEqBytes([]byte(nil))},
		{pgtype.UUID{}, new(pgtype.UUID), isExpectedEq(pgtype.UUID{})},
		{nil, new(pgtype.UUID), isExpectedEq(pgtype.UUID{})},
	})

	pgxtest.RunValueRoundTripTests(context.Background(), t, defaultConnTestRunner, pgxtest.KnownOIDQueryExecModes, "uuid", []pgxtest.ValueRoundTripTest{
		{
			[16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
			new(pgtype.UUID),
			isExpectedEq(pgtype.UUID{Bytes: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, Valid: true}),
		},
		{
			[]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
			new(pgtype.UUID),
			isExpectedEq(pgtype.UUID{Bytes: [16]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, Valid: true}),
		},
	})
}

func TestUUID_MarshalJSON(t *testing.T) {
	tests := []struct {
		name string
		src  pgtype.UUID
		want []byte
	}{
		{
			name: "first",
			src: pgtype.UUID{
				Bytes: [16]byte{29, 72, 90, 122, 109, 24, 69, 153, 140, 108, 52, 66, 86, 22, 136, 122},
				Valid: true,
			},
			want: []byte(`"1d485a7a-6d18-4599-8c6c-34425616887a"`),
		},
		{
			name: "third",
			src: pgtype.UUID{
				Bytes: [16]byte{},
			},
			want: []byte("null"),
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			got, err := tt.src.MarshalJSON()
			require.NoError(t, err)
			if !reflect.DeepEqual(got, tt.want) {
				t.Errorf("MarshalJSON() got = %v, want %v", got, tt.want)
			}
		})
	}
}

func TestUUID_UnmarshalJSON(t *testing.T) {
	tests := []struct {
		name    string
		want    *pgtype.UUID
		src     []byte
		wantErr bool
	}{
		{
			name: "first",
			want: &pgtype.UUID{
				Bytes: [16]byte{29, 72, 90, 122, 109, 24, 69, 153, 140, 108, 52, 66, 86, 22, 136, 122},
				Valid: true,
			},
			src:     []byte(`"1d485a7a-6d18-4599-8c6c-34425616887a"`),
			wantErr: false,
		},
		{
			name: "second",
			want: &pgtype.UUID{
				Bytes: [16]byte{},
			},
			src:     []byte("null"),
			wantErr: false,
		},
		{
			name: "third",
			want: &pgtype.UUID{
				Bytes: [16]byte{},
				Valid: false,
			},
			src:     []byte("1d485a7a-6d18-4599-8c6c-34425616887a"),
			wantErr: true,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			got := &pgtype.UUID{}
			if err := got.UnmarshalJSON(tt.src); (err != nil) != tt.wantErr {
				t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr)
			}
			if !reflect.DeepEqual(got, tt.want) {
				t.Errorf("UnmarshalJSON() got = %v, want %v", got, tt.want)
			}
		})
	}
}

repository: jackc/pgx

repo_name: jackc/pgx

gha_license_id: MIT

gha_language: Go


text:
SUMMARY = "DE-Nano Units to initialize usb gadgets"
DESCRIPTION = "Scripts to start usb gadget for usb mass storage, ethernet, and serial interfaces"
AUTHOR = "Dalon Westergreen <dwesterg@gmail.com>"
SECTION = "DE10-Nano"

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

inherit systemd

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"

PACKAGE_ARCH = "${MACHINE_ARCH}"
SRCREV = "e191339d28d6d26ea5a9a5aedf3c04047cc04963"
PV = "1.0${PR}+git${SRCPV}"

SRC_URI = "file://de10-nano-gadget-init.service \
           file://udhcpd.conf \
           file://de10-nano-gadget-init.sh \
	   git://github.com/01org/de10-nano-drivers.git;protocol=https \
          "

do_install() {
	install -d ${D}${base_libdir}/systemd/system
	install -m 0644 ${WORKDIR}/*.service ${D}${base_libdir}/systemd/system

	install -d ${D}${sysconfdir}
	install -m 0644 ${WORKDIR}/*.conf ${D}${sysconfdir}

	install -d ${D}${bindir}
	install -m 0755 ${WORKDIR}/*.sh ${D}${bindir}

	install -d ${D}${sysconfdir}/systemd/system/getty.target.wants
	( cd ${D}${sysconfdir}/systemd/system/getty.target.wants && ln -s /lib/systemd/system/serial-getty@.service serial-getty@ttyGS0.service )

	install -d ${D}${datadir}/${PN}
	tar -xzvf ${WORKDIR}/git/fat_image.img.tgz -C ${D}${datadir}/${PN}
}

PACKAGES =+ "${PN}-network ${PN}-udhcpd"

ALLOW_EMPTY_${PN} = "1"

FILES_${PN} = "${base_libdir}/systemd/system/de10-nano-gadget-init.service \
               ${sysconfdir}/systemd/ \
               ${datadir}/${PN}/ \
               ${datadir}/${PN}/fat_image.img \
              "

FILES_${PN}-network = "${base_libdir}/systemd/system/network-gadget-init.service \
                       ${bindir}/de10-nano-gadget-init.sh \
		       ${datadir}/${PN}"

FILES_${PN}-udhcpd = "${sysconfdir}/udhcpd.conf"

RRECOMMENDS_${PN} = "${PN}-network ${PN}-udhcpd"
RREPLACES_${PN} = "${PN}-storage"

NATIVE_SYSTEMD_SUPPORT = "1"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "de10-nano-gadget-init.service"

gha_language: C


text:
SUMMARY = "HORNET Helper Tools "
DESCRIPTION = "HORNET Helper Tools "
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

SRC_URI = "git://github.com/honeycombOS/hornetctl.git;protocol=https"
SRCREV = "3c5bad10b9102554dae8efb7ffd64d0527b2cf44"

S = "${WORKDIR}/git"

RDEPENDS_${PN} = " hornet python3 python3-pyyaml python3-urllib3"

do_install(){

    install -m 0755 -d ${D}${bindir}

    # install hornet helper scripts
    install -m 0755 ${S}/hornetctl ${D}${bindir}
}


text:
SUMMARY = "Simple module to parse ISO 8601 dates"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=b05625f2336fa024e8d57e65c6595844"

SRC_URI[md5sum] = "b06d11cd14a64096f907086044f0fe38"
SRC_URI[sha256sum] = "e8fb52f78880ae063336c94eb5b87b181e6a0cc33a6c008511bac9a6e980ef30"

inherit pypi setuptools

repository: reMarkable/meta-openembedded

repo_name: reMarkable/meta-openembedded

branch_name: refs/heads/zero-gravitas

gha_language: BitBake


text:
package cmd

import (
	"encoding/json"
	"fmt"
	"os"

	"github.com/aws/aws-sdk-go/aws"

	"github.com/aws/aws-sdk-go/aws/session"
	"github.com/aws/aws-sdk-go/service/secretsmanager"
	"github.com/spf13/cobra"
)

func init() {
	command := &cobra.Command{
		Use:   "get [secret-id]",
		Short: "Retrive AWS Secrets Manager json secret to dotenv file",
		Args:  cobra.ExactArgs(1),
		Run:   getCommnad,
	}

	command.Flags().String("version-id", "", "Specify AWS Secrets Manager Secret Version Id")
	command.Flags().String("version-stage", "", "Specify AWS Secrets Manager Secret Version Stage")
	command.Flags().StringP("file", "f", ".env", "Specify dotenv file path")

	rootCmd.AddCommand(command)
}

func getCommnad(cmd *cobra.Command, args []string) {
	versionID := getFlagStringOrFailed(cmd, "version-id")
	versionStage := getFlagStringOrFailed(cmd, "version-stage")
	fileName := getFlagStringOrFailed(cmd, "file")

	awsSession := secretsmanager.New(session.New(&aws.Config{
		Region: aws.String(getFlagStringOrFailed(cmd, "aws-region")),
	}))
	awsInput := &secretsmanager.GetSecretValueInput{
		SecretId: &args[0],
	}

	if len(versionID) > 0 {
		awsInput.VersionId = &versionID
	}

	if len(versionStage) > 0 {
		awsInput.VersionStage = &versionStage
	}

	secretsData, err := awsSession.GetSecretValue(awsInput)

	if err != nil {
		showErrorAndExit(fmt.Errorf("Get secret value falied: %w", err))
	}

	var secrets map[string]string
	if err = json.Unmarshal([]byte(*secretsData.SecretString), &secrets); err != nil {
		showErrorAndExit(fmt.Errorf("Unmarshal secrets json falied: %w", err))
	}

	file, err := os.Create(fileName)
	if err != nil {
		showErrorAndExit(fmt.Errorf("Creating %s falied: %w", fileName, err))
	}

	defer file.Close()
	defer file.Sync()

	for key, value := range secrets {
		if _, err := file.WriteString(fmt.Sprintf("%s=%s\n", key, value)); err != nil {
			showErrorAndExit(fmt.Errorf("Writing dotenv falied: %w", err))
		}
	}
}

repository: RafaelYon/aws-secrets-dotenv

repo_name: RafaelYon/aws-secrets-dotenv


text:
DESCRIPTION = "QT Gnuplot is a front end for Gnuplot. Install Opie-Embedded \
console to enable the Launch Gnuplot menu option."
HOMEPAGE = "http://www.mneuroth.de/privat/zaurus/gnuplot.html"
SECTION = "opie/applications"
PRIORITY = "optional"
LICENSE = "GPL"
DEPENDS = "gnuplot"
RDEPDENDS_${PN} = "gnuplot"

PR = "r1"

SRC_URI  = "http://www.mneuroth.de/privat/zaurus/qtplot-${PV}.tar.gz"

APPTYPE    = "binary"
APPDESKTOP = "${S}"

inherit opie

do_install_prepend() {
	install -d ${D}${palmtopdir}/pics
        install -d ${D}${palmtopdir}/help/html

        install -m 644 Qtplot.png ${D}${palmtopdir}/pics/
        install -m 644 qtplot.html ${D}${palmtopdir}/help/html/
}

SRC_URI[md5sum] = "0a481885a496092c77eb4017540b5cf6"
SRC_URI[sha256sum] = "6df317183ff62cc82f3dcf88207a267cd6478cb5147f55d7530c94f1ad5f4132"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package container

import (
	"fmt"
	"image"
	"testing"
	"time"

	"github.com/mum4k/termdash/cell"
	"github.com/mum4k/termdash/linestyle"
	"github.com/mum4k/termdash/mouse"
	"github.com/mum4k/termdash/private/event"
	"github.com/mum4k/termdash/private/event/testevent"
	"github.com/mum4k/termdash/private/faketerm"
	"github.com/mum4k/termdash/terminal/terminalapi"
)

// pointCase is a test case for the pointCont function.
type pointCase struct {
	desc      string
	point     image.Point
	wantNil   bool
	wantColor cell.Color // expected container identified by its border color
}

func TestPointCont(t *testing.T) {
	tests := []struct {
		desc      string
		termSize  image.Point
		container func(ft *faketerm.Terminal) (*Container, error)
		cases     []pointCase
	}{
		{
			desc:     "single container, no border",
			termSize: image.Point{3, 3},
			container: func(ft *faketerm.Terminal) (*Container, error) {
				return New(
					ft,
					BorderColor(cell.ColorBlue),
				)
			},
			cases: []pointCase{
				{
					desc:      "inside the container",
					point:     image.Point{1, 1},
					wantColor: cell.ColorBlue,
				},
				{
					desc:      "top left corner",
					point:     image.Point{0, 0},
					wantColor: cell.ColorBlue,
				},
				{
					desc:      "top right corner",
					point:     image.Point{2, 0},
					wantColor: cell.ColorBlue,
				},
				{
					desc:      "bottom left corner",
					point:     image.Point{0, 2},
					wantColor: cell.ColorBlue,
				},
				{
					desc:      "bottom right corner",
					point:     image.Point{2, 2},
					wantColor: cell.ColorBlue,
				},
				{
					desc:    "outside of the container, too large",
					point:   image.Point{3, 3},
					wantNil: true,
				},
				{
					desc:    "outside of the container, too small",
					point:   image.Point{-1, -1},
					wantNil: true,
				},
			},
		},
		{
			desc:     "single container, border",
			termSize: image.Point{3, 3},
			container: func(ft *faketerm.Terminal) (*Container, error) {
				return New(
					ft,
					Border(linestyle.Light),
					BorderColor(cell.ColorBlue),
				)
			},
			cases: []pointCase{
				{
					desc:      "inside the container",
					point:     image.Point{1, 1},
					wantColor: cell.ColorBlue,
				},
				{
					desc:      "on the border",
					point:     image.Point{0, 1},
					wantColor: cell.ColorBlue,
				},
			},
		},
		{
			desc:     "split containers, parent has no border",
			termSize: image.Point{10, 10},
			container: func(ft *faketerm.Terminal) (*Container, error) {
				return New(
					ft,
					BorderColor(cell.ColorBlack),
					SplitVertical(
						Left(
							SplitHorizontal(
								Top(
									BorderColor(cell.ColorGreen),
								),
								Bottom(
									BorderColor(cell.ColorWhite),
								),
							),
						),
						Right(
							BorderColor(cell.ColorRed),
						),
					),
				)
			},
			cases: []pointCase{
				{
					desc:      "right sub container, inside corner",
					point:     image.Point{5, 5},
					wantColor: cell.ColorRed,
				},
				{
					desc:      "right sub container, outside corner",
					point:     image.Point{9, 9},
					wantColor: cell.ColorRed,
				},
				{
					desc:      "top left",
					point:     image.Point{0, 0},
					wantColor: cell.ColorGreen,
				},
				{
					desc:      "bottom left",
					point:     image.Point{0, 9},
					wantColor: cell.ColorWhite,
				},
			},
		},
		{
			desc:     "split containers, parent has border",
			termSize: image.Point{10, 10},
			container: func(ft *faketerm.Terminal) (*Container, error) {
				return New(
					ft,
					Border(linestyle.Light),
					BorderColor(cell.ColorBlack),
					SplitVertical(
						Left(
							SplitHorizontal(
								Top(
									BorderColor(cell.ColorGreen),
								),
								Bottom(
									BorderColor(cell.ColorWhite),
								),
							),
						),
						Right(
							BorderColor(cell.ColorRed),
						),
					),
				)
			},
			cases: []pointCase{
				{
					desc:      "right sub container, inside corner",
					point:     image.Point{5, 5},
					wantColor: cell.ColorRed,
				},
				{
					desc:      "top right corner focuses parent",
					point:     image.Point{9, 9},
					wantColor: cell.ColorBlack,
				},
				{
					desc:      "right sub container, outside corner",
					point:     image.Point{8, 8},
					wantColor: cell.ColorRed,
				},
				{
					desc:      "top left focuses parent",
					point:     image.Point{0, 0},
					wantColor: cell.ColorBlack,
				},
				{
					desc:      "top left sub container",
					point:     image.Point{1, 1},
					wantColor: cell.ColorGreen,
				},
				{
					desc:      "bottom left focuses parent",
					point:     image.Point{0, 9},
					wantColor: cell.ColorBlack,
				},
				{
					desc:      "bottom left sub container",
					point:     image.Point{1, 8},
					wantColor: cell.ColorWhite,
				},
			},
		},
	}

	for _, tc := range tests {
		t.Run(tc.desc, func(t *testing.T) {
			ft, err := faketerm.New(tc.termSize)
			if err != nil {
				t.Fatalf("faketerm.New => unexpected error: %v", err)
			}

			cont, err := tc.container(ft)
			if err != nil {
				t.Fatalf("tc.container => unexpected error: %v", err)
			}
			// Initial draw to determine sizes of containers.
			if err := cont.Draw(); err != nil {
				t.Fatalf("Draw => unexpected error: %v", err)
			}
			for _, pc := range tc.cases {
				gotCont := pointCont(cont, pc.point)
				if (gotCont == nil) != pc.wantNil {
					t.Errorf("%s, pointCont%v => got %v, wantNil: %v", pc.desc, pc.point, gotCont, pc.wantNil)
				}
				if gotCont == nil {
					continue
				}

				gotColor := gotCont.opts.inherited.borderColor
				if gotColor != pc.wantColor {
					t.Errorf("%s, pointCont%v => got container with border color %v, want %v", pc.desc, pc.point, gotColor, pc.wantColor)
				}
			}
		})
	}
}

// contLoc is used in tests to indicate the desired location of a container.
type contLoc int

// String implements fmt.Stringer()
func (cl contLoc) String() string {
	if n, ok := contLocNames[cl]; ok {
		return n
	}
	return "contLocUnknown"
}

// contLocNames maps contLoc values to human readable names.
var contLocNames = map[contLoc]string{
	contLocRoot:  "Root",
	contLocLeft:  "Left",
	contLocRight: "Right",
}

const (
	contLocUnknown contLoc = iota
	contLocRoot
	contLocLeft
	contLocRight
)

func TestFocusTrackerMouse(t *testing.T) {
	ft, err := faketerm.New(image.Point{10, 10})
	if err != nil {
		t.Fatalf("faketerm.New => unexpected error: %v", err)
	}

	var (
		insideLeft  = image.Point{1, 1}
		insideRight = image.Point{6, 6}
	)

	tests := []struct {
		desc string
		// Can be either the mouse event or a time.Duration to pause for.
		events        []*terminalapi.Mouse
		wantFocused   contLoc
		wantProcessed int
	}{
		{
			desc:        "initially the root is focused",
			wantFocused: contLocRoot,
		},
		{
			desc: "click and release moves focus to the left",
			events: []*terminalapi.Mouse{
				{Position: image.Point{0, 0}, Button: mouse.ButtonLeft},
				{Position: image.Point{1, 1}, Button: mouse.ButtonRelease},
			},
			wantFocused:   contLocLeft,
			wantProcessed: 2,
		},
		{
			desc: "click and release moves focus to the right",
			events: []*terminalapi.Mouse{
				{Position: image.Point{5, 5}, Button: mouse.ButtonLeft},
				{Position: image.Point{6, 6}, Button: mouse.ButtonRelease},
			},
			wantFocused:   contLocRight,
			wantProcessed: 2,
		},
		{
			desc: "click in the same container is a no-op",
			events: []*terminalapi.Mouse{
				{Position: insideRight, Button: mouse.ButtonLeft},
				{Position: insideRight, Button: mouse.ButtonRelease},
				{Position: insideRight, Button: mouse.ButtonLeft},
				{Position: insideRight, Button: mouse.ButtonRelease},
			},
			wantFocused:   contLocRight,
			wantProcessed: 4,
		},
		{
			desc: "click in the same container and release never happens",
			events: []*terminalapi.Mouse{
				{Position: insideRight, Button: mouse.ButtonLeft},
				{Position: insideLeft, Button: mouse.ButtonLeft},
				{Position: insideLeft, Button: mouse.ButtonRelease},
			},
			wantFocused:   contLocLeft,
			wantProcessed: 3,
		},
		{
			desc: "click in the same container, release elsewhere",
			events: []*terminalapi.Mouse{
				{Position: insideRight, Button: mouse.ButtonLeft},
				{Position: insideLeft, Button: mouse.ButtonRelease},
			},
			wantFocused:   contLocRoot,
			wantProcessed: 2,
		},
		{
			desc: "other buttons are ignored",
			events: []*terminalapi.Mouse{
				{Position: insideLeft, Button: mouse.ButtonMiddle},
				{Position: insideLeft, Button: mouse.ButtonRelease},
				{Position: insideLeft, Button: mouse.ButtonRight},
				{Position: insideLeft, Button: mouse.ButtonRelease},
				{Position: insideLeft, Button: mouse.ButtonWheelUp},
				{Position: insideLeft, Button: mouse.ButtonWheelDown},
			},
			wantFocused:   contLocRoot,
			wantProcessed: 6,
		},
		{
			desc: "moving mouse with pressed button and then releasing moves focus",
			events: []*terminalapi.Mouse{
				{Position: image.Point{0, 0}, Button: mouse.ButtonLeft},
				{Position: image.Point{1, 1}, Button: mouse.ButtonLeft},
				{Position: image.Point{2, 2}, Button: mouse.ButtonRelease},
			},
			wantFocused:   contLocLeft,
			wantProcessed: 3,
		},
		{
			desc: "click ignored if followed by another click of the same button elsewhere",
			events: []*terminalapi.Mouse{
				{Position: insideRight, Button: mouse.ButtonLeft},
				{Position: insideLeft, Button: mouse.ButtonLeft},
				{Position: insideRight, Button: mouse.ButtonRelease},
			},
			wantFocused:   contLocRoot,
			wantProcessed: 3,
		},
		{
			desc: "click ignored if followed by another click of a different button",
			events: []*terminalapi.Mouse{
				{Position: insideRight, Button: mouse.ButtonLeft},
				{Position: insideRight, Button: mouse.ButtonMiddle},
				{Position: insideRight, Button: mouse.ButtonRelease},
			},
			wantFocused:   contLocRoot,
			wantProcessed: 3,
		},
	}

	for _, tc := range tests {
		t.Run(tc.desc, func(t *testing.T) {
			root, err := New(
				ft,
				SplitVertical(
					Left(),
					Right(),
				),
			)
			if err != nil {
				t.Fatalf("New => unexpected error: %v", err)
			}

			eds := event.NewDistributionSystem()
			root.Subscribe(eds)
			// Initial draw to determine sizes of containers.
			if err := root.Draw(); err != nil {
				t.Fatalf("Draw => unexpected error: %v", err)
			}
			for _, ev := range tc.events {
				eds.Event(ev)
			}
			if err := testevent.WaitFor(5*time.Second, func() error {
				if got, want := eds.Processed(), tc.wantProcessed; got != want {
					return fmt.Errorf("the event distribution system processed %d events, want %d", got, want)
				}
				return nil
			}); err != nil {
				t.Fatalf("testevent.WaitFor => %v", err)
			}

			var wantFocused *Container
			switch wf := tc.wantFocused; wf {
			case contLocRoot:
				wantFocused = root
			case contLocLeft:
				wantFocused = root.first
			case contLocRight:
				wantFocused = root.second
			default:
				t.Fatalf("unsupported wantFocused value => %v", wf)
			}

			if !root.focusTracker.isActive(wantFocused) {
				t.Errorf("isActive(%v) => false, want true, status: root(%v):%v, left(%v):%v, right(%v):%v",
					tc.wantFocused,
					contLocRoot, root.focusTracker.isActive(root),
					contLocLeft, root.focusTracker.isActive(root.first),
					contLocRight, root.focusTracker.isActive(root.second),
				)
			}
		})
	}
}


text:
package ddb

import (
	"context"
	"fmt"

	"github.com/aws/aws-sdk-go/service/dynamodb"
	"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute"
	"github.com/aws/aws-sdk-go/service/dynamodb/expression"
)

// Scanner holds a DynamoDB query
type Scanner struct {
	res *scanResult
	eb  expression.Builder
}

// Scan sets up a scanner that can be run to fetch
func Scan(b expression.Builder, in dynamodb.ScanInput) (q *Scanner) {
	q = new(Scanner)
	q.res = &scanResult{pos: -1}
	q.res.in = &in
	q.eb = b
	return
}

// Run will return a Query result for iteration
func (q *Scanner) Run(ctx context.Context, ddb Dynamo) (r Result, err error) {
	expr, err := exprBuild(q.eb)
	if err != nil {
		return nil, fmt.Errorf("failed to build expression(s): %w", err)
	}

	q.res.ddb = ddb
	q.res.ctx = ctx
	q.res.in.FilterExpression = expr.Filter()
	q.res.in.ProjectionExpression = expr.Projection()
	q.res.in.ExpressionAttributeNames = expr.Names()
	q.res.in.ExpressionAttributeValues = expr.Values()
	return q.res, q.res.init()
}

// scanResult is a result that is returned when a scan operation
// is run. It will automatically get more pages as the user scans
// through the results.
type scanResult struct {
	ctx context.Context
	in  *dynamodb.ScanInput
	out *dynamodb.ScanOutput
	tot int64
	ddb Dynamo
	err error
	pos int
}

func (c *scanResult) init() (err error) {
	if c.out, err = c.ddb.ScanWithContext(c.ctx, c.in); err != nil {
		return err
	}

	c.tot = *c.out.Count
	return nil
}

func (c *scanResult) Len() int64 {
	return c.tot
}

func (c *scanResult) Err() error {
	return c.err
}

func (c *scanResult) Next() bool {

	// we got some query output, start with pos iteration
	c.pos++
	if c.out != nil && c.pos >= len(c.out.Items) {
		if c.out.LastEvaluatedKey == nil {
			return false // fully done
		}

		// else we prep the cursor for a new query
		if c.out.LastEvaluatedKey != nil {
			c.pos = 0
			c.in.ExclusiveStartKey = c.out.LastEvaluatedKey
			c.out = nil
		}
	}

	// no out, run again
	if c.out == nil {
		if c.out, c.err = c.ddb.ScanWithContext(c.ctx, c.in); c.err != nil {
			return false
		}
		c.tot += *c.out.Count
	}

	return true
}

func (c *scanResult) Scan(v interface {
	Itemizer
	Deitemizer
}) (err error) {
	it := v.Item()
	if err = dynamodbattribute.UnmarshalMap(c.out.Items[c.pos], it); err != nil {
		return
	}

	if err = v.FromItem(it); err != nil {
		return
	}

	return
}

repository: gohandle/ddb

repo_name: gohandle/ddb


text:
#ifndef BART_SRC_EQUATION_FACTORY_H_
#define BART_SRC_EQUATION_FACTORY_H_

#include <memory>
#include <unordered_map>

#include "equation_base.h"
#include "../common/computing_data.h"

namespace bart {

namespace equation {

template <int dim>
class Factory {
 private:
  Factory() = default;
  ~Factory() = default;
 public:
  static std::unique_ptr<EquationBase<dim>> CreateEquation(
      const dealii::ParameterHandler &prm,
      std::shared_ptr<FundamentalData<dim>> &dat_ptr);

};

template <int dim>
std::unordered_map<std::string, std::unique_ptr<EquationBase<dim>>>
GetEquations(const dealii::ParameterHandler &prm,
             std::shared_ptr<FundamentalData<dim>> &dat_ptr);

} // namespace equation

} // namespace bart

#endif // BART_SRC_EQUATION_FACTORY_H_

repository: SlaybaughLab/BART

repo_name: SlaybaughLab/BART

branch_name: refs/heads/dev

extension: h


text:
DESCRIPTION = "RaspberryPi GStreamer Packagegroup"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

inherit packagegroup

COMPATIBLE_MACHINE = "^rpi$"

OMXPLAYER_rpi = "omxplayer"
OMXPLAYER_rpi_aarch64 = ""

RDEPENDS_${PN} = "\
  glib-2.0 \
  gstreamer1.0 \
  gstreamer1.0-omx \
  gstreamer1.0-libav \
  gstreamer1.0-plugins-base \
  gstreamer1.0-plugins-good \
  gstreamer1.0-plugins-bad \
  gstreamer1.0-plugins-ugly \
  gstreamer1.0-rtsp-server \
"

repository: FrankBau/meta-raspberrypi-avg

repo_name: FrankBau/meta-raspberrypi-avg


text:
// Copyright (c) 2013-2018 LG Electronics, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// SPDX-License-Identifier: Apache-2.0

#include <cassert>

#include "engine/leveldb/MojDbLevelContainerIterator.h"

MojDbLevelContainerIterator::MojDbLevelContainerIterator (std::map<std::string, std::string>& database)
    : m_container(database)
{
    toFirst();
}

MojDbLevelContainerIterator::MojDbLevelContainerIterator(iterator_t iterator, std::map<std::string, std::string>& database)
    : m_container(database), m_it(iterator)
{
}

MojDbLevelContainerIterator::~MojDbLevelContainerIterator()
{
}

MojDbLevelContainerIterator& MojDbLevelContainerIterator::operator++ ()
{
    assert( !isEnd() );
    if (m_start)
    {
        toFirst();
    }
    else
    {
        ++m_it;
    }

    return *this;
}

/*
MojDbLevelContainerIterator MojDbLevelContainerIterator::operator++(int )
{
    MojDbLevelContainerIterator oldValue(*this);

    ++(*this);

    return oldValue;
}*/

MojDbLevelContainerIterator& MojDbLevelContainerIterator::operator-- ()
{
    assert( !isBegin() );
    if (m_it == m_container.begin())
    {
        toBegin();
    }
    else
    {
        --m_it;
    }

    return *this;
}

/*
MojDbLevelContainerIterator MojDbLevelContainerIterator::operator-- (int)
{
    MojDbLevelContainerIterator oldValue(*this);

    --(*this);

    return oldValue;
}*/

MojDbLevelContainerIterator& MojDbLevelContainerIterator::operator= (iterator_t iterator)
{
    m_it = iterator;
    m_start = false;

    return *this;
}

void MojDbLevelContainerIterator::toBegin()
{
    m_start = true;
}

void MojDbLevelContainerIterator::toEnd()
{
    m_it = m_container.end();
}

void MojDbLevelContainerIterator::toFirst()
{
    m_it = m_container.begin();
    m_start = false;
}

void MojDbLevelContainerIterator::toLast()
{
    m_start = m_container.empty();
    if (!m_start) m_it = --m_container.end();
}

branch_name: refs/heads/webosce

extension: cpp


text:
@InProceedings{bargi14,
  title = {{A Non-parametric Conditional Factor Regression Model for Multi-Dimensional Input and Response}},
  author = {Bargi, Ava and Xu, Richard Yi and Ghahramani, Zoubin and Piccardi, Massimo},
  pages = {77-85},
  abstract = {In this paper, we propose a  non-parametric conditional factor regression (NCFR) model for domains with multi-dimensional input and response. NCFR enhances linear regression in two ways: a) introducing low-dimensional latent factors leading to dimensionality reduction and b) integrating the Indian Buffet Process as prior for the latent layer to dynamically derive an optimal number of sparse factors. Thanks to IBP's enhancements to the latent factors, NCFR can significantly avoid over-fitting even in the case of a very small sample size compared to the dimensionality. Experimental results on three diverse datasets comparing NCRF to a few baseline alternatives give evidence of its robust learning, remarkable predictive performance, good mixing and computational efficiency.},
}

repository: mreid/papersite

repo_name: mreid/papersite

gha_language: TeX

extension: bib


text:
/*
@Time : 2019/10/9 18:54
@Author : louis
@File : 389-findTheDifference
@Software: GoLand
*/

package leetcode

/*
FindTheDifference
Given two strings s and t which consist of only lowercase letters.
String t is generated by random shuffling string s and then add one more letter at a random position.
Find the letter that was added in t.
*/
func FindTheDifference(s, t string) byte {
	var res byte
	for i := 0; i < len(s); i++ {
		res ^= s[i]
	}
	for i := 0; i < len(t); i++ {
		res ^= t[i]
	}
	return res
}

repository: oldthreefeng/algo

repo_name: oldthreefeng/algo


text:
<?xml version="1.0" encoding="UTF-8"?>
<drawing version="7">
    <attr value="spartan3e" name="DeviceFamilyName">
        <trait delete="all:0" />
        <trait editname="all:0" />
        <trait edittrait="all:0" />
    </attr>
    <netlist>
        <signal name="gnd1,M,S1,S0" />
        <signal name="gnd1" />
        <signal name="L(6:0)" />
        <signal name="ML(6:0)" />
        <signal name="MR(6:0)" />
        <signal name="R(6:0)" />
        <signal name="R(5)" />
        <signal name="R(4)" />
        <signal name="R(3)" />
        <signal name="R(2)" />
        <signal name="R(1)" />
        <signal name="R(0)" />
        <signal name="MR(6)" />
        <signal name="MR(5)" />
        <signal name="MR(4)" />
        <signal name="MR(3)" />
        <signal name="MR(2)" />
        <signal name="MR(1)" />
        <signal name="MR(0)" />
        <signal name="ML(6)" />
        <signal name="ML(5)" />
        <signal name="ML(4)" />
        <signal name="ML(3)" />
        <signal name="ML(2)" />
        <signal name="ML(1)" />
        <signal name="ML(0)" />
        <signal name="L(6)" />
        <signal name="L(5)" />
        <signal name="L(4)" />
        <signal name="L(3)" />
        <signal name="L(2)" />
        <signal name="L(0)" />
        <signal name="A(3:0)" />
        <signal name="B(3:0)" />
        <signal name="M" />
        <signal name="S1" />
        <signal name="S0" />
        <signal name="c_out" />
        <signal name="F(3:0)" />
        <signal name="CLK" />
        <signal name="SS(6:0)" />
        <signal name="EN_L" />
        <signal name="EN_ML" />
        <signal name="EN_R" />
        <signal name="L(1)" />
        <signal name="R(6)" />
        <signal name="EN_MR" />
        <port polarity="Input" name="A(3:0)" />
        <port polarity="Input" name="B(3:0)" />
        <port polarity="Input" name="M" />
        <port polarity="Input" name="S1" />
        <port polarity="Input" name="S0" />
        <port polarity="Output" name="c_out" />
        <port polarity="Output" name="F(3:0)" />
        <port polarity="Input" name="CLK" />
        <port polarity="Output" name="SS(6:0)" />
        <port polarity="Output" name="EN_L" />
        <port polarity="Output" name="EN_ML" />
        <port polarity="Output" name="EN_R" />
        <port polarity="Output" name="EN_MR" />
        <blockdef name="bin_to_7_seg">
            <timestamp>2017-2-15T16:24:3</timestamp>
            <rect width="256" x="64" y="-448" height="448" />
            <rect width="64" x="0" y="-428" height="24" />
            <line x2="0" y1="-416" y2="-416" x1="64" />
            <line x2="384" y1="-416" y2="-416" x1="320" />
            <line x2="384" y1="-352" y2="-352" x1="320" />
            <line x2="384" y1="-288" y2="-288" x1="320" />
            <line x2="384" y1="-224" y2="-224" x1="320" />
            <line x2="384" y1="-160" y2="-160" x1="320" />
            <line x2="384" y1="-96" y2="-96" x1="320" />
            <line x2="384" y1="-32" y2="-32" x1="320" />
        </blockdef>
        <blockdef name="gnd">
            <timestamp>2000-1-1T10:10:10</timestamp>
            <line x2="64" y1="-64" y2="-96" x1="64" />
            <line x2="52" y1="-48" y2="-48" x1="76" />
            <line x2="60" y1="-32" y2="-32" x1="68" />
            <line x2="40" y1="-64" y2="-64" x1="88" />
            <line x2="64" y1="-64" y2="-80" x1="64" />
            <line x2="64" y1="-128" y2="-96" x1="64" />
        </blockdef>
        <blockdef name="alu_lab_instructions">
            <timestamp>2017-2-15T23:28:46</timestamp>
            <rect width="256" x="64" y="-320" height="320" />
            <rect width="64" x="0" y="-300" height="24" />
            <line x2="0" y1="-288" y2="-288" x1="64" />
            <rect width="64" x="0" y="-236" height="24" />
            <line x2="0" y1="-224" y2="-224" x1="64" />
            <line x2="0" y1="-160" y2="-160" x1="64" />
            <line x2="0" y1="-96" y2="-96" x1="64" />
            <line x2="0" y1="-32" y2="-32" x1="64" />
            <line x2="384" y1="-288" y2="-288" x1="320" />
            <rect width="64" x="320" y="-44" height="24" />
            <line x2="384" y1="-32" y2="-32" x1="320" />
        </blockdef>
        <blockdef name="seven_seg_control_sch">
            <timestamp>2017-2-15T23:28:46</timestamp>
            <rect width="304" x="64" y="-320" height="320" />
            <line x2="0" y1="-288" y2="-288" x1="64" />
            <rect width="64" x="0" y="-236" height="24" />
            <line x2="0" y1="-224" y2="-224" x1="64" />
            <rect width="64" x="0" y="-172" height="24" />
            <line x2="0" y1="-160" y2="-160" x1="64" />
            <rect width="64" x="0" y="-108" height="24" />
            <line x2="0" y1="-96" y2="-96" x1="64" />
            <rect width="64" x="0" y="-44" height="24" />
            <line x2="0" y1="-32" y2="-32" x1="64" />
            <line x2="432" y1="-224" y2="-224" x1="368" />
            <line x2="432" y1="-160" y2="-160" x1="368" />
            <line x2="432" y1="-32" y2="-32" x1="368" />
            <line x2="432" y1="-96" y2="-96" x1="368" />
            <rect width="64" x="368" y="-300" height="24" />
            <line x2="432" y1="-288" y2="-288" x1="368" />
        </blockdef>
        <block symbolname="bin_to_7_seg" name="XLXI_1">
            <blockpin signalname="A(3:0)" name="bin_input(3:0)" />
            <blockpin signalname="L(6)" name="a" />
            <blockpin signalname="L(5)" name="b" />
            <blockpin signalname="L(4)" name="c" />
            <blockpin signalname="L(3)" name="d" />
            <blockpin signalname="L(2)" name="g" />
            <blockpin signalname="L(1)" name="f" />
            <blockpin signalname="L(0)" name="e" />
        </block>
        <block symbolname="bin_to_7_seg" name="XLXI_2">
            <blockpin signalname="gnd1,M,S1,S0" name="bin_input(3:0)" />
            <blockpin signalname="ML(6)" name="a" />
            <blockpin signalname="ML(5)" name="b" />
            <blockpin signalname="ML(4)" name="c" />
            <blockpin signalname="ML(3)" name="d" />
            <blockpin signalname="ML(2)" name="g" />
            <blockpin signalname="ML(1)" name="f" />
            <blockpin signalname="ML(0)" name="e" />
        </block>
        <block symbolname="bin_to_7_seg" name="XLXI_3">
            <blockpin signalname="B(3:0)" name="bin_input(3:0)" />
            <blockpin signalname="MR(6)" name="a" />
            <blockpin signalname="MR(5)" name="b" />
            <blockpin signalname="MR(4)" name="c" />
            <blockpin signalname="MR(3)" name="d" />
            <blockpin signalname="MR(2)" name="g" />
            <blockpin signalname="MR(1)" name="f" />
            <blockpin signalname="MR(0)" name="e" />
        </block>
        <block symbolname="bin_to_7_seg" name="XLXI_4">
            <blockpin signalname="F(3:0)" name="bin_input(3:0)" />
            <blockpin signalname="R(6)" name="a" />
            <blockpin signalname="R(5)" name="b" />
            <blockpin signalname="R(4)" name="c" />
            <blockpin signalname="R(3)" name="d" />
            <blockpin signalname="R(2)" name="g" />
            <blockpin signalname="R(1)" name="f" />
            <blockpin signalname="R(0)" name="e" />
        </block>
        <block symbolname="gnd" name="XLXI_5">
            <blockpin signalname="gnd1" name="G" />
        </block>
        <block symbolname="alu_lab_instructions" name="XLXI_6">
            <blockpin signalname="A(3:0)" name="B(3:0)" />
            <blockpin signalname="B(3:0)" name="A(3:0)" />
            <blockpin signalname="M" name="M" />
            <blockpin signalname="S1" name="S1" />
            <blockpin signalname="S0" name="S0" />
            <blockpin signalname="c_out" name="c_out" />
            <blockpin signalname="F(3:0)" name="SUM(3:0)" />
        </block>
        <block symbolname="seven_seg_control_sch" name="XLXI_7">
            <blockpin signalname="CLK" name="CLK" />
            <blockpin signalname="L(6:0)" name="L(6:0)" />
            <blockpin signalname="ML(6:0)" name="ML(6:0)" />
            <blockpin signalname="MR(6:0)" name="MR(6:0)" />
            <blockpin signalname="R(6:0)" name="R(6:0)" />
            <blockpin signalname="EN_MR" name="EN_MR" />
            <blockpin signalname="EN_L" name="EN_L" />
            <blockpin signalname="EN_ML" name="EN_ML" />
            <blockpin signalname="EN_R" name="EN_R" />
            <blockpin signalname="SS(6:0)" name="seven_seg_out(6:0)" />
        </block>
    </netlist>
    <sheet sheetnum="1" width="3520" height="2720">
        <instance x="1520" y="656" name="XLXI_1" orien="R0">
        </instance>
        <instance x="1472" y="1248" name="XLXI_2" orien="R0">
        </instance>
        <instance x="1472" y="1808" name="XLXI_3" orien="R0">
        </instance>
        <instance x="1552" y="2384" name="XLXI_4" orien="R0">
        </instance>
        <branch name="gnd1,M,S1,S0">
            <attrtext style="alignment:SOFT-TVCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1440" y="1008" type="branch" />
            <wire x2="1472" y1="832" y2="832" x1="1440" />
            <wire x2="1440" y1="832" y2="880" x1="1440" />
            <wire x2="1440" y1="880" y2="960" x1="1440" />
            <wire x2="1440" y1="960" y2="1008" x1="1440" />
            <wire x2="1440" y1="1008" y2="1056" x1="1440" />
            <wire x2="1440" y1="1056" y2="1136" x1="1440" />
        </branch>
        <bustap x2="1344" y1="880" y2="880" x1="1440" />
        <bustap x2="1344" y1="960" y2="960" x1="1440" />
        <bustap x2="1344" y1="1056" y2="1056" x1="1440" />
        <bustap x2="1344" y1="1136" y2="1136" x1="1440" />
        <instance x="944" y="1024" name="XLXI_5" orien="R0" />
        <branch name="gnd1">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1216" y="880" type="branch" />
            <wire x2="1008" y1="880" y2="896" x1="1008" />
            <wire x2="1216" y1="880" y2="880" x1="1008" />
            <wire x2="1344" y1="880" y2="880" x1="1216" />
        </branch>
        <branch name="L(6:0)">
            <attrtext style="alignment:SOFT-TVCENTER;fontsize:28;fontname:Arial" attrname="Name" x="2080" y="432" type="branch" />
            <wire x2="2080" y1="160" y2="240" x1="2080" />
            <wire x2="2080" y1="240" y2="304" x1="2080" />
            <wire x2="2080" y1="304" y2="368" x1="2080" />
            <wire x2="2080" y1="368" y2="432" x1="2080" />
            <wire x2="2080" y1="432" y2="448" x1="2080" />
            <wire x2="2080" y1="448" y2="496" x1="2080" />
            <wire x2="2080" y1="496" y2="560" x1="2080" />
            <wire x2="2080" y1="560" y2="624" x1="2080" />
            <wire x2="2272" y1="160" y2="160" x1="2080" />
            <wire x2="2272" y1="160" y2="272" x1="2272" />
            <wire x2="2464" y1="272" y2="272" x1="2272" />
        </branch>
        <branch name="ML(6:0)">
            <attrtext style="alignment:SOFT-TVCENTER;fontsize:28;fontname:Arial" attrname="Name" x="2064" y="944" type="branch" />
            <wire x2="2064" y1="752" y2="848" x1="2064" />
            <wire x2="2064" y1="848" y2="896" x1="2064" />
            <wire x2="2064" y1="896" y2="944" x1="2064" />
            <wire x2="2064" y1="944" y2="960" x1="2064" />
            <wire x2="2064" y1="960" y2="1024" x1="2064" />
            <wire x2="2064" y1="1024" y2="1088" x1="2064" />
            <wire x2="2064" y1="1088" y2="1136" x1="2064" />
            <wire x2="2064" y1="1136" y2="1216" x1="2064" />
            <wire x2="2256" y1="752" y2="752" x1="2064" />
            <wire x2="2256" y1="336" y2="752" x1="2256" />
            <wire x2="2464" y1="336" y2="336" x1="2256" />
        </branch>
        <branch name="MR(6:0)">
            <attrtext style="alignment:SOFT-TVCENTER;fontsize:28;fontname:Arial" attrname="Name" x="2080" y="1568" type="branch" />
            <wire x2="2080" y1="1376" y2="1392" x1="2080" />
            <wire x2="2080" y1="1392" y2="1456" x1="2080" />
            <wire x2="2080" y1="1456" y2="1520" x1="2080" />
            <wire x2="2080" y1="1520" y2="1568" x1="2080" />
            <wire x2="2080" y1="1568" y2="1584" x1="2080" />
            <wire x2="2080" y1="1584" y2="1648" x1="2080" />
            <wire x2="2080" y1="1648" y2="1712" x1="2080" />
            <wire x2="2080" y1="1712" y2="1776" x1="2080" />
            <wire x2="2272" y1="1376" y2="1376" x1="2080" />
            <wire x2="2272" y1="400" y2="1376" x1="2272" />
            <wire x2="2464" y1="400" y2="400" x1="2272" />
        </branch>
        <branch name="R(6:0)">
            <attrtext style="alignment:SOFT-TVCENTER;fontsize:28;fontname:Arial" attrname="Name" x="2080" y="2176" type="branch" />
            <wire x2="2080" y1="1904" y2="1968" x1="2080" />
            <wire x2="2080" y1="1968" y2="2032" x1="2080" />
            <wire x2="2080" y1="2032" y2="2096" x1="2080" />
            <wire x2="2080" y1="2096" y2="2160" x1="2080" />
            <wire x2="2080" y1="2160" y2="2176" x1="2080" />
            <wire x2="2080" y1="2176" y2="2224" x1="2080" />
            <wire x2="2080" y1="2224" y2="2288" x1="2080" />
            <wire x2="2080" y1="2288" y2="2352" x1="2080" />
            <wire x2="2288" y1="1904" y2="1904" x1="2080" />
            <wire x2="2288" y1="464" y2="1904" x1="2288" />
            <wire x2="2464" y1="464" y2="464" x1="2288" />
        </branch>
        <bustap x2="1984" y1="1968" y2="1968" x1="2080" />
        <bustap x2="1984" y1="2032" y2="2032" x1="2080" />
        <bustap x2="1984" y1="2096" y2="2096" x1="2080" />
        <bustap x2="1984" y1="2160" y2="2160" x1="2080" />
        <bustap x2="1984" y1="2224" y2="2224" x1="2080" />
        <bustap x2="1984" y1="2288" y2="2288" x1="2080" />
        <bustap x2="1984" y1="2352" y2="2352" x1="2080" />
        <bustap x2="1984" y1="1392" y2="1392" x1="2080" />
        <bustap x2="1984" y1="1456" y2="1456" x1="2080" />
        <bustap x2="1984" y1="1520" y2="1520" x1="2080" />
        <bustap x2="1984" y1="1584" y2="1584" x1="2080" />
        <bustap x2="1984" y1="1648" y2="1648" x1="2080" />
        <bustap x2="1984" y1="1712" y2="1712" x1="2080" />
        <bustap x2="1984" y1="1776" y2="1776" x1="2080" />
        <bustap x2="1968" y1="848" y2="848" x1="2064" />
        <bustap x2="1968" y1="896" y2="896" x1="2064" />
        <bustap x2="1968" y1="960" y2="960" x1="2064" />
        <bustap x2="1968" y1="1024" y2="1024" x1="2064" />
        <bustap x2="1968" y1="1088" y2="1088" x1="2064" />
        <bustap x2="1968" y1="1136" y2="1136" x1="2064" />
        <bustap x2="1968" y1="1216" y2="1216" x1="2064" />
        <bustap x2="1984" y1="624" y2="624" x1="2080" />
        <bustap x2="1984" y1="560" y2="560" x1="2080" />
        <bustap x2="1984" y1="496" y2="496" x1="2080" />
        <bustap x2="1984" y1="448" y2="448" x1="2080" />
        <bustap x2="1984" y1="368" y2="368" x1="2080" />
        <bustap x2="1984" y1="304" y2="304" x1="2080" />
        <bustap x2="1984" y1="240" y2="240" x1="2080" />
        <branch name="R(6)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1952" y="1968" type="branch" />
            <wire x2="1952" y1="1968" y2="1968" x1="1936" />
            <wire x2="1984" y1="1968" y2="1968" x1="1952" />
        </branch>
        <branch name="R(5)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1952" y="2032" type="branch" />
            <wire x2="1952" y1="2032" y2="2032" x1="1936" />
            <wire x2="1984" y1="2032" y2="2032" x1="1952" />
        </branch>
        <branch name="R(4)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1952" y="2096" type="branch" />
            <wire x2="1952" y1="2096" y2="2096" x1="1936" />
            <wire x2="1984" y1="2096" y2="2096" x1="1952" />
        </branch>
        <branch name="R(3)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1952" y="2160" type="branch" />
            <wire x2="1952" y1="2160" y2="2160" x1="1936" />
            <wire x2="1984" y1="2160" y2="2160" x1="1952" />
        </branch>
        <branch name="R(2)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1968" y="2224" type="branch" />
            <wire x2="1968" y1="2224" y2="2224" x1="1936" />
            <wire x2="1984" y1="2224" y2="2224" x1="1968" />
        </branch>
        <branch name="R(1)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1968" y="2288" type="branch" />
            <wire x2="1968" y1="2288" y2="2288" x1="1936" />
            <wire x2="1984" y1="2288" y2="2288" x1="1968" />
        </branch>
        <branch name="R(0)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1952" y="2352" type="branch" />
            <wire x2="1952" y1="2352" y2="2352" x1="1936" />
            <wire x2="1984" y1="2352" y2="2352" x1="1952" />
        </branch>
        <branch name="MR(6)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1904" y="1392" type="branch" />
            <wire x2="1904" y1="1392" y2="1392" x1="1856" />
            <wire x2="1984" y1="1392" y2="1392" x1="1904" />
        </branch>
        <branch name="MR(5)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1920" y="1456" type="branch" />
            <wire x2="1920" y1="1456" y2="1456" x1="1856" />
            <wire x2="1984" y1="1456" y2="1456" x1="1920" />
        </branch>
        <branch name="MR(4)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1920" y="1520" type="branch" />
            <wire x2="1920" y1="1520" y2="1520" x1="1856" />
            <wire x2="1984" y1="1520" y2="1520" x1="1920" />
        </branch>
        <branch name="MR(3)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1888" y="1584" type="branch" />
            <wire x2="1888" y1="1584" y2="1584" x1="1856" />
            <wire x2="1984" y1="1584" y2="1584" x1="1888" />
        </branch>
        <branch name="MR(2)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1888" y="1648" type="branch" />
            <wire x2="1888" y1="1648" y2="1648" x1="1856" />
            <wire x2="1984" y1="1648" y2="1648" x1="1888" />
        </branch>
        <branch name="MR(1)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1904" y="1712" type="branch" />
            <wire x2="1904" y1="1712" y2="1712" x1="1856" />
            <wire x2="1984" y1="1712" y2="1712" x1="1904" />
        </branch>
        <branch name="MR(0)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1904" y="1776" type="branch" />
            <wire x2="1904" y1="1776" y2="1776" x1="1856" />
            <wire x2="1984" y1="1776" y2="1776" x1="1904" />
        </branch>
        <branch name="ML(6)">
            <attrtext style="alignment:SOFT-TCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1904" y="848" type="branch" />
            <wire x2="1904" y1="832" y2="832" x1="1856" />
            <wire x2="1904" y1="832" y2="848" x1="1904" />
            <wire x2="1968" y1="848" y2="848" x1="1904" />
        </branch>
        <branch name="ML(5)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1888" y="896" type="branch" />
            <wire x2="1888" y1="896" y2="896" x1="1856" />
            <wire x2="1968" y1="896" y2="896" x1="1888" />
        </branch>
        <branch name="ML(4)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1904" y="960" type="branch" />
            <wire x2="1904" y1="960" y2="960" x1="1856" />
            <wire x2="1968" y1="960" y2="960" x1="1904" />
        </branch>
        <branch name="ML(3)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1904" y="1024" type="branch" />
            <wire x2="1904" y1="1024" y2="1024" x1="1856" />
            <wire x2="1968" y1="1024" y2="1024" x1="1904" />
        </branch>
        <branch name="ML(2)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1904" y="1088" type="branch" />
            <wire x2="1904" y1="1088" y2="1088" x1="1856" />
            <wire x2="1968" y1="1088" y2="1088" x1="1904" />
        </branch>
        <branch name="ML(1)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1904" y="1136" type="branch" />
            <wire x2="1904" y1="1152" y2="1152" x1="1856" />
            <wire x2="1904" y1="1136" y2="1152" x1="1904" />
            <wire x2="1968" y1="1136" y2="1136" x1="1904" />
        </branch>
        <branch name="ML(0)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1904" y="1216" type="branch" />
            <wire x2="1904" y1="1216" y2="1216" x1="1856" />
            <wire x2="1968" y1="1216" y2="1216" x1="1904" />
        </branch>
        <branch name="L(6)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1936" y="240" type="branch" />
            <wire x2="1936" y1="240" y2="240" x1="1904" />
            <wire x2="1984" y1="240" y2="240" x1="1936" />
        </branch>
        <branch name="L(5)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1952" y="304" type="branch" />
            <wire x2="1952" y1="304" y2="304" x1="1904" />
            <wire x2="1984" y1="304" y2="304" x1="1952" />
        </branch>
        <branch name="L(4)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1952" y="368" type="branch" />
            <wire x2="1952" y1="368" y2="368" x1="1904" />
            <wire x2="1984" y1="368" y2="368" x1="1952" />
        </branch>
        <branch name="L(3)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1952" y="448" type="branch" />
            <wire x2="1936" y1="432" y2="432" x1="1904" />
            <wire x2="1936" y1="432" y2="448" x1="1936" />
            <wire x2="1952" y1="448" y2="448" x1="1936" />
            <wire x2="1984" y1="448" y2="448" x1="1952" />
        </branch>
        <branch name="L(2)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1936" y="496" type="branch" />
            <wire x2="1936" y1="496" y2="496" x1="1904" />
            <wire x2="1984" y1="496" y2="496" x1="1936" />
        </branch>
        <branch name="L(1)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1936" y="560" type="branch" />
            <wire x2="1936" y1="560" y2="560" x1="1904" />
            <wire x2="1984" y1="560" y2="560" x1="1936" />
        </branch>
        <branch name="L(0)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="1936" y="624" type="branch" />
            <wire x2="1936" y1="624" y2="624" x1="1904" />
            <wire x2="1984" y1="624" y2="624" x1="1936" />
        </branch>
        <branch name="A(3:0)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="464" y="240" type="branch" />
            <wire x2="464" y1="2032" y2="2032" x1="208" />
            <wire x2="1520" y1="240" y2="240" x1="464" />
            <wire x2="464" y1="240" y2="2016" x1="464" />
            <wire x2="464" y1="2016" y2="2032" x1="464" />
            <wire x2="672" y1="2016" y2="2016" x1="464" />
            <wire x2="672" y1="2016" y2="2176" x1="672" />
            <wire x2="752" y1="2176" y2="2176" x1="672" />
        </branch>
        <iomarker fontsize="28" x="208" y="2032" name="A(3:0)" orien="R180" />
        <iomarker fontsize="28" x="208" y="2160" name="B(3:0)" orien="R180" />
        <instance x="752" y="2464" name="XLXI_6" orien="R0">
        </instance>
        <branch name="B(3:0)">
            <attrtext style="alignment:SOFT-BCENTER;fontsize:28;fontname:Arial" attrname="Name" x="608" y="1392" type="branch" />
            <wire x2="608" y1="2160" y2="2160" x1="208" />
            <wire x2="608" y1="2160" y2="2240" x1="608" />
            <wire x2="752" y1="2240" y2="2240" x1="608" />
            <wire x2="608" y1="1392" y2="2160" x1="608" />
            <wire x2="1472" y1="1392" y2="1392" x1="608" />
        </branch>
        <branch name="M">
            <wire x2="224" y1="2304" y2="2304" x1="48" />
            <wire x2="752" y1="2304" y2="2304" x1="224" />
            <wire x2="224" y1="2080" y2="2304" x1="224" />
            <wire x2="1072" y1="2080" y2="2080" x1="224" />
            <wire x2="1344" y1="960" y2="960" x1="1072" />
            <wire x2="1072" y1="960" y2="2080" x1="1072" />
        </branch>
        <branch name="S1">
            <wire x2="272" y1="2368" y2="2368" x1="48" />
            <wire x2="752" y1="2368" y2="2368" x1="272" />
            <wire x2="1344" y1="1056" y2="1056" x1="272" />
            <wire x2="272" y1="1056" y2="2368" x1="272" />
        </branch>
        <branch name="S0">
            <wire x2="400" y1="2432" y2="2432" x1="48" />
            <wire x2="752" y1="2432" y2="2432" x1="400" />
            <wire x2="1344" y1="1136" y2="1136" x1="400" />
            <wire x2="400" y1="1136" y2="2432" x1="400" />
        </branch>
        <branch name="c_out">
            <wire x2="1216" y1="2576" y2="2576" x1="960" />
            <wire x2="1216" y1="2176" y2="2176" x1="1136" />
            <wire x2="1216" y1="2176" y2="2576" x1="1216" />
        </branch>
        <branch name="F(3:0)">
            <wire x2="1344" y1="2432" y2="2432" x1="1136" />
            <wire x2="1344" y1="2432" y2="2480" x1="1344" />
            <wire x2="1344" y1="2480" y2="2544" x1="1344" />
            <wire x2="1344" y1="2544" y2="2592" x1="1344" />
            <wire x2="1344" y1="2592" y2="2640" x1="1344" />
            <wire x2="1344" y1="1968" y2="2432" x1="1344" />
            <wire x2="1552" y1="1968" y2="1968" x1="1344" />
        </branch>
        <iomarker fontsize="28" x="960" y="2576" name="c_out" orien="R180" />
        <iomarker fontsize="28" x="48" y="2304" name="M" orien="R180" />
        <iomarker fontsize="28" x="48" y="2368" name="S1" orien="R180" />
        <iomarker fontsize="28" x="48" y="2432" name="S0" orien="R180" />
        <iomarker fontsize="28" x="1344" y="2640" name="F(3:0)" orien="R90" />
        <instance x="2464" y="496" name="XLXI_7" orien="R0">
        </instance>
        <branch name="CLK">
            <wire x2="2448" y1="208" y2="208" x1="2368" />
            <wire x2="2464" y1="208" y2="208" x1="2448" />
        </branch>
        <branch name="SS(6:0)">
            <wire x2="3152" y1="208" y2="208" x1="2896" />
        </branch>
        <branch name="EN_L">
            <wire x2="3184" y1="272" y2="272" x1="2896" />
        </branch>
        <branch name="EN_ML">
            <wire x2="3152" y1="336" y2="336" x1="2896" />
        </branch>
        <branch name="EN_R">
            <wire x2="3152" y1="464" y2="464" x1="2896" />
        </branch>
        <iomarker fontsize="28" x="3152" y="208" name="SS(6:0)" orien="R0" />
        <iomarker fontsize="28" x="3184" y="272" name="EN_L" orien="R0" />
        <iomarker fontsize="28" x="3152" y="336" name="EN_ML" orien="R0" />
        <iomarker fontsize="28" x="3152" y="464" name="EN_R" orien="R0" />
        <iomarker fontsize="28" x="2368" y="208" name="CLK" orien="R180" />
        <branch name="EN_MR">
            <wire x2="3232" y1="400" y2="400" x1="2896" />
        </branch>
        <iomarker fontsize="28" x="3232" y="400" name="EN_MR" orien="R0" />
    </sheet>
</drawing>

extension: sch


text:
package main

import (
	"errors"
	"fmt"
	"os"
	"time"

	"github.com/getsentry/sentry-go"
)

const flushDuration time.Duration = 2 * time.Second
const sentryDSN string = "https://62fa8ecced0f4e97a96049c056b5d611@sentry.io/1766414"

func main() {
	sentry.Init(sentry.ClientOptions{
		Dsn: sentryDSN,
	})

	eventID := sentry.CaptureException(errors.New("ExampleError"))
	fmt.Printf("Sentry Event ID %v\n", eventID)
	sentry.Flush(flushDuration)

	fmt.Println("Error should be reported")

	time.Sleep(flushDuration)
	os.Exit(0)
}


text:
package service

import (
	"strings"
	"time"

	"github.com/aliyun/aliyun-oss-go-sdk/oss"
	"github.com/goecology/egoshop/appgo/apps/shopadmin/pkg/mus"
	"github.com/goecology/egoshop/appgo/model/constx"
	"github.com/satori/uuid"
	"github.com/spf13/viper"
	"go.uber.org/zap"
)

var Oss *alioss

type alioss struct {
	*oss.Client
	buckets map[string]*bucket
}

type bucket struct {
	*oss.Bucket
}

const ()

// https://help.aliyun.com/document_detail/31857.html
// https://github.com/aliyun/aliyun-oss-go-sdk/blob/master/README-CN.md
func InitOssCli() {
	c, e := oss.New(
		viper.GetString("oss.endpoint"),
		viper.GetString("oss.accessKeyID"),
		viper.GetString("oss.accessKeySecret"),
	)
	if e != nil {
		mus.Logger.Warn("oss fail", zap.Error(e))
		return
	}
	Oss = &alioss{
		Client:  c,
		buckets: make(map[string]*bucket),
	}

	Oss.newBucket(viper.GetString("oss.bucket"), viper.GetString("oss.bucket")) // 公共读，通过bucketUrl访问ojb，无过期时间
}

func (o *alioss) newBucket(name string, bucketName string) {
	b, e := Oss.Bucket(bucketName)
	if e != nil {
		mus.Logger.Warn("oss fail", zap.Error(e))
		return
	}
	o.buckets[name] = &bucket{b}
}

func (o *alioss) Buckets() []oss.BucketProperties {
	lsRes, e := Oss.ListBuckets()
	if e != nil {
		mus.Logger.Warn("oss fail", zap.Error(e))
		return nil
	}
	return lsRes.Buckets
}

// Buck 返回bucket，pubr为true则返回公共读bucket，否原则返回私有读写bucket
func (o *alioss) Buck(bucketName string) *bucket {
	return Oss.buckets[bucketName]
}

// PutObj 使用pri bucket上传对象
func (o *alioss) PutObj(bucketName string, key string, filePath string) error {
	return o.Buck(bucketName).PutObjectFromFile(key, filePath)
}

func (b *bucket) PutObj(key string, filePath string) error {
	return b.PutObjectFromFile(key, filePath)
}

// GetObj 使用pri bucket直接返回对象
func (o *alioss) GetObj(bucketName string, key string, filePath string) error {
	return o.Buck(bucketName).GetObjectToFile(key, filePath)
}

func (b *bucket) GetObj(key string, filePath string) error {
	return b.GetObjectToFile(key, filePath)
}

func (o *alioss) GetObjURL(bucketName string, key string) (string, error) {
	return o.Buck(bucketName).GetObjURL(key)
}

// GetObjURL 使用pri bucket返回对象url
func (o *alioss) GetObjURLBySign(bucketName string, key string) (string, error) {
	return o.Buck(bucketName).SignURL(key, oss.HTTPGet, 120)
}

func (b *bucket) GetObjURL(key string) (string, error) {
	return b.SignURL(key, oss.HTTPGet, 120)
}

func (o *alioss) OssPrefix(ossType int) string {
	resp, _ := constx.OssMap[ossType]
	return resp
}

// Key 随机生成一个key
func (o *alioss) Key(prefix string) string {
	month := time.Now().Format("200601")
	// Reossv2上传报错：Thespecifiedobjectisnotvalid.
	//	object路径开头不能与“/”
	return prefix + "/" + month + "/" + strings.ReplaceAll(uuid.NewV4().String(), "-", "") + ".jpg"
}

repository: SysenShang/egoshop

repo_name: SysenShang/egoshop


text:
package grpc

import (
	"context"
	"fmt"
	"net"
	"sync"
	"time"

	stat "github.com/Haba1234/sysmon/internal/grpc/api"
	"github.com/Haba1234/sysmon/internal/sysmon"
	"google.golang.org/grpc"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)

//go:generate protoc -I ./api Service.proto --go_out=. --go-grpc_out=.

// Server структура сервера.
type Server struct {
	mu *sync.Mutex
	stat.UnimplementedStatisticsServer
	srv       *grpc.Server
	logg      sysmon.Logger
	collector sysmon.Collector
	bufSize   int
	maxPeriod time.Duration
}

const twoMin = 120

// NewServer конструктор.
func NewServer(logg sysmon.Logger, collector sysmon.Collector, bufSize int) *Server {
	return &Server{
		mu:        &sync.Mutex{},
		logg:      logg,
		bufSize:   bufSize,
		collector: collector,
		maxPeriod: time.Duration(twoMin) * time.Second,
	}
}

// Start запуск сервера gRPC.
func (s *Server) Start(ctx context.Context, addr string) error {
	s.logg.Info("gRPC server " + addr + " running...")
	lsn, err := net.Listen("tcp", addr)
	if err != nil {
		return err
	}

	s.mu.Lock()
	s.srv = grpc.NewServer(grpc.StreamInterceptor(loggingServerInterceptor(s.logg)))
	s.mu.Unlock()
	stat.RegisterStatisticsServer(s.srv, s)

	if err := s.srv.Serve(lsn); err != nil {
		return err
	}

	return nil
}

func loggingServerInterceptor(logg sysmon.Logger) grpc.StreamServerInterceptor {
	return func(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
		logg.Info(fmt.Sprintf("method: %s, duration: %s, request: %+v", info.FullMethod, time.Since(time.Now()), srv))
		return handler(srv, ss)
	}
}

// Stop останов сервера gRPC.
func (s *Server) Stop(ctx context.Context) error {
	s.logg.Info("gRPC server stopped")
	s.mu.Lock()
	defer s.mu.Unlock()
	s.srv.GracefulStop()
	return nil
}

// ListStatistics стримминг данных клиенту.
func (s *Server) ListStatistics(req *stat.SubscriptionRequest, stream stat.Statistics_ListStatisticsServer) error {
	n := req.GetPeriod().AsDuration()
	m := int(req.GetDepth())
	buf := time.Duration(s.bufSize) * time.Second
	s.logg.Debug(fmt.Sprintf("client connected - period: %v, depth: %vs, buf: %v", n, m, buf), "grpc")

	if n <= 0 {
		return status.Error(
			codes.InvalidArgument,
			"period must be greater than 0 sec",
		)
	}
	if n > s.maxPeriod {
		return status.Error(
			codes.InvalidArgument,
			fmt.Sprintf("period must be less than %v sec", s.maxPeriod),
		)
	}
	if m <= 0 {
		return status.Error(
			codes.InvalidArgument,
			"depth must be greater than 0 sec",
		)
	}
	if m > s.bufSize {
		return status.Error(
			codes.InvalidArgument,
			fmt.Sprintf("depth must be less than %v sec", s.bufSize),
		)
	}

	ticker := time.NewTicker(n)
	for {
		select {
		case <-stream.Context().Done():
			s.logg.Info("gRPC client stopped")
			ticker.Stop()
			return nil
		case <-ticker.C:
			statusServices := s.collector.GetStatusServices()
			if statusServices.La.StatusCode != sysmon.ServiceRun && statusServices.CPU.StatusCode != sysmon.ServiceRun {
				// Нет ни одного запущенного сервиса!
				return status.Error(
					codes.Aborted,
					"all services are stopped",
				)
			}
			if statusServices.La.Counter < m && statusServices.CPU.Counter < m {
				// Данные еще не готовы для отправки
				break
			}
			if err := stream.Send(s.getStatistics(m)); err != nil {
				return err
			}
		}
	}
}

func (s *Server) getStatistics(m int) *stat.StatisticsResponse {
	stats := &stat.StatisticsResponse{
		Status: "OK",
	}
	result := s.collector.GetStats(m)

	stats.La = &stat.LoadAverage{
		Status:     statusCodeToStr(result.La.StatusCode),
		OneMin:     result.La.Data[0],
		FiveMin:    result.La.Data[1],
		FifteenMin: result.La.Data[2],
	}
	stats.Cp = &stat.CPUAverage{
		Status: statusCodeToStr(result.CPU.StatusCode),
		User:   result.CPU.Data[0],
		Sys:    result.CPU.Data[1],
		Idle:   result.CPU.Data[2],
	}
	return stats
}

func statusCodeToStr(code int) string {
	switch code {
	case 1:
		return "works"
	case 2:
		return "stopped"
	case 3:
		return "stopped with errors"
	default:
		return "unknown"
	}
}


text:
PR = "r1"
require u-boot.inc

DEFAULT_PREFERENCE = "-1"
DEFAULT_PREFERENCE_lite5200 = "1"
DEFAULT_PREFERENCE_tqm8540 = "1"

SRC_URI = "ftp://ftp.denx.de/pub/u-boot/u-boot-${PV}.tar.bz2 "

TARGET_LDFLAGS = ""

inherit base

do_compile () {
       oe_runmake ${UBOOT_MACHINE}
       oe_runmake all
}

SRC_URI[md5sum] = "cd42bc64b6edafa6930ce299a144503e"
SRC_URI[sha256sum] = "790ccb12d99fc527a8b8d20dfdf491795d30f87aa0902f8cbda196583aa20bc8"