text:
.3" layer="21"/>
<wire x1="-1.27" y1="13.335" x2="-0.635" y2="13.97" width="0.3" layer="21"/>
<wire x1="-0.635" y1="13.97" x2="0.635" y2="13.97" width="0.3" layer="21"/>
<wire x1="0.635" y1="13.97" x2="1.27" y2="13.335" width="0.3" layer="21"/>
<wire x1="-1.27" y1="12.065" x2="-0.635" y2="11.43" width="0.3" layer="21"/>
<wire x1="0.635" y1="11.43" x2="1.27" y2="12.065" width="0.3" layer="21"/>
<wire x1="1.27" y1="13.335" x2="1.27" y2="12.065" width="0.3" layer="21"/>
<text x="3.81" y="-1.27" size="2" layer="21" font="vector" ratio="13" rot="R90">>VALUE</text>
</package>
<package name="R1">
<description>0207_STEHEND_MET</description>
<pad name="1" x="0" y="0" drill="0.8" diameter="1.8" shape="octagon" rot="R180"/>
<pad name="2" x="-2.54" y="0" drill="0.8" diameter="1.8" shape="octagon" rot="R180"/>
<circle x="0" y="0" radius="1.15" width="0.15" layer="21"/>
<text x="1.582" y="-0.81" size="2" layer="21" font="vector" ratio="13">>NAME</text>
</package>
<package name="R4">
<description>0204</description>
<pad name="1" x="0" y="0" drill="0.8" diameter="1.8" shape="octagon"/>
<pad name="2" x="2.54" y="0" drill="0.8" diameter="1.8" shape="octagon"/>
<circle x="0" y="0" radius="1.15" width="0.15" layer="21"/>
<text x="4.468" y="-0.888" size="2" layer="21" font="vector" ratio="13">>NAME</text>
</package>
<package name="K16">
<description>1X01</description>
<pad name="1" x="0" y="0" drill="0.8" diameter="1.8" shape="octagon"/>
<wire x1="-0.635" y1="1.27" x2="0.635" y2="1.27" width="0.3" layer="21"/>
<wire x1="0.635" y1="1.27" x2="1.27" y2="0.635" width="0.3" layer="21"/>
<wire x1="1.27" y1="0.635" x2="1.27" y2="-0.635" width="0.3" layer="21"/>
<wire x1="1.27" y1="-0.635" x2="0.635" y2="-1.27" width="0.3" layer="21"/>
<wire x1="-1.27" y1="0.635" x2="-1.27" y2="-0.635" width="0.3" layer="21"/>
<wire x1="-0.635" y1="1.27" x2="-1.27" y2="0.635" width="0.3" layer="21"/>
<wire x1="-1.27" y1="-0.635" x2="-0.635" y2="-1.27" width="0.3" layer="21"/>
<wire x1="0.635" y1="-1.27" x2="-0.635" y2="-1.27" width="0.3" layer="21"/>
<text x="-1.905" y="-3.81" size="0.8" layer="21" font="vector" ratio="13">>VALUE</text>
</package>
<package name="K18">
<description>1X01</description>
<pad name="1" x="0" y="0" drill="0.8" diameter="1.8" shape="octagon"/>
<wire x1="-0.635" y1="1.27" x2="0.635" y2="1.27" width="0.3" layer="21"/>
<wire x1="0.635" y1="1.27" x2="1.27" y2="0.635" width="0.3" layer="21"/>
<wire x1="1.27" y1="0.635" x2="1.27" y2="-0.635" width="0.3" layer="21"/>
<wire x1="1.27" y1="-0.635" x2="0.635" y2="-1.27" width="0.3" layer="21"/>
<wire x1="-1.27" y1="0.635" x2="-1.27" y2="-0.635" width="0.3" layer="21"/>
<wire x1="-0.635" y1="1.27" x2="-1.27" y2="0.635" width="0.3" layer="21"/>
<wire x1="-1.27" y1="-0.635" x2="-0.635" y2="-1.27" width="0.3" layer="21"/>
<wire x1="0.635" y1="-1.27" x2="-0.635" y2="-1.27" width="0.3" layer="21"/>
<text x="-1.905" y="-3.81" size="0.8" layer="21" font="vector" ratio="13">>VALUE</text>
</package>
<package name="R5">
<description>0204</description>
<pad name="1" x="0" y="0" drill="0.8" diameter="1.8" shape="octagon" rot="R180"/>
<pad name="2" x="-2.54" y="0" drill="0.8" diameter="1.8" shape="octagon" rot="R180"/>
<circle x="0" y="0" radius="0.85" width="0.15" layer="21"/>
<text x="1.839" y="-1.037" size="2" layer="21" font="vector" ratio="13">>NAME</text>
<text x="-1.18" y="1.81" size="2" layer="21" font="vector" ratio="13">>VALUE</text>
</package>
<package name="R3">
<description>0207_STEHEND_MET</description>
<pad name="1" x="0" y="0" drill="0.8" diameter="1.8" shape="octagon" rot="R90"/>
<pad name="2" x="0" y="2.54" drill="0.8" diameter="1.8" shape="octagon" rot="R90"/>
<circle x="0" y="0" radius="1.15" width="0.15" layer="21"/>
<text x="1.578" y="0.458" size="2" layer="21" font="vector" ratio="13">>NAME</text>
</package>
</packages>
</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-Regeln

Die Standard-Design-Regeln 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-Regeln unter
einem neuen Namen ab.
</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="8mil"/>
<param name="mdWirePad" value="8mil"/>
<param name="mdWireVia" value="8mil"/>
<param name="mdPadPad" value="8mil"/>
<param name="mdPadVia" value="8mil"/>
<param name="mdViaVia" value="8mil"/>
<param name="mdSmdPad" value="8mil"/>
<param name="mdSmdVia" value="8mil"/>
<param name="mdSmdSmd" value="8mil"/>
<param name="mdViaViaSameLayer" value="8mil"/>
<param name="mnLayersViaInSmd" value="2"/>
<param name="mdCopperDimension" value="40mil"/>
<param name="mdDrill" value="8mil"/>
<param name="mdSmdStop" value="0mil"/>
<param name="msWidth" value="10mil"/>
<param name="msDrill" value="0.6mm"/>
<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="checkGrid" value="0"/>
<param name="checkAngle" value="0"/>
<param name="checkFont" value="1"/>
<param name="checkRestrict" value="1"/>
<param name="useDiameter" value="13"/>
<param name="maxErrors" value="999999"/>
</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="|"/>
<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="-"/>
<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="IC1" library="open-V2" package="IC1" value="ATTINY84" x="40.993" y="9.403"/>
<element name="C1" library="open-V2" package="C1" value="100nF" x="52.948" y="9.503"/>
<element name="S1" library="open-V2" package="S1" value="Vib" x="74.448" y="7.681" smashed="yes">
<attribute name="NAME" x="74.083" y="10.885" size="2" layer="21" font="vector" ratio="13"/>
</element>
<element name="K2" library="open-V2" package="K2" value=" " x="80.393" y="14.288"/>
<element name="K1" library="open-V2" package="K1" value=" " x="80.342" y="1.774"/>
<element name="R2" library="open-V2" package="R2" value="2M" x="70.135" y="11.748"/>
<element name="K3" library="open-V2" package="K3" value="K2X03" x="83.095" y="5.368"/>
<element name="R9" library="open-V2" package="R9" value="10K" x="29.919" y="13.696"/>
<element name="DISPLAY1" library="open-V2" package="DISPLAY1" value="TDSR1060 I" x="61.978" y="7.876" smashed="yes">
<attribute name="NAME" x="54.808" y="7.076" size="2" layer="21" font="vector" ratio="13"/>
</element>
<element name="K5" library="open-V2" package="K5" value=" " x="74.305" y="14.288"/>
<element name="K4" library="open-V2" package="K4" value=" " x="14.353" y="1.526"/>
<element name="K6" library="open-V2" package="K6" value=" " x="16.893" y="1.526"/>
<element name="K7" library="open-V2" package="K7" value=" " x="19.433" y="1.526"/>
<element name="K8" library="open-V2" package="K8" value=" " x="21.973" y="1.526"/>
<element name="K9" library="open-V2" package="K9" value=" " x="24.513" y="1.526"/>
<element name="K10" library="open-V2" package="K10" value=" " x="27.053" y="1.526"/>
<element name="K11" library="open-V2" package="K11" value=" " x="1.653" y="1.526"/>
<element name="K12" library="open-V2" package="K12" value=" " x="11.813" y="1.526"/>
<element name="K13" library="open-V2" package="K13" value=" " x="9.273" y="1.526"/>
<element name="K14" library="open-V2" package="K14" value=" " x="4.193" y="1.526"/>
<element name="K15" library="open-V2" package="K15" value=" " x="6.733" y="1.526"/>
<element name="R1" library="open-V2" package="R1" value="330" x="51.159" y="2.376"/>
<element name="R4" library="open-V2" package="R4" value="0" x="51.864" y="14.134"/>
<element name="K16" library="open-V2" package="K16" value=" " x="83.078" y="1.774"/>
<element name="K18" library="open-V2" package="K18" value=" " x="83.057" y="14.288"/>
<element name="R5" library="open-V2" package="R5" value="0" x="34.613" y="2.484"/>
<element name="R3" library="open-V2" package="R3" value="0" x="69.977" y="1.669"/>
</elements>
<signals>
<signal name="GND">
<contactref element="R1" pad="2"/>
<contactref element="IC1" pad="14"/>
<contactref element="C1" pad="1"/>
<contactref element="R3" pad="1"/>
<contactref element="K3" pad="6"/>
<contactref element="K1" pad="1"/>
<contactref element="K16" pad="1"/>
<contactref element="K13" pad="2"/>
<contactref element="K13" pad="3"/>
<wire x1="10.379" y1="0.4" x2="10.379" y2="4.066" width="0.3" layer="16"/>
<wire x1="10.379" y1="4.066" x2="9.273" y2="4.066" width="0.3" layer="16"/>
<wire x1="9.273" y1="6.606" x2="9.273" y2="4.066" width="0.3" layer="16"/>
<wire x1="48.646" y1="0.4" x2="48.619" y2="0.4" width="0.3" layer="16"/>
<wire x1="52.869" y1="8.246" x2="48.613" y2="8.246" width="0.3" layer="16"/>
<wire x1="48.613" y1="8.246" x2="48.613" y2="5.593" width="0.3" layer="16"/>
<wire x1="48.619" y1="5.593" x2="48.619" y2="2.376" width="0.3" layer="16"/>
<wire x1="48.619" y1="5.593" x2="48.613" y2="5.593" width="0.3" layer="16"/>
<wire x1="48.619" y1="2.376" x2="48.619" y2="0.4" width="0.3" layer="16"/>
<wire x1="48.619" y1="0.4" x2="10.379" y2="0.4" width="0.3" layer="16"/>
<wire x1="83.078" y1="1.774" x2="80.342" y2="1.774" width="0.3" layer="16"/>
<wire x1="80.342" y1="1.774" x2="79.182" y2="1.774" width="0.3" layer="16"/>
<wire x1="79.182" y1="1.774" x2="77.808" y2="0.4" width="0.3" layer="16"/>
<wire x1="77.808" y1="0.4" x2="48.646" y2="0.4" width="0.3" layer="16"/>
<wire x1="80.342" y1="1.774" x2="83.078" y2="1.774" width="0.2" layer="1"/>
<wire x1="80.342" y1="1.774" x2="80.342" y2="2.344" width="0.2" layer="1"/>
<wire x1="80.342" y1="2.344" x2="80.342" y2="2.976" width="0.2" layer="1"/>
<wire x1="80.342" y1="2.976" x2="81.643" y2="2.976" width="0.2" layer="1"/>
<wire x1="69.977" y1="1.669" x2="69.977" y2="2.344" width="0.2" layer="1"/>
<wire x1="69.977" y1="2.344" x2="80.342" y2="2.344" width="0.2" layer="1"/>
<wire x1="80.555" y1="10.448" x2="81.643" y2="10.448" width="0.2" layer="1"/>
<wire x1="81.643" y1="10.448" x2="81.643" y2="2.976" width="0.2" layer="1"/>
<wire x1="9.273" y1="4.066" x2="9.273" y2="6.606" width="0.2" layer="1"/>
<wire x1="52.869" y1="8.246" x2="52.948" y2="8.233" width="0" layer="19" extent="16-16"/>
</signal>
<signal name="VCC">
<contactref element="K5" pad="1"/>
<contactref element="R2" pad="2"/>
<contactref element="R9" pad="1"/>
<contactref element="K3" pad="2"/>
<contactref element="C1" pad="2"/>
<contactref element="IC1" pad="1"/>
<wire x1="10.437" y1="15.639" x2="10.437" y2="11.686" width="0.3" layer="1"/>
<wire x1="48.57" y1="15.639" x2="30.775" y2="15.639" width="0.3" layer="1"/>
<wire x1="52.869" y1="10.786" x2="48.57" y2="10.786" width="0.3" layer="1"/>
<wire x1="48.57" y1="10.786" x2="48.57" y2="13.213" width="0.3" layer="1"/>
<wire x1="29.911" y1="13.696" x2="29.919" y2="13.696" width="0.3" layer="1"/>
<wire x1="48.57" y1="13.213" x2="48.57" y2="15.639" width="0.3" layer="1"/>
<wire x1="29.919" y1="13.696" x2="29.919" y2="14.406" width="0.3" layer="1"/>
<wire x1="29.911" y1="13.696" x2="29.911" y2="14.774" width="0.3" layer="1"/>
<wire x1="29.911" y1="14.774" x2="30.775" y2="15.639" width="0.3" layer="1"/>
<wire x1="30.775" y1="15.639" x2="10.437" y2="15.639" width="0.3" layer="1"/>
<wire x1="74.305" y1="14.288" x2="70.135" y2="14.288" width="0.3" layer="1"/>
<wire x1="70.135" y1="14.288" x2="68.784" y2="15.639" width="0.3" layer="1"/>
<wire x1="68.784" y1="15.639" x2="48.57" y2="15.639" width="0.3" layer="1"/>
<wire x1="80.555" y1="5.368" x2="77.743" y2="5.368" width="0.2" layer="16"/>
<wire x1="77.743" y1="5.368" x2="77.343" y2="5.768" width="0.2" layer="16"/>
<wire x1="77.343" y1="5.768" x2="77.343" y2="11.25" width="0.2" layer="16"/>
<wire x1="77.343" y1="11.25" x2="74.305" y2="14.288" width="0.2" layer="16"/>
<wire x1="70.135" y1="14.288" x2="74.305" y2="14.288" width="0.2" layer="16"/>
<contactref element="K13" pad="5"/>
<contactref element="K13" pad="4"/>
<wire x1="9.273" y1="11.686" x2="9.273" y2="9.146" width="0.3" layer="1"/>
<wire x1="9.273" y1="11.686" x2="9.273" y2="9.146" width="0.2" layer="16"/>
<wire x1="52.869" y1="10.786" x2="52.948" y2="10.773" width="0" layer="19" extent="1-1"/>
<wire x1="9.273" y1="11.686" x2="10.437" y2="11.686" width="0" layer="19" extent="1-1"/>
</signal>
<signal name="PA7">
<contactref element="R4" pad="1"/>
<contactref element="IC1" pad="6"/>
<contactref element="K10" pad="6"/>
<wire x1="51.864" y1="14.134" x2="50.585" y2="14.134" width="0.2" layer="16"/>
<wire x1="50.585" y1="14.134" x2="49.943" y2="14.776" width="0.2" layer="16"/>
<wire x1="49.943" y1="14.776" x2="35.913" y2="14.776" width="0.2" layer="16"/>
<wire x1="35.913" y1="14.776" x2="35.913" y2="13.213" width="0.2" layer="16"/>
<wire x1="27.053" y1="14.226" x2="28.143" y2="14.226" width="0.2" layer="1"/>
<wire x1="28.143" y1="14.226" x2="28.143" y2="12.776" width="0.2" layer="1"/>
<wire x1="28.143" y1="12.776" x2="28.543" y2="12.376" width="0.2" layer="1"/>
<wire x1="28.543" y1="12.376" x2="31.243" y2="12.376" width="0.2" layer="1"/>
<wire x1="31.243" y1="12.376" x2="31.243" y2="14.376" width="0.2" layer="1"/>
<wire x1="31.243" y1="14.376" x2="31.643" y2="14.776" width="0.2" layer="1"/>
<wire x1="31.643" y1="14.776" x2="33.943" y2="14.776" width="0.2" layer="1"/>
<wire x1="33.943" y1="14.776" x2="34.343" y2="14.376" width="0.2" layer="1"/>
<wire x1="34.343" y1="14.376" x2="34.343" y2="13.676" width="0.2" layer="1"/>
<wire x1="34.343" y1="13.676" x2="34.805" y2="13.213" width="0.2" layer="1"/>
<wire x1="34.805" y1="13.213" x2="35.913" y2="13.213" width="0.2" layer="1"/>
</signal>
<signal name="A">
<contactref element="DISPLAY1" pad="10"/>
<contactref element="IC1" pad="2"/>
<wire x1="46.073" y1="13.213" x2="47.043" y2="13.213" width="0.2" layer="16"/>
<wire x1="47.043" y1="13.213" x2="47.043" y2="11.976" width="0.2" layer="16"/>
<wire x1="47.043" y1="11.976" x2="47.443" y2="11.576" width="0.2" layer="16"/>
<wire x1="47.443" y1="11.576" x2="49.543" y2="11.576" width="0.2" layer="16"/>
<wire x1="49.543" y1="11.576" x2="50.443" y2="12.476" width="0.2" layer="16"/>
<wire x1="50.443" y1="12.476" x2="54.543" y2="12.476" width="0.2" layer="16"/>
<wire x1="54.543" y1="12.476" x2="55.333" y2="11.686" width="0.2" layer="16"/>
<wire x1="55.333" y1="11.686" x2="56.871" y2="11.686" width="0.2" layer="16"/>
</signal>
<signal name="B">
<contactref element="DISPLAY1" pad="9"/>
<contactref element="IC1" pad="3"/>
<wire x1="43.533" y1="13.213" x2="44.543" y2="13.213" width="0.2" layer="16"/>
<wire x1="44.543" y1="13.213" x2="44.543" y2="11.576" width="0.2" layer="16"/>
<wire x1="44.543" y1="11.576" x2="44.943" y2="11.176" width="0.2" layer="16"/>
<wire x1="44.943" y1="11.176" x2="50.043" y2="11.176" width="0.2" layer="16"/>
<wire x1="50.043" y1="11.176" x2="50.943" y2="12.076" width="0.2" layer="16"/>
<wire x1="50.943" y1="12.076" x2="54.143" y2="12.076" width="0.2" layer="16"/>
<wire x1="54.143" y1="12.076" x2="55.743" y2="10.476" width="0.2" layer="16"/>
<wire x1="55.743" y1="10.476" x2="59.411" y2="10.476" width="0.2" layer="16"/>
<wire x1="59.411" y1="10.476" x2="59.411" y2="11.686" width="0.2" layer="16"/>
</signal>
<signal name="3,6V">
<contactref element="K2" pad="1"/>
<contactref element="K5" pad="2"/>
<contactref element="K18" pad="1"/>
<wire x1="83.057" y1="14.288" x2="80.393" y2="14.288" width="0.3" layer="1"/>
<wire x1="80.393" y1="14.288" x2="76.845" y2="14.288" width="0.3" layer="1"/>
</signal>
<signal name="G">
<contactref element="IC1" pad="10"/>
<contactref element="R5" pad="2"/>
<contactref element="K10" pad="3"/>
<wire x1="27.053" y1="6.606" x2="31.643" y2="6.606" width="0.2" layer="1"/>
<wire x1="31.643" y1="6.606" x2="32.073" y2="6.176" width="0.2" layer="1"/>
<wire x1="32.073" y1="6.176" x2="32.073" y2="2.484" width="0.2" layer="1"/>
<wire x1="38.453" y1="5.593" x2="38.453" y2="3.776" width="0.2" layer="16"/>
<wire x1="38.453" y1="3.776" x2="32.073" y2="3.776" width="0.2" layer="16"/>
<wire x1="32.073" y1="3.776" x2="32.073" y2="2.484" width="0.2" layer="16"/>
</signal>
<signal name="C">
<contactref element="DISPLAY1" pad="7"/>
<contactref element="IC1" pad="5"/>
<wire x1="38.453" y1="13.213" x2="39.443" y2="13.213" width="0.2" layer="1"/>
<wire x1="39.443" y1="13.213" x2="39.443" y2="9.876" width="0.2" layer="1"/>
<wire x1="39.443" y1="9.876" x2="39.843" y2="9.476" width="0.2" layer="1"/>
<wire x1="39.843" y1="9.476" x2="64.091" y2="9.476" width="0.2" layer="1"/>
<wire x1="64.091" y1="9.476" x2="64.491" y2="9.876" width="0.2" layer="1"/>
<wire x1="64.491" y1="9.876" x2="64.491" y2="11.686" width="0.2" layer="1"/>
</signal>
<signal name="PA0">
<contactref element="R2" pad="1"/>
<contactref element="K10" pad="2"/>
<contactref element="S1" pad="1"/>
<contactref element="IC1" pad="13"/>
<contactref element="S1" pad="3"/>
<wire x1="69.243" y1="9.476" x2="46.543" y2="9.476" width="0.2" layer="16"/>
<wire x1="46.543" y1="9.476" x2="46.073" y2="9.006" width="0.2" layer="16"/>
<wire x1="46.073" y1="9.006" x2="46.073" y2="5.593" width="0.2" layer="16"/>
<wire x1="27.053" y1="4.066" x2="28.933" y2="4.066" width="0.2" layer="16"/>
<wire x1="28.933" y1="4.066" x2="32.043" y2="7.176" width="0.2" layer="16"/>
<wire x1="32.043" y1="7.176" x2="39.043" y2="7.176" width="0.2" layer="16"/>
<wire x1="39.043" y1="7.176" x2="39.443" y2="6.776" width="0.2" layer="16"/>
<wire x1="39.443" y1="6.776" x2="39.443" y2="4.376" width="0.2" layer="16"/>
<wire x1="39.443" y1="4.376" x2="39.843" y2="3.976" width="0.2" layer="16"/>
<wire x1="39.843" y1="3.976" x2="46.073" y2="3.976" width="0.2" layer="16"/>
<wire x1="46.073" y1="3.976" x2="46.073" y2="5.593" width="0.2" layer="16"/>
<wire x1="75.648" y1="8.831" x2="75.648" y2="11.276" width="0.2" layer="1"/>
<wire x1="75.648" y1="11.276" x2="75.176" y2="11.748" width="0.2" layer="1"/>
<wire x1="75.176" y1="11.748" x2="70.135" y2="11.748" width="0.2" layer="1"/>
<wire x1="73.348" y1="6.531" x2="73.348" y2="6.931" width="0.2" layer="16"/>
<wire x1="73.348" y1="6.931" x2="71.788" y2="6.931" width="0.2" layer="16"/>
<wire x1="71.788" y1="6.931" x2="69.643" y2="9.076" width="0.2" layer="16"/>
<wire x1="69.643" y1="9.076" x2="69.243" y2="9.476" width="0.2" layer="16"/>
<wire x1="69.643" y1="9.076" x2="70.135" y2="9.568" width="0.2" layer="16"/>
<wire x1="70.135" y1="9.568" x2="70.135" y2="11.748" width="0.2" layer="16"/>
</signal>
<signal name="RST">
<contactref element="K3" pad="5"/>
<contactref element="R9" pad="2"/>
<contactref element="IC1" pad="4"/>
<wire x1="83.095" y1="10.448" x2="83.095" y2="12.576" width="0.2" layer="1"/>
<wire x1="83.095" y1="12.576" x2="82.695" y2="12.976" width="0.2" layer="1"/>
<wire x1="82.695" y1="12.976" x2="65.743" y2="12.976" width="0.2" layer="1"/>
<wire x1="65.743" y1="12.976" x2="65.743" y2="7.376" width="0.2" layer="1"/>
<wire x1="65.743" y1="7.376" x2="65.343" y2="6.976" width="0.2" layer="1"/>
<wire x1="65.343" y1="6.976" x2="51.343" y2="6.976" width="0.2" layer="1"/>
<wire x1="51.343" y1="6.976" x2="50.343" y2="7.976" width="0.2" layer="1"/>
<wire x1="50.343" y1="7.976" x2="37.843" y2="7.976" width="0.2" layer="1"/>
<wire x1="37.843" y1="7.976" x2="37.443" y2="8.376" width="0.2" layer="1"/>
<wire x1="37.443" y1="8.376" x2="37.443" y2="14.376" width="0.2" layer="1"/>
<wire x1="37.443" y1="14.376" x2="37.843" y2="14.776" width="0.2" layer="1"/>
<wire x1="37.843" y1="14.776" x2="39.443" y2="14.776" width="0.2" layer="1"/>
<wire x1="39.443" y1="14.776" x2="39.843" y2="14.376" width="0.2" layer="1"/>
<wire x1="39.843" y1="14.376" x2="39.843" y2="13.213" width="0.2" layer="1"/>
<wire x1="39.843" y1="13.213" x2="40.993" y2="13.213" width="0.2" layer="1"/>
<wire x1="29.919" y1="11.156" x2="40.543" y2="11.156" width="0.2" layer="16"/>
<wire x1="40.543" y1="11.156" x2="40.993" y2="11.606" width="0.2" layer="16"/>
<wire x1="40.993" y1="11.606" x2="40.993" y2="13.213" width="0.2" layer="16"/>
</signal>
<signal name="D/MOSI">
<contactref element="DISPLAY1" pad="5"/>
<contactref element="IC1" pad="7"/>
<contactref element="K3" pad="4"/>
<wire x1="33.373" y1="13.213" x2="33.373" y2="12.813" width="0.2" layer="1"/>
<wire x1="33.373" y1="12.813" x2="34.343" y2="12.813" width="0.2" layer="1"/>
<wire x1="34.343" y1="12.813" x2="34.343" y2="7.976" width="0.2" layer="1"/>
<wire x1="34.343" y1="7.976" x2="34.743" y2="7.576" width="0.2" layer="1"/>
<wire x1="34.743" y1="7.576" x2="49.643" y2="7.576" width="0.2" layer="1"/>
<wire x1="49.643" y1="7.576" x2="50.043" y2="7.176" width="0.2" layer="1"/>
<wire x1="50.043" y1="7.176" x2="50.043" y2="6.076" width="0.2" layer="1"/>
<wire x1="50.043" y1="6.076" x2="50.443" y2="5.676" width="0.2" layer="1"/>
<wire x1="50.443" y1="5.676" x2="67.031" y2="5.676" width="0.2" layer="1"/>
<wire x1="67.031" y1="5.676" x2="67.031" y2="4.066" width="0.2" layer="1"/>
<wire x1="80.555" y1="7.908" x2="79.043" y2="7.908" width="0.2" layer="1"/>
<wire x1="79.043" y1="7.908" x2="78.643" y2="7.508" width="0.2" layer="1"/>
<wire x1="78.643" y1="7.508" x2="78.643" y2="3.276" width="0.2" layer="1"/>
<wire x1="78.643" y1="3.276" x2="78.243" y2="2.876" width="0.2" layer="1"/>
<wire x1="78.243" y1="2.876" x2="67.031" y2="2.876" width="0.2" layer="1"/>
<wire x1="67.031" y1="2.876" x2="67.031" y2="4.066" width="0.2" layer="1"/>
</signal>
<signal name="E/MISO">
<contactref element="DISPLAY1" pad="4"/>
<contactref element="K3" pad="1"/>
<contactref element="IC1" pad="8"/>
<wire x1="33.373" y1="5.593" x2="33.373" y2="0.976" width="0.2" layer="1"/>
<wire x1="33.373" y1="0.976" x2="64.043" y2="0.976" width="0.2" layer="1"/>
<wire x1="64.043" y1="0.976" x2="64.491" y2="1.424" width="0.2" layer="1"/>
<wire x1="64.491" y1="1.424" x2="64.491" y2="4.066" width="0.2" layer="1"/>
<wire x1="76.543" y1="4.776" x2="72.743" y2="4.776" width="0.2" layer="16"/>
<wire x1="72.743" y1="4.776" x2="71.243" y2="6.276" width="0.2" layer="16"/>
<wire x1="71.243" y1="6.276" x2="64.943" y2="6.276" width="0.2" layer="16"/>
<wire x1="64.943" y1="6.276" x2="64.491" y2="5.824" width="0.2" layer="16"/>
<wire x1="64.491" y1="5.824" x2="64.491" y2="4.066" width="0.2" layer="16"/>
<wire x1="83.095" y1="5.368" x2="82.043" y2="6.42" width="0.2" layer="1"/>
<wire x1="82.043" y1="6.42" x2="82.043" y2="11.076" width="0.2" layer="1"/>
<wire x1="82.043" y1="11.076" x2="81.643" y2="11.476" width="0.2" layer="1"/>
<wire x1="81.643" y1="11.476" x2="77.843" y2="11.476" width="0.2" layer="1"/>
<wire x1="77.843" y1="11.476" x2="77.443" y2="11.076" width="0.2" layer="1"/>
<wire x1="77.443" y1="11.076" x2="77.443" y2="4.776" width="0.2" layer="1"/>
<wire x1="77.443" y1="4.776" x2="76.543" y2="4.776" width="0.2" layer="1"/>
<wire x1="76.543" y1="4.776" x2="76.543" y2="4.776" width="0" layer="19" extent="1-16"/>
<via x="76.543" y="4.776" extent="1-16" drill="0.6" shape="square"/>
</signal>
<signal name="F/CLK">
<contactref element="DISPLAY1" pad="2"/>
<contactref element="IC1" pad="9"/>
<contactref element="K3" pad="3"/>
<wire x1="83.095" y1="7.908" x2="82.043" y2="7.908" width="0.2" layer="16"/>
<wire x1="82.043" y1="7.908" x2="81.643" y2="7.508" width="0.2" layer="16"/>
<wire x1="81.643" y1="7.508" x2="81.643" y2="3.376" width="0.2" layer="16"/>
<wire x1="81.643" y1="3.376" x2="81.243" y2="2.976" width="0.2" layer="16"/>
<wire x1="81.243" y1="2.976" x2="69.243" y2="2.976" width="0.2" layer="16"/>
<wire x1="69.243" y1="2.976" x2="69.043" y2="2.776" width="0.2" layer="16"/>
<wire x1="69.043" y1="2.776" x2="63.643" y2="2.776" width="0.2" layer="16"/>
<wire x1="63.643" y1="2.776" x2="63.243" y2="3.176" width="0.2" layer="16"/>
<wire x1="63.243" y1="3.176" x2="63.243" y2="4.876" width="0.2" layer="16"/>
<wire x1="63.243" y1="4.876" x2="62.843" y2="5.276" width="0.2" layer="16"/>
<wire x1="62.843" y1="5.276" x2="59.411" y2="5.276" width="0.2" layer="16"/>
<wire x1="59.411" y1="5.276" x2="59.411" y2="4.066" width="0.2" layer="16"/>
<wire x1="35.913" y1="5.593" x2="35.913" y2="7.176" width="0.2" layer="1"/>
<wire x1="35.913" y1="7.176" x2="49.243" y2="7.176" width="0.2" layer="1"/>
<wire x1="49.243" y1="7.176" x2="49.643" y2="6.776" width="0.2" layer="1"/>
<wire x1="49.643" y1="6.776" x2="49.643" y2="5.676" width="0.2" layer="1"/>
<wire x1="49.643" y1="5.676" x2="50.043" y2="5.276" width="0.2" layer="1"/>
<wire x1="50.043" y1="5.276" x2="59.411" y2="5.276" width="0.2" layer="1"/>
<wire x1="59.411" y1="5.276" x2="59.411" y2="4.066" width="0.2" layer="1"/>
</signal>
<signal name="DP">
<contactref element="DISPLAY1" pad="6"/>
<contactref element="R4" pad="2"/>
<wire x1="67.031" y1="11.686" x2="67.031" y2="13.646" width="0.2" layer="16"/>
<wire x1="67.031" y1="13.646" x2="66.543" y2="14.134" width="0.2" layer="16"/>
<wire x1="66.543" y1="14.134" x2="54.404" y2="14.134" width="0.2" layer="16"/>
</signal>
<signal name="PA1">
<contactref element="IC1" pad="12"/>
<contactref element="K10" pad="5"/>
<wire x1="27.053" y1="11.686" x2="28.043" y2="11.686" width="0.2" layer="16"/>
<wire x1="28.043" y1="11.686" x2="28.043" y2="10.276" width="0.2" layer="16"/>
<wire x1="28.043" y1="10.276" x2="28.443" y2="9.876" width="0.2" layer="16"/>
<wire x1="28.443" y1="9.876" x2="43.133" y2="9.876" width="0.2" layer="16"/>
<wire x1="43.133" y1="9.876" x2="43.533" y2="9.476" width="0.2" layer="16"/>
<wire x1="43.533" y1="9.476" x2="43.533" y2="5.593" width="0.2" layer="16"/>
</signal>
<signal name="PA2">
<contactref element="IC1" pad="11"/>
<contactref element="K10" pad="4"/>
<wire x1="27.053" y1="9.146" x2="40.523" y2="9.146" width="0.2" layer="16"/>
<wire x1="40.523" y1="9.146" x2="40.993" y2="8.676" width="0.2" layer="16"/>
<wire x1="40.993" y1="8.676" x2="40.993" y2="5.593" width="0.2" layer="16"/>
</signal>
<signal name="1">
<contactref element="R5" pad="1"/>
<contactref element="DISPLAY1" pad="1"/>
<wire x1="56.871" y1="4.066" x2="56.871" y2="4.043" width="0.2" layer="1"/>
<wire x1="56.871" y1="4.043" x2="34.613" y2="4.043" width="0.2" layer="1"/>
<wire x1="34.613" y1="4.043" x2="34.613" y2="2.484" width="0.2" layer="1"/>
</signal>
<signal name="K">
<contactref element="DISPLAY1" pad="3"/>
<contactref element="R1" pad="1"/>
<wire x1="51.159" y1="2.376" x2="61.951" y2="2.376" width="0.2" layer="16"/>
<wire x1="61.951" y1="2.376" x2="61.951" y2="4.066" width="0.2" layer="16"/>
</signal>
<signal name="SIG$25">
<contactref element="S1" pad="2"/>
<contactref element="R3" pad="2"/>
<contactref element="S1" pad="4"/>
<wire x1="75.648" y1="6.531" x2="75.648" y2="5.176" width="0.2" layer="1"/>
<wire x1="75.648" y1="5.176" x2="72.443" y2="5.176" width="0.2" layer="1"/>
<wire x1="72.443" y1="5.176" x2="72.043" y2="5.176" width="0.2" layer="1"/>
<wire x1="73.348" y1="8.831" x2="72.043" y2="8.831" width="0.2" layer="1"/>
<wire x1="72.043" y1="8.831" x2="72.043" y2="5.176" width="0.2" layer="1"/>
<wire x1="69.977" y1="4.209" x2="71.477" y2="4.209" width="0.2" layer="1"/>
<wire x1="71.477" y1="4.209" x2="72.443" y2="5.176" width="0.2" layer="1"/>
</signal>
</signals>
</board>
</drawing>
</eagle>


text:
package dal

import "os"

var databaseName = os.Getenv("SWITCH_DB_NAME")
var databaseUserName = os.Getenv("SWITCH_DB_USER")
var databasePassword = os.Getenv("SWITCH_DB_PASSWORD")
var databaseHost = os.Getenv("SWITCH_DB_HOST")
var databasePort = os.Getenv("SWITCH_DB_PORT")

license: MIT

repository: Kareem-Emad/switch

license_type: permissive

repo_name: Kareem-Emad/switch

branch_name: refs/heads/master

extension: go


text:
package controllersCharacter

import (
	"strconv"

	"github.com/huydeerpets/tbs/controllers"
	"github.com/huydeerpets/tbs/models"
	"github.com/huydeerpets/tbs/utils/character"
)

// DeleteController Delete - controller
type DeleteController struct {
	controllers.BaseController
}

// DeleteResponse - Delete response
type DeleteResponse struct {
	Image []characters.Image `json:"images"`
}

// Delete DeleteImage
func (c *DeleteController) Delete() {
	userID := c.GetUserID()
	if !c.IsNoLogin(userID) {
		c.ServerLoginNotFound()
		return
	}

	id, err := strconv.Atoi(c.Ctx.Input.Param(":id"))
	if err != nil {
		c.ServerError(err, controllers.ErrParameter, userID)
		return
	}

	tx := models.Begin()

	if err = characters.DeleteByID(id, userID); err != nil {
		models.Rollback(tx)
		c.ServerError(err, controllers.ErrCodeUserNotFound, userID)
		return
	}

	models.Commit(tx)

	image, err := characters.GetImageListByUserID(userID)
	if err != nil {
		c.ServerError(err, controllers.ErrCodeCommon, userID)
		return
	}

	c.Data["json"] = DeleteResponse{
		Image: image,
	}

	c.ServeJSON()
}

repository: huydeerpets/tbs

repo_name: huydeerpets/tbs


text:
DESCRIPTION = "Ultralightweight JSON parser in ANSI C"
HOMEPAGE = "https://github.com/DaveGamble/cJSON"
AUTHOR = "Dave Gamble"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=218947f77e8cb8e2fa02918dc41c50d0"

inherit cmake pkgconfig

PR = "r0"

SRC_URI = "\
    git://github.com/DaveGamble/cJSON.git \
"

SRCREV = "c69134d01746dcf551dd7724b4edb12f922eb0d1"

S = "${WORKDIR}/git"

FILES_${PN}-dev += "\
    ${libdir}/cmake \
"

EXTRA_OECMAKE += "\
    -DENABLE_CUSTOM_COMPILER_FLAGS=OFF \
    -DBUILD_SHARED_AND_STATIC_LIBS=On \
"

repository: dwalkes/meta-iot-cloud

repo_name: dwalkes/meta-iot-cloud

gha_license_id: MIT

extension: bb


text:
package network

import (
	"fmt"
)

// ErrUnknownDriver is the "Unknown driver" error.
var ErrUnknownDriver = fmt.Errorf("Unknown driver")

// ErrNotImplemented is the "Not implemented" error.
var ErrNotImplemented = fmt.Errorf("Not implemented")

repository: lxc/incus

repo_name: lxc/incus

branch_name: refs/heads/main

gha_language: Go


text:
namespace Orleans.Security.IntegrationTests.Configuration
{
    internal static class TestClusterOptions
    {
        public const string ClusterId = nameof(IntegrationTests);

        public const string ServiceId = "Service_1";
    }
}

gha_language: C#

extension: cs


text:
@article{busi2021persistence,
 author = {Busi, Susheel Bhanu and de Nies, Laura and Habier, Janine and Wampach, Linda and Fritz, Joëlle V and Heintz-Buschart, Anna and May, Patrick and Halder, Rashi and de Beaufort, Carine and Wilmes, Paul},
 journal = {ISME Communications},
 number = {1},
 pages = {1--12},
 publisher = {Nature Publishing Group},
 title = {Persistence of birth mode-dependent effects on gut microbiome composition, immune system stimulation and antimicrobial resistance during the first year of life},
 volume = {1},
 year = {2021}
}

extension: bib


text:
get_filename_component(test3_input_file test3/input.txt REALPATH)
read_filelist(test3_output ${test3_input_file})
file(WRITE ${CMAKE_BINARY_DIR}/test3.result "${test3_output}\n")
get_filename_component(test3_expected_file test3/expected.txt.in REALPATH)
configure_file(${test3_expected_file} test3.expected)

add_test(NAME test3
  COMMAND tclsh ${compare_tcl} ${CMAKE_BINARY_DIR}/test3.expected ${CMAKE_BINARY_DIR}/test3.result
  )

extension: cmake


text:
//************************************************************************//
// API "cellar": Models
//
// Generated with goagen v1.0.0, command line:
// $ goagen
// --design=github.com/illyabusigin/goa-cellar/design
// --out=$(GOPATH)/src/github.com/illyabusigin/goa-cellar
// --version=v1.0.0
//
// The content of this file is auto-generated, DO NOT MODIFY
//************************************************************************//

package models

import (
	"github.com/goadesign/goa"
	"github.com/illyabusigin/goa-cellar/app"
	"github.com/jinzhu/gorm"
	"golang.org/x/net/context"
	"time"
)

// Bottle Model
type Bottle struct {
	ID        int `gorm:"primary_key"` // primary key
	AccountID int // Belongs To Account
	Color     string
	Country   *string
	CreatedAt time.Time
	DeletedAt *time.Time
	Name      string
	Rating    int
	Region    *string
	Review    *string
	Sweetness *int
	UpdatedAt time.Time
	Varietal  string
	Vineyard  string
	Vintage   int
	Account   Account
}

// TableName overrides the table name settings in Gorm to force a specific table name
// in the database.
func (m Bottle) TableName() string {
	return "bottles"

}

// BottleDB is the implementation of the storage interface for
// Bottle.
type BottleDB struct {
	Db *gorm.DB
}

// NewBottleDB creates a new storage type.
func NewBottleDB(db *gorm.DB) *BottleDB {
	return &BottleDB{Db: db}
}

// DB returns the underlying database.
func (m *BottleDB) DB() interface{} {
	return m.Db
}

// BottleStorage represents the storage interface.
type BottleStorage interface {
	DB() interface{}
	List(ctx context.Context) ([]*Bottle, error)
	Get(ctx context.Context, id int) (*Bottle, error)
	Add(ctx context.Context, bottle *Bottle) error
	Update(ctx context.Context, bottle *Bottle) error
	Delete(ctx context.Context, id int) error

	ListBottle(ctx context.Context, accountID int) []*app.Bottle
	OneBottle(ctx context.Context, id int, accountID int) (*app.Bottle, error)

	ListBottleFull(ctx context.Context, accountID int) []*app.BottleFull
	OneBottleFull(ctx context.Context, id int, accountID int) (*app.BottleFull, error)

	ListBottleTiny(ctx context.Context, accountID int) []*app.BottleTiny
	OneBottleTiny(ctx context.Context, id int, accountID int) (*app.BottleTiny, error)

	BottleFromCreateBottlePayload(payload *app.CreateBottlePayload) *Bottle
	UpdateFromBottlePayload(ctx context.Context, payload *app.BottlePayload, id int) error
	UpdateFromCreateBottlePayload(ctx context.Context, payload *app.CreateBottlePayload, id int) error
}

// TableName overrides the table name settings in Gorm to force a specific table name
// in the database.
func (m *BottleDB) TableName() string {
	return "bottles"

}

// Belongs To Relationships

// BottleFilterByAccount is a gorm filter for a Belongs To relationship.
func BottleFilterByAccount(accountID int, originaldb *gorm.DB) func(db *gorm.DB) *gorm.DB {
	if accountID > 0 {
		return func(db *gorm.DB) *gorm.DB {
			return db.Where("account_id = ?", accountID)

		}
	}
	return func(db *gorm.DB) *gorm.DB { return db }
}

// CRUD Functions

// Get returns a single Bottle as a Database Model
// This is more for use internally, and probably not what you want in  your controllers
func (m *BottleDB) Get(ctx context.Context, id int) (*Bottle, error) {
	defer goa.MeasureSince([]string{"goa", "db", "bottle", "get"}, time.Now())

	var native Bottle
	err := m.Db.Table(m.TableName()).Where("id = ?", id).Find(&native).Error
	if err == gorm.ErrRecordNotFound {
		return nil, err
	}

	return &native, err
}

// List returns an array of Bottle
func (m *BottleDB) List(ctx context.Context) ([]*Bottle, error) {
	defer goa.MeasureSince([]string{"goa", "db", "bottle", "list"}, time.Now())

	var objs []*Bottle
	err := m.Db.Table(m.TableName()).Find(&objs).Error
	if err != nil && err != gorm.ErrRecordNotFound {
		return nil, err
	}

	return objs, nil
}

// Add creates a new record.
func (m *BottleDB) Add(ctx context.Context, model *Bottle) error {
	defer goa.MeasureSince([]string{"goa", "db", "bottle", "add"}, time.Now())

	err := m.Db.Create(model).Error
	if err != nil {
		goa.LogError(ctx, "error adding Bottle", "error", err.Error())
		return err
	}

	return nil
}

// Update modifies a single record.
func (m *BottleDB) Update(ctx context.Context, model *Bottle) error {
	defer goa.MeasureSince([]string{"goa", "db", "bottle", "update"}, time.Now())

	obj, err := m.Get(ctx, model.ID)
	if err != nil {
		goa.LogError(ctx, "error updating Bottle", "error", err.Error())
		return err
	}
	err = m.Db.Model(obj).Updates(model).Error

	return err
}

// Delete removes a single record.
func (m *BottleDB) Delete(ctx context.Context, id int) error {
	defer goa.MeasureSince([]string{"goa", "db", "bottle", "delete"}, time.Now())

	var obj Bottle

	err := m.Db.Delete(&obj, id).Error

	if err != nil {
		goa.LogError(ctx, "error deleting Bottle", "error", err.Error())
		return err
	}

	return nil
}

// BottleFromBottlePayload Converts source BottlePayload to target Bottle model
// only copying the non-nil fields from the source.
func BottleFromBottlePayload(payload *app.BottlePayload) *Bottle {
	bottle := &Bottle{}
	if payload.Color != nil {
		bottle.Color = *payload.Color
	}
	if payload.Country != nil {
		bottle.Country = payload.Country
	}
	if payload.Name != nil {
		bottle.Name = *payload.Name
	}
	if payload.Rating != nil {
		bottle.Rating = *payload.Rating
	}
	if payload.Region != nil {
		bottle.Region = payload.Region
	}
	if payload.Review != nil {
		bottle.Review = payload.Review
	}
	if payload.Sweetness != nil {
		bottle.Sweetness = payload.Sweetness
	}
	if payload.Varietal != nil {
		bottle.Varietal = *payload.Varietal
	}
	if payload.Vineyard != nil {
		bottle.Vineyard = *payload.Vineyard
	}
	if payload.Vintage != nil {
		bottle.Vintage = *payload.Vintage
	}

	return bottle
}

// UpdateFromBottlePayload applies non-nil changes from BottlePayload to the model and saves it
func (m *BottleDB) UpdateFromBottlePayload(ctx context.Context, payload *app.BottlePayload, id int) error {
	defer goa.MeasureSince([]string{"goa", "db", "bottle", "updatefrombottlePayload"}, time.Now())

	var obj Bottle
	err := m.Db.Table(m.TableName()).Where("id = ?", id).Find(&obj).Error
	if err != nil {
		goa.LogError(ctx, "error retrieving Bottle", "error", err.Error())
		return err
	}
	if payload.Color != nil {
		obj.Color = *payload.Color
	}
	if payload.Country != nil {
		obj.Country = payload.Country
	}
	if payload.Name != nil {
		obj.Name = *payload.Name
	}
	if payload.Rating != nil {
		obj.Rating = *payload.Rating
	}
	if payload.Region != nil {
		obj.Region = payload.Region
	}
	if payload.Review != nil {
		obj.Review = payload.Review
	}
	if payload.Sweetness != nil {
		obj.Sweetness = payload.Sweetness
	}
	if payload.Varietal != nil {
		obj.Varietal = *payload.Varietal
	}
	if payload.Vineyard != nil {
		obj.Vineyard = *payload.Vineyard
	}
	if payload.Vintage != nil {
		obj.Vintage = *payload.Vintage
	}

	err = m.Db.Save(&obj).Error
	return err
}

// BottleFromCreateBottlePayload Converts source CreateBottlePayload to target Bottle model
// only copying the non-nil fields from the source.
func BottleFromCreateBottlePayload(payload *app.CreateBottlePayload) *Bottle {
	bottle := &Bottle{}
	bottle.Color = payload.Color
	if payload.Country != nil {
		bottle.Country = payload.Country
	}
	bottle.Name = payload.Name
	if payload.Rating != nil {
		bottle.Rating = *payload.Rating
	}
	if payload.Region != nil {
		bottle.Region = payload.Region
	}
	if payload.Review != nil {
		bottle.Review = payload.Review
	}
	if payload.Sweetness != nil {
		bottle.Sweetness = payload.Sweetness
	}
	bottle.Varietal = payload.Varietal
	bottle.Vineyard = payload.Vineyard
	bottle.Vintage = payload.Vintage

	return bottle
}

// UpdateFromCreateBottlePayload applies non-nil changes from CreateBottlePayload to the model and saves it
func (m *BottleDB) UpdateFromCreateBottlePayload(ctx context.Context, payload *app.CreateBottlePayload, id int) error {
	defer goa.MeasureSince([]string{"goa", "db", "bottle", "updatefromcreateBottlePayload"}, time.Now())

	var obj Bottle
	err := m.Db.Table(m.TableName()).Where("id = ?", id).Find(&obj).Error
	if err != nil {
		goa.LogError(ctx, "error retrieving Bottle", "error", err.Error())
		return err
	}
	obj.Color = payload.Color
	if payload.Country != nil {
		obj.Country = payload.Country
	}
	obj.Name = payload.Name
	if payload.Rating != nil {
		obj.Rating = *payload.Rating
	}
	if payload.Region != nil {
		obj.Region = payload.Region
	}
	if payload.Review != nil {
		obj.Review = payload.Review
	}
	if payload.Sweetness != nil {
		obj.Sweetness = payload.Sweetness
	}
	obj.Varietal = payload.Varietal
	obj.Vineyard = payload.Vineyard
	obj.Vintage = payload.Vintage

	err = m.Db.Save(&obj).Error
	return err
}

repository: illyabusigin/goa-cellar

repo_name: illyabusigin/goa-cellar


text:
// Copyright Aeraki Authors
//
// 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 model

import (
	"github.com/aeraki-framework/double2istio/pkg/dubbo/common"

	nacosmodel "github.com/nacos-group/nacos-sdk-go/model"
	"istio.io/pkg/log"
)

// ConvertDubboServices converts SubscribeServices to DubboServices
func ConvertDubboServices(registryNS, registryGroup string,
	subscribeServices []nacosmodel.SubscribeService) ([]common.DubboServiceInstance, error) {
	instances := make([]common.DubboServiceInstance, 0)

	for _, subscribeService := range subscribeServices {
		dubboInterface := subscribeService.Metadata["interface"]
		if dubboInterface == "" {
			log.Errorf("invalid dubbo service instance: interface is missing: %v", subscribeService.Metadata)
			continue
		}
		instances = append(instances, common.DubboServiceInstance{
			IP:        subscribeService.Ip,
			Port:      uint32(subscribeService.Port),
			Interface: dubboInterface,
			Namespace: registryNS,
			Group:     registryGroup,
			Metadata:  common.CopyMap(subscribeService.Metadata),
		})
	}
	return instances, nil
}


text:
# Clearsilver
SECTION = "net"
DESCRIPTION = "Clearsilver is a fast, powerful, and language-neutral HTML template system"
LICENSE = "Neotonic ClearSilver License"
DEPENDS = "python"
PR = "r2"

SRC_URI = "http://www.clearsilver.net/downloads/${P}.tar.gz \
           file://crosscompile.patch"

EXTRA_OECONF = "--disable-apache --disable-perl --disable-ruby --disable-java --disable-csharp --enable-gettext --with-python=${STAGING_BINDIR_NATIVE}/python"

inherit autotools distutils-common-base

export PYTHON_DIR

do_compile() {
	BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} oe_runmake
}

do_configure() {
	gnu-configize
	oe_runconf
}

do_stage() {
        autotools_stage_includes
        for i in libs/libneo_cgi.a libs/libneo_cs.a libs/libneo_utl.a; do
            install -m 644 $i ${STAGING_LIBDIR}
        done
}

SRC_URI[md5sum] = "ff4104b0e58bca1b61d528edbd902769"
SRC_URI[sha256sum] = "71d8c6459a4be1912dbc445e2e9d46303be6623cea51563c21abe39c8b5b0bd2"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
package goat

import (
	"time"

	"github.com/spf13/viper"
)

// Viper conveniently supports reading configuration from a variety of sources.  For our env helpers to work seamlessly
// with Viper, we need to use Viper to read env vars rather than os.LookupEnv.  While it might initially seem possible
// to use a generic function for this purpose, unfortunately that does not seem to be possible.  See the examples below
// for an explanation.
//
// This type assertion doesn't work because viper.Get returns interface{} so value is never a T and ok is never true.
// 		func EnvOrDefault[T any](key string, defaultValue T) T {
// 			if viper.IsSet(key) {
// 				value := viper.Get(key)
// 				result, ok := value.(T)
// 				if ok {
// 					return result
// 				}
// 			}
// 			return defaultValue
// 		}
//
// This doesn't work because it isn't possible to type cast using a type parameter without first passing a type
// assertion, which won't work because viper.Get returns an interface{} (see above).
// 		func EnvOrDefault[T any](key string, defaultValue T) T {
// 			if viper.IsSet(key) {
// 				value := viper.Get(key)
// 				return T(value)
// 			}
// 			return defaultValue
// 		}
//
// There are several problems trying to use reflection.
// 		func EnvOrDefault[T any](key string, defaultValue T) T {
// 			if viper.IsSet(key) {
// 				switch reflect.TypeOf(defaultValue).String() {
// 				 case "int":
// 				 	// This doesn't work because viper.GetInt returns an int, but we need to return a T.
// 				 	return viper.GetInt(key)
// 				 }
//
// 				 case "int":
// 				 	value := viper.GetInt(key)
// 				 	// This doesn't work because value is not an interface type
// 				 	result, ok := value.(T)
// 				 	if ok {
// 				 		return result
// 				 	}
//
// 				 case "int":
// 				 	value := viper.GetInt(key)
// 				 	// This doesn't work because Go doesn't support typecasting using a type parameter.
// 				 	return T(value)
// 				 }
// 			}
// 			return defaultValue
// 		}
//
// Using a type switch also doesn't work because of all the reasons in the previous example plus the fact that Go
// doesn't support type switches using type parameters.
// 		func EnvOrDefault[T any](key string, defaultValue T) T {
// 			if viper.IsSet(key) {
// 				switch defaultValue.(type) {
// 				case int:
// 					return viper.GetInt(key)
// 				}
// 			}
// 			return defaultValue
// 		}

// EnvString returns the value of the specified env var or defaultValue if the env var is not set.
func EnvString(key string, defaultValue string) string {
	if viper.IsSet(key) {
		return viper.GetString(key)
	}
	return defaultValue
}

// EnvBool returns the value of the specified env var or defaultValue if the env var is not set.
func EnvBool(key string, defaultValue bool) bool {
	if viper.IsSet(key) {
		return viper.GetBool(key)
	}
	return defaultValue
}

// EnvInt returns the value of the specified env var or defaultValue if the env var is not set.
func EnvInt(key string, defaultValue int) int {
	if viper.IsSet(key) {
		return viper.GetInt(key)
	}
	return defaultValue
}

// EnvInt32 returns the value of the specified env var or defaultValue if the env var is not set.
func EnvInt32(key string, defaultValue int32) int32 {
	if viper.IsSet(key) {
		return viper.GetInt32(key)
	}
	return defaultValue
}

// EnvInt64 returns the value of the specified env var or defaultValue if the env var is not set.
func EnvInt64(key string, defaultValue int64) int64 {
	if viper.IsSet(key) {
		return viper.GetInt64(key)
	}
	return defaultValue
}

// EnvUint16 returns the value of the specified env var or defaultValue if the env var is not set.
func EnvUint16(key string, defaultValue uint16) uint16 {
	if viper.IsSet(key) {
		return viper.GetUint16(key)
	}
	return defaultValue
}

// EnvUint32 returns the value of the specified env var or defaultValue if the env var is not set.
func EnvUint32(key string, defaultValue uint32) uint32 {
	if viper.IsSet(key) {
		return viper.GetUint32(key)
	}
	return defaultValue
}

// EnvUint64 returns the value of the specified env var or defaultValue if the env var is not set.
func EnvUint64(key string, defaultValue uint64) uint64 {
	if viper.IsSet(key) {
		return viper.GetUint64(key)
	}
	return defaultValue
}

// EnvFloat64 returns the value of the specified env var or defaultValue if the env var is not set.
func EnvFloat64(key string, defaultValue float64) float64 {
	if viper.IsSet(key) {
		return viper.GetFloat64(key)
	}
	return defaultValue
}

// EnvTime returns the value of the specified env var or defaultValue if the env var is not set.
func EnvTime(key string, defaultValue time.Time) time.Time {
	if viper.IsSet(key) {
		return viper.GetTime(key)
	}
	return defaultValue
}

// EnvDuration returns the value of the specified env var or defaultValue if the env var is not set.
func EnvDuration(key string, defaultValue time.Duration) time.Duration {
	if viper.IsSet(key) {
		return viper.GetDuration(key)
	}
	return defaultValue
}

// EnvIntSlice returns the value of the specified env var or defaultValue if the env var is not set.
func EnvIntSlice(key string, defaultValue []int) []int {
	if viper.IsSet(key) {
		return viper.GetIntSlice(key)
	}
	return defaultValue
}

// EnvStringSlice returns the value of the specified env var or defaultValue if the env var is not set.
func EnvStringSlice(key string, defaultValue []string) []string {
	if viper.IsSet(key) {
		return viper.GetStringSlice(key)
	}
	return defaultValue
}

// EnvStringMap returns the value of the specified env var or defaultValue if the env var is not set.
func EnvStringMap(key string, defaultValue map[string]any) map[string]any {
	if viper.IsSet(key) {
		return viper.GetStringMap(key)
	}
	return defaultValue
}

// EnvStringMapString returns the value of the specified env var or defaultValue if the env var is not set.
func EnvStringMapString(key string, defaultValue map[string]string) map[string]string {
	if viper.IsSet(key) {
		return viper.GetStringMapString(key)
	}
	return defaultValue
}


text:
package rt

import (
	"expvar"
	"fmt"
	"github.com/anacrolix/envpprof"
	"github.com/anacrolix/tagflag"
	"github.com/anacrolix/torrent"
	"github.com/anacrolix/torrent/metainfo"
	"log"
	"net"
	"net/http"
	"os"
	"strings"
	"time"
)

var flags = struct {
	Mmap            bool           `help:"memory-map torrent data"`
	TestPeer        []*net.TCPAddr `help:"addresses of some starting peers"`
	Seed            bool           `help:"seed after download is complete"`
	Addr            *net.TCPAddr   `help:"network listen addr"`
	UploadRate      tagflag.Bytes  `help:"max piece bytes to send per second"`
	DownloadRate    tagflag.Bytes  `help:"max bytes per second down from peers"`
	Debug           bool
	PackedBlocklist string
	Stats           *bool
	tagflag.StartPos
	Torrent []string `arity:"+" help:"torrent file path or magnet uri"`
}{
	UploadRate:   -1,
	DownloadRate: -1,
}

type torrentInfo struct {
	TL int64 `json:"tl"`
	BC int64 `json:"bc"`
}

var (
	serverSideTorrentInfo      torrentInfo
	torrentError               chan error
	torrentErrorForHTTPHandler error
)

func init() {
	serverSideTorrentInfo = torrentInfo{TL: 1, BC: 0}
	torrentError = make(chan error, 1)
}

func download(magnet string) (err error) {
	select {
	case <-downloadInProgress:
		downloadInProgress <- struct{}{}
	default:
		downloadInProgress <- struct{}{}
	}
	downloadFinished = false

	//log.SetFlags(log.LstdFlags | log.Lshortfile)
	infoLog.Printf("magnet link: %s download scheduled\n", magnet)
	defer envpprof.Stop()
	flags.Torrent = []string{magnet}
	flags.Seed = false
	flags.Debug = false
	clientConfig := torrent.NewDefaultClientConfig()
	clientConfig.Debug = flags.Debug
	clientConfig.Seed = flags.Seed

	client, err := torrent.NewClient(clientConfig)
	if err != nil {
		errorLog.Printf("error creating client: %s\n", err)
		return err
	}
	defer client.Close()
	go clientSignalHandler(client)
	go torrentErrorHandler(client)

	// Write status on the root path on the default HTTP muxer. This will be
	// bound to localhost somewhere if GOPPROF is set, thanks to the envpprof
	// import.
	//http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
	//	client.WriteStatus(w)
	//})

	addTorrents(client)
	if client.WaitAll() {
		downloadFinished = true
		infoLog.Println("downloaded ALL the torrents")
	} else {
		infoLog.Println("y u no complete torrents?!")
		return
	}
	if flags.Seed {
		outputStats(client)
		select {}
	}
	outputStats(client)

	client.Close()

	<-downloadInProgress

	return nil
}

func addTorrents(client *torrent.Client) {
	for _, arg := range flags.Torrent {
		t := func() *torrent.Torrent {
			if strings.HasPrefix(arg, "magnet:") {
				t, err := client.AddMagnet(arg)
				if err != nil {
					errorLog.Printf("error adding magnet: %s\n", err)
					torrentError <- err
					return nil
				}
				return t
			} else if strings.HasPrefix(arg, "http://") || strings.HasPrefix(arg, "https://") {
				response, err := http.Get(arg)
				if err != nil {
					log.Fatalf("Error downloading torrent file: %s", err)
				}

				metaInfo, err := metainfo.Load(response.Body)
				defer response.Body.Close()
				if err != nil {
					fmt.Fprintf(os.Stderr, "error loading torrent file %q: %s\n", arg, err)
					os.Exit(1)
				}
				t, err := client.AddTorrent(metaInfo)
				if err != nil {
					log.Fatal(err)
				}
				return t
			} else if strings.HasPrefix(arg, "infohash:") {
				t, _ := client.AddTorrentInfoHash(metainfo.NewHashFromHex(strings.TrimPrefix(arg, "infohash:")))
				return t
			}
			metaInfo, err := metainfo.LoadFromFile(arg)
			if err != nil {
				fmt.Fprintf(os.Stderr, "error loading torrent file %q: %s\n", arg, err)
				os.Exit(1)
			}
			t, err := client.AddTorrent(metaInfo)
			if err != nil {
				log.Fatal(err)
			}
			return t
		}()

		if t == nil {
			continue
		}

		getInfo(t)
		t.AddPeers(func() (ret []torrent.Peer) {
			for _, ta := range flags.TestPeer {
				ret = append(ret, torrent.Peer{
					IP:   ta.IP,
					Port: ta.Port,
				})
			}
			return
		}())
		go func() {
			<-t.GotInfo()
			t.DownloadAll()
		}()
	}
}

func getInfo(t *torrent.Torrent) {
	go func() {
		<-t.GotInfo()
		serverSideTorrentInfo.TL = t.Info().TotalLength()
		for {
			serverSideTorrentInfo.BC = t.BytesCompleted()
			time.Sleep(time.Second)
		}
	}()
}

func statsEnabled() bool {
	if flags.Stats == nil {
		return flags.Debug
	}
	return *flags.Stats
}

func outputStats(cl *torrent.Client) {
	if !statsEnabled() {
		return
	}
	expvar.Do(func(kv expvar.KeyValue) {
		fmt.Printf("%s: %s\n", kv.Key, kv.Value)
	})
	cl.WriteStatus(os.Stdout)
}

func clientSignalHandler(client *torrent.Client) {
	<-clientCleanupSignal
	infoLog.Println("close signal received")
	client.Close()
	removeContents(mediaDir)
	clientCleanupFinished <- struct{}{}
}

func torrentErrorHandler(client *torrent.Client) {
	err := <-torrentError
	errorLog.Printf("torrent error: %v\n", err)
	client.Close()
	torrentErrorForHTTPHandler = err
}


text:
require bug-app.inc

DESCRIPTION = "This app will turn off the backlight of BUG base and module LCDs if no activity within 15 seconds.  Backlights turn back on with button press and/or acceleration."
HOMEPAGE = "http://buglabs.net/applications/scnsvr"

DEPENDS += "service-tracker com.buglabs.common com.buglabs.bug.jni.accelerometer com.buglabs.bug.module.motion com.buglabs.bug.module.lcd "

PV = "2"

SRC_LINK = "http://buglabs.net/program_version/download/816"

APIVERSION = ""


text:
DESCRIPTION = "rcswitch-pi"
HOMEPAGE = ""
SECTION = "devel/libs"
LICENSE = "LGPLv3+"
LIC_FILES_CHKSUM = "file://${TOPDIR}/../meta-teapot/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"

DEPENDS = "wiringpi"

S = "${WORKDIR}/git"

SRC_URI = "\
          git://github.com/r10r/rcswitch-pi.git \
          "

SRCREV = "2c9c027217ae0b4fe132e0725db166ac29f93974"

COMPATIBLE_MACHINE = "raspberrypi"

do_install() {
	install -d ${D}${bindir}
	install -m 0755 ${WORKDIR}/git/send ${D}${bindir}/send
}

FILES_${PN} = "${bindir}"

repository: shagu/meta-teapot

repo_name: shagu/meta-teapot

gha_language: BitBake


text:
DESCRIPTION = "task mamona base"
LICENSE = "MIT"
PR = "r5"
ALLOW_EMPTY = "1"

PACKAGES = "${PN}"

RDEPENDS_${PN} = "\
  apt \
  base-files \
  base-passwd \
  bash \
  bash-noemu \
  busybox \
  bzip2 \
  coreutils \
  dpkg \
  e2fsprogs \
  e2fsprogs-badblocks \
  util-linux-ng \
  file \
  gawk \
  gawk-common \
  initscripts \
  libgcc \
  libstdc++ \
  makedevs \
  ncurses \
  netbase \
  patch \
  perl \
  pkgconfig \
  procps \
  sed \
  sudo \
  sysvinit \
  sysvinit-inittab \
  tar \
  tinylogin \
  udev \
  update-alternatives-dpkg \
  update-rc.d \
  util-linux \
  util-linux-losetup \
  util-linux-swaponoff \
  util-linux-umount \
  util-linux-ng-blkid \
  zlib \
"


text:
package hublist

import (
	"context"
	"encoding/json"
	"fmt"
	"net/http"
	"strconv"
	"strings"
)

// TELists is a list of well-known TE-compatible hub lists.
var TELists = []string{
	"http://www.te-home.net/",
}

func teGetRaw(ctx context.Context, addr string, dst interface{}) error {
	if !strings.Contains(addr, "?") {
		addr += `?do=hublist&get=hublist.json`
	}
	req, err := http.NewRequest("GET", addr, nil)
	if err != nil {
		return err
	}
	req = req.WithContext(ctx)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	if resp.StatusCode != 200 {
		return fmt.Errorf("http status: %v", resp.Status)
	}
	return json.NewDecoder(resp.Body).Decode(dst)
}

// GetTE fetches and decodes a TE-compatible hub list.
func GetTE(ctx context.Context, addr string) ([]Hub, error) {
	var resp struct {
		List []teHub `json:"hublist"`
	}
	err := teGetRaw(ctx, addr, &resp)
	if err != nil {
		return nil, err
	}
	list := make([]Hub, 0, len(resp.List))
	for _, h := range resp.List {
		list = append(list, h.toHub())
	}
	return list, err
}

func (h teHub) toHub() Hub {
	return Hub{
		Address:     h.Address,
		Bots:        h.Bots,
		Country:     h.Country,
		Description: h.Description,
		Email:       h.Email,
		Encoding:    h.Encoding,
		Failover:    h.Failover,
		Icon:        h.Icon,
		Infected:    h.Infected,
		Logo:        h.Logo,
		Maxhubs:     h.Maxhubs,
		Maxusers:    h.Maxusers,
		Minshare:    Size(h.Minshare),
		Minslots:    h.Minslots,
		Name:        h.Name,
		Network:     h.Network,
		Operators:   h.Operators,
		Rating:      strconv.Itoa(h.Rating),
		Reliability: strconv.FormatFloat(h.Reliability, 'g', -1, 64),
		Shared:      Size(h.Shared),
		Software:    h.Software,
		Status:      h.Status,
		Users:       h.Users,
		Website:     h.Website,
	}
}

repository: RoLex/go-dcpp

repo_name: RoLex/go-dcpp


text:
// Copyright 2019 Istio Authors
//
// 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 coredatamodel

import (
	"errors"
	"fmt"
	"net"
	"strconv"

	networking "istio.io/api/networking/v1alpha3"

	"istio.io/istio/pilot/pkg/model"
	"istio.io/istio/pilot/pkg/serviceregistry"
	"istio.io/istio/pkg/config/constants"
	"istio.io/istio/pkg/config/host"
	"istio.io/istio/pkg/config/labels"
	"istio.io/istio/pkg/config/protocol"
	"istio.io/istio/pkg/config/schemas"
	"istio.io/istio/pkg/config/visibility"
	"istio.io/pkg/log"
)

var (
	_ model.Controller       = &MCPDiscovery{}
	_ model.ServiceDiscovery = &MCPDiscovery{}
)

// DiscoveryOptions stores the configurable attributes of a Control
type DiscoveryOptions struct {
	Env          *model.Environment
	ClusterID    string
	DomainSuffix string
}

// mixerEnabled checks to see if mixer is enabled in the environment
// so we can set the UID on eds endpoints
func (o *DiscoveryOptions) mixerEnabled() bool {
	return o.Env != nil && o.Env.Mesh != nil && (o.Env.Mesh.MixerCheckServer != "" || o.Env.Mesh.MixerReportServer != "")
}

// MCPDiscovery provides discovery interface for SyntheticServiceEntries
type MCPDiscovery struct {
	*SyntheticServiceEntryController
	*DiscoveryOptions
}

// NewMCPDiscovery provides a new instance of Discovery
func NewMCPDiscovery(controller CoreDataModel, options *DiscoveryOptions) *MCPDiscovery {
	return &MCPDiscovery{
		SyntheticServiceEntryController: controller.(*SyntheticServiceEntryController),
		DiscoveryOptions:                options,
	}
}

// Services list declarations of all SyntheticServiceEntries in the system
func (d *MCPDiscovery) Services() ([]*model.Service, error) {
	services := make([]*model.Service, 0)

	syntheticServiceEntries, err := d.List(schemas.SyntheticServiceEntry.Type, model.NamespaceAll)
	if err != nil {
		return nil, err
	}
	for _, cfg := range syntheticServiceEntries {
		services = append(services, convertServices(cfg)...)
	}
	return services, nil
}

// GetProxyServiceInstances returns service instances co-located with a given proxy
func (d *MCPDiscovery) GetProxyServiceInstances(proxy *model.Proxy) ([]*model.ServiceInstance, error) {
	out := make([]*model.ServiceInstance, 0)

	// There is only one IP for kube registry
	proxyIP := proxy.IPAddresses[0]

	// add not ready endpoint
	d.notReadyEndpointsMu.Lock()
	defer d.notReadyEndpointsMu.Unlock()
	for addr, conf := range d.notReadyEndpoints {
		notReadyIP, port, err := net.SplitHostPort(addr)
		if err != nil {
			continue
		}
		notReadyPort, err := strconv.Atoi(port)
		if proxyIP != notReadyIP || err != nil {
			continue
		}
		se, ok := conf.Spec.(*networking.ServiceEntry)
		if !ok {
			return nil, errors.New("getProxyServiceInstances: wrong type")
		}
		for _, h := range se.Hosts {
			for _, svcPort := range se.Ports {
				out = append(out, d.notReadyServiceInstance(se, svcPort, conf, h, notReadyIP, notReadyPort))
			}
		}
	}

	// add any other endpoint
	svcInstances, err := d.serviceInstancesFromConfig(proxy.ConfigNamespace, proxy.IPAddresses[0])
	if err != nil {
		return nil, err
	}
	out = append(out, svcInstances...)
	return out, nil
}

// InstancesByPort implements a service catalog operation
func (d *MCPDiscovery) InstancesByPort(svc *model.Service, servicePort int, lbls labels.Collection) ([]*model.ServiceInstance, error) {
	out := make([]*model.ServiceInstance, 0)

	d.notReadyEndpointsMu.Lock()
	defer d.notReadyEndpointsMu.Unlock()

	for addr, conf := range d.notReadyEndpoints {
		notReadyIP, port, err := net.SplitHostPort(addr)
		if err != nil {
			continue
		}
		notReadyPort, err := strconv.Atoi(port)
		if err != nil {
			continue
		}
		se, ok := conf.Spec.(*networking.ServiceEntry)
		if !ok {
			return nil, errors.New("instancesByPort: wrong type")
		}

		for _, svcPort := range se.Ports {
			for _, h := range se.Hosts {
				if host.Name(h) == svc.Hostname && servicePort == int(svcPort.Number) {
					// add not ready endpoint
					out = append(out, d.notReadyServiceInstance(se, svcPort, conf, h, notReadyIP, notReadyPort))
				}
			}
		}
	}
	// add other endpoints
	if svc != nil {
		sseConf, err := d.List(schemas.SyntheticServiceEntry.Type, svc.Attributes.Namespace)
		if err != nil {
			return nil, err
		}

		for _, conf := range sseConf {
			se, ok := conf.Spec.(*networking.ServiceEntry)
			if !ok {
				return nil, errors.New("instancesByPort: wrong type")
			}
			for _, h := range se.Hosts {
				for _, svcPort := range se.Ports {
					if host.Name(h) == svc.Hostname && int(svcPort.Number) == servicePort {
						var uid string
						if d.mixerEnabled() {
							uid = fmt.Sprintf("kubernetes://%s.%s", conf.Name, conf.Namespace)
						}
						for _, ep := range se.Endpoints {
							for _, epPort := range ep.Ports {
								si := &model.ServiceInstance{
									Endpoint: model.NetworkEndpoint{
										UID:      uid,
										Address:  ep.Address,
										Port:     int(epPort),
										Locality: ep.Locality,
										LbWeight: ep.Weight,
										Network:  ep.Network,
										ServicePort: &model.Port{
											Name:     svcPort.Name,
											Port:     int(svcPort.Number),
											Protocol: protocol.Instance(svcPort.Protocol),
										},
									},
									// ServiceAccount is retrieved in Kube/Controller
									// using IdentityPodAnnotation
									//ServiceAccount, Address: ???, //TODO: nino-k
									Service: &model.Service{
										Hostname:   host.Name(h),
										Ports:      convertServicePorts(se.Ports),
										Resolution: model.Resolution(int(se.Resolution)),
										Attributes: model.ServiceAttributes{
											Name:      conf.Name,
											Namespace: conf.Namespace,
											UID:       uid,
										},
									},
									Labels: labels.Instance(conf.Labels),
								}
								out = append(out, si)
							}
						}
					}
				}
			}
		}
	}
	return out, nil
}

func convertPort(port *networking.Port) *model.Port {
	return &model.Port{
		Name:     port.Name,
		Port:     int(port.Number),
		Protocol: protocol.Parse(port.Protocol),
	}
}

func convertServices(cfg model.Config) []*model.Service {
	serviceEntry := cfg.Spec.(*networking.ServiceEntry)
	creationTime := cfg.CreationTimestamp

	out := make([]*model.Service, 0)

	var resolution model.Resolution
	switch serviceEntry.Resolution {
	case networking.ServiceEntry_NONE:
		resolution = model.Passthrough
	case networking.ServiceEntry_DNS:
		resolution = model.DNSLB
	case networking.ServiceEntry_STATIC:
		resolution = model.ClientSideLB
	}

	svcPorts := make(model.PortList, 0, len(serviceEntry.Ports))
	for _, port := range serviceEntry.Ports {
		svcPorts = append(svcPorts, convertPort(port))
	}

	var exportTo map[visibility.Instance]bool
	if len(serviceEntry.ExportTo) > 0 {
		exportTo = make(map[visibility.Instance]bool)
		for _, e := range serviceEntry.ExportTo {
			exportTo[visibility.Instance(e)] = true
		}
	}

	for _, hostname := range serviceEntry.Hosts {
		if len(serviceEntry.Addresses) > 0 {
			for _, address := range serviceEntry.Addresses {
				if ip, network, cidrErr := net.ParseCIDR(address); cidrErr == nil {
					newAddress := address
					ones, zeroes := network.Mask.Size()
					if ones == zeroes {
						// /32 mask. Remove the /32 and make it a normal IP address
						newAddress = ip.String()
					}
					out = append(out, &model.Service{
						CreationTime: creationTime,
						MeshExternal: serviceEntry.Location == networking.ServiceEntry_MESH_EXTERNAL,
						Hostname:     host.Name(hostname),
						Address:      newAddress,
						Ports:        svcPorts,
						Resolution:   resolution,
						Attributes: model.ServiceAttributes{
							ServiceRegistry: string(serviceregistry.MCPRegistry),
							Name:            hostname,
							Namespace:       cfg.Namespace,
							ExportTo:        exportTo,
						},
					})
				} else if net.ParseIP(address) != nil {
					out = append(out, &model.Service{
						CreationTime: creationTime,
						MeshExternal: serviceEntry.Location == networking.ServiceEntry_MESH_EXTERNAL,
						Hostname:     host.Name(hostname),
						Address:      address,
						Ports:        svcPorts,
						Resolution:   resolution,
						Attributes: model.ServiceAttributes{
							ServiceRegistry: string(serviceregistry.MCPRegistry),
							Name:            hostname,
							Namespace:       cfg.Namespace,
							ExportTo:        exportTo,
						},
					})
				}
			}
		} else {
			out = append(out, &model.Service{
				CreationTime: creationTime,
				MeshExternal: serviceEntry.Location == networking.ServiceEntry_MESH_EXTERNAL,
				Hostname:     host.Name(hostname),
				Address:      constants.UnspecifiedIP,
				Ports:        svcPorts,
				Resolution:   resolution,
				Attributes: model.ServiceAttributes{
					ServiceRegistry: string(serviceregistry.MCPRegistry),
					Name:            hostname,
					Namespace:       cfg.Namespace,
					ExportTo:        exportTo,
				},
			})
		}
	}

	return out
}

func (d *MCPDiscovery) serviceInstancesFromConfig(namespace, proxyIP string) ([]*model.ServiceInstance, error) {
	out := make([]*model.ServiceInstance, 0)
	sseConf, err := d.List(schemas.SyntheticServiceEntry.Type, namespace)
	if err != nil {
		return nil, err
	}

	for _, conf := range sseConf {
		se, ok := conf.Spec.(*networking.ServiceEntry)
		if !ok {
			return nil, errors.New("serviceInstancesFromConfig: wrong type")
		}
		for _, h := range se.Hosts {
			for _, svcPort := range se.Ports {
				// add other endpoints
				out = append(out, d.serviceInstancesByProxyIP(proxyIP, se, svcPort, conf, h)...)
			}
		}
	}
	return out, nil

}

func (d *MCPDiscovery) notReadyServiceInstance(
	se *networking.ServiceEntry,
	svcPort *networking.Port,
	conf *model.Config,
	hostname,
	ip string,
	port int) *model.ServiceInstance {
	var uid string
	if d.mixerEnabled() {
		uid = fmt.Sprintf("kubernetes://%s.%s", conf.Name, conf.Namespace)
	}
	out := &model.ServiceInstance{
		Endpoint: model.NetworkEndpoint{
			UID:     uid,
			Address: ip,
			Port:    port,
			ServicePort: &model.Port{
				Name:     svcPort.Name,
				Port:     int(svcPort.Number),
				Protocol: protocol.Instance(svcPort.Protocol),
			},
		},
		// ServiceAccount is retrieved in Kube/Controller
		// using IdentityPodAnnotation
		//ServiceAccount and Address: ???, //TODO: nino-k
		Service: &model.Service{
			Hostname:   host.Name(hostname),
			Ports:      convertServicePorts(se.Ports),
			Resolution: model.Resolution(int(se.Resolution)),
			Attributes: model.ServiceAttributes{
				Name:      conf.Name,
				Namespace: conf.Namespace,
				UID:       uid,
			},
		},
		Labels: labels.Instance(conf.Labels),
	}
	return out
}

func (d *MCPDiscovery) serviceInstancesByProxyIP(
	proxyIP string,
	se *networking.ServiceEntry,
	svcPort *networking.Port,
	conf model.Config,
	hostname string) (out []*model.ServiceInstance) {
	var uid string
	if d.mixerEnabled() {
		uid = fmt.Sprintf("kubernetes://%s.%s", conf.Name, conf.Namespace)
	}
	for _, ep := range se.Endpoints {
		if ep.Address == proxyIP {
			for _, epPort := range ep.Ports {
				si := &model.ServiceInstance{
					Endpoint: model.NetworkEndpoint{
						UID:      uid,
						Address:  ep.Address,
						Port:     int(epPort),
						Locality: ep.Locality,
						LbWeight: ep.Weight,
						Network:  ep.Network,
						ServicePort: &model.Port{
							Name:     svcPort.Name,
							Port:     int(svcPort.Number),
							Protocol: protocol.Instance(svcPort.Protocol),
						},
					},
					// ServiceAccount is retrieved in Kube/Controller
					// using IdentityPodAnnotation
					//ServiceAccount, Address: ???, //TODO: nino-k
					Service: &model.Service{
						Hostname:   host.Name(hostname),
						Ports:      convertServicePorts(se.Ports),
						Resolution: model.Resolution(int(se.Resolution)),
						Attributes: model.ServiceAttributes{
							Name:      conf.Name,
							Namespace: conf.Namespace,
							UID:       uid,
						},
					},
					Labels: labels.Instance(conf.Labels),
				}
				out = append(out, si)
			}
		}
	}
	return out
}

func convertServicePorts(ports []*networking.Port) model.PortList {
	out := make(model.PortList, 0)
	for _, port := range ports {
		out = append(out, &model.Port{
			Name:     port.Name,
			Port:     int(port.Number),
			Protocol: protocol.Instance(port.Protocol),
		})
	}

	return out
}

// GetService Not Supported
func (d *MCPDiscovery) GetService(hostname host.Name) (*model.Service, error) {
	log.Warnf("GetService %s", errUnsupported)
	return nil, nil
}

// ManagementPorts Not Supported
func (d *MCPDiscovery) ManagementPorts(addr string) model.PortList {
	log.Warnf("ManagementPorts %s", errUnsupported)
	return nil
}

// WorkloadHealthCheckInfo Not Supported
func (d *MCPDiscovery) WorkloadHealthCheckInfo(addr string) model.ProbeList {
	log.Warnf("WorkloadHealthCheckInfo %s", errUnsupported)
	return nil
}

// GetIstioServiceAccounts Not Supported
func (d *MCPDiscovery) GetIstioServiceAccounts(svc *model.Service, ports []int) []string {
	log.Warnf("GetIstioServiceAccounts %s", errUnsupported)
	return nil
}

// GetProxyWorkloadLabels Not Supported
func (d *MCPDiscovery) GetProxyWorkloadLabels(*model.Proxy) (labels.Collection, error) {
	log.Warnf("GetProxyWorkloadLabels %s", errUnsupported)
	return nil, nil
}

// model Controller

// AppendServiceHandler Not Supported
func (d *MCPDiscovery) AppendServiceHandler(f func(*model.Service, model.Event)) error {
	log.Warnf("AppendServiceHandler %s", errUnsupported)
	return nil
}

// AppendInstanceHandler Not Supported
func (d *MCPDiscovery) AppendInstanceHandler(f func(*model.ServiceInstance, model.Event)) error {
	log.Warnf("AppendInstanceHandler %s", errUnsupported)
	return nil
}

// Run until a signal is received
func (d *MCPDiscovery) Run(stop <-chan struct{}) {
	log.Warnf("Run %s", errUnsupported)
}

repository: xiaowei-leo/istio

repo_name: xiaowei-leo/istio


text:
package main

import (
	"goLearning/utils"
	"os"
	"strings"
	"text/template"
)

type TplFile struct {
	FileName string
	PackageName string
	Data interface{}
}

type TplStruct struct {
	Name string `json:"name"`
	Fields []TplStructField
}

type TplStructField struct {
	Name string
	Type string
	Tag string
}

func main() {
	// 获取模板内容
	// the value at the current location in the structure
	tplDir := "/Users/ibeans/backup/workdir3/goLearning/模板引擎/"
	teplPtr, err := utils.ReadFile(tplDir + "struct.tpl")
	if err != nil {
		panic(err)
	}
	tepl := strings.TrimSpace(*teplPtr)

	// 定义模板数据
	dataStruct := TplStruct{
		Name:         "Inventory",
	}
	dataStruct.Fields = append(dataStruct.Fields, TplStructField{"Material", "string", "`json:\"material\"`"})
	dataStruct.Fields = append(dataStruct.Fields, TplStructField{"Count", "int", "`json:\"count\"`"})
	dataStruct.Fields = append(dataStruct.Fields, TplStructField{"Count1", "int", "`json:\"count\"`"})
	dataStruct.Fields = append(dataStruct.Fields, TplStructField{"Count2", "int", "`json:\"count\"`"})
	dataInfo := TplFile{
		FileName:    "result/structTpl.go",
		PackageName: "structTpl",
		Data:        dataStruct,
	}

	// 解析模板, 获取结果
	tmpl, err := template.New("test").Parse(tepl)
	if err != nil {
		panic(err)
	}

	f, err := os.Create(tplDir + dataInfo.FileName)
	if err != nil {
		panic(err)
	}

	err = tmpl.Execute(f, dataInfo)
	if err != nil {
		panic(err)
	}
}

repository: GraceYongqi/goLearning

repo_name: GraceYongqi/goLearning


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE eagle SYSTEM "eagle.dtd">
<eagle version="9.4.2">
<drawing>
<settings>
<setting alwaysvectorfont="no"/>
<setting verticaltext="up"/>
</settings>
<grid distance="0.1" unitdist="inch" unit="inch" style="lines" multiple="1" display="no" altdistance="0.01" altunitdist="inch" altunit="inch"/>
<layers>
<layer number="1" name="Top" color="4" fill="1" visible="no" active="no"/>
<layer number="2" name="Route2" color="1" fill="3" visible="no" active="no"/>
<layer number="3" name="Route3" color="4" fill="3" visible="no" active="no"/>
<layer number="4" name="Route4" color="1" fill="4" visible="no" active="no"/>
<layer number="5" name="Route5" color="4" fill="4" visible="no" active="no"/>
<layer number="6" name="Route6" color="1" fill="8" visible="no" active="no"/>
<layer number="7" name="Route7" color="4" fill="8" visible="no" active="no"/>
<layer number="8" name="Route8" color="1" fill="2" visible="no" active="no"/>
<layer number="9" name="Route9" color="4" fill="2" visible="no" active="no"/>
<layer number="10" name="Route10" color="1" fill="7" visible="no" active="no"/>
<layer number="11" name="Route11" color="4" fill="7" visible="no" active="no"/>
<layer number="12" name="Route12" color="1" fill="5" visible="no" active="no"/>
<layer number="13" name="Route13" color="4" fill="5" visible="no" active="no"/>
<layer number="14" name="Route14" color="1" fill="6" visible="no" active="no"/>
<layer number="15" name="Route15" color="4" fill="6" visible="no" active="no"/>
<layer number="16" name="Bottom" color="1" fill="1" visible="no" active="no"/>
<layer number="17" name="Pads" color="2" fill="1" visible="no" active="no"/>
<layer number="18" name="Vias" color="2" fill="1" visible="no" active="no"/>
<layer number="19" name="Unrouted" color="6" fill="1" visible="no" active="no"/>
<layer number="20" name="Dimension" color="15" fill="1" visible="no" active="no"/>
<layer number="21" name="tPlace" color="7" fill="1" visible="no" active="no"/>
<layer number="22" name="bPlace" color="7" fill="1" visible="no" active="no"/>
<layer number="23" name="tOrigins" color="15" fill="1" visible="no" active="no"/>
<layer number="24" name="bOrigins" color="15" fill="1" visible="no" active="no"/>
<layer number="25" name="tNames" color="7" fill="1" visible="no" active="no"/>
<layer number="26" name="bNames" color="7" fill="1" visible="no" active="no"/>
<layer number="27" name="tValues" color="7" fill="1" visible="no" active="no"/>
<layer number="28" name="bValues" color="7" fill="1" visible="no" active="no"/>
<layer number="29" name="tStop" color="7" fill="3" visible="no" active="no"/>
<layer number="30" name="bStop" color="7" fill="6" visible="no" active="no"/>
<layer number="31" name="tCream" color="7" fill="4" visible="no" active="no"/>
<layer number="32" name="bCream" color="7" fill="5" visible="no" active="no"/>
<layer number="33" name="tFinish" color="6" fill="3" visible="no" active="no"/>
<layer number="34" name="bFinish" color="6" fill="6" visible="no" active="no"/>
<layer number="35" name="tGlue" color="7" fill="4" visible="no" active="no"/>
<layer number="36" name="bGlue" color="7" fill="5" visible="no" active="no"/>
<layer number="37" name="tTest" color="7" fill="1" visible="no" active="no"/>
<layer number="38" name="bTest" color="7" fill="1" visible="no" active="no"/>
<layer number="39" name="tKeepout" color="4" fill="11" visible="no" active="no"/>
<layer number="40" name="bKeepout" color="1" fill="11" visible="no" active="no"/>
<layer number="41" name="tRestrict" color="4" fill="10" visible="no" active="no"/>
<layer number="42" name="bRestrict" color="1" fill="10" visible="no" active="no"/>
<layer number="43" name="vRestrict" color="2" fill="10" visible="no" active="no"/>
<layer number="44" name="Drills" color="7" fill="1" visible="no" active="no"/>
<layer number="45" name="Holes" color="7" fill="1" visible="no" active="no"/>
<layer number="46" name="Milling" color="3" fill="1" visible="no" active="no"/>
<layer number="47" name="Measures" color="7" fill="1" visible="no" active="no"/>
<layer number="48" name="Document" color="7" fill="1" visible="no" active="no"/>
<layer number="49" name="Reference" color="7" fill="1" visible="no" active="no"/>
<layer number="51" name="tDocu" color="7" fill="1" visible="no" active="no"/>
<layer number="52" name="bDocu" color="7" fill="1" visible="no" active="no"/>
<layer number="88" name="SimResults" color="9" fill="1" visible="yes" active="yes"/>
<layer number="89" name="SimProbes" color="9" fill="1" visible="yes" active="yes"/>
<layer number="90" name="Modules" color="5" fill="1" visible="yes" active="yes"/>
<layer number="91" name="Nets" color="2" fill="1" visible="yes" active="yes"/>
<layer number="92" name="Busses" color="1" fill="1" visible="yes" active="yes"/>
<layer number="93" name="Pins" color="2" fill="1" visible="no" active="yes"/>
<layer number="94" name="Symbols" color="4" fill="1" visible="yes" active="yes"/>
<layer number="95" name="Names" color="7" fill="1" visible="yes" active="yes"/>
<layer number="96" name="Values" color="7" fill="1" visible="yes" active="yes"/>
<layer number="97" name="Info" color="7" fill="1" visible="yes" active="yes"/>
<layer number="98" name="Guide" color="6" fill="1" visible="yes" active="yes"/>
</layers>
<schematic xreflabel="%F%N/%S.%C%R" xrefpart="/%S.%C%R">
<libraries>
<library name="pinhead">
<description>Pin Header Connectors

<author>Created by librarian@cadsoft.de</author></description>
<packages>
<package name="1X04">
<description>PIN HEADER</description>
<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"/>
<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="-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="-5.08" y1="0.635" x2="-5.08" y2="-0.635" 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="-4.445" 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="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="3.175" y1="1.27" 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="4.445" y1="-1.27" x2="3.175" y2="-1.27" width="0.1524" layer="21"/>
<pad name="1" x="-3.81" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="2" x="-1.27" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="3" x="1.27" y="0" drill="1.016" shape="long" rot="R90"/>
<pad name="4" x="3.81" y="0" drill="1.016" shape="long" rot="R90"/>
<text x="-5.1562" y="1.8288" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-5.08" y="-3.175" size="1.27" layer="27">>VALUE</text>
<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="3.556" y1="-0.254" x2="4.064" y2="0.254" layer="51"/>
</package>
<package name="1X04/90">
<description>PIN HEADER</description>
<wire x1="-5.08" y1="-1.905" x2="-2.54" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="-1.905" x2="-2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-2.54" y1="0.635" x2="-5.08" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-5.08" y1="0.635" x2="-5.08" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="-3.81" y1="6.985" x2="-3.81" y2="1.27" width="0.762" layer="21"/>
<wire x1="-2.54" y1="-1.905" x2="0" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="0" y1="-1.905" x2="0" y2="0.635" width="0.1524" layer="21"/>
<wire x1="0" y1="0.635" x2="-2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="-1.27" y1="6.985" x2="-1.27" y2="1.27" width="0.762" layer="21"/>
<wire x1="0" y1="-1.905" x2="2.54" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="2.54" y1="-1.905" x2="2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="2.54" y1="0.635" x2="0" y2="0.635" width="0.1524" layer="21"/>
<wire x1="1.27" y1="6.985" x2="1.27" y2="1.27" width="0.762" layer="21"/>
<wire x1="2.54" y1="-1.905" x2="5.08" y2="-1.905" width="0.1524" layer="21"/>
<wire x1="5.08" y1="-1.905" x2="5.08" y2="0.635" width="0.1524" layer="21"/>
<wire x1="5.08" y1="0.635" x2="2.54" y2="0.635" width="0.1524" layer="21"/>
<wire x1="3.81" y1="6.985" x2="3.81" y2="1.27" width="0.762" layer="21"/>
<pad name="1" x="-3.81" y="-3.81" drill="1.016" shape="long" rot="R90"/>
<pad name="2" x="-1.27" y="-3.81" drill="1.016" shape="long" rot="R90"/>
<pad name="3" x="1.27" y="-3.81" drill="1.016" shape="long" rot="R90"/>
<pad name="4" x="3.81" y="-3.81" drill="1.016" shape="long" rot="R90"/>
<text x="-5.715" y="-3.81" size="1.27" layer="25" ratio="10" rot="R90">>NAME</text>
<text x="6.985" y="-4.445" size="1.27" layer="27" rot="R90">>VALUE</text>
<rectangle x1="-4.191" y1="0.635" x2="-3.429" y2="1.143" layer="21"/>
<rectangle x1="-1.651" y1="0.635" x2="-0.889" y2="1.143" layer="21"/>
<rectangle x1="0.889" y1="0.635" x2="1.651" y2="1.143" layer="21"/>
<rectangle x1="3.429" y1="0.635" x2="4.191" y2="1.143" layer="21"/>
<rectangle x1="-4.191" y1="-2.921" x2="-3.429" y2="-1.905" layer="21"/>
<rectangle x1="-1.651" y1="-2.921" x2="-0.889" y2="-1.905" layer="21"/>
<rectangle x1="0.889" y1="-2.921" x2="1.651" y2="-1.905" layer="21"/>
<rectangle x1="3.429" y1="-2.921" x2="4.191" y2="-1.905" layer="21"/>
</package>
</packages>
<symbols>
<symbol name="PINHD4">
<wire x1="-6.35" y1="-5.08" x2="1.27" y2="-5.08" width="0.4064" layer="94"/>
<wire x1="1.27" y1="-5.08" x2="1.27" y2="7.62" width="0.4064" layer="94"/>
<wire x1="1.27" y1="7.62" x2="-6.35" y2="7.62" width="0.4064" layer="94"/>
<wire x1="-6.35" y1="7.62" x2="-6.35" y2="-5.08" width="0.4064" layer="94"/>
<text x="-6.35" y="8.255" size="1.778" layer="95">>NAME</text>
<text x="-6.35" y="-7.62" size="1.778" layer="96">>VALUE</text>
<pin name="1" x="-2.54" y="5.08" visible="pad" length="short" direction="pas" function="dot"/>
<pin name="2" x="-2.54" y="2.54" visible="pad" length="short" direction="pas" function="dot"/>
<pin name="3" x="-2.54" y="0" visible="pad" length="short" direction="pas" function="dot"/>
<pin name="4" x="-2.54" y="-2.54" visible="pad" length="short" direction="pas" function="dot"/>
</symbol>
</symbols>
<devicesets>
<deviceset name="PINHD-1X4" prefix="JP" uservalue="yes">
<description>PIN HEADER</description>
<gates>
<gate name="A" symbol="PINHD4" x="0" y="0"/>
</gates>
<devices>
<device name="" package="1X04">
<connects>
<connect gate="A" pin="1" pad="1"/>
<connect gate="A" pin="2" pad="2"/>
<connect gate="A" pin="3" pad="3"/>
<connect gate="A" pin="4" pad="4"/>
</connects>
<technologies>
<technology name=""/>
</technologies>
</device>
<device name="/90" package="1X04/90">
<connects>
<connect gate="A" pin="1" pad="1"/>
<connect gate="A" pin="2" pad="2"/>
<connect gate="A" pin="3" pad="3"/>
<connect gate="A" pin="4" pad="4"/>
</connects>
<technologies>
<technology name=""/>
</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="I2C_BUS1" library="pinhead" deviceset="PINHD-1X4" device=""/>
<part name="RTC" library="pinhead" deviceset="PINHD-1X4" device=""/>
<part name="I2C_BUS2" library="pinhead" deviceset="PINHD-1X4" device=""/>
<part name="I2C_BUS3" library="pinhead" deviceset="PINHD-1X4" device=""/>
<part name="I2C_BUS4" library="pinhead" deviceset="PINHD-1X4" device=""/>
<part name="I2C_BUS5" library="pinhead" deviceset="PINHD-1X4" device=""/>
<part name="I2C_BUS6" library="pinhead" deviceset="PINHD-1X4" device=""/>
</parts>
<sheets>
<sheet>
<plain>
</plain>
<instances>
<instance part="I2C_BUS1" gate="A" x="7.62" y="48.26" smashed="yes">
<attribute name="NAME" x="1.27" y="56.515" size="1.778" layer="95"/>
<attribute name="VALUE" x="1.27" y="40.64" size="1.778" layer="96"/>
</instance>
<instance part="RTC" gate="A" x="83.82" y="48.26" smashed="yes">
<attribute name="NAME" x="77.47" y="56.515" size="1.778" layer="95"/>
<attribute name="VALUE" x="77.47" y="40.64" size="1.778" layer="96"/>
</instance>
<instance part="I2C_BUS2" gate="A" x="20.32" y="48.26" smashed="yes">
<attribute name="NAME" x="13.97" y="56.515" size="1.778" layer="95"/>
<attribute name="VALUE" x="13.97" y="40.64" size="1.778" layer="96"/>
</instance>
<instance part="I2C_BUS3" gate="A" x="33.02" y="48.26" smashed="yes">
<attribute name="NAME" x="26.67" y="56.515" size="1.778" layer="95"/>
<attribute name="VALUE" x="26.67" y="40.64" size="1.778" layer="96"/>
</instance>
<instance part="I2C_BUS4" gate="A" x="45.72" y="48.26" smashed="yes">
<attribute name="NAME" x="39.37" y="56.515" size="1.778" layer="95"/>
<attribute name="VALUE" x="39.37" y="40.64" size="1.778" layer="96"/>
</instance>
<instance part="I2C_BUS5" gate="A" x="58.42" y="48.26" smashed="yes">
<attribute name="NAME" x="52.07" y="56.515" size="1.778" layer="95"/>
<attribute name="VALUE" x="52.07" y="40.64" size="1.778" layer="96"/>
</instance>
<instance part="I2C_BUS6" gate="A" x="71.12" y="48.26" smashed="yes">
<attribute name="NAME" x="64.77" y="56.515" size="1.778" layer="95"/>
<attribute name="VALUE" x="64.77" y="40.64" size="1.778" layer="96"/>
</instance>
</instances>
<busses>
</busses>
<nets>
<net name="GND" class="0">
<segment>
<pinref part="I2C_BUS1" gate="A" pin="1"/>
<pinref part="RTC" gate="A" pin="1"/>
<wire x1="5.08" y1="53.34" x2="17.78" y2="53.34" width="0.1524" layer="91"/>
<pinref part="I2C_BUS2" gate="A" pin="1"/>
<wire x1="17.78" y1="53.34" x2="30.48" y2="53.34" width="0.1524" layer="91"/>
<junction x="17.78" y="53.34"/>
<pinref part="I2C_BUS3" gate="A" pin="1"/>
<wire x1="30.48" y1="53.34" x2="43.18" y2="53.34" width="0.1524" layer="91"/>
<junction x="30.48" y="53.34"/>
<pinref part="I2C_BUS4" gate="A" pin="1"/>
<wire x1="43.18" y1="53.34" x2="55.88" y2="53.34" width="0.1524" layer="91"/>
<junction x="43.18" y="53.34"/>
<pinref part="I2C_BUS5" gate="A" pin="1"/>
<wire x1="55.88" y1="53.34" x2="68.58" y2="53.34" width="0.1524" layer="91"/>
<junction x="55.88" y="53.34"/>
<pinref part="I2C_BUS6" gate="A" pin="1"/>
<wire x1="68.58" y1="53.34" x2="81.28" y2="53.34" width="0.1524" layer="91"/>
<junction x="68.58" y="53.34"/>

</segment>
</net>
<net name="5V" class="0">
<segment>
<pinref part="I2C_BUS1" gate="A" pin="2"/>
<pinref part="RTC" gate="A" pin="2"/>
<wire x1="5.08" y1="50.8" x2="17.78" y2="50.8" width="0.1524" layer="91"/>
<pinref part="I2C_BUS2" gate="A" pin="2"/>
<wire x1="17.78" y1="50.8" x2="30.48" y2="50.8" width="0.1524" layer="91"/>
<junction x="17.78" y="50.8"/>
<pinref part="I2C_BUS3" gate="A" pin="2"/>
<wire x1="30.48" y1="50.8" x2="43.18" y2="50.8" width="0.1524" layer="91"/>
<junction x="30.48" y="50.8"/>
<pinref part="I2C_BUS4" gate="A" pin="2"/>
<wire x1="43.18" y1="50.8" x2="55.88" y2="50.8" width="0.1524" layer="91"/>
<junction x="43.18" y="50.8"/>
<pinref part="I2C_BUS5" gate="A" pin="2"/>
<wire x1="55.88" y1="50.8" x2="68.58" y2="50.8" width="0.1524" layer="91"/>
<junction x="55.88" y="50.8"/>
<pinref part="I2C_BUS6" gate="A" pin="2"/>
<wire x1="68.58" y1="50.8" x2="81.28" y2="50.8" width="0.1524" layer="91"/>
<junction x="68.58" y="50.8"/>

</segment>
</net>
<net name="SDA" class="0">
<segment>
<pinref part="I2C_BUS1" gate="A" pin="3"/>
<pinref part="RTC" gate="A" pin="3"/>
<wire x1="5.08" y1="48.26" x2="17.78" y2="48.26" width="0.1524" layer="91"/>
<pinref part="I2C_BUS2" gate="A" pin="3"/>
<wire x1="17.78" y1="48.26" x2="30.48" y2="48.26" width="0.1524" layer="91"/>
<junction x="17.78" y="48.26"/>
<pinref part="I2C_BUS3" gate="A" pin="3"/>
<wire x1="30.48" y1="48.26" x2="43.18" y2="48.26" width="0.1524" layer="91"/>
<junction x="30.48" y="48.26"/>
<pinref part="I2C_BUS4" gate="A" pin="3"/>
<wire x1="43.18" y1="48.26" x2="55.88" y2="48.26" width="0.1524" layer="91"/>
<junction x="43.18" y="48.26"/>
<pinref part="I2C_BUS5" gate="A" pin="3"/>
<wire x1="55.88" y1="48.26" x2="68.58" y2="48.26" width="0.1524" layer="91"/>
<junction x="55.88" y="48.26"/>
<pinref part="I2C_BUS6" gate="A" pin="3"/>
<wire x1="68.58" y1="48.26" x2="81.28" y2="48.26" width="0.1524" layer="91"/>
<junction x="68.58" y="48.26"/>

</segment>
</net>
<net name="SCL" class="0">
<segment>
<pinref part="RTC" gate="A" pin="4"/>
<pinref part="I2C_BUS1" gate="A" pin="4"/>
<wire x1="81.28" y1="45.72" x2="68.58" y2="45.72" width="0.1524" layer="91"/>
<pinref part="I2C_BUS2" gate="A" pin="4"/>
<wire x1="68.58" y1="45.72" x2="55.88" y2="45.72" width="0.1524" layer="91"/>
<wire x1="55.88" y1="45.72" x2="43.18" y2="45.72" width="0.1524" layer="91"/>
<wire x1="43.18" y1="45.72" x2="30.48" y2="45.72" width="0.1524" layer="91"/>
<wire x1="30.48" y1="45.72" x2="17.78" y2="45.72" width="0.1524" layer="91"/>
<wire x1="17.78" y1="45.72" x2="5.08" y2="45.72" width="0.1524" layer="91"/>
<junction x="17.78" y="45.72"/>
<pinref part="I2C_BUS3" gate="A" pin="4"/>
<junction x="30.48" y="45.72"/>
<pinref part="I2C_BUS4" gate="A" pin="4"/>
<junction x="43.18" y="45.72"/>
<pinref part="I2C_BUS5" gate="A" pin="4"/>
<junction x="55.88" y="45.72"/>
<pinref part="I2C_BUS6" gate="A" pin="4"/>
<junction x="68.58" y="45.72"/>

</segment>
</net>
</nets>
</sheet>
</sheets>
</schematic>
</drawing>
</eagle>

repository: ThomasKulin/GrowController

path: /Hardware/V2/I2C Interface.sch

repo_name: ThomasKulin/GrowController

extension: sch

filename: I2C Interface.sch


text:
using Chrono.Client;
using Chrono.Host.Services;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Chrono.Functional.Tests
{
    [TestClass]
    public class SessionModeServiceTests
    {
        private SessionModeService subject;

        [TestMethod]
        public void GetSessionMode_SessionIdDoesNotExist_ShouldBeRecord()
        {
            subject = new SessionModeService();

            var result = subject.GetSessionMode("qwe");

            result.Should().Be(ChronoSessionMode.Record);
        }

        [TestMethod]
        public void GetSessionMode_PlaySession_ShouldBePlay()
        {
            subject = new SessionModeService();
            subject.PlaySession("qwe");

            var result = subject.GetSessionMode("qwe");

            result.Should().Be(ChronoSessionMode.Play);
        }

        [TestMethod]
        public void GetSessionMode_RecordSession_ShouldBeRecord()
        {
            subject = new SessionModeService();
            subject.RecordSession("qwe");

            var result = subject.GetSessionMode("qwe");

            result.Should().Be(ChronoSessionMode.Record);
        }
    }
}

repository: Levchenkov/Chrono

repo_name: Levchenkov/Chrono


text:
package utils

import (
	"os"
    "path/filepath"
    "html/template"
    "log"
    "bytes"
)

func Template(name string) *template.Template{
	var buffer bytes.Buffer
    dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
    if err != nil {
        log.Fatal(err)
    }
    buffer.WriteString(dir)
    buffer.WriteString("/")
    buffer.WriteString("static/")
    buffer.WriteString(name)
    buffer.WriteString(".html")

    t, err := template.ParseFiles(buffer.String())
    if err != nil {
        log.Fatal("There was an error:", err)
    }
    return t
}

repository: peinguin/ThroneRushBot

repo_name: peinguin/ThroneRushBot