text:
inref part="IC1" gate="AN_POWER" pin="VDDA"/>
<pinref part="+3V3A1" gate="G$1" pin="+3V3A"/>
<wire x1="60.96" y1="17.78" x2="68.58" y2="17.78" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$1" class="0">
<segment>
<pinref part="IC1" gate="PORTF/OSC" pin="PF1/OSC=>"/>
<pinref part="X1" gate="G$1" pin="1"/>
<wire x1="60.96" y1="58.42" x2="66.04" y2="58.42" width="0.1524" layer="91"/>
<pinref part="C1" gate="G$1" pin="1"/>
<wire x1="66.04" y1="58.42" x2="71.12" y2="58.42" width="0.1524" layer="91"/>
<junction x="66.04" y="58.42"/>
</segment>
</net>
<net name="N$2" class="0">
<segment>
<pinref part="IC1" gate="PORTF/OSC" pin="PF0/OSC<="/>
<wire x1="60.96" y1="60.96" x2="66.04" y2="60.96" width="0.1524" layer="91"/>
<wire x1="66.04" y1="60.96" x2="66.04" y2="68.58" width="0.1524" layer="91"/>
<wire x1="66.04" y1="68.58" x2="83.82" y2="68.58" width="0.1524" layer="91"/>
<wire x1="83.82" y1="68.58" x2="83.82" y2="58.42" width="0.1524" layer="91"/>
<pinref part="X1" gate="G$1" pin="3"/>
<wire x1="83.82" y1="58.42" x2="78.74" y2="58.42" width="0.1524" layer="91"/>
<pinref part="C2" gate="G$1" pin="1"/>
<junction x="83.82" y="58.42"/>
</segment>
</net>
<net name="N$4" class="0">
<segment>
<pinref part="USB" gate="G$1" pin="1"/>
<wire x1="160.02" y1="50.8" x2="157.48" y2="50.8" width="0.1524" layer="91"/>
<wire x1="157.48" y1="50.8" x2="157.48" y2="55.88" width="0.1524" layer="91"/>
<wire x1="157.48" y1="55.88" x2="154.94" y2="55.88" width="0.1524" layer="91"/>
<pinref part="L1" gate="G$1" pin="2"/>
</segment>
</net>
<net name="N$5" class="0">
<segment>
<pinref part="USB" gate="G$1" pin="2"/>
<wire x1="160.02" y1="48.26" x2="149.86" y2="48.26" width="0.1524" layer="91"/>
<pinref part="R1" gate="G$1" pin="2"/>
</segment>
</net>
<net name="N$6" class="0">
<segment>
<pinref part="USB" gate="G$1" pin="3"/>
<wire x1="160.02" y1="45.72" x2="154.94" y2="45.72" width="0.1524" layer="91"/>
<wire x1="154.94" y1="45.72" x2="154.94" y2="40.64" width="0.1524" layer="91"/>
<wire x1="154.94" y1="40.64" x2="149.86" y2="40.64" width="0.1524" layer="91"/>
<pinref part="R2" gate="G$1" pin="2"/>
</segment>
</net>
<net name="N$20" class="0">
<segment>
<pinref part="IC3" gate="G$1" pin="NR"/>
<wire x1="119.38" y1="116.84" x2="121.92" y2="116.84" width="0.1524" layer="91"/>
<pinref part="C7" gate="G$1" pin="1"/>
</segment>
</net>
<net name="VBUS" class="0">
<segment>
<pinref part="L1" gate="G$1" pin="1"/>
<wire x1="147.32" y1="55.88" x2="144.78" y2="55.88" width="0.1524" layer="91"/>
<label x="132.08" y="55.88" size="1.778" layer="95" rot="MR0"/>
<pinref part="C8" gate="G$1" pin="1"/>
<wire x1="144.78" y1="55.88" x2="137.16" y2="55.88" width="0.1524" layer="91"/>
<wire x1="137.16" y1="55.88" x2="134.62" y2="55.88" width="0.1524" layer="91"/>
<wire x1="137.16" y1="58.42" x2="137.16" y2="55.88" width="0.1524" layer="91"/>
<junction x="137.16" y="55.88"/>
<pinref part="C9" gate="G$1" pin="1"/>
<wire x1="144.78" y1="58.42" x2="144.78" y2="55.88" width="0.1524" layer="91"/>
<junction x="144.78" y="55.88"/>
</segment>
<segment>
<pinref part="IC3" gate="G$1" pin="IN"/>
<wire x1="99.06" y1="119.38" x2="96.52" y2="119.38" width="0.1524" layer="91"/>
<pinref part="IC3" gate="G$1" pin="EN"/>
<wire x1="96.52" y1="119.38" x2="88.9" y2="119.38" width="0.1524" layer="91"/>
<wire x1="88.9" y1="119.38" x2="81.28" y2="119.38" width="0.1524" layer="91"/>
<wire x1="99.06" y1="116.84" x2="96.52" y2="116.84" width="0.1524" layer="91"/>
<wire x1="96.52" y1="116.84" x2="96.52" y2="119.38" width="0.1524" layer="91"/>
<junction x="96.52" y="119.38"/>
<label x="81.28" y="121.92" size="1.778" layer="95" rot="MR180"/>
<pinref part="C16" gate="G$1" pin="1"/>
<junction x="88.9" y="119.38"/>
</segment>
</net>
<net name="ALERT" class="0">
<segment>
<pinref part="JP1" gate="A" pin="5"/>
<wire x1="170.18" y1="81.28" x2="165.1" y2="81.28" width="0.1524" layer="91"/>
<label x="162.56" y="81.28" size="1.778" layer="95" rot="MR0"/>
</segment>
<segment>
<pinref part="IC1" gate="PORTB_L" pin="PB7"/>
<wire x1="60.96" y1="104.14" x2="63.5" y2="104.14" width="0.1524" layer="91"/>
<label x="66.04" y="104.14" size="1.778" layer="95"/>
</segment>
</net>
<net name="CA" class="0">
<segment>
<pinref part="IC1" gate="PORTA_L" pin="PA2/ADC1_CH3"/>
<wire x1="17.78" y1="116.84" x2="15.24" y2="116.84" width="0.1524" layer="91"/>
<label x="12.7" y="116.84" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="BA" class="0">
<segment>
<pinref part="IC1" gate="PORTA_L" pin="PA4/ADC2_CH1"/>
<wire x1="17.78" y1="111.76" x2="15.24" y2="111.76" width="0.1524" layer="91"/>
<label x="12.7" y="111.76" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="AA" class="0">
<segment>
<pinref part="IC1" gate="PORTA_L" pin="PA3/ADC1_CH4"/>
<wire x1="17.78" y1="114.3" x2="15.24" y2="114.3" width="0.1524" layer="91"/>
<label x="12.7" y="114.3" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="DA" class="0">
<segment>
<pinref part="IC1" gate="PORTA_L" pin="PA5/ADC2_CH2"/>
<wire x1="17.78" y1="109.22" x2="15.24" y2="109.22" width="0.1524" layer="91"/>
<label x="12.7" y="109.22" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="BOOT0" class="0">
<segment>
<pinref part="IC1" gate="RESET/BOOT" pin="BOOT0"/>
<wire x1="60.96" y1="38.1" x2="63.5" y2="38.1" width="0.1524" layer="91"/>
<label x="66.04" y="38.1" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="R4" gate="G$1" pin="1"/>
<pinref part="BLDR" gate="1" pin="2"/>
<wire x1="106.68" y1="33.02" x2="109.22" y2="33.02" width="0.1524" layer="91"/>
<wire x1="109.22" y1="33.02" x2="111.76" y2="33.02" width="0.1524" layer="91"/>
<wire x1="109.22" y1="33.02" x2="109.22" y2="45.72" width="0.1524" layer="91"/>
<junction x="109.22" y="33.02"/>
<label x="106.68" y="45.72" size="1.778" layer="95" rot="R270"/>
</segment>
</net>
<net name="TRG" class="0">
<segment>
<pinref part="IC1" gate="PORTB_L" pin="TIM8_CH1/PB6"/>
<wire x1="60.96" y1="106.68" x2="63.5" y2="106.68" width="0.1524" layer="91"/>
<label x="66.04" y="106.68" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="JP4" gate="-1" pin="S"/>
<wire x1="132.08" y1="91.44" x2="129.54" y2="91.44" width="0.1524" layer="91"/>
<label x="127" y="91.44" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="LEDA" class="0">
<segment>
<pinref part="IC1" gate="PORTB_L" pin="TIM3_CH3/PB0"/>
<wire x1="60.96" y1="121.92" x2="63.5" y2="121.92" width="0.1524" layer="91"/>
<label x="66.04" y="121.92" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="R22" gate="G$1" pin="1"/>
<wire x1="101.6" y1="68.58" x2="99.06" y2="68.58" width="0.1524" layer="91"/>
<label x="96.52" y="68.58" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="LEDB" class="0">
<segment>
<pinref part="IC1" gate="PORTB_L" pin="TIM3_CH4/PB1"/>
<wire x1="60.96" y1="119.38" x2="63.5" y2="119.38" width="0.1524" layer="91"/>
<label x="66.04" y="119.38" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="R23" gate="G$1" pin="1"/>
<wire x1="101.6" y1="58.42" x2="99.06" y2="58.42" width="0.1524" layer="91"/>
<label x="96.52" y="58.42" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="N$19" class="0">
<segment>
<pinref part="A" gate="G$1" pin="A"/>
<pinref part="R22" gate="G$1" pin="2"/>
</segment>
</net>
<net name="N$21" class="0">
<segment>
<pinref part="B" gate="G$1" pin="A"/>
<pinref part="R23" gate="G$1" pin="2"/>
</segment>
</net>
</nets>
</sheet>
<sheet>
<plain>
<text x="40.64" y="121.92" size="1.778" layer="97">8kHz anti-aliasing filter</text>
</plain>
<instances>
<instance part="FRAME2" gate="G$1" x="0" y="0"/>
<instance part="IC7" gate="G$1" x="99.06" y="106.68"/>
<instance part="GND37" gate="1" x="83.82" y="96.52"/>
<instance part="L4" gate="G$1" x="101.6" y="121.92"/>
<instance part="R27" gate="G$1" x="111.76" y="93.98" rot="R270"/>
<instance part="R28" gate="G$1" x="142.24" y="93.98" rot="R270"/>
<instance part="R29" gate="G$1" x="124.46" y="109.22" rot="R270"/>
<instance part="R30" gate="G$1" x="142.24" y="109.22" rot="R270"/>
<instance part="GND38" gate="1" x="111.76" y="86.36"/>
<instance part="C33" gate="G$1" x="132.08" y="109.22"/>
<instance part="C34" gate="G$1" x="149.86" y="104.14"/>
<instance part="C35" gate="G$1" x="83.82" y="109.22"/>
<instance part="U1" gate="_2" x="25.4" y="114.3"/>
<instance part="U1" gate="_1" x="25.4" y="83.82"/>
<instance part="U2" gate="_2" x="25.4" y="53.34"/>
<instance part="U2" gate="_1" x="25.4" y="22.86"/>
<instance part="R5" gate="G$1" x="25.4" y="124.46"/>
<instance part="R6" gate="G$1" x="35.56" y="91.44" rot="R270"/>
<instance part="R7" gate="G$1" x="25.4" y="63.5"/>
<instance part="R8" gate="G$1" x="35.56" y="30.48" rot="R270"/>
<instance part="R9" gate="G$1" x="12.7" y="116.84" rot="R90"/>
<instance part="R10" gate="G$1" x="12.7" y="86.36" rot="R90"/>
<instance part="R11" gate="G$1" x="12.7" y="55.88" rot="R90"/>
<instance part="R12" gate="G$1" x="12.7" y="25.4" rot="R90"/>
<instance part="R13" gate="G$1" x="40.64" y="114.3"/>
<instance part="R14" gate="G$1" x="40.64" y="83.82"/>
<instance part="R15" gate="G$1" x="40.64" y="53.34"/>
<instance part="R16" gate="G$1" x="40.64" y="22.86"/>
<instance part="R17" gate="G$1" x="12.7" y="106.68" rot="R270"/>
<instance part="R18" gate="G$1" x="12.7" y="76.2" rot="R270"/>
<instance part="R19" gate="G$1" x="12.7" y="45.72" rot="R270"/>
<instance part="R20" gate="G$1" x="12.7" y="15.24" rot="R270"/>
<instance part="C3" gate="G$1" x="45.72" y="109.22"/>
<instance part="C4" gate="G$1" x="45.72" y="78.74"/>
<instance part="C5" gate="G$1" x="45.72" y="48.26"/>
<instance part="C6" gate="G$1" x="45.72" y="17.78"/>
<instance part="GND5" gate="1" x="12.7" y="99.06"/>
<instance part="GND6" gate="1" x="12.7" y="68.58"/>
<instance part="GND7" gate="1" x="12.7" y="7.62"/>
<instance part="GND8" gate="1" x="12.7" y="38.1"/>
<instance part="5A+1" gate="1" x="27.94" y="91.44" rot="R270"/>
<instance part="5A+2" gate="1" x="27.94" y="30.48" rot="R270"/>
<instance part="GND11" gate="1" x="88.9" y="30.48"/>
<instance part="5A+3" gate="1" x="137.16" y="48.26" rot="R270"/>
<instance part="JP2" gate="-1" x="170.18" y="78.74"/>
<instance part="JP2" gate="-2" x="170.18" y="53.34"/>
<instance part="JP2" gate="-3" x="170.18" y="73.66"/>
<instance part="JP2" gate="-4" x="170.18" y="48.26"/>
<instance part="JP2" gate="-5" x="170.18" y="68.58"/>
<instance part="JP2" gate="-6" x="170.18" y="43.18"/>
<instance part="JP2" gate="-7" x="170.18" y="63.5"/>
<instance part="JP2" gate="-8" x="170.18" y="38.1"/>
<instance part="JP2" gate="-9" x="170.18" y="58.42"/>
<instance part="JP2" gate="-10" x="170.18" y="33.02"/>
<instance part="GND13" gate="1" x="162.56" y="27.94"/>
<instance part="C10" gate="G$1" x="106.68" y="43.18"/>
<instance part="C11" gate="G$1" x="116.84" y="43.18"/>
<instance part="SUPPLY1" gate="G$1" x="172.72" y="121.92"/>
<instance part="SUPPLY2" gate="G$1" x="73.66" y="53.34"/>
<instance part="IC4" gate="G$1" x="88.9" y="45.72"/>
<instance part="L2" gate="G$1" x="154.94" y="114.3"/>
<instance part="C12" gate="G$1" x="162.56" y="104.14"/>
<instance part="C13" gate="G$1" x="172.72" y="104.14"/>
<instance part="C14" gate="G$1" x="127" y="43.18"/>
<instance part="R21" gate="G$1" x="157.48" y="124.46"/>
<instance part="D2" gate="G$1" x="116.84" y="114.3"/>
<instance part="GND9" gate="1" x="93.98" y="60.96"/>
<instance part="+3V3A2" gate="G$1" x="129.54" y="73.66" rot="R270"/>
<instance part="IC2" gate="G$1" x="93.98" y="68.58"/>
<instance part="C17" gate="G$1" x="73.66" y="71.12"/>
<instance part="C19" gate="G$1" x="109.22" y="71.12"/>
<instance part="C23" gate="G$1" x="119.38" y="71.12"/>
<instance part="5A+4" gate="1" x="73.66" y="81.28"/>
<instance part="L3" gate="G$1" x="76.2" y="114.3"/>
<instance part="C15" gate="G$1" x="66.04" y="109.22"/>
<instance part="JP5" gate="G$1" x="73.66" y="22.86"/>
<instance part="GND20" gate="1" x="66.04" y="17.78"/>
<instance part="SUPPLY3" gate="G$1" x="63.5" y="25.4" rot="R90"/>
</instances>
<busses>
</busses>
<nets>
<net name="GND" class="0">
<segment>
<pinref part="IC7" gate="G$1" pin="GND"/>
<pinref part="GND37" gate="1" pin="GND"/>
<wire x1="88.9" y1="101.6" x2="83.82" y2="101.6" width="0.1524" layer="91"/>
<wire x1="83.82" y1="101.6" x2="83.82" y2="99.06" width="0.1524" layer="91"/>
<pinref part="C35" gate="G$1" pin="2"/>
<wire x1="83.82" y1="104.14" x2="83.82" y2="101.6" width="0.1524" layer="91"/>
<junction x="83.82" y="101.6"/>
<pinref part="C15" gate="G$1" pin="2"/>
<wire x1="66.04" y1="104.14" x2="66.04" y2="101.6" width="0.1524" layer="91"/>
<wire x1="66.04" y1="101.6" x2="83.82" y2="101.6" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="R27" gate="G$1" pin="2"/>
<pinref part="GND38" gate="1" pin="GND"/>
<pinref part="R28" gate="G$1" pin="2"/>
<wire x1="142.24" y1="88.9" x2="111.76" y2="88.9" width="0.1524" layer="91"/>
<junction x="111.76" y="88.9"/>
<pinref part="C34" gate="G$1" pin="2"/>
<wire x1="149.86" y1="99.06" x2="149.86" y2="88.9" width="0.1524" layer="91"/>
<wire x1="149.86" y1="88.9" x2="142.24" y2="88.9" width="0.1524" layer="91"/>
<junction x="142.24" y="88.9"/>
<pinref part="C12" gate="G$1" pin="2"/>
<wire x1="149.86" y1="88.9" x2="162.56" y2="88.9" width="0.1524" layer="91"/>
<wire x1="162.56" y1="88.9" x2="162.56" y2="99.06" width="0.1524" layer="91"/>
<junction x="149.86" y="88.9"/>
<pinref part="C13" gate="G$1" pin="2"/>
<wire x1="162.56" y1="88.9" x2="172.72" y2="88.9" width="0.1524" layer="91"/>
<wire x1="172.72" y1="88.9" x2="172.72" y2="99.06" width="0.1524" layer="91"/>
<junction x="162.56" y="88.9"/>
</segment>
<segment>
<pinref part="GND5" gate="1" pin="GND"/>
<pinref part="R17" gate="G$1" pin="2"/>
<pinref part="C3" gate="G$1" pin="2"/>
<wire x1="45.72" y1="101.6" x2="45.72" y2="104.14" width="0.1524" layer="91"/>
<wire x1="45.72" y1="101.6" x2="12.7" y2="101.6" width="0.1524" layer="91"/>
<junction x="12.7" y="101.6"/>
</segment>
<segment>
<pinref part="R18" gate="G$1" pin="2"/>
<pinref part="GND6" gate="1" pin="GND"/>
<pinref part="U1" gate="_1" pin="V-"/>
<wire x1="22.86" y1="76.2" x2="22.86" y2="71.12" width="0.1524" layer="91"/>
<pinref part="C4" gate="G$1" pin="2"/>
<wire x1="22.86" y1="71.12" x2="45.72" y2="71.12" width="0.1524" layer="91"/>
<wire x1="45.72" y1="71.12" x2="45.72" y2="73.66" width="0.1524" layer="91"/>
<wire x1="22.86" y1="71.12" x2="12.7" y2="71.12" width="0.1524" layer="91"/>
<junction x="12.7" y="71.12"/>
<junction x="22.86" y="71.12"/>
</segment>
<segment>
<pinref part="R19" gate="G$1" pin="2"/>
<pinref part="GND8" gate="1" pin="GND"/>
<pinref part="C5" gate="G$1" pin="2"/>
<wire x1="45.72" y1="40.64" x2="45.72" y2="43.18" width="0.1524" layer="91"/>
<wire x1="45.72" y1="40.64" x2="12.7" y2="40.64" width="0.1524" layer="91"/>
<junction x="12.7" y="40.64"/>
</segment>
<segment>
<pinref part="R20" gate="G$1" pin="2"/>
<pinref part="GND7" gate="1" pin="GND"/>
<pinref part="U2" gate="_1" pin="V-"/>
<wire x1="22.86" y1="10.16" x2="22.86" y2="15.24" width="0.1524" layer="91"/>
<pinref part="C6" gate="G$1" pin="2"/>
<wire x1="45.72" y1="12.7" x2="45.72" y2="10.16" width="0.1524" layer="91"/>
<wire x1="45.72" y1="10.16" x2="22.86" y2="10.16" width="0.1524" layer="91"/>
<wire x1="22.86" y1="10.16" x2="12.7" y2="10.16" width="0.1524" layer="91"/>
<junction x="12.7" y="10.16"/>
<junction x="22.86" y="10.16"/>
</segment>
<segment>
<pinref part="GND11" gate="1" pin="GND"/>
<pinref part="C10" gate="G$1" pin="2"/>
<wire x1="88.9" y1="33.02" x2="106.68" y2="33.02" width="0.1524" layer="91"/>
<wire x1="106.68" y1="33.02" x2="106.68" y2="38.1" width="0.1524" layer="91"/>
<pinref part="C11" gate="G$1" pin="2"/>
<wire x1="106.68" y1="33.02" x2="116.84" y2="33.02" width="0.1524" layer="91"/>
<wire x1="116.84" y1="33.02" x2="116.84" y2="38.1" width="0.1524" layer="91"/>
<junction x="106.68" y="33.02"/>
<pinref part="IC4" gate="G$1" pin="GND"/>
<junction x="88.9" y="33.02"/>
<pinref part="C14" gate="G$1" pin="2"/>
<wire x1="116.84" y1="33.02" x2="127" y2="33.02" width="0.1524" layer="91"/>
<wire x1="127" y1="33.02" x2="127" y2="38.1" width="0.1524" layer="91"/>
<junction x="116.84" y="33.02"/>
</segment>
<segment>
<pinref part="JP2" gate="-1" pin="S"/>
<pinref part="GND13" gate="1" pin="GND"/>
<wire x1="165.1" y1="78.74" x2="162.56" y2="78.74" width="0.1524" layer="91"/>
<wire x1="162.56" y1="78.74" x2="162.56" y2="68.58" width="0.1524" layer="91"/>
<pinref part="JP2" gate="-2" pin="S"/>
<wire x1="162.56" y1="68.58" x2="162.56" y2="58.42" width="0.1524" layer="91"/>
<wire x1="162.56" y1="58.42" x2="162.56" y2="53.34" width="0.1524" layer="91"/>
<wire x1="162.56" y1="53.34" x2="162.56" y2="43.18" width="0.1524" layer="91"/>
<wire x1="162.56" y1="43.18" x2="162.56" y2="33.02" width="0.1524" layer="91"/>
<wire x1="162.56" y1="33.02" x2="162.56" y2="30.48" width="0.1524" layer="91"/>
<wire x1="165.1" y1="53.34" x2="162.56" y2="53.34" width="0.1524" layer="91"/>
<pinref part="JP2" gate="-5" pin="S"/>
<wire x1="165.1" y1="68.58" x2="162.56" y2="68.58" width="0.1524" layer="91"/>
<pinref part="JP2" gate="-6" pin="S"/>
<wire x1="165.1" y1="43.18" x2="162.56" y2="43.18" width="0.1524" layer="91"/>
<pinref part="JP2" gate="-9" pin="S"/>
<wire x1="165.1" y1="58.42" x2="162.56" y2="58.42" width="0.1524" layer="91"/>
<pinref part="JP2" gate="-10" pin="S"/>
<wire x1="165.1" y1="33.02" x2="162.56" y2="33.02" width="0.1524" layer="91"/>
<junction x="162.56" y="33.02"/>
<junction x="162.56" y="43.18"/>
<junction x="162.56" y="53.34"/>
<junction x="162.56" y="58.42"/>
<junction x="162.56" y="68.58"/>
</segment>
<segment>
<pinref part="GND9" gate="1" pin="GND"/>
<pinref part="IC2" gate="G$1" pin="GND"/>
<pinref part="C17" gate="G$1" pin="2"/>
<wire x1="73.66" y1="66.04" x2="73.66" y2="63.5" width="0.1524" layer="91"/>
<wire x1="73.66" y1="63.5" x2="93.98" y2="63.5" width="0.1524" layer="91"/>
<junction x="93.98" y="63.5"/>
<pinref part="C19" gate="G$1" pin="2"/>
<wire x1="109.22" y1="66.04" x2="109.22" y2="63.5" width="0.1524" layer="91"/>
<wire x1="93.98" y1="63.5" x2="109.22" y2="63.5" width="0.1524" layer="91"/>
<pinref part="C23" gate="G$1" pin="2"/>
<wire x1="109.22" y1="63.5" x2="119.38" y2="63.5" width="0.1524" layer="91"/>
<wire x1="119.38" y1="63.5" x2="119.38" y2="66.04" width="0.1524" layer="91"/>
<junction x="109.22" y="63.5"/>
</segment>
<segment>
<pinref part="JP5" gate="G$1" pin="2"/>
<wire x1="71.12" y1="22.86" x2="66.04" y2="22.86" width="0.1524" layer="91"/>
<wire x1="66.04" y1="22.86" x2="66.04" y2="20.32" width="0.1524" layer="91"/>
<pinref part="GND20" gate="1" pin="GND"/>
</segment>
</net>
<net name="SW" class="0">
<segment>
<pinref part="IC7" gate="G$1" pin="SW"/>
<wire x1="114.3" y1="114.3" x2="111.76" y2="114.3" width="0.1524" layer="91"/>
<pinref part="L4" gate="G$1" pin="2"/>
<wire x1="111.76" y1="114.3" x2="109.22" y2="114.3" width="0.1524" layer="91"/>
<wire x1="106.68" y1="121.92" x2="111.76" y2="121.92" width="0.1524" layer="91"/>
<wire x1="111.76" y1="121.92" x2="111.76" y2="114.3" width="0.1524" layer="91"/>
<junction x="111.76" y="114.3"/>
<pinref part="D2" gate="G$1" pin="A"/>
</segment>
</net>
<net name="OVP" class="0">
<segment>
<pinref part="R29" gate="G$1" pin="2"/>
<pinref part="IC7" gate="G$1" pin="OVP"/>
<wire x1="109.22" y1="104.14" x2="111.76" y2="104.14" width="0.1524" layer="91"/>
<pinref part="R27" gate="G$1" pin="1"/>
<wire x1="111.76" y1="104.14" x2="124.46" y2="104.14" width="0.1524" layer="91"/>
<wire x1="111.76" y1="99.06" x2="111.76" y2="104.14" width="0.1524" layer="91"/>
<junction x="111.76" y="104.14"/>
</segment>
</net>
<net name="FB" class="0">
<segment>
<pinref part="R30" gate="G$1" pin="2"/>
<pinref part="R28" gate="G$1" pin="1"/>
<wire x1="142.24" y1="104.14" x2="142.24" y2="101.6" width="0.1524" layer="91"/>
<wire x1="142.24" y1="101.6" x2="142.24" y2="99.06" width="0.1524" layer="91"/>
<junction x="142.24" y="101.6"/>
<pinref part="C33" gate="G$1" pin="2"/>
<wire x1="132.08" y1="101.6" x2="142.24" y2="101.6" width="0.1524" layer="91"/>
<wire x1="132.08" y1="104.14" x2="132.08" y2="101.6" width="0.1524" layer="91"/>
<pinref part="IC7" gate="G$1" pin="FB"/>
<wire x1="109.22" y1="101.6" x2="132.08" y2="101.6" width="0.1524" layer="91"/>
<junction x="132.08" y="101.6"/>
</segment>
</net>
<net name="N$3" class="0">
<segment>
<pinref part="U1" gate="_2" pin="OUT"/>
<pinref part="R13" gate="G$1" pin="1"/>
<pinref part="R5" gate="G$1" pin="2"/>
<wire x1="35.56" y1="114.3" x2="33.02" y2="114.3" width="0.1524" layer="91"/>
<wire x1="30.48" y1="124.46" x2="35.56" y2="124.46" width="0.1524" layer="91"/>
<wire x1="35.56" y1="124.46" x2="35.56" y2="114.3" width="0.1524" layer="91"/>
<junction x="35.56" y="114.3"/>
</segment>
</net>
<net name="N$7" class="0">
<segment>
<pinref part="U1" gate="_1" pin="OUT"/>
<pinref part="R14" gate="G$1" pin="1"/>
<pinref part="R6" gate="G$1" pin="2"/>
<wire x1="35.56" y1="83.82" x2="33.02" y2="83.82" width="0.1524" layer="91"/>
<wire x1="35.56" y1="86.36" x2="35.56" y2="83.82" width="0.1524" layer="91"/>
<junction x="35.56" y="83.82"/>
</segment>
</net>
<net name="N$8" class="0">
<segment>
<pinref part="U2" gate="_2" pin="OUT"/>
<pinref part="R15" gate="G$1" pin="1"/>
<pinref part="R7" gate="G$1" pin="2"/>
<wire x1="35.56" y1="53.34" x2="33.02" y2="53.34" width="0.1524" layer="91"/>
<wire x1="30.48" y1="63.5" x2="35.56" y2="63.5" width="0.1524" layer="91"/>
<wire x1="35.56" y1="63.5" x2="35.56" y2="53.34" width="0.1524" layer="91"/>
<junction x="35.56" y="53.34"/>
</segment>
</net>
<net name="N$9" class="0">
<segment>
<pinref part="U2" gate="_1" pin="OUT"/>
<pinref part="R16" gate="G$1" pin="1"/>
<pinref part="R8" gate="G$1" pin="2"/>
<wire x1="35.56" y1="22.86" x2="33.02" y2="22.86" width="0.1524" layer="91"/>
<wire x1="35.56" y1="25.4" x2="35.56" y2="22.86" width="0.1524" layer="91"/>
<junction x="35.56" y="22.86"/>
</segment>
</net>
<net name="DA" class="0">
<segment>
<pinref part="R14" gate="G$1" pin="2"/>
<pinref part="C4" gate="G$1" pin="1"/>
<wire x1="45.72" y1="83.82" x2="48.26" y2="83.82" width="0.1524" layer="91"/>
<wire x1="45.72" y1="81.28" x2="45.72" y2="83.82" width="0.1524" layer="91"/>
<junction x="45.72" y="83.82"/>
<label x="50.8" y="83.82" size="1.778" layer="95"/>
</segment>
</net>
<net name="CA" class="0">
<segment>
<pinref part="R16" gate="G$1" pin="2"/>
<pinref part="C6" gate="G$1" pin="1"/>
<wire x1="45.72" y1="22.86" x2="48.26" y2="22.86" width="0.1524" layer="91"/>
<wire x1="45.72" y1="20.32" x2="45.72" y2="22.86" width="0.1524" layer="91"/>
<junction x="45.72" y="22.86"/>
<label x="50.8" y="22.86" size="1.778" layer="95"/>
</segment>
</net>
<net name="BA" class="0">
<segment>
<pinref part="R15" gate="G$1" pin="2"/>
<pinref part="C5" gate="G$1" pin="1"/>
<wire x1="45.72" y1="53.34" x2="48.26" y2="53.34" width="0.1524" layer="91"/>
<wire x1="45.72" y1="50.8" x2="45.72" y2="53.34" width="0.1524" layer="91"/>
<junction x="45.72" y="53.34"/>
<label x="50.8" y="53.34" size="1.778" layer="95"/>
</segment>
</net>
<net name="AA" class="0">
<segment>
<pinref part="R13" gate="G$1" pin="2"/>
<pinref part="C3" gate="G$1" pin="1"/>
<wire x1="45.72" y1="114.3" x2="48.26" y2="114.3" width="0.1524" layer="91"/>
<wire x1="45.72" y1="111.76" x2="45.72" y2="114.3" width="0.1524" layer="91"/>
<junction x="45.72" y="114.3"/>
<label x="50.8" y="114.3" size="1.778" layer="95"/>
</segment>
</net>
<net name="N$13" class="0">
<segment>
<pinref part="U1" gate="_2" pin="-IN"/>
<wire x1="17.78" y1="116.84" x2="17.78" y2="124.46" width="0.1524" layer="91"/>
<pinref part="R5" gate="G$1" pin="1"/>
<wire x1="17.78" y1="124.46" x2="20.32" y2="124.46" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$14" class="0">
<segment>
<pinref part="U2" gate="_2" pin="-IN"/>
<wire x1="17.78" y1="55.88" x2="17.78" y2="63.5" width="0.1524" layer="91"/>
<pinref part="R7" gate="G$1" pin="1"/>
<wire x1="17.78" y1="63.5" x2="20.32" y2="63.5" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$15" class="0">
<segment>
<pinref part="R8" gate="G$1" pin="1"/>
<wire x1="35.56" y1="35.56" x2="17.78" y2="35.56" width="0.1524" layer="91"/>
<wire x1="17.78" y1="35.56" x2="17.78" y2="25.4" width="0.1524" layer="91"/>
<pinref part="U2" gate="_1" pin="-IN"/>
</segment>
</net>
<net name="N$16" class="0">
<segment>
<pinref part="R6" gate="G$1" pin="1"/>
<wire x1="35.56" y1="96.52" x2="17.78" y2="96.52" width="0.1524" layer="91"/>
<wire x1="17.78" y1="96.52" x2="17.78" y2="86.36" width="0.1524" layer="91"/>
<pinref part="U1" gate="_1" pin="-IN"/>
</segment>
</net>
<net name="A" class="0">
<segment>
<pinref part="R9" gate="G$1" pin="2"/>
<wire x1="12.7" y1="121.92" x2="10.16" y2="121.92" width="0.1524" layer="91"/>
<label x="7.62" y="121.92" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="JP2" gate="-8" pin="S"/>
<wire x1="165.1" y1="38.1" x2="160.02" y2="38.1" width="0.1524" layer="91"/>
<label x="157.48" y="38.1" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="B" class="0">
<segment>
<pinref part="R11" gate="G$1" pin="2"/>
<wire x1="12.7" y1="60.96" x2="10.16" y2="60.96" width="0.1524" layer="91"/>
<label x="7.62" y="60.96" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="JP2" gate="-3" pin="S"/>
<wire x1="165.1" y1="73.66" x2="160.02" y2="73.66" width="0.1524" layer="91"/>
<label x="157.48" y="73.66" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="C" class="0">
<segment>
<pinref part="R12" gate="G$1" pin="2"/>
<wire x1="12.7" y1="30.48" x2="10.16" y2="30.48" width="0.1524" layer="91"/>
<label x="7.62" y="30.48" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="JP2" gate="-4" pin="S"/>
<wire x1="165.1" y1="48.26" x2="160.02" y2="48.26" width="0.1524" layer="91"/>
<label x="157.48" y="48.26" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="D" class="0">
<segment>
<pinref part="R10" gate="G$1" pin="2"/>
<wire x1="12.7" y1="91.44" x2="10.16" y2="91.44" width="0.1524" layer="91"/>
<label x="7.62" y="91.44" size="1.778" layer="95"/>
</segment>
<segment>
<pinref part="JP2" gate="-7" pin="S"/>
<wire x1="165.1" y1="63.5" x2="160.02" y2="63.5" width="0.1524" layer="91"/>
<label x="157.48" y="63.5" size="1.778" layer="95" rot="MR0"/>
</segment>
</net>
<net name="N$17" class="0">
<segment>
<pinref part="R9" gate="G$1" pin="1"/>
<pinref part="R17" gate="G$1" pin="1"/>
<pinref part="U1" gate="_2" pin="+IN"/>
<wire x1="17.78" y1="111.76" x2="12.7" y2="111.76" width="0.1524" layer="91"/>
<junction x="12.7" y="111.76"/>
</segment>
</net>
<net name="N$10" class="0">
<segment>
<pinref part="R10" gate="G$1" pin="1"/>
<pinref part="R18" gate="G$1" pin="1"/>
<pinref part="U1" gate="_1" pin="+IN"/>
<wire x1="17.78" y1="81.28" x2="12.7" y2="81.28" width="0.1524" layer="91"/>
<junction x="12.7" y="81.28"/>
</segment>
</net>
<net name="N$11" class="0">
<segment>
<pinref part="R11" gate="G$1" pin="1"/>
<pinref part="R19" gate="G$1" pin="1"/>
<pinref part="U2" gate="_2" pin="+IN"/>
<wire x1="17.78" y1="50.8" x2="12.7" y2="50.8" width="0.1524" layer="91"/>
<junction x="12.7" y="50.8"/>
</segment>
</net>
<net name="N$12" class="0">
<segment>
<pinref part="R12" gate="G$1" pin="1"/>
<pinref part="R20" gate="G$1" pin="1"/>
<pinref part="U2" gate="_1" pin="+IN"/>
<wire x1="17.78" y1="20.32" x2="12.7" y2="20.32" width="0.1524" layer="91"/>
<junction x="12.7" y="20.32"/>
</segment>
</net>
<net name="+5VA" class="0">
<segment>
<pinref part="U1" gate="_1" pin="V+"/>
<pinref part="5A+1" gate="1" pin="+5VA"/>
<wire x1="25.4" y1="91.44" x2="22.86" y2="91.44" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="U2" gate="_1" pin="V+"/>
<pinref part="5A+2" gate="1" pin="+5VA"/>
<wire x1="25.4" y1="30.48" x2="22.86" y2="30.48" width="0.1524" layer="91"/>
</segment>
<segment>
<wire x1="99.06" y1="48.26" x2="101.6" y2="48.26" width="0.1524" layer="91"/>
<wire x1="101.6" y1="48.26" x2="106.68" y2="48.26" width="0.1524" layer="91"/>
<wire x1="106.68" y1="48.26" x2="116.84" y2="48.26" width="0.1524" layer="91"/>
<wire x1="116.84" y1="48.26" x2="127" y2="48.26" width="0.1524" layer="91"/>
<wire x1="127" y1="48.26" x2="134.62" y2="48.26" width="0.1524" layer="91"/>
<wire x1="99.06" y1="45.72" x2="101.6" y2="45.72" width="0.1524" layer="91"/>
<wire x1="101.6" y1="45.72" x2="101.6" y2="48.26" width="0.1524" layer="91"/>
<junction x="101.6" y="48.26"/>
<pinref part="5A+3" gate="1" pin="+5VA"/>
<pinref part="C10" gate="G$1" pin="1"/>
<wire x1="106.68" y1="45.72" x2="106.68" y2="48.26" width="0.1524" layer="91"/>
<pinref part="C11" gate="G$1" pin="1"/>
<wire x1="116.84" y1="45.72" x2="116.84" y2="48.26" width="0.1524" layer="91"/>
<junction x="106.68" y="48.26"/>
<junction x="116.84" y="48.26"/>
<pinref part="IC4" gate="G$1" pin="OUT"/>
<pinref part="IC4" gate="G$1" pin="SENSE"/>
<pinref part="C14" gate="G$1" pin="1"/>
<wire x1="127" y1="45.72" x2="127" y2="48.26" width="0.1524" layer="91"/>
<junction x="127" y="48.26"/>
</segment>
<segment>
<wire x1="83.82" y1="73.66" x2="81.28" y2="73.66" width="0.1524" layer="91"/>
<wire x1="81.28" y1="73.66" x2="73.66" y2="73.66" width="0.1524" layer="91"/>
<wire x1="73.66" y1="73.66" x2="73.66" y2="78.74" width="0.1524" layer="91"/>
<wire x1="83.82" y1="71.12" x2="81.28" y2="71.12" width="0.1524" layer="91"/>
<wire x1="81.28" y1="71.12" x2="81.28" y2="73.66" width="0.1524" layer="91"/>
<junction x="81.28" y="73.66"/>
<pinref part="IC2" gate="G$1" pin="IN"/>
<pinref part="IC2" gate="G$1" pin="EN"/>
<pinref part="C17" gate="G$1" pin="1"/>
<junction x="73.66" y="73.66"/>
<pinref part="5A+4" gate="1" pin="+5VA"/>
</segment>
</net>
<net name="+9V" class="0">
<segment>
<pinref part="SUPPLY1" gate="G$1" pin="+9V"/>
<pinref part="L2" gate="G$1" pin="2"/>
<pinref part="C12" gate="G$1" pin="1"/>
<wire x1="160.02" y1="114.3" x2="162.56" y2="114.3" width="0.1524" layer="91"/>
<wire x1="162.56" y1="114.3" x2="162.56" y2="106.68" width="0.1524" layer="91"/>
<wire x1="162.56" y1="114.3" x2="172.72" y2="114.3" width="0.1524" layer="91"/>
<wire x1="172.72" y1="114.3" x2="172.72" y2="119.38" width="0.1524" layer="91"/>
<junction x="162.56" y="114.3"/>
<pinref part="C13" gate="G$1" pin="1"/>
<wire x1="172.72" y1="106.68" x2="172.72" y2="114.3" width="0.1524" layer="91"/>
<junction x="172.72" y="114.3"/>
<pinref part="R21" gate="G$1" pin="2"/>
<wire x1="162.56" y1="124.46" x2="162.56" y2="114.3" width="0.1524" layer="91"/>
</segment>
<segment>
<wire x1="78.74" y1="48.26" x2="73.66" y2="48.26" width="0.1524" layer="91"/>
<wire x1="73.66" y1="48.26" x2="73.66" y2="50.8" width="0.1524" layer="91"/>
<wire x1="78.74" y1="45.72" x2="73.66" y2="45.72" width="0.1524" layer="91"/>
<wire x1="73.66" y1="45.72" x2="73.66" y2="48.26" width="0.1524" layer="91"/>
<junction x="73.66" y="48.26"/>
<pinref part="SUPPLY2" gate="G$1" pin="+9V"/>
<pinref part="IC4" gate="G$1" pin="IN"/>
<pinref part="IC4" gate="G$1" pin="EN"/>
</segment>
<segment>
<pinref part="JP5" gate="G$1" pin="1"/>
<wire x1="71.12" y1="25.4" x2="66.04" y2="25.4" width="0.1524" layer="91"/>
<pinref part="SUPPLY3" gate="G$1" pin="+9V"/>
</segment>
</net>
<net name="+9VRAW" class="0">
<segment>
<pinref part="R30" gate="G$1" pin="1"/>
<wire x1="132.08" y1="114.3" x2="142.24" y2="114.3" width="0.1524" layer="91"/>
<wire x1="142.24" y1="114.3" x2="149.86" y2="114.3" width="0.1524" layer="91"/>
<junction x="142.24" y="114.3"/>
<pinref part="C33" gate="G$1" pin="1"/>
<wire x1="132.08" y1="114.3" x2="132.08" y2="111.76" width="0.1524" layer="91"/>
<pinref part="C34" gate="G$1" pin="1"/>
<wire x1="149.86" y1="106.68" x2="149.86" y2="114.3" width="0.1524" layer="91"/>
<wire x1="119.38" y1="114.3" x2="124.46" y2="114.3" width="0.1524" layer="91"/>
<junction x="132.08" y="114.3"/>
<wire x1="124.46" y1="114.3" x2="132.08" y2="114.3" width="0.1524" layer="91"/>
<pinref part="R29" gate="G$1" pin="1"/>
<junction x="124.46" y="114.3"/>
<pinref part="L2" gate="G$1" pin="1"/>
<wire x1="149.86" y1="114.3" x2="152.4" y2="114.3" width="0.1524" layer="91"/>
<junction x="149.86" y="114.3"/>
<wire x1="149.86" y1="114.3" x2="149.86" y2="124.46" width="0.1524" layer="91"/>
<pinref part="R21" gate="G$1" pin="1"/>
<wire x1="149.86" y1="124.46" x2="152.4" y2="124.46" width="0.1524" layer="91"/>
<pinref part="D2" gate="G$1" pin="C"/>
</segment>
</net>
<net name="+3V3A" class="0">
<segment>
<pinref part="+3V3A2" gate="G$1" pin="+3V3A"/>
<pinref part="C23" gate="G$1" pin="1"/>
<wire x1="119.38" y1="73.66" x2="127" y2="73.66" width="0.1524" layer="91"/>
<pinref part="C19" gate="G$1" pin="1"/>
<pinref part="IC2" gate="G$1" pin="OUT"/>
<wire x1="104.14" y1="73.66" x2="109.22" y2="73.66" width="0.1524" layer="91"/>
<junction x="109.22" y="73.66"/>
<wire x1="109.22" y1="73.66" x2="119.38" y2="73.66" width="0.1524" layer="91"/>
<junction x="119.38" y="73.66"/>
</segment>
</net>
<net name="VBUS" class="0">
<segment>
<pinref part="L3" gate="G$1" pin="1"/>
<wire x1="73.66" y1="114.3" x2="66.04" y2="114.3" width="0.1524" layer="91"/>
<pinref part="C15" gate="G$1" pin="1"/>
<wire x1="66.04" y1="114.3" x2="58.42" y2="114.3" width="0.1524" layer="91"/>
<wire x1="66.04" y1="111.76" x2="66.04" y2="114.3" width="0.1524" layer="91"/>
<junction x="66.04" y="114.3"/>
<label x="66.04" y="116.84" size="1.778" layer="95" rot="R180"/>
</segment>
</net>
<net name="VIN" class="0">
<segment>
<pinref part="IC7" gate="G$1" pin="EN"/>
<wire x1="88.9" y1="111.76" x2="83.82" y2="111.76" width="0.1524" layer="91"/>
<wire x1="83.82" y1="111.76" x2="83.82" y2="114.3" width="0.1524" layer="91"/>
<pinref part="IC7" gate="G$1" pin="VIN"/>
<wire x1="83.82" y1="114.3" x2="81.28" y2="114.3" width="0.1524" layer="91"/>
<wire x1="88.9" y1="114.3" x2="83.82" y2="114.3" width="0.1524" layer="91"/>
<junction x="83.82" y="114.3"/>
<wire x1="83.82" y1="114.3" x2="83.82" y2="121.92" width="0.1524" layer="91"/>
<pinref part="L4" gate="G$1" pin="1"/>
<wire x1="83.82" y1="121.92" x2="99.06" y2="121.92" width="0.1524" layer="91"/>
<pinref part="C35" gate="G$1" pin="1"/>
<junction x="83.82" y="111.76"/>
<pinref part="L3" gate="G$1" pin="2"/>
</segment>
</net>
</nets>
</sheet>
</sheets>
</schematic>
</drawing>
<compatibility>
<note version="8.2" severity="warning">
Since Version 8.2, Eagle supports online libraries. The ids
of those online libraries will not be understood (or retained)
with this version.
</note>
</compatibility>
</eagle>


text:
package main

import (
	tl "github.com/JoelOtter/termloop"
)

const (
	EMPTY int = iota
	RED
	BLUE
	ELIMINATED
)

type Box struct {
	*tl.Rectangle
	Status int
	Row    int
	Col    int
}

func (box *Box) validateClick(ev tl.Event) bool {
	// check if box is empty
	if box.Status != EMPTY {
		return false
	}

	// check the game play
	return GAME.ValidateMove(box)
}

func (box *Box) Tick(ev tl.Event) {
	if ev.Type != tl.EventMouse {
		return
	}

	x, y := box.Position()
	switch ev.Key {
	case tl.MouseLeft:
		if ev.MouseX > x && ev.MouseX < (x+BOX_WIDTH) && ev.MouseY < (y+BOX_HEIGHT) && ev.MouseY > y {
			if box.validateClick(ev) {
				// paint the box!
				move := GAME.GetMove()
				if move == ELIMINATE {
					box.SetColor(tl.ColorBlack)
					box.Status = ELIMINATED
				} else {
					player := GAME.GetPlayer()
					if player == RED {
						//box.SetColor(tl.ColorRed)
						renderBall <- Ball{nil, RED, x, y}
					} else {
						//box.SetColor(tl.ColorBlue)
						renderBall <- Ball{nil, BLUE, x, y}
					}
					box.Status = player
				}
				GAME.NextMove()
				end, winner := GAME.EndGame()
				if end {
					renderWinner <- Player{
						Color: winner[0].Status,
					}
				}
			}
		}
	}
}

func NewBox(x, y, row, column int) Box {
	return Box{tl.NewRectangle(x, y, BOX_WIDTH, BOX_HEIGHT, tl.ColorGreen), EMPTY, row, column}
}

license: MIT

license_type: permissive

branch_name: refs/heads/master

gha_license_id: MIT

gha_language: Go

extension: go


text:
inherit debian-dsc
inherit sbuild

PV = "2.10-1"

DSC_URI = "${DEBIAN_REPO}/pool/main/h/${PN}/${PN}_${PV}.dsc;md5sum=34dfe918302fda549691710425f58d1c;sha256sum=329decc4cb8172964b5e72597b6f9d5405c02ad2bf94d6a66b0a88a9425dd0b3"

repository: toshiba/meta-eid

repo_name: toshiba/meta-eid

extension: bb


text:
package v1controller

// Controller Interface
type Controller struct {
}

// NewController Function
func NewController() *Controller {
	return &Controller{}
}

repository: anant-sharma/go-blockchain-events

repo_name: anant-sharma/go-blockchain-events


text:
package main

import (
    "encoding/csv"
    "flag"
    "fmt"
    "github.com/jonas-p/go-shp"
    "os"
    "path/filepath"
    "regexp"
    "strings"
    "sync"
    "sync/atomic"
)

var inPath = flag.String("i", "", "Input file glob path to shapefiles")
var outPath = flag.String("o", "", "Output file location")
var shapeType = flag.Int("t", 25, "Default is polygon; Shape type from https://godoc.org/github.com/jonas-p/go-shp#ShapeType")
var alphaNumeric = regexp.MustCompile("[^a-zA-Z0-9]+")

func main() {
    flag.Parse()
    if len(os.Args) < 2 {
        fmt.Println("Last argument must be one of: merge, extract-attrs")
        os.Exit(1)
    }
    if *inPath == "" {
        fmt.Println("Missing -i input file(s)")
        flag.PrintDefaults()
        os.Exit(1)
    }
    if *outPath == "" {
        fmt.Println("Missing -o output location")
        flag.PrintDefaults()
        os.Exit(1)
    }
    action := os.Args[len(os.Args)-1]

    fileMatches, err := filepath.Glob(*inPath)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
    if len(fileMatches) < 1 {
        fmt.Println("No matches for input pattern")
        os.Exit(1)
    }

    var allFields []shp.Field
    fieldNameToIndex := make(map[string]int)

    // pass 1, get all possible allFields
    for i, shapePath := range fileMatches {
        shapefile, err := shp.Open(shapePath)
        if err != nil {
            fmt.Println("Problem reading", shapePath, ", skipping. ", err)
            continue
        }

        fmt.Println("Processing shapefile allFields", shapePath, "(", i+1, "of", len(fileMatches), ")")

        localFields := shapefile.Fields()
        var fieldName string
        var fieldIndex int
        for _, localField := range localFields {
            fieldName = string(localField.Name[:11])
            if _, exists := fieldNameToIndex[fieldName]; !exists {
                allFields = append(allFields, localField)
                fieldIndex = len(allFields) - 1
                fieldNameToIndex[fieldName] = fieldIndex
            }
        }
    }

    if action == "merge" {
        merge(fileMatches, allFields, fieldNameToIndex)
    } else if action == "extract-attrs" {
        extractAtrrs(fileMatches, allFields, fieldNameToIndex)
    } else {
        fmt.Println("Last argument must be one of: merge, extract-attrs")
        os.Exit(1)
    }

    fmt.Println("Done")
}

func merge(fileMatches []string, allFields []shp.Field, fieldNameToIndex map[string]int) {
    outputFile, err := shp.Create(*outPath, shp.ShapeType(*shapeType))
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }

    err = outputFile.SetFields(allFields)
    if err != nil {
        fmt.Println("Failed setting output shapefile allFields, aborting!", err, allFields)
        os.Exit(1)
    }

    var rowCursor int64
    var filesProcessed int64

    // pass 2, copy shapefiles
    var wg sync.WaitGroup
    var writelock sync.Mutex
    for _, shPath := range fileMatches {
        sf, err := shp.Open(shPath)
        if err != nil {
            fmt.Println("Problem reading", shPath, ", skipping. ", err)
            continue
        }

        wg.Add(1)

        go func(shapePath string, shapefile *shp.Reader) {
            localFields := shapefile.Fields()

            // loop through all features in the shapefile
            for shapefile.Next() {
                localRow, shape := shapefile.Shape()

                // print feature
                //fmt.Println(reflect.TypeOf(shape).Elem(), shape.BBox())
                writelock.Lock()
                outputFile.Write(shape)
                writelock.Unlock()

                // print attributes
                var remoteKey int
                var fieldName string
                for localKey, field := range localFields {
                    val := shapefile.ReadAttribute(localRow, localKey)
                    //fmt.Printf("\t%v: %v\row", f, val)
                    fieldName = string(field.Name[:11])
                    remoteKey = fieldNameToIndex[fieldName]
                    writelock.Lock()
                    err = outputFile.WriteAttribute(int(rowCursor), remoteKey, val)
                    writelock.Unlock()
                    if err != nil {
                        fmt.Println("Failed writing attribute, skipping. ", localKey, val, err)
                        continue
                    }
                }

                atomic.AddInt64(&rowCursor, 1)
                if rowCursor%10000 == 0 {
                    fmt.Println("Total shapes processed:", rowCursor)
                }
            }

            final := atomic.AddInt64(&filesProcessed, 1)
            err = shapefile.Close()
            if err != nil {
                fmt.Println("Failed closing shapefile", shapePath, err)
            } else {
                fmt.Println("Finished", shapePath, "(", final, "of", len(fileMatches), ")")
            }
            wg.Done()
        }(shPath, sf)
    }

    wg.Wait()

    outputFile.Close()

    fmt.Println("Processed", rowCursor)
}

func extractAtrrs(fileMatches []string, allFields []shp.Field, fieldNameToIndex map[string]int) {
    outputFile, err := os.Create(*outPath)
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
    writer := csv.NewWriter(outputFile)
    if err != nil {
        fmt.Print(err)
        os.Exit(1)
    }

    // Add a special field with the filename
    fieldCount := len(allFields)
    filenameLastColumnIndex := fieldCount - 1

    // write header
    var header []string
    // the order matters
    for _, f := range allFields {
        header = append(header, cleanName(f.Name[:11]))
    }
    header[filenameLastColumnIndex] = "shpmrg_input"
    err = writer.Write(header)
    if err != nil {
        fmt.Println("Failed to write csv header", err)
        os.Exit(1)
    }

    var rowCursor int64
    var filesProcessed int64

    // pass 2, copy shapefiles
    var wg sync.WaitGroup
    var writelock sync.Mutex

    for _, shPath := range fileMatches {
        sf, err := shp.Open(shPath)
        if err != nil {
            fmt.Println("Problem reading", shPath, ", skipping. ", err)
            continue
        }

        wg.Add(1)

        go func(shapePath string, shapefile *shp.Reader) {
            localFields := shapefile.Fields()

            // /opt/geo/myshape0.shp -> myshape0
            basename := strings.Replace(filepath.Base(shapePath), filepath.Ext(shapePath), "", 1)

            // loop through all features in the shapefile
            var localRowIndex int
            var csvRow []string
            for shapefile.Next() {
                localRowIndex, _ = shapefile.Shape()

                // print attributes
                var fieldName string
                var column int
                csvRow = newRow(fieldCount)
                for localKey, field := range localFields {
                    val := shapefile.ReadAttribute(localRowIndex, localKey)
                    //fmt.Printf("\t%v: %v\row", f, val)
                    fieldName = string(field.Name[:11])
                    column = fieldNameToIndex[fieldName]
                    csvRow[column] = val
                }
                csvRow[filenameLastColumnIndex] = basename

                writelock.Lock()
                err = writer.Write(csvRow)
                writelock.Unlock()
                if err != nil {
                    fmt.Println("Failed writing csv row", localRowIndex, shapePath, err)
                    continue
                }

                atomic.AddInt64(&rowCursor, 1)
                if rowCursor%10000 == 0 {
                    fmt.Println("Total shapes processed:", rowCursor)
                }
            }

            final := atomic.AddInt64(&filesProcessed, 1)
            err = shapefile.Close()
            if err != nil {
                fmt.Println("Failed closing shapefile", shapePath, err)
            } else {
                fmt.Println("Finished", shapePath, "(", final, "of", len(fileMatches), ")")
            }
            wg.Done()
        }(shPath, sf)
    }

    wg.Wait()
    writer.Flush()

    err = outputFile.Close()
    if err != nil {
        fmt.Println("failed closing CSV", *outPath, err)
    }
    fmt.Println("Processed", rowCursor)
}

// seeding everything with empty string keeps there from being nulls on import, which breaks
// many simple sql import tools
func newRow(size int) (r []string) {
    r = make([]string, size)
    for i := 0; i < size; i++ {
        r[i] = ""
    }
    return r
}

func cleanName(name []byte) string {
    return string(alphaNumeric.ReplaceAll(name, []byte("")))
}

repository: AQUAOSOTech/shpmrg

repo_name: AQUAOSOTech/shpmrg


text:
/*********************************************************************************************/
/* Problem: Climbing Stairs (LC) ********/
/*********************************************************************************************/
/*
--Problem statement:
  You are climbing a staircase. It takes n steps to reach the top. Each time you can either
  climb 1 or 2 steps. In how many distinct ways can you climb to the top?
  > Example 1:
    Input: n = 2
    Output: 2
    Explanation: There are two ways to climb to the top.
      1. 1 step + 1 step
      2. 2 steps

  > Example 2:
    Input: n = 3
    Output: 3
    Explanation: There are three ways to climb to the top.
      1. 1 step + 1 step + 1 step
      2. 1 step + 2 steps
      3. 2 steps + 1 step

 --Inputs:
  -int: non-negative integer N

--Outputs:
  -int: non-negative integer, the number of possible ways in which it is possible to climb the
        staircase.

--Constraints:
   1 <= n <= 45

--Reasoning: See comments below.

--Time complexity: O(N), where N is the number of steps in the staircase. This time complexity
  is achieved due to the memoization.

--Space complexity: O(N), since we allocated space to store the calculated results.

*/

#include <iostream>
#include <vector>

int climbHelper(int n, std::vector<int> &cache) {
  // base case: given a value n, in case we've already calculated the result for it, i.e.,
  // cache[n] is a valid result, we just return this result:
  if (n < cache.size())
    return cache.at(n);

  // recursive case: calculate the result for the case where we climb 1 step:
  int jumpOne = climbHelper(n - 1, cache);
  // recursive case: calculate the result for the case where we climb 2 step:
  int jumpTwo = climbHelper(n - 2, cache);
  // sum the result of both approaches:
  int ways = jumpOne + jumpTwo;
  // chache the result so we don;t have to calculate it again:
  cache.push_back(ways);
  // return the result:
  return cache.at(n);
}

int climbStairs(int n) {
  // initialize a cache to store the results calculated along the way. Since n >= 1 and
  // for a staircase of only 1 step (n=1) there is only one possible way to climb, i.e., to
  // take 1 step, cache[n] for n <= 1 is 1.
  std::vector<int> cache(2, 1);

  return climbHelper(n, cache);
}

int main() {
  int n{2};
  std::cout << "Number of steps: " << n << "\tPossible ways to climb: " << climbStairs(n) << "\n";

  n = 4;
  std::cout << "Number of steps: " << n << "\tPossible ways to climb: " << climbStairs(n) << "\n";

  n = 5;
  std::cout << "Number of steps: " << n << "\tPossible ways to climb: " << climbStairs(n) << "\n";

  return 0;
}

/*  -- DRY RUN --
cs(4):
    n < 2 ? F

    j1 = cs(3):--------------------------: 3
        n < 2 ? F
        j1 = cs(2):----------------------: 2
            n < 2 ? F
            j1 = cs(1):------------------: 1
                n < 2 ? T:
                    return cache[1] = 1
            j2 = cs(0):------------------: 1
                n < 2 ? T:
                    return cache[0] = 1
            ways = j1 + j2 = 2
            cache.push_back(2) ----------: [1,1,2]
            return cache[2] = 2
        j2 = cs(1):----------------------: 1
            n < 3 ? T:
                return cache[1] = 1
        ways = j1 + j2 = 3
        cache.push_back(3) --------------: [1,1,2,3]
        return cache[3] = 3
    j2 = cs(2):--------------------------: 2
        n < 4 ? T:
            return cache[2] = 2
    ways = j1 + j2 = 5
    cache.push_back(5) ------------------: [1,1,2,3,5]
*/

repository: pedrotorreao/DSA

repo_name: pedrotorreao/DSA

extension: cpp


text:
@proceedings{cummings:ismir:2020,
 editor = {Julie Cumming and
Jin Ha Lee and
Brian McFee and
Markus Schedl and
Johanna Devaney and
Cory McKay and
Eva Zangerle and
Timothy de Reuse},
 isbn = {978-0-9813537-1-5},
 title = {Proceedings of the 21th International Society for Music Information
Retrieval Conference, ISMIR 2020, Montreal, Canada, October 11-16,
2020},
 year = {2020}
}

branch_name: refs/heads/main

extension: bib


text:
SUMMARY = "Empty dummy package: Lemonbeat gateway firmware for the radio module"
LICENSE = "CLOSED"

inherit systemd allarch

FILES_${PN} = ""
ALLOW_EMPTY_${PN} = "1"

gha_language: Shell