text:
="2"/>
<connect gate="G$1" pin="VCC" pad="9"/>
</connects>
<technologies>
<technology name="">
<attribute name="ARROW_PART_NUMBER" value="HM-11" constant="no"/>
<attribute name="ARROW_PRICE-STOCK" value="" constant="no"/>
<attribute name="DESCRIPTION" value="Bluetooth 4.0 BLE module" constant="no"/>
<attribute name="HEIGHT" value="mm" constant="no"/>
<attribute name="MANUFACTURER_NAME" value="Huamao technology Co" constant="no"/>
<attribute name="MANUFACTURER_PART_NUMBER" value="HM-11" constant="no"/>
<attribute name="MOUSER_PART_NUMBER" value="" constant="no"/>
<attribute name="MOUSER_PRICE-STOCK" value="" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="MCP1812AT-030_TT" prefix="PS">
<description>LDO Voltage Regulators Ultra Low Iq LDO

Source:  Datasheet </description>
<gates>
<gate name="G$1" symbol="MCP1812AT-030_TT" x="0" y="0"/>
</gates>
<devices>
<device name="" package="SOT95P237X112-3N">
<connects>
<connect gate="G$1" pin="GND" pad="3"/>
<connect gate="G$1" pin="VIN" pad="2"/>
<connect gate="G$1" pin="VOUT" pad="1"/>
</connects>
<technologies>
<technology name="">
<attribute name="ARROW_PART_NUMBER" value="MCP1812AT-030/TT" constant="no"/>
<attribute name="ARROW_PRICE-STOCK" value="" constant="no"/>
<attribute name="DESCRIPTION" value="LDO Voltage Regulators Ultra Low Iq LDO" constant="no"/>
<attribute name="HEIGHT" value="1.12mm" constant="no"/>
<attribute name="MANUFACTURER_NAME" value="Microchip" constant="no"/>
<attribute name="MANUFACTURER_PART_NUMBER" value="MCP1812AT-030/TT" constant="no"/>
<attribute name="MOUSER_PART_NUMBER" value="579-MCP1812AT-030/TT" constant="no"/>
<attribute name="MOUSER_PRICE-STOCK" value="https://www.mouser.co.uk/ProductDetail/Microchip-Technology/MCP1812AT-030-TT?qs=byeeYqUIh0Pab4jw7Ms6qQ%3D%3D" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="MPT4" prefix="X" uservalue="yes">
<description>PHOENIX CONNECTOR</description>
<gates>
<gate name="-1" symbol="SKB" x="0" y="10.16" addlevel="always"/>
<gate name="-2" symbol="SKB" x="0" y="5.08" addlevel="always"/>
<gate name="-3" symbol="SKB" x="0" y="0" addlevel="always"/>
<gate name="-4" symbol="SKBV" x="0" y="-5.08" addlevel="always"/>
</gates>
<devices>
<device name="" package="4POL254">
<connects>
<connect gate="-1" pin="1" pad="1"/>
<connect gate="-2" pin="1" pad="2"/>
<connect gate="-3" pin="1" pad="3"/>
<connect gate="-4" pin="1" pad="4"/>
</connects>
<technologies>
<technology name="">
<attribute name="MF" value="" constant="no"/>
<attribute name="MPN" value="" constant="no"/>
<attribute name="OC_FARNELL" value="unknown" constant="no"/>
<attribute name="OC_NEWARK" value="unknown" constant="no"/>
<attribute name="POPULARITY" value="5" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
<deviceset name="LED" prefix="LED" uservalue="yes">
<description>LED

OSRAM:

- CHIPLED

LG R971, LG N971, LY N971, LG Q971, LY Q971, LO R971, LY R971
LH N974, LH R974

LS Q976, LO Q976, LY Q976

LO Q996

- Hyper CHIPLED

LW Q18S

LB Q993, LB Q99A, LB R99A

- SideLED

LS A670, LO A670, LY A670, LG A670, LP A670

LB A673, LV A673, LT A673, LW A673

LH A674

LY A675

LS A676, LA A676, LO A676, LY A676, LW A676

LS A679, LY A679, LG A679

-  Hyper Micro SIDELED®

LS Y876, LA Y876, LO Y876, LY Y876

LT Y87S

- SmartLED

LW L88C, LW L88S

LB L89C, LB L89S, LG L890

LS L89K, LO L89K, LY L89K

LS L896, LA L896, LO L896, LY L896

- TOPLED

LS T670, LO T670, LY T670, LG T670, LP T670

LSG T670, LSP T670, LSY T670, LOP T670, LYG T670

LG T671, LOG T671, LSG T671

LB T673, LV T673, LT T673, LW T673

LH T674

LS T676, LA T676, LO T676, LY T676, LB T676, LH T676, LSB T676, LW T676

LB T67C, LV T67C, LT T67C, LS T67K, LO T67K, LY T67K, LW E67C

LS E67B, LA E67B, LO E67B, LY E67B, LB E67C, LV E67C, LT E67C

LW T67C

LS T679, LY T679, LG T679

LS T770, LO T770, LY T770, LG T770, LP T770

LB T773, LV T773, LT T773, LW T773

LH T774

LS E675, LA E675, LY E675, LS T675

LS T776, LA T776, LO T776, LY T776, LB T776

LHGB T686

LT T68C, LB T68C

- Hyper Mini TOPLED®

LB M676

- Mini TOPLED Santana®

LG M470

LS M47K, LO M47K, LY M47K

Source: http://www.osram.convergy.de

LUXEON:

- LUMILED®

LXK2-PW12-R00, LXK2-PW12-S00, LXK2-PW14-U00, LXK2-PW14-V00

LXK2-PM12-R00, LXK2-PM12-S00, LXK2-PM14-U00

LXK2-PE12-Q00, LXK2-PE12-R00, LXK2-PE12-S00, LXK2-PE14-T00, LXK2-PE14-U00

LXK2-PB12-K00, LXK2-PB12-L00, LXK2-PB12-M00, LXK2-PB14-N00, LXK2-PB14-P00, LXK2-PB14-Q00

LXK2-PR12-L00, LXK2-PR12-M00, LXK2-PR14-Q00, LXK2-PR14-R00

LXK2-PD12-Q00, LXK2-PD12-R00, LXK2-PD12-S00

LXK2-PH12-R00, LXK2-PH12-S00

LXK2-PL12-P00, LXK2-PL12-Q00, LXK2-PL12-R00

Source: www.luxeon.com

KINGBRIGHT:

KA-3528ASYC

Source: www.kingbright.com</description>
<gates>
<gate name="G$1" symbol="LED" x="0" y="0"/>
</gates>
<devices>
<device name="SMT1206" package="1206">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15796/2"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="20" constant="no"/>
</technology>
</technologies>
</device>
<device name="LD260" package="LD260">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15794/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="SQR2X5" package="LED2X5">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15800/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="2" constant="no"/>
</technology>
</technologies>
</device>
<device name="3MM" package="LED3MM">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15797/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="97" constant="no"/>
</technology>
</technologies>
</device>
<device name="5MM" package="LED5MM">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15799/2"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="93" constant="no"/>
</technology>
</technologies>
</device>
<device name="LSU260" package="LSU260">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15805/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="LZR181" package="LZR181">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15808/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="1" constant="no"/>
</technology>
</technologies>
</device>
<device name="B152" package="Q62902-B152">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15803/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="B153" package="Q62902-B153">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15804/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="B155" package="Q62902-B155">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15807/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="B156" package="Q62902-B156">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15806/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="SFH480" package="SFH480">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15809/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="2" constant="no"/>
</technology>
</technologies>
</device>
<device name="SFH482" package="SFH482">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15795/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="SQR5.7X3.2" package="U57X32">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15789/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="IRL80A" package="IRL80A">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15810/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="P-LCC-2" package="P-LCC-2">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15817/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="2" constant="no"/>
</technology>
</technologies>
</device>
<device name="MINI-TOP" package="OSRAM-MINI-TOP-LED">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15811/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="SIDELED" package="OSRAM-SIDELED">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15812/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="2" constant="no"/>
</technology>
</technologies>
</device>
<device name="SMART-LED" package="SMART-LED">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="B"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15814/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="P-LCC-2-BACK" package="P-LCC-2-TOPLED-RG">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15813/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="MICRO-SIDELED" package="MICRO-SIDELED">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15815/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="P-LCC-4" package="P-LCC-4">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C@4"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15816/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="CHIP-LED0603" package="CHIP-LED0603">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15819/3"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="26" constant="no"/>
</technology>
</technologies>
</device>
<device name="CHIP-LED0805" package="CHIP-LED0805">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15818/2"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="68" constant="no"/>
</technology>
</technologies>
</device>
<device name="TOPLED-SANTANA" package="MINI-TOPLED-SANTANA">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15820/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="CHIPLED_0805" package="CHIPLED_0805">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15821/2"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="52" constant="no"/>
</technology>
</technologies>
</device>
<device name="CHIPLED_1206" package="CHIPLED_1206">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15823/2"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="28" constant="no"/>
</technology>
</technologies>
</device>
<device name="CHIPLED_0603" package="CHIPLED_0603">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15822/2"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="28" constant="no"/>
</technology>
</technologies>
</device>
<device name="CHIPLED-0603-TTW" package="CHIPLED-0603-TTW">
<connects>
<connect gate="G$1" pin="A" pad="A@1"/>
<connect gate="G$1" pin="C" pad="C@1"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15824/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="" package="SMARTLED-TTW">
<connects>
<connect gate="G$1" pin="A" pad="A@1"/>
<connect gate="G$1" pin="C" pad="C@1"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15825/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="3" constant="no"/>
</technology>
</technologies>
</device>
<device name="-LUMILED+" package="LUMILED+">
<connects>
<connect gate="G$1" pin="A" pad="2+"/>
<connect gate="G$1" pin="C" pad="4-"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15826/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="-LUMILED" package="LUMILED">
<connects>
<connect gate="G$1" pin="A" pad="2+"/>
<connect gate="G$1" pin="C" pad="4-"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15827/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="10MM" package="LED10MM">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="K"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15828/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="2" constant="no"/>
</technology>
</technologies>
</device>
<device name="KA-3528ASYC" package="KA-3528ASYC">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15831/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="0" constant="no"/>
</technology>
</technologies>
</device>
<device name="SML0805" package="SML0805">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15830/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="17" constant="no"/>
</technology>
</technologies>
</device>
<device name="SML1206" package="SML1206">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15829/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="6" constant="no"/>
</technology>
</technologies>
</device>
<device name="SML0603" package="SML0603">
<connects>
<connect gate="G$1" pin="A" pad="A"/>
<connect gate="G$1" pin="C" pad="C"/>
</connects>
<package3dinstances>
<package3dinstance package3d_urn="urn:adsk.eagle:package:15832/1"/>
</package3dinstances>
<technologies>
<technology name="">
<attribute name="POPULARITY" value="17" constant="no"/>
</technology>
</technologies>
</device>
</devices>
</deviceset>
</devicesets>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
</classes>
<parts>
<part name="SV1" library="BluJoy-e" deviceset="PICKIT" device=""/>
<part name="U1" library="BluJoy-e" deviceset="PIC16F15345-I/SO" device="" value="PIC16F18446-I/SO"/>
<part name="C1" library="BluJoy-e" deviceset="CC0603KRX7R7BB104" device="" value="1 uF"/>
<part name="C2" library="BluJoy-e" deviceset="CC0603KRX7R7BB104" device="" value="1 uF"/>
<part name="C3" library="BluJoy-e" deviceset="CC0603KRX7R7BB104" device="" value="1 uF"/>
<part name="D1" library="BluJoy-e" deviceset="BAT42WS-7-F" device="" value="BAT42WS-7-F"/>
<part name="U3" library="BluJoy-e" deviceset="MCP1812AT-030_TT" device="" value="3.0 LDO"/>
<part name="R1" library="BluJoy-e" deviceset="CRCW0603240RFKEB" device="" value="100"/>
<part name="R2" library="BluJoy-e" deviceset="CRCW0603240RFKEB" device="" value="22"/>
<part name="R3" library="BluJoy-e" deviceset="CRCW0603240RFKEB" device="" value="18"/>
<part name="L1" library="BluJoy-e" deviceset="ASMB-TTF0-0A20B" device=""/>
<part name="Q1" library="BluJoy-e" deviceset="NTR4171PT1G" device="" value="P-FET"/>
<part name="S1" library="BluJoy-e" deviceset="PTS636_SK25J_SMTR_LFS" device=""/>
<part name="S2" library="BluJoy-e" deviceset="PTS636_SK25J_SMTR_LFS" device=""/>
<part name="X2" library="BluJoy-e" deviceset="MPT4" device="" value="HB"/>
<part name="J1" library="BluJoy-e" deviceset="2468" device=""/>
<part name="U2" library="BluJoy-e" deviceset="HM-11" device=""/>
<part name="U4" library="BluJoy-e" deviceset="HM-11" device=""/>
<part name="C4" library="BluJoy-e" deviceset="CC0603KRX7R7BB104" device="" value="1 uF"/>
<part name="J2" library="BluJoy-e" deviceset="PHOENIX3.5X8-B" device=""/>
<part name="R4" library="BluJoy-e" deviceset="CRCW0603240RFKEB" device="" value="1K"/>
<part name="L2" library="BluJoy-e" deviceset="LED" device="CHIP-LED0603" package3d_urn="urn:adsk.eagle:package:15819/3"/>
<part name="R6" library="BluJoy-e" deviceset="CRCW0603240RFKEB" device="" value="1K"/>
<part name="X1" library="BluJoy-e" deviceset="MPT4" device="" value="HB"/>
</parts>
<sheets>
<sheet>
<plain>
<wire x1="71.12" y1="76.2" x2="71.12" y2="152.4" width="0.254" layer="97" style="dashdot"/>
<wire x1="71.12" y1="152.4" x2="208.28" y2="152.4" width="0.254" layer="97" style="dashdot"/>
<wire x1="208.28" y1="152.4" x2="208.28" y2="76.2" width="0.254" layer="97" style="dashdot"/>
<wire x1="208.28" y1="76.2" x2="71.12" y2="76.2" width="0.254" layer="97" style="dashdot"/>
<text x="96.52" y="78.74" size="5.08" layer="97" font="vector">Snap-Off Master</text>
<text x="157.734" y="135.89" size="2.54" layer="97" font="vector">MASTER</text>
<text x="38.354" y="122.936" size="2.54" layer="97" font="vector">SLAVE</text>
<text x="-58.42" y="129.54" size="3.81" layer="97" font="vector" ratio="10">Hoverboards for Assistive Devices</text>
<text x="-58.42" y="121.92" size="3.81" layer="97" font="vector" ratio="10">Master / Slave Joystick Control</text>
<text x="-58.42" y="114.3" size="3.81" layer="97" font="vector" ratio="10">Rev 2.0</text>
<text x="-58.42" y="106.68" size="3.81" layer="97" font="vector" ratio="10">By Phil Malone</text>
<text x="-58.42" y="99.06" size="3.81" layer="97" font="vector" ratio="10">https://bit.ly/3hHNuS8</text>
<text x="-50.8" y="35.56" size="1.778" layer="97" rot="R90">Battery holder mounted on back side!</text>
</plain>
<instances>
<instance part="SV1" gate="G$1" x="-2.54" y="76.2" smashed="yes" rot="R180">
<attribute name="VALUE" x="-1.27" y="86.36" size="1.778" layer="96" rot="R180"/>
<attribute name="NAME" x="-1.27" y="67.818" size="1.778" layer="95" rot="R180"/>
</instance>
<instance part="U1" gate="A" x="15.24" y="33.02" smashed="yes">
<attribute name="NAME" x="25.7556" y="1.4986" size="2.0828" layer="95" ratio="6" rot="SR0"/>
<attribute name="VALUE" x="37.8206" y="11.6586" size="2.0828" layer="96" ratio="6" rot="SR0"/>
</instance>
<instance part="C1" gate="G$1" x="-48.26" y="5.08" smashed="yes" rot="R90">
<attribute name="NAME" x="-52.07" y="13.97" size="1.778" layer="95" rot="R90" align="center-left"/>
<attribute name="VALUE" x="-44.45" y="13.97" size="1.778" layer="96" rot="R90" align="center-left"/>
</instance>
<instance part="C2" gate="G$1" x="99.06" y="35.56" smashed="yes" rot="R90">
<attribute name="NAME" x="92.71" y="44.45" size="1.778" layer="95" rot="R90" align="center-left"/>
<attribute name="VALUE" x="95.25" y="44.45" size="1.778" layer="96" rot="R90" align="center-left"/>
</instance>
<instance part="C3" gate="G$1" x="124.46" y="101.6" smashed="yes" rot="R90">
<attribute name="NAME" x="120.65" y="105.41" size="1.778" layer="95" rot="R180" align="center-left"/>
<attribute name="VALUE" x="120.65" y="102.87" size="1.778" layer="96" rot="R180" align="center-left"/>
</instance>
<instance part="D1" gate="G$1" x="139.7" y="129.54" smashed="yes" rot="R180">
<attribute name="NAME" x="133.35" y="134.62" size="1.778" layer="95" rot="R180" align="center-left"/>
<attribute name="VALUE" x="128.27" y="127" size="1.778" layer="96" rot="R180" align="center-left"/>
</instance>
<instance part="U3" gate="G$1" x="119.38" y="116.84" smashed="yes" rot="R180">
<attribute name="NAME" x="107.95" y="109.22" size="1.778" layer="95" rot="R180" align="center-left"/>
<attribute name="VALUE" x="110.49" y="111.76" size="1.778" layer="96" rot="R180" align="center-left"/>
</instance>
<instance part="R1" gate="G$1" x="185.42" y="10.16" smashed="yes" rot="R180">
<attribute name="NAME" x="179.324" y="10.16" size="1.27" layer="95" rot="R180" align="center-left"/>
<attribute name="VALUE" x="176.022" y="10.16" size="1.27" layer="96" rot="R180" align="center-left"/>
</instance>
<instance part="R2" gate="G$1" x="185.42" y="12.7" smashed="yes" rot="R180">
<attribute name="NAME" x="179.324" y="12.7" size="1.27" layer="95" rot="R180" align="center-left"/>
<attribute name="VALUE" x="176.022" y="12.7" size="1.27" layer="96" rot="R180" align="center-left"/>
</instance>
<instance part="R3" gate="G$1" x="185.42" y="15.24" smashed="yes" rot="R180">
<attribute name="NAME" x="179.324" y="15.24" size="1.27" layer="95" rot="R180" align="center-left"/>
<attribute name="VALUE" x="176.022" y="15.24" size="1.27" layer="96" rot="R180" align="center-left"/>
</instance>
<instance part="L1" gate="G$1" x="162.56" y="10.16" smashed="yes" rot="R180">
<attribute name="NAME" x="124.206" y="5.842" size="1.778" layer="95" rot="R180" align="center-left"/>
</instance>
<instance part="Q1" gate="G$1" x="25.4" y="55.88" smashed="yes">
<attribute name="NAME" x="31.75" y="60.96" size="1.778" layer="95" align="center-left"/>
</instance>
<instance part="S1" gate="G$1" x="-38.1" y="-2.54" smashed="yes" rot="R90">
<attribute name="NAME" x="-43.18" y="3.81" size="1.778" layer="95" rot="R90" align="center-left"/>
</instance>
<instance part="S2" gate="G$1" x="-30.48" y="-2.54" smashed="yes" rot="R90">
<attribute name="NAME" x="-25.4" y="3.81" size="1.778" layer="95" rot="R90" align="center-left"/>
</instance>
<instance part="X2" gate="-1" x="121.92" y="142.24" smashed="yes" rot="MR90">
<attribute name="NAME" x="121.285" y="145.796" size="1.778" layer="95" rot="MR90"/>
</instance>
<instance part="X2" gate="-2" x="99.06" y="142.24" smashed="yes" rot="MR90">
<attribute name="NAME" x="98.425" y="145.796" size="1.778" layer="95" rot="MR90"/>
</instance>
<instance part="X2" gate="-3" x="93.98" y="142.24" smashed="yes" rot="MR90">
<attribute name="NAME" x="93.345" y="145.796" size="1.778" layer="95" rot="MR90"/>
</instance>
<instance part="X2" gate="-4" x="88.9" y="142.24" smashed="yes" rot="MR90">
<attribute name="NAME" x="88.265" y="145.796" size="1.778" layer="95" rot="MR90"/>
<attribute name="VALUE" x="83.058" y="143.764" size="1.778" layer="96" rot="MR90"/>
</instance>
<instance part="J1" gate="G$1" x="-58.42" y="2.54" smashed="yes" rot="R90">
<attribute name="NAME" x="-63.5" y="8.89" size="1.778" layer="95" rot="R90" align="center-left"/>
</instance>
<instance part="U2" gate="G$1" x="22.86" y="119.38" smashed="yes">
<attribute name="NAME" x="29.21" y="124.46" size="1.778" layer="95" align="center-left"/>
</instance>
<instance part="U4" gate="G$1" x="147.32" y="132.08" smashed="yes">
<attribute name="NAME" x="151.13" y="137.16" size="1.778" layer="95" align="center-left"/>
</instance>
<instance part="C4" gate="G$1" x="134.62" y="101.6" smashed="yes" rot="R90">
<attribute name="NAME" x="130.81" y="105.41" size="1.778" layer="95" rot="R180" align="center-left"/>
<attribute name="VALUE" x="130.81" y="102.87" size="1.778" layer="96" rot="R180" align="center-left"/>
</instance>
<instance part="J2" gate="G$1" x="134.62" y="38.1" smashed="yes" rot="MR0"/>
<instance part="R4" gate="G$1" x="119.38" y="134.62" smashed="yes" rot="R180">
<attribute name="NAME" x="110.744" y="137.16" size="1.27" layer="95" rot="R180" align="center-left"/>
<attribute name="VALUE" x="109.982" y="134.62" size="1.27" layer="96" rot="R180" align="center-left"/>
</instance>
<instance part="L2" gate="G$1" x="195.58" y="106.68" smashed="yes">
<attribute name="NAME" x="194.818" y="109.22" size="1.778" layer="95" rot="R180"/>
<attribute name="VALUE" x="201.295" y="102.108" size="1.778" layer="96" rot="R90"/>
</instance>
<instance part="R6" gate="G$1" x="195.58" y="111.76" smashed="yes" rot="R90">
<attribute name="NAME" x="193.04" y="123.444" size="1.27" layer="95" rot="R180" align="center-left"/>
<attribute name="VALUE" x="195.58" y="121.158" size="1.27" layer="96" rot="R90" align="center-left"/>
</instance>
<instance part="X1" gate="-1" x="104.14" y="55.88" smashed="yes" rot="MR180">
<attribute name="NAME" x="107.696" y="56.515" size="1.778" layer="95" rot="MR180"/>
</instance>
<instance part="X1" gate="-2" x="104.14" y="60.96" smashed="yes" rot="MR180">
<attribute name="NAME" x="107.696" y="61.595" size="1.778" layer="95" rot="MR180"/>
</instance>
<instance part="X1" gate="-3" x="104.14" y="66.04" smashed="yes" rot="MR180">
<attribute name="NAME" x="107.696" y="66.675" size="1.778" layer="95" rot="MR180"/>
</instance>
<instance part="X1" gate="-4" x="104.14" y="71.12" smashed="yes" rot="MR180">
<attribute name="NAME" x="107.696" y="71.755" size="1.778" layer="95" rot="MR180"/>
<attribute name="VALUE" x="103.124" y="54.102" size="1.778" layer="96" rot="MR180"/>
</instance>
</instances>
<busses>
</busses>
<nets>
<net name="N$5" class="0">
<segment>
<pinref part="L1" gate="G$1" pin="RED_ANODE"/>
<pinref part="R1" gate="G$1" pin="2"/>
<wire x1="165.1" y1="10.16" x2="167.64" y2="10.16" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$6" class="0">
<segment>
<pinref part="L1" gate="G$1" pin="GREEN_ANODE"/>
<pinref part="R2" gate="G$1" pin="2"/>
<wire x1="165.1" y1="12.7" x2="167.64" y2="12.7" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$7" class="0">
<segment>
<pinref part="L1" gate="G$1" pin="BLUE_ANODE"/>
<pinref part="R3" gate="G$1" pin="2"/>
<wire x1="165.1" y1="15.24" x2="167.64" y2="15.24" width="0.1524" layer="91"/>
</segment>
</net>
<net name="BLUE" class="0">
<segment>
<pinref part="U1" gate="A" pin="RB4"/>
<pinref part="L1" gate="G$1" pin="BLUE_CATHODE"/>
<wire x1="83.82" y1="15.24" x2="111.76" y2="15.24" width="0.1524" layer="91"/>

</segment>
</net>
<net name="GREEN" class="0">
<segment>
<pinref part="U1" gate="A" pin="RB5"/>
<pinref part="L1" gate="G$1" pin="GREEN_CATHODE"/>
<wire x1="83.82" y1="12.7" x2="111.76" y2="12.7" width="0.1524" layer="91"/>

</segment>
</net>
<net name="RED" class="0">
<segment>
<pinref part="U1" gate="A" pin="RB6"/>
<pinref part="L1" gate="G$1" pin="RED_CATHODE"/>
<wire x1="83.82" y1="10.16" x2="111.76" y2="10.16" width="0.1524" layer="91"/>

</segment>
</net>
<net name="3V" class="0">
<segment>
<pinref part="R3" gate="G$1" pin="1"/>
<wire x1="185.42" y1="15.24" x2="187.96" y2="15.24" width="0.1524" layer="91"/>
<wire x1="187.96" y1="15.24" x2="187.96" y2="12.7" width="0.1524" layer="91"/>
<pinref part="R1" gate="G$1" pin="1"/>
<wire x1="187.96" y1="12.7" x2="187.96" y2="10.16" width="0.1524" layer="91"/>
<wire x1="187.96" y1="10.16" x2="185.42" y2="10.16" width="0.1524" layer="91"/>
<pinref part="R2" gate="G$1" pin="1"/>
<wire x1="185.42" y1="12.7" x2="187.96" y2="12.7" width="0.1524" layer="91"/>
<junction x="187.96" y="12.7"/>
<wire x1="187.96" y1="12.7" x2="193.04" y2="12.7" width="0.1524" layer="91"/>

<pinref part="X1" gate="-1" pin="1"/>
<wire x1="101.6" y1="55.88" x2="68.58" y2="55.88" width="0.1524" layer="91"/>
<wire x1="68.58" y1="55.88" x2="68.58" y2="63.5" width="0.1524" layer="91"/>

<pinref part="U1" gate="A" pin="VDD"/>
<pinref part="C1" gate="G$1" pin="C2"/>
<wire x1="17.78" y1="33.02" x2="-48.26" y2="33.02" width="0.1524" layer="91"/>
<wire x1="-48.26" y1="33.02" x2="-48.26" y2="17.78" width="0.1524" layer="91"/>
<wire x1="-58.42" y1="33.02" x2="-48.26" y2="33.02" width="0.1524" layer="91"/>
<junction x="-48.26" y="33.02"/>
<pinref part="Q1" gate="G$1" pin="S"/>
<wire x1="-48.26" y1="33.02" x2="-48.26" y2="53.34" width="0.1524" layer="91"/>
<wire x1="-48.26" y1="53.34" x2="25.4" y2="53.34" width="0.1524" layer="91"/>
<pinref part="SV1" gate="G$1" pin="2"/>
<wire x1="-10.16" y1="78.74" x2="-48.26" y2="78.74" width="0.1524" layer="91"/>
<wire x1="-48.26" y1="78.74" x2="-48.26" y2="63.5" width="0.1524" layer="91"/>
<junction x="-48.26" y="53.34"/>
<pinref part="J1" gate="G$1" pin="NEG"/>
<wire x1="-48.26" y1="63.5" x2="-48.26" y2="53.34" width="0.1524" layer="91"/>
<wire x1="-58.42" y1="33.02" x2="-58.42" y2="27.94" width="0.1524" layer="91"/>
<wire x1="68.58" y1="63.5" x2="-48.26" y2="63.5" width="0.1524" layer="91"/>
<junction x="-48.26" y="63.5"/>
<wire x1="68.58" y1="63.5" x2="193.04" y2="63.5" width="0.1524" layer="91"/>
<wire x1="193.04" y1="63.5" x2="193.04" y2="12.7" width="0.1524" layer="91"/>
<junction x="68.58" y="63.5"/>
</segment>
</net>
<net name="GND" class="0">
<segment>

<pinref part="S1" gate="G$1" pin="COM"/>
<wire x1="-38.1" y1="-2.54" x2="-38.1" y2="-5.08" width="0.1524" layer="91"/>
<wire x1="-38.1" y1="-5.08" x2="-30.48" y2="-5.08" width="0.1524" layer="91"/>
<pinref part="S2" gate="G$1" pin="COM"/>
<wire x1="-30.48" y1="-5.08" x2="-30.48" y2="-2.54" width="0.1524" layer="91"/>
<wire x1="-38.1" y1="-5.08" x2="-48.26" y2="-5.08" width="0.1524" layer="91"/>
<junction x="-38.1" y="-5.08"/>
<pinref part="C1" gate="G$1" pin="C1"/>
<wire x1="-48.26" y1="-5.08" x2="-58.42" y2="-5.08" width="0.1524" layer="91"/>
<wire x1="-48.26" y1="5.08" x2="-48.26" y2="-5.08" width="0.1524" layer="91"/>
<junction x="-48.26" y="-5.08"/>
<junction x="-30.48" y="-5.08"/>
<wire x1="-30.48" y1="-5.08" x2="2.54" y2="-5.08" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="VSS"/>
<wire x1="2.54" y1="-5.08" x2="88.9" y2="-5.08" width="0.1524" layer="91"/>
<wire x1="83.82" y1="33.02" x2="88.9" y2="33.02" width="0.1524" layer="91"/>
<wire x1="88.9" y1="33.02" x2="99.06" y2="33.02" width="0.1524" layer="91"/>
<wire x1="88.9" y1="-5.08" x2="88.9" y2="33.02" width="0.1524" layer="91"/>
<junction x="88.9" y="33.02"/>

<pinref part="C3" gate="G$1" pin="C1"/>
<wire x1="124.46" y1="101.6" x2="124.46" y2="99.06" width="0.1524" layer="91"/>
<wire x1="124.46" y1="99.06" x2="88.9" y2="99.06" width="0.1524" layer="91"/>
<junction x="124.46" y="99.06"/>
<wire x1="88.9" y1="99.06" x2="88.9" y2="116.84" width="0.1524" layer="91"/>
<pinref part="U3" gate="G$1" pin="GND"/>
<wire x1="88.9" y1="116.84" x2="91.44" y2="116.84" width="0.1524" layer="91"/>
<wire x1="88.9" y1="116.84" x2="88.9" y2="139.7" width="0.1524" layer="91"/>
<junction x="88.9" y="116.84"/>
<pinref part="X2" gate="-4" pin="1"/>
<wire x1="88.9" y1="33.02" x2="88.9" y2="71.12" width="0.1524" layer="91"/>
<junction x="88.9" y="99.06"/>
<pinref part="C2" gate="G$1" pin="C1"/>
<wire x1="88.9" y1="71.12" x2="88.9" y2="99.06" width="0.1524" layer="91"/>
<wire x1="99.06" y1="35.56" x2="99.06" y2="33.02" width="0.1524" layer="91"/>
<wire x1="2.54" y1="-5.08" x2="2.54" y2="86.36" width="0.1524" layer="91"/>
<junction x="2.54" y="-5.08"/>
<wire x1="2.54" y1="86.36" x2="63.5" y2="86.36" width="0.1524" layer="91"/>
<wire x1="63.5" y1="86.36" x2="63.5" y2="109.22" width="0.1524" layer="91"/>
<pinref part="U2" gate="G$1" pin="GND"/>
<wire x1="63.5" y1="109.22" x2="58.42" y2="109.22" width="0.1524" layer="91"/>
<wire x1="124.46" y1="99.06" x2="134.62" y2="99.06" width="0.1524" layer="91"/>
<pinref part="U4" gate="G$1" pin="GND"/>
<wire x1="134.62" y1="99.06" x2="187.96" y2="99.06" width="0.1524" layer="91"/>
<wire x1="187.96" y1="99.06" x2="187.96" y2="121.92" width="0.1524" layer="91"/>
<wire x1="187.96" y1="121.92" x2="182.88" y2="121.92" width="0.1524" layer="91"/>
<pinref part="C4" gate="G$1" pin="C1"/>
<wire x1="134.62" y1="101.6" x2="134.62" y2="99.06" width="0.1524" layer="91"/>
<junction x="134.62" y="99.06"/>
<wire x1="99.06" y1="33.02" x2="104.14" y2="33.02" width="0.1524" layer="91"/>
<junction x="99.06" y="33.02"/>
<pinref part="J2" gate="G$1" pin="1"/>
<wire x1="104.14" y1="33.02" x2="104.14" y2="40.64" width="0.1524" layer="91"/>
<wire x1="104.14" y1="40.64" x2="119.38" y2="40.64" width="0.1524" layer="91"/>
<pinref part="J2" gate="G$1" pin="3"/>
<wire x1="119.38" y1="40.64" x2="124.46" y2="40.64" width="0.1524" layer="91"/>
<wire x1="124.46" y1="38.1" x2="119.38" y2="38.1" width="0.1524" layer="91"/>
<wire x1="119.38" y1="38.1" x2="119.38" y2="40.64" width="0.1524" layer="91"/>
<junction x="119.38" y="40.64"/>
<pinref part="J1" gate="G$1" pin="POS"/>
<wire x1="-58.42" y1="-5.08" x2="-58.42" y2="2.54" width="0.1524" layer="91"/>
<pinref part="L2" gate="G$1" pin="C"/>
<wire x1="195.58" y1="101.6" x2="195.58" y2="99.06" width="0.1524" layer="91"/>
<wire x1="195.58" y1="99.06" x2="187.96" y2="99.06" width="0.1524" layer="91"/>
<junction x="187.96" y="99.06"/>
<pinref part="X1" gate="-4" pin="1"/>
<wire x1="101.6" y1="71.12" x2="88.9" y2="71.12" width="0.1524" layer="91"/>
<junction x="88.9" y="71.12"/>
</segment>
<segment>
<pinref part="SV1" gate="G$1" pin="3"/>
<wire x1="-17.78" y1="76.2" x2="-10.16" y2="76.2" width="0.1524" layer="91"/>

</segment>
</net>
<net name="USER_1" class="0">
<segment>
<pinref part="S1" gate="G$1" pin="NO"/>
<wire x1="-38.1" y1="30.48" x2="-38.1" y2="22.86" width="0.1524" layer="91"/>

<wire x1="-38.1" y1="30.48" x2="-7.62" y2="30.48" width="0.1524" layer="91"/>
<wire x1="-7.62" y1="30.48" x2="-7.62" y2="10.16" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="RB7"/>
<wire x1="-7.62" y1="10.16" x2="17.78" y2="10.16" width="0.1524" layer="91"/>
</segment>
</net>
<net name="USER_2" class="0">
<segment>
<pinref part="U1" gate="A" pin="RA4"/>
<wire x1="17.78" y1="27.94" x2="-30.48" y2="27.94" width="0.1524" layer="91"/>
<pinref part="S2" gate="G$1" pin="NO"/>
<wire x1="-30.48" y1="27.94" x2="-30.48" y2="22.86" width="0.1524" layer="91"/>

</segment>
</net>
<net name="SLAVE_TX" class="0">
<segment>
<pinref part="U1" gate="A" pin="RC5"/>
<wire x1="17.78" y1="22.86" x2="5.08" y2="22.86" width="0.1524" layer="91"/>
<wire x1="5.08" y1="22.86" x2="5.08" y2="116.84" width="0.1524" layer="91"/>
<wire x1="5.08" y1="116.84" x2="22.86" y2="116.84" width="0.1524" layer="91"/>

<pinref part="U2" gate="G$1" pin="UART_TX"/>
</segment>
</net>
<net name="MASTER_RX" class="0">
<segment>
<wire x1="147.32" y1="124.46" x2="144.78" y2="124.46" width="0.1524" layer="91"/>
<wire x1="144.78" y1="124.46" x2="93.98" y2="124.46" width="0.1524" layer="91"/>
<wire x1="83.82" y1="40.64" x2="83.82" y2="66.04" width="0.1524" layer="91"/>
<wire x1="83.82" y1="66.04" x2="83.82" y2="88.9" width="0.1524" layer="91"/>
<wire x1="83.82" y1="40.64" x2="12.7" y2="40.64" width="0.1524" layer="91"/>
<wire x1="12.7" y1="40.64" x2="12.7" y2="15.24" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="RC6"/>
<wire x1="12.7" y1="15.24" x2="17.78" y2="15.24" width="0.1524" layer="91"/>

<pinref part="U4" gate="G$1" pin="UART_RX"/>
<wire x1="144.78" y1="124.46" x2="144.78" y2="88.9" width="0.1524" layer="91"/>
<junction x="144.78" y="124.46"/>
<wire x1="144.78" y1="88.9" x2="83.82" y2="88.9" width="0.1524" layer="91"/>
<pinref part="X2" gate="-3" pin="1"/>
<wire x1="93.98" y1="124.46" x2="93.98" y2="139.7" width="0.1524" layer="91"/>
<pinref part="X1" gate="-3" pin="1"/>
<wire x1="101.6" y1="66.04" x2="83.82" y2="66.04" width="0.1524" layer="91"/>
<junction x="83.82" y="66.04"/>
</segment>
</net>
<net name="3V-SW" class="0">
<segment>
<pinref part="U1" gate="A" pin="RC7"/>
<wire x1="17.78" y1="12.7" x2="15.24" y2="12.7" width="0.1524" layer="91"/>
<wire x1="15.24" y1="12.7" x2="15.24" y2="48.26" width="0.1524" layer="91"/>
<wire x1="15.24" y1="48.26" x2="60.96" y2="48.26" width="0.1524" layer="91"/>

<wire x1="60.96" y1="50.8" x2="86.36" y2="50.8" width="0.1524" layer="91"/>

<pinref part="C3" gate="G$1" pin="C2"/>
<wire x1="124.46" y1="116.84" x2="124.46" y2="114.3" width="0.1524" layer="91"/>
<pinref part="U3" gate="G$1" pin="VOUT"/>
<wire x1="119.38" y1="116.84" x2="124.46" y2="116.84" width="0.1524" layer="91"/>
<wire x1="124.46" y1="116.84" x2="139.7" y2="116.84" width="0.1524" layer="91"/>
<junction x="124.46" y="116.84"/>
<wire x1="139.7" y1="116.84" x2="139.7" y2="93.98" width="0.1524" layer="91"/>
<wire x1="139.7" y1="93.98" x2="86.36" y2="93.98" width="0.1524" layer="91"/>
<wire x1="86.36" y1="93.98" x2="86.36" y2="50.8" width="0.1524" layer="91"/>
<pinref part="U2" gate="G$1" pin="VCC"/>
<wire x1="58.42" y1="101.6" x2="60.96" y2="101.6" width="0.1524" layer="91"/>
<wire x1="60.96" y1="101.6" x2="60.96" y2="55.88" width="0.1524" layer="91"/>
<junction x="60.96" y="50.8"/>
<pinref part="U4" gate="G$1" pin="VCC"/>
<wire x1="60.96" y1="55.88" x2="60.96" y2="50.8" width="0.1524" layer="91"/>
<wire x1="182.88" y1="114.3" x2="185.42" y2="114.3" width="0.1524" layer="91"/>
<wire x1="185.42" y1="114.3" x2="185.42" y2="93.98" width="0.1524" layer="91"/>
<wire x1="185.42" y1="93.98" x2="139.7" y2="93.98" width="0.1524" layer="91"/>
<junction x="139.7" y="93.98"/>
<wire x1="60.96" y1="48.26" x2="60.96" y2="50.8" width="0.1524" layer="91"/>
<junction x="60.96" y="50.8"/>
<junction x="86.36" y="50.8"/>
<pinref part="J2" gate="G$1" pin="8"/>
<wire x1="144.78" y1="33.02" x2="157.48" y2="33.02" width="0.1524" layer="91"/>
<wire x1="157.48" y1="33.02" x2="157.48" y2="50.8" width="0.1524" layer="91"/>
<wire x1="99.06" y1="50.8" x2="157.48" y2="50.8" width="0.1524" layer="91"/>
<pinref part="C2" gate="G$1" pin="C2"/>
<wire x1="99.06" y1="48.26" x2="99.06" y2="50.8" width="0.1524" layer="91"/>
<wire x1="86.36" y1="50.8" x2="99.06" y2="50.8" width="0.1524" layer="91"/>
<junction x="99.06" y="50.8"/>
<pinref part="Q1" gate="G$1" pin="D"/>
<wire x1="45.72" y1="55.88" x2="60.96" y2="55.88" width="0.1524" layer="91"/>
<junction x="60.96" y="55.88"/>
</segment>
</net>
<net name="!POWER_ENA1" class="0">
<segment>
<pinref part="Q1" gate="G$1" pin="G"/>
<wire x1="-2.54" y1="55.88" x2="25.4" y2="55.88" width="0.1524" layer="91"/>

<pinref part="U1" gate="A" pin="RA5"/>
<wire x1="-2.54" y1="55.88" x2="-2.54" y2="30.48" width="0.1524" layer="91"/>
<wire x1="-2.54" y1="30.48" x2="17.78" y2="30.48" width="0.1524" layer="91"/>
</segment>
</net>
<net name="ESTOP" class="0">
<segment>
<pinref part="U1" gate="A" pin="RC2"/>
<wire x1="83.82" y1="17.78" x2="111.76" y2="17.78" width="0.1524" layer="91"/>

<wire x1="111.76" y1="17.78" x2="111.76" y2="20.32" width="0.1524" layer="91"/>
<wire x1="111.76" y1="20.32" x2="152.4" y2="20.32" width="0.1524" layer="91"/>
<pinref part="J2" gate="G$1" pin="2"/>
<wire x1="152.4" y1="20.32" x2="152.4" y2="40.64" width="0.1524" layer="91"/>
<wire x1="152.4" y1="40.64" x2="144.78" y2="40.64" width="0.1524" layer="91"/>
</segment>
</net>
<net name="RT" class="0">
<segment>
<pinref part="U1" gate="A" pin="RC1"/>
<wire x1="83.82" y1="20.32" x2="109.22" y2="20.32" width="0.1524" layer="91"/>

<wire x1="109.22" y1="20.32" x2="109.22" y2="22.86" width="0.1524" layer="91"/>
<wire x1="109.22" y1="22.86" x2="149.86" y2="22.86" width="0.1524" layer="91"/>
<wire x1="149.86" y1="22.86" x2="149.86" y2="38.1" width="0.1524" layer="91"/>
<pinref part="J2" gate="G$1" pin="4"/>
<wire x1="149.86" y1="38.1" x2="144.78" y2="38.1" width="0.1524" layer="91"/>
</segment>
</net>
<net name="UP" class="0">
<segment>
<pinref part="U1" gate="A" pin="RC0"/>
<wire x1="83.82" y1="22.86" x2="106.68" y2="22.86" width="0.1524" layer="91"/>

<wire x1="106.68" y1="22.86" x2="106.68" y2="35.56" width="0.1524" layer="91"/>
<pinref part="J2" gate="G$1" pin="5"/>
<wire x1="106.68" y1="35.56" x2="124.46" y2="35.56" width="0.1524" layer="91"/>
</segment>
</net>
<net name="DOWN/VERT" class="0">
<segment>
<pinref part="U1" gate="A" pin="RA2"/>

<wire x1="83.82" y1="25.4" x2="119.38" y2="25.4" width="0.1524" layer="91"/>
<wire x1="119.38" y1="25.4" x2="119.38" y2="33.02" width="0.1524" layer="91"/>
<pinref part="J2" gate="G$1" pin="7"/>
<wire x1="119.38" y1="33.02" x2="124.46" y2="33.02" width="0.1524" layer="91"/>
</segment>
</net>
<net name="SLAVE_RX" class="0">
<segment>
<pinref part="U1" gate="A" pin="RC4"/>
<wire x1="17.78" y1="20.32" x2="7.62" y2="20.32" width="0.1524" layer="91"/>
<wire x1="7.62" y1="20.32" x2="7.62" y2="111.76" width="0.1524" layer="91"/>
<wire x1="7.62" y1="111.76" x2="22.86" y2="111.76" width="0.1524" layer="91"/>

<pinref part="U2" gate="G$1" pin="UART_RX"/>
</segment>
</net>
<net name="MASTER_TX" class="0">
<segment>
<pinref part="D1" gate="G$1" pin="K"/>
<wire x1="139.7" y1="129.54" x2="142.24" y2="129.54" width="0.1524" layer="91"/>
<wire x1="142.24" y1="129.54" x2="147.32" y2="129.54" width="0.1524" layer="91"/>
<wire x1="142.24" y1="129.54" x2="142.24" y2="91.44" width="0.1524" layer="91"/>
<wire x1="142.24" y1="91.44" x2="81.28" y2="91.44" width="0.1524" layer="91"/>
<junction x="142.24" y="129.54"/>
<wire x1="81.28" y1="91.44" x2="81.28" y2="60.96" width="0.1524" layer="91"/>
<wire x1="81.28" y1="60.96" x2="81.28" y2="43.18" width="0.1524" layer="91"/>
<wire x1="81.28" y1="43.18" x2="10.16" y2="43.18" width="0.1524" layer="91"/>
<wire x1="10.16" y1="43.18" x2="10.16" y2="17.78" width="0.1524" layer="91"/>
<pinref part="U1" gate="A" pin="RC3"/>
<wire x1="10.16" y1="17.78" x2="17.78" y2="17.78" width="0.1524" layer="91"/>

<pinref part="U4" gate="G$1" pin="UART_TX"/>
<pinref part="X1" gate="-2" pin="1"/>
<wire x1="101.6" y1="60.96" x2="81.28" y2="60.96" width="0.1524" layer="91"/>
<junction x="81.28" y="60.96"/>
</segment>
</net>
<net name="RESET" class="0">
<segment>
<pinref part="U1" gate="A" pin="MCLR/VPP/RA3"/>
<wire x1="17.78" y1="25.4" x2="-25.4" y2="25.4" width="0.1524" layer="91"/>
<pinref part="SV1" gate="G$1" pin="1"/>
<wire x1="-25.4" y1="25.4" x2="-25.4" y2="81.28" width="0.1524" layer="91"/>
<wire x1="-25.4" y1="81.28" x2="-10.16" y2="81.28" width="0.1524" layer="91"/>

</segment>
</net>
<net name="DAT" class="0">
<segment>
<pinref part="U1" gate="A" pin="RA0/ICSPDAT"/>
<wire x1="83.82" y1="30.48" x2="96.52" y2="30.48" width="0.1524" layer="91"/>

</segment>
<segment>
<pinref part="SV1" gate="G$1" pin="4"/>
<wire x1="-10.16" y1="73.66" x2="-17.78" y2="73.66" width="0.1524" layer="91"/>

</segment>
</net>
<net name="N$1" class="0">
<segment>
<pinref part="D1" gate="G$1" pin="A"/>
<wire x1="124.46" y1="129.54" x2="99.06" y2="129.54" width="0.1524" layer="91"/>
<pinref part="X2" gate="-2" pin="1"/>
<wire x1="99.06" y1="129.54" x2="99.06" y2="134.62" width="0.1524" layer="91"/>
<pinref part="R4" gate="G$1" pin="2"/>
<wire x1="99.06" y1="134.62" x2="99.06" y2="139.7" width="0.1524" layer="91"/>
<wire x1="101.6" y1="134.62" x2="99.06" y2="134.62" width="0.1524" layer="91"/>
<junction x="99.06" y="134.62"/>
</segment>
</net>
<net name="5V" class="0">
<segment>
<pinref part="X2" gate="-1" pin="1"/>
<wire x1="121.92" y1="134.62" x2="121.92" y2="139.7" width="0.1524" layer="91"/>
<pinref part="R4" gate="G$1" pin="1"/>
<wire x1="119.38" y1="134.62" x2="121.92" y2="134.62" width="0.1524" layer="91"/>
<pinref part="U3" gate="G$1" pin="VIN"/>
<pinref part="C4" gate="G$1" pin="C2"/>
<wire x1="134.62" y1="114.3" x2="134.62" y2="119.38" width="0.1524" layer="91"/>
<wire x1="134.62" y1="119.38" x2="121.92" y2="119.38" width="0.1524" layer="91"/>
<wire x1="121.92" y1="119.38" x2="119.38" y2="119.38" width="0.1524" layer="91"/>
<wire x1="121.92" y1="134.62" x2="121.92" y2="119.38" width="0.1524" layer="91"/>
<junction x="121.92" y="134.62"/>
<junction x="121.92" y="119.38"/>

</segment>
</net>
<net name="N$2" class="0">
<segment>
<pinref part="U4" gate="G$1" pin="PIO1"/>
<pinref part="R6" gate="G$1" pin="2"/>
<wire x1="182.88" y1="129.54" x2="195.58" y2="129.54" width="0.1524" layer="91"/>
</segment>
</net>
<net name="N$3" class="0">
<segment>
<pinref part="R6" gate="G$1" pin="1"/>
<pinref part="L2" gate="G$1" pin="A"/>
<wire x1="195.58" y1="111.76" x2="195.58" y2="109.22" width="0.1524" layer="91"/>
</segment>
</net>
<net name="LEFT/HOR" class="0">
<segment>
<pinref part="U1" gate="A" pin="RA1/ICSPCLK"/>

<wire x1="83.82" y1="27.94" x2="147.32" y2="27.94" width="0.1524" layer="91"/>
<wire x1="147.32" y1="27.94" x2="147.32" y2="35.56" width="0.1524" layer="91"/>
<pinref part="J2" gate="G$1" pin="6"/>
<wire x1="147.32" y1="35.56" x2="144.78" y2="35.56" width="0.1524" layer="91"/>
</segment>
<segment>
<pinref part="SV1" gate="G$1" pin="5"/>
<wire x1="-10.16" y1="71.12" x2="-17.78" y2="71.12" width="0.1524" layer="91"/>

</segment>
</net>
</nets>
</sheet>
</sheets>
<errors>
<approved hash="104,1,17.78,25.4,U1,MCLR/VPP/RA3,RESET,,,"/>
<approved hash="104,1,17.78,33.02,U1,VDD,3V,,,"/>
<approved hash="104,1,58.42,101.6,U2,VCC,3V-SW,,,"/>
<approved hash="113,1,-7.57767,74.6404,SV1,,,,,"/>
</errors>
</schematic>
</drawing>
<compatibility>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports URNs for individual library
assets (packages, symbols, and devices). The URNs of those assets
will not be understood (or retained) with this version.
</note>
<note version="8.3" severity="warning">
Since Version 8.3, EAGLE supports the association of 3D packages
with devices in libraries, schematics, and board files. Those 3D
packages will not be understood (or retained) with this version.
</note>
</compatibility>
</eagle>

license: MIT

license_type: permissive

branch_name: refs/heads/master


text:
/*
 * Copyright (c) 2019 QLC Chain Team
 *
 * This software is released under the MIT License.
 * https://opensource.org/licenses/MIT
 */

package chain

import (
	"errors"

	"go.uber.org/zap"

	"github.com/qlcchain/go-qlc/common"
	"github.com/qlcchain/go-qlc/consensus/pov"
	"github.com/qlcchain/go-qlc/log"
)

type PoVService struct {
	common.ServiceLifecycle
	povEngine *pov.PoVEngine
	logger    *zap.SugaredLogger
}

func NewPoVService(cfgFile string) *PoVService {
	povEngine, _ := pov.NewPovEngine(cfgFile, false)
	return &PoVService{
		povEngine: povEngine,
		logger:    log.NewLogger("pov_service"),
	}
}

func (pov *PoVService) GetPoVEngine() *pov.PoVEngine {
	return pov.povEngine
}

func (pov *PoVService) Init() error {
	if !pov.PreInit() {
		return errors.New("pre init fail")
	}
	defer pov.PostInit()
	return pov.povEngine.Init()
}

func (pov *PoVService) Start() error {
	if !pov.PreStart() {
		return errors.New("pre start fail")
	}
	defer pov.PostStart()

	return pov.povEngine.Start()
}

func (pov *PoVService) Stop() error {
	if !pov.PreStop() {
		return errors.New("pre stop fail")
	}
	defer pov.PostStop()

	return pov.povEngine.Stop()
}

func (pov *PoVService) Status() int32 {
	return pov.State()
}

repository: qlcchain/go-qlc

repo_name: qlcchain/go-qlc

gha_license_id: MIT

gha_language: Go

extension: go


text:
using MZcms.Core.Helper;

namespace MZcms.Web.Framework
{
    public class CurrentUrlHelper
    {
        /// <summary>
        /// 取站点域名：Scheme://Host
        /// </summary>
        /// <returns></returns>
        public static string CurrentUrlNoPort()
        {
            return WebHelper.GetScheme() + "://" + WebHelper.GetHost();
        }
        /// <summary>
        /// 取站点域名，带端口：Scheme://Host:Port
        /// </summary>
        /// <returns></returns>
        public static string CurrentUrl()
        {
            var scheme = WebHelper.GetScheme().ToLower();
            var port = WebHelper.GetPort();
            if (port == "80" && scheme == "http") { port = ""; }
            if (port == "443" && scheme == "https") { port = ""; }
            port = string.IsNullOrEmpty(port) ? string.Empty : ":" + port;
            return scheme + "://" + WebHelper.GetHost() + port;
        }

        /// <summary>
        /// 取站点Scheme
        /// </summary>
        /// <returns></returns>
        public static string GetScheme()
        {
            return WebHelper.GetScheme();
        }

    }
}

repository: MiZoneRom/MiZoneAdminManager

repo_name: MiZoneRom/MiZoneAdminManager

extension: cs


text:
package main

import (
	"os"
	"os/signal"
	"syscall"

	"github.com/mrtc0/cxray/pkg/logger"
	tracer "github.com/mrtc0/cxray/pkg/tracer"
	"github.com/mrtc0/cxray/pkg/tracer/execve"
	"github.com/mrtc0/cxray/pkg/tracer/listen"
	"github.com/mrtc0/cxray/pkg/tracer/open"
	"github.com/mrtc0/cxray/pkg/tracer/tcpv4connect"
	"gopkg.in/urfave/cli.v1"
)

func main() {
	app := cli.NewApp()
	l := logger.New(logger.Format(), logger.Output(os.Stdout))

	app.Action = func(c *cli.Context) error {
		l := logger.New(logger.Format(), logger.Output(os.Stdout))
		sig := make(chan os.Signal, 1)

		signal.Notify(sig, os.Interrupt)
		signal.Notify(sig, syscall.SIGTERM)

		tracer.Init()
		tracer.Tracers = map[string]tracer.Tracer{
			"execve":       execve.Init(),
			"open":         open.Init(),
			"tcpv4connect": tcpv4connect.Init(),
			"listen":       listen.Init(),
		}

		for _, t := range tracer.Tracers {
			err := t.Load()
			if err != nil {
				t.Stop()
				l.Fatal(err)
			}

			go func(t tracer.Tracer) {
				for {
					event, err := t.Watch()

					if event == nil {
						continue
					}

					if err != nil {
						t.Stop()
						l.Fatal(err)
					}

					l.Info("", *event)
				}
			}(t)

			t.Start()
		}

		<-sig
		for _, t := range tracer.Tracers {
			t.Stop()
		}
		return nil
	}

	err := app.Run(os.Args)
	if err != nil {
		l.Fatal(err)
	}
}

repository: triplekill/cxray

repo_name: triplekill/cxray


text:
// Copyright (c) 2020, mParticle, Inc
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   https://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.

using System;
using System.Globalization;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using static MP.Json.Validation.BitUtils;
using System.Collections.Generic;

namespace MP.Json.Validation
{

    /// <summary>
    /// Reusable non-thread-safe schema validator.
    ///
    /// This is not thread-safe, so you need one per thread. However, this can be reused for successive
    /// validations in one thread. Just call Init(document, object).
    /// </summary>
    public class JsonValidator
    {
        #region Variables
        const int MaxTimeToLive = 1000 * 1000;

        private EventHandler<ValidationArgs> errorAction;

        private readonly ValidationArgs validationArgs;

        private StringInfo _stringInfo;

        private int suppressionLevel;

        private int timeToLive;

        #endregion

        #region Construction
        public JsonValidator()
        {
            validationArgs = new ValidationArgs(this);
        }
        #endregion

        #region Properties

        public readonly JsonPointer SchemaPointer = new JsonPointer();

        public readonly JsonPointer InstancePointer = new JsonPointer();

        /// <summary>
        /// Strict compliance at the cost of performance
        /// </summary>

        public bool Strict { get; set; }

        /// <summary>
        /// Enable coercion of string values to numbers and booleans
        /// </summary>
        public bool CoerceStringsToValues { get; set; }

        /// <summary>
        /// Whether validation should abort on first error
        /// </summary>
        public bool AbortOnError { get; set; }

        public SchemaVersion Version { get; set; } = SchemaVersion.All;

        /// <summary>
        /// For correctly reading string lengths
        /// </summary>
        public StringInfo StringInfo
        {
            get
            {
                if (_stringInfo == null)
                    _stringInfo = new StringInfo();
                return _stringInfo;
            }
        }

        /// <summary>
        /// Indicates whether the validation was successful
        /// </summary>
        public bool Success { get; private set; }

        #endregion

        #region Methods

        internal int TurnOffErrors()
        {
            return suppressionLevel++;
        }

        internal void TurnOnErrors()
        {
            suppressionLevel--;
        }

        internal void RestoreSuppressionLevel(int level)
        {
            suppressionLevel = level;
        }

        internal bool IsRecordingErrors
            => suppressionLevel == 0 && errorAction != null;

        internal bool ReportError(ErrorType errorType,
            Subschema schema = null,
            object actual = null,
            object expected = null,
            object instance = null)
        {
            var result = ReportError((Keyword)errorType, schema, actual, expected, instance);
            if (errorType == ErrorType.TimeLimit) CancelValidation();
            return result;
        }

        /// <summary>
        /// Pushes an error onto the errors list with the given parameters
        /// </summary>
        /// <param name="keyword"></param>
        /// <param name="key"></param>
        /// <param name="actual"></param>
        /// <param name="expected"></param>
        /// <param name="instancePath"></param>
        /// <param name="schemaPath"></param>
        internal bool ReportError(Keyword keyword,
            Subschema schema,
            object actual = null,
            object expected = null,
            object instance = null)
        {
            // Errors being suppressed don't directly affect success result
            if (suppressionLevel > 0 || errorAction == null)
                return true;

            if (schema != null)
            {
                if (expected == null)
                    expected = schema.GetData(keyword);
            }

            validationArgs.Actual = MPJson.From(actual);
            validationArgs.Instance = MPJson.From(instance ?? actual);
            validationArgs.Expected = expected;
            validationArgs.Schema = schema;
            validationArgs.ValidationError = null;

            if (keyword >= 0)
            {
                validationArgs.ErrorType = (ErrorType)keyword;
                SchemaPointer.Push(keyword);
            }
            else
            {
                validationArgs.ErrorType = (ErrorType)SchemaPointer.Keyword;
            }

            errorAction(this, validationArgs);
            if (keyword >= 0) SchemaPointer.Pop();

            if (AbortOnError)
                errorAction = null;

            return errorAction == null;
        }

        [DebuggerStepThrough]
        internal bool OutOfTime()
        {
            if (timeToLive-- > 0)
                return false;

            ReportError(ErrorType.TimeLimit, null);
            CancelValidation();
            return true;
        }

        public bool Validate(MPSchema schema, MPJson json, EventHandler<ValidationArgs> eventHandler = null)
        {
            return Validate(schema?.Root, json, eventHandler);
        }

        public bool Validate(Subschema root, MPJson json, EventHandler<ValidationArgs> eventHandler = null)
        {
            if (root == null)
                return false;

            object jobject = json.Value;

            SchemaPointer.Clear();
            InstancePointer.Clear();

            suppressionLevel = 0;

            errorAction = eventHandler;
            timeToLive = MaxTimeToLive;
            Success = Validate(root, jobject);
            return Success;
        }

        public void CancelValidation()
        {
            errorAction = null;
        }

        #endregion

        #region Validation

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        private bool Validate(Subschema schema, object instance)
        {
            return !OutOfTime()
                && ValidateType(schema, instance)
                && ValidateGeneric(schema, instance);
        }

        private bool Validate(Subschema schema, object instance,
            Keyword keyword, string prop1, string prop2)
        {
            SchemaPointer.Push(keyword);
            if (prop1 != null) SchemaPointer.Push(prop1);
            if (prop2 != null) InstancePointer.Push(prop2);

            bool result = Validate(schema, instance);

            SchemaPointer.Pop();
            if (prop1 != null) SchemaPointer.Pop();
            if (prop2 != null) InstancePointer.Pop();
            return result;
        }

        private bool Validate(Subschema schema, object instance, Keyword keyword)
        {
            SchemaPointer.Push(keyword);
            bool result = Validate(schema, instance);
            SchemaPointer.Pop();
            return result;
        }

        private bool Validate(Subschema schema, object instance, int index)
        {
            SchemaPointer.Push(index);
            bool result = Validate(schema, instance);
            SchemaPointer.Pop();
            return result;
        }

        private bool Validate(Subschema schema, object instance, int index, int instanceIndex)
        {
            if (index >= 0) SchemaPointer.Push(index);
            InstancePointer.Push(instanceIndex);
            bool result = Validate(schema, instance);
            InstancePointer.Pop();
            if (index >= 0) SchemaPointer.Pop();
            return result;
        }

        private bool ValidateType(Subschema schema, object value)
        {
            var type = MPJson.GetType(value);
            switch (type)
            {
                case JsonType.Object:
                    if ((schema.Flags & SchemaFlags.TypeObject) == 0)
                        break;
                    return ValidateObject(schema, (KeyValuePair<string, object>[])value);

                case JsonType.Array:
                    if ((schema.Flags & SchemaFlags.TypeArray) == 0)
                        break;
                    return ValidateArray(schema, (object[])value);

                case JsonType.Number:
                    double d = Convert.ToDouble(value);
                    if ((schema.Flags & SchemaFlags.TypeNumber) == 0
                        && ((schema.Flags & SchemaFlags.TypeInteger) == 0 || d != Math.Floor(d)))
                        break;
                    return ValidateNumber(schema, d);

                case JsonType.String:
                    if ((schema.Flags & SchemaFlags.TypeString) != 0)
                        return ValidateString(schema, (string)value);

                    if (this.CoerceStringsToValues)
                    {
                        var str = (string)value;
                        if ((schema.Flags & (SchemaFlags.TypeNumber | SchemaFlags.TypeInteger)) != 0
                            && double.TryParse(str, NumberStyles.Float, CultureInfo.InvariantCulture, out d)
                            && (0 != (schema.Flags & SchemaFlags.TypeNumber) || d == Math.Floor(d)))
                            return ValidateNumber(schema, d);

                        if ((schema.Flags & SchemaFlags.TypeBoolean) != 0
                            && string.Equals(str, str.Length == 4 ? JsonParser.TrueKeyword : JsonParser.FalseKeyword, StringComparison.OrdinalIgnoreCase))
                            return true;
                    }

                    break;

                case JsonType.Boolean:
                    if ((schema.Flags & SchemaFlags.TypeBoolean) == 0)
                        break;
                    return true;

                case JsonType.Null:
                    if ((schema.Flags & SchemaFlags.TypeNull) == 0)
                        break;
                    return true;
            }

            if (!IsRecordingErrors)
                return false;

            return (schema.Flags & SchemaFlags.TypeAll) != 0
                ? ReportError(
                    ErrorType.Type,
                    schema,
                    actual: KeywordUtils.GetTypeText(type),
                    expected: schema.GetValidTypes(),
                    instance: value)
                : ReportError(ErrorType.None, actual: value);
        }

        private bool ValidateGeneric(Subschema schema, object instance)
        {
            bool finalResult = true;

            for (SchemaFlags mask = schema.Flags & (SchemaFlags.GenericProperties & SchemaFlags.AllProperties);
                    mask != 0;
                    mask = (SchemaFlags)RemoveLowestBit((long)mask))
            {
                Keyword keyword = (Keyword)IndexOfLowestBit((long)mask);

                bool? result = null;
                Subschema[] schemaArray;
                int index;
                switch (keyword)
                {
                    case Keyword.If:
                        int level = TurnOffErrors();
                        result = Validate(schema.If, instance, Keyword.If);
                        RestoreSuppressionLevel(level);

                        result = result == true
                            ? Validate(schema.Then, instance, Keyword.Then)
                            : Validate(schema.Else, instance, Keyword.Else);
                        break;

                    case Keyword.Not:
                        level = TurnOffErrors();
                        result = !Validate(schema.Not, instance, Keyword.Not);
                        RestoreSuppressionLevel(level);
                        break;

                    case Keyword.AllOf:
                        result = true;
                        schemaArray = schema.AllOf;
                        SchemaPointer.Push(keyword);
                        for (index = 0; index < schemaArray.Length; index++)
                            if (!Validate(schemaArray[index], instance, index))
                            {
                                finalResult = false;
                                if (!IsRecordingErrors) break;
                            }
                        SchemaPointer.Pop();
                        break;

                    case Keyword.AnyOf:
                        result = false;
                        level = TurnOffErrors();
                        schemaArray = schema.AnyOf;
                        SchemaPointer.Push(keyword);
                        for (index = 0; index < schemaArray.Length; index++)
                            if (Validate(schemaArray[index], instance, index))
                            {
                                result = true;
                                break;
                            }
                        SchemaPointer.Pop();
                        RestoreSuppressionLevel(level);
                        break;

                    case Keyword.OneOf:
                        result = false;
                        level = TurnOffErrors();
                        schemaArray = schema.OneOf;
                        SchemaPointer.Push(keyword);
                        for (index = 0; index < schemaArray.Length; index++)
                            if (Validate(schemaArray[index], instance, index))
                            {
                                result = !result;
                                if (result == false)
                                    break;
                            }
                        SchemaPointer.Pop();
                        RestoreSuppressionLevel(level);
                        break;

                    case Keyword.Enum:
                        result = false;
                        // TODO: Provide support for type coercion
                        foreach (object v in (object[])schema.Enum.Value)
                            if (MPJson.Matches(v, instance))
                            {
                                result = true;
                                break;
                            }
                        break;

                    case Keyword.Const:
                        // TODO: Provide support for string to value coercion
                        result = MPJson.Matches(schema.Const.Value, instance);
                        break;

                    case Keyword._Ref:
                        var r = schema.Ref;
                        if (r.Version != 0)
                        {
                            var draft = new MPSchema(MPJson.From(instance), r.Version);
                            result = draft.IsValid;
                            break; // This was checked on creation
                        }

                        var rSchema = r.Schema;
                        result = rSchema != null && ReferenceUsageIsControlled();
                        if (result == true && !Validate(rSchema, instance, Keyword._Ref))
                            finalResult = false;
                        break;

                    case Keyword.Metadata:
                        break;
                }

                if (result == false)
                {
                    finalResult = false;
                    if (ReportError(keyword, schema, instance))
                        return false;
                }
            }

            return finalResult;
        }

        private bool ReferenceUsageIsControlled()
        {
            // The basic idea is that each use of a reference should contribute to
            // some progress in the processing of the instance

            int schemaDepth = SchemaPointer.Length;
            int instanceDepth = InstancePointer.Length;
            int allowedDepth = 2 * instanceDepth + 2;
            return schemaDepth <= allowedDepth;
        }

        private bool ValidateObject(Subschema schema, KeyValuePair<string, object>[] map)
        {
            bool finalResult = true;
            bool propertyCheck = false;

            for (var mask = schema.Flags & SchemaFlags.ObjectProperties;
                    mask != 0;
                    mask = (SchemaFlags)RemoveLowestBit((long)mask))
            {
                Keyword keyword = (Keyword)IndexOfLowestBit((long)mask);
                Subschema subschema;

                bool result = true;
                switch (keyword)
                {
                    case Keyword.DependentSchemas:
                        foreach (var kv in schema.DependentSchemas)
                        {
                            int index = map.GetPropertyIndex(kv.Key);
                            if (index < 0) continue;
                            if (!Validate(kv.Value, map,
                                Keyword.DependentSchemas, kv.Key, null))
                            {
                                finalResult = false;
                                if (!IsRecordingErrors)
                                    return false;
                            }
                        }
                        break;

                    case Keyword.DependentRequired:
                        foreach (var kv in schema.DependentRequired)
                        {
                            int index = map.GetPropertyIndex(kv.Key);
                            if (index >= 0 && !HandleRequired(schema, map, kv.Value,
                                Keyword.DependentRequired, kv.Key))
                            {
                                finalResult = false;
                                if (!IsRecordingErrors)
                                    return false;
                            }
                        }
                        break;

                    case Keyword.MaxProperties:
                        result = map.Length <= schema.MaxProperties;
                        break;

                    case Keyword.MinProperties:
                        result = map.Length >= schema.MinProperties;
                        break;

                    case Keyword.PropertyNames:
                        subschema = schema.PropertyNames;
                        for (int i = 0; i < map.Length; i++)
                        {
                            var kv = map[i];
                            if (!Validate(subschema, kv.Key,
                                Keyword.PropertyNames, null, kv.Key))
                            {
                                finalResult = false;
                                if (!IsRecordingErrors)
                                    return false;
                            }
                        }
                        break;

                    case Keyword.Required:
                        if (!HandleRequired(schema, map, schema.Required,
                            Keyword.Required, null))
                        {
                            finalResult = false;
                            if (!IsRecordingErrors)
                                return false;
                        }
                        break;

                    case Keyword.AdditionalProperties:
                    case Keyword.PatternProperties:
                    case Keyword.Properties:
                        propertyCheck = true;
                        break;
                }

                if (!result)
                {
                    finalResult = false;
                    if (ReportError(keyword, schema, map))
                        return false;
                }
            }

            if (propertyCheck && !ValidateProperties(map,
                    schema.Properties, schema.PatternProperties, schema.AdditionalProperties))
                finalResult = false;

            return finalResult;
        }

        /// <summary>
        /// Fast approach to search all properties
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="instMap"></param>
        /// <param name="schemaMap"></param>
        /// <remarks> O(n lg(m/n)) where n is |schema properties| and m is |instance properties| </remarks>
        private void DivideAndConquer<T>(KeyValuePair<string, object>[] instMap, KeyValuePair<string, T>[] schemaMap)
            => DivideAndConquer(instMap, schemaMap, 0, instMap.Length - 1, 0, schemaMap.Length - 1);

        private void DivideAndConquer<T>(KeyValuePair<string, object>[] instMap, KeyValuePair<string, T>[] schemaMap,
            int istart, int iend,
            int sstart, int send)
        {
            while (sstart < send)
            {
                int mid = sstart + send >> 1;
                int partition = instMap.GetPropertyIndex(schemaMap[mid].Key, istart, iend);
                int istart2;
                if (partition >= 0)
                {
                    istart2 = partition + 1;
                }
                else
                {
                    partition = ~partition;
                    istart2 = partition;
                }

                DivideAndConquer(instMap, schemaMap, istart2, iend, mid + 1, send);
                iend = partition - 1;
                send = mid - 1;
            }
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="map"></param>
        /// <param name="validator"></param>
        /// <param name="properties"></param>
        /// <param name="patternProperties"></param>
        /// <param name="additionalProperties"></param>
        /// <param name="recordErrors"></param>
        /// <returns></returns>
        private bool ValidateProperties(
            KeyValuePair<string, object>[] map,
            KeyValuePair<string, Subschema>[] properties,
            KeyValuePair<SchemaRegex, Subschema>[] patternProperties,
            Subschema additionalProperties)
        {
            if (properties == null)
                properties = Array.Empty<KeyValuePair<string, Subschema>>();

            bool result = true;
            for (int i = 0, iprop = 0; i < map.Length; i++)
            {
                string prop = map[i].Key;
                object value = map[i].Value;

                // Match property
                int cmp = 1;
                bool found = false;
                for (; iprop < properties.Length; iprop++)
                {
                    cmp = string.CompareOrdinal(properties[iprop].Key, prop);
                    if (cmp >= 0)
                        break;
                }

                if (cmp == 0)
                {
                    found = true;
                    if (!Validate(properties[iprop].Value, value,
                        Keyword.Properties, prop, prop))
                    {
                        result = false;
                        if (!IsRecordingErrors)
                            return false;
                    }
                }

                // Match patternProperty
                if (patternProperties != null)
                {
                    foreach (var pp in patternProperties)
                    {
                        if (pp.Key.Matches(prop) == SchemaRegexSuccess.Success)
                        {
                            found = true;
                            if (!Validate(pp.Value, value,
                                Keyword.PatternProperties, pp.Key.Pattern, prop))
                            {
                                result = false;
                                if (!IsRecordingErrors)
                                    return false;
                            }
                        }
                    }
                }

                // Match additionalProperties
                if (found == false && additionalProperties != null)
                {
                    if (!Validate(additionalProperties, value,
                        Keyword.AdditionalProperties, null, prop))
                    {
                        result = false;
                        if (!IsRecordingErrors)
                            return false;
                    }
                }
            }

            return result;
        }

        private bool HandleRequired(Subschema schema, KeyValuePair<string, object>[] map, string[] required,
            Keyword keyword, string prop)
        {
            bool result = true;
            SchemaPointer.Push(keyword);
            if (prop != null) SchemaPointer.Push(prop);
            for (int index = 0; index < required.Length; index++)
            {
                string s = required[index];
                if (s == null || map.GetPropertyIndex(s) < 0)
                {
                    SchemaPointer.Push(index);
                    ReportError(Keyword.None, schema, actual: prop, expected: s, instance: map);
                    SchemaPointer.Pop();

                    result = false;
                    if (!IsRecordingErrors)
                        break;
                }
            }
            if (prop != null) SchemaPointer.Pop();
            SchemaPointer.Pop();
            return result;
        }

        private bool ValidateArray(Subschema schema, object[] array)
        {
            bool finalResult = true;

            for (var mask = schema.Flags & (SchemaFlags.ArrayProperties & SchemaFlags.AllProperties);
                    mask != 0;
                    mask = (SchemaFlags)RemoveLowestBit((long)mask))
            {
                Keyword keyword = (Keyword)IndexOfLowestBit((long)mask);
                Subschema subschema;
                Subschema[] schemaArray;
                bool result = true;
                bool respond = true;
                switch (keyword)
                {
                    case Keyword.AdditionalItems:
                        // https://json-schema.org/draft/2019-09/json-schema-core.html#rfc.section.8.2.4
                        // AdditionalItems is ignored if Items is not present
                        subschema = schema.AdditionalItems;
                        schemaArray = schema.Items as Subschema[];
                        respond = false;
                        if (schemaArray != null && schemaArray.Length < array.Length)
                        {
                            SchemaPointer.Push(Keyword.AdditionalItems);
                            for (int i = schemaArray.Length; i < array.Length; i++)
                            {
                                result &= Validate(subschema, array[i], -1, i);
                                if (!result && !IsRecordingErrors)
                                    break;
                            }
                            SchemaPointer.Pop();
                        }
                        break;

                    case Keyword.Contains:
                        subschema = schema.Contains;
                        double minContains = schema.MinContains;
                        double maxContains = schema.MaxContains;
                        result = minContains == 0;
                        int contains = 0;
                        SchemaPointer.Push(Keyword.Contains);
                        TurnOffErrors();
                        for (int i = 0; i < array.Length; i++)
                        {
                            bool elementResult = Validate(subschema, array[i], -1, i);
                            if (elementResult)
                            {
                                contains++;
                                if (contains >= minContains)
                                {
                                    result = true;
                                    if (contains + (array.Length - i - 1) <= maxContains)
                                        break;
                                }
                            }
                        }
                        TurnOnErrors();
                        SchemaPointer.Pop();
                        if (contains > maxContains)
                            result = false;
                        break;

                    case Keyword.Items:
                        object items = schema.Items;
                        SchemaPointer.Push(Keyword.Items);
                        respond = false;
                        if ((subschema = items as Subschema) != null)
                        {
                            for (int i = 0; i < array.Length; i++)
                            {
                                result &= Validate(subschema, array[i], -1, i);
                                if (!result && !IsRecordingErrors)
                                    break;
                            }
                        }
                        else
                        {
                            schemaArray = (Subschema[])items;
                            result = true;
                            for (int i = Math.Min(array.Length, schemaArray.Length) - 1; i >= 0; i--)
                            {
                                result &= Validate(schemaArray[i], array[i], i, i);
                                if (!result && !IsRecordingErrors)
                                    break;
                            }
                        }
                        SchemaPointer.Pop();
                        break;

                    case Keyword.MaxItems:
                        result = array.Length <= schema.MaxItems;
                        break;

                    case Keyword.MinItems:
                        result = array.Length >= schema.MinItems;
                        break;

                    case Keyword.UniqueItems:
                        var uniques = new HashSet<MPJson>();
                        foreach (object v in array)
                            if (!uniques.Add(MPJson.From(v)))
                            {
                                result = false;
                                break;
                            }
                        break;
                }

                if (!result)
                {
                    finalResult = false;
                    if (respond
                        ? ReportError(keyword, schema, array)
                        : !IsRecordingErrors)
                        return false;
                }
            }

            return finalResult;
        }

        private bool ValidateString(Subschema schema, string value)
        {
            bool finalResult = true;

            for (var mask = schema.Flags & SchemaFlags.StringProperties;
                    mask != 0;
                    mask = (SchemaFlags)RemoveLowestBit((long)mask))
            {
                Keyword keyword = (Keyword)IndexOfLowestBit((long)mask);
                bool? result = true;
                switch (keyword)
                {
                    case Keyword.MinLength:
                        StringInfo si;

                        result = value.Length >= schema.MinLength;
                        if (result == true && Strict)
                        {
                            si = StringInfo;
                            si.String = value;
                            result = si.LengthInTextElements >= schema.MinLength;
                        }
                        break;

                    case Keyword.MaxLength:
                        result = value.Length <= schema.MaxLength;
                        if (result == false && Strict)
                        {
                            si = StringInfo;
                            si.String = value;
                            result = si.LengthInTextElements <= schema.MaxLength;
                        }
                        break;

                    case Keyword.Pattern:
                        SchemaRegex pattern = schema.Pattern;
                        var resultType = pattern.Matches(value);
                        if (resultType != SchemaRegexSuccess.Success)
                        {
                            if (resultType == SchemaRegexSuccess.TimedOut)
                            {
                                SchemaPointer.Push(Keyword.Pattern);
                                ReportError(ErrorType.TimeLimit, schema, value);
                                SchemaPointer.Pop();
                                return false;
                            }

                            finalResult = false;
                            if (ReportError(keyword, schema, value, pattern.Pattern))
                                return false;
                        }
                        continue;

                    case Keyword.Format:
                        result = Formats.IsValueOfFormat(value, schema.Format);
                        break;
                }

                if (result == false)
                {
                    finalResult = false;
                    if (ReportError(keyword, schema, value))
                        return false;
                }
            }

            return finalResult;
        }

        private bool ValidateNumber(Subschema schema, double value)
        {
            bool finalResult = true;

            for (var mask = schema.Flags & SchemaFlags.NumberProperties;
                    mask != 0;
                    mask = (SchemaFlags)RemoveLowestBit((long)mask))
            {
                Keyword keyword = (Keyword)IndexOfLowestBit((long)mask);
                bool? result = true;
                switch (keyword)
                {
                    case Keyword.Minimum:
                        result = value >= schema.Minimum;
                        break;

                    case Keyword.Maximum:
                        result = value <= schema.Maximum;
                        break;

                    case Keyword.ExclusiveMaximum:
                        result = value < schema.ExclusiveMaximum;
                        break;

                    case Keyword.ExclusiveMinimum:
                        result = value > schema.ExclusiveMinimum;
                        break;

                    case Keyword.MultipleOf:
                        double m = (double)schema.MultipleOf;
                        double r = value % m;
                        if (r != 0)
                        {
                            r = Math.Abs(r);
                            r = Math.Min(m - r, r);
                            result = r < 1e-14 * m;
                        }
                        break;
                }

                if (result == false)
                {
                    finalResult = false;
                    if (ReportError(keyword, schema, value))
                        return false;
                }
            }

            return finalResult;
        }

        #endregion
    }
}

repository: franclopez/mparticle-json

repo_name: franclopez/mparticle-json


text:
package anisync

import (
	"net/http"
	"sort"
	"time"

	"github.com/nstratos/go-myanimelist/mal"
)

type Client struct {
	resources Resources
}

func (c *Client) Resources() Resources { return c.resources }

func NewClient(resources Resources) *Client {
	return &Client{resources: resources}
}

func (c *Client) VerifyMALCredentials(username, password string) (*mal.User, *http.Response, error) {
	u, resp, err := c.resources.VerifyCredentials(username, password)
	if resp == nil {
		return u, nil, err
	}
	return u, resp.Response, err
}

type Anime struct {
	ID              int
	Status          Status
	Title           string
	EpisodesWatched int
	LastUpdated     *time.Time
	Rating          string
	Notes           string
	TimesRewatched  int
	Rewatching      bool
	Image           string
}

func FindByID(anime []Anime, id int) *Anime {
	sort.Sort(ByID(anime))
	i := sort.Search(len(anime), func(i int) bool { return anime[i].ID >= id })
	if i < len(anime) && anime[i].ID == id {
		return &anime[i]
	}
	return nil
}

type ByID []Anime

func (a ByID) Len() int           { return len(a) }
func (a ByID) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a ByID) Less(i, j int) bool { return a[i].ID < a[j].ID }

repository: nstratos/anisync

repo_name: nstratos/anisync


text:
import { IconType } from "react-icons";
import { GoHome } from "react-icons/go";
import { BiCoin } from "react-icons/bi";
import { RiDashboardLine } from "react-icons/ri";
import { IoIosBasket } from "react-icons/io";
import { GiWallet } from "react-icons/gi";
interface NavItem {
  id: number;
  name: string;
  icon: IconType;
  link: string;
}

export const navItem: Array<NavItem> = [
  {
    id: 1,
    name: "Home",
    icon: GoHome,
    link: "/",
  },
  {
    id: 2,
    name: "Wallet",
    icon: GiWallet,
    link: "/wallet",
  },
  {
    id: 3,
    name: "Buy token",
    icon: BiCoin,
    link: "/buyToken",
  },
  {
    id: 4,
    name: "Dashboard",
    icon: RiDashboardLine,
    link: "/Dashboard",
  },
  {
    id: 5,
    name: "Buy Product",
    icon: IoIosBasket,
    link: "/buyProduct",
  },
];

branch_name: refs/heads/main

extension: ts


text:
#pragma once

#include <cuda_runtime.h>
#include <cstdint>
#include <opencv2/opencv.hpp>

void cuda_preprocess_init(int max_image_size);
void cuda_preprocess_destroy();
void cuda_preprocess(uint8_t* src, int src_width, int src_height,
                     float* dst, int dst_width, int dst_height,
                     cudaStream_t stream);
void cuda_batch_preprocess(std::vector<cv::Mat>& img_batch,
                           float* dst, int dst_width, int dst_height,
                           cudaStream_t stream);

repository: wang-xinyu/tensorrtx

repo_name: wang-xinyu/tensorrtx

extension: h


text:
DESCRIPTION = "Bazel build and test tool"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"

SRC_URI[md5sum] = "7f66122853137fb98dfe5e61ff8b1275"
SRC_URI[sha256sum] = "56ea1b199003ad832813621744178e42b39e6206d34fbae342562c287da0cd54"

SRC_URI = "https://github.com/bazelbuild/bazel/releases/download/${PV}/bazel-${PV}-dist.zip"

inherit native

S = "${WORKDIR}"

INHIBIT_SYSROOT_STRIP = "1"

DEPENDS = "coreutils-native zip-native"

do_compile () {
        export HTTP_PROXY=${HTTP_PROXY}
        export HTTPS_PROXY=${HTTPS_PROXY}
        export http_proxy=${HTTP_PROXY}
        export https_proxy=${HTTPS_PROXY}
        export JAVA_HOME="${bindir}/openjdk-1.8-native/"
        ./compile.sh
}

do_install () {
        install -d ${D}${bindir}
        cp -Rf \
		${S}/output/* \
		${D}${bindir}
}

DEPENDS += "openjdk-8-native"
RDEPENDS_${PN}-native += "openjdk-8-native"

repository: ShotSpotter/meta-renesas-ai

repo_name: ShotSpotter/meta-renesas-ai

extension: bb


text:
import { App, ExpressJS, HandleRequest, JovoRequest, TestSuite } from 'jovo-framework';
import { Alexa } from 'jovo-platform-alexa';
import { GoogleAssistant } from 'jovo-platform-googleassistant';

jest.setTimeout(550);
process.env.NODE_ENV = 'UNIT_TEST';

let app: App;
let t: TestSuite;

for (const p of [new Alexa(), new GoogleAssistant()]) {
  beforeEach(() => {
    app = new App();
    app.use(p);
    t = p.makeTestSuite();
  });

  describe('test tell', () => {
    test('tell plain text', async (done) => {
      app.setHandler({
        LAUNCH() {
          this.tell('Hello World!');
        },
      });

      const launchRequest: JovoRequest = await t.requestBuilder.launch();
      app.handle(ExpressJS.dummyRequest(launchRequest));

      app.on('response', (handleRequest: HandleRequest) => {
        expect(handleRequest.jovo!.$response!.isTell('Hello World!')).toBe(true);
        done();
      });
    });

    test('tell speechbuilder', async (done) => {
      app.setHandler({
        LAUNCH() {
          this.$speech.addText('Hello World!');
          this.tell(this.$speech);
        },
      });

      const launchRequest: JovoRequest = await t.requestBuilder.launch();
      app.handle(ExpressJS.dummyRequest(launchRequest));

      app.on('response', (handleRequest: HandleRequest) => {
        expect(handleRequest.jovo!.$response!.isTell('Hello World!')).toBe(true);
        done();
      });
    });

    test('tell ssml', async (done) => {
      app.setHandler({
        LAUNCH() {
          this.tell('<speak>Hello <break time="100ms"/></speak>');
        },
      });

      const launchRequest: JovoRequest = await t.requestBuilder.launch();
      app.handle(ExpressJS.dummyRequest(launchRequest));

      app.on('response', (handleRequest: HandleRequest) => {
        expect(handleRequest.jovo!.$response!.isTell('Hello <break time="100ms"/>')).toBe(true);
        done();
      });
    });
  });

  describe('test ask', () => {
    test('ask plain text', async (done) => {
      app.setHandler({
        LAUNCH() {
          this.ask('Hello World!', 'Reprompt');
        },
      });

      const launchRequest: JovoRequest = await t.requestBuilder.launch();
      app.handle(ExpressJS.dummyRequest(launchRequest));

      app.on('response', (handleRequest: HandleRequest) => {
        expect(handleRequest.jovo!.$response!.isAsk('Hello World!', 'Reprompt')).toBe(true);
        done();
      });
    });

    test('ask speechbuilder', async (done) => {
      app.setHandler({
        LAUNCH() {
          this.$speech.addText('Hello World!');
          this.$reprompt.addText('Reprompt!');
          this.ask(this.$speech, this.$reprompt);
        },
      });

      const launchRequest: JovoRequest = await t.requestBuilder.launch();
      app.handle(ExpressJS.dummyRequest(launchRequest));

      app.on('response', (handleRequest: HandleRequest) => {
        expect(handleRequest.jovo!.$response!.isAsk('Hello World!', 'Reprompt!')).toBe(true);
        done();
      });
    });

    test('ask ssml', async (done) => {
      app.setHandler({
        LAUNCH() {
          this.ask(
            '<speak>Hello <break time="100ms"/></speak>',
            '<speak>Reprompt <break time="100ms"/></speak>',
          );
        },
      });

      const launchRequest: JovoRequest = await t.requestBuilder.launch();
      app.handle(ExpressJS.dummyRequest(launchRequest));

      app.on('response', (handleRequest: HandleRequest) => {
        expect(
          handleRequest.jovo!.$response!.isAsk(
            'Hello <break time="100ms"/>',
            'Reprompt <break time="100ms"/>',
          ),
        ).toBe(true);
        done();
      });
    });
  });
}