text:
5" y1="4.03351875" x2="4.561840625" y2="4.053840625" layer="21"/>
<rectangle x1="1.513840625" y1="4.053840625" x2="4.561840625" y2="4.074159375" layer="21"/>
<rectangle x1="1.49351875" y1="4.074159375" x2="4.582159375" y2="4.09448125" layer="21"/>
<rectangle x1="1.49351875" y1="4.09448125" x2="4.582159375" y2="4.1148" layer="21"/>
<rectangle x1="1.4732" y1="4.1148" x2="4.60248125" y2="4.13511875" layer="21"/>
<rectangle x1="1.45288125" y1="4.13511875" x2="4.6228" y2="4.155440625" layer="21"/>
<rectangle x1="1.45288125" y1="4.155440625" x2="4.64311875" y2="4.175759375" layer="21"/>
<rectangle x1="1.432559375" y1="4.175759375" x2="4.64311875" y2="4.19608125" layer="21"/>
<rectangle x1="1.412240625" y1="4.19608125" x2="4.663440625" y2="4.2164" layer="21"/>
<rectangle x1="1.412240625" y1="4.2164" x2="4.663440625" y2="4.23671875" layer="21"/>
<rectangle x1="1.39191875" y1="4.23671875" x2="4.683759375" y2="4.257040625" layer="21"/>
<rectangle x1="1.3716" y1="4.257040625" x2="4.70408125" y2="4.277359375" layer="21"/>
<rectangle x1="1.3716" y1="4.277359375" x2="4.70408125" y2="4.29768125" layer="21"/>
<rectangle x1="1.35128125" y1="4.29768125" x2="4.7244" y2="4.318" layer="21"/>
<rectangle x1="1.35128125" y1="4.318" x2="4.74471875" y2="4.33831875" layer="21"/>
<rectangle x1="1.330959375" y1="4.33831875" x2="4.74471875" y2="4.358640625" layer="21"/>
<rectangle x1="1.310640625" y1="4.358640625" x2="4.765040625" y2="4.378959375" layer="21"/>
<rectangle x1="1.310640625" y1="4.378959375" x2="2.26568125" y2="4.39928125" layer="21"/>
<rectangle x1="2.346959375" y1="4.378959375" x2="3.72871875" y2="4.39928125" layer="21"/>
<rectangle x1="3.78968125" y1="4.378959375" x2="4.785359375" y2="4.39928125" layer="21"/>
<rectangle x1="1.29031875" y1="4.39928125" x2="2.245359375" y2="4.4196" layer="21"/>
<rectangle x1="2.3876" y1="4.39928125" x2="3.68808125" y2="4.4196" layer="21"/>
<rectangle x1="3.83031875" y1="4.39928125" x2="4.785359375" y2="4.4196" layer="21"/>
<rectangle x1="1.27" y1="4.4196" x2="2.20471875" y2="4.43991875" layer="21"/>
<rectangle x1="2.428240625" y1="4.4196" x2="3.647440625" y2="4.43991875" layer="21"/>
<rectangle x1="3.850640625" y1="4.4196" x2="4.80568125" y2="4.43991875" layer="21"/>
<rectangle x1="1.29031875" y1="4.43991875" x2="2.1844" y2="4.460240625" layer="21"/>
<rectangle x1="2.46888125" y1="4.43991875" x2="3.6068" y2="4.460240625" layer="21"/>
<rectangle x1="3.89128125" y1="4.43991875" x2="4.80568125" y2="4.460240625" layer="21"/>
<rectangle x1="1.310640625" y1="4.460240625" x2="2.143759375" y2="4.480559375" layer="21"/>
<rectangle x1="2.529840625" y1="4.460240625" x2="3.545840625" y2="4.480559375" layer="21"/>
<rectangle x1="3.9116" y1="4.460240625" x2="4.785359375" y2="4.480559375" layer="21"/>
<rectangle x1="1.330959375" y1="4.480559375" x2="2.123440625" y2="4.50088125" layer="21"/>
<rectangle x1="2.5908" y1="4.480559375" x2="3.48488125" y2="4.50088125" layer="21"/>
<rectangle x1="3.952240625" y1="4.480559375" x2="4.765040625" y2="4.50088125" layer="21"/>
<rectangle x1="1.35128125" y1="4.50088125" x2="2.0828" y2="4.5212" layer="21"/>
<rectangle x1="2.651759375" y1="4.50088125" x2="3.42391875" y2="4.5212" layer="21"/>
<rectangle x1="3.972559375" y1="4.50088125" x2="4.74471875" y2="4.5212" layer="21"/>
<rectangle x1="1.3716" y1="4.5212" x2="2.06248125" y2="4.54151875" layer="21"/>
<rectangle x1="2.67208125" y1="4.5212" x2="3.4036" y2="4.54151875" layer="21"/>
<rectangle x1="4.0132" y1="4.5212" x2="4.7244" y2="4.54151875" layer="21"/>
<rectangle x1="1.39191875" y1="4.54151875" x2="2.021840625" y2="4.561840625" layer="21"/>
<rectangle x1="2.67208125" y1="4.54151875" x2="3.4036" y2="4.561840625" layer="21"/>
<rectangle x1="4.03351875" y1="4.54151875" x2="4.70408125" y2="4.561840625" layer="21"/>
<rectangle x1="1.412240625" y1="4.561840625" x2="2.00151875" y2="4.582159375" layer="21"/>
<rectangle x1="2.67208125" y1="4.561840625" x2="3.4036" y2="4.582159375" layer="21"/>
<rectangle x1="4.074159375" y1="4.561840625" x2="4.683759375" y2="4.582159375" layer="21"/>
<rectangle x1="1.432559375" y1="4.582159375" x2="1.96088125" y2="4.60248125" layer="21"/>
<rectangle x1="2.6924" y1="4.582159375" x2="3.4036" y2="4.60248125" layer="21"/>
<rectangle x1="4.1148" y1="4.582159375" x2="4.663440625" y2="4.60248125" layer="21"/>
<rectangle x1="1.45288125" y1="4.60248125" x2="1.940559375" y2="4.6228" layer="21"/>
<rectangle x1="2.6924" y1="4.60248125" x2="3.38328125" y2="4.6228" layer="21"/>
<rectangle x1="4.13511875" y1="4.60248125" x2="4.64311875" y2="4.6228" layer="21"/>
<rectangle x1="1.4732" y1="4.6228" x2="1.89991875" y2="4.64311875" layer="21"/>
<rectangle x1="2.6924" y1="4.6228" x2="3.38328125" y2="4.64311875" layer="21"/>
<rectangle x1="4.175759375" y1="4.6228" x2="4.6228" y2="4.64311875" layer="21"/>
<rectangle x1="1.49351875" y1="4.64311875" x2="1.8796" y2="4.663440625" layer="21"/>
<rectangle x1="2.6924" y1="4.64311875" x2="3.38328125" y2="4.663440625" layer="21"/>
<rectangle x1="4.19608125" y1="4.64311875" x2="4.60248125" y2="4.663440625" layer="21"/>
<rectangle x1="1.513840625" y1="4.663440625" x2="1.838959375" y2="4.683759375" layer="21"/>
<rectangle x1="2.6924" y1="4.663440625" x2="3.38328125" y2="4.683759375" layer="21"/>
<rectangle x1="4.23671875" y1="4.663440625" x2="4.582159375" y2="4.683759375" layer="21"/>
<rectangle x1="1.534159375" y1="4.683759375" x2="1.79831875" y2="4.70408125" layer="21"/>
<rectangle x1="2.71271875" y1="4.683759375" x2="3.362959375" y2="4.70408125" layer="21"/>
<rectangle x1="4.257040625" y1="4.683759375" x2="4.561840625" y2="4.70408125" layer="21"/>
<rectangle x1="1.55448125" y1="4.70408125" x2="1.778" y2="4.7244" layer="21"/>
<rectangle x1="2.71271875" y1="4.70408125" x2="3.362959375" y2="4.7244" layer="21"/>
<rectangle x1="4.29768125" y1="4.70408125" x2="4.54151875" y2="4.7244" layer="21"/>
<rectangle x1="1.5748" y1="4.7244" x2="1.737359375" y2="4.74471875" layer="21"/>
<rectangle x1="2.71271875" y1="4.7244" x2="3.362959375" y2="4.74471875" layer="21"/>
<rectangle x1="4.318" y1="4.7244" x2="4.5212" y2="4.74471875" layer="21"/>
<rectangle x1="1.59511875" y1="4.74471875" x2="1.717040625" y2="4.765040625" layer="21"/>
<rectangle x1="2.71271875" y1="4.74471875" x2="3.362959375" y2="4.765040625" layer="21"/>
<rectangle x1="4.358640625" y1="4.74471875" x2="4.50088125" y2="4.765040625" layer="21"/>
<rectangle x1="1.615440625" y1="4.765040625" x2="1.6764" y2="4.785359375" layer="21"/>
<rectangle x1="2.733040625" y1="4.765040625" x2="3.342640625" y2="4.785359375" layer="21"/>
<rectangle x1="4.378959375" y1="4.765040625" x2="4.480559375" y2="4.785359375" layer="21"/>
<rectangle x1="1.635759375" y1="4.785359375" x2="1.65608125" y2="4.80568125" layer="21"/>
<rectangle x1="2.733040625" y1="4.785359375" x2="3.342640625" y2="4.80568125" layer="21"/>
<rectangle x1="4.4196" y1="4.785359375" x2="4.460240625" y2="4.80568125" layer="21"/>
<rectangle x1="2.733040625" y1="4.80568125" x2="3.342640625" y2="4.826" layer="21"/>
<rectangle x1="2.733040625" y1="4.826" x2="3.342640625" y2="4.84631875" layer="21"/>
<rectangle x1="2.753359375" y1="4.84631875" x2="3.32231875" y2="4.866640625" layer="21"/>
<rectangle x1="2.753359375" y1="4.866640625" x2="3.32231875" y2="4.886959375" layer="21"/>
<rectangle x1="2.753359375" y1="4.886959375" x2="3.32231875" y2="4.90728125" layer="21"/>
<rectangle x1="2.753359375" y1="4.90728125" x2="3.32231875" y2="4.9276" layer="21"/>
<rectangle x1="2.77368125" y1="4.9276" x2="3.302" y2="4.94791875" layer="21"/>
<rectangle x1="2.77368125" y1="4.94791875" x2="3.302" y2="4.968240625" layer="21"/>
<rectangle x1="2.77368125" y1="4.968240625" x2="3.302" y2="4.988559375" layer="21"/>
<rectangle x1="2.77368125" y1="4.988559375" x2="3.302" y2="5.00888125" layer="21"/>
<rectangle x1="2.794" y1="5.00888125" x2="3.28168125" y2="5.0292" layer="21"/>
<rectangle x1="2.794" y1="5.0292" x2="3.28168125" y2="5.04951875" layer="21"/>
<rectangle x1="2.794" y1="5.04951875" x2="3.28168125" y2="5.069840625" layer="21"/>
<rectangle x1="2.794" y1="5.069840625" x2="3.28168125" y2="5.090159375" layer="21"/>
<rectangle x1="2.794" y1="5.090159375" x2="3.28168125" y2="5.11048125" layer="21"/>
<rectangle x1="2.81431875" y1="5.11048125" x2="3.261359375" y2="5.1308" layer="21"/>
<rectangle x1="2.81431875" y1="5.1308" x2="3.261359375" y2="5.15111875" layer="21"/>
<rectangle x1="2.81431875" y1="5.15111875" x2="3.261359375" y2="5.171440625" layer="21"/>
<rectangle x1="2.81431875" y1="5.171440625" x2="3.261359375" y2="5.191759375" layer="21"/>
<rectangle x1="2.834640625" y1="5.191759375" x2="3.241040625" y2="5.21208125" layer="21"/>
<rectangle x1="2.834640625" y1="5.21208125" x2="3.241040625" y2="5.2324" layer="21"/>
<rectangle x1="2.834640625" y1="5.2324" x2="3.241040625" y2="5.25271875" layer="21"/>
<rectangle x1="2.834640625" y1="5.25271875" x2="3.241040625" y2="5.273040625" layer="21"/>
<rectangle x1="2.854959375" y1="5.273040625" x2="3.22071875" y2="5.293359375" layer="21"/>
<rectangle x1="2.854959375" y1="5.293359375" x2="3.22071875" y2="5.31368125" layer="21"/>
<rectangle x1="2.854959375" y1="5.31368125" x2="3.22071875" y2="5.334" layer="21"/>
<rectangle x1="2.854959375" y1="5.334" x2="3.22071875" y2="5.35431875" layer="21"/>
<rectangle x1="2.87528125" y1="5.35431875" x2="3.2004" y2="5.374640625" layer="21"/>
<rectangle x1="2.87528125" y1="5.374640625" x2="3.2004" y2="5.394959375" layer="21"/>
<rectangle x1="2.87528125" y1="5.394959375" x2="3.2004" y2="5.41528125" layer="21"/>
<rectangle x1="2.87528125" y1="5.41528125" x2="3.2004" y2="5.4356" layer="21"/>
<rectangle x1="2.8956" y1="5.4356" x2="3.18008125" y2="5.45591875" layer="21"/>
<rectangle x1="2.8956" y1="5.45591875" x2="3.18008125" y2="5.476240625" layer="21"/>
<rectangle x1="2.8956" y1="5.476240625" x2="3.18008125" y2="5.496559375" layer="21"/>
<rectangle x1="2.8956" y1="5.496559375" x2="3.18008125" y2="5.51688125" layer="21"/>
<rectangle x1="2.91591875" y1="5.51688125" x2="3.159759375" y2="5.5372" layer="21"/>
<rectangle x1="2.91591875" y1="5.5372" x2="3.159759375" y2="5.55751875" layer="21"/>
<rectangle x1="2.91591875" y1="5.55751875" x2="3.159759375" y2="5.577840625" layer="21"/>
<rectangle x1="2.91591875" y1="5.577840625" x2="3.159759375" y2="5.598159375" layer="21"/>
<rectangle x1="2.936240625" y1="5.598159375" x2="3.159759375" y2="5.61848125" layer="21"/>
<rectangle x1="2.936240625" y1="5.61848125" x2="3.139440625" y2="5.6388" layer="21"/>
<rectangle x1="2.936240625" y1="5.6388" x2="3.139440625" y2="5.65911875" layer="21"/>
<rectangle x1="2.936240625" y1="5.65911875" x2="3.139440625" y2="5.679440625" layer="21"/>
<rectangle x1="2.936240625" y1="5.679440625" x2="3.139440625" y2="5.699759375" layer="21"/>
<rectangle x1="2.956559375" y1="5.699759375" x2="3.11911875" y2="5.72008125" layer="21"/>
<rectangle x1="2.956559375" y1="5.72008125" x2="3.11911875" y2="5.7404" layer="21"/>
<rectangle x1="2.956559375" y1="5.7404" x2="3.11911875" y2="5.76071875" layer="21"/>
<rectangle x1="2.956559375" y1="5.76071875" x2="3.11911875" y2="5.781040625" layer="21"/>
<rectangle x1="2.97688125" y1="5.781040625" x2="3.0988" y2="5.801359375" layer="21"/>
<rectangle x1="2.97688125" y1="5.801359375" x2="3.0988" y2="5.82168125" layer="21"/>
<rectangle x1="2.97688125" y1="5.82168125" x2="3.0988" y2="5.842" layer="21"/>
<rectangle x1="2.97688125" y1="5.842" x2="3.0988" y2="5.86231875" layer="21"/>
<rectangle x1="2.9972" y1="5.86231875" x2="3.07848125" y2="5.882640625" layer="21"/>
<rectangle x1="2.9972" y1="5.882640625" x2="3.07848125" y2="5.902959375" layer="21"/>
<rectangle x1="2.9972" y1="5.902959375" x2="3.07848125" y2="5.92328125" layer="21"/>
<rectangle x1="2.9972" y1="5.92328125" x2="3.07848125" y2="5.9436" layer="21"/>
<rectangle x1="3.01751875" y1="5.9436" x2="3.058159375" y2="5.96391875" layer="21"/>
<rectangle x1="3.01751875" y1="5.96391875" x2="3.058159375" y2="5.984240625" layer="21"/>
<rectangle x1="3.01751875" y1="5.984240625" x2="3.058159375" y2="6.004559375" layer="21"/>
<rectangle x1="3.01751875" y1="6.004559375" x2="3.058159375" y2="6.02488125" layer="21"/>
<rectangle x1="3.037840625" y1="6.02488125" x2="3.058159375" y2="6.0452" layer="21"/>
</package>
</packages>
</library>
<library name="Seeed-OPL-Diode">
<packages>
<package name="DO-214AC">
<description>http://www.sycelectronica.com.ar/semiconductores/1N4007-SMD.pdf</description>
<smd name="1" x="-2.042" y="0" dx="1.77" dy="1.8" layer="1" rot="R90"/>
<smd name="2" x="2.042" y="0" dx="1.77" dy="1.8" layer="1" rot="R90"/>
<polygon width="0.127" layer="21">
<vertex x="-0.381" y="0.762"/>
<vertex x="0.508" y="0"/>
<vertex x="-0.381" y="-0.762"/>
</polygon>
<wire x1="-2.145" y1="1.35" x2="2.145" y2="1.35" width="0.127" layer="21"/>
<wire x1="2.145" y1="1.35" x2="2.145" y2="-1.35" width="0.127" layer="51"/>
<wire x1="2.145" y1="-1.35" x2="-2.145" y2="-1.35" width="0.127" layer="21"/>
<wire x1="-2.145" y1="-1.35" x2="-2.145" y2="1.35" width="0.127" layer="51"/>
<text x="-1.905" y="1.651" size="0.889" layer="25" ratio="11">>NAME</text>
<text x="-1.905" y="-2.54" size="0.889" layer="27" ratio="11">>VALUE</text>
<rectangle x1="-2.159" y1="-1.27" x2="2.159" y2="1.27" layer="39"/>
<wire x1="2.15" y1="1.3" x2="2.15" y2="1" width="0.127" layer="21"/>
<wire x1="2.15" y1="-1.3" x2="2.15" y2="-1" width="0.127" layer="21"/>
<wire x1="-2.15" y1="-1.3" x2="-2.15" y2="-1" width="0.127" layer="21"/>
<wire x1="-2.15" y1="1.3" x2="-2.15" y2="1" width="0.127" layer="21"/>
</package>
<package name="DO-214AB">
<description>SMC

http://www.vishay.com/docs/88751/88751.pdf</description>
<smd name="2" x="3.683" y="0" dx="2.286" dy="4.064" layer="1" rot="R180"/>
<smd name="1" x="-3.683" y="0" dx="2.286" dy="4.064" layer="1" rot="R180"/>
<wire x1="3.429" y1="-2.921" x2="-3.429" y2="-2.921" width="0.127" layer="21"/>
<wire x1="-3.429" y1="-2.921" x2="-3.429" y2="2.921" width="0.127" layer="51"/>
<wire x1="-3.429" y1="2.921" x2="3.429" y2="2.921" width="0.127" layer="21"/>
<wire x1="3.429" y1="2.921" x2="3.429" y2="-2.921" width="0.127" layer="51"/>
<polygon width="0.127" layer="21">
<vertex x="-0.889" y="1.905"/>
<vertex x="1.016" y="0"/>
<vertex x="-0.889" y="-1.905"/>
</polygon>
<rectangle x1="-3.429" y1="-2.921" x2="3.429" y2="2.921" layer="39" rot="R180"/>
<text x="-3.175" y="3.175" size="0.889" layer="25" ratio="11">>NAME</text>
<text x="-3.175" y="-4.064" size="0.889" layer="27" ratio="11">>VALUE</text>
<wire x1="3.43" y1="2.9" x2="3.43" y2="2.1" width="0.127" layer="21"/>
<wire x1="3.43" y1="-2.9" x2="3.43" y2="-2.1" width="0.127" layer="21"/>
<wire x1="-3.43" y1="-2.9" x2="-3.43" y2="-2.1" width="0.127" layer="21"/>
<wire x1="-3.43" y1="2.9" x2="-3.43" y2="2.1" width="0.127" layer="21"/>
</package>
</packages>
</library>
<library name="z_jlc_smt">
<packages>
<package name="LED-0603-SEEED">
<wire x1="1.3335" y1="-0.635" x2="-1.3335" y2="-0.635" width="0.127" layer="21"/>
<wire x1="-1.3335" y1="-0.635" x2="-1.3335" y2="0.635" width="0.127" layer="21"/>
<wire x1="-1.3335" y1="0.635" x2="1.3335" y2="0.635" width="0.127" layer="21"/>
<wire x1="1.3335" y1="0.635" x2="1.3335" y2="-0.635" width="0.127" layer="21"/>
<wire x1="0.127" y1="-0.381" x2="0.127" y2="0.381" width="0.127" layer="21"/>
<wire x1="0.127" y1="0.381" x2="0" y2="0.1905" width="0.127" layer="21"/>
<wire x1="0" y1="0.1905" x2="-0.127" y2="0" width="0.127" layer="21"/>
<wire x1="-0.127" y1="0" x2="0" y2="-0.1905" width="0.127" layer="21"/>
<wire x1="0" y1="-0.1905" x2="0.127" y2="-0.381" width="0.127" layer="21"/>
<wire x1="0.0635" y1="-0.254" x2="0.0635" y2="0.254" width="0.127" layer="21"/>
<wire x1="0" y1="-0.1905" x2="0" y2="0.1905" width="0.127" layer="21"/>
<smd name="+" x="0.762" y="0" dx="0.762" dy="0.889" layer="1" roundness="25" rot="R180"/>
<smd name="-" x="-0.762" y="0" dx="0.762" dy="0.889" layer="1" roundness="25" rot="R180"/>
<text x="-1.905" y="0.889" size="0.889" layer="25" ratio="11">>NAME</text>
<text x="-1.778" y="-1.5875" size="0.635" layer="27" ratio="10">>VALUE</text>
<rectangle x1="-1.27" y1="-0.5715" x2="1.27" y2="0.5715" layer="39" rot="R180"/>
</package>
<package name="R0402">
<wire x1="-0.762" y1="-0.4445" x2="-0.889" y2="-0.3175" width="0.0762" layer="21" curve="-90"/>
<wire x1="-0.889" y1="-0.3175" x2="-0.889" y2="0.3175" width="0.0762" layer="21"/>
<wire x1="-0.889" y1="0.3175" x2="-0.762" y2="0.4445" width="0.0762" layer="21" curve="-90"/>
<wire x1="-0.762" y1="0.4445" x2="0.762" y2="0.4445" width="0.0762" layer="21"/>
<wire x1="0.762" y1="0.4445" x2="0.889" y2="0.3175" width="0.0762" layer="21" curve="-90"/>
<wire x1="0.889" y1="0.3175" x2="0.889" y2="-0.3175" width="0.0762" layer="21"/>
<wire x1="0.889" y1="-0.3175" x2="0.762" y2="-0.4445" width="0.0762" layer="21" curve="-90"/>
<wire x1="0.762" y1="-0.4445" x2="-0.762" y2="-0.4445" width="0.0762" layer="21"/>
<smd name="1" x="-0.4445" y="0" dx="0.635" dy="0.635" layer="1" roundness="50"/>
<smd name="2" x="0.4445" y="0" dx="0.635" dy="0.635" layer="1" roundness="50"/>
<text x="-1.27" y="0.635" size="0.889" layer="25" ratio="11">>NAME</text>
<text x="-1.27" y="-1.524" size="0.889" layer="27" font="vector" ratio="11">>VALUE</text>
</package>
<package name="C0402">
<description>0402
</description>
<wire x1="-0.762" y1="-0.4445" x2="-0.889" y2="-0.3175" width="0.0762" layer="21" curve="-90"/>
<wire x1="-0.889" y1="-0.3175" x2="-0.889" y2="0.3175" width="0.0762" layer="21"/>
<wire x1="-0.889" y1="0.3175" x2="-0.762" y2="0.4445" width="0.0762" layer="21" curve="-90"/>
<wire x1="-0.762" y1="0.4445" x2="0.762" y2="0.4445" width="0.0762" layer="21"/>
<wire x1="0.762" y1="0.4445" x2="0.889" y2="0.3175" width="0.0762" layer="21" curve="-90"/>
<wire x1="0.889" y1="0.3175" x2="0.889" y2="-0.3175" width="0.0762" layer="21"/>
<wire x1="0.889" y1="-0.3175" x2="0.762" y2="-0.4445" width="0.0762" layer="21" curve="-90"/>
<wire x1="0.762" y1="-0.4445" x2="-0.762" y2="-0.4445" width="0.0762" layer="21"/>
<smd name="1" x="-0.4445" y="0" dx="0.635" dy="0.635" layer="1" roundness="50"/>
<smd name="2" x="0.4445" y="0" dx="0.635" dy="0.635" layer="1" roundness="50"/>
<text x="-1.27" y="0.635" size="0.889" layer="25" ratio="11">>NAME</text>
<text x="-1.397" y="-1.524" size="0.635" layer="27" font="vector" ratio="10">>VALUE</text>
<polygon width="0.0254" layer="51">
<vertex x="-0.508" y="0.254"/>
<vertex x="0.508" y="0.254"/>
<vertex x="0.508" y="-0.254"/>
<vertex x="-0.508" y="-0.254"/>
</polygon>
</package>
</packages>
</library>
<library name="SparkFun-Connectors">
<description>
SparkFun Electronics' preferred foot prints

In this library you'll find connectors and sockets- basically anything that can be plugged into or onto.

We've spent an enormous amount of time creating and checking these footprints and parts, but it is the end user's responsibility to ensure correctness and suitablity for a given componet or application. If you enjoy using this library, please buy one of our products at www.sparkfun.com.

Licensing: Creative Commons ShareAlike 4.0 International - https://creativecommons.org/licenses/by-sa/4.0/

You are welcome to use this library for commercial purposes. For attribution, we ask that when you begin to sell your device using our footprint, you email us with a link to the product being sold. We want bragging rights that we helped (in a very small part) to create your 8th world wonder. We would like the opportunity to feature your device on our homepage.</description>
<packages>
<package name="1X02_NO_SILK">
<pad name="1" x="0" y="0" drill="1.016" diameter="1.8796" rot="R90"/>
<pad name="2" x="2.54" y="0" drill="1.016" diameter="1.8796" rot="R90"/>
<text x="-1.3462" y="1.8288" size="1.27" layer="25" ratio="10">>NAME</text>
<text x="-1.27" y="-3.175" size="1.27" layer="27">>VALUE</text>
<rectangle x1="2.286" y1="-0.254" x2="2.794" y2="0.254" layer="51"/>
<rectangle x1="-0.254" y1="-0.254" x2="0.254" y2="0.254" layer="51"/>
</package>
</packages>
</library>
</libraries>
<attributes>
</attributes>
<variantdefs>
</variantdefs>
<classes>
<class number="0" name="default" width="0" drill="0">
</class>
</classes>
<designrules name="SparkFun-2-layer-TIGHT">
<description language="en">SparkFun 2 Layer Design Rule Checks - STANDARD/TIGHT/FAB-LIMIT

These rules have been curated by SparkFuns DFM commitee. After doing much research, communicating with our multiple fab houses, and getting quotes of various designs, we have compiled three DRU files.

STANDARD: This is more of a "best case scenario" set of limitations. If your design has the space, and/or you have the time to work within these parameters, please do. Larger trace width and clearance makes for easier visual inspection of the PCB while troubleshooting (useful in production and to the end user). It also allows for better ability to hack a trace (if you are crazy enough to scrape away the mask and solder to a trace). Another thing to keep in mind is that more metal is just more robust.

TIGHT: This is where cost comes into play. We have found that most fab houses begin to add extra charges when you go smaller than these specs. In some cases, going to less than 15 mil trace can increase the cost by 10%. (This is why we have set the min drill on this DRU to 15 mil) Same story for traces thinner than 7 mil. To avoid those extra charges, then stay within the rules of this DRU.

FAB-LIMIT: These set of rules are at the very limit of most fab houses capabilities. You will pay more for these specs, and it should be used on designs that have a darned good reason to need 4 mil vias and 4 mil traces.

**NOTE Clearance, Distance, Sizes, and Restring are all set to different limits in each of these three DRU files. Please compare the files within the CAM job editor window of eagle to see all the numbers.

***NOTE, Please set your Net Classes to default (0mil for all settings), so that it won't effect the DRC when you run it with these settings.</description>
<param name="layerSetup" value="(1*16)"/>
<param name="mtCopper" value="0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm 0.035mm"/>
<param name="mtIsolate" value="1.5mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm 0.15mm 0.2mm"/>
<param name="mdWireWire" value="7mil"/>
<param name="mdWirePad" value="7mil"/>
<param name="mdWireVia" value="7mil"/>
<param name="mdPadPad" value="7mil"/>
<param name="mdPadVia" value="7mil"/>
<param name="mdViaVia" value="7mil"/>
<param name="mdSmdPad" value="7mil"/>
<param name="mdSmdVia" value="7mil"/>
<param name="mdSmdSmd" value="7mil"/>
<param name="mdViaViaSameLayer" value="8mil"/>
<param name="mnLayersViaInSmd" value="2"/>
<param name="mdCopperDimension" value="7mil"/>
<param name="mdDrill" value="7mil"/>
<param name="mdSmdStop" value="0mil"/>
<param name="msWidth" value="7mil"/>
<param name="msDrill" value="15mil"/>
<param name="msMicroVia" value="9.99mm"/>
<param name="msBlindViaRatio" value="0.5"/>
<param name="rvPadTop" value="0.25"/>
<param name="rvPadInner" value="0.25"/>
<param name="rvPadBottom" value="0.25"/>
<param name="rvViaOuter" value="0.25"/>
<param name="rvViaInner" value="0.25"/>
<param name="rvMicroViaOuter" value="0.25"/>
<param name="rvMicroViaInner" value="0.25"/>
<param name="rlMinPadTop" value="7mil"/>
<param name="rlMaxPadTop" value="20mil"/>
<param name="rlMinPadInner" value="7mil"/>
<param name="rlMaxPadInner" value="20mil"/>
<param name="rlMinPadBottom" value="7mil"/>
<param name="rlMaxPadBottom" value="20mil"/>
<param name="rlMinViaOuter" value="7mil"/>
<param name="rlMaxViaOuter" value="20mil"/>
<param name="rlMinViaInner" value="7mil"/>
<param name="rlMaxViaInner" value="20mil"/>
<param name="rlMinMicroViaOuter" value="4mil"/>
<param name="rlMaxMicroViaOuter" value="20mil"/>
<param name="rlMinMicroViaInner" value="4mil"/>
<param name="rlMaxMicroViaInner" value="20mil"/>
<param name="psTop" value="-1"/>
<param name="psBottom" value="-1"/>
<param name="psFirst" value="-1"/>
<param name="psElongationLong" value="100"/>
<param name="psElongationOffset" value="100"/>
<param name="mvStopFrame" value="1"/>
<param name="mvCreamFrame" value="0"/>
<param name="mlMinStopFrame" value="4mil"/>
<param name="mlMaxStopFrame" value="4mil"/>
<param name="mlMinCreamFrame" value="0mil"/>
<param name="mlMaxCreamFrame" value="0mil"/>
<param name="mlViaStopLimit" value="20mil"/>
<param name="srRoundness" value="0"/>
<param name="srMinRoundness" value="0mil"/>
<param name="srMaxRoundness" value="0mil"/>
<param name="slThermalIsolate" value="10mil"/>
<param name="slThermalsForVias" value="0"/>
<param name="dpMaxLengthDifference" value="10mm"/>
<param name="dpGapFactor" value="2.5"/>
<param name="checkGrid" value="0"/>
<param name="checkAngle" value="1"/>
<param name="checkFont" value="1"/>
<param name="checkRestrict" value="1"/>
<param name="useDiameter" value="13"/>
<param name="maxErrors" value="50"/>
</designrules>
<autorouter>
<pass name="Default">
<param name="RoutingGrid" value="50mil"/>
<param name="AutoGrid" value="1"/>
<param name="Efforts" value="0"/>
<param name="TopRouterVariant" value="1"/>
<param name="tpViaShape" value="round"/>
<param name="PrefDir.1" value="a"/>
<param name="PrefDir.2" value="0"/>
<param name="PrefDir.3" value="0"/>
<param name="PrefDir.4" value="0"/>
<param name="PrefDir.5" value="0"/>
<param name="PrefDir.6" value="0"/>
<param name="PrefDir.7" value="0"/>
<param name="PrefDir.8" value="0"/>
<param name="PrefDir.9" value="0"/>
<param name="PrefDir.10" value="0"/>
<param name="PrefDir.11" value="0"/>
<param name="PrefDir.12" value="0"/>
<param name="PrefDir.13" value="0"/>
<param name="PrefDir.14" value="0"/>
<param name="PrefDir.15" value="0"/>
<param name="PrefDir.16" value="a"/>
<param name="cfVia" value="8"/>
<param name="cfNonPref" value="5"/>
<param name="cfChangeDir" value="2"/>
<param name="cfOrthStep" value="2"/>
<param name="cfDiagStep" value="3"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="1"/>
<param name="cfMalusStep" value="1"/>
<param name="cfPadImpact" value="4"/>
<param name="cfSmdImpact" value="4"/>
<param name="cfBusImpact" value="0"/>
<param name="cfHugging" value="3"/>
<param name="cfAvoid" value="4"/>
<param name="cfPolygon" value="10"/>
<param name="cfBase.1" value="0"/>
<param name="cfBase.2" value="1"/>
<param name="cfBase.3" value="1"/>
<param name="cfBase.4" value="1"/>
<param name="cfBase.5" value="1"/>
<param name="cfBase.6" value="1"/>
<param name="cfBase.7" value="1"/>
<param name="cfBase.8" value="1"/>
<param name="cfBase.9" value="1"/>
<param name="cfBase.10" value="1"/>
<param name="cfBase.11" value="1"/>
<param name="cfBase.12" value="1"/>
<param name="cfBase.13" value="1"/>
<param name="cfBase.14" value="1"/>
<param name="cfBase.15" value="1"/>
<param name="cfBase.16" value="0"/>
<param name="mnVias" value="20"/>
<param name="mnSegments" value="9999"/>
<param name="mnExtdSteps" value="9999"/>
<param name="mnRipupLevel" value="10"/>
<param name="mnRipupSteps" value="100"/>
<param name="mnRipupTotal" value="100"/>
</pass>
<pass name="Follow-me" refer="Default" active="yes">
</pass>
<pass name="Busses" refer="Default" active="yes">
<param name="cfNonPref" value="4"/>
<param name="cfBusImpact" value="4"/>
<param name="cfHugging" value="0"/>
<param name="mnVias" value="0"/>
</pass>
<pass name="Route" refer="Default" active="yes">
</pass>
<pass name="Optimize1" refer="Default" active="yes">
<param name="cfVia" value="99"/>
<param name="cfExtdStep" value="10"/>
<param name="cfHugging" value="1"/>
<param name="mnExtdSteps" value="1"/>
<param name="mnRipupLevel" value="0"/>
</pass>
<pass name="Optimize2" refer="Optimize1" active="yes">
<param name="cfNonPref" value="0"/>
<param name="cfChangeDir" value="6"/>
<param name="cfExtdStep" value="0"/>
<param name="cfBonusStep" value="2"/>
<param name="cfMalusStep" value="2"/>
<param name="cfPadImpact" value="2"/>
<param name="cfSmdImpact" value="2"/>
<param name="cfHugging" value="0"/>
</pass>
<pass name="Optimize3" refer="Optimize2" active="yes">
<param name="cfChangeDir" value="8"/>
<param name="cfPadImpact" value="0"/>
<param name="cfSmdImpact" value="0"/>
</pass>
<pass name="Optimize4" refer="Optimize3" active="yes">
<param name="cfChangeDir" value="25"/>
</pass>
</autorouter>
<elements>
<element name="C1" library="xmgu2008" package="1206" value="106" x="10.795" y="24.892" smashed="yes" rot="R180">
<attribute name="NAME" x="12.065" y="23.749" size="0.4064" layer="25" rot="R180"/>
<attribute name="VALUE" x="11.811" y="27.051" size="0.4064" layer="27" rot="R180"/>
</element>
<element name="C7" library="xmgu2008" package="1206" value="106" x="5.842" y="12.319" smashed="yes" rot="R180">
<attribute name="NAME" x="7.112" y="11.176" size="0.4064" layer="25" rot="R180"/>
<attribute name="VALUE" x="5.969" y="10.922" size="0.4064" layer="27" rot="R180"/>
</element>
<element name="D1" library="z_jlc_smt" package="LED-0603-SEEED" value="red" x="23.876" y="33.274" smashed="yes" rot="R180">
<attribute name="NAME" x="25.781" y="32.385" size="0.889" layer="25" ratio="11" rot="R180"/>
<attribute name="VALUE" x="24.765" y="34.8615" size="0.635" layer="27" ratio="10" rot="R180"/>
</element>
<element name="JP1" library="xmgu2008" package="SCREWTERMINAL-5MM-2" value="INPUT" x="12.446" y="33.528" rot="R180">
<attribute name="STOREFRONT_ID" value="PRT-08432" x="12.446" y="33.528" size="1.778" layer="27" rot="R180" display="off"/>
</element>
<element name="JP2" library="xmgu2008" package="SCREWTERMINAL-5MM-2" value="BAT" x="3.81" y="3.683">
<attribute name="STOREFRONT_ID" value="PRT-08432" x="3.81" y="3.683" size="1.778" layer="27" display="off"/>
</element>
<element name="L1" library="xmgu2008" package="L_SMDRI-127" value="15UH" x="30.353" y="15.494" smashed="yes" rot="R270">
<attribute name="NAME" x="34.503" y="19.344" size="1.27" layer="25" rot="R270"/>
<attribute name="VALUE" x="28.027" y="16.883" size="1.27" layer="27"/>
</element>
<element name="R6" library="xmgu2008" package="R2512" value="0.1R" x="12.954" y="12.319" smashed="yes" rot="R180">
<attribute name="NAME" x="15.494" y="10.414" size="1.27" layer="25" rot="R180"/>
<attribute name="VALUE" x="15.367" y="10.287" size="1.27" layer="27" rot="R180"/>
</element>
<element name="C2" library="xmgu2008" package="0603-CAP" value="104" x="11.049" y="22.225" smashed="yes" rot="R180">
<attribute name="NAME" x="11.938" y="21.5265" size="0.4064" layer="25" rot="R180"/>
<attribute name="VALUE" x="8.5725" y="21.844" size="0.4064" layer="27"/>
</element>
<element name="C3" library="z_jlc_smt" package="C0402" value="104" x="19.177" y="17.272" smashed="yes">
<attribute name="NAME" x="18.288" y="17.9705" size="0.4064" layer="25"/>
<attribute name="VALUE" x="20.2565" y="18.161" size="0.4064" layer="27"/>
</element>
<element name="C4" library="z_jlc_smt" package="C0402" value="470p" x="3.937" y="16.891" smashed="yes" rot="R90">
<attribute name="NAME" x="3.2385" y="16.002" size="0.4064" layer="25" rot="R90"/>
<attribute name="VALUE" x="2.9845" y="17.145" size="0.4064" layer="27" rot="R180"/>
</element>
<element name="C5" library="z_jlc_smt" package="C0402" value="224" x="21.844" y="16.383" smashed="yes" rot="R90">
<attribute name="NAME" x="21.1455" y="15.494" size="0.4064" layer="25" rot="R90"/>
<attribute name="VALUE" x="23.9395" y="16.51" size="0.4064" layer="27" rot="R180"/>
</element>
<element name="R5" library="z_jlc_smt" package="R0402" value="120R" x="19.177" y="15.494" smashed="yes">
<attribute name="NAME" x="18.288" y="16.1925" size="0.4064" layer="25"/>
<attribute name="VALUE" x="20.1295" y="14.732" size="0.4064" layer="27" rot="R180"/>
</element>
<element name="R3" library="z_jlc_smt" package="R0402" value="10K" x="6.731" y="17.526" smashed="yes">
<attribute name="NAME" x="5.842" y="18.2245" size="0.4064" layer="25"/>
<attribute name="VALUE" x="7.8105" y="18.161" size="0.4064" layer="27"/>
</element>
<element name="D2" library="z_jlc_smt" package="LED-0603-SEEED" value="green" x="23.876" y="35.433" smashed="yes" rot="R180">
<attribute name="NAME" x="25.781" y="34.544" size="0.889" layer="25" ratio="11" rot="R180"/>
<attribute name="VALUE" x="22.606" y="36.1315" size="0.635" layer="27" ratio="10"/>
</element>
<element name="R1" library="z_jlc_smt" package="R0402" value="75K" x="19.812" y="33.274" rot="R180"/>
<element name="R2" library="z_jlc_smt" package="R0402" value="75K" x="19.812" y="35.433" rot="R180"/>
<element name="U1" library="xmgu2008" package="TSSOP16" value="CN3704" x="13.081" y="18.034" rot="R270"/>
<element name="R7" library="z_jlc_smt" package="R0402" value="0R" x="7.239" y="19.431" smashed="yes" rot="R90">
<attribute name="NAME" x="6.5405" y="18.542" size="0.4064" layer="25" rot="R90"/>
<attribute name="VALUE" x="6.2865" y="19.812" size="0.4064" layer="27" rot="R180"/>
</element>
<element name="D4" library="Seeed-OPL-Diode" package="DO-214AC" value="SS54" x="33.274" y="30.48" smashed="yes" rot="R270">
<attribute name="MPN" value="1N5819" x="33.274" y="30.48" size="1.778" layer="27" font="vector" ratio="15" rot="R270" display="off"/>
<attribute name="NAME" x="34.925" y="32.385" size="0.889" layer="25" ratio="11" rot="R270"/>
<attribute name="VALUE" x="35.179" y="33.274" size="0.889" layer="27" ratio="11" rot="R270"/>
</element>
<element name="JP3" library="xmgu2008" package="SCREWTERMINAL-5MM-2" value="SYS" x="19.812" y="3.683">
<attribute name="STOREFRONT_ID" value="PRT-08432" x="19.812" y="3.683" size="1.778" layer="27" font="vector" ratio="15" display="off"/>
</element>
<element name="Q1" library="xmgu2008" package="SO08" value="AO4407" x="17.145" y="24.765" rot="R270">
<attribute name="PROD_ID" value="TRANS-08355" x="17.145" y="24.765" size="1.778" layer="27" font="vector" ratio="15" rot="R270" display="off"/>
</element>
<element name="R4" library="z_jlc_smt" package="R0402" value="20K" x="6.731" y="16.129" smashed="yes">
<attribute name="NAME" x="5.842" y="16.8275" size="0.4064" layer="25"/>
<attribute name="VALUE" x="6.2865" y="14.478" size="0.4064" layer="27"/>
</element>
<element name="D3" library="Seeed-OPL-Diode" package="DO-214AB" value="SS54" x="25.908" y="27.051">
<attribute name="MPN" value="SS34-E3/57T" x="25.908" y="27.051" size="1.778" layer="27" font="vector" ratio="15" display="off"/>
</element>
<element name="C6" library="xmgu2008" package="1206" value="106" x="30.607" y="5.207" rot="R270"/>
<element name="U$1" library="xmgu2008" package="DIYNOVA_LOGO" value="" x="26.416" y="30.734"/>
<element name="J1" library="SparkFun-Connectors" package="1X02_NO_SILK" value="ntc" x="5.08" y="21.209" rot="R90"/>
</elements>
<signals>
<signal name="GND">
<polygon width="0.254" layer="1" isolate="0.3048" thermals="no" rank="3">
<vertex x="0" y="38.1"/>
<vertex x="36.83" y="38.1"/>
<vertex x="36.83" y="0"/>
<vertex x="0" y="0"/>
</polygon>
<polygon width="0.254" layer="16" isolate="0.3048" thermals="no">
<vertex x="0" y="38.1"/>
<vertex x="36.83" y="38.1"/>
<vertex x="36.83" y="0"/>
<vertex x="0" y="0"/>
</polygon>
<contactref element="C1" pad="2"/>
<contactref element="JP1" pad="2"/>
<contactref element="C7" pad="2"/>
<contactref element="U1" pad="2"/>
<contactref element="R7" pad="2"/>
<via x="12.192" y="20.193" extent="1-16" drill="0.635"/>
<via x="7.874" y="21.844" extent="1-16" drill="0.381"/>
<via x="9.144" y="27.559" extent="1-16" drill="0.381"/>
<via x="7.239" y="25.019" extent="1-16" drill="0.381"/>
<contactref element="U1" pad="10"/>
<contactref element="R3" pad="1"/>
<via x="12.065" y="16.002" extent="1-16" drill="0.381"/>
<via x="5.08" y="16.891" extent="1-16" drill="0.381"/>
<contactref element="D4" pad="1"/>
<contactref element="JP3" pad="2"/>
<contactref element="R4" pad="1"/>
<contactref element="C6" pad="2"/>
<contactref element="JP2" pad="1"/>
<via x="21.971" y="31.369" extent="1-16" drill="0.381"/>
<via x="20.193" y="31.369" extent="1-16" drill="0.381"/>
<via x="28.067" y="31.623" extent="1-16" drill="0.381"/>
<via x="30.099" y="31.623" extent="1-16" drill="0.381"/>
<via x="33.147" y="34.925" extent="1-16" drill="0.381"/>
<via x="16.891" y="29.591" extent="1-16" drill="0.381"/>
<via x="16.891" y="27.559" extent="1-16" drill="0.381"/>
<via x="16.891" y="25.781" extent="1-16" drill="0.381"/>
<via x="16.891" y="24.003" extent="1-16" drill="0.381"/>
<via x="16.891" y="22.225" extent="1-16" drill="0.381"/>
<via x="20.701" y="20.447" extent="1-16" drill="0.381"/>
<via x="18.415" y="20.447" extent="1-16" drill="0.381"/>
<via x="26.035" y="16.383" extent="1-16" drill="0.381"/>
<via x="28.067" y="16.383" extent="1-16" drill="0.381"/>
<via x="30.099" y="16.383" extent="1-16" drill="0.381"/>
<via x="32.131" y="16.383" extent="1-16" drill="0.381"/>
<via x="34.163" y="16.383" extent="1-16" drill="0.381"/>
<contactref element="J1" pad="2"/>
<via x="34.036" y="3.556" extent="1-16" drill="0.381"/>
<via x="35.179" y="2.794" extent="1-16" drill="0.381"/>
<via x="33.909" y="2.032" extent="1-16" drill="0.381"/>
<via x="35.179" y="1.27" extent="1-16" drill="0.381"/>
<via x="32.639" y="1.27" extent="1-16" drill="0.381"/>
<via x="30.734" y="1.397" extent="1-16" drill="0.381"/>
<via x="29.21" y="1.143" extent="1-16" drill="0.381"/>
<via x="28.702" y="2.667" extent="1-16" drill="0.381"/>
<via x="28.702" y="4.318" extent="1-16" drill="0.381"/>
<via x="35.814" y="4.953" extent="1-16" drill="0.381"/>
<via x="35.814" y="6.985" extent="1-16" drill="0.381"/>
<via x="32.893" y="2.794" extent="1-16" drill="0.381"/>
<via x="12.954" y="9.271" extent="1-16" drill="0.381"/>
<via x="12.954" y="7.747" extent="1-16" drill="0.381"/>
<via x="12.954" y="5.969" extent="1-16" drill="0.381"/>
<via x="3.683" y="9.652" extent="1-16" drill="0.381"/>
<via x="1.905" y="10.16" extent="1-16" drill="0.381"/>
<via x="1.905" y="12.446" extent="1-16" drill="0.381"/>
<via x="1.651" y="14.859" extent="1-16" drill="0.381"/>
<via x="1.524" y="16.764" extent="1-16" drill="0.381"/>
<via x="1.524" y="18.669" extent="1-16" drill="0.381"/>
<via x="1.524" y="20.701" extent="1-16" drill="0.381"/>
<via x="1.397" y="23.114" extent="1-16" drill="0.381"/>
<via x="2.54" y="25.654" extent="1-16" drill="0.381"/>
<via x="2.159" y="28.448" extent="1-16" drill="0.381"/>
<via x="4.572" y="26.797" extent="1-16" drill="0.381"/>
<via x="6.604" y="27.686" extent="1-16" drill="0.381"/>
<via x="6.604" y="29.845" extent="1-16" drill="0.381"/>
<via x="3.175" y="31.242" extent="1-16" drill="0.381"/>
<via x="2.032" y="33.147" extent="1-16" drill="0.381"/>
<via x="1.778" y="35.052" extent="1-16" drill="0.381"/>
<via x="3.175" y="36.449" extent="1-16" drill="0.381"/>
<via x="4.572" y="34.036" extent="1-16" drill="0.381"/>
<via x="5.334" y="31.496" extent="1-16" drill="0.381"/>
<via x="8.509" y="31.242" extent="1-16" drill="0.381"/>
<via x="6.604" y="36.576" extent="1-16" drill="0.381"/>
<via x="9.017" y="35.941" extent="1-16" drill="0.381"/>
<via x="28.321" y="36.703" extent="1-16" drill="0.381"/>
<via x="31.496" y="36.576" extent="1-16" drill="0.381"/>
<via x="35.179" y="35.941" extent="1-16" drill="0.381"/>
<via x="35.687" y="32.258" extent="1-16" drill="0.381"/>
<via x="35.687" y="28.956" extent="1-16" drill="0.381"/>
<via x="35.687" y="25.527" extent="1-16" drill="0.381"/>
<via x="35.687" y="21.717" extent="1-16" drill="0.381"/>
<via x="35.687" y="18.542" extent="1-16" drill="0.381"/>
<via x="35.687" y="14.478" extent="1-16" drill="0.381"/>
<via x="35.814" y="12.7" extent="1-16" drill="0.381"/>
<via x="35.814" y="10.922" extent="1-16" drill="0.381"/>
<via x="35.814" y="9.017" extent="1-16" drill="0.381"/>
<via x="25.146" y="18.923" extent="1-16" drill="0.381"/>
<via x="23.749" y="15.494" extent="1-16" drill="0.381"/>
<via x="17.907" y="31.242" extent="1-16" drill="0.381"/>
<via x="19.431" y="37.211" extent="1-16" drill="0.381"/>
<via x="21.971" y="36.957" extent="1-16" drill="0.381"/>
<via x="24.257" y="36.957" extent="1-16" drill="0.381"/>
<via x="26.67" y="36.957" extent="1-16" drill="0.381"/>
<via x="16.764" y="37.084" extent="1-16" drill="0.381"/>
<via x="13.589" y="37.211" extent="1-16" drill="0.381"/>
<via x="10.414" y="37.084" extent="1-16" drill="0.381"/>
<via x="1.651" y="30.734" extent="1-16" drill="0.381"/>
</signal>
<signal name="N$1">
<contactref element="C2" pad="2"/>
<contactref element="U1" pad="1"/>
<wire x1="10.231" y1="20.259" x2="10.231" y2="22.193" width="0.1778" layer="1"/>
<wire x1="10.231" y1="22.193" x2="10.199" y2="22.225" width="0.1778" layer="1"/>
</signal>
<signal name="SW2">
<contactref element="L1" pad="1"/>
<polygon width="0.0508" layer="1" isolate="0.3048" thermals="no">
<vertex x="34.417" y="29.591"/>
<vertex x="26.67" y="29.591"/>
<vertex x="26.67" y="18.796"/>
<vertex x="34.417" y="18.796"/>
</polygon>
<contactref element="D4" pad="2"/>
<contactref element="D3" pad="2"/>
</signal>
<signal name="BAT">
<contactref element="C7" pad="1"/>
<contactref element="U1" pad="14"/>
<polygon width="0.0508" layer="1" isolate="0.3048" thermals="no">
<vertex x="6.35" y="13.97"/>
<vertex x="11.176" y="13.97"/>
<vertex x="11.176" y="2.032"/>
<vertex x="6.35" y="2.032"/>
</polygon>
<contactref element="JP2" pad="2"/>
<wire x1="16.131" y1="18.959" x2="14.641" y2="18.959" width="0.1778" layer="1"/>
<wire x1="14.641" y1="18.959" x2="13.716" y2="18.034" width="0.1778" layer="1"/>
<contactref element="R6" pad="2"/>
<wire x1="13.716" y1="18.034" x2="13.716" y2="12.573" width="0.1778" layer="1"/>
<wire x1="13.716" y1="12.573" x2="13.462" y2="12.319" width="0.1778" layer="1"/>
<wire x1="13.462" y1="12.319" x2="10.154" y2="12.319" width="0.1778" layer="1"/>
</signal>
<signal name="N$8">
<contactref element="C3" pad="1"/>
<contactref element="U1" pad="11"/>
<wire x1="16.131" y1="17.009" x2="17.644" y2="17.009" width="0.1778" layer="1"/>
<wire x1="17.644" y1="17.009" x2="17.907" y2="17.272" width="0.1778" layer="1"/>
<wire x1="17.907" y1="17.272" x2="18.7325" y2="17.272" width="0.1778" layer="1"/>
</signal>
<signal name="N$9">
<contactref element="C4" pad="1"/>
<contactref element="U1" pad="8"/>
<wire x1="10.231" y1="15.709" x2="9.232" y2="15.709" width="0.1778" layer="1"/>
<wire x1="9.232" y1="15.709" x2="8.636" y2="15.113" width="0.1778" layer="1"/>
<wire x1="8.636" y1="15.113" x2="4.445" y2="15.113" width="0.1778" layer="1"/>
<wire x1="4.445" y1="15.113" x2="3.937" y2="15.621" width="0.1778" layer="1"/>
<wire x1="3.937" y1="15.621" x2="3.937" y2="16.4465" width="0.1778" layer="1"/>
</signal>
<signal name="N$11">
<contactref element="R5" pad="1"/>
<contactref element="U1" pad="9"/>
<wire x1="16.131" y1="15.709" x2="17.565" y2="15.709" width="0.1778" layer="1"/>
<wire x1="17.565" y1="15.709" x2="17.78" y2="15.494" width="0.1778" layer="1"/>
<wire x1="17.78" y1="15.494" x2="18.7325" y2="15.494" width="0.1778" layer="1"/>
</signal>
<signal name="N$12">
<contactref element="R5" pad="2"/>
<contactref element="C5" pad="1"/>
<wire x1="21.1455" y1="15.9385" x2="20.701" y2="15.494" width="0.1778" layer="1"/>
<wire x1="20.701" y1="15.494" x2="19.6215" y2="15.494" width="0.1778" layer="1"/>
<wire x1="21.844" y1="15.9385" x2="21.1455" y2="15.9385" width="0.1778" layer="1"/>
</signal>
<signal name="NTC">
<contactref element="R3" pad="2"/>
<contactref element="U1" pad="6"/>
<wire x1="10.231" y1="17.009" x2="8.899" y2="17.009" width="0.1778" layer="1"/>
<contactref element="J1" pad="1"/>
<wire x1="5.08" y1="21.209" x2="6.477" y2="21.209" width="0.1778" layer="16"/>
<wire x1="6.477" y1="21.209" x2="8.509" y2="19.177" width="0.1778" layer="16"/>
<wire x1="8.509" y1="19.177" x2="8.509" y2="17.399" width="0.1778" layer="16"/>
<via x="8.509" y="17.399" extent="1-16" drill="0.381"/>
<wire x1="8.509" y1="17.399" x2="8.899" y2="17.009" width="0.1778" layer="1"/>
<wire x1="7.1755" y1="17.526" x2="8.382" y2="17.526" width="0.1778" layer="1"/>
<wire x1="8.382" y1="17.526" x2="8.509" y2="17.399" width="0.1778" layer="1"/>
</signal>
<signal name="VCC">
<polygon width="0.0508" layer="1" isolate="0.3048" thermals="no">
<vertex x="15.113" y="23.622"/>
<vertex x="13.081" y="23.622"/>
<vertex x="13.081" y="21.082"/>
<vertex x="11.303" y="21.082"/>
<vertex x="11.303" y="36.068"/>
<vertex x="15.113" y="36.068"/>
</polygon>
<contactref element="U1" pad="15"/>
<contactref element="R1" pad="2"/>
<contactref element="R2" pad="2"/>
<wire x1="19.3675" y1="33.274" x2="14.605" y2="33.274" width="0.1778" layer="1"/>
<contactref element="C2" pad="1"/>
<contactref element="Q1" pad="1"/>
<contactref element="Q1" pad="2"/>
<contactref element="Q1" pad="3"/>
<contactref element="JP1" pad="1"/>
<contactref element="C1" pad="1"/>
<wire x1="16.131" y1="19.609" x2="14.427" y2="19.609" width="0.4064" layer="1"/>
<wire x1="14.427" y1="19.609" x2="12.7" y2="21.336" width="0.4064" layer="1"/>
<wire x1="19.3675" y1="35.433" x2="19.3675" y2="33.274" width="0.1778" layer="1"/>
</signal>
<signal name="AGND">
<contactref element="C3" pad="2"/>
<contactref element="C4" pad="2"/>
<contactref element="C5" pad="2"/>
<contactref element="R7" pad="1"/>
<contactref element="U1" pad="3"/>
<wire x1="10.231" y1="18.959" x2="13.045" y2="18.959" width="0.1778" layer="1"/>
<wire x1="13.045" y1="18.959" x2="13.081" y2="18.923" width="0.1778" layer="1"/>
<via x="13.081" y="18.923" extent="1-16" drill="0.381"/>
<wire x1="13.081" y1="18.923" x2="19.304" y2="18.923" width="0.1778" layer="16"/>
<via x="19.304" y="18.923" extent="1-16" drill="0.381"/>
<wire x1="3.937" y1="17.3355" x2="3.937" y2="18.415" width="0.1778" layer="1"/>
<wire x1="3.937" y1="18.415" x2="4.5085" y2="18.9865" width="0.1778" layer="1"/>
<wire x1="10.231" y1="18.959" x2="7.2665" y2="18.959" width="0.1778" layer="1"/>
<wire x1="7.2665" y1="18.959" x2="7.239" y2="18.9865" width="0.1778" layer="1"/>
<wire x1="7.239" y1="18.9865" x2="4.5085" y2="18.9865" width="0.1778" layer="1"/>
<wire x1="19.6215" y1="17.272" x2="19.6215" y2="18.6055" width="0.1778" layer="1"/>
<wire x1="19.6215" y1="18.6055" x2="19.304" y2="18.923" width="0.1778" layer="1"/>
<wire x1="19.6215" y1="17.272" x2="20.574" y2="17.272" width="0.1778" layer="1"/>
<wire x1="20.574" y1="17.272" x2="21.0185" y2="16.8275" width="0.1778" layer="1"/>
<wire x1="21.844" y1="16.8275" x2="21.0185" y2="16.8275" width="0.1778" layer="1"/>
</signal>
<signal name="VSYS">
<contactref element="JP3" pad="1"/>
<contactref element="L1" pad="2"/>
<contactref element="R6" pad="1"/>
<contactref element="U1" pad="13"/>
<polygon width="0.0508" layer="1" isolate="0.3048" thermals="no">
<vertex x="34.417" y="13.97"/>
<vertex x="14.732" y="13.97"/>
<vertex x="14.732" y="1.778"/>
<vertex x="22.606" y="1.778"/>
<vertex x="22.606" y="5.588"/>
<vertex x="34.417" y="5.588"/>
</polygon>
<contactref element="C6" pad="1"/>
<wire x1="16.131" y1="18.309" x2="14.753" y2="18.309" width="0.1778" layer="1"/>
<wire x1="14.753" y1="18.309" x2="14.224" y2="17.78" width="0.1778" layer="1"/>
<wire x1="14.224" y1="17.78" x2="14.224" y2="12.573" width="0.1778" layer="1"/>
<wire x1="14.224" y1="12.573" x2="14.478" y2="12.319" width="0.1778" layer="1"/>
<wire x1="14.478" y1="12.319" x2="15.754" y2="12.319" width="0.1778" layer="1"/>
</signal>
<signal name="N$2">
<contactref element="U1" pad="4"/>
<contactref element="D1" pad="-"/>
<wire x1="10.231" y1="18.309" x2="11.917" y2="18.309" width="0.1778" layer="1"/>
<wire x1="11.917" y1="18.309" x2="12.065" y2="18.161" width="0.1778" layer="1"/>
<via x="12.065" y="18.161" extent="1-16" drill="0.381"/>
<wire x1="12.065" y1="18.161" x2="20.701" y2="18.161" width="0.1778" layer="16"/>
<wire x1="20.701" y1="18.161" x2="24.765" y2="22.225" width="0.1778" layer="16"/>
<wire x1="24.765" y1="22.225" x2="24.765" y2="31.877" width="0.1778" layer="16"/>
<via x="24.765" y="31.877" extent="1-16" drill="0.381"/>
<wire x1="24.638" y1="33.274" x2="24.638" y2="32.004" width="0.1778" layer="1"/>
<wire x1="24.638" y1="32.004" x2="24.765" y2="31.877" width="0.1778" layer="1"/>
</signal>
<signal name="N$4">
<contactref element="U1" pad="5"/>
<contactref element="D2" pad="-"/>
<wire x1="10.231" y1="17.659" x2="11.424" y2="17.659" width="0.1778" layer="1"/>
<wire x1="11.424" y1="17.659" x2="11.811" y2="17.272" width="0.1778" layer="1"/>
<wire x1="11.811" y1="17.272" x2="12.7" y2="17.272" width="0.1778" layer="1"/>
<via x="12.7" y="17.272" extent="1-16" drill="0.381"/>
<wire x1="12.7" y1="17.272" x2="20.828" y2="17.272" width="0.1778" layer="16"/>
<wire x1="20.828" y1="17.272" x2="25.654" y2="22.098" width="0.1778" layer="16"/>
<wire x1="25.654" y1="22.098" x2="25.654" y2="33.655" width="0.1778" layer="16"/>
<wire x1="25.654" y1="33.655" x2="26.289" y2="34.29" width="0.1778" layer="16"/>
<via x="26.289" y="34.29" extent="1-16" drill="0.381"/>
<wire x1="26.289" y1="34.29" x2="26.289" y2="35.179" width="0.1778" layer="1"/>
<wire x1="26.289" y1="35.179" x2="26.035" y2="35.433" width="0.1778" layer="1"/>
<wire x1="26.035" y1="35.433" x2="24.638" y2="35.433" width="0.1778" layer="1"/>
</signal>
<signal name="N$5">
<contactref element="R1" pad="1"/>
<contactref element="D1" pad="+"/>
<wire x1="20.2565" y1="33.274" x2="23.114" y2="33.274" width="0.1778" layer="1"/>
</signal>
<signal name="N$6">
<contactref element="R2" pad="1"/>
<contactref element="D2" pad="+"/>
<wire x1="20.2565" y1="35.433" x2="23.114" y2="35.433" width="0.1778" layer="1"/>
</signal>
<signal name="N$7">
<contactref element="U1" pad="7"/>
<contactref element="R4" pad="2"/>
<wire x1="10.231" y1="16.359" x2="8.866" y2="16.359" width="0.1778" layer="1"/>
<wire x1="8.866" y1="16.359" x2="8.636" y2="16.129" width="0.1778" layer="1"/>
<wire x1="8.636" y1="16.129" x2="7.1755" y2="16.129" width="0.1778" layer="1"/>
</signal>
<signal name="N$10">
<contactref element="Q1" pad="4"/>
<contactref element="U1" pad="16"/>
<wire x1="16.131" y1="20.259" x2="15.174" y2="20.259" width="0.1778" layer="1"/>
<wire x1="15.174" y1="20.259" x2="14.351" y2="21.082" width="0.1778" layer="1"/>
<wire x1="14.351" y1="21.082" x2="14.351" y2="22.854" width="0.1778" layer="1"/>
<wire x1="14.351" y1="22.854" x2="14.345" y2="22.86" width="0.1778" layer="1"/>
</signal>
<signal name="SW1">
<contactref element="Q1" pad="6"/>
<contactref element="Q1" pad="7"/>
<contactref element="Q1" pad="8"/>
<contactref element="Q1" pad="5"/>
<contactref element="D3" pad="1"/>
<polygon width="0.0508" layer="1" isolate="0.3048" thermals="no">
<vertex x="24.13" y="29.591"/>
<vertex x="18.669" y="29.591"/>
<vertex x="18.669" y="21.717"/>
<vertex x="24.13" y="21.717"/>
</polygon>
</signal>
</signals>
<errors>
<approved hash="3,1,8a70160816088a70"/>
<approved hash="3,1,0a60161816410a39"/>
<approved hash="3,1,431c00e4001643ee"/>
<approved hash="3,1,ca9c16e416e5ca9d"/>
<approved hash="3,1,7e7e160617c67fbe"/>
<approved hash="3,1,8e92146a15938f6b"/>
<approved hash="3,1,28fe6b066b0328fb"/>
<approved hash="3,1,5b9826e026ca5bb2"/>
<approved hash="3,1,1a7e680669c61bbe"/>
<approved hash="3,1,49f01408140549fd"/>
<approved hash="3,1,ceec20142004cefc"/>
<approved hash="3,1,4bce183618034bfb"/>
<approved hash="3,1,329c2064204532bd"/>
<approved hash="3,1,4e682e102e0e4e76"/>
<approved hash="3,1,c2ec00140004c2fc"/>
<approved hash="3,1,0ef8060006db0e23"/>
<approved hash="3,1,391c03e403c6393e"/>
<approved hash="3,1,669c36e436ca66b2"/>
<approved hash="3,1,2cd0142817d52f2d"/>
<approved hash="3,1,3e9c0464044a3eb2"/>
<approved hash="3,1,aa4cf434ebcab5b2"/>
<approved hash="3,1,7ffcf604f6c67f3e"/>
<approved hash="3,1,f7f838003856f7ae"/>
<approved hash="3,1,f1f806000656f1ae"/>
<approved hash="3,1,bcd0062806d2bc2a"/>
<approved hash="3,1,fdd0062805d5fe2d"/>
<approved hash="3,1,cd9c1464144acdb2"/>
<approved hash="3,1,824c063419ca9db2"/>
<approved hash="3,1,fcfc140414c6fc3e"/>
<approved hash="3,1,fef802000256feae"/>
<approved hash="3,1,21e1f419f7f4220c"/>
<approved hash="3,1,86e0061806f5860d"/>
<approved hash="3,1,6b60361836f26b8a"/>
<approved hash="3,1,f26c001401f6f38e"/>
<approved hash="3,1,7360001800f2738a"/>
<approved hash="3,1,a1f9f401f43ba1c3"/>
<approved hash="3,1,4d60141814f24d8a"/>
<approved hash="3,1,bfec341435f6be0e"/>
<approved hash="3,1,ea6c08140832ea4a"/>
<approved hash="3,1,4d580020004a4d32"/>
<approved hash="3,1,239c3464344a23b2"/>
<approved hash="3,1,67583820384a6732"/>
<approved hash="3,1,fdec14141432fdca"/>
</errors>
</board>
</drawing>
</eagle>

license_type: permissive

branch_name: refs/heads/master

extension: brd


text:
package output

import (
	"encoding/csv"
	"fmt"
	"os"
)

// CSV creates a file at path then writes the contents in CSV format
func CSV(path string, headers []string, records <-chan []string) error {
	f, err := os.Create(path)
	if err != nil {
		return fmt.Errorf("unable to create file %s: %v", path, err)
	}
	defer f.Close()

	w := csv.NewWriter(f)

	// write headers to file.
	if err := w.Write(headers); err != nil {
		return fmt.Errorf("error writing record to csv: %v", err)
	}

	// write all records.
	for r := range records {
		if err := w.Write(r); err != nil {
			return fmt.Errorf("could not write record to csv: %v", err)
		}
	}

	w.Flush()

	// check for extra errors.
	if err := w.Error(); err != nil {
		return fmt.Errorf("writer failed: %v", err)
	}
	return nil
}

license: MIT

repository: calini/grape

repo_name: calini/grape

gha_license_id: MIT

gha_language: Go

extension: go


text:
package verboten

import (
	"../../string"
)

func Run(parameters ...idiom_string.Type) idiom_string.Type {

	if expected, actual := 1, len(parameters); expected != actual {
		return idiom_string.Errorf("expected %d parameter(s), but actually got %d", expected, actual)
	}
	parameter0 := parameters[0]

	if !parameter0.IsSomething() {
		return idiom_string.Error("not something")
	}

	value, err := parameter0.Return()
	if nil != err {
		return idiom_string.Error(err.Error()) //@TODO: should the raw error message be returned?
	}

	return idiom_string.Error(value)
}

repository: reiver/idiom

repo_name: reiver/idiom


text:
include (CheckFunctionExists)
include (CheckCXXSourceCompiles)

message(STATUS "compiler is " ${CMAKE_C_COMPILER})
if("${CMAKE_C_COMPILER}" MATCHES "gcc")
	message(STATUS "adding -shared-libgcc " ${CMAKE_C_COMPILER})
        set(COMMON_CXX_FLAGS ${COMMON_CXX_FLAGS} -shared-libgcc -Wall -ansi -Wpointer-arith -Wwrite-strings)
        set(COMMON_LINKER_FLAGS ${COMMON_LINKER_FLAGS} -shared-libgcc)
endif("${CMAKE_C_COMPILER}" MATCHES "gcc")
if("${CMAKE_C_COMPILER}" MATCHES "cl")
		message(STATUS "Found cl: adding /W3, /GL and /VERBOSE:LIB to " ${CMAKE_C_COMPILER})
        set(COMMON_CXX_FLAGS ${COMMON_CXX_FLAGS} "/W3 /wd4290 /GL")
        set(COMMON_LINKER_FLAGS ${COMMON_LINKER_FLAGS} "/VERBOSE:LIB" )
endif()

if(UNIX)
	add_definitions(-D__UNIX__)
	add_definitions(-DUNITTEST_POSIX)

if("${CMAKE_SYSTEM_NAME}" STREQUAL "AIX")
	add_definitions(-D__AIX__)
	# AIX is missing iconv from libc, so we add it separately
	FIND_PATH( ICONV_INCLUDE_DIR NAMES iconv.h )
	MARK_AS_ADVANCED( ICONV_INCLUDE_DIR )
	FIND_LIBRARY( ICONV_LIBRARY NAMES iconv )
	MARK_AS_ADVANCED( ICONV_LIBRARY )
	SET(EXECLIBS ${EXECLIBS} ${ICONV_LIBRARY} )
endif("${CMAKE_SYSTEM_NAME}" STREQUAL "AIX")

if (${CMAKE_SYSTEM_NAME} STREQUAL Linux)
        add_definitions(-D__LINUX__)
endif (${CMAKE_SYSTEM_NAME} STREQUAL Linux)

endif(UNIX)

if(WIN32)
	add_definitions(-DWIN32)
	add_definitions(-D_CONSOLE)
	add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
	set(COMMONLIBS ${COMMONLIBS} wsock32)
	if("${CMAKE_C_COMPILER}" MATCHES "gcc")
		add_definitions(-D_CYGWIN_)
	endif()
endif(WIN32)

add_definitions(-D_REENTRANT)

if (CMAKE_BUILD_TYPE MATCHES "Debug")
#	add_definitions(-D_DEBUG)
endif (CMAKE_BUILD_TYPE MATCHES "Debug")

find_file(stdio.h HAVE_STDIO_H)

try_compile(
    attstreams_result
    ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp
    ${CMAKE_CURRENT_SOURCE_DIR}/cmake/testattstreams.cpp
    OUTPUT_VARIABLE attstreams_output)
if (attstreams_result)
set(USING_STREAMS 1)
message(STATUS "Building with AT&T Streams")
else()
message(STATUS "Building without AT&T Streams")
endif()

try_compile(
    socklent_result
    ${CMAKE_CURRENT_BINARY_DIR}/CMakeTmp
    ${CMAKE_CURRENT_SOURCE_DIR}/cmake/testsocklent.cpp
    OUTPUT_VARIABLE socklent_output)
if (socklent_result)
message(STATUS "socklen_t is defined")
else()
set(socklen_t int)
message(STATUS "socklen_t is undefined, defaulting to int")
endif()

check_function_exists(ftime HAVE_FTIME)

check_cxx_source_compiles("
#include <exception>
void term() {};
int main(int argc, char** argv){ set_terminate(term); return 0;}"
GLOBAL_SET_TERMINATE)
if (GLOBAL_SET_TERMINATE)
	message(STATUS "set_terminate is global")
else()
	message(STATUS "set_terminate is not global")
	check_cxx_source_compiles("
	#include <exception>
	void term() {};
	int main(int argc, char** argv){ std::set_terminate(term); return 0;}"
	STD_SET_TERMINATE)
	if (STD_SET_TERMINATE)
		set(TERMINATE_IN_STD 1)
		message(STATUS "set_terminate is available in std::")
	else()
		message(FATAL "set_terminate is not available in std::, cannot proceed")
	endif()

endif()

check_cxx_source_compiles("
#include <typeinfo>
int main(int argc, char** argv){ const typeinfo& ty = typeid(typeinfo); return 0;}"
GLOBAL_TYPEINFO)
if (GLOBAL_TYPEINFO)
	message(STATUS "typeinfo is global")
else()
	message(STATUS "typeinfo is not global")
	check_cxx_source_compiles("
	#include <typeinfo>
	int main(int argc, char** argv){ const std::type_info& ty = typeid(std::type_info); return 0;}"
	STD_TYPEINFO)
	if (STD_TYPEINFO)
		set(TYPEINFO_IN_STD 1)
		message(STATUS "type_info is available in std namespace")
	else()
		message(FATAL "type_info is not available in std namespace, cannot proceed")
	endif()
endif()

check_cxx_source_compiles("
#include <netdb.h>
int main(int argc, char** argv){
	const char* name = "localhost";
	hostent host;
	char buf[1024];
	hostent* host_ptr;
	int error;
	gethostbyname_r( name, &host, buf, sizeof(buf), &host_ptr, &error );
	return 0;
}" GETHOSTBYNAME_R_INPUTS_RESULT)
if (GETHOSTBYNAME_R_INPUTS_RESULT)
	set(GETHOSTBYNAME_R_INPUTS_RESULT 1)
	message(STATUS "The system has gethostbyname_r which takes a result as a pass-in param")
else()
	message(STATUS "The system does not have a gethostbyname_r which takes a result as a pass-in param")
endif()

# Checks for libraries.
#AC_CHECK_LIB(c,shutdown,true,AC_CHECK_LIB(socket,shutdown))
#AC_CHECK_LIB(c,inet_addr,true,AC_CHECK_LIB(nsl,inet_addr))
#AC_CHECK_LIB(c,nanosleep,true,AC_CHECK_LIB(rt,nanosleep))
#AC_CHECK_LIB(compat,ftime)

# Checks for header files.
# check for boost::pool_allocator
#AC_MSG_CHECKING(for boost::pool_allocator)
#AC_TRY_COMPILE(
#	[#include <boost/pool/pool_alloc.hpp>
#	 #include<vector>],
#	[std::vector<int, boost::pool_allocator<int> > x;],
#	AC_MSG_RESULT(yes)
#	AC_DEFINE(HAVE_BOOST_POOL_ALLOCATOR, 1,
#	boost::pool_allocator exists),
#	AC_MSG_RESULT(no))

# check for boost::fast_pool_allocator
#AC_MSG_CHECKING(for boost::fast_pool_allocator)
#AC_TRY_COMPILE(
#	[#include <boost/pool/pool_alloc.hpp>
#	 #include<vector>],
#	[std::vector<int, boost::fast_pool_allocator<int> > x;],
#	AC_MSG_RESULT(yes)
#	AC_DEFINE(HAVE_BOOST_FAST_POOL_ALLOCATOR, 1,
#	boost::fast_pool_allocator exists),
#	AC_MSG_RESULT(no))

# check for __gnu_cxx::__pool_alloc
#AC_MSG_CHECKING(__gnu_cxx::__pool_alloc)
#AC_TRY_COMPILE(
#	[#include <ext/pool_allocator.h>
#	 #include<vector>],
#	[std::vector<int, __gnu_cxx::__pool_alloc<int> > x;],
#	AC_MSG_RESULT(yes)
#	AC_DEFINE(HAVE_POOL_ALLOCATOR, 1,
#	__gnu_cxx::pool_allocator exists),
#	AC_MSG_RESULT(no))

# check for __gnu_cxx::__mt_alloc
#AC_MSG_CHECKING(__gnu_cxx::__mt_alloc)
#AC_TRY_COMPILE(
#	[#include <ext/mt_allocator.h>
#	 #include<vector>],
#	[std::vector<int, __gnu_cxx::__mt_alloc<int> > x;],
#	AC_MSG_RESULT(yes)
#	AC_DEFINE(HAVE_MT_ALLOCATOR, 1,
#	__gnu_cxx::mt_allocator exists),
#	AC_MSG_RESULT(no))

# check for __gnu_cxx::bitmap_allocator
#AC_MSG_CHECKING(__gnu_cxx::bitmap_allocator)
#AC_TRY_COMPILE(
#	[#include <ext/bitmap_allocator.h>
#	 #include<vector>],
#	[std::vector<int, __gnu_cxx::bitmap_allocator<int> > x;],
#	AC_MSG_RESULT(yes)
#	AC_DEFINE(HAVE_BITMAP_ALLOCATOR, 1,
#	__gnu_cxx::bitmap_allocator exists),
#	AC_MSG_RESULT(no))

#AC_CHECK_LIB(iberty, cplus_demangle,
#  AC_DEFINE(HAVE_CPLUS_DEMANGLE,1,whether or not we have to demangle names)
#  LIBS="$LIBS -liberty")

# Checks for runtime behavior
#AC_MSG_CHECKING(if select modifies timeval parameter)
#AC_TRY_RUN(
#[
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#int main(int argc, char** argv)
#{
#  struct timeval tv;
#  tv.tv_sec = 0;
#  tv.tv_usec = 1;
#  select(0,0,0,0,&tv);
#  return tv.tv_usec != 1 ? 0 : 1;
#}
#],
#AC_MSG_RESULT(yes)
#AC_DEFINE(SELECT_MODIFIES_TIMEVAL, 1,
#select statement decrements timeval parameter if interupted),
#AC_MSG_RESULT(no),
#AC_MSG_RESULT(unable to determine, assuming no...))

if (QF_WITH_NEW_ALLOCATOR)
set(ENABLE_NEW_ALLOCATOR 1)
endif()

if (QF_WITH_CALLSTACK)
add_definitions(-DENABLE_CALLSTACK)
endif()

if (QF_WITH_BOOST)
add_definitions(-DHAVE_BOOST)
endif()

if (QF_WITH_MYSQL)
add_definitions(-DHAVE_MYSQL)
endif()

if (QF_WITH_POSTGRESQL)
add_definitions(-DHAVE_POSTGRESQL)
endif()

if (QF_WITH_PYTHON)
add_definitions(-DHAVE_PYTHON)
endif()

if (QF_WITH_RUBY)
add_definitions(-DHAVE_RUBY)
endif()

if (QF_WITH_JAVA)
add_definitions(-DHAVE_JAVA)
endif()

if (QF_WITH_STLPORT)
add_definitions(-DHAVE_STLPORT)
endif()

repository: rockdreamer/quickfix-older

repo_name: rockdreamer/quickfix-older

extension: cmake


text:
using System;

namespace Flexinets.WooCommerce
{
    public class WooCommercePaymentNotificationModel
    {
        public String action;
        public Int64 arg;
    }
}

extension: cs


text:
@article{Komiske:2018cqr,
 archiveprefix = {arXiv},
 author = {Komiske, Patrick T. and Metodiev, Eric M. and Thaler, Jesse},
 doi = {10.1007/JHEP01(2019)121},
 eprint = {1810.05165},
 journal = {JHEP},
 pages = {121},
 primaryclass = {hep-ph},
 reportnumber = {MIT-CTP 5064},
 title = {Energy Flow Networks: Deep Sets for Particle Jets},
 volume = {01},
 year = {2019}
}

repository: pkomiske/academic-kickstart

repo_name: pkomiske/academic-kickstart

extension: bib


text:
// Copyright 2019 spaGO Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package gradfn

import (
	"fmt"

	"github.com/nlpodyssey/spago/mat"
)

// Add is an operator to perform element-wise sum over two values.
// y = x1 + x2
type Add[O mat.Tensor] struct {
	x1 O
	x2 O
}

// NewAdd returns a new Add Function.
func NewAdd[O mat.Tensor](x1, x2 O) *Add[O] {
	return &Add[O]{
		x1: x1,
		x2: x2,
	}
}

// Operands returns the list of operands.
func (r *Add[O]) Operands() []mat.Tensor {
	return []mat.Tensor{r.x1, r.x2}
}

// Forward computes the output of the function.
func (r *Add[O]) Forward() (mat.Tensor, error) {
	x1v := r.x1.Value().(mat.Matrix)
	x2v := r.x2.Value().(mat.Matrix)
	return x1v.Add(x2v), nil
}

// Backward computes the backward pass.
func (r *Add[O]) Backward(gy mat.Tensor) error {
	if r.x1.RequiresGrad() {
		x1v := r.x1.Value()
		if !mat.SameDims(x1v.(mat.Matrix), gy.(mat.Matrix)) {
			return fmt.Errorf("fn: matrices have incompatible dimensions")
		}
		r.x1.AccGrad(gy)
	}
	if r.x2.RequiresGrad() {
		x2v := r.x2.Value()
		if !mat.SameDims(x2v.(mat.Matrix), gy.(mat.Matrix)) {
			return fmt.Errorf("fn: matrices have incompatible dimensions")
		}
		r.x2.AccGrad(gy)
	}
	return nil
}

repository: nlpodyssey/spago

repo_name: nlpodyssey/spago

branch_name: refs/heads/main


text:
package methods

import (
	"time"

	"github.com/prometheus/common/model"
	"github.com/prometheus/prometheus/pkg/rulefmt"
)

type NotificationSeverity string

var (
	NotificationPageSeverity   = NotificationSeverity("page")
	NotificationTicketSeverity = NotificationSeverity("ticket")

	// Severities list of available severities: page and ticket
	Severities = []NotificationSeverity{
		NotificationPageSeverity,
		NotificationTicketSeverity,
	}
)

type Window struct {
	Duration     model.Duration       `yaml:"duration"`
	Consumption  float64              `yaml:"consumption"`
	Notification NotificationSeverity `yaml:"notification"`
}

type AlertErrorOptions struct {
	ServiceName        string
	AvailabilityTarget float64
	SLOWindow          time.Duration

	Windows     []Window
	ShortWindow bool
	BurnRate    float64

	// important for simple algorithm
	AlertWindow string
	AlertWait   string
}

type AlertLatencyOptions struct {
	ServiceName string
	Targets     []LatencyTarget
	SLOWindow   time.Duration

	Windows     []Window
	ShortWindow bool
	BurnRate    float64

	// important for simple algorithm
	AlertWindow string
	AlertWait   string
}

type AlertMethod interface {
	AlertForError(*AlertErrorOptions) ([]rulefmt.Rule, error)
	AlertForLatency(*AlertLatencyOptions) ([]rulefmt.Rule, error)
}

var methods = map[string]AlertMethod{}

func register(method AlertMethod, name string) AlertMethod {
	methods[name] = method
	return method
}

func Get(name string) AlertMethod {
	return methods[name]
}

type LatencyTarget struct {
	LE     string  `yaml:"le"`
	Target float64 `yaml:"target"`
}

repository: globocom/slo-generator

repo_name: globocom/slo-generator


text:
//
// Created by avendel on 10.10.2018.
//

#pragma once

#include <cstdint>

namespace shiva::input::mouse {
    enum class Button : uint8_t {
        Left,
        Right,
        Middle,
        XButton1,
        XButton2,
        ButtonCount
    };

    enum class Wheel : uint8_t {
        VerticalWheel,
        HorizontalWheel
    };
}

extension: hpp


text:
using Microsoft.Bot.Builder.Dialogs;
using System;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;
using Microsoft.Bot.Connector;
using SceneBuilderBot.Services.Repositories;
using System.Diagnostics;

namespace SceneBuilderBot.Dialogs
{
    [Serializable]
    public class UnknownUserRootDialog : IDialog<object>
    {
        private string userId;
        private string currentSceneId;

        public async Task StartAsync(IDialogContext context)
        {
            Debug.WriteLine("UnknownUserRootDialog.StartAsync > Enter");
            await context.PostAsync(ConversationMessages.WelcomeMessage);
            Debug.WriteLine("UnknownUserRootDialog.StartAsync > After context.PostAsync / Before context.Wait");
            context.Wait(MessageReceivedAsync);
            Debug.WriteLine("UnknownUserRootDialog.StartAsync > After context.Wait");
        }

        private async Task MessageReceivedAsync(IDialogContext context, IAwaitable<object> result)
        {
            Debug.WriteLine("UnknownUserRootDialog.MessageReceivedAsync > Start");
            var activity = await result as Activity;

            if (!context.UserData.ContainsKey(ConversationStorageKeys.UserNameId))
            {
                Debug.WriteLine("UnknownUserRootDialog.MessageReceivedAsync > Prompt 'Before we get started'");
                PromptDialog.Text(context, this.HandleUserIdPrompt, "Before we get started, please tell me your name?");
                Debug.WriteLine("UnknownUserRootDialog.MessageReceivedAsync > return");
                return;
            }
            else
            {
                userId = context.UserData.GetValue<string>(ConversationStorageKeys.UserNameId);
            }

            if (activity.Text.Equals(ConversationKeySentences.StartNewScene, StringComparison.InvariantCultureIgnoreCase))
            {
                Debug.WriteLine("UnknownUserRootDialog.MessageReceivedAsync > Prompt 'Before we get started'");
                PromptDialog.Text(context, this.HandleSceneNamePrompt, "Give a name for your scene.");
                Debug.WriteLine("UnknownUserRootDialog.MessageReceivedAsync > return");
                return;
            }

            Debug.WriteLine("UnknownUserRootDialog.MessageReceivedAsync > Before context.Wait");
            context.Wait(MessageReceivedAsync);
            Debug.WriteLine("UnknownUserRootDialog.MessageReceivedAsync > After context.Wait");
        }

        private async Task HandleUserIdPrompt(IDialogContext context, IAwaitable<string> result)
        {
            Debug.WriteLine("UnknownUserRootDialog.HandleUserIdPrompt > Start");
            try {
                var userName = await result;

                Debug.WriteLine("UnknownUserRootDialog.HandleUserIdPrompt > Before context.PostAsync");
                await context.PostAsync($"Welcome {userId}!");
                Debug.WriteLine("UnknownUserRootDialog.HandleUserIdPrompt > After context.PostAsync");

                var userRepository = InMemoryUserRepository.Get();
                userId = userRepository.RegisterChannelUser(context.Activity.From.Id, userName);

                context.UserData.SetValue(ConversationStorageKeys.UserNameId, userId);
            }
            catch (TooManyAttemptsException)
            {
            }

            Debug.WriteLine("UnknownUserRootDialog.HandleUserIdPrompt > Before context.Wait");
            context.Wait(this.MessageReceivedAsync);
            Debug.WriteLine("UnknownUserRootDialog.HandleUserIdPrompt > After context.Wait");
        }

        private async Task HandleSceneNamePrompt(IDialogContext context, IAwaitable<string> result)
        {
            try
            {
                currentSceneId = await result;

                Debug.WriteLine("UnknownUserRootDialog.HandleSceneNamePrompt > Before context.PostAsync");
                await context.PostAsync($"You can now start building scene {currentSceneId}!");
                Debug.WriteLine("UnknownUserRootDialog.HandleSceneNamePrompt > After context.PostAsync");

                context.UserData.SetValue(ConversationStorageKeys.CurrentSceneId, currentSceneId);
            }
            catch (TooManyAttemptsException)
            {
            }

            Debug.WriteLine("UnknownUserRootDialog.HandleSceneNamePrompt > Before context.Wait");
            context.Wait(this.MessageReceivedAsync);
            Debug.WriteLine("UnknownUserRootDialog.HandleSceneNamePrompt > After context.Wait");
        }
    }
}

repository: Trojka/SceneBuilderBot

repo_name: Trojka/SceneBuilderBot


text:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package auth_test

import (
	"net/http"

	. "github.com/onsi/ginkgo/v2"

	"github.com/apisix/manager-api/test/e2e/base"
)

var _ = Describe("Authentication", func() {
	DescribeTable("test auth module",
		func(tc base.HttpTestCase) {
			base.RunTestCase(tc)
		},
		Entry("Access with valid authentication token", base.HttpTestCase{
			Object:       base.ManagerApiExpect(),
			Method:       http.MethodGet,
			Path:         "/apisix/admin/routes",
			Headers:      map[string]string{"Authorization": base.GetToken()},
			ExpectStatus: http.StatusOK,
			ExpectBody:   `"code":0`,
		}),
		Entry("Access with malformed authentication token", base.HttpTestCase{
			Object:       base.ManagerApiExpect(),
			Method:       http.MethodGet,
			Path:         "/apisix/admin/routes",
			Headers:      map[string]string{"Authorization": "Not-A-Valid-Token"},
			ExpectStatus: http.StatusUnauthorized,
			ExpectBody:   `"message":"request unauthorized"`,
		}),
		Entry("Access without authentication token", base.HttpTestCase{
			Object:       base.ManagerApiExpect(),
			Method:       http.MethodGet,
			Path:         "/apisix/admin/routes",
			ExpectStatus: http.StatusUnauthorized,
			ExpectBody:   `"message":"request unauthorized"`,
		}),
	)
})

repository: apache/apisix-dashboard

repo_name: apache/apisix-dashboard


text:
/*
 * Copyright (c) 2021-2023, Diabeloop
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

import { User } from '../../../lib/auth'
import { HcpProfession } from '../../../lib/auth/models/enums/hcp-profession.enum'
import { AuthenticatedUserMetadata } from '../../../lib/auth/models/enums/authenticated-user-metadata.enum'
import { UserRole } from '../../../lib/auth/models/enums/user-role.enum'
import { CountryCodes } from '../../../lib/auth/models/country.model'
import { LanguageCodes } from '../../../lib/auth/models/enums/language-codes.enum'
import { Unit } from 'medical-domain'

const getHcp = (): User => {
  const email = 'john.doe@example.com'
  const hcp = new User({
    email,
    email_verified: true,
    sub: 'auth0|a0000000',
    [AuthenticatedUserMetadata.Roles]: [UserRole.Hcp]
  })
  hcp.frProId = 'ANS20211229094028'
  hcp.profile = { email, firstName: 'John', lastName: 'Doe', fullName: 'John Doe', hcpProfession: HcpProfession.diabeto }
  hcp.preferences = { displayLanguageCode: 'en' }
  hcp.settings = { units: { bg: Unit.MilligramPerDeciliter }, country: CountryCodes.France }
  return hcp
}

const getCaregiver = (): User => {
  const email = 'caregiver@example.com'
  const caregiver = new User({
    email,
    email_verified: true,
    sub: 'auth0|b0000000',
    [AuthenticatedUserMetadata.Roles]: [UserRole.Caregiver]
  })
  caregiver.profile = { email, firstName: 'Caregiver', lastName: 'Example', fullName: 'Caregiver Example' }
  caregiver.preferences = { displayLanguageCode: 'de' }
  caregiver.settings = { country: CountryCodes.Germany, units: { bg: Unit.MmolPerLiter } }
  return caregiver
}

const getPatient = (): User => {
  const email = 'josephine.dupuis@example.com'
  const patient = new User({
    email,
    email_verified: true,
    sub: 'auth0|a0a0a0b0',
    [AuthenticatedUserMetadata.Roles]: [UserRole.Patient]
  })
  patient.settings = { a1c: { rawdate: '2020-01-01', date: '2020-01-01', value: '7.5' }, country: CountryCodes.France }
  patient.profile = {
    email,
    firstName: 'Josephine',
    lastName: 'Dupuis',
    fullName: 'Josephine D.',
    patient: {
      birthday: '1964-12-01',
      birthPlace: 'Anywhere',
      diagnosisDate: '2020-12-02',
      diagnosisType: '1',
      referringDoctor: 'Dr Dre',
      sex: 'M',
      ins: '123456789012345',
      ssn: '012345678901234'
    }
  }
  patient.preferences = { displayLanguageCode: LanguageCodes.Fr }
  return patient
}

/**
 * Logged-in users for test, choose one suitable
 */
export const loggedInUsers = { getHcp, getPatient, getCaregiver }

repository: mdblp/blip

repo_name: mdblp/blip

gha_language: TypeScript

extension: ts


text:
package check_enter

import (
	"fgame/fgame/common/lang"
	coretypes "fgame/fgame/core/types"
	funcopentypes "fgame/fgame/game/funcopen/types"
	"fgame/fgame/game/player"
	playerlogic "fgame/fgame/game/player/logic"
	"fgame/fgame/game/scene/scene"
	scenetypes "fgame/fgame/game/scene/types"

	log "github.com/Sirupsen/logrus"
)

func init() {
	scene.RegisterCheckEnterHandler(scenetypes.SceneTypeWelfareQiYu, scene.CheckEnterSceneHandlerFunc(qiYuDaoCheckEnterScene))
}

//奇遇岛 进入处理
func qiYuDaoCheckEnterScene(spl scene.Player, s scene.Scene, pos coretypes.Position, enterType scenetypes.SceneEnterType) (flag bool, enterPos coretypes.Position) {
	enterPos = pos
	pl, ok := spl.(player.Player)
	if !ok {
		log.WithFields(
			log.Fields{
				"playerId": pl.GetId(),
			}).Warn("shenyu: 不是玩家")
		playerlogic.SendSystemMessage(pl, lang.CommonArgumentInvalid)
		return
	}

	// if enterType == scenetypes.SceneEnterTypeTrac {
	// 	log.WithFields(
	// 		log.Fields{}).Warn("shenyu: 本地图不支持传送")
	// 	playerlogic.SendSystemMessage(pl, lang.CommonMapNotTransfer)
	// 	return
	// }

	if !pl.IsFuncOpen(funcopentypes.FuncOpenTypeDuanWuQiYuDao) {
		log.WithFields(
			log.Fields{
				"playerId": pl.GetId(),
			}).Warn("shenyu: 进入场景失败，功能未开启")
		playerlogic.SendSystemMessage(pl, lang.CommonFuncNoOpen)
		return
	}

	flag = true
	return
}

repository: rebider/Fgame

repo_name: rebider/Fgame


text:
SUMMARY = "Python module for automating interactive applications"
DISCRIPTION = "\
	Pexpect is a pure Python module for spawning child applications; \
	controlling them; and responding to expected patterns in their \
	output. Pexpect works like Don Libes' Expect. Pexpect allows your \
	script to spawn a child application and control it as if a human were \
	typing commands."
HOMEPAGE = "http://www.noah.org/wiki/Pexpect"

PR = "${INC_PR}.0"

require pexpect.inc

inherit distutils

RDEPENDS_${PN}_class-target = "\
	python-core \
	python-io \
	python-terminal \
	python-resource \
	python-fcntl"

# Change install directory from "site-packages" to "dist-packages"
PYTHON_SITEPACKAGES_DIR = "${libdir}/${PYTHON_DIR}/dist-packages"

do_install_append() {
	install -d ${D}/${datadir}/pyshared/
	install -m 644 ${S}/*.py ${D}/${datadir}/pyshared/

	cp -r ${S}/pexpect/ ${D}/${datadir}/pyshared/
	cp -r ${D}/${libdir}/${PYTHON_DIR}/dist-packages/*.egg-info ${D}/${datadir}/pyshared/

	# Remove unwanted files
	find ${D}${libdir} -type f -name "*.pyc" -exec rm -f {} \;
}

FILES_${PN} = "${datadir}/* ${libdir}/${PYTHON_DIR}/*"

BBCLASSEXTEND = "native"

repository: manut/meta-combo

repo_name: manut/meta-combo

branch_name: refs/heads/morty

gha_language: BitBake

extension: bb


text:
using System;
using System.Collections.Generic;

namespace vtortola.Redis
{
    /// <summary>
    /// Result of a multiple command statement.
    /// </summary>
    public interface IRedisResults : IEnumerable<IRedisResultInspector>
    {
        /// <summary>
        /// Gets the <see cref="IRedisResultInspector"/> at the specified index.
        /// </summary>
        IRedisResultInspector this[Int32 index] { get; }

        /// <summary>
        /// Gets the <see cref="IRedisResultInspector"/> count.
        /// </summary>
        Int32 Count { get; }

        /// <summary>
        /// Throws an exception if any of the <see cref="IRedisResultInspector"/> contains one.
        /// </summary>
        void ThrowErrorIfAny();
    }
}

repository: vtortola/RedisClient

repo_name: vtortola/RedisClient

gha_language: C#


text:
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %% [markdown]
# # Listas
#
# * Lista é uma coleção de elementos
# * Cada elemento possui uma posição dentro de uma lista. Essa posição é chamada índice
# * O primeiro elemento fica armazenado na posição *0*, enquanto o último elemento fica armazenado na posição *n-1* (onde *n* é a quantidade de elementos da lista)
#
# O que veremos nessa aula:
#
# 1. Como criar uma lista
# 2. Como acessar elementos de uma lista
# 3. Como modificar elementos de uma lista
# 4. Principais métodos de um objeto lista
# 5. Funções aplicáveis a uma lista
# %% [markdown]
# ### 1. Como criar uma lista

# %%
# Criando uma lista vazia
lista_vazia = []
lista_vazia2 = list()

# %%
# Visualizando o tipo
type(lista_vazia)

# %%
# Visualizando o tipo
type(lista_vazia2)

# %%
# Verificando o tamanho da lista
len(lista_vazia)

# %%
# Criando listas com elementos
lista = [23, 56, 2, -3, 10, 2, 18, 0, 5]
lista_reais = [1.5, -2.13, 5.14]
lista_strings = ["Rodrigo", "Python", "PUC Minas", "Ciência de Dados e Big Data"]
lista_booleanos = [True, True, False, True]
lista_misturada = [1, 2, 3.14159, "teste"]
lista_misturada2 = [1, 2, 3.14159, "teste", [1, "A", 1.0]]
listas_aninhadas = [ [1, 2, 3], [4, 5, 6], [7, 8, 9]]

# %%
# Visualizando a lista
lista

# %%
lista_reais

# %%
lista_strings

# %%
lista_booleanos

# %%
lista_misturada

# %%
lista_misturada2

# %%
listas_aninhadas

# %% [markdown]
# ### 2. Como acessar elementos de uma lista

# %%
# Acessando o índice 0 (primeira posição)
lista[0]

# %%
lista

# %%
# Acessando o índice 2 (terceira posição)
lista[2]

# %%
# Acessando o índice 3 (quarta posição)
lista_strings[3]

# %%
lista_strings

# %%
# Acessando o índice 3 (quarta posição)
lista_misturada[3]

# %%
lista_misturada

# %%
# Acessando o índice 4 nos foi retornado uma lista com 3 elementos. Agora queremos acessar o índice 1 dessa lista interna
lista_misturada2[4][1]

# %%
lista_misturada2

# %%
# Acessando um índice inexistente
lista[20]

# %% [markdown]
# ### 3. Como modificar elementos de uma lista

# %%
# Visualizando a lista
lista

# %%
# Alterando o elemento do índice 1 de 56 para 18
lista[1] = 18

# %%
# Visualizando a alteração realizada
lista

# %%
# Modificando o elemento do índice 3 de -3 para 15
lista[3] = 15

# %%
# Visualizando a alteração realizada
lista

# %%
# Modificando o elemento do índice 2. Ele recebe a soma dos dois elementos anteriores
lista[2] = lista[0] + lista[1]

# %%
# Visualizando a alteração realizada
lista

# %% [markdown]
# ### 4. Principais métodos de um objeto lista
#
# Método | Descrição | Exemplo
# :----- | :-------- | :------
# append | Adiciona um elemento no final da lista | `lista.append(5)`
# clear  | Apaga todos os elementos de uma lista | `lista.clear()`
# copy | Retorna uma cópia dos elementos da lista | `copia = lista.copy()`
# count | Retorna a quantidade de ocorrências de um elemento na lista | `qt = lista.count(5)`
# extend | Adiciona os elementos de outra lista passada por parâmetro | `lista.extend(outra_lista)`
# index | Retorna o índice do elemento passado por parâmetro (primeira posição) | `pos5 = lista.index(5)`
# insert | Adiciona um elemento em uma posição passada por parâmetro (adiciona no final caso a posição não exista)| `lista.insert(3, "João")`
# pop | Remove o elemento na posição passada por parâmetro (provoca um erro caso a posição não exista)| `elemento = lista.pop(3)`
# remove | Remove o elemento passado por parâmetro (provoca um erro caso o elemento não exista)| `lista.remove(5)`
# reverse | Inverte a ordem dos elementos de uma lista | `lista.reverse()`
# sort | Ordena os objetos de uma lista | `lista.sort()`
#  | | `lista.sort(reverse=True)`
# %% [markdown]
# #### 4.1 - append()

# %%
# Visualizando a lista antes da chamada ao método append()
lista

# %%
# Adicionado o 17 no final da lista
lista.append(17)

# %%
# Visualizando a lista após chamada ao método append()
lista

# %% [markdown]
# #### 4.2 - clear()

# %%
# Visualizando lista_reais antes da chamada ao método clear()
lista_reais

# %%
# Removendo todos os ementos de lista_reais
lista_reais.clear()

# %%
# Visualizando lista_reais após chamada ao método clear()
lista_reais

# %% [markdown]
# #### 4.3 - copy()

# %%
# Copiando uma lista para outra?
copia = lista

# %%
# Visualizando o conteúdo de copia
copia

# %%
# Alterando o elemento do índice 0 de 23 para 5
copia[0] = 5

# %%
# Visualizando o conteúdo de copia
copia

# %%
# Visualizando o conteúdo de lista (Perceba que o elemento 23 também foi alterado na lista, e não apenas em copia)
lista

# %%
# Desfazendo a alteração no índice 0, modificando de 5 para 23
lista[0] = 23

# %%
# A maneira correta de copiar uma lista para outra é através da chamada ao método copy()
copia = lista.copy()

# %%
# Visualizando o conteúdo de lista
lista

# %%
# Visualizando o conteúdo de copia
copia

# %%
# Alterando o elemento do índice 0 de 23 para 5
copia[0] = 5

# %%
# Visualizando o conteúdo de lista
lista

# %%
# Visualizando o conteúdo de lista - Agora sim, apenas o índice 0 de copia foi alterado
copia

# %% [markdown]
# #### 4.4 - count()

# %%
# Verificando quantas vezes o número 5 aparece em copia
copia.count(5)

# %% [markdown]
# #### 4.5 - extend()

# %%
# Suponha que temos uma lista chamada numeros que contém os elementos [1, 2, 3]
numeros = [1, 2, 3]

# %%
# Queremos adicionar o elementos [4, 5] à lista números e usamos o método append()
numeros.append([4,5])

# %%
# Ao invés de adicionarmos os elementos 4 e 5, adicionar uma lista contendo os elementos [4, 5]
numeros

# %%
# A maneira correta de adicionar novos elementos de uma lista, a partir de outra lista, é através do método extend()
numeros = [1, 2, 3]
numeros.extend([4,5])
numeros

# %% [markdown]
# #### 4.6 - index()

# %%
# Redefinindo os elementos da lista
lista = [1, 3, 7, 2, 3, 8, 4]

# %%
# O método index nos permite saber em que posição determinado elemento está armazenado
lista.index(7)

# %%
# Podemos guardar esse valor em uma variável
posicao8 = lista.index(8)

# %%
posicao8

# %%
# O método index() retorna a posição da primeira ocorrência do elemento procurado.
posicao3 = lista.index(3)

# %%
posicao3

# %%
# Caso o elemento não exista, ocorre um erro
lista.index(19)

# %% [markdown]
# #### 4.7 - insert()

# %%
# O método insert() permite adicionar um elemento em qualquer posição da lista.
# Caso a posição não exista, ele insere o elemento desejado na última posição
lista.insert(2, "ABC")
lista

# %%
lista.insert(100, "XYZ")
lista

# %% [markdown]
# #### 4.8 - pop()

# %%
# Utilizamos o método pop() quando desejamos apagar uma posição da lista
# Removendo o elemento no índice 2
valor = lista.pop(2)
# Visualizando o valor retornado
valor

# %%
# Visualizando a lista após a remoção
lista

# %%
# Removendo o elemento da última posição
lista.pop(-1)
# Visualizando a lista após a remoção
lista

# %%
# O método pop() provoca um erro caso a posição não exista
lista.pop(45)

# %% [markdown]
# #### 4.9 - remove()

# %%
# Utilizamos o método remove() quando desejamos apagar um elemento específico da lista
# Visualizando lista_strings antes da remoção
lista_strings

# %%
# Removendo "Rodrigo"
lista_strings.remove("Rodrigo")

# %%
# Visualizando lista_strings após a remoção
lista_strings

# %%
# O método remove() provoca um erro caso o elemento não exista
lista_strings.remove("Java")

# %% [markdown]
# #### 4.10 - reverse()

# %%
# Redefinindo os elementos de lista
lista = [1, 2, 3, 4, 5, 6]
# Visualizando a lista antes da chamada ao método reverse()
lista

# %%
# Invertendo os elementos da lista
lista.reverse()

# %%
# Visualizando a lista após chamada ao método reverse()
lista

# %% [markdown]
# #### 4.11 - sort()

# %%
# Redefinindo os elementos de lista
lista = [6, 3, 1, 4, 2, 5]
# Visualizando a lista antes da chamada ao método sort()
lista

# %%
# Ordenando os elementos em ordem crescente
lista.sort()

# %%
# Visualizando a lista após chamada ao método sort()
lista

# %%
# Redefinindo os elementos de lista
lista = [6, 3, 1, 4, 2, 5]
# Visualizando a lista antes da chamada ao método sort()
lista

# %%
# Ordenando os elementos em ordem decrescente
lista.sort(reverse=True)

# %%
# Visualizando a lista após chamada ao método sort()
lista

# %%
# Ordenando lista de caracteres
lista_letras = ["Q", "W", "E", "R", "T", "Y", "A", "S", "D"]
lista_letras.sort()
lista_letras

# %%
# Ordenando lista de strings
lista_strings = ["GHI", "XYZ", "DEF", "ABC", "KLM"]
lista_strings.sort()
lista_strings

# %%
# Não é possível ordenar uma lista com elementos de diferentes tipos
lista_misturada = [2, "ABC", 3.14]
lista_misturada.sort()
lista_misturada

# %% [markdown]
# ### 5. Funções aplicáveis a uma lista
#
# Função | Descrição | Exemplo
# :----- | :-------- | :------
# len | Retorna a quantidade de elementos de uma lista | `print(len(lista))`
# max  | Retorna o maior elemento de uma lista | `maior = max(lista)`
# min | Retorna o menor elemento de uma lista | `menor = min(lista)`
# sum | Retorna o somatório dos elementos de uma lista | `soma = sum(lista)`

# %%
# Redefinindo os elementos de lista e lista_letras
lista = [8, 3, 21, 14, 2, 45]
lista_letras = ["Q", "W", "E", "R", "T", "Y", "A", "S", "D"]

# %%
# A função len() retorna a quantidade de elementos de uma lista
len(lista)

# %%
# A função max() retorna o maior elemento de uma lista
max(lista)

# %%
max(lista_letras)

# %%
# A função min() retorna o menor elemento de uma lista
min(lista)

# %%
min(lista_letras)

# %%
# A função sum() retorna a soma dos elementos de uma lista numérica
sum(lista)

extension: py


text:
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package csv_test

import (
	"fmt"
	"os"
	"strings"
	"time"

	"github.com/atotto/encoding/csv"
)

func ExampleWriter() {

	type Person struct {
		Name       string
		Age        int
		Height     float32
		Weight     float64
		CreateTime time.Time
	}

	member := []Person{
		{"Gopher", 2, 12.3, 34.5, time.Date(2020, 1, 1, 12, 20, 2, 0, time.UTC)},
		{"Ghost", 4, 12.3, 0.000034, time.Date(2020, 2, 3, 15, 20, 2, 0, time.UTC)},
	}

	w := csv.NewWriter(os.Stdout)
	w.SetTimeLocation(time.UTC)
	w.WriteStructAll(member)

	// Output:
	// Gopher,2,12.3,34.5,2020-01-01 12:20:02
	// Ghost,4,12.3,3.4e-05,2020-02-03 15:20:02
}

func ExampleReader() {

	csvtext := "Gopher,2,12.3,34.5,2020/01/01 12:20:02\nGhost,4,12.3,3.4e-05,2020/02/03 15:20:02"

	type Person struct {
		Name       string
		Age        int
		Height     float32
		Weight     float64
		CreateTime time.Time
	}

	var person = []Person{}

	r := csv.NewReader(strings.NewReader(csvtext))
	r.SetTimeFormat("2006/01/02 15:04:05")
	r.SetTimeLocation(time.UTC)
	err := r.ReadStructAll(&person)
	if err != nil {
		return
	}

	fmt.Printf("%v", person)

	// Output:
	// [{Gopher 2 12.3 34.5 2020-01-01 12:20:02 +0000 UTC} {Ghost 4 12.3 3.4e-05 2020-02-03 15:20:02 +0000 UTC}]
}

repository: atotto/encoding

repo_name: atotto/encoding


text:
package marketing

import (
	"encoding/json"
	"fmt"

	"github.com/duffiye/wechat/wechatpay/common"

	"github.com/duffiye/wechat/wechatpay/context"
)

type Marketing struct {
	*context.Context
}

func NewMarketing(ctx *context.Context) *Marketing {

	return &Marketing{ctx}
}

type FavorCallbacksRequest struct {
	common.Header
	MchID     string `json:"mchid"`
	NotifyURL string `json:"notify_url"`
	Switch    bool   `json:"switch"`
}

type FavorCallbacksResult struct {
	UpdateTime string `json:"update_time"`
	NotifyURL  string `json:"notify_url"`
}

func (m *Marketing) FavorCallbacks(request FavorCallbacksRequest) (result FavorCallbacksResult, err error) {
	var method string = "POST"
	var url string = "/test"
	requestBody, _ := json.Marshal(request)
	authorization, err := m.GetAuthorization(method, url, request.Timestamp, request.NonceStr, requestBody)
	if err != nil {
		return result, fmt.Errorf("获取Authorization信息失败,%v", err)
	}
	fmt.Println(authorization)
	return
}

repository: duffiye/wechat

repo_name: duffiye/wechat


text:
/**
 * Copyright 2015 Batis Degryll Ludo
 * @file ZBNoidTitleBuilder.h
 * @since 2017-12-08
 * @date 2017-12-08
 * @author Degryll Ludo Batis
 * @brief Defines a daemon that ends the game if the number of lifes reaches 0 in zombienoid game.
 */

#ifndef ZBE_MAIN_ZOMBIENOID_DAEMONS_ZBNOIDTITLEBUILDER_H
#define ZBE_MAIN_ZOMBIENOID_DAEMONS_ZBNOIDTITLEBUILDER_H

#include <memory>
#include <cstdint>

#include "ZBNoid.h"

#include "ZBE/core/daemons/Daemon.h"

#include "ZBE/core/events/generators/InputEventGenerator.h"

namespace zombienoid {

  /** \brief Defines a daemon that ends the game if the number of lifes reaches 0 in zombienoid game.
   */
  class ZBNoidTitleBuilder {
    public:

      ZBNoidTitleBuilder(const ZBNoidTitleBuilder&) = delete;
      void operator=(const ZBNoidTitleBuilder&) = delete;

      ZBNoidTitleBuilder(std::shared_ptr<RsrcIDDictionary> rsrcIDDic, std::shared_ptr<zbe::SDLWindow> window, std::shared_ptr<zbe::InputBuffer> inputBuffer) : rsrcIDDic(rsrcIDDic), window(window), inputBuffer(inputBuffer) {}

      ~ZBNoidTitleBuilder(){}

      /** \brief It will finish the game if the number of lifes reaches 0
       */
      std::shared_ptr<zbe::Daemon> build();

    private:
      std::shared_ptr<RsrcIDDictionary> rsrcIDDic;
      std::shared_ptr<zbe::SDLWindow> window;
      std::shared_ptr<zbe::InputBuffer> inputBuffer;
  };

}  // namespace zombienoid

#endif // ZBE_MAIN_ZOMBIENOID_DAEMONS_ZBNOIDTITLEBUILDER_H

repository: Degryll/ZBE

repo_name: Degryll/ZBE

gha_language: C

extension: h


text:
package web

import (
	"fmt"
	"html"
	"io"
	"net/http"

	"github.com/go-martini/martini"
	"github.com/martini-contrib/auth"
	"github.com/martini-contrib/render"
	"github.com/martini-contrib/secure"
	"github.com/prometheus/client_golang/prometheus"
	log "github.com/sirupsen/logrus"
	"github.com/tyler-sommer/stick"
)

var requestCounter = prometheus.NewCounterVec(prometheus.CounterOpts{
	Name: "http_requests_total",
	Help: "Total web request count.",
}, []string{"proto", "method", "url"})

func init() {
	prometheus.MustRegister(requestCounter)
}

type generatedTemplate func(env *stick.Env, output io.Writer, ctx map[string]stick.Value)

type generatedEnv struct {
	*stick.Env
	mapping map[string]generatedTemplate
}

func (env *generatedEnv) Execute(tpl string, out io.Writer, ctx map[string]stick.Value) error {
	if fn, ok := env.mapping[tpl]; ok {
		fn(env.Env, out, ctx)
		return nil
	}
	return env.Env.Execute(tpl, out, ctx)
}

type StickHandler struct {
	env *generatedEnv
	res http.ResponseWriter
}

func (h *StickHandler) HTML(status int, name string, ctx map[string]stick.Value) {
	h.res.WriteHeader(200)
	err := h.env.Execute(name, h.res, ctx)
	if err != nil {
		fmt.Println(err)
	}
}

func newStickHandler() martini.Handler {
	env := stick.New(newTemplateLoader())
	env.Functions["escape"] = func(ctx stick.Context, args ...stick.Value) stick.Value {
		if len(args) < 1 {
			return nil
		}
		return html.EscapeString(stick.CoerceString(args[0]))
	}
	genv := &generatedEnv{env, templateMapping}
	return func(res http.ResponseWriter, req *http.Request, c martini.Context) {
		c.Map(&StickHandler{genv, res})
	}
}

func counterHandler(req *http.Request) {
	proto := "http"
	if req.TLS != nil {
		proto = "https"
	}
	requestCounter.With(prometheus.Labels{"proto": proto, "method": req.Method, "url": req.URL.Path}).Add(1)
}

func (s *Server) Configure() {
	s.Handlers(
		counterHandler,
		newStaticHandler(),
		newStickHandler(),
		render.Renderer(),
		secure.Secure(secure.Options{
			BrowserXssFilter: true,
			FrameDeny:        true,
			SSLRedirect:      s.conf.RequireHTTPS,
			SSLHost:          s.conf.SSLHostPort,
			DisableProdCheck: true,
		}),
	)
	s.NotFound(func(req *http.Request, r render.Render, l log.FieldLogger) {
		r.Error(404)
	})

	if s.conf.HTTPAuth && len(s.conf.AuthUsername) > 0 && len(s.conf.AuthPassword) > 0 {
		s.Use(auth.Basic(s.conf.AuthUsername, s.conf.AuthPassword))
	}

	err := Configure(s)
	if err != nil {
		s.l.Errorln(err)
	}
}


text:
//------------------------------------------------------------
// Game Framework
// Copyright © 2013-2021 Jiang Yin. All rights reserved.
// Homepage: https://gameframework.cn/
// Feedback: mailto:ellan@gameframework.cn
//------------------------------------------------------------

using GameFramework;
using GameFramework.DataTable;
using GameFramework.Event;
using System.Collections.Generic;
using UnityEngine;
using UnityGameFramework.Runtime;

namespace StarForce
{
    public class SurvivalGame : GameBase
    {
        private float m_ElapseSeconds = 0f;
        private OrderExcuer excuer;
        private OutPutBox outPutBox;
        private int mainFormId = 0;
        private DRStage curStageInfo = null;

        private List<Box> InputBoxs = new List<Box>();
        private string[] inputSplits;
        public override GameMode GameMode
        {
            get
            {
                return GameMode.Survival;
            }
        }
        override
        public void Initialize() {

            GameEntry.Event.Subscribe(ShowEntitySuccessEventArgs.EventId, OnShowEntitySuccess);
            mainFormId = GameEntry.UI.OpenUIForm("Assets/GameMain/UI/UIForms/MainForm.prefab", "Default");
            GameEntry.Entity.ShowRobot();
            GameEntry.Entity.ShowOutPutBox();

            int stage = 1;
            IDataTable<DRStage> dtStage = GameEntry.DataTable.GetDataTable<DRStage>();
            curStageInfo = dtStage.GetDataRow(stage);

            //生成对应箱子    设置答案
            inputSplits = GameEntry.Entity.ShowBox(curStageInfo.Input);
        }

        protected override void OnShowEntitySuccess(object sender, GameEventArgs e) {
            ShowEntitySuccessEventArgs ne = (ShowEntitySuccessEventArgs)e;
            if (ne.EntityLogicType == typeof(OutPutBox)) {
                outPutBox = (OutPutBox)ne.Entity.Logic;
                outPutBox.SetInfo(curStageInfo.OutPut, mainFormId);
            } else if (ne.EntityLogicType == typeof(OrderExcuer)) {
                var temp = (OrderExcuer)ne.Entity.Logic;
                excuer = temp;
                excuer.mainFormId = mainFormId;
            } else if (ne.EntityLogicType == typeof(Box)) {
                InputBoxs.Add((Box)ne.Entity.Logic);
                if (InputBoxs.Count == inputSplits.Length) {
                    float posx = ne.Entity.gameObject.transform.position.x;
                    Log.Info("size = " + inputSplits.Length);
                    for(int i = 0; i < InputBoxs.Count; i++){
                        InputBoxs[i].boxPram = inputSplits[i];
                        InputBoxs[i].gameObject.transform.position = new Vector3(posx, i, -1);
                    }
                }
            }
        }

        protected override void OnShowEntityFailure(object sender, GameEventArgs e) {
            base.OnShowEntityFailure(sender, e);
        }
        public override void Reset() {
            var inputPos = GameObject.Find("PointInput").transform.position;
            var boxs = GameEntry.Entity.GetEntityGroup("Box");
            var allbox = boxs.GetAllEntities();
            foreach (var box in allbox) {
                var entity = GameEntry.Entity.GetEntity(box.Id);
                entity.gameObject.transform.position = inputPos;
                entity.gameObject.GetComponent<Rigidbody2D>().velocity = Vector3.zero;
            }
            Debug.Log("ResetBoxs");
            excuer.gameObject.transform.position = Vector3.zero;
            outPutBox.outPuts.Clear();
        }

        public override void StartExcute() {
            excuer.GetComponent<OrderExcuer>().StartExcute(outPutBox);
        }

        public override void Update(float elapseSeconds, float realElapseSeconds)
        {
            base.Update(elapseSeconds, realElapseSeconds);
        }
    }
}

repository: dosusang/Dosu-StarForce

repo_name: dosusang/Dosu-StarForce