Migrate to zola ...after the incident of losing over 30 commits worth of work over several days by forgetting to exclude the `.git` directory and not having pushed, it's now done. Hopefully. I'm still kind of mad. Zola's nice though.
@@ -1,492 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="640" - height="480" - viewBox="0 0 169.33333 127" - version="1.1" - id="svg8" - inkscape:version="0.92.2 2405546, 2018-03-11" - sodipodi:docname="awaitkwd1.svg"> - <defs - id="defs2"> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker2498" - style="overflow:visible;" - inkscape:isstock="true"> - <path - id="path2496" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker2434" - style="overflow:visible;" - inkscape:isstock="true"> - <path - id="path2432" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker2376" - style="overflow:visible;" - inkscape:isstock="true"> - <path - id="path2374" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:isstock="true" - style="overflow:visible;" - id="marker2306" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Lend" - inkscape:collect="always"> - <path - transform="scale(0.8) rotate(180) translate(12.5,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path2304" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker2035" - style="overflow:visible;" - inkscape:isstock="true" - inkscape:collect="always"> - <path - id="path2033" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:isstock="true" - style="overflow:visible;" - id="marker1920" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Lend"> - <path - transform="scale(0.8) rotate(180) translate(12.5,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path1918" /> - </marker> - <marker - inkscape:isstock="true" - style="overflow:visible;" - id="marker1441" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Lend" - inkscape:collect="always"> - <path - transform="scale(0.8) rotate(180) translate(12.5,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path1439" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker1399" - style="overflow:visible;" - inkscape:isstock="true" - inkscape:collect="always"> - <path - id="path1397" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:isstock="true" - style="overflow:visible;" - id="marker1363" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Lend" - inkscape:collect="always"> - <path - transform="scale(0.8) rotate(180) translate(12.5,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path1361" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="Arrow1Lend" - style="overflow:visible;" - inkscape:isstock="true" - inkscape:collect="always"> - <path - id="path1074" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - </defs> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="0.98994949" - inkscape:cx="180.99756" - inkscape:cy="228.4128" - inkscape:document-units="mm" - inkscape:current-layer="layer1" - showgrid="false" - units="px" - inkscape:window-width="1366" - inkscape:window-height="739" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" /> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-169.99997)"> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="8.8198938" - y="183.27678" - id="text831"><tspan - sodipodi:role="line" - id="tspan829" - x="8.8198938" - y="192.64055" - style="stroke-width:0.26458332" /></text> - <g - id="g929" - transform="translate(-3.8334857,-1.0690781)"> - <rect - y="173.66089" - x="99.108299" - height="59.932461" - width="71.760002" - id="rect812" - style="opacity:1;fill:#d6ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17683256;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - y="175.69913" - x="101.14654" - height="9.8860025" - width="39.184521" - id="rect827" - style="opacity:1;fill:#d8ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17793897;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <text - id="text835" - y="183.15857" - x="102.76424" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.11755896px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.17793897" - xml:space="preserve"><tspan - style="stroke-width:0.17793897" - y="183.15857" - x="102.76424" - id="tspan833" - sodipodi:role="line">method 1</tspan></text> - <text - id="text848" - y="190.75735" - x="101.92492" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.51081705px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.11277042" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="190.75735" - x="101.92492" - id="tspan846" - sodipodi:role="line">async def m1():</tspan><tspan - id="tspan850" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="196.39587" - x="101.92492" - sodipodi:role="line"> prepare request</tspan><tspan - id="tspan852" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="202.03439" - x="101.92492" - sodipodi:role="line"> await send request</tspan><tspan - id="tspan854" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="207.67291" - x="101.92492" - sodipodi:role="line" /><tspan - id="tspan856" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="213.31145" - x="101.92492" - sodipodi:role="line"> await receive request</tspan><tspan - id="tspan860" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="218.94997" - x="101.92492" - sodipodi:role="line" /><tspan - id="tspan858" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="224.58849" - x="101.92492" - sodipodi:role="line"> process request</tspan><tspan - id="tspan862" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="230.22701" - x="101.92492" - sodipodi:role="line"> return result</tspan></text> - </g> - <g - transform="translate(-3.8334857,60.867907)" - id="g957"> - <rect - style="opacity:1;fill:#d6ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17683256;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect931" - width="71.760002" - height="59.932461" - x="99.108299" - y="173.66089" /> - <rect - style="opacity:1;fill:#d8ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17793897;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect933" - width="39.184521" - height="9.8860025" - x="101.14654" - y="175.69913" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.11755896px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.17793897" - x="102.76424" - y="183.15857" - id="text937"><tspan - sodipodi:role="line" - id="tspan935" - x="102.76424" - y="183.15857" - style="stroke-width:0.17793897">method 2</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.51081705px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.11277042" - x="101.92492" - y="190.75735" - id="text955"><tspan - sodipodi:role="line" - id="tspan939" - x="101.92492" - y="190.75735" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042">async def m2():</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="196.39587" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan941"> prepare parameters</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="202.03439" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan943"> await send query</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="207.67291" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan945" /><tspan - sodipodi:role="line" - x="101.92492" - y="213.31145" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan947"> await receive answer</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="218.94997" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan949" /><tspan - sodipodi:role="line" - x="101.92492" - y="224.58849" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan951"> process answer</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="230.22701" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan953"> return result</tspan></text> - </g> - <rect - style="opacity:1;fill:#faffb5;fill-opacity:1;stroke:#000000;stroke-width:0.26830563;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect959" - width="87.068367" - height="121.70461" - x="2.6476943" - y="172.26968" /> - <rect - y="174.00694" - x="3.9172246" - height="9.8860025" - width="39.184525" - id="rect963" - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.17793897;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <text - id="text967" - y="180.99866" - x="4.7331147" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.11755896px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.17793897" - xml:space="preserve"><tspan - style="stroke-width:0.17793897" - y="180.99866" - x="4.7331147" - id="tspan965" - sodipodi:role="line">event loop</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.54473734px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.16361843" - x="6.6373014" - y="190.92131" - id="text1043"><tspan - sodipodi:role="line" - id="tspan1041" - x="6.6373014" - y="190.92131" - style="stroke-width:0.16361843">no events</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="199.10223" - style="stroke-width:0.16361843" - id="tspan1045">enter m1</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="207.28316" - style="stroke-width:0.16361843" - id="tspan1047">pause m1</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="215.46408" - style="stroke-width:0.16361843" - id="tspan1049">enter m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="223.645" - style="stroke-width:0.16361843" - id="tspan1051">pause m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="231.82591" - style="stroke-width:0.16361843" - id="tspan1053">check events</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="240.00684" - style="stroke-width:0.16361843" - id="tspan1055">resume m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="248.18776" - style="stroke-width:0.16361843" - id="tspan1057">pause m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="256.36868" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1059">check events</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="264.54959" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1061">resume m1</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="272.73053" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1063">pause m1</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="280.91144" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1065">resume m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="289.09238" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1067">...</tspan></text> - <path - style="fill:none;stroke:#000000;stroke-width:0.265;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#Arrow1Lend)" - d="m 39.288619,196.50663 65.748301,-3.20724" - id="path1069" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker1363)" - d="M 106.96726,199.48211 42.144344,204.3958" - id="path1353" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker1399)" - d="m 39.309524,212.71128 64.391056,42.32737" - id="path1389" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker1441)" - d="M 105.54985,260.99774 43.832203,220.82815" - id="path1431" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker2035)" - d="m 46.113094,237.65771 58.397326,28.5372" - id="path2288" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker2306)" - d="M 106.02232,272.43152 44.60119,245.78419" - id="path2290" - inkscape:connector-curvature="0" /> - </g> -</svg>
@@ -1,507 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="640" - height="480" - viewBox="0 0 169.33333 127" - version="1.1" - id="svg8" - inkscape:version="0.92.2 2405546, 2018-03-11" - sodipodi:docname="awaitkwd2.svg"> - <defs - id="defs2"> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker2498" - style="overflow:visible;" - inkscape:isstock="true"> - <path - id="path2496" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker2434" - style="overflow:visible;" - inkscape:isstock="true"> - <path - id="path2432" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker2376" - style="overflow:visible;" - inkscape:isstock="true"> - <path - id="path2374" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:isstock="true" - style="overflow:visible;" - id="marker2306" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Lend" - inkscape:collect="always"> - <path - transform="scale(0.8) rotate(180) translate(12.5,0)" - style="fill-rule:evenodd;stroke:#7f7f7f;stroke-width:1pt;stroke-opacity:1;fill:#7f7f7f;fill-opacity:1" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path2304" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker2035" - style="overflow:visible;" - inkscape:isstock="true" - inkscape:collect="always"> - <path - id="path2033" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#7f7f7f;stroke-width:1pt;stroke-opacity:1;fill:#7f7f7f;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:isstock="true" - style="overflow:visible;" - id="marker1920" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Lend"> - <path - transform="scale(0.8) rotate(180) translate(12.5,0)" - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path1918" /> - </marker> - <marker - inkscape:isstock="true" - style="overflow:visible;" - id="marker1441" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Lend" - inkscape:collect="always"> - <path - transform="scale(0.8) rotate(180) translate(12.5,0)" - style="fill-rule:evenodd;stroke:#7f7f7f;stroke-width:1pt;stroke-opacity:1;fill:#7f7f7f;fill-opacity:1" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path1439" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="marker1399" - style="overflow:visible;" - inkscape:isstock="true" - inkscape:collect="always"> - <path - id="path1397" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#7f7f7f;stroke-width:1pt;stroke-opacity:1;fill:#7f7f7f;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - <marker - inkscape:isstock="true" - style="overflow:visible;" - id="marker1363" - refX="0.0" - refY="0.0" - orient="auto" - inkscape:stockid="Arrow1Lend" - inkscape:collect="always"> - <path - transform="scale(0.8) rotate(180) translate(12.5,0)" - style="fill-rule:evenodd;stroke:#7f7f7f;stroke-width:1pt;stroke-opacity:1;fill:#7f7f7f;fill-opacity:1" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - id="path1361" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="Arrow1Lend" - style="overflow:visible;" - inkscape:isstock="true" - inkscape:collect="always"> - <path - id="path1074" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#7f7f7f;stroke-width:1pt;stroke-opacity:1;fill:#7f7f7f;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - </defs> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="0.98994949" - inkscape:cx="172.66711" - inkscape:cy="250.50475" - inkscape:document-units="mm" - inkscape:current-layer="layer1" - showgrid="false" - units="px" - inkscape:window-width="1366" - inkscape:window-height="739" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" /> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-169.99997)"> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.58333302px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="8.8198938" - y="183.27678" - id="text831"><tspan - sodipodi:role="line" - id="tspan829" - x="8.8198938" - y="192.64055" - style="stroke-width:0.26458332" /></text> - <g - id="g929" - transform="translate(-3.8334857,-1.0690781)"> - <rect - y="173.66089" - x="99.108299" - height="59.932461" - width="71.760002" - id="rect812" - style="opacity:1;fill:#d6ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17683256;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - y="175.69913" - x="101.14654" - height="9.8860025" - width="39.184521" - id="rect827" - style="opacity:1;fill:#d8ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17793897;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <text - id="text835" - y="183.15857" - x="102.76424" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.11755896px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.17793897" - xml:space="preserve"><tspan - style="stroke-width:0.17793897" - y="183.15857" - x="102.76424" - id="tspan833" - sodipodi:role="line">method 1</tspan></text> - <text - id="text848" - y="190.75735" - x="101.92492" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.51081705px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.11277042" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="190.75735" - x="101.92492" - id="tspan846" - sodipodi:role="line">async def m1():</tspan><tspan - id="tspan850" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="196.39587" - x="101.92492" - sodipodi:role="line"> prepare request</tspan><tspan - id="tspan852" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="202.03439" - x="101.92492" - sodipodi:role="line"> await send request</tspan><tspan - id="tspan854" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="207.67291" - x="101.92492" - sodipodi:role="line" /><tspan - id="tspan856" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="213.31145" - x="101.92492" - sodipodi:role="line"> await receive request</tspan><tspan - id="tspan860" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="218.94997" - x="101.92492" - sodipodi:role="line" /><tspan - id="tspan858" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="224.58849" - x="101.92492" - sodipodi:role="line"> process request</tspan><tspan - id="tspan862" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - y="230.22701" - x="101.92492" - sodipodi:role="line"> return result</tspan></text> - </g> - <g - transform="translate(-3.8334857,60.867907)" - id="g957"> - <rect - style="opacity:1;fill:#d6ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17683256;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect931" - width="71.760002" - height="59.932461" - x="99.108299" - y="173.66089" /> - <rect - style="opacity:1;fill:#d8ffff;fill-opacity:1;stroke:#000000;stroke-width:0.17793897;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect933" - width="39.184521" - height="9.8860025" - x="101.14654" - y="175.69913" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.11755896px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.17793897" - x="102.76424" - y="183.15857" - id="text937"><tspan - sodipodi:role="line" - id="tspan935" - x="102.76424" - y="183.15857" - style="stroke-width:0.17793897">method 2</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.51081705px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.11277042" - x="101.92492" - y="190.75735" - id="text955"><tspan - sodipodi:role="line" - id="tspan939" - x="101.92492" - y="190.75735" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042">async def m2():</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="196.39587" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan941"> prepare parameters</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="202.03439" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan943"> await send query</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="207.67291" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan945" /><tspan - sodipodi:role="line" - x="101.92492" - y="213.31145" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan947"> await receive answer</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="218.94997" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan949" /><tspan - sodipodi:role="line" - x="101.92492" - y="224.58849" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan951"> process answer</tspan><tspan - sodipodi:role="line" - x="101.92492" - y="230.22701" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.11277042" - id="tspan953"> return result</tspan></text> - </g> - <rect - style="opacity:1;fill:#faffb5;fill-opacity:1;stroke:#000000;stroke-width:0.26830563;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect959" - width="87.068367" - height="121.70461" - x="2.6476943" - y="172.26968" /> - <rect - y="174.00694" - x="3.9172246" - height="9.8860025" - width="39.184525" - id="rect963" - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.17793897;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <text - id="text967" - y="180.99866" - x="4.7331147" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:7.11755896px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.17793897" - xml:space="preserve"><tspan - style="stroke-width:0.17793897" - y="180.99866" - x="4.7331147" - id="tspan965" - sodipodi:role="line">event loop</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:6.54473734px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.16361843" - x="6.6373014" - y="190.92131" - id="text1043"><tspan - sodipodi:role="line" - id="tspan1041" - x="6.6373014" - y="190.92131" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1">no events</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="199.10223" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1045">enter m1</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="207.28316" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1047">pause m1</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="215.46408" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1049">enter m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="223.645" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1051">pause m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="231.82591" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1053">check events</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="240.00684" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1055">resume m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="248.18776" - style="stroke-width:0.16361843;fill:#7f7f7f;fill-opacity:1" - id="tspan1057">pause m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="256.36868" - style="stroke-width:0.16361843" - id="tspan1059">check events</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="264.54959" - style="stroke-width:0.16361843" - id="tspan1061">resume m1</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="272.73053" - style="stroke-width:0.16361843" - id="tspan1063">pause m1</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="280.91144" - style="stroke-width:0.16361843" - id="tspan1065">resume m2</tspan><tspan - sodipodi:role="line" - x="6.6373014" - y="289.09238" - style="stroke-width:0.16361843" - id="tspan1067">...</tspan></text> - <path - style="fill:none;stroke:#7f7f7f;stroke-width:0.265;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#Arrow1Lend)" - d="m 39.288619,196.50663 65.748301,-3.20724" - id="path1069" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#7f7f7f;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker1363)" - d="M 106.96726,199.48211 42.144344,204.3958" - id="path1353" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#7f7f7f;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker1399)" - d="m 39.309524,212.71128 64.391056,42.32737" - id="path1389" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#7f7f7f;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker1441)" - d="M 105.54985,260.99774 43.832203,220.82815" - id="path1431" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#7f7f7f;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker2035)" - d="m 46.113094,237.65771 58.397326,28.5372" - id="path2288" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#7f7f7f;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker2306)" - d="M 106.02232,272.43152 44.60119,245.78419" - id="path2290" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker2434)" - d="M 48.758927,261.47021 105.45536,205.52973" - id="path2362" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker2376)" - d="M 106.21131,213.65622 42.900298,270.35265" - id="path2364" - inkscape:connector-curvature="0" /> - <path - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker2498)" - d="m 46.302083,277.91217 58.586307,0.37798" - id="path2366" - inkscape:connector-curvature="0" /> - </g> -</svg>
@@ -1,166 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="640" - height="480" - viewBox="0 0 169.33333 127" - version="1.1" - id="svg8" - inkscape:version="0.92.2 2405546, 2018-03-11" - sodipodi:docname="eventloop.svg"> - <defs - id="defs2"> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0.0" - refX="0.0" - id="Arrow1Lend" - style="overflow:visible;" - inkscape:isstock="true"> - <path - id="path855" - d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " - style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1" - transform="scale(0.8) rotate(180) translate(12.5,0)" /> - </marker> - </defs> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="0.7" - inkscape:cx="316.89692" - inkscape:cy="221.88288" - inkscape:document-units="mm" - inkscape:current-layer="layer1" - showgrid="false" - units="px" - inkscape:window-width="1366" - inkscape:window-height="739" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" - showguides="true" /> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-169.99995)"> - <rect - style="opacity:1;fill:#ffffc3;fill-opacity:1;stroke:#000000;stroke-width:0.25628251;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect834" - width="163.12053" - height="66.714058" - x="3.1063988" - y="172.44116" /> - <rect - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.25628251;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" - id="rect836" - width="72.491341" - height="14.827774" - x="5.7682643" - y="176.38446" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.25129986px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.25628251" - x="12.724504" - y="186.4527" - id="text840"><tspan - sodipodi:role="line" - id="tspan838" - x="12.724504" - y="186.4527" - style="stroke-width:0.25628251">event loop</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:8.77740383px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.21943507" - x="18.673456" - y="204.51938" - id="text844"><tspan - sodipodi:role="line" - id="tspan842" - x="18.673456" - y="204.51938" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.21943507">while running:</tspan><tspan - sodipodi:role="line" - x="18.673456" - y="215.49113" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.21943507" - id="tspan846"> process events</tspan><tspan - sodipodi:role="line" - x="18.673456" - y="226.46289" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.21943507" - id="tspan848"> call user_function()</tspan></text> - <path - style="fill:none;stroke:#000000;stroke-width:0.25628251px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" - d="m 24.661439,211.12809 v 23.81738 H 150.99704 V 187.8285 H 86.793703 v 5.17769" - id="path850" - inkscape:connector-curvature="0" /> - <rect - y="243.02905" - x="3.1063988" - height="51.462708" - width="163.12053" - id="rect1134" - style="opacity:1;fill:#daffff;fill-opacity:1;stroke:#000000;stroke-width:0.25004876;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <rect - y="248.85146" - x="5.7682643" - height="14.827774" - width="72.491341" - id="rect1136" - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.25628251;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" /> - <text - id="text1140" - y="258.91971" - x="12.724504" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10.25129986px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.25628251" - xml:space="preserve"><tspan - style="stroke-width:0.25628251" - y="258.91971" - x="12.724504" - id="tspan1138" - sodipodi:role="line">your code</tspan></text> - <text - id="text1148" - y="275.38342" - x="14.646159" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:8.77740383px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.21943507" - xml:space="preserve"><tspan - id="tspan1146" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.21943507" - y="275.38342" - x="14.646159" - sodipodi:role="line">async def user_function():</tspan><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:monospace;-inkscape-font-specification:monospace;stroke-width:0.21943507" - y="286.35516" - x="14.646159" - sodipodi:role="line" - id="tspan1155"> ... # some code</tspan></text> - </g> -</svg>
@@ -1,365 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>An Introduction to Asyncio</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="an_introduction_to_asyncio"><a class="anchor" href="#an_introduction_to_asyncio">¶</a>An Introduction to Asyncio</h1> -<div class="date-created-modified">Created 2018-06-13<br> -Modified 2020-10-03</div> -<h2 id="index"><a class="anchor" href="#index">¶</a>Index</h2> -<ul> -<li><a href="#background">Background</a></li> -<li><a href="#input_output">Input / Output</a></li> -<li><a href="#diving_in">Diving In</a></li> -<li><a href="#a_toy_example">A Toy Example</a></li> -<li><a href="#a_real_example">A Real Example</a></li> -<li><a href="#extra_material">Extra Material</a></li> -</ul> -<h2 id="background"><a class="anchor" href="#background">¶</a>Background</h2> -<p>After seeing some friends struggle with <code>asyncio</code> I decided that it could be a good idea to write a blog post using my own words to explain how I understand the world of asynchronous IO. I will focus on Python's <code>asyncio</code> module but this post should apply to any other language easily.</p> -<p>So what is <code>asyncio</code> and what makes it good? Why don't we just use the old and known threads to run several parts of the code concurrently, at the same time?</p> -<p>The first reason is that <code>asyncio</code> makes your code easier to reason about, as opposed to using threads, because the amount of ways in which your code can run grows exponentially. Let's see that with an example. Imagine you have this code:</p> -<pre><code class="language-python">def method(): - line 1 - line 2 - line 3 - line 4 - line 5 -</code></pre> -<p>And you start two threads to run the method at the same time. What is the order in which the lines of code get executed? The answer is that you can't know! The first thread can run the entire method before the second thread even starts. Or it could be the first thread that runs after the second thread. Perhaps both run the "line 1", and then the line 2. Maybe the first thread runs lines 1 and 2, and then the second thread only runs the line 1 before the first thread finishes.</p> -<p>As you can see, any combination of the order in which the lines run is possible. If the lines modify some global shared state, that will get messy quickly.</p> -<p>Second, in Python, threads <em>won't</em> make your code faster most of the time. It will only increase the concurrency of your program (which is okay if it makes many blocking calls), allowing you to run several things at the same time.</p> -<p>If you have a lot of CPU work to do though, threads aren't a real advantage. Indeed, your code will probably run slower under the most common Python implementation, CPython, which makes use of a Global Interpreter Lock (GIL) that only lets a thread run at once. The operations won't run in parallel!</p> -<h2 id="input_output"><a class="anchor" href="#input_output">¶</a>Input / Output</h2> -<p>Before we go any further, let's first stop to talk about input and output, commonly known as "IO". There are two main ways to perform IO operations, such as reading or writing from a file or a network socket.</p> -<p>The first one is known as "blocking IO". What this means is that, when you try performing IO, the current application thread is going to <em>block</em> until the Operative System can tell you it's done. Normally, this is not a problem, since disks are pretty fast anyway, but it can soon become a performance bottleneck. And network IO will be much slower than disk IO!</p> -<pre><code class="language-python">import socket - -# Setup a network socket and a very simple HTTP request. -# By default, sockets are open in blocking mode. -sock = socket.socket() -request = b'''HEAD / HTTP/1.0\r -Host: example.com\r -\r -''' - -# "connect" will block until a successful TCP connection -# is made to the host "example.com" on port 80. -sock.connect(('example.com', 80)) - -# "sendall" will repeatedly call "send" until all the data in "request" is -# sent to the host we just connected, which blocks until the data is sent. -sock.sendall(request) - -# "recv" will try to receive up to 1024 bytes from the host, and block until -# there is any data to receive (or empty if the host closes the connection). -response = sock.recv(1024) - -# After all those blocking calls, we got out data! These are the headers from -# making a HTTP request to example.com. -print(response.decode()) -</code></pre> -<p>Blocking IO offers timeouts, so that you can get control back in your code if the operation doesn't finish. Imagine that the remote host doesn't want to reply, your code would be stuck for as long as the connection remains alive!</p> -<p>But wait, what if we make the timeout small? Very, very small? If we do that, we will never block waiting for an answer. That's how asynchronous IO works, and it's the opposite of blocking IO (you can also call it non-blocking IO if you want to).</p> -<p>How does non-blocking IO work if the IO device needs a while to answer with the data? In that case, the operative system responds with "not ready", and your application gets control back so it can do other stuff while the IO device completes your request. It works a bit like this:</p> -<pre><code><app> Hey, I would like to read 16 bytes from this file -<OS> Okay, but the disk hasn't sent me the data yet -<app> Alright, I will do something else then -(a lot of computer time passes) -<app> Do you have my 16 bytes now? -<OS> Yes, here they are! "Hello, world !!\n" -</code></pre> -<p>In reality, you can tell the OS to notify you when the data is ready, as opposed to polling (constantly asking the OS whether the data is ready yet or not), which is more efficient.</p> -<p>But either way, that's the difference between blocking and non-blocking IO, and what matters is that your application gets to run more without ever needing to wait for data to arrive, because the data will be there immediately when you ask, and if it's not yet, your app can do more things meanwhile.</p> -<h2 id="diving_in"><a class="anchor" href="#diving_in">¶</a>Diving In</h2> -<p>Now we've seen what blocking and non-blocking IO is, and how threads make your code harder to reason about, but they give concurrency (yet not more speed). Is there any other way to achieve this concurrency that doesn't involve threads? Yes! The answer is <code>asyncio</code>.</p> -<p>So how does <code>asyncio</code> help? First we need to understand a very crucial concept before we can dive any deeper, and I'm talking about the <em>event loop</em>. What is it and why do we need it?</p> -<p>You can think of the event loop as a <em>loop</em> that will be responsible for calling your <code>async</code> functions:</p> -<div class="image-container"> -<img src="eventloop.svg" alt="The Event Loop" /> -<div class="image-caption"></div> -</div> -<p> -<p>That's silly you may think. Now not only we run our code but we also have to run some "event loop". It doesn't sound beneficial at all. What are these events? Well, they are the IO events we talked about before!</p> -<p><code>asyncio</code>'s event loop is responsible for handling those IO events, such as file is ready, data arrived, flushing is done, and so on. As we saw before, we can make these events non-blocking by setting their timeout to 0.</p> -<p>Let's say you want to read from 10 files at the same time. You will ask the OS to read data from 10 files, and at first none of the reads will be ready. But the event loop will be constantly asking the OS to know which are done, and when they are done, you will get your data.</p> -<p>This has some nice advantages. It means that, instead of waiting for a network request to send you a response or some file, instead of blocking there, the event loop can decide to run other code meanwhile. Whenever the contents are ready, they can be read, and your code can continue. Waiting for the contents to be received is done with the <code>await</code> keyword, and it tells the loop that it can run other code meanwhile:</p> -<div class="image-container"> -<img src="awaitkwd1.svg" alt="Step 1, await keyword" /> -<div class="image-caption"></div> -</div> -<p> -<div class="image-container"> -<img src="awaitkwd2.svg" alt="Step 2, await keyword" /> -<div class="image-caption"></div> -</div> -<p> -<p>Start reading the code of the event loop and follow the arrows. You can see that, in the beginning, there are no events yet, so the loop calls one of your functions. The code runs until it has to <code>await</code> for some IO operation to complete, such as sending a request over the network. The method is "paused" until an event occurs (for example, an "event" occurs when the request has been sent completely).</p> -<p>While the first method is busy, the event loop can enter the second method, and run its code until the first <code>await</code>. But it can happen that the event of the second query occurs before the request on the first method, so the event loop can re-enter the second method because it has already sent the query, but the first method isn't done sending the request yet.</p> -<p>Then, the second method <code>await</code>'s for an answer, and an event occurs telling the event loop that the request from the first method was sent. The code can be resumed again, until it has to <code>await</code> for a response, and so on. Here's an explanation with pseudo-code for this process if you prefer:</p> -<pre><code class="language-python">async def method(request): - prepare request - await send request - - await receive request - - process request - return result - -run in parallel ( - method with request 1, - method with request 2, -) -</code></pre> -<p>This is what the event loop will do on the above pseudo-code:</p> -<pre><code>no events pending, can advance - -enter method with request 1 - prepare request - await sending request -pause method with request 1 - -no events ready, can advance - -enter method with request 2 - prepare request - await sending request -pause method with request 2 - -both requests are paused, cannot advance -wait for events -event for request 2 arrives (sending request completed) - -enter method with request 2 - await receiving response -pause method with request 2 - -event for request 1 arrives (sending request completed) - -enter method with request 1 - await receiving response -pause method with request 1 - -...and so on -</code></pre> -<p>You may be wondering "okay, but threads work for me, so why should I change?". There are some important things to note here. The first is that we only need one thread to be running! The event loop decides when and which methods should run. This results in less pressure for the operating system. The second is that we know when it may run other methods. Those are the <code>await</code> keywords! Whenever there is one of those, we know that the loop is able to run other things until the resource (again, like network) becomes ready (when a event occurs telling us it's ready to be used without blocking or it has completed).</p> -<p>So far, we already have two advantages. We are only using a single thread so the cost for switching between methods is low, and we can easily reason about where our program may interleave operations.</p> -<p>Another advantage is that, with the event loop, you can easily schedule when a piece of code should run, such as using the method <a href="https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.call_at"><code>loop.call_at</code></a>, without the need for spawning another thread at all.</p> -<p>To tell the <code>asyncio</code> to run the two methods shown above, we can use <a href="https://docs.python.org/3/library/asyncio-future.html#asyncio.ensure_future"><code>asyncio.ensure_future</code></a>, which is a way of saying "I want the future of my method to be ensured". That is, you want to run your method in the future, whenever the loop is free to do so. This method returns a <code>Future</code> object, so if your method returns a value, you can <code>await</code> this future to retrieve its result.</p> -<p>What is a <code>Future</code>? This object represents the value of something that will be there in the future, but might not be there yet. Just like you can <code>await</code> your own <code>async def</code> functions, you can <code>await</code> these <code>Future</code>'s.</p> -<p>The <code>async def</code> functions are also called "coroutines", and Python does some magic behind the scenes to turn them into such. The coroutines can be <code>await</code>'ed, and this is what you normally do.</p> -<h2 id="a_toy_example"><a class="anchor" href="#a_toy_example">¶</a>A Toy Example</h2> -<p>That's all about <code>asyncio</code>! Let's wrap up with some example code. We will create a server that replies with the text a client sends, but reversed. First, we will show what you could write with normal synchronous code, and then we will port it.</p> -<p>Here is the <strong>synchronous version</strong>:</p> -<pre><code class="language-python"># server.py -import socket - - -def server_method(): - # create a new server socket to listen for connections - server = socket.socket() - - # bind to localhost:6789 for new connections - server.bind(('localhost', 6789)) - - # we will listen for one client at most - server.listen(1) - - # *block* waiting for a new client - client, _ = server.accept() - - # *block* waiting for some data - data = client.recv(1024) - - # reverse the data - data = data[::-1] - - # *block* sending the data - client.sendall(data) - - # close client and server - server.close() - client.close() - - -if __name__ == '__main__': - # block running the server - server_method() -</code></pre> -<pre><code class="language-python"># client.py -import socket - - -def client_method(): - message = b'Hello Server!\n' - client = socket.socket() - - # *block* trying to stabilish a connection - client.connect(('localhost', 6789)) - - # *block* trying to send the message - print('Sending', message) - client.sendall(message) - - # *block* until we receive a response - response = client.recv(1024) - print('Server replied', response) - - client.close() - - -if __name__ == '__main__': - client_method() -</code></pre> -<p>From what we've seen, this code will block on all the lines with a comment above them saying that they will block. This means that for running more than one client or server, or both in the same file, you will need threads. But we can do better, we can rewrite it into <code>asyncio</code>!</p> -<p>The first step is to mark all your <code>def</code>initions that may block with <code>async</code>. This marks them as coroutines, which can be <code>await</code>ed on.</p> -<p>Second, since we're using low-level sockets, we need to make use of the methods that <code>asyncio</code> provides directly. If this was a third-party library, this would be just like using their <code>async def</code>initions.</p> -<p>Here is the <strong>asynchronous version</strong>:</p> -<pre><code class="language-python"># server.py -import asyncio -import socket - -# get the default "event loop" that we will run -loop = asyncio.get_event_loop() - - -# notice our new "async" before the definition -async def server_method(): - server = socket.socket() - server.bind(('localhost', 6789)) - server.listen(1) - - # await for a new client - # the event loop can run other code while we wait here! - client, _ = await loop.sock_accept(server) - - # await for some data - data = await loop.sock_recv(client, 1024) - data = data[::-1] - - # await for sending the data - await loop.sock_sendall(client, data) - - server.close() - client.close() - - -if __name__ == '__main__': - # run the loop until "server method" is complete - loop.run_until_complete(server_method()) -</code></pre> -<pre><code class="language-python"># client.py -import asyncio -import socket - -loop = asyncio.get_event_loop() - - -async def client_method(): - message = b'Hello Server!\n' - client = socket.socket() - - # await to stabilish a connection - await loop.sock_connect(client, ('localhost', 6789)) - - # await to send the message - print('Sending', message) - await loop.sock_sendall(client, message) - - # await to receive a response - response = await loop.sock_recv(client, 1024) - print('Server replied', response) - - client.close() - - -if __name__ == '__main__': - loop.run_until_complete(client_method()) -</code></pre> -<p>That's it! You can place these two files separately and run, first the server, then the client. You should see output in the client.</p> -<p>The big difference here is that you can easily modify the code to run more than one server or clients at the same time. Whenever you <code>await</code> the event loop will run other of your code. It seems to "block" on the <code>await</code> parts, but remember it's actually jumping to run more code, and the event loop will get back to you whenever it can.</p> -<p>In short, you need an <code>async def</code> to <code>await</code> things, and you run them with the event loop instead of calling them directly. So this…</p> -<pre><code class="language-python">def main(): - ... # some code - - -if __name__ == '__main__': - main() -</code></pre> -<p>…becomes this:</p> -<pre><code class="language-python">import asyncio - - -async def main(): - ... # some code - - -if __name__ == '__main__': - asyncio.get_event_loop().run_until_complete(main) -</code></pre> -<p>This is pretty much how most of your <code>async</code> scripts will start, running the main method until its completion.</p> -<h2 id="a_real_example"><a class="anchor" href="#a_real_example">¶</a>A Real Example</h2> -<p>Let's have some fun with a real library. We'll be using <a href="https://github.com/LonamiWebs/Telethon">Telethon</a> to broadcast a message to our three best friends, all at the same time, thanks to the magic of <code>asyncio</code>. We'll dive right into the code, and then I'll explain our new friend <code>asyncio.wait(...)</code>:</p> -<pre><code class="language-python"># broadcast.py -import asyncio -import sys - -from telethon import TelegramClient - -# (you need your own values here, check Telethon's documentation) -api_id = 123 -api_hash = '123abc' -friends = [ - '@friend1__username', - '@friend2__username', - '@bestie__username' -] - -# we will have to await things, so we need an async def -async def main(message): - # start is a coroutine, so we need to await it to run it - client = await TelegramClient('me', api_id, api_hash).start() - - # wait for all three client.send_message to complete - await asyncio.wait([ - client.send_message(friend, message) - for friend in friends - ]) - - # and close our client - await client.disconnect() - - -if __name__ == '__main__': - if len(sys.argv) != 2: - print('You must pass the message to broadcast!') - quit() - - message = sys.argv[1] - asyncio.get_event_loop().run_until_complete(main(message)) -</code></pre> -<p>Wait… how did that send a message to all three of -my friends? The magic is done here:</p> -<pre><code class="language-python">[ - client.send_message(friend, message) - for friend in friends -] -</code></pre> -<p>This list comprehension creates another list with three -coroutines, the three <code>client.send_message(...)</code>. -Then we just pass that list to <code>asyncio.wait</code>:</p> -<pre><code class="language-python">await asyncio.wait([...]) -</code></pre> -<p>This method, by default, waits for the list of coroutines to run until they've all finished. You can read more on the Python <a href="https://docs.python.org/3/library/asyncio-task.html#asyncio.wait">documentation</a>. Truly a good function to know about!</p> -<p>Now whenever you have some important news for your friends, you can simply <code>python3 broadcast.py 'I bought a car!'</code> to tell all your friends about your new car! All you need to remember is that you need to <code>await</code> on coroutines, and you will be good. <code>asyncio</code> will warn you when you forget to do so.</p> -<h2 id="extra_material"><a class="anchor" href="#extra_material">¶</a>Extra Material</h2> -<p>If you want to understand how <code>asyncio</code> works under the hood, I recommend you to watch this hour-long talk <a href="https://youtu.be/M-UcUs7IMIM">Get to grips with asyncio in Python 3</a> by Robert Smallshire. In the video, they will explain the differences between concurrency and parallelism, along with others concepts, and how to implement your own <code>asyncio</code> "scheduler" from scratch.</p> -</main> -</body> -</html> -
@@ -1,1979 +0,0 @@
-<feed xmlns="http://www.w3.org/2005/Atom"><title>pagong</title><id>pagong</id><updated>2020-10-02T22:00:00+00:00</updated><entry><title>Atemporal Blog Posts</title><id>dist/posts/index.html</id><updated>2020-10-02T22:00:00+00:00</updated><published>2020-10-02T22:00:00+00:00</published><summary>These are some interesting posts and links I've found around the web. I believe they are quite interesting and nice reads, so if you have the time, I encourage you to check some out.</summary><content type="html" src="dist/posts/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Atemporal Blog Posts</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="atemporal_blog_posts"><a class="anchor" href="#atemporal_blog_posts">¶</a>Atemporal Blog Posts</h1> -<div class="date-created-modified">2020-10-03</div> -<p>These are some interesting posts and links I've found around the web. I believe they are quite interesting and nice reads, so if you have the time, I encourage you to check some out.</p> -<h2 id="algorithms"><a class="anchor" href="#algorithms">¶</a>Algorithms</h2> -<ul> -<li>http://www.tannerhelland.com/4660/dithering-eleven-algorithms-source-code/. Image Dithering: Eleven Algorithms and Source Code. What does it mean and how to achieve it?</li> -<li>https://cristian.io/post/bloom-filters/. Idempotence layer on bloom filters. What are they and how can they help?</li> -<li>https://en.wikipedia.org/wiki/Huffman_coding. Huffman coding. This encoding is a simple yet interesting way of compressing information.</li> -<li>https://github.com/mxgmn/WaveFunctionCollapse. Wave Function Collapse. Bitmap &amp; tilemap generation from a single example with the help of ideas from quantum mechanics.</li> -<li>https://blog.nelhage.com/2015/02/regular-expression-search-with-suffix-arrays/. Regular Expression Search with Suffix Arrays. A way to efficiently search large amounts of text.</li> -</ul> -<h2 id="culture"><a class="anchor" href="#culture">¶</a>Culture</h2> -<ul> -<li>https://www.wired.com/story/ideas-joi-ito-robot-overlords/. Why Westerners Fear Robots and the Japanese Do Not. Explains some possible reasons for this case.</li> -<li>http://catb.org/~esr/faqs/smart-questions.html. How To Ask Questions The Smart Way. Some bits of hacker culture and amazing tips on how to ask a question.</li> -<li>http://apenwarr.ca/log/?m=201809#14. XML, blockchains, and the strange shapes of progress. Some of history about XML and blockchain.</li> -<li>https://czep.net/17/legion-of-lobotomized-unices.html. Legion of lobotomized unices. A time where computers are treated a lot more nicely.</li> -<li>https://eli.thegreenplace.net/2016/the-expression-problem-and-its-solutions/. The Expression Problem and its solutions. What is it and what can we do to solve it?</li> -<li>http://allendowney.blogspot.com/2015/08/the-inspection-paradox-is-everywhere.html. The Inspection Paradox is Everywhere. Interesting and very common phenomena.</li> -<li>https://github.com/ChrisKnott/Algojammer. An experimental code editor for writing algorithms. Contains several links to different tools for reverse debugging.</li> -<li>http://habitatchronicles.com/2017/05/what-are-capabilities/. What Are Capabilities? Good ideas with great security implications.</li> -<li>https://blog.aurynn.com/2015/12/16-contempt-culture. Contempt Culture. Or why you should not speak crap about your non-favourite programming languages.</li> -<li>https://www.lesswrong.com/posts/tscc3e5eujrsEeFN4/well-kept-gardens-die-by-pacifism. Well-Kept Gardens Die By Pacifism. Risks any online community can run into.</li> -<li>https://ncase.me/. It's Nicky Case! They make some cool things worth checking out, I really like &quot;we become what we behold&quot;.</li> -</ul> -<h2 id="debate"><a class="anchor" href="#debate">¶</a>Debate</h2> -<ul> -<li>https://steemit.com/opensource/@crell/open-source-is-awful. Open Source is awful. Has some points about why is it bad and how it could improve.</li> -<li>http://www.mondo2000.com/2018/01/17/pink-lexical-goop-dark-side-autocorrect/. Pink Lexical Goop: The Dark Side of Autocorrect. It can shape how you think.</li> -<li>http://blog.ploeh.dk/2015/08/03/idiomatic-or-idiosyncratic/. Idiomatic or idiosyncratic? Can porting code constructs from other languages have a positive effect?</li> -<li>https://gamasutra.com/view/news/169296/Indepth_Functional_programming_in_C.php. In-depth: Functional programming in C++. Is it useful to bother with functional concepts in a language like C++?</li> -<li>https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/. Notes on structured concurrency, or: Go statement considered harmful.</li> -<li>https://queue.acm.org/detail.cfm?id=3212479. C Is Not a Low-level Language. Could there be alternative programming models designed for more specialized CPUs?</li> -</ul> -<h2 id="food_for_thought"><a class="anchor" href="#food_for_thought">¶</a>Food for Thought</h2> -<ul> -<li>https://www.hillelwayne.com/post/divide-by-zero/. 1/0 = 0. Explores why it makes sense to redefine mathemathics under some circumstances, and why it is possible to do so.</li> -<li>https://jeremykun.com/2018/04/13/for-mathematicians-does-not-mean-equality/. For mathematicians, = does not mean equality. What other definitions does the equal sign have?</li> -<li>https://www.lesswrong.com/posts/2MD3NMLBPCqPfnfre/cached-thoughts. Cached Thoughts. How is it possible that our brains work at all?</li> -<li>http://tonsky.me/blog/disenchantment/. Software disenchantment. Faster hardware and slower software is a trend. -<ul> -<li>https://blackhole12.com/blog/software-engineering-is-bad-but-it-s-not-that-bad/. Software Engineering Is Bad, But That's Not Why. This post has some good counterpoints to Software disenchantment.</li> -</ul> -</li> -<li>http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/. What Color is Your Function? Spoiler: can we approach asynchronous IO better?</li> -<li>https://hackernoon.com/im-harvesting-credit-card-numbers-and-passwords-from-your-site-here-s-how-9a8cb347c5b5. I'm harvesting credit card numbers and passwords from your site. A word of warning when mindlessly adding dependencies.</li> -<li>https://medium.com/message/everything-is-broken-81e5f33a24e1. Everything Is Broken. Some of the (probable) truths about our world.</li> -</ul> -<h2 id="funny"><a class="anchor" href="#funny">¶</a>Funny</h2> -<ul> -<li>http://thedailywtf.com/articles/We-Use-BobX. We Use BobX. BobX.</li> -<li>http://thedailywtf.com/articles/the-inner-json-effect. The Inner JSON Effect. For some reason, custom languages are in.</li> -<li>https://thedailywtf.com/articles/exponential-backup. Exponential Backup. Far better than git.</li> -<li>https://thedailywtf.com/articles/ITAPPMONROBOT. ITAPPMONROBOT. Solving software problems with hardware.</li> -<li>https://thedailywtf.com/articles/a-tapestry-of-threads. A Tapestry of Threads.More threads must mean faster code, right?</li> -<li>https://medium.com/commitlog/a-brief-totally-accurate-history-of-programming-languages-cd93ec806124. A Brief Totally Accurate History Of Programming Languages. Don't take offense for it!</li> -</ul> -<h2 id="graphics"><a class="anchor" href="#graphics">¶</a>Graphics</h2> -<ul> -<li>http://shaunlebron.github.io/visualizing-projections/. Visualizing Projections. Small post about different projection methods.</li> -<li>http://www.iquilezles.org/www/index.htm. A <em>lot</em> of useful and quality articles regarding computer graphics.</li> -</ul> -<h2 id="history"><a class="anchor" href="#history">¶</a>History</h2> -<ul> -<li>https://twobithistory.org/2018/08/18/ada-lovelace-note-g.html. What Did Ada Lovelace's Program Actually Do?. And other characters that took part in the beginning's of programming.</li> -<li>https://chrisdown.name/2018/01/02/in-defence-of-swap.html. In defence of swap: common misconceptions. Swap is still an useful concept.</li> -<li>https://www.pacifict.com/Story/. The Graphing Calculator Story. A great classic Apple tale.</li> -<li>https://twobithistory.org/2018/10/14/lisp.html. How Lisp Became God's Own Programming Language. Lisp as a foundational programming language.</li> -</ul> -<h2 id="motivational"><a class="anchor" href="#motivational">¶</a>Motivational</h2> -<ul> -<li>https://www.joelonsoftware.com/2002/01/06/fire-and-motion/. Fire And Motion. What does actually take to get things done?</li> -<li>https://realmensch.org/2017/08/25/the-parable-of-the-two-programmers/. The Parable of the Two Programmers. This tale is about two different types of programmer and their respective endings in a company, illustrating how the one you wouldn't expect to actually ends in a better situation.</li> -<li>https://byorgey.wordpress.com/2018/05/06/conversations-with-a-six-year-old-on-functional-programming/. Conversations with a six-year-old on functional programming. Little kids today can be really interested in technological topics.</li> -<li>https://bulletproofmusician.com/how-many-hours-a-day-should-you-practice/. How Many Hours a Day Should You Practice?. While the article is about music, it applies to any other areas.</li> -<li>http://nathanmarz.com/blog/suffering-oriented-programming.html. Suffering-oriented programming. A possibly new approach on how you could tackle your new projects.</li> -<li>https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/. Things You Should Never Do, Part I. There is no need to rewrite your code.</li> -</ul> -<h2 id="optimization"><a class="anchor" href="#optimization">¶</a>Optimization</h2> -<ul> -<li>http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html. What Every C Programmer Should Know About Undefined Behavior #1/3. Explains what undefined behaviour is and why it makes sense.</li> -<li>http://ridiculousfish.com/blog/posts/labor-of-division-episode-i.html. Labor of Division (Episode I). Some tricks to divide without division.</li> -<li>http://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html. A Great Old-Timey Game-Programming Hack. Abusing instructions to make games playable even on the slowest hardware.</li> -<li>https://web.archive.org/web/20191213224640/https://people.eecs.berkeley.edu/~sangjin/2012/12/21/epoll-vs-kqueue.html. Scalable Event Multiplexing: epoll vs kqueue. How good OS primitives can really help performance and scability.</li> -<li>https://adamdrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html. Command-line Tools can be 235x Faster than your Hadoop Cluster. Or how to use the right tool for the right job.</li> -<li>https://nullprogram.com/blog/2018/05/27/. When FFI Function Calls Beat Native C. How lua beat C at it and the explanation behind it.</li> -<li>http://igoro.com/archive/gallery-of-processor-cache-effects/. Gallery of Processor Cache Effects. Knowing a few things about the cache can make a big difference.</li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Making a Difference</title><id>dist/making-a-difference/index.html</id><updated>2020-10-02T22:00:00+00:00</updated><published>2020-08-23T22:00:00+00:00</published><summary>When I've thought about what "making a difference" means, I've always seen it as having to do something at very large scales. Something that changes everyone's lives. But I've realized that it doesn't need the case.</summary><content type="html" src="dist/making-a-difference/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Making a Difference</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="making_a_difference"><a class="anchor" href="#making_a_difference">¶</a>Making a Difference</h1> -<div class="date-created-modified">Created 2020-08-24<br> -Modified 2020-10-03</div> -<p>When I've thought about what &quot;making a difference&quot; means, I've always seen it as having to do something at very large scales. Something that changes everyone's lives. But I've realized that it doesn't need the case.</p> -<p>I'm thinking about certain people. I'm thinking about middle-school.</p> -<p>I'm thinking about my math teacher, who I remember saying that if he made a student fail with a grade very close to passing, then he would be a bad teacher because he could just &quot;let them pass&quot;. But if he just passed that one student, he would fail as a teacher, because it's his job to get people to actually <em>learn</em> his subject. He didn't want to be mean, he was just trying to have everybody properly learn the subject. That made a difference on me, but I never got the chance to thank him.</p> -<p>I'm thinking about my English teacher, who has had to put up with a lot of stupidity from the rest of students, making the class not enjoyable. But I thought she was nice, and she thought I was nice. I remember of a day when she was grading my assignement and debating what grade I should get. I thought to myself, she should just grade whatever she considered fair. But she went something along the lines of &quot;what the heck, you deserve it&quot;, and graded in my favour. I think of her as an honest person who also just wants to make other people learn, despite the other students not liking her much. I never got a chance to thank her.</p> -<p>I'm thinking about my philosophy teacher, who was a nice chap. He tried to make the lectures fun and had some really interesting ways of thinking. He was nice to talk to overall, but I never got to thank him for what he taught us.</p> -<p>I'm thinking about one of my lecturers at university who has let me express my feelings to her and helped me make the last push I needed to finish my university degree (I was really dreading some subjects and considering dropping out, but those days are finally over).</p> -<p>I'm thinking about all the people who has been in a long-distance relationship with me. None of the three I've had have worked out in the long-term so far, and I'm in a need of a break from those. But they were really invaluable to help me grow and learn a lot about how things actually work. I'm okay with the first two people now, maybe the third one can be my friend once more in the future as well. I'm sure I've told them how important they have been to me and my life.</p> -<p>I'm thinking about all the people who I've met online and have had overall a healthy relation, sharing interesting things between each other, playtime, thoughts, and other various lessons.</p> -<p>What I'm trying to get across is that you may be more impactful than you think you really are. And even if people don't say it, some are extremely thankful of your interactions with them. You can see this post as a sort of a &quot;call for action&quot; to be more thankful to the people that have affected you in important ways. If people take things for granted because they Just Work, the person who made those things should be proud of this achievement.</p> -<p>Thanks to all of them, to everyone who has shared good moments with me, and to all the people who enjoy the things I make.</p> -</main> -</body> -</html> - </content></entry><entry><title>University posts</title><id>dist/university/index.html</id><updated>2020-10-02T22:00:00+00:00</updated><published>2020-07-02T22:00:00+00:00</published><summary>During university, there were a few subjects where I had to write blog posts for (either as</summary><content type="html" src="dist/university/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>University posts</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="university_posts"><a class="anchor" href="#university_posts">¶</a>University posts</h1> -<div class="date-created-modified">Created 2020-07-03<br> -Modified 2020-10-03</div> -<p>During university, there were a few subjects where I had to write blog posts for (either as -evaluable tasks or just for fun). Currently, these are:</p> -<ul> -<li><a href="/blog/mdad">Data Mining and Data Warehousing</a></li> -<li><a href="/blog/ribw">Information Retrieval and Web Search</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Python ctypes and Windows</title><id>dist/ctypes-and-windows/index.html</id><updated>2020-10-02T22:00:00+00:00</updated><published>2019-06-18T22:00:00+00:00</published><summary>Python</summary><content type="html" src="dist/ctypes-and-windows/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Python ctypes and Windows</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="python_ctypes_and_windows"><a class="anchor" href="#python_ctypes_and_windows">¶</a>Python ctypes and Windows</h1> -<div class="date-created-modified">Created 2019-06-19<br> -Modified 2020-10-03</div> -<p><a href="https://www.python.org/">Python</a>'s <a href="https://docs.python.org/3/library/ctypes.html"><code>ctypes</code></a> is quite a nice library to easily load and invoke C methods available in already-compiled <a href="https://en.wikipedia.org/wiki/Dynamic-link_library"><code>.dll</code> files</a> without any additional dependencies. And I <em>love</em> depending on as little as possible.</p> -<p>In this blog post, we will walk through my endeavors to use <code>ctypes</code> with the <a href="https://docs.microsoft.com/en-us/windows/desktop/api/">Windows API</a>, and do some cool stuff with it.</p> -<p>We will assume some knowledge of C/++ and Python, since we will need to read and write a bit of both. Please note that this post is only an introduction to <code>ctypes</code>, and if you need more information you should consult the <a href="https://docs.python.org/3/library/ctypes.html">Python's documentation for <code>ctypes</code></a>.</p> -<p>While the post focuses on Windows' API, the code here probably applies to unix-based systems with little modifications.</p> -<h2 id="basics"><a class="anchor" href="#basics">¶</a>Basics</h2> -<p>First of all, let's learn how to load a library. Let's say we want to load <code>User32.dll</code>:</p> -<pre><code class="language-python">import ctypes - -ctypes.windll.user32 -</code></pre> -<p>Yes, it's that simple. When you access an attribute of <code>windll</code>, said library will load. Since Windows is case-insensitive, we will use lowercase consistently.</p> -<p>Calling a function is just as simple. Let's say you want to call <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setcursorpos"><code>SetCursorPos</code></a>, which is defined as follows:</p> -<pre><code class="language-c">BOOL SetCursorPos( - int X, - int Y -); -</code></pre> -<p>Okay, it returns a <code>bool</code> and takes two inputs, <code>x</code> and <code>y</code>. So we can call it like so:</p> -<pre><code class="language-python">ctypes.windll.user32.SetCursorPos(100, 100) -</code></pre> -<p>Try it! Your cursor will move!</p> -<h2 id="funky_stuff"><a class="anchor" href="#funky_stuff">¶</a>Funky Stuff</h2> -<p>We can go a bit more crazy and make it form a spiral:</p> -<pre><code class="language-python">import math -import time - -for i in range(200): - x = int(500 + math.cos(i / 5) * i) - y = int(500 + math.sin(i / 5) * i) - ctypes.windll.user32.SetCursorPos(x, y) - time.sleep(0.05) -</code></pre> -<p>Ah, it's always so pleasant to do random stuff when programming. Sure makes it more fun.</p> -<h2 id="complex_structures"><a class="anchor" href="#complex_structures">¶</a>Complex Structures</h2> -<p><code>SetCursorPos</code> was really simple. It took two parameters and they both were integers. Let's go with something harder. Let's go with <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-sendinput"><code>SendInput</code></a>! Emulating input will be a fun exercise:</p> -<pre><code class="language-c">UINT SendInput( - UINT cInputs, - LPINPUT pInputs, - int cbSize -); -</code></pre> -<p>Okay, <code>LPINPUT</code>, what are you? Microsoft likes to prefix types with what they are. In this case, <code>LP</code> stands for &quot;Long Pointer&quot; (I guess?), so <code>LPINPUT</code> is just a Long Pointer to <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-taginput"><code>INPUT</code></a>:</p> -<pre><code class="language-c">typedef struct tagINPUT { - DWORD type; - union { - MOUSEINPUT mi; - KEYBDINPUT ki; - HARDWAREINPUT hi; - } DUMMYUNIONNAME; -} INPUT, *PINPUT, *LPINPUT; -</code></pre> -<p>Alright, that's new. We have a <code>struct</code> and <code>union</code>, two different concepts. We can define both with <code>ctypes</code>:</p> -<pre><code class="language-python">INPUT_MOUSE = 0 -INPUT_KEYBOARD = 1 -INPUT_HARDWARE = 2 - -class INPUT(ctypes.Structure): - _fields_ = [ - ('type', ctypes.c_long), - ... - ] -</code></pre> -<p>Structures are classes that subclass <code>ctypes.Structure</code>, and you define their fields in the <code>_fields_</code> class-level variable, which is a list of tuples <code>(field name, field type)</code>.</p> -<p>The C structure had a <code>DWORD type</code>. <code>DWORD</code> is a <code>c_long</code>, and <code>type</code> is a name like any other, which is why we did <code>('type', ctypes.c_long)</code>.</p> -<p>But what about the union? It's anonymous, and we can't make anonymous unions (<em>citation needed</em>) with <code>ctypes</code>. We will give it a concrete name and a type.</p> -<p>Before defining the union, we need to define its inner structures, <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-tagmouseinput"><code>MOUSEINPUT</code></a>, <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-tagkeybdinput"><code>KEYBDINPUT</code></a> and <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-taghardwareinput"><code>HARDWAREINPUT</code></a>. We won't be using them all, but since they count towards the final struct size (C will choose the largest structure as the final size), we need them, or Windows' API will get confused and refuse to work (personal experience):</p> -<pre><code class="language-python">class MOUSEINPUT(ctypes.Structure): - _fields_ = [ - ('dx', ctypes.c_long), - ('dy', ctypes.c_long), - ('mouseData', ctypes.c_long), - ('dwFlags', ctypes.c_long), - ('time', ctypes.c_long), - ('dwExtraInfo', ctypes.POINTER(ctypes.c_ulong)) - ] - - -class KEYBDINPUT(ctypes.Structure): - _fields_ = [ - ('wVk', ctypes.c_short), - ('wScan', ctypes.c_short), - ('dwFlags', ctypes.c_long), - ('time', ctypes.c_long), - ('dwExtraInfo', ctypes.POINTER(ctypes.c_ulong)) - ] - - -class HARDWAREINPUT(ctypes.Structure): - _fields_ = [ - ('uMsg', ctypes.c_long), - ('wParamL', ctypes.c_short), - ('wParamH', ctypes.c_short) - ] - - -class INPUTUNION(ctypes.Union): - _fields_ = [ - ('mi', MOUSEINPUT), - ('ki', KEYBDINPUT), - ('hi', HARDWAREINPUT) - ] - - -class INPUT(ctypes.Structure): - _fields_ = [ - ('type', ctypes.c_long), - ('value', INPUTUNION) - ] -</code></pre> -<p>Some things to note:</p> -<ul> -<li>Pointers are defined as <code>ctypes.POINTER(inner type)</code>.</li> -<li>The field names can be anything you want. You can make them more &quot;pythonic&quot; if you want (such as changing <code>dwExtraInfo</code> for just <code>extra_info</code>), but I chose to stick with the original naming.</li> -<li>The union is very similar, but it uses <code>ctypes.Union</code> instead of <code>ctypes.Structure</code>.</li> -<li>We gave a name to the anonymous union, <code>INPUTUNION</code>, and used it inside <code>INPUT</code> with also a made-up name, <code>('value', INPUTUNION)</code>.</li> -</ul> -<p>Now that we have all the types we need defined, we can use them:</p> -<pre><code class="language-python">KEYEVENTF_KEYUP = 0x0002 - -def press(vk, down): - inputs = INPUT(type=INPUT_KEYBOARD, value=INPUTUNION(ki=KEYBDINPUT( - wVk=vk, - wScan=0, - dwFlags=0 if down else KEYEVENTF_KEYUP, - time=0, - dwExtraInfo=None - ))) - ctypes.windll.user32.SendInput(1, ctypes.byref(inputs), ctypes.sizeof(inputs)) - - -for char in 'HELLO': - press(ord(char), down=True) - press(ord(char), down=False) -</code></pre> -<p>Run it! It will press and release the keys <code>hello</code> to type the word <code>&quot;hello&quot;</code>!</p> -<p><code>vk</code> stands for &quot;virtual key&quot;. Letters correspond with their upper-case ASCII value, which is what we did above. You can find all the available keys in the page with all the <a href="https://docs.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes">Virtual Key Codes</a>.</p> -<h2 id="dynamic_inputs_and_pointers"><a class="anchor" href="#dynamic_inputs_and_pointers">¶</a>Dynamic Inputs and Pointers</h2> -<p>What happens if a method wants something by reference? That is, a pointer to your thing? For example, <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-getcursorpos"><code>GetCursorPos</code></a>:</p> -<pre><code class="language-c">typedef struct tagPOINT { - LONG x; - LONG y; -} POINT, *PPOINT, *NPPOINT, *LPPOINT; - -BOOL GetCursorPos( - LPPOINT lpPoint -); -</code></pre> -<p>It wants a Long Pointer to <a href="https://docs.microsoft.com/en-us/windows/desktop/api/windef/ns-windef-point"><code>POINT</code></a>. We can do just that with <code>ctypes.byref</code>:</p> -<pre><code class="language-python">class POINT(ctypes.Structure): - _fields_ = [ - ('x', ctypes.c_long), - ('y', ctypes.c_long) - ] - - -def get_mouse(): - point = POINT() - ctypes.windll.user32.GetCursorPos(ctypes.byref(point)) - # pass our point by ref ^^^^^ - # this lets GetCursorPos fill its x and y fields - - return point.x, point.y - - -while True: - print(get_mouse()) - time.sleep(0.05) -</code></pre> -<p>Now you can track the mouse position! Make sure to <code>Ctrl+C</code> the program when you're tired of it.</p> -<p>What happens if a method wants a dynamically-sized input?</p> -<pre><code class="language-python">buffer = ctypes.create_string_buffer(size) -</code></pre> -<p>In that case, you can create an in-memory <code>buffer</code> of <code>size</code> with <code>ctypes.create_string_buffer</code>. It will return a character array of that size, which you can pass as a pointer directly (without <code>ctypes.byref</code>).</p> -<p>To access the buffer's contents, you can use either <code>.raw</code> or <code>.value</code>:</p> -<pre><code class="language-python">entire_buffer_as_bytes = buffer.raw -up_until_null = buffer.value -</code></pre> -<p>When the method fills in the data, you can <code>cast</code> your buffer back into a pointer of a concrete type:</p> -<pre><code class="language-python">result_ptr = ctypes.cast(buffer, ctypes.POINTER(ctypes.c_long)) -</code></pre> -<p>And you can de-reference pointers with <code>.contents</code>:</p> -<pre><code class="language-python">first_result = result_ptr.contents -</code></pre> -<h2 id="arrays"><a class="anchor" href="#arrays">¶</a>Arrays</h2> -<p>Arrays are defined as <code>type * size</code>. Your linter may not like that, and if you don't know the size beforehand, consider creating a 0-sized array. For example:</p> -<pre><code class="language-python"># 10 longs -ten_longs = (ctypes.c_long * 10)() -for i in range(10): - ten_longs[i] = 2 ** i - -# Unknown size of longs, e.g. inside some Structure -longs = (ctypes.c_long * 0) - -# Now you know how many longs it actually was -known_longs = ctypes.cast( - ctypes.byref(longs), - ctypes.POINTER(ctypes.c_long * size) -).contents -</code></pre> -<p>If there's a better way to initialize arrays, please let me know.</p> -<h2 id="wintypes"><a class="anchor" href="#wintypes">¶</a>wintypes</h2> -<p>Under Windows, the <code>ctypes</code> module has a <code>wintypes</code> submodule. This one contains definitions like <code>HWND</code> which may be useful and can be imported as:</p> -<pre><code class="language-python">from ctypes.wintypes import HWND, LPCWSTR, UINT -</code></pre> -<h2 id="callbacks"><a class="anchor" href="#callbacks">¶</a>Callbacks</h2> -<p>Some functions (I'm looking at you, <a href="https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumwindows"><code>EnumWindows</code></a>) ask us to pass a callback. In this case, it wants a <a href="https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms633498(v=vs.85)"><code>EnumWindowsProc</code></a>:</p> -<pre><code class="language-c">BOOL EnumWindows( - WNDENUMPROC lpEnumFunc, - LPARAM lParam -); - -BOOL CALLBACK EnumWindowsProc( - _In_ HWND hwnd, - _In_ LPARAM lParam -); -</code></pre> -<p>The naive approach won't work:</p> -<pre><code class="language-python">def callback(hwnd, lParam): - print(hwnd) - return True - -ctypes.windll.user32.EnumWindows(callback, 0) -# ctypes.ArgumentError: argument 1: &lt;class 'TypeError'&gt;: Don't know how to convert parameter 1 -# Aww. -</code></pre> -<p>Instead, you must wrap your function as a C definition like so:</p> -<pre><code class="language-python">from ctypes.wintypes import BOOL, HWND, LPARAM - -EnumWindowsProc = ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM) - -def callback(hwnd, lParam): - print(hwnd) - return True - -# Wrap the function in the C definition -callback = EnumWindowsProc(callback) - -ctypes.windll.user32.EnumWindows(callback, 0) -# Yay, it works. -</code></pre> -<p>You may have noticed this is what decorators do, wrap the function. So…</p> -<pre><code class="language-python">from ctypes.wintypes import BOOL, HWND, LPARAM - -@ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM) -def callback(hwnd, lParam): - print(hwnd) - return True - -ctypes.windll.user32.EnumWindows(callback, 0) -</code></pre> -<p>…will also work. And it is a <em>lot</em> fancier.</p> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing Words</h2> -<p>With the knowledge above and some experimentation, you should be able to call and do (almost) anything you want. That was pretty much all I needed on my project anyway :)</p> -<p>We have been letting Python convert Python values into C values, but you can do so explicitly too. For example, you can use <code>ctypes.c_short(17)</code> to make sure to pass that <code>17</code> as a <code>short</code>. And if you have a <code>c_short</code>, you can convert or cast it to its Python <code>.value</code> as <code>some_short.value</code>. The same applies for integers, longs, floats, doubles… pretty much anything, char pointers (strings) included.</p> -<p>If you can't find something in their online documentation, you can always <a href="https://github.com/BurntSushi/ripgrep"><code>rg</code></a> for it in the <code>C:\Program Files (x86)\Windows Kits\10\Include\*</code> directory.</p> -<p>Note that the <code>ctypes.Structure</code>'s that you define can have more methods of your own. For example, you can write them a <code>__str__</code> to easily view its fields, or define a <code>@property</code> to re-interpret some data in a meaningful way.</p> -<p>For enumerations, you can pass just the right integer number, make a constant for it, or if you prefer, use a <a href="https://docs.python.org/3/library/enum.html#enum.IntEnum"><code>enum.IntEnum</code></a>. For example, <a href="https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/dism/dismloglevel-enumeration"><code>DismLogLevel</code></a> would be:</p> -<pre><code class="language-python">class DismLogLevel(enum.IntEnum): - DismLogErrors = 0 - DismLogErrorsWarnings = 1 - DismLogErrorsWarningsInfo = 2 -</code></pre> -<p>And you <em>should</em> be able to pass <code>DismLogLevel.DismLogErrors</code> as the parameter now.</p> -<p>If you see a function definition like <code>Function(void)</code>, that's C's way of saying it takes no parameters, so just call it as <code>Function()</code>.</p> -<p>Make sure to pass all parameters, even if they seem optional they probably still want a <code>NULL</code> at least, and of course, read the documentation well. Some methods have certain pre-conditions.</p> -<p>Have fun hacking!</p> -</main> -</body> -</html> - </content></entry><entry><title>Shattered Pixel Dungeon</title><id>dist/pixel-dungeon/index.html</id><updated>2020-10-02T22:00:00+00:00</updated><published>2019-06-02T22:00:00+00:00</published><summary>Shattered Pixel Dungeon</summary><content type="html" src="dist/pixel-dungeon/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Shattered Pixel Dungeon</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="shattered_pixel_dungeon"><a class="anchor" href="#shattered_pixel_dungeon">¶</a>Shattered Pixel Dungeon</h1> -<div class="date-created-modified">Created 2019-06-03<br> -Modified 2020-10-03</div> -<p><a href="https://shatteredpixel.com/shatteredpd/">Shattered Pixel Dungeon</a> is the classic roguelike RPG game with randomly-generated dungeons. As a new player, it was a bit frustrating to be constantly killed on the first levels of the dungeon, but with some practice it's easy to reach high levels if you can kill the first boss.</p> -<h2 id="basic_tips"><a class="anchor" href="#basic_tips">¶</a>Basic Tips</h2> -<p>The game comes with its own tips, but here's a short and straight-forward summary:</p> -<ul> -<li><strong>Don't rush into enemies</strong>. Abuse doors and small corridors to kill them one by one. You can use the clock on the bottom left to wait a turn without moving.</li> -<li><strong>Explore each level at full</strong>. You will find goodies and gain XP while doing so.</li> -<li><strong>Upon finding a special room</strong> (e.g. has a chest but is protected by piranhas), drink all potions that you found in that level until there's one that helps you (e.g. be invisible so piranhas leave you alone). There is guaranteed to be a helpful one per level with special rooms.</li> -<li><strong>Drink potions as early as possible</strong>. Harmful potions do less damage on early levels (and if you die, you lose less). This will keep them identified early for the rest of the game.</li> -<li><strong>Read scrolls as early as possible</strong> as well. This will keep them identified. It may be worth to wait until you have an item which may be cursed and until the level is clear, because some scrolls clean curses and others alert enemies.</li> -<li><strong>Food and health are resources</strong> that you have to <em>manage</em>, not keep them always at full. Even if you are starving and taking damage, you may not need to eat <em>just yet</em>, since food is scarce. Eat when you are low on health or in possible danger.</li> -<li><strong>Piranhas</strong>. Seriously, just leave them alone if you are melee. They're free food if you're playing ranged, though.</li> -<li><strong>Prefer armor over weapons</strong>. And make sure to identify or clean it from curses before wearing anything!</li> -<li><strong>Find a dew vial early</strong>. It's often a better idea to store dew (health) for later than to use it as soon as possible.</li> -</ul> -<h2 id="bosses"><a class="anchor" href="#bosses">¶</a>Bosses</h2> -<p>There is a boss every 5 levels.</p> -<ul> -<li><strong>Level 5 boss</strong>. Try to stay on water, but don't let <em>it</em> stay on water since it will heal. Be careful when he starts enraging.</li> -<li><strong>Level 10 boss</strong>. Ranged weapons are good against it.</li> -<li><strong>Level 15 boss</strong>. I somehow managed to tank it with a health potion.</li> -<li><strong>Level 20 boss</strong>. I didn't get this far just yet. You are advised to use scrolls of magic mapping in the last levels to skip straight to the boss, since there's nothing else of value.</li> -<li><strong>Level 25 boss</strong>. The final boss. Good job if you made it this far!</li> -</ul> -<h2 id="mage"><a class="anchor" href="#mage">¶</a>Mage</h2> -<p>If you followed the basic tips, you will sooner or later make use of two scrolls of upgrade in a single run. This will unlock the mage class, which is ridiculously powerful. He starts with a ranged-weapon, a magic missile wand, which is really helpful to keep enemies at a distance. Normally, you want to use this at first to surprise attack them soon, and if you are low on charges, you may go melee on normal enemies if you are confident.</p> -<h2 id="luck"><a class="anchor" href="#luck">¶</a>Luck</h2> -<p>This game is all about luck and patience! Some runs will be better than others, and you should thank and pray the RNG gods for them. If you don't, they will only give you cursed items and not a single scroll to clean them. So, good luck and enjoy playing!</p> -</main> -</body> -</html> - </content></entry><entry><title>Breaking Risk of Rain</title><id>dist/breaking-ror/index.html</id><updated>2020-10-02T22:00:00+00:00</updated><published>2019-01-11T23:00:00+00:00</published><summary>Risk of Rain</summary><content type="html" src="dist/breaking-ror/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Breaking Risk of Rain</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="breaking_risk_of_rain"><a class="anchor" href="#breaking_risk_of_rain">¶</a>Breaking Risk of Rain</h1> -<div class="date-created-modified">Created 2019-01-12<br> -Modified 2020-10-03</div> -<p><a href="https://riskofraingame.com/">Risk of Rain</a> is a fun little game you can spend a lot of hours on. It's incredibly challenging for new players, and fun once you have learnt the basics. This blog will go through what I've learnt and how to play the game correctly.</p> -<h2 id="getting_started"><a class="anchor" href="#getting_started">¶</a>Getting Started</h2> -<p>If you're new to the game, you may find it frustrating. You must learn very well to dodge.</p> -<p>Your first <a href="http://riskofrain.wikia.com/wiki/Category:Characters">character</a> will be <a href="http://riskofrain.wikia.com/wiki/Commando">Commando</a>. He's actually a very nice character. Use your third skill (dodge) to move faster, pass through large groups of enemies, and negate fall damage.</p> -<p>If there are a lot of monsters, remember to <strong>leave</strong> from there! It's really important for survival. Most enemies <strong>don't do body damage</strong>. Not even the body of the <a href="http://riskofrain.wikia.com/wiki/Magma_Worm">Magma Worm</a> or the <a href="http://riskofrain.wikia.com/wiki/Wandering_Vagrant">Wandering Vagrant</a> (just dodge the head and projectiles respectively).</p> -<p>The first thing you must do is always <strong>rush for the teleporter</strong>. Completing the levels quick will make the game easier. But make sure to take note of <strong>where the chests are</strong>! When you have time (even when the countdown finishes), go back for them and buy as many as you can. Generally, prefer <a href="http://riskofrain.wikia.com/wiki/Chest">chests</a> over <a href="http://riskofrain.wikia.com/wiki/Shrine">shrines</a> since they may eat all your money.</p> -<p>Completing the game on <a href="http://riskofrain.wikia.com/wiki/Difficulty">Drizzle</a> is really easy if you follow these tips.</p> -<h2 id="requisites"><a class="anchor" href="#requisites">¶</a>Requisites</h2> -<p>Before breaking the game, you must obtain several <a href="http://riskofrain.wikia.com/wiki/Item#Artifacts">artifacts</a>. We are interested in particular in the following:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Sacrifice">Sacrifice</a>. You really need this one, and may be a bit hard to get. With it, you will be able to farm the first level for 30 minutes and kill the final boss in 30 seconds.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Command">Command</a>. You need this unless you want to grind for hours to get enough of the items you really need for the rest of the game. Getting this one is easy.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Glass">Glass</a>. Your life will be very small (at the beginning…), but you will be able to one-shot everything easily.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Kin">Kin</a> (optional). It makes it easier to obtain a lot of boxes if you restart the first level until you get <a href="http://riskofrain.wikia.com/wiki/Lemurian">lemurians</a> or <a href="http://riskofrain.wikia.com/wiki/Jellyfish">jellyfish</a> as the monster, since they're cheap to spawn.</li> -</ul> -<p>With those, the game becomes trivial. Playing as <a href="http://riskofrain.wikia.com/wiki/Huntress">Huntress</a> is excellent since she can move at high speed while killing everything on screen.</p> -<h2 id="breaking_the_game"><a class="anchor" href="#breaking_the_game">¶</a>Breaking the Game</h2> -<p>The rest is easy! With the command artifact you want the following items.</p> -<h3 id="<a href="http://riskofrain.wikia.com/wiki/Category:Common_Items">common_items"><a class="anchor" href="#common_items">¶</a>Common Items</a></h3> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Soldier&#x27;s_Syringe">Soldier's Syringe</a>. <strong>Stack 13</strong> of these and you will triple your attack speed. You can get started with 4 or so.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Paul&#x27;s_Goat_Hoof">Paul's Goat Hoof</a>. <strong>Stack +30</strong> of these and your movement speed will be insane. You can get a very good speed with 8 or so.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Crowbar">Crowbar</a>. <strong>Stack +20</strong> to guarantee you can one-shot bosses.</li> -</ul> -<p>If you want to be safer:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Hermit&#x27;s_Scarf">Hermit's Scarf</a>. <strong>Stack 6</strong> of these to dodge 1/3 of the attacks.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Monster_Tooth">Monster Tooth</a>. <strong>Stack 9</strong> of these to recover 50 life on kill. This is plenty, since you will be killing <em>a lot</em>.</li> -</ul> -<p>If you don't have enough and want more fun, get one of these:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Gasoline">Gasoline</a>. Burn the ground on kill, and more will die!</li> -<li><a href="http://riskofrain.wikia.com/wiki/Headstompers">Headstompers</a>. They make a pleasing sound on fall, and hurt.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Lens-Maker&#x27;s_Glasses">Lens-Maker's Glasses</a>. <strong>Stack 14</strong> and you will always deal a critical strike for double the damage.</li> -</ul> -<h3 id="<a href="http://riskofrain.wikia.com/wiki/Category:Uncommon_Items">uncommon_items"><a class="anchor" href="#uncommon_items">¶</a>Uncommon Items</a></h3> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Infusion">Infusion</a>. You only really need one of this. Your life will skyrocket after a while, since this gives you 1HP per kill.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Hopoo_Feather">Hopoo Feather</a>. <strong>Stack +10</strong> of these. You will pretty much be able to fly with so many jumps.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Guardian&#x27;s_Heart">Guardian's Heart</a>. Not really necessary, but useful for early and late game, since it will absorb infinite damage the first hit.</li> -</ul> -<p>If, again, you want more fun, get one of these:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Ukulele">Ukelele</a>. Spazz your enemies!</li> -<li><a href="http://riskofrain.wikia.com/wiki/Will-o&#x27;-the-wisp">Will-o'-the-wisp</a>. Explode your enemies!</li> -<li><a href="http://riskofrain.wikia.com/wiki/Chargefield_Generator">Chargefield Generator</a>. It should cover your entire screen after a bit, hurting all enemies without moving a finger.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Golden_Gun">Golden Gun</a>. You will be rich, so this gives you +40% damage.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Predatory_Instincts">Predatory Instincts</a>. If you got 14 glasses, you will always be doing critical strikes, and this will give even more attack speed.</li> -<li><a href="http://riskofrain.wikia.com/wiki/56_Leaf_Clover">56 Leaf Clover</a>. More drops, in case you didn't have enough.</li> -</ul> -<h3 id="<a href="http://riskofrain.wikia.com/wiki/Category:Rare_Items">rare_items"><a class="anchor" href="#rare_items">¶</a>Rare Items</a></h3> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Ceremonial_Dagger">Ceremonial Dagger</a>. <strong>Stack +3</strong>, then killing one thing kills another thing and makes a chain reaction.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Alien_Head">Alien Head</a>. <strong>Stack 3</strong>, and you will be able to use your abilities more often.</li> -</ul> -<p>For more fun:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Brilliant_Behemoth">Brilliant Behemoth</a>. Boom boom.</li> -</ul> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing Words</h2> -<p>You can now beat the game in Monsoon solo with any character. Have fun! And be careful with the sadly common crashes.</p> -</main> -</body> -</html> - </content></entry><entry><title>An Introduction to Asyncio</title><id>dist/asyncio/index.html</id><updated>2020-10-02T22:00:00+00:00</updated><published>2018-06-12T22:00:00+00:00</published><summary>After seeing some friends struggle with </summary><content type="html" src="dist/asyncio/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>An Introduction to Asyncio</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="an_introduction_to_asyncio"><a class="anchor" href="#an_introduction_to_asyncio">¶</a>An Introduction to Asyncio</h1> -<div class="date-created-modified">Created 2018-06-13<br> -Modified 2020-10-03</div> -<h2 id="index"><a class="anchor" href="#index">¶</a>Index</h2> -<ul> -<li><a href="#background">Background</a></li> -<li><a href="#input_output">Input / Output</a></li> -<li><a href="#diving_in">Diving In</a></li> -<li><a href="#a_toy_example">A Toy Example</a></li> -<li><a href="#a_real_example">A Real Example</a></li> -<li><a href="#extra_material">Extra Material</a></li> -</ul> -<h2 id="background"><a class="anchor" href="#background">¶</a>Background</h2> -<p>After seeing some friends struggle with <code>asyncio</code> I decided that it could be a good idea to write a blog post using my own words to explain how I understand the world of asynchronous IO. I will focus on Python's <code>asyncio</code> module but this post should apply to any other language easily.</p> -<p>So what is <code>asyncio</code> and what makes it good? Why don't we just use the old and known threads to run several parts of the code concurrently, at the same time?</p> -<p>The first reason is that <code>asyncio</code> makes your code easier to reason about, as opposed to using threads, because the amount of ways in which your code can run grows exponentially. Let's see that with an example. Imagine you have this code:</p> -<pre><code class="language-python">def method(): - line 1 - line 2 - line 3 - line 4 - line 5 -</code></pre> -<p>And you start two threads to run the method at the same time. What is the order in which the lines of code get executed? The answer is that you can't know! The first thread can run the entire method before the second thread even starts. Or it could be the first thread that runs after the second thread. Perhaps both run the &quot;line 1&quot;, and then the line 2. Maybe the first thread runs lines 1 and 2, and then the second thread only runs the line 1 before the first thread finishes.</p> -<p>As you can see, any combination of the order in which the lines run is possible. If the lines modify some global shared state, that will get messy quickly.</p> -<p>Second, in Python, threads <em>won't</em> make your code faster most of the time. It will only increase the concurrency of your program (which is okay if it makes many blocking calls), allowing you to run several things at the same time.</p> -<p>If you have a lot of CPU work to do though, threads aren't a real advantage. Indeed, your code will probably run slower under the most common Python implementation, CPython, which makes use of a Global Interpreter Lock (GIL) that only lets a thread run at once. The operations won't run in parallel!</p> -<h2 id="input_output"><a class="anchor" href="#input_output">¶</a>Input / Output</h2> -<p>Before we go any further, let's first stop to talk about input and output, commonly known as &quot;IO&quot;. There are two main ways to perform IO operations, such as reading or writing from a file or a network socket.</p> -<p>The first one is known as &quot;blocking IO&quot;. What this means is that, when you try performing IO, the current application thread is going to <em>block</em> until the Operative System can tell you it's done. Normally, this is not a problem, since disks are pretty fast anyway, but it can soon become a performance bottleneck. And network IO will be much slower than disk IO!</p> -<pre><code class="language-python">import socket - -# Setup a network socket and a very simple HTTP request. -# By default, sockets are open in blocking mode. -sock = socket.socket() -request = b'''HEAD / HTTP/1.0\r -Host: example.com\r -\r -''' - -# &quot;connect&quot; will block until a successful TCP connection -# is made to the host &quot;example.com&quot; on port 80. -sock.connect(('example.com', 80)) - -# &quot;sendall&quot; will repeatedly call &quot;send&quot; until all the data in &quot;request&quot; is -# sent to the host we just connected, which blocks until the data is sent. -sock.sendall(request) - -# &quot;recv&quot; will try to receive up to 1024 bytes from the host, and block until -# there is any data to receive (or empty if the host closes the connection). -response = sock.recv(1024) - -# After all those blocking calls, we got out data! These are the headers from -# making a HTTP request to example.com. -print(response.decode()) -</code></pre> -<p>Blocking IO offers timeouts, so that you can get control back in your code if the operation doesn't finish. Imagine that the remote host doesn't want to reply, your code would be stuck for as long as the connection remains alive!</p> -<p>But wait, what if we make the timeout small? Very, very small? If we do that, we will never block waiting for an answer. That's how asynchronous IO works, and it's the opposite of blocking IO (you can also call it non-blocking IO if you want to).</p> -<p>How does non-blocking IO work if the IO device needs a while to answer with the data? In that case, the operative system responds with &quot;not ready&quot;, and your application gets control back so it can do other stuff while the IO device completes your request. It works a bit like this:</p> -<pre><code>&lt;app&gt; Hey, I would like to read 16 bytes from this file -&lt;OS&gt; Okay, but the disk hasn't sent me the data yet -&lt;app&gt; Alright, I will do something else then -(a lot of computer time passes) -&lt;app&gt; Do you have my 16 bytes now? -&lt;OS&gt; Yes, here they are! &quot;Hello, world !!\n&quot; -</code></pre> -<p>In reality, you can tell the OS to notify you when the data is ready, as opposed to polling (constantly asking the OS whether the data is ready yet or not), which is more efficient.</p> -<p>But either way, that's the difference between blocking and non-blocking IO, and what matters is that your application gets to run more without ever needing to wait for data to arrive, because the data will be there immediately when you ask, and if it's not yet, your app can do more things meanwhile.</p> -<h2 id="diving_in"><a class="anchor" href="#diving_in">¶</a>Diving In</h2> -<p>Now we've seen what blocking and non-blocking IO is, and how threads make your code harder to reason about, but they give concurrency (yet not more speed). Is there any other way to achieve this concurrency that doesn't involve threads? Yes! The answer is <code>asyncio</code>.</p> -<p>So how does <code>asyncio</code> help? First we need to understand a very crucial concept before we can dive any deeper, and I'm talking about the <em>event loop</em>. What is it and why do we need it?</p> -<p>You can think of the event loop as a <em>loop</em> that will be responsible for calling your <code>async</code> functions:</p> -<div class="image-container"> -<img src="eventloop.svg" alt="The Event Loop" /> -<div class="image-caption"></div> -</div> -<p> -<p>That's silly you may think. Now not only we run our code but we also have to run some &quot;event loop&quot;. It doesn't sound beneficial at all. What are these events? Well, they are the IO events we talked about before!</p> -<p><code>asyncio</code>'s event loop is responsible for handling those IO events, such as file is ready, data arrived, flushing is done, and so on. As we saw before, we can make these events non-blocking by setting their timeout to 0.</p> -<p>Let's say you want to read from 10 files at the same time. You will ask the OS to read data from 10 files, and at first none of the reads will be ready. But the event loop will be constantly asking the OS to know which are done, and when they are done, you will get your data.</p> -<p>This has some nice advantages. It means that, instead of waiting for a network request to send you a response or some file, instead of blocking there, the event loop can decide to run other code meanwhile. Whenever the contents are ready, they can be read, and your code can continue. Waiting for the contents to be received is done with the <code>await</code> keyword, and it tells the loop that it can run other code meanwhile:</p> -<div class="image-container"> -<img src="awaitkwd1.svg" alt="Step 1, await keyword" /> -<div class="image-caption"></div> -</div> -<p> -<div class="image-container"> -<img src="awaitkwd2.svg" alt="Step 2, await keyword" /> -<div class="image-caption"></div> -</div> -<p> -<p>Start reading the code of the event loop and follow the arrows. You can see that, in the beginning, there are no events yet, so the loop calls one of your functions. The code runs until it has to <code>await</code> for some IO operation to complete, such as sending a request over the network. The method is &quot;paused&quot; until an event occurs (for example, an &quot;event&quot; occurs when the request has been sent completely).</p> -<p>While the first method is busy, the event loop can enter the second method, and run its code until the first <code>await</code>. But it can happen that the event of the second query occurs before the request on the first method, so the event loop can re-enter the second method because it has already sent the query, but the first method isn't done sending the request yet.</p> -<p>Then, the second method <code>await</code>'s for an answer, and an event occurs telling the event loop that the request from the first method was sent. The code can be resumed again, until it has to <code>await</code> for a response, and so on. Here's an explanation with pseudo-code for this process if you prefer:</p> -<pre><code class="language-python">async def method(request): - prepare request - await send request - - await receive request - - process request - return result - -run in parallel ( - method with request 1, - method with request 2, -) -</code></pre> -<p>This is what the event loop will do on the above pseudo-code:</p> -<pre><code>no events pending, can advance - -enter method with request 1 - prepare request - await sending request -pause method with request 1 - -no events ready, can advance - -enter method with request 2 - prepare request - await sending request -pause method with request 2 - -both requests are paused, cannot advance -wait for events -event for request 2 arrives (sending request completed) - -enter method with request 2 - await receiving response -pause method with request 2 - -event for request 1 arrives (sending request completed) - -enter method with request 1 - await receiving response -pause method with request 1 - -...and so on -</code></pre> -<p>You may be wondering &quot;okay, but threads work for me, so why should I change?&quot;. There are some important things to note here. The first is that we only need one thread to be running! The event loop decides when and which methods should run. This results in less pressure for the operating system. The second is that we know when it may run other methods. Those are the <code>await</code> keywords! Whenever there is one of those, we know that the loop is able to run other things until the resource (again, like network) becomes ready (when a event occurs telling us it's ready to be used without blocking or it has completed).</p> -<p>So far, we already have two advantages. We are only using a single thread so the cost for switching between methods is low, and we can easily reason about where our program may interleave operations.</p> -<p>Another advantage is that, with the event loop, you can easily schedule when a piece of code should run, such as using the method <a href="https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.call_at"><code>loop.call_at</code></a>, without the need for spawning another thread at all.</p> -<p>To tell the <code>asyncio</code> to run the two methods shown above, we can use <a href="https://docs.python.org/3/library/asyncio-future.html#asyncio.ensure_future"><code>asyncio.ensure_future</code></a>, which is a way of saying &quot;I want the future of my method to be ensured&quot;. That is, you want to run your method in the future, whenever the loop is free to do so. This method returns a <code>Future</code> object, so if your method returns a value, you can <code>await</code> this future to retrieve its result.</p> -<p>What is a <code>Future</code>? This object represents the value of something that will be there in the future, but might not be there yet. Just like you can <code>await</code> your own <code>async def</code> functions, you can <code>await</code> these <code>Future</code>'s.</p> -<p>The <code>async def</code> functions are also called &quot;coroutines&quot;, and Python does some magic behind the scenes to turn them into such. The coroutines can be <code>await</code>'ed, and this is what you normally do.</p> -<h2 id="a_toy_example"><a class="anchor" href="#a_toy_example">¶</a>A Toy Example</h2> -<p>That's all about <code>asyncio</code>! Let's wrap up with some example code. We will create a server that replies with the text a client sends, but reversed. First, we will show what you could write with normal synchronous code, and then we will port it.</p> -<p>Here is the <strong>synchronous version</strong>:</p> -<pre><code class="language-python"># server.py -import socket - - -def server_method(): - # create a new server socket to listen for connections - server = socket.socket() - - # bind to localhost:6789 for new connections - server.bind(('localhost', 6789)) - - # we will listen for one client at most - server.listen(1) - - # *block* waiting for a new client - client, _ = server.accept() - - # *block* waiting for some data - data = client.recv(1024) - - # reverse the data - data = data[::-1] - - # *block* sending the data - client.sendall(data) - - # close client and server - server.close() - client.close() - - -if __name__ == '__main__': - # block running the server - server_method() -</code></pre> -<pre><code class="language-python"># client.py -import socket - - -def client_method(): - message = b'Hello Server!\n' - client = socket.socket() - - # *block* trying to stabilish a connection - client.connect(('localhost', 6789)) - - # *block* trying to send the message - print('Sending', message) - client.sendall(message) - - # *block* until we receive a response - response = client.recv(1024) - print('Server replied', response) - - client.close() - - -if __name__ == '__main__': - client_method() -</code></pre> -<p>From what we've seen, this code will block on all the lines with a comment above them saying that they will block. This means that for running more than one client or server, or both in the same file, you will need threads. But we can do better, we can rewrite it into <code>asyncio</code>!</p> -<p>The first step is to mark all your <code>def</code>initions that may block with <code>async</code>. This marks them as coroutines, which can be <code>await</code>ed on.</p> -<p>Second, since we're using low-level sockets, we need to make use of the methods that <code>asyncio</code> provides directly. If this was a third-party library, this would be just like using their <code>async def</code>initions.</p> -<p>Here is the <strong>asynchronous version</strong>:</p> -<pre><code class="language-python"># server.py -import asyncio -import socket - -# get the default &quot;event loop&quot; that we will run -loop = asyncio.get_event_loop() - - -# notice our new &quot;async&quot; before the definition -async def server_method(): - server = socket.socket() - server.bind(('localhost', 6789)) - server.listen(1) - - # await for a new client - # the event loop can run other code while we wait here! - client, _ = await loop.sock_accept(server) - - # await for some data - data = await loop.sock_recv(client, 1024) - data = data[::-1] - - # await for sending the data - await loop.sock_sendall(client, data) - - server.close() - client.close() - - -if __name__ == '__main__': - # run the loop until &quot;server method&quot; is complete - loop.run_until_complete(server_method()) -</code></pre> -<pre><code class="language-python"># client.py -import asyncio -import socket - -loop = asyncio.get_event_loop() - - -async def client_method(): - message = b'Hello Server!\n' - client = socket.socket() - - # await to stabilish a connection - await loop.sock_connect(client, ('localhost', 6789)) - - # await to send the message - print('Sending', message) - await loop.sock_sendall(client, message) - - # await to receive a response - response = await loop.sock_recv(client, 1024) - print('Server replied', response) - - client.close() - - -if __name__ == '__main__': - loop.run_until_complete(client_method()) -</code></pre> -<p>That's it! You can place these two files separately and run, first the server, then the client. You should see output in the client.</p> -<p>The big difference here is that you can easily modify the code to run more than one server or clients at the same time. Whenever you <code>await</code> the event loop will run other of your code. It seems to &quot;block&quot; on the <code>await</code> parts, but remember it's actually jumping to run more code, and the event loop will get back to you whenever it can.</p> -<p>In short, you need an <code>async def</code> to <code>await</code> things, and you run them with the event loop instead of calling them directly. So this…</p> -<pre><code class="language-python">def main(): - ... # some code - - -if __name__ == '__main__': - main() -</code></pre> -<p>…becomes this:</p> -<pre><code class="language-python">import asyncio - - -async def main(): - ... # some code - - -if __name__ == '__main__': - asyncio.get_event_loop().run_until_complete(main) -</code></pre> -<p>This is pretty much how most of your <code>async</code> scripts will start, running the main method until its completion.</p> -<h2 id="a_real_example"><a class="anchor" href="#a_real_example">¶</a>A Real Example</h2> -<p>Let's have some fun with a real library. We'll be using <a href="https://github.com/LonamiWebs/Telethon">Telethon</a> to broadcast a message to our three best friends, all at the same time, thanks to the magic of <code>asyncio</code>. We'll dive right into the code, and then I'll explain our new friend <code>asyncio.wait(...)</code>:</p> -<pre><code class="language-python"># broadcast.py -import asyncio -import sys - -from telethon import TelegramClient - -# (you need your own values here, check Telethon's documentation) -api_id = 123 -api_hash = '123abc' -friends = [ - '@friend1__username', - '@friend2__username', - '@bestie__username' -] - -# we will have to await things, so we need an async def -async def main(message): - # start is a coroutine, so we need to await it to run it - client = await TelegramClient('me', api_id, api_hash).start() - - # wait for all three client.send_message to complete - await asyncio.wait([ - client.send_message(friend, message) - for friend in friends - ]) - - # and close our client - await client.disconnect() - - -if __name__ == '__main__': - if len(sys.argv) != 2: - print('You must pass the message to broadcast!') - quit() - - message = sys.argv[1] - asyncio.get_event_loop().run_until_complete(main(message)) -</code></pre> -<p>Wait… how did that send a message to all three of -my friends? The magic is done here:</p> -<pre><code class="language-python">[ - client.send_message(friend, message) - for friend in friends -] -</code></pre> -<p>This list comprehension creates another list with three -coroutines, the three <code>client.send_message(...)</code>. -Then we just pass that list to <code>asyncio.wait</code>:</p> -<pre><code class="language-python">await asyncio.wait([...]) -</code></pre> -<p>This method, by default, waits for the list of coroutines to run until they've all finished. You can read more on the Python <a href="https://docs.python.org/3/library/asyncio-task.html#asyncio.wait">documentation</a>. Truly a good function to know about!</p> -<p>Now whenever you have some important news for your friends, you can simply <code>python3 broadcast.py 'I bought a car!'</code> to tell all your friends about your new car! All you need to remember is that you need to <code>await</code> on coroutines, and you will be good. <code>asyncio</code> will warn you when you forget to do so.</p> -<h2 id="extra_material"><a class="anchor" href="#extra_material">¶</a>Extra Material</h2> -<p>If you want to understand how <code>asyncio</code> works under the hood, I recommend you to watch this hour-long talk <a href="https://youtu.be/M-UcUs7IMIM">Get to grips with asyncio in Python 3</a> by Robert Smallshire. In the video, they will explain the differences between concurrency and parallelism, along with others concepts, and how to implement your own <code>asyncio</code> &quot;scheduler&quot; from scratch.</p> -</main> -</body> -</html> - </content></entry><entry><title>My new computer</title><id>dist/new-computer/index.html</id><updated>2020-07-02T22:00:00+00:00</updated><published>2020-06-18T22:00:00+00:00</published><summary>This post will be mostly me ranting about setting up a new laptop, but I also just want to share my upgrade. If you're considering installing Arch Linux with dual-boot for Windows, maybe this post will help. Or perhaps you will learn something new to troubleshoot systems in the future. Let's begin!</summary><content type="html" src="dist/new-computer/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>My new computer</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="my_new_computer"><a class="anchor" href="#my_new_computer">¶</a>My new computer</h1> -<div class="date-created-modified">Created 2020-06-19<br> -Modified 2020-07-03</div> -<p>This post will be mostly me ranting about setting up a new laptop, but I also just want to share my upgrade. If you're considering installing Arch Linux with dual-boot for Windows, maybe this post will help. Or perhaps you will learn something new to troubleshoot systems in the future. Let's begin!</p> -<p>Last Sunday, I ordered a Asus Rog Strix G531GT-BQ165 for 900€ (on a 20% discount) with the following specifications:</p> -<ul> -<li>Intel® Core i7-9750H (6 cores, 12MB cache, 2.6GHz up to 4.5GHz, 64-bit)</li> -<li>16GB RAM (8GB*2) DDR4 2666MHz</li> -<li>512GB SSD M.2 PCIe® NVMe</li> -<li>Display 15.6&quot; (1920x1080/16:9) 60Hz</li> -<li>Graphics NVIDIA® GeForce® GTX1650 4GB GDDR5 VRAM</li> -<li>LAN 10/100/1000</li> -<li>Wi-Fi 5 (802.11ac) 2x2 RangeBoost</li> -<li>Bluetooth 5.0</li> -<li>48Wh battery with 3 cells</li> -<li>3 x USB 3.1 (GEN1)</li> -</ul> -<p>I was mostly interested in a general upgrade (better processor, disk, more RAM), although the graphics card is a really nice addition which will allow me to take some time off on more games. After using it for a bit, I really love the feel of the keyboard, and I love the lack of numpad! (No sarcasm, I really don't like numpads.)</p> -<p>This is an upgrade from my previous laptop (Asus X554LA-XX822T), which I won in a competition before entering university in a programming challenge. It has served me really well for the past five years, and had the following specifications:</p> -<ul> -<li>Intel® Core™ i5-5200U</li> -<li>4GB RAM DDR3L 1600MHz (which I upgraded to have 8GB)</li> -<li>1TB HDD</li> -<li>Display 15.6&quot; (1366x768/16:9)</li> -<li>Intel® HD Graphics 4400</li> -<li>LAN 10/100/1000</li> -<li>Wifi 802.11 bgn</li> -<li>Bluetooth 4.0</li> -<li>Battery 2 cells</li> -<li>1 x USB 2.0</li> -<li>2 x USB 3.0</li> -</ul> -<p>Prior to this one, I had a Lenovo (also won in the same competition of the previous year), and prior to that (just for the sake of history), it was HP Pavilion, AMD A4-3300M processor, which unfortunately ended with heating problems. But that's very old now.</p> -<h2 id="laptop_arrival"><a class="anchor" href="#laptop_arrival">¶</a>Laptop arrival</h2> -<p>The laptop arrived 2 days ago at roughly 19:00, which I put charged for 3 hours as the book said. The day after, nightmares began!</p> -<p>Trying to boot it the first two times was fun, as it comes with a somewhat loud sound on boot. I don't know why they would do this, and I immediately turned it off in the BIOS.</p> -<h2 id="installation_journey"><a class="anchor" href="#installation_journey">¶</a>Installation journey</h2> -<p>I spent all of yesterday trying to setup Windows and Arch Linux (and didn't even finish, it took me this morning too and even now it's only half functional). I absolutely <em>hate</em> the amount of partitions the Windows installer creates on a clean disk. So instead, I first went with Arch Linux, and followed the <a href="https://wiki.archlinux.org/index.php/Installation_guide">installation guide on the Arch wiki</a>. Pre-installation, setting up the wireless network, creating the partitions and formatting them went all good. I decided to avoid GRUB at first and go with rEFInd, but alas I missed a big warning on the wiki and after reboot (I would later find out) it was not mounting root properly, so all I had was whatever was in the Initramfs. Reboot didn't work, so I had to hold the power button.</p> -<p>Anyway, once the partitions were created, I went to install Windows (there was a lot of back and forth burning different <code>.iso</code> images on the USB, which was a bit annoying because it wasn't the fastest thing in the world). This was pretty painless, and the process was standard: select advanced to let me choose the right partition, pick the one, say &quot;no&quot; to everything in the services setup, and done. But this was the first Windows <code>.iso</code> I tried. It was an old revision, and the drivers were causing issues when running (something weird about their <code>.dll</code>, manually installing the <code>.ini</code> driver files seemed to work?). The Nvidia drivers didn't want to be installed on such an old revision, after updating everything I could via Windows updates. So back I went to burning a newer Windows <code>.iso</code> and going through the same process again…</p> -<p>Once Windows was ready and I verified that I could boot to it correctly, it was time to have a second go at Arch Linux. And I went through the setup at least three times, getting it wrong every single time, formatting root every single time, redownloading the packages every single pain. If only had I known earlier what the issue was!</p> -<p>Why bother with Arch? I was pretty happy with Linux Mint, and I lowkey wanted to try NixOS, but I had used Arch before and it's a really nice distro overall (up-to-date, has AUR, quite minimal, imperative), except for trying to install rEFInd while chrooted…</p> -<p>In the end I managed to get something half-working, I still need to properly configure WiFi and pulseaudio in my system but hey it works.</p> -<p>I like to be able to dual-boot Windows and Linux because Linux is amazing for productivity, but unfortunately, some games only work fine on Windows. Might as well have both systems and use one for gaming, while the other is my daily driver.</p> -<h2 id="setting_up_arch_linux"><a class="anchor" href="#setting_up_arch_linux">¶</a>Setting up Arch Linux</h2> -<p>This is the process I followed to install Arch Linux in the end, along with a brief explanation on what I think the things are doing and why we are doing them. I think the wiki could do a better job at this, but I also know it's hard to get it right for everyone. Something I do dislike is the link colour, after opening a link it becomes gray and it's a lot easier to miss the fact that it is a link in the first place, which was tough when re-reading it because some links actually matter a lot. Furthermore, important information may just be a single line, also easy to skim over. Anyway, on to the installation process…</p> -<p>The first thing we want to do is configure our keyboard layout or else the keys won't correspond to what we expect:</p> -<pre><code class="language-sh">loadkeys es -</code></pre> -<p>Because we're on a recent system, we want to verify that UEFI works correctly. If we see files listed, then it works fine:</p> -<pre><code class="language-sh">ls /sys/firmware/efi/efivars -</code></pre> -<p>The next thing we want to do is configure the WiFi, because I don't have any ethernet cable nearby. To do this, we check what network interfaces our laptop has (we're looking for the one prefixed with &quot;w&quot;, presumably for wireless, such as &quot;wlan0&quot; or &quot;wlo1&quot;), we set it up, scan for available wireless network, and finally connect. In my case, the network has WPA security so we rely on <code>wpa_supplicant</code> to connect, passing the SSID (network name) and password:</p> -<pre><code class="language-sh">ip link -ip link set &lt;IFACE&gt; up -iw dev &lt;IFACE&gt; scan | less -wpa_supplicant -B -i &lt;IFACE&gt; -c &lt;(wpa_passphrase &lt;SSID&gt; &lt;PASS&gt;) -</code></pre> -<p>After that's done, pinging an IP address like &quot;1.1.1.1&quot; should Just Work™, but to be able to resolve hostnames, we need to also setup a nameserver. I'm using Cloudflare's, but you could use any other:</p> -<pre><code class="language-sh">echo nameserver 1.1.1.1 &gt; /etc/resolv.conf -ping archlinux.org -^C -</code></pre> -<p>If the ping works, then network works! If you still have issues, you may need to <a href="https://wiki.archlinux.org/index.php/Network_configuration#Static_IP_address">manually configure a static IP address</a> and add a route with the address of your, well, router. This basically shows if we have any address, adds a static address (so people know who we are), shows what route we have, and adds a default one (so our packets know where to go):</p> -<pre><code class="language-sh">ip address show -ip address add &lt;YOUR ADDR&gt;/24 broadcast + dev &lt;IFACE&gt; -ip route show -ip route add default via &lt;ROUTER ADDR&gt; dev &lt;IFACE&gt; -</code></pre> -<p>Now that we have network available, we can enable NTP to synchronize our system time (this may be required for network operations where certificates have a validity period, not sure; in any case nobody wants a wrong system time):</p> -<pre><code class="language-sh">timedatectl set-ntp true -</code></pre> -<p>After that, we can manage our disk and partitions using <code>fdisk</code>. We want to define partitions to tell the system where it should live. To determine the disk name, we first list them, and then edit it. <code>fdisk</code> is really nice and reminds you at every step that help can be accessed with &quot;m&quot;, which you should constantly use to guide you through.</p> -<pre><code class="language-sh">fdisk -l -fdisk /dev/&lt;DISK&gt; -</code></pre> -<p>The partitions I made are the following:</p> -<ul> -<li>A 100MB one for the EFI system.</li> -<li>A 32GB one for Linux' root <code>/</code> partition.</li> -<li>A 200GB one for Linux' home <code>/home</code> partition.</li> -<li>The rest was unallocated for Windows because I did this first.</li> -</ul> -<p>I like to have <code>/home</code> and <code>/</code> separate because I can reinstall root without losing anything from home (projects, music, photos, screenshots, videos…).</p> -<p>After the partitions are made, we format them in FAT32 and EXT4 which are good defaults for EFI, root and home. They need to have a format, or else they won't be usable:</p> -<pre><code class="language-sh">mkfs.fat -F32 /dev/&lt;DISK&gt;&lt;PART1&gt; -mkfs.ext4 /dev/&lt;DISK&gt;&lt;PART2&gt; -mkfs.ext4 /dev/&lt;DISK&gt;&lt;PART3&gt; -</code></pre> -<p>Because the laptop was new, there was no risk to lose anything, but if you're doing a install on a previous system, be very careful with the partition names. Make sure they match with the ones in <code>fdisk -l</code>.</p> -<p>Now that we have usable partitions, we need to mount them or they won't be accessible. We can do this with <code>mount</code>:</p> -<pre><code class="language-sh">mount /dev/&lt;DISK&gt;&lt;PART2&gt; /mnt -mkdir /mnt/efi -mount /dev/&lt;DISK&gt;&lt;PART1&gt; /mnt/efi -mkdir /mnt/home -mount /dev/&lt;DISK&gt;&lt;PART3&gt; /mnt/home -</code></pre> -<p>Remember to use the correct partitions while mounting. We mount everything so that the system knows which partitions we care about, which we will let know about later on.</p> -<p>Next step is to setup the basic Arch Linux system on root, which can be done with <code>pacstrap</code>. What follows the directory is a list of packages, and you may choose any you wish (at least add <code>base</code>, <code>linux</code> and <code>linux-firmware</code>). These can be installed later, but I'd recommend having them from the beginning, just in case:</p> -<pre><code class="language-sh">pacstrap /mnt base linux linux-firmware sudo vim-minimal dhcpcd wpa_supplicant man-db man-pages intel-ucode grub efibootmgr os-prober ntfs-3g -</code></pre> -<p>Because my system has an intel CPU, I also installed <code>intel-ucode</code>.</p> -<p>Next up is generating the <code>fstab</code> file, which we tell to use UUIDs to be on the safe side through <code>-U</code>. This file is important, because without it the system won't know what partitions exist and will happily only boot with the initramfs, without anything of what we just installed at root. Not knowing this made me restart the entire installation process a few times.</p> -<pre><code class="language-sh">genfstab -U /mnt &gt;&gt; /mnt/etc/fstab -</code></pre> -<p>After that's done, we can change our root into our mount point and finish up configuration. We setup our timezone (so DST can be handled correctly if needed), synchronize the hardware clock (to persist the current time to the BIOS), uncomment our locales (exit <code>vim</code> by pressing ESC, then type <code>:wq</code> and press enter), generate locale files (which some applications need), configure language and keymap, update the hostname of our laptop and what indicate what <code>localhost</code> means…</p> -<pre><code class="language-sh">ln -sf /usr/share/zoneinfo/&lt;REGION&gt;/&lt;CITY&gt; /etc/localtime -hwclock --systohc -vim /etc/locale.gen -locale-gen -echo LANG=es_ES.UTF-8 &gt; /etc/locale.conf -echo KEYMAP=es &gt; /etc/vconsole.conf -echo &lt;HOST&gt; /etc/hostname -cat &lt;&lt;EOF &gt; /etc/hosts -127.0.0.1 localhost -::1 localhost -127.0.1.1 &lt;HOST&gt;.localdomain &lt;HOST&gt; -EOF -</code></pre> -<p>Really, we could've done all of this later, and the same goes for setting root's password with <code>passwd</code> or creating users (some of the groups you probably want are <code>power</code> and <code>wheel</code>).</p> -<p>The important part here is installing GRUB (which also needed the <code>efibootmgr</code> package):</p> -<pre><code class="language-sh">grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB -</code></pre> -<p>If we want GRUB to find our Windows install, we also need the <code>os-prober</code> and <code>ntfs-3g</code> packages that we installed earlier with <code>pacstrap</code>, and with those we need to mount the Windows partition somewhere. It doesn't matter where. With that done, we can generate the GRUB configuration file which lists all the boot options:</p> -<pre><code class="language-sh">mkdir /windows -mount /dev/&lt;DISK&gt;&lt;PART5&gt; /windows -grub-mkconfig -o /boot/grub/grub.cfg -</code></pre> -<p>(In my case, I installed Windows before completing the Arch install, which created an additional partition in between).</p> -<p>With GRUB ready, we can exit the chroot and reboot the system, and if all went well, you should be greeted with a choice of operating system to use:</p> -<pre><code class="language-sh">exit -reboot -</code></pre> -<p>If for some reason you need to find what mountpoints were active prior to rebooting (to <code>unmount</code> them for example), you can use <code>findmnt</code>.</p> -<p>Before GRUB I tried rEFInd, which as I explained had issues with for missing a warning. Then I tried systemd-boot, which did not pick up Arch at first. That's where the several reinstalls come from, I didn't want to work with a half-worked system so I mostly redid the entire process quite a few times.</p> -<h2 id="migrating_to_the_new_laptop"><a class="anchor" href="#migrating_to_the_new_laptop">¶</a>Migrating to the new laptop</h2> -<p>I had a external disk formatted with NTFS. Of course, after moving every file I cared about from my previous Linux install caused all the permissions to reset. All my <code>.git</code> repositories, dirty with file permission changes! This is going to take a while to fix, or maybe I should just <code>git config core.fileMode false</code>. Here is a <a href="https://stackoverflow.com/a/2083563">lovely command</a> to sort them out on a per-repository basis:</p> -<pre><code class="language-sh">git diff --summary | grep --color 'mode change 100644 =&gt; 100755' | cut -d' ' -f7- | xargs -d'\n' chmod -x -</code></pre> -<p>I never realized how much I had stored over the years, but it really was a lot. While moving things to the external disk, I tried to do some cleanup, such as removing some build artifacts which needlessly occupy space, or completely skipping all the binary application files. If I need those I will install them anyway. The process was mostly focused on finding all the projects and program data that I did care about, or even some game saves. Nothing too difficult, but definitely time consuming.</p> -<h2 id="tuning_arch"><a class="anchor" href="#tuning_arch">¶</a>Tuning Arch</h2> -<p>Now that our system is ready, install <code>pacman-contrib</code> to grab a copy of the <code>rankmirrors</code> speed. It should help speed up the download of whatever packages you want to install, since it will help us <a href="https://wiki.archlinux.org/index.php/Mirrors#List_by_speed">rank the mirrors by download speed</a>. Making a copy of the file is important, otherwise whenever you try to install something it will fail saying it can't find anything.</p> -<pre><code class="language-sh">cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup -sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup -rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup | tee /etc/pacman.d/mirrorlist -</code></pre> -<p>This will take a while, but it should be well worth it. We're using <code>tee</code> to see the progress as it goes.</p> -<p>Some other packages I installed after I had a working system in no particular order:</p> -<ul> -<li><code>xfce4</code> and <code>xorg-server</code>. I just love the simplicity of XFCE.</li> -<li><code>xfce4-whiskermenu-plugin</code>, a really nice start menu.</li> -<li><code>xfce4-pulseaudio-plugin</code> and <code>pavucontrol</code>, to quickly adjust the audio with my mouse.</li> -<li><code>xfce4-taskmanager</code>, a GUI alternative I generally prefer to <code>htop</code>.</li> -<li><code>pulseaudio</code> and <code>pulseaudio-alsa</code> to get nice integration with XFCE4 and audio mixing.</li> -<li><code>firefox</code>, which comes with fonts too. A really good web browser.</li> -<li><code>git</code>, to commit <del>crimes</del> code.</li> -<li><code>code</code>, a wonderful editor which I used to write this blog entry.</li> -<li><code>nano</code>, so much nicer to write a simple commit message.</li> -<li><code>python</code> and <code>python-pip</code>, my favourite language to toy around ideas or use as a calculator.</li> -<li><code>telegram-desktop</code>, for my needs on sharing memes.</li> -<li><code>cmus</code> and <code>mpv</code>, a simple terminal music player and media player.</li> -<li><code>openssh</code>, to connect into any VPS I have access to.</li> -<li><code>base-devel</code>, necessary to build most projects I'll find myself working with (or even compiling some projects Rust which I installed via <code>rustup</code>).</li> -<li><code>flac</code>, <code>libmad</code>, <code>opus</code>, and <code>libvorbis</code>, to be able to play more audio files.</li> -<li><code>inkscape</code>, to make random drawings.</li> -<li><code>ffmpeg</code>, to convert media or record screen.</li> -<li><code>xclip</code>, to automatically copy screenshots to my clipboard.</li> -<li><code>gvfs</code>, needed by Thunar to handle mounting and having a trash (perma-deletion by default can be nasty sometimes).</li> -<li><code>noto-fonts</code>, <code>noto-fonts-cjk</code>, <code>noto-fonts-extra</code> and <code>noto-fonts-emoji</code>, if you don't want missing gliphs everywhere.</li> -<li><code>xfce4-notifyd</code> and <code>libnotify</code>, for notifications.</li> -<li><code>cronie</code>, to be able to <code>crontab -e</code>. Make sure to <code>system enable cronie</code>.</li> -<li><code>xarchiver</code> (with <code>p7zip</code>, <code>zip</code>, <code>unzip</code> and <code>unrar</code>) to uncompress stuff.</li> -<li><code>xreader</code> to read <code>.pdf</code> files.</li> -<li><code>sqlitebrowser</code> is always nice to tinker around with SQLite databases.</li> -<li><code>jre8-openjdk</code> if you want to run Java applications.</li> -<li><code>smartmontools</code> is nice with a SSD to view your disk statistics.</li> -</ul> -<p>After that, I configured my Super L key to launch <code>xfce4-popup-whiskermenu</code> so that it opens the application menu, pretty much the same as it would on Windows, moved the panels around and configured them to my needs, and it feels like home once more.</p> -<p>I made some mistakes while <a href="https://wiki.archlinux.org/index.php/Systemd-networkd">configuring systemd-networkd</a> and accidentally added a service that was incorrect, which caused boot to wait for it to timeout before completing. My boot time was taking 90 seconds longer because of this! <a href="https://www.reddit.com/r/archlinux/comments/4nv9yi/my_arch_greets_me_now_with_a_start_job/">The solution was to remove said service</a>, so this is something to look out for.</p> -<p>In order to find what was taking long, I had to edit the <a href="https://wiki.archlinux.org/index.php/kernel_parameters">kernel parameters</a> to remove the <code>quiet</code> option. I prefer seeing the output on what my computer is doing anyway, because it gives me a sense of progress and most importantly is of great value when things go wrong. Another interesting option is <code>noauto,x-systemd.automount</code>, which makes a disk lazily-mounted. If you have a slow disk, this could help speed things up.</p> -<p>If you see a service taking long, you can also use <code>systemd-analyze blame</code> to see what takes the longest, and <code>systemctl list-dependencies</code> is also helpful to find what services are active.</p> -<p>My <code>locale charmap</code> was spitting out a bunch of warnings:</p> -<pre><code class="language-sh">$ locale charmap -locale: Cannot set LC_CTYPE to default locale: No such file or directory -locale: Cannot set LC_MESSAGES to default locale: No such file or directory -locale: Cannot set LC_ALL to default locale: No such file or directory -ANSI_X3.4-1968 -</code></pre> -<p>…ANSI encoding? Immediately I added the following to <code>~/.bashrc</code> and <code>~/.profile</code>:</p> -<pre><code class="language-sh">export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 -export LANGUAGE=en_US.UTF-8 -</code></pre> -<p>For some reason, I also had to edit <code>xfce4-terminal</code>'s preferences in advanced to change the default character encoding to UTF-8. This also solved my issues with pasting things into the terminal, and also proper rendering! I guess pastes were not working because it had some characters that could not be encoded.</p> -<p>To have working notifications, I added the following to <code>~/.bash_profile</code> after <code>exec startx</code>:</p> -<pre><code class="language-sh">systemctl --user start xfce4-notifyd.service -</code></pre> -<p>I'm pretty sure there's a better way to do this, or maybe it's not even necessary, but this works for me.</p> -<p>Some of the other things I had left to do was setting up <code>sccache</code> to speed up Rust builds:</p> -<pre><code class="language-sh">cargo install sccache -echo export RUSTC_WRAPPER=sccache &gt;&gt; ~/.bashrc -</code></pre> -<p>Once I had <code>cargo</code> ready, installed <code>hacksaw</code> and <code>shotgun</code> with it to perform screenshots.</p> -<p>I also disabled the security delay when downloading files in Firefox because it's just annoying, in <code>about:config</code> setting <code>security.dialog_enable_delay</code> to <code>0</code>, and added the <a href="https://alisdair.mcdiarmid.org/kill-sticky-headers/">Kill sticky headers</a> to my bookmarks (you may prefer <a href="https://github.com/t-mart/kill-sticky">the updated version</a>).</p> -<p>The <code>utils-linux</code> comes with a <code>fstrim</code> utility to <a href="https://wiki.archlinux.org/index.php/Solid_state_drive#Periodic_TRIM">trim the SSD weekly</a>, which I want enabled via <code>systemctl enable fstrim.timer</code> (you may also want to <code>start</code> it if you don't reboot often). For more SSD tips, check <a href="https://easylinuxtipsproject.blogspot.com/p/ssd.html">How to optimize your Solid State Drive</a>.</p> -<p>If the sound is funky prior to reboot, try <code>pulseaudio --kill</code> and <code>pulseaudio --start</code>, or delete <code>~/.config/pulse</code>.</p> -<p>I haven't been able to get the brightness keys to work yet, but it's not a big deal, because scrolling on the power manager plugin of Xfce does work (and also <code>xbacklight</code> works, or writing directly to <code>/sys/class/backlight/*</code>).</p> -<h2 id="tuning_windows"><a class="anchor" href="#tuning_windows">¶</a>Tuning Windows</h2> -<p>On the Windows side, I disabled the annoying Windows defender by running (<kbd>Ctrl+R</kbd>) <code>gpedit.msc</code> and editing:</p> -<ul> -<li><em>Computer Configuration &gt; Administrative Templates &gt; Windows Components &gt; Windows Defender » Turn off Windows Defender » Enable</em></li> -<li><em>User Configuration &gt; Administrative Templates &gt; Start Menu and Taskbar » Remove Notifications and Action Center » Enable</em></li> -</ul> -<p>I also updated the <a href="https://github.com/WindowsLies/BlockWindows/raw/master/hosts"><code>hosts</code> file</a> (located at <code>%windir%\system32\Drivers\etc\hosts</code>) with the hope that it will stop some of the telemetry.</p> -<p>Last, to have consistent time on Windows and Linux, I changed the following registry key for a <code>qword</code> with value <code>1</code>:</p> -<pre><code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal -</code></pre> -<p>(The key might not exist, but you can create it if that's the case).</p> -<p>All this time, my laptop had the keyboard lights on, which have been quite annoying. Apparently, they also can cause <a href="https://www.reddit.com/r/ValveIndex/comments/cm6pos/psa_uninstalldisable_aura_sync_lighting_if_you/">massive FPS drops</a>. I headed over to <a href="https://rog.asus.com/downloads/">Asus Rog downloads</a>, selected Aura Sync…</p> -<pre><code class="language-md"># Not Found - -The requested URL /campaign/aura/us/Sync.html was not found on this server. - -Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. -</code></pre> -<p>…great! I'll just find the <a href="https://www.asus.com/campaign/aura/global/">Aura site</a> somewhere else…</p> -<pre><code class="language-md"># ASUS - -# We'll be back. - -Hi, our website is temporarily closed for service enhancements. - -We'll be back shortly.Thank you for your patience! -</code></pre> -<p>Oh come on. After waiting for the next day, I headed over, downloaded their software, tried to install it and it was an awful experience. It felt like I was purposedly installing malware. It spammed and flashed a lot of <code>cmd</code>'s on screen as if it was a virus. It was stuck at 100% doing that and then, Windows blue-screened with <code>KERNEL_MODE_HEAP_CORRUPTION</code>. Amazing. How do you screw up this bad?</p> -<p>Well, at least rebooting worked. I tried to <a href="https://answers.microsoft.com/en-us/windows/forum/all/unable-to-uninstall-asus-aura-sync-utility/e9bec36c-e62f-4773-80be-88fb68dace16">uninstall Aura, but of course that failed</a>. Using the <a href="https://support.microsoft.com/en-us/help/17588/windows-fix-problems-that-block-programs-being-installed-or-removed">troubleshooter to uninstall programs</a> helped me remove most of the crap that was installed.</p> -<p>After searching around how to disable the lights (because <a href="https://rog.asus.com/forum/showthread.php?112786-Option-to-Disable-Aura-Lights-on-Strix-G-series-(G531GT)-irrespective-of-OSes">my BIOS did not have this setting</a>), I stumbled upon <a href="https://rog.asus.com/us/innovation/armoury_crate/">&quot;Armoury Crate&quot;</a>. Okay, fine, I will install that.</p> -<p>The experience wasn't much better. It did the same thing with a lot of consoles flashing on screen. And of course, it resulted in another blue-screen, this time <code>KERNEL_SECURITY_CHECK_FAILURE</code>. To finish up, the BSOD kept happening as I rebooted the system. <del>Time to reinstall Windows once more.</del> After booting and crashing a few more times I could get into secure mode and perform the reinstall from there, which saved me from burning the <code>.iso</code> again.</p> -<p>Asus software might be good, but the software is utter crap.</p> -<p>After trying out <a href="https://github.com/wroberts/rogauracore">rogauracore</a> (which didn't list my model), it worked! I could disable the stupid lights from Linux, and <a href="https://gitlab.com/CalcProgrammer1/OpenRGB/-/wikis/home">OpenRGB</a> also works on Windows which may be worth checking out too.</p> -<p>Because <code>rougauracore</code> helped me and they linked to <a href="https://github.com/linuxhw/hw-probe/blob/master/README.md#appimage">hw-probe</a>, I decided to <a href="https://linux-hardware.org/?probe=0e3e48c501">run it on my system</a>, with the hopes it is useful for other people.</p> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing words</h2> -<p>I hope the installation journey is at least useful to someone, or that you enjoyed reading about it all. If not, sorry!</p> -</main> -</body> -</html> - </content></entry><entry><title>Tips for Outpost</title><id>dist/tips-outpost/index.html</id><updated>2020-05-21T22:00:00+00:00</updated><published>2020-05-09T22:00:00+00:00</published><summary>Outpost</summary><content type="html" src="dist/tips-outpost/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Tips for Outpost</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="tips_for_outpost"><a class="anchor" href="#tips_for_outpost">¶</a>Tips for Outpost</h1> -<div class="date-created-modified">Created 2020-05-10<br> -Modified 2020-05-22</div> -<p><a href="https://store.steampowered.com/app/1127110/Outpost/">Outpost</a> is a fun little game by Open Mid Interactive that has popped in recently in my recommended section of Steam, and I decided to give it a try.</p> -<p>It's a fun tower-defense game with progression, different graphics and random world generation which makes it quite fun for a few hours. In this post I want to talk about some tips I found useful to get past night 50.</p> -<h2 id="build_pattern"><a class="anchor" href="#build_pattern">¶</a>Build Pattern</h2> -<p>At first, you may be inclined to design a checkerboard pattern like the following, where &quot;C&quot; is the Crystal shrine, &quot;S&quot; is a stone launcher and &quot;B&quot; is a booster:</p> -<div class="image-container"> -<img src="outpost-bad-pattern.svg" alt="Bad Outpost build pattern" /> -<div class="image-caption"></div> -</div> -<p> -<p>Indeed, this pattern will apply <strong>4</strong> boosts to every turret, but unfortunately, the other 4 slots of the booster are wasted! This is because boosters are able to power 8 different towers, and you really want to maximize that. Here's a better design:</p> -<div class="image-container"> -<img src="outpost-good-pattern.svg" alt="Good Outpost build pattern" /> -<div class="image-caption"></div> -</div> -<p> -<p>The shrine's tower does get boosted, but it's still not really worth it to boost it. This pattern works good, and it's really easy to tile: just repeat the same 3x3 pattern.</p> -<p>Nonetheless, we can do better. What if we applied multiple boosters to the same tower while still applying all 8 boosts?</p> -<div class="image-container"> -<img src="outpost-best-pattern.svg" alt="Best Outpost build pattern" /> -<div class="image-caption"></div> -</div> -<p> -<p>That's what peak performance looks like. You can actually apply multiple boosters to the same tower, and it works great.</p> -<p>Now, is it really worth it building anywhere except around the shrine? Not really. You never know where a boss will come from, so all sides need a lot of defense if you want to stand a chance.</p> -<p>The addition of traps in 1.6 is amazing. You want to build these outside your strong &quot;core&quot;, mostly to slow the enemies down so your turrets have more time to finish them off. Don't waste boosters on the traps, and build them at a reasonable distance from the center (the sixth tile is a good spot):</p> -<div class="image-container"> -<img src="outpost-trap-pattern.svg" alt="Trap Outpost build pattern" /> -<div class="image-caption"></div> -</div> -<p> -<p>If you gather enough materials, you can build more trap and cannon layers outside, roughly at enough distance to slow them for enough duration until they reach the next layer of traps, and so on. Probably a single gap of &quot;cannon, booster, cannon&quot; is enough between trap layers, just not in the center where you need a lot of fire power.</p> -<h2 id="talents"><a class="anchor" href="#talents">¶</a>Talents</h2> -<p>Talents are the way progression works in the game. Generally, after a run, you will have enough experience to upgrade nearly all talents of roughly the same tier. However, some are worth upgrading more than others (which provide basically no value).</p> -<p>The best ones to upgrade are:</p> -<ul> -<li>Starting supplies. Amazing to get good tools early.</li> -<li>Shrine shield. Very useful to hold against tough bosses.</li> -<li>Better buildings (cannon, boosters, bed and traps). They're a must to deal the most damage.</li> -<li>Better pickaxe. Stone is limited, so better make good use of it.</li> -<li>Better chests. They provide an insane amount of resources early.</li> -<li>Winter slow. Turrets will have more time to deal damage, it's perfect.</li> -<li>More time. Useful if you're running out, although generally you enter nights early after having a good core anyway.</li> -<li>More rocks. Similar to a better pickaxe, more stone is always better.</li> -</ul> -<p>Some decent ones:</p> -<ul> -<li>In-shrine turret. It's okay to get past the first night without building but not much beyond that.</li> -<li>Better axe and greaves. Great to save some energy and really nice quality of life to move around.</li> -<li>Tree growth. Normally there's enough trees for this not to be an issue but it can save some time gathering wood.</li> -<li>Wisps. They're half-decent since they can provide materials once you max out or max out expensive gear.</li> -</ul> -<p>Some okay ones:</p> -<ul> -<li>Extra XP while playing. Generally not needed due to the way XP scales per night, but can be a good boost.</li> -<li>Runestones. Not as reliable as chests but some can grant more energy per day.</li> -</ul> -<p>Some crap ones:</p> -<ul> -<li>Boosts for other seasons. I mean, winter is already the best, no use there.</li> -<li>Bow. The bow is very useless at the moment, it's not worth your experience.</li> -<li>More energy per bush. Not really worth hunting for bushes since you will have enough energy to do well.</li> -</ul> -<h2 id="turrets"><a class="anchor" href="#turrets">¶</a>Turrets</h2> -<p>Always build the highest tier, there's no point in anything lower than that. You will need to deal a lot of damage in a small area, which means space is a premium.</p> -<h2 id="boosters"><a class="anchor" href="#boosters">¶</a>Boosters</h2> -<p>If you're very early in the game, I recommend alternating both the flag and torch in a checkerboard pattern where the boosters should go in the pattern above. This way your towers will get extra speed and extra range, which works great.</p> -<p>When you're in mid-game (stone launchers, gears and campfires), I do not recommend using campfires. The issue is their range boost is way too long, and the turrets will miss quite a few shots. It's better to put all your power into fire speed for increased DPS, at least near the center. If you manage to build too far out and some of the turrets hardly ever shoot, you may put campfires there.</p> -<p>In end-game, of course alternate both of the highest tier upgrades. They are really good, and provide the best benefit / cost ratio.</p> -<h2 id="gathering_materials"><a class="anchor" href="#gathering_materials">¶</a>Gathering Materials</h2> -<p>It is <strong>very</strong> important to use all your energy every day! Otherwise it will go to waste, and you will need a lot of materials.</p> -<p>As of 1.6, you can mine two things at once if they're close enough! I don't know if this is intended or a bug, but it sure is great.</p> -<p>Once you're in mid-game, your stone-based fort should stand pretty well against the nights on its own. After playing for a while you will notice, if your base can defend a boss, then it will have no issue carrying you through the nights until the next boss. You can (and should!) spend the nights gathering materials, but only when you're confident that the night won't run out.</p> -<p>Before the boss hits (every fifth night), come back to your base and use all of your materials. This is the next fort upgrade that will carry it the five next nights.</p> -<p>You may also speed up time during night, but make sure you use all your energy before hand. And also take care, in the current version of the game speeding up time only speeds up monster movement, not the fire rate or projectile speed of your turrets! This means they will miss more shots and can be pretty dangerous. If you're speeding up time, consider speeding it up for a little bit, then go back to normal until things are more calm, and repeat.</p> -<p>If you're in the end-game, try to rush for chests. They provide a huge amount of materials which is really helpful to upgrade all your tools early so you can make sure to get the most out of every rock left in the map.</p> -<p>In the end-game, after all stone has been collected, you don't really need to use all of your energy anymore. Just enough to have enough wood to build with the remaining stone. This will also be nice with the bow upgrades, which admitedly can get quite powerful, but it's best to have a strong fort first.</p> -<h2 id="season"><a class="anchor" href="#season">¶</a>Season</h2> -<p>In my opinion, winter is just the best of the seasons. You don't <em>really</em> need that much energy (it gets tiresome), or extra tree drops, or luck. Slower movement means your turrets will be able to shoot enemies for longer, dealing more damage over time, giving them more chance to take enemies out before they reach the shrine.</p> -<p>Feel free to re-roll the map a few times (play and exit, or even restart the game) until you get winter if you want to go for The Play.</p> -<h2 id="gear"><a class="anchor" href="#gear">¶</a>Gear</h2> -<p>In my opinion, you really should rush for the best pickaxe you can afford. Stone is a limited resource that doesn't regrow like trees, so once you run out, it's over. Better to make the best use out of it with a good pickaxe!</p> -<p>You may also upgrade your greaves, we all known faster movement is a <em>really</em> nice quality of life improvement.</p> -<p>Of course, you will eventually upgrade your axe to chop wood (otherwise it's wasted energy, really), but it's not as much of a priority as the pickaxe.</p> -<p>Now, the bow is completely useless. Don't bother with it. Your energy is better spent gathering materials to build permanent turrets that deal constant damage while you're away, and the damage adds up with every extra turret you build.</p> -<p>With regards to items you carry (like sword, or helmet), look for these (from best to worst):</p> -<ul> -<li>Less minion life.</li> -<li>Chance to not consume energy.</li> -<li>+1 turret damage.</li> -<li>Extra energy.</li> -<li>+1 drop from trees or stones.</li> -<li>+1 free wood or stone per day.</li> -</ul> -<p>Less minion life, nothing to say. You will need it near end-game.</p> -<p>The chance to not consume energy is better the more energy you have. With a 25% chance not to consume energy, you can think of it as 1 extra energy for every 4 energy you have on average.</p> -<p>Turret damage is a tough one, it's <em>amazing</em> mid-game (it basically doubles your damage) but falls short once you unlock the cannon where you may prefer other items. Definitely recommended if you're getting started. You may even try to roll it on low tiers by dying on the second night, because it's that good.</p> -<p>Extra energy is really good, because it means you can get more materials before it gets too rough. Make sure you have built at least two beds in the first night! This extra energy will pay of for the many nights to come.</p> -<p>The problem with free wood or stone per day is that you have, often, five times as much energy per day. By this I mean you can get easily 5 stone every day, which means 5 extra stone, whereas the other would provide just 1 per night. On a good run, you will get around 50 free stone or 250 extra stone. It's a clear winner.</p> -<p>In end-game, more quality of life are revealing chests so that you can rush them early, if you like to hunt for them try to make better use of the slot.</p> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing words</h2> -<p>I hope you enjoy the game as much as I do! Movement is sometimes janky and there's the occassional lag spikes, but despite this it should provide at least a few good hours of gameplay. Beware however a good run can take up to an hour!</p> -</main> -</body> -</html> - </content></entry><entry><title>Installing NixOS, Take 2</title><id>dist/installing_nixos_2/index.html</id><updated>2019-02-15T23:00:00+00:00</updated><published>2019-02-14T23:00:00+00:00</published><summary>This is my second take at installing NixOS, after a while being frustrated with Arch Linux and the fact that a few kernel upgrades ago, the system crashed randomly from time to time. </summary><content type="html" src="dist/installing_nixos_2/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Installing NixOS, Take 2</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="installing_nixos_take_2"><a class="anchor" href="#installing_nixos_take_2">¶</a>Installing NixOS, Take 2</h1> -<div class="date-created-modified">Created 2019-02-15<br> -Modified 2019-02-16</div> -<p>This is my second take at installing NixOS, after a while being frustrated with Arch Linux and the fact that a few kernel upgrades ago, the system crashed randomly from time to time. <code>journalctl</code> did not have any helpful hints and I thought reinstalling could be worthwhile anyway.</p> -<p>This time, I started with more knowledge! The first step is heading to the <a href="https://nixos.org">NixOS website</a> and downloading their minimal installation CD for 64 bits. I didn't go with their graphical live CD, because their <a href="https://nixos.org/nixos/manual">installation manual</a> is a wonderful resource that guides you nicely.</p> -<p>Once you have downloaded their <code>.iso</code>, you should probably verify it's <code>sha256sum</code> and make sure that it matches. The easiest thing to do in my opinion is using an USB to burn the image in it. Plug it in and check its device name with <code>fdisk -l</code>. In my case, it was <code>/dev/sdb</code>, so I went ahead with it and ran <code>dd if=nixos.iso of=/dev/sdb status=progress</code>. Make sure to run <code>sync</code> once that's done.</p> -<p>If either <code>dd</code> or <code>sync</code> seem &quot;stuck&quot; in the end, they are just flushing the changes to disk to make sure all is good. This is normal, and depends on your drives.</p> -<p>Now, reboot your computer with the USB plugged in and make sure to boot into it. You should be welcome with a pretty screen. Just select the first option and wait until it logs you in as root. Once you're there you probably want to <code>loadkeys es</code> or whatever your keyboard layout is, or you will have a hard time with passwords, since the characters are all over the place.</p> -<p>In a clean disk, you would normally create the partitions now. In my case, I already had the partitions made (100MB for the EFI system, where <code>/boot</code> lives, 40GB for the root <code>/</code> partition with my old Linux installation, and 700G for <code>/home</code>), so I didn't need to do anything here. The manual showcases <code>parted</code>, but I personally use <code>fdisk</code>, which has very helpful help I check every time I use it.</p> -<p><strong>Important</strong>: The <code>XY</code> in <code>/dev/sdXY</code> is probably different in your system! Make sure you use <code>fdisk -l</code> to see the correct letters and numbers!</p> -<p>With the partitions ready in my UEFI system, I formatted both <code>/</code> and <code>/boot</code> just to be safe with <code>mkfs.ext4 -L nixos /dev/sda2</code> and <code>mkfs.fat -F 32 -n boot /dev/sda1</code> (remember that these are the letters and numbers used in my partition scheme). Don't worry about the warning in the second command regarding lowercase letters and Windows. It's not really an issue.</p> -<p>Now, since we gave each partition a label, we can easily mount them through <code>mount /dev/disk/by-label/nixos /mnt</code> and, in UEFI systems, be sure to <code>mkdir -p /mnt/boot</code> and <code>mount /dev/disk/by-label/boot /mnt/boot</code>. I didn't bother setting up swap, since I have 8GB of RAM in my laptop and that's really enough for my use case.</p> -<p>With that done, we will now ask the configuration wizard to do some work for us (in particular, generate a template) with <code>nixos-generate-config --root /mnt</code>. This generates a very well documented file that we should edit right now (and this is important!) with whatever editor you prefer. I used <code>vim</code>, but you can change it for <code>nano</code> if you prefer.</p> -<p>On to the configuration file, we need to enable a few things, so <code>vim /mnt/etc/nixos/configuration.nix</code> and start scrolling down. We want to make sure to uncomment:</p> -<pre><code># We really want network! -networking.wireless.enable = true; - -# This &quot;fixes&quot; the keyboard layout. Put the one you use. -i18n = { -consoleKeyMap = &quot;es&quot;; -} - -# Timezones are tricky so let's get this right. -time.timeZone = &quot;Europe/Madrid&quot;; - -# We *really* want some base packages installed, such as -# wpa_supplicant, or we won't have a way to connect to the -# network once we install... -environment.systemPackages = with pkgs; [ -wpa_supplicant wget curl vim neovim cmus mpv firefox git tdesktop -]; - -# Printing is useful, sure, enable CUPS -services.printing.enable = true; - -# We have speakers, let's make use of them. -sound.enable = true; -hardware.pulseaudio.enable = true; - -# We want the X11 windowing system enabled, in Spanish. -services.xserver.enable = true; -services.xserver.layout = &quot;es&quot;; - -# I want a desktop manager in my laptop. -# I personally prefer XFCE, but the manual shows plenty -# of other options, such as Plasma, i3 WM, or whatever. -services.xserver.desktopManager.xfce.enable = true; -services.xserver.desktopManager.default = &quot;xfce&quot;; - -# Touchpad is useful (although sometimes annoying) in a laptop -services.xserver.libinput.enable = true; - -# We don't want to do everything as root! -users.users.lonami = { -isNormalUser = true; -uid = 1000; -home = &quot;/home/lonami&quot;; -extraGroups = [ &quot;wheel&quot; &quot;networkmanager&quot; &quot;audio&quot; ]; -}; -</code></pre> -<p><em>(Fun fact, I overlooked the configuration file until I wrote this and hadn't noticed sound/pulseaudio was there. It wasn't hard to find online how to enable it though!)</em></p> -<p>Now, let's modify <code>hardware-configuration.nix</code>. But if you have <code>/home</code> in a separate partition like me, you should run <code>blkid</code> to figure out its UUID. To avoid typing it out myself, I just ran <code>blkid &gt;&gt; /mnt/etc/nixos/hardware-configuration.nix</code> so that I could easily move it around with <code>vim</code>:</p> -<pre><code># (stuff...) - -fileSystems.&quot;/home&quot; = -{ device = &quot;/dev/disk/by-uuid/d344c686-cae7-4dd3-840e-308eddf86608&quot;; -fsType = &quot;ext4&quot;; -}; - -# (more stuff...) -</code></pre> -<p>Note that, obviously, you should put your own partition's UUID there. Modifying the configuration is where I think the current NixOS' manual should have made more emphasis, at this step of the installation. They do detail it below, but that was already too late in my first attempt. Anyway, you can boot from the USB and run <code>nixos-install</code> as many times as you need until you get it working!</p> -<p>But before installing, we need to configure the network since there are plenty of things to download. If you want to work from WiFi, you should first figure out the name of your network card with <code>ip link show</code>. In my case it's called <code>wlp3s0</code>. So with that knowledge we can run <code>wpa_supplicant -B -i wlp3s0 -c &lt;(wpa_passphrase SSID key)</code>. Be sure to replace both <code>SSID</code> and <code>key</code> with the name of your network and password key, respectively. If they have spaces, surround them in quotes.</p> -<p>Another funny pitfall was typing <code>wpa_supplicant</code> in the command above twice (instead of <code>wpa_passphrase</code>). That sure spit out a few funny errors! Once you have ran that, wait a few seconds and <code>ping 1.1.1.1</code> to make sure that you can reach the internet. If you do, <code>^C</code> and let's install NixOS!</p> -<pre><code>nixos-install -</code></pre> -<p>Well, that was pretty painless. You can now <code>reboot</code> and enjoy your new, functional system.</p> -<h2 id="afterword"><a class="anchor" href="#afterword">¶</a>Afterword</h2> -<p>The process of installing NixOS was really painless once you have made sense out of what things mean. I was far more pleased this time than in my previous attempt, despite the four attempts I needed to have it up and running.</p> -<p>However not all is so good. I'm not sure where I went wrong, but the first time I tried with <code>i3</code> instead of <code>xfce</code>, all I was welcome with was a white, small terminal in the top left corner. I even generated a configuration file with <code>i3-config-wizard</code> to make sure it could detect my Mod1/Mod4 keys (which, it did), but even after rebooting, my commands weren't responding. For example, I couldn't manage to open another terminal with <code>Mod1+Enter</code>. I'm not even sure that I was in <code>i3</code>…</p> -<p>In my very first attempt, I pressed <code>Alt+F8</code> as suggested in the welcome message. This took me an offline copy of the manual, which is really nicely done. Funny enough, though, I couldn't exit <code>w3m</code>. Both <code>Q</code> and <code>B</code> to quit and take me back wouldn't work. Somehow, it kept throwing me back into <code>w3m</code>, so I had to forcibly shutdown.</p> -<p>In my second attempt, I also forgot to configure network, so I had no way to download <code>wpa_supplicant</code> without having <code>wpa_supplicant</code> itself to connect my laptop to the network! So, it was important to do that through the USB before installing it (which comes with the program preinstalled), just by making sure to add it in the configuration file.</p> -<p>Some other notes, if you can't reach the internet, don't add any DNS in <code>/etc/resolv.conf</code>. This should be done declaratively in <code>configuration.nix</code>.</p> -<p>In the end, I spent the entire afternoon playing around with it, taking breaks and what-not. I still haven't figured out why <code>nvim</code> was printing the literal escape character when going from normal to insert mode in the <code>xfce4-terminal</code> (and other actions also made it print this &quot;garbage&quot; to the console), why sometimes the network can reach the internet (and only some sites!) and sometimes not, and how to setup dualboot.</p> -<p>But despite all of this, I think it was a worth installing it again. One sure sees things from a different perspective, and gets the chance to write another blog post!</p> -<p>If there's something I overlooked or that could be done better, or maybe you can explain it differently, please be sure to <a href="https://lonami.dev/contact">contact me</a> to let me know!</p> -<h2 id="update"><a class="anchor" href="#update">¶</a>Update</h2> -<p>Well, that was surprisingly fast feedback. Thank you very much <a href="https://bb010g.keybase.pub/">@bb010g</a> for it! As they rightfully pointed out, one can avoid adding <code>/home</code> manually to <code>hardware-configuration.nix</code> if you mount it before generating the configuration files. However, the installation process doesn't need <code>/home</code> mounted, so I didn't do it.</p> -<p>The second weird issue with <code>w3m</code> is actually a funny one. <code>Alt+F8</code> <em>switches to another TTY</em>! That's why quitting the program wouldn't do anything. You'd still be in a different TTY! Normally, this is <code>Ctrl+Alt+FX</code>, so I hadn't even thought that this is what could be happening. Anyway, the solution is not quitting the program, but rather going back to the main TTY with <code>Alt+F1</code>. You can switch back and forth all you need to consult the manual.</p> -<p>More suggestions are having <a href="https://github.com/rycee/home-manager"><code>home-manager</code></a> manage the graphical sessions, since it should be easier to deal with than the alternatives.</p> -<p>Despite having followed the guide and having read it over and over several times, it seems like my thoughts in this blog post may be a bit messy. So I recommend you also reading through the guide to have two versions of all this, just in case.</p> -<p>Regarding network issues, they use <code>connman</code> so that may be worth checking out.</p> -<p>Regarding terminal issues with <code>nvim</code> printing the literal escape character, I was told off for not having checked what my <code>$TERM</code> was. I hadn't really looked into it much myself, just complained about it here, so sorry for being annoying about that. A quick search in the <code>nixpkgs</code> repository lets us find <a href="https://github.com/NixOS/nixpkgs/blob/release-18.09/pkgs/applications/editors/neovim/default.nix">neovim/default.nix</a>, with version 0.3.1. Looking at <a href="https://github.com/neovim/neovim">Neovim's main repository</a> we can see that this is a bit outdated, but that is fine.</p> -<p>If only I had bothered to look at <a href="https://github.com/neovim/neovim/wiki/FAQ#nvim-shows-weird-symbols-2-q-when-changing-modes">Neovim's wiki</a>, (which they found through <a href="https://github.com/neovim/neovim/issues/7749">Neovim's GitHub issues</a>) I would've seen that some terminals just don't support the program properly. The solution is, of course, to use a different terminal emulator with better support or to disable the <code>guicursor</code> in Neovim's config.</p> -<p>This is a pretty good life lesson. 30 seconds of searching, maybe two minutes and a half for also checking XFCE issues, are often more than enough to troubleshoot your issues. The internet is a big place and more people have surely came across the problem before, so make sure to look online first. In my defense I'll say that it didn't bother me so much so I didn't bother looking for that soon either.</p> -</main> -</body> -</html> - </content></entry><entry><title>Installing NixOS</title><id>dist/installing_nixos/index.html</id><updated>2019-02-15T23:00:00+00:00</updated><published>2017-05-12T22:00:00+00:00</published><summary>Please see </summary><content type="html" src="dist/installing_nixos/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Installing NixOS</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="installing_nixos"><a class="anchor" href="#installing_nixos">¶</a>Installing NixOS</h1> -<div class="date-created-modified">Created 2017-05-13<br> -Modified 2019-02-16</div> -<h2 id="update"><a class="anchor" href="#update">¶</a>Update</h2> -<p><em>Please see <a href="../installing_nixos_2/index.html">my followup post with NixOS</a> for a far better experience with it</em></p> -<hr /> -<p>Today I decided to install <a href="http://nixos.org/">NixOS</a> as a recommendation, a purely functional Linux distribution, since <a href="https://xubuntu.org/">Xubuntu</a> kept crashing. Here's my journey, and how I managed to install it from a terminal for the first time in my life. Steps aren't hard, but they may not seem obvious at first.</p> -<ul> -<li> -<p>Grab the Live CD, burn it on a USB stick and boot. I recommend using <a href="https://etcher.io/">Etcher</a>.</p> -</li> -<li> -<p>Type <code>systemctl start display-manager</code> and wait.<sup class="footnote-reference" id="r.1"><a href="#f.1">1</a></sup></p> -</li> -<li> -<p>Open both the manual and the <code>konsole</code>.</p> -</li> -<li> -<p>Connect to the network using the GUI.</p> -</li> -<li> -<p>Create the disk partitions by using <code>fdisk</code>.</p> -<p>You can list them with <code>fdisk -l</code>, modify a certain drive with <code>fdisk /dev/sdX</code> (for instance, <code>/dev/sda</code>) and follow the instructions.</p> -<p>To create the file system, use <code>mkfs.ext4 -L &lt;label&gt; /dev/sdXY</code> and swap with <code>mkswap -L &lt;label&gt; /dev/sdXY</code>.</p> -<p>The EFI partition should be done with <code>mkfs.vfat</code>.</p> -</li> -<li> -<p>Mount the target to <code>/mnt</code> e.g. if the label was <code>nixos</code>, <code>mount /dev/disk/by-label/nixos /mnt</code></p> -</li> -<li> -<p><code>mkdir /mnt/boot</code> and then mount your EFI partition to it.</p> -</li> -<li> -<p>Generate a configuration template with <code>nixos-generate-config --root /mnt</code>, and modify it with <code>nano /etc/nixos/configuration.nix</code>.</p> -</li> -<li> -<p>While modifying the configuration, make sure to add <code>boot.loader.grub.device = &quot;/dev/sda&quot;</code></p> -</li> -<li> -<p>More useful configuration things are:</p> -<ul> -<li>Uncomment the whole <code>i18n</code> block.</li> -<li>Add some essential packages like <code>environment.systemPackages = with pkgs; [wget git firefox pulseaudio networkmanagerapplet];</code>.</li> -<li>If you want to use XFCE, add <code>services.xserver.desktopManager.xfce.enable = true;</code>, otherwise, you don't need <code>networkmanagerapplet</code> either. Make sure to add <code>networking.networkmanager.enable = true;</code> too.</li> -<li>Define some user for yourself (modify <code>guest</code> name) and use a UID greater than 1000. Also, add yourself to <code>extraGroups = [&quot;wheel&quot; &quot;networkmanager&quot;];</code> (the first to be able to <code>sudo</code>, the second to use network related things).</li> -</ul> -</li> -<li> -<p>Run <code>nixos-install</code>. If you ever modify that file again, to add more packages for instance (this is how they're installed), run <code>nixos-rebuild switch</code> (or use <code>test</code> to test but don't boot to it, or <code>boot</code> not to switch but to use on next boot.</p> -</li> -<li> -<p><code>reboot</code>.</p> -</li> -<li> -<p>Login as <code>root</code>, and set a password for your user with <code>passwd &lt;user&gt;</code>. Done!</p> -</li> -</ul> -<p>I enjoyed the process of installing it, and it's really cool that it has versioning and is so clean to keep track of which packages you install. But not being able to run arbitrary binaries by default is something very limitting in my opinion, though they've done a good job.</p> -<p>I'm now back to Xubuntu, with a fresh install.</p> -<h2 id="update_2"><a class="anchor" href="#update_2">¶</a>Update</h2> -<p>It is not true that &quot;they don't allow running arbitrary binaries by default&quot;, as pointed out in their <a href="https://nixos.org/nixpkgs/manual/#sec-fhs-environments">manual, buildFHSUserEnv</a>:</p> -<blockquote> -<p><code>buildFHSUserEnv</code> provides a way to build and run FHS-compatible lightweight sandboxes. It creates an isolated root with bound <code>/nix/store</code>, so its footprint in terms of disk space needed is quite small. This allows one to run software which is hard or unfeasible to patch for NixOS -- 3rd-party source trees with FHS assumptions, games distributed as tarballs, software with integrity checking and/or external self-updated binaries. It uses Linux namespaces feature to create temporary lightweight environments which are destroyed after all child processes exit, without root user rights requirement.</p> -</blockquote> -<p>Thanks to <a href="https://github.com/bb010g">@bb010g</a> for pointing this out.</p> -<h2 id="notes"><a class="anchor" href="#notes">¶</a>Notes</h2> -<p class="footnote" id="f.1"><sup>1</sup> The keyboard mapping is a bit strange. On my Spanish keyboard, the keys were as follows: <a href="#r.1">↩</a></p> -<table><thead><tr><th>Keyboard</th><th>Maps to</th><th>Shift</th></tr></thead><tbody> -<tr><td>'</td><td>-</td><td>_</td></tr> -<tr><td>´</td><td>'</td><td>&quot;</td></tr> -<tr><td>`</td><td>[</td><td></td></tr> -<tr><td>+</td><td>]</td><td></td></tr> -<tr><td>¡</td><td>=</td><td></td></tr> -<tr><td>-</td><td>/</td><td></td></tr> -<tr><td>ñ</td><td>;</td><td></td></tr> -</tbody></table> -</main> -</body> -</html> - </content></entry><entry><title>WorldEdit Commands</title><id>dist/world_edit/index.html</id><updated>2018-07-10T22:00:00+00:00</updated><published>2018-07-10T22:00:00+00:00</published><summary>WorldEdit</summary><content type="html" src="dist/world_edit/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>WorldEdit Commands</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="worldedit_commands"><a class="anchor" href="#worldedit_commands">¶</a>WorldEdit Commands</h1> -<div class="date-created-modified">2018-07-11</div> -<p><a href="https://dev.bukkit.org/projects/worldedit">WorldEdit</a> is an extremely powerful tool for modifying entire worlds within <a href="https://minecraft.net">Minecraft</a>, which can be used as either a mod for your single-player worlds or as a plugin for your <a href="https://getbukkit.org/">Bukkit</a> servers.</p> -<p>This command guide was written for Minecraft 1.12.1, version <a href="https://dev.bukkit.org/projects/worldedit/files/2460562">6.1.7.3</a>, but should work for newer versions too. All WorldEdit commands can be used with a double slash (<code>//</code>) so they don't conlict with built-in commands. This means you can get a list of all commands with <code>//help</code>. Let's explore different categories!</p> -<h2 id="movement"><a class="anchor" href="#movement">¶</a>Movement</h2> -<p>In order to edit a world properly you need to learn how to move in said world properly. There are several straightforward commands that let you move:</p> -<ul> -<li><code>//ascend</code> goes up one floor.</li> -<li><code>//descend</code> goes down one floor.</li> -<li><code>//thru</code> let's you pass through walls.</li> -<li><code>//jumpto</code> to go wherever you are looking.</li> -</ul> -<h2 id="information"><a class="anchor" href="#information">¶</a>Information</h2> -<p>Knowing your world properly is as important as knowing how to move within it, and will also let you change the information in said world if you need to.</p> -<ul> -<li><code>//biomelist</code> shows all known biomes.</li> -<li><code>//biomeinfo</code> shows the current biome.</li> -<li><code>//setbiome</code> lets you change the biome.</li> -</ul> -<h2 id="blocks"><a class="anchor" href="#blocks">¶</a>Blocks</h2> -<p>You can act over all blocks in a radius around you with quite a few commands. Some won't actually act over the entire range you specify, so 100 is often a good number.</p> -<h3 id="filling"><a class="anchor" href="#filling">¶</a>Filling</h3> -<p>You can fill pools with <code>//fill water 100</code> or caves with <code>//fillr water 100</code>, both of which act below your feet.</p> -<h3 id="fixing"><a class="anchor" href="#fixing">¶</a>Fixing</h3> -<p>If the water or lava is buggy use <code>//fixwater 100</code> or <code>//fixlava 100</code> respectively.</p> -<p>Some creeper removed the snow or the grass? Fear not, you can use <code>//snow 10</code> or <code>//grass 10</code>.</p> -<h3 id="emptying"><a class="anchor" href="#emptying">¶</a>Emptying</h3> -<p>You can empty a pool completely with <code>//drain 100</code>, remove the snow with <code>//thaw 10</code>, and remove fire with <code>//ex 10</code>.</p> -<h3 id="removing"><a class="anchor" href="#removing">¶</a>Removing</h3> -<p>You can remove blocks above and below you in some area with the <code>//removeabove N</code> and <code>//removebelow N</code>. You probably want to set a limit though, or you could fall off the world with <code>//removebelow 1 10</code> for radius and depth. You can also remove near blocks with <code>//removenear block 10</code>.</p> -<h3 id="shapes"><a class="anchor" href="#shapes">¶</a>Shapes</h3> -<p>Making a cylinder (or circle) can be done with through <code>//cyl stone 10</code>, a third argument for the height. The radius can be comma-separated to make a ellipses instead, such as <code>//cyl stone 5,10</code>.</p> -<p>Spheres are done with <code>//sphere stone 5</code>. This will build one right at your center, so you can raise it to be on your feet with <code>//sphere stone 5 yes</code>. Similar to cylinders, you can comma separate the radius <code>x,y,z</code>.</p> -<p>Pyramids can be done with <code>//pyramic stone 5</code>.</p> -<p>All these commands can be prefixed with &quot;h&quot; to make them hollow. For instance, <code>//hsphere stone 10</code>.</p> -<h2 id="regions"><a class="anchor" href="#regions">¶</a>Regions</h2> -<h3 id="basics"><a class="anchor" href="#basics">¶</a>Basics</h3> -<p>Operating over an entire region is really important, and the first thing you need to work comfortably with them is a tool to make selections. The default wooden-axe tool can be obtained with <code>//wand</code>, but you must be near the blocks to select. You can use a different tool, like a golden axe, to use as your &quot;far wand&quot; (wand usable over distance). Once you have one in your hand type <code>//farwand</code> to use it as your &quot;far wand&quot;. You can select the two corners of your region with left and right click. If you have selected the wrong tool, use <code>//none</code> to clear it.</p> -<p>If there are no blocks but you want to use your current position as a corner, use <code>//pos1</code> or 2.</p> -<p>If you made a region too small, you can enlarge it with <code>//expand 10 up</code>, or <code>//expand vert</code> for the entire vertical range, etc., or make it smaller with <code>//contract 10 up</code> etc., or <code>//inset</code> it to contract in both directions. You can use short-names for the cardinal directions (NSEW).</p> -<p>Finally, if you want to move your selection, you can <code>//shift 1 north</code> it to wherever you need.</p> -<h3 id="information_2"><a class="anchor" href="#information_2">¶</a>Information</h3> -<p>You can get the <code>//size</code> of the selection or even <code>//count torch</code> in some area. If you want to count all blocks, get their distribution <code>//distr</code>.</p> -<h3 id="filling_2"><a class="anchor" href="#filling_2">¶</a>Filling</h3> -<p>With a region selected, you can <code>//set</code> it to be any block! For instance, you can use <code>//set air</code> to clear it entirely. You can use more than one block evenly by separting them with a comma <code>//set stone,dirt</code>, or with a custom chance <code>//set 20%stone,80%dirt</code>.</p> -<p>You can use <code>//replace from to</code> instead if you don't want to override all blocks in your selection.</p> -<p>You can make an hollow set with <code>//faces</code>, and if you just want the walls, use <code>//walls</code>.</p> -<h3 id="cleaning"><a class="anchor" href="#cleaning">¶</a>Cleaning</h3> -<p>If someone destroyed your wonderful snow landscape, fear not, you can use <code>//overlay snow</code> over it (although for this you actually have <code>//snow N</code> and its opposite <code>//thaw</code>).</p> -<p>If you set some rough area, you can always <code>//smooth</code> it, even more than one time with <code>//smooth 3</code>. You can get your dirt and stone back with <code>//naturalize</code> and put some plants with <code>//flora</code> or <code>//forest</code>, both of which support a density or even the type for the trees. If you already have the dirt use <code>//green</code> instead. If you want some pumpkins, with <code>//pumpkins</code>.</p> -<h3 id="moving"><a class="anchor" href="#moving">¶</a>Moving</h3> -<p>You can repeat an entire selection many times by stacking them with <code>//stack N DIR</code>. This is extremely useful to make things like corridors or elevators. For instance, you can make a small section of the corridor, select it entirely, and then repeat it 10 times with <code>//stack 10 north</code>. Or you can make the elevator and then <code>//stack 10 up</code>. If you need to also copy the air use <code>//stackair</code>.</p> -<p>Finally, if you don't need to repeat it and simply move it just a bit towards the right direction, you can use <code>//move N</code>. The default direction is &quot;me&quot; (towards where you are facing) but you can set one with <code>//move 1 up</code> for example.</p> -<h3 id="selecting"><a class="anchor" href="#selecting">¶</a>Selecting</h3> -<p>You can not only select cuboids. You can also select different shapes, or even just points:</p> -<ul> -<li><code>//sel cuboid</code> is the default.</li> -<li><code>//sel extend</code> expands the default.</li> -<li><code>//sel poly</code> first point with left click and right click to add new points.</li> -<li><code>//sel ellipsoid</code> first point to select the center and right click to select the different radius.</li> -<li><code>//sel sphere</code> first point to select the center and one more right click for the radius.</li> -<li><code>//sel cyl</code> for cylinders, first click being the center.</li> -<li><code>//sel convex</code> for convex shapes. This one is extremely useful for <code>//curve</code>.</li> -</ul> -<h2 id="brushes"><a class="anchor" href="#brushes">¶</a>Brushes</h2> -<p>Brushes are a way to paint in 3D without first bothering about making a selection, and there are spherical and cylinder brushes with e.g. <code>//brush sphere stone 2</code>, or the shorter form <code>//br s stone</code>. For cylinder, one must use <code>cyl</code> instead <code>sphere</code>.</p> -<p>There also exists a brush to smooth the terrain which can be enabled on the current item with <code>//br smooth</code>, which can be used with right-click like any other brush.</p> -<h2 id="clipboard"><a class="anchor" href="#clipboard">¶</a>Clipboard</h2> -<p>Finally, you can copy and cut things around like you would do with normal text with <code>//copy</code> and <code>//cut</code>. The copy is issued from wherever you issue the command, so when you use <code>//paste</code>, remember that if you were 4 blocks apart when copying, it will be 4 blocks apart when pasting.</p> -<p>The contents of the clipboard can be flipped to wherever you are looking via <code>//flip</code>, and can be rotated via the <code>//rotate 90</code> command (in degrees).</p> -<p>To remove the copy use <code>//clearclipboard</code>.</p> -</main> -</body> -</html> - </content></entry><entry><title>Sentences</title><id>dist/sentences/index.html</id><updated>2018-01-30T23:00:00+00:00</updated><published>2018-01-30T23:00:00+00:00</published><summary>Don't know English? </summary><content type="html" src="dist/sentences/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Sentences</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="sentences"><a class="anchor" href="#sentences">¶</a>Sentences</h1> -<div class="date-created-modified">2018-01-31</div> -<blockquote> -<p>Don't know English? <a href="spanish.html">Read the Spanish version instead</a>.</p> -</blockquote> -<p>Just a few sentences that I've been gathering among the years and I think are worthy of being kept somewhere.</p> -<ul> -<li>So far, you've survived 100% of your worst days. You're doing great</li> -<li>Money is not a concern, perfection is</li> -<li>The only limit to our realization of tomorrow will be our doubts today</li> -<li>Not all cultures deserve respect.</li> -<li>It's not the same knowing that you're not free that not being free.</li> -<li>Being alive is not a biolgical matter, rather mental.</li> -<li>Every mountain starts off as a grain of sand.</li> -<li>Time goes against desire.</li> -<li>The only way to respect is fear.</li> -<li>For those who have nothing I have so much.</li> -<li>One isn't what they think, it's what they do.</li> -<li>When your goal seems impossible, don't change the goal. Find new ways to get to it.</li> -<li>Be the change you wish to see in the world.</li> -<li>Tell me something, I'll forget. Show me something, I'll remember. But make me part of it and I'll understand it.</li> -<li>If you want something to happen, go and do it. Or wait sitting like a stupid until it happens that it never happens.</li> -<li>I'd rather be happy than be right.</li> -<li>The engines don’t move the ship at all. The ship stays where it is and the engines move the universe around it.</li> -<li>If I never try getting there, I'll never get there.</li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Blog de Lonami</title><id>dist/index/index.html</id><updated>2018-01-30T23:00:00+00:00</updated><published>2016-03-03T23:00:00+00:00</published><summary>Hola | Hi.</summary><content type="html" src="dist/index/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Blog de Lonami</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="blog_de_lonami"><a class="anchor" href="#blog_de_lonami">¶</a>Blog de Lonami</h1> -<div class="date-created-modified">Created 2016-03-04<br> -Modified 2018-01-31</div> -<p>Hola | Hi.</p> -<p>Choose your language below:</p> -<ul> -<li><a href="#bienvenido-al-blog">Leer entradas en español</a></li> -<li><a href="#welcome-to-the-blog">Read English entries</a></li> -</ul> -<h2 id="bienvenido_al_blog"><a class="anchor" href="#bienvenido_al_blog">¶</a>Bienvenido al blog</h2> -<p>Bienvenido al mejor (o no) blog del mundo. En esta sección publicaré de manera muy puntual algunas entradas que espero resulten interesantes para el gran público.</p> -<h2 id="welcome_to_the_blog"><a class="anchor" href="#welcome_to_the_blog">¶</a>Welcome to the blog</h2> -<p>Welcome to the best (or not) blog in the entire world. On this blog I will occasionally post new entries which I find interesting.</p> -</main> -</body> -</html> - </content></entry><entry><title>Graphs</title><id>dist/graphs/index.html</id><updated>2017-06-01T22:00:00+00:00</updated><published>2017-06-01T22:00:00+00:00</published><summary>There are a few things which won't render unless you enable</summary><content type="html" src="dist/graphs/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Graphs</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script> -<div class="date-created-modified">2017-06-02</div> -<noscript>There are a few things which won't render unless you enable -JavaScript. No tracking, I promise!</noscript> -<h1 class="title" id="graphs"><a class="anchor" href="#graphs">¶</a>Graphs</h1> -<blockquote> -<p>Don't know English? <a href="spanish.html">Read the Spanish version instead</a>.</p> -</blockquote> -<p>Let's imagine we have 5 bus stations, which we'll denote by \(s_i\):</p> -<p>(\begin{bmatrix} -&amp; s_1 &amp; s_2 &amp; s_3 &amp; s_4 &amp; s_5 \ -s_1 &amp; &amp; V &amp; &amp; &amp; \ -s_2 &amp; V &amp; &amp; &amp; &amp; V \ -s_3 &amp; &amp; &amp; &amp; V &amp; \ -s_4 &amp; &amp; V &amp; V &amp; &amp; \ -s_5 &amp; V &amp; &amp; &amp; V &amp; -\end{bmatrix})</p> -<p>This is known as a <i>"table of direct interconnections"</i>.</p> - <p>The \(V\) represent connected paths. For instance, on the first - row starting at \(s_1\), reaching the \(V\), - allows us to turn up to get to \(s_2\).</p> -<p>We can see the above table represented in a more graphical way:</p> - <img src="example1.svg" /> - <p>This type of graph is called, well, a <i>graph</i>, and it's a directed - graph (or <i>digraph</i>), since the direction on which the arrows go does - matter. It's made up of vertices, joined together by edges (also known as - lines or directed <b>arcs</b>).</p> -<p>One can walk from a node to another through different <b>paths</b>. For - example, \(s_4 \rightarrow s_2 \rightarrow s_5\) is an indirect path of <b>order</b> - two, because we must use two edges to go from \(s_4\) to - \(s_5\).</p> -<p>Let's now represent its adjacency matrix called A which represents the - same table, but uses <mark>1</mark> instead </mark>V</mark> to represent - a connection:</p> -<p>(\begin{bmatrix} -0 &amp; 1 &amp; 0 &amp; 0 &amp; 0 \ -1 &amp; 0 &amp; 0 &amp; 0 &amp; 1 \ -0 &amp; 0 &amp; 0 &amp; 1 &amp; 0 \ -0 &amp; 1 &amp; 1 &amp; 0 &amp; 0 \ -1 &amp; 0 &amp; 0 &amp; 1 &amp; 0 -\end{bmatrix})</p> -<p>This way we can see how the \(a_{2,1}\) element represents the - connection \(s_2 \rightarrow s_1\), and the \(a_{5,1}\) element the - \(s_5 \rightarrow s_1\) connection, etc.</p> -<p>In general, \(a_{i,j}\) represents a connection from - \(s_i \rightarrow s_j\)as long as \(a_{i,j}\geq 1\).</p> -<p>Working with matrices allows us to have a computable representation of - any graph, which is very useful.</p> -<hr /> -<p>Graphs have a lot of interesting properties besides being representable - by a computer. What would happen if, for instance, we calculated - \(A^2\)? We obtain the following matrix:</p> -<p>(\begin{bmatrix} -1 &amp; 0 &amp; 0 &amp; 0 &amp; 1 \ -1 &amp; 1 &amp; 0 &amp; 1 &amp; 0 \ -0 &amp; 1 &amp; 1 &amp; 0 &amp; 0 \ -1 &amp; 0 &amp; 0 &amp; 1 &amp; 1 \ -0 &amp; 2 &amp; 1 &amp; 0 &amp; 0 -\end{bmatrix})</p> -<p>We can interpret this as the paths of order <b>two</b>.</p> - <p>But what does the element \(a_{5,2}=2\) represent? It indicates - the amount of possible ways to go from \(s_5 \rightarrow s_i \rightarrow s_2\).</p> -<p>One can manually multiply the involved row and column to determine which - element is the one we need to pass through, this way we have the row - \([1 0 0 1 0]\) and the column \([1 0 0 1 0]\) (on - vertical). The elements \(s_i\geq 1\) are \(s_1\) and - \(s_4\). This is, we can go from \(s_5\) to - \(s_2\) via \(s_5 \rightarrow s_1 \rightarrow s_2\) or via - \(s_5 \rightarrow s_4 \rightarrow s_2\):</p> - <img src="example2.svg" /> -<p>It's important to note that graphs to not consider self-connections, this - is, \(s_i \rightarrow s_i\) is not allowed; neither we work with multigraphs - here (those which allow multiple connections, for instance, an arbitrary - number \(n\) of times).</p> -<p>(\begin{bmatrix} -1 &amp; 1 &amp; 0 &amp; 1 &amp; 0 \ -1 &amp; 2 &amp; \textbf{1} &amp; 0 &amp; 1 \ -1 &amp; 0 &amp; 0 &amp; 1 &amp; 1 \ -1 &amp; 2 &amp; 1 &amp; 1 &amp; 0 \ -2 &amp; 0 &amp; 0 &amp; 1 &amp; 2 -\end{bmatrix})</p> -<p>We can see how the first \(1\) just appeared on the element - \(a_{2,3}\), which means that the shortest path to it is at least - of order three.</mark> -<hr /> -<p>A graph is said to be <b>strongly connected</b> as long as there is a - way to reach <i>all</i> its elements.</p> -<p>We can see all the available paths until now by simply adding up all the - direct and indirect ways to reach a node, so for now, we can add - \(A+A^2+A^3\) in such a way that:</p> -<p>(\begin{bmatrix} -2 &amp; 2 &amp; 0 &amp; 1 &amp; 1 \ -3 &amp; 3 &amp; 1 &amp; 1 &amp; 3 \ -1 &amp; 1 &amp; 1 &amp; 2 &amp; 1 \ -2 &amp; 3 &amp; 2 &amp; 2 &amp; 1 \ -3 &amp; 2 &amp; 1 &amp; 2 &amp; 2 -\end{bmatrix})</p> -<p>There isn't a connection between \(s_1\) and \(s_3\) yet. - If we were to calculate \(A^4\):</p> -<p>(\begin{bmatrix} -1 &amp; 2 &amp; 1 &amp; &amp; \ -&amp; &amp; &amp; &amp; \ -&amp; &amp; &amp; &amp; \ -&amp; &amp; &amp; &amp; \ -&amp; &amp; &amp; &amp;<br /> -\end{bmatrix})</p> -<p>We don't need to calculate anymore. We now know that the graph is - strongly connected!</p> -<hr /> -<p>Congratulations! You've completed this tiny introduction to graphs. - Now you can play around with them and design your own connections.</p> -<p>Hold the left mouse button on the above area and drag it down to create - a new node, or drag a node to this area to delete it.</p> -<p>To create new connections, hold the right mouse button on the node you - want to start with, and drag it to the node you want it to be connected to.</p> -<p>To delete the connections coming from a specific node, middle click it.</p> -<table><tr><td style="width:100%;"> - <button onclick="resetConnections()">Reset connections</button> - <button onclick="clearNodes()">Clear all the nodes</button> - <br /> - <br /> - <label for="matrixOrder">Show matrix of order:</label> - <input id="matrixOrder" type="number" min="1" max="5" - value="1" oninput="updateOrder()"> - <br /> - <label for="matrixAccum">Show accumulated matrix</label> - <input id="matrixAccum" type="checkbox" onchange="updateOrder()"> - <br /> - <br /> - <div class="matrix"> - <table id="matrixTable"></table> - </div> - </td><td> - <canvas id="canvas" width="400" height="400" oncontextmenu="return false;"> - Looks like your browser won't let you see this fancy example :( - </canvas> - <br /> - </td></tr></table> -<script src="tinyparser.js"></script> -<script src="enhancements.js"></script> -<script src="graphs.js"></script> -</main> -</body> -</html> - </content></entry><entry><title>Apuntes de bachillerato de Filosofía</title><id>dist/filosofia/index.html</id><updated>2016-06-20T22:00:00+00:00</updated><published>2016-06-20T22:00:00+00:00</published><summary>Hay asignaturas que merecen la pena, y una de ellas es la filosofía. De verdad. Aprendes un montón de cosas y abres tu mente, comparas muchos puntos de vista y te das cuenta de grandes cosas. Por eso, quiero compartir mis apuntes con todo aquel interesado.</summary><content type="html" src="dist/filosofia/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Apuntes de bachillerato de Filosofía</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="apuntes_de_bachillerato_de_filosofía"><a class="anchor" href="#apuntes_de_bachillerato_de_filosofía">¶</a>Apuntes de bachillerato de Filosofía</h1> -<div class="date-created-modified">2016-06-21</div> -<p>Hay asignaturas que merecen la pena, y una de ellas es la filosofía. De verdad. Aprendes un montón de cosas y abres tu mente, comparas muchos puntos de vista y te das cuenta de grandes cosas. Por eso, quiero compartir mis apuntes con todo aquel interesado.</p> -<p>Personalmente, mi autor favorito es Friedrich Nietzsche (se pronuncia <em>/niche/</em>). Está en el tercer trimestre, el más interesante, aunque si prefieres algo de contexto, te recomiendo leerlo todo. Puedes leerlo como si fuera un libro cualquiera:</p> -<ul> -<li>Descargar en .pdf -<ul> -<li><a href="filo_trimestre1.pdf">Filosofía - Primer trimestre</a></li> -<li><a href="filo_trimestre2.pdf">Filosofía - Segundo trimestre</a></li> -<li><a href="filo_trimestre3.pdf">Filosofía - Tercer trimestre</a></li> -</ul> -</li> -<li>Descargar en .odt (lo puedes editar) -<ul> -<li><a href="filo_trimestre1.odt">Filosofía - Primer trimestre</a></li> -<li><a href="filo_trimestre2.odt">Filosofía - Segundo trimestre</a></li> -<li><a href="filo_trimestre3.odt">Filosofía - Tercer trimestre</a></li> -</ul> -</li> -</ul> -<p>Nota: Hay algunas palabras un tanto soez. ¡Añaden emoción y no son para tanto, a lo sumo dos o tres! :)</p> -</main> -</body> -</html> - </content></entry><entry><title>Reflexión sobre la Inteligencia artificial</title><id>dist/reflexion_ia/index.html</id><updated>2016-06-12T22:00:00+00:00</updated><published>2016-06-12T22:00:00+00:00</published><summary>Nota: esta reflexión ha sido sacada de una conversación en Telegram, aunque ha sido lo más adaptada posible a formato de blog.</summary><content type="html" src="dist/reflexion_ia/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Reflexión sobre la Inteligencia artificial</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="reflexión_sobre_la_inteligencia_artificial"><a class="anchor" href="#reflexión_sobre_la_inteligencia_artificial">¶</a>Reflexión sobre la Inteligencia artificial</h1> -<div class="date-created-modified">2016-06-13</div> -<blockquote> -<p>Nota: esta reflexión ha sido sacada de una conversación en Telegram, aunque ha sido lo más adaptada posible a formato de blog.</p> -</blockquote> -<h2 id="conversación_del_12_03_16"><a class="anchor" href="#conversación_del_12_03_16">¶</a>Conversación del 12.03.16</h2> -<p>Pienso que para conseguir una verdadera inteligencia artificial debemos abstraernos mucho. Es decir, siempre hay una pequeña parte de <em>Pero es que el ser humano, los sentimientos, tal, cual</em>... Igual simplemente, absolutamente todo esté programado. Cuando actúas de manera que no sabes por qué por ejemplo, seguramente sea una serie de estímulos adecuados que producen esa respuesta porque se ha formado ese camino de neuronas en tu mente. Por ejemplo, el arco reflejo, que es un arco innato.</p> -<ul> -<li><em>Sensación de quemar → retirar</em></li> -<li><em><a href="https://es.wikipedia.org/wiki/Condicionamiento_cl%C3%A1sico">Un estímulo X → una respuesta Y</a></em></li> -</ul> -<p>Es una ida y vuelta instantanea entre sensación y respuesta. El cerebro simplemente es capaz de trabajar con combinaciones más complejas, como por ejemplo la suma, este número con este otro → sale otro número, y se le añade a otro... Hay una especie de <a href="https://es.wikipedia.org/wiki/Recursi%C3%B3n">recursión</a> también, aunque en realidad es que es el mismo estímulo el que <a href="https://es.wikipedia.org/wiki/M%C3%A9todo_%28inform%C3%A1tica%29">&quot;llama&quot;</a> a un determinado camino.</p> -<p>Pero lo verdaderamente impresionante es la consciencia, igual no tenemos consciencia de verdad, igual es como lo sentimos. Siempre nos han hablado de la consciencia pero nadie ha sabido probarla, por lo que sólo tenemos una idea, un concepto. Es aún más impresionante es el hecho de recordar y <a href="https://es.wikipedia.org/wiki/Memoria_de_trabajo">trabajar</a> con la información.</p> -<p>Cuando hablamos de consciencia, estamos simplemente tratando información sobre esa misma información, ¿cómo cojones sentimos lo que pensamos? Yo sé que estoy pensando porque hemos definido <em>pensar</em> como este proceso. ¿Pero cómo coño entiendo yo eso? Es decir, ¿cómo me doy cuenta? por qué lo situo en mi cabeza? Probablemente, aunque el cerebro esté trabajando con todo eso, la sensación sea externa a nosotros, es decir, ocurre en mi cabeza. ¿Pero de verdad lo siento en mi cabeza?</p> -<p>Me estoy rayando.</p> -<p>El verdadero problema está en saber cómo sabemos que estamos pensando. El cerebro se compone de neuronas y conexiones, esa es la base a parte de donde se encuentra todo y tal la base es esa, y las sensaciones táctiles son igual de complejas, las procesa mi cerebro pero las siento en mi mano. ¿Será cosa de costumbre? Yo siento algo y lo situo ahí. Sin embargo sentimos ahí y no por encima o por debajo de, vamos a poner, los dedos de la mano, lo siento justo ahí. ¿Qué coño es realmente la <a href="https://es.wikipedia.org/wiki/Memoria_a_corto_plazo">memoria a corto plazo</a>? (porque lo de la <a href="https://es.wikipedia.org/wiki/Memoria_a_largo_plazo">memoria a largo plazo</a> se traslada ahí cuando la necesitamos para trabajar con ella, por eso es <em>MCP</em> o memoria de trabajo según ciertas teorías).</p> -<p>En fin.</p> -</main> -</body> -</html> - </content></entry><entry><title>Inteligencia artificial</title><id>dist/inteligencia_artificial/index.html</id><updated>2016-03-04T23:00:00+00:00</updated><published>2016-02-23T23:00:00+00:00</published><summary>La inteligencia artificial es una rama apasionante que tiene su origen en la </summary><content type="html" src="dist/inteligencia_artificial/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Inteligencia artificial</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="inteligencia_artificial"><a class="anchor" href="#inteligencia_artificial">¶</a>Inteligencia artificial</h1> -<div class="date-created-modified">Created 2016-02-24<br> -Modified 2016-03-05</div> -<h2 id="índice"><a class="anchor" href="#índice">¶</a>Índice</h2> -<ul> -<li><a href="#qu%C3%A9_es">Qué es</a></li> -<li><a href="#en_qu%C3%A9_consiste">En qué consiste</a></li> -<li><a href="#l%C3%ADmites">Límites</a></li> -<li><a href="#tipos_de_inteligencia_artificial">Tipos de inteligencia artificial</a></li> -<li><a href="#aplicaciones_pr%C3%A1cticas">Aplicaciones prácticas</a></li> -<li><a href="#implicaciones_%C3%A9ticas">Implicaciones éticas</a></li> -<li><a href="#ejemplos">Ejemplos</a></li> -<li><a href="#conceptos">Conceptos</a></li> -<li><a href="#fuentes">Fuentes</a></li> -</ul> -<h2 id="qué_es"><a class="anchor" href="#qué_es">¶</a>Qué es</h2> -<p>La inteligencia artificial es una rama apasionante que tiene su origen en la <strong>informática</strong> y se basa en el concepto de conseguir <em>emular</em><sup class="footnote-reference" id="r.1"><a href="#f.1">1</a></sup> al cerebro humano, mediante el desarrollo un programa que sea capaz de <strong>aprender y mejorar por sí sólo</strong> (normalmente bajo algún tipo de supervisión)</p> -<p>Fue un concepto acuñado por <em>John McCarthy</em> en un congreso de informática de 1956, y desde entonces este campo ha crecido de manera exponencial con unas buenas previsiones de futuro.</p></p> -<div class="image-container"> -<img src="human_progress_edge.svg" alt="Progreso humano en la inteligencia artificial" /> -<div class="image-caption"></div> -</div> -<p> -<p><em>Progreso humano en la inteligencia artificial. <a href="http://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1">Fuente</a></em></p> -<h2 id="en_qué_consiste"><a class="anchor" href="#en_qué_consiste">¶</a>En qué consiste</h2> -<p>La inteligencia artificial no consiste en escribir unas pautas fijas y finitas al igual que hacen la gran mayoría de programas, en los cuales introduces unos datos y producen siempre la misma salida, una salida predecible, programada e invariable, que además, tiene sus límites, ya que si introduces datos para los que la aplicación no está programada, esta aplicación no será capaz de manejarlos. No los entenderá y no producirá ningún resultado.</p> -<p>La inteligencia artificial consiste en dar un paso <strong>más allá</strong>. Una inteligencia artificial <em>entrenada</em> es capaz de manejar datos para los cuales no ha sido programada de manera explícita<sup class="footnote-reference" id="r.2"><a href="#f.2">2</a></sup></sup></p> -<h2 id="límites"><a class="anchor" href="#límites">¶</a>Límites</h2> -<p>Actualmente, la inteligencia artificial se ve limitada por la velocidad y capacidad de los dispositivos (ordenadores, teléfonos inteligentes).</p> -<p>A día de hoy, ya hemos conseguido emular el cerebro de un gusano de un milímetro de longitud, que consiste de un total de trescientas dos neuronas. El <strong>cerebro humano</strong> contiene unas <strong>cien mil millones de neuronas</strong>.</p> -<div class="image-container"> -<img src="exponential_grow.gif" alt="Progreso en la velocidad de los dispositivos" /> -<div class="image-caption"></div> -</div> -<p> -<p><em>Crecimiento en la velocidad de procesado de los dispositivos. <a href="http://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1">Fuente</a></em></p> -<p>Comparado con las neuronas de un cerebro humano (cuya velocidad<sup class="footnote-reference" id="r.3"><a href="#f.3">3</a></sup> máxima oscilan entre los 200Hz), los procesadores de hoy en día (mucho más lentos que los que tendremos dentro de algunos años) ya tienen una velocidad superior a los 2Ghz, es decir, <strong>10 millones de veces</strong> más rápidos que las neuronas. Y la comunicación interna del cerebro, que oscila entre los 120m/s, queda infinitamente distante de la velocidad de los ordenadores que se comunican de manera óptica a la <strong>velocidad de la luz</strong>.</p> -<p>Además de todo esto, la capacidad de los dispositivos puede ser <strong>ampliada</strong>, a diferencia del cerebro que tiene un tamaño ya determinado. Y, por último, un procesador puede estar <strong>trabajando sin parar</strong> nunca, sin cansarse.</p></p> -<!-- Boston dynamics artificial intelligence put some more examples, like Google or predicting models or big data, ocr --> -<h2 id="tipos_de_inteligencia_artificial"><a class="anchor" href="#tipos_de_inteligencia_artificial">¶</a>Tipos de inteligencia artificial</h2> -<h3 id="según_el_tipo_de_aprendizaje"><a class="anchor" href="#según_el_tipo_de_aprendizaje">¶</a>Según el tipo de aprendizaje</h3> -<ul> -<li><strong>Aprendizaje supervisado</strong>: se le presenta una entrada de datos y produce una salida de los datos procesados, y un &quot;tutor&quot; es el que determina si la salida es correcta o no.</li> -<li><strong>Aprendizaje sin supervisar</strong>: se le presenta una entrada de datos sin presentarle ningún otro tipo de información, para que encuentre la estructura de los datos por sí sóla.</li> -<li><strong>Aprendizaje por refuerzo</strong>: un ordenador interactua con un entorno variable en el que debe llevar a cabo una tarea concreta, sin que un tutor le indique cómo explícitamente.</li> -</ul> -<h3 id="según_la_forma_de_llevarlo_a_cabo_principales_métodos_"><a class="anchor" href="#según_la_forma_de_llevarlo_a_cabo_principales_métodos_">¶</a>Según la forma de llevarlo a cabo (principales métodos)</h3> -<ul> -<li> -<p><strong>Aprendizaje por árbol de decisiones</strong>. Este aprendizaje usa un árbol de decisiones, que almacena observaciones y conclusiones.</p> -<div class="image-container"> -<img src="decision_tree.svg" alt="Árbol de decisiones" /> -<div class="image-caption"></div> -</div> -<p> -</li> -<li> -<p><strong>Aprendizaje por asociación de reglas</strong>. Utilizado para descubrir relaciones en grandes bases de datos<sup class="footnote-reference" id="r.4"><a href="#f.4">4</a></sup>.</p> -</li> -<li> -<p><strong>Red neuronal artificial (RNA)</strong>. Inspirado en redes neuronales biológicas**. Los cálculos se estructuran en un grupo de neuronas artificiales interconectadas.</p> -</li> -<li> -<p><strong>Programación lógica inductiva (PLI)</strong>. Se aproxima de manera hipotética, dado un transfondo lógico y una entrada, a una solución que no se le había presentado antes.</p> -</li> -<li> -<p><strong>Máquinas de soporte vectorial (MSV)</strong>. Se usan para clasificar y problemas que necesitan de regresión<sup class="footnote-reference" id="r.5"><a href="#f.5">5</a></sup>. Dado una serie de ejemplos, una entrada será clasificada de una forma u otra.</p> -</li> -<li> -<p><em><strong>Clustering</strong></em>. Este tipo de análisis consiste en asignar observaciones a ciertas subcategorías (denominadas <em>clústeres</em>), para que aquellas que están en el mismo <em>clúster</em> sean similares**. Este tipo de aprendizaje es una técnica común en análisis estadístico.</p> -</li> -<li> -<p><strong>Redes bayesianas</strong>. Es un modelo probabilístico que organiza variables al azar según unas determinadas condiciones mediante un gráfico**. Un ejemplo de red bayesiana es el siguiente:</p> -<div class="image-container"> -<img src="bayesian_network.svg" alt="Red bayesiana" /> -<div class="image-caption"></div> -</div> -<p> -</li> -<li> -<p><strong>Algoritmos genéticos</strong>. Imita el proceso evolutivo de la selección natural, y usa métodos como la mutación para generar nuevos &quot;genotipos&quot; que, con algo de suerte, serán mejores en encontrar la solución correcta.</p> -</li> -</ul> -<h2 id="aplicaciones_prácticas"><a class="anchor" href="#aplicaciones_prácticas">¶</a>Aplicaciones prácticas</h2> -<p>La inteligencia artificial ya se encuentra desde hace algún tiempo entre nosotros, como por ejemplo el archiconocido <strong>buscador Google</strong>, que filtra los resultados más relevantes mediante una inteligencia artificial. Otros ejemplos son el reconocimiento de caracteres a partir de una foto, o incluso reconocimiento del habla con <strong>asistentes virtuales como Cortana o Siri</strong>, en los videojuegos, en bolsa, en los <strong>hospitales</strong>, industria pesada, transportes, juguetes, música, aviación, robótica, filtros anti-spam... y un largo etcétera.</p> -<h2 id="implicaciones_éticas"><a class="anchor" href="#implicaciones_éticas">¶</a>Implicaciones éticas</h2> -<p>Una vez tengamos la tecnología necesaria para recrear un cerebro humano, si enseñáramos a esta inteligencia artificial al igual que un humano, ¿llegaría a tener <strong>sentimientos</strong>? ¿Sería consciente de su existencia? ¿Podría sentir felicidad, alegría, tristeza, enfado? ¿Tendría <strong>creatividad</strong>? ¿Derecho a propiedad? Si la respuesta es que sí, y es la respuesta más lógica, significa que, en realidad, los sentimientos no son nada más que una manera de entender las cosas. No tienen valor por sí mismos. Seríamos capaces de recrearlos, y tendrían el mismo valor que un sentimiento humano, aunque esa inteligencia viviera dentro de un ordenador. Y acabar con esta inteligencia sería acabar con esta vida, <strong>una vida</strong> casi, por no decir enteramente, <strong>humana</strong>. Además, todo esto implicaría que todo comportamiento humano es predecible. Por último, si esta inteligencia es realmente como un humano, al utilizarla, ¿la estaríamos esclavizando al obligarla a trabajar para nosotros? ¿En qué momento dejaremos de llamarlos &quot;ordenadores&quot; y comenzaremos a tratarles como &quot;humanos&quot;? ¿Será la humanidad capaz de adaptarse al cambio?</p> -<!-- ¿y si sólo somos cerebro y logramos recrearlo? ¿tendría sentimientos? --> -<h2 id="ejemplos"><a class="anchor" href="#ejemplos">¶</a>Ejemplos</h2> -<p>En el siguiente algorítmo genético podemos ver como una figura aprende a saltar, obedeciendo a las leyes físicas (ver en <a href="https://youtu.be/Gl3EjiVlz_4">YouTube</a>):</p> -<iframe width="420" height="315" src="https://www.youtube.com/embed/Gl3EjiVlz_4" frameborder="0" allowfullscreen></iframe> -<p>Por el contrario, en el siguiente ejemplo, un algorítmo genético aprende a &quot;luchar&quot; contra otra figura: (ver en <a href="https://youtu.be/u2t77mQmJiY">YouTube</a>):</p> -<iframe width="560" height="315" src="https://www.youtube.com/embed/u2t77mQmJiY" frameborder="0" allowfullscreen></iframe> -<p>Estos cuatro increíbles ejemplos siguientes muestran un proceso evolutivo similar al sufrido por cualquier tipo de ser (ver en <a href="https://youtu.be/GOFws_hhZs8">YouTube</a>):</p> -<iframe width="560" height="315" src="https://www.youtube.com/embed/GOFws_hhZs8" frameborder="0" allowfullscreen></iframe> -<iframe width="560" height="315" src="https://www.youtube.com/embed/31dsH2Fs1IQ" frameborder="0" allowfullscreen></iframe> -<iframe width="560" height="315" src="https://www.youtube.com/embed/IVcvvqxtNwE" frameborder="0" allowfullscreen></iframe> -<iframe width="560" height="315" src="https://www.youtube.com/embed/KrTbJUJsDSw" frameborder="0" allowfullscreen></iframe> -<h2 id="conceptos"><a class="anchor" href="#conceptos">¶</a>Conceptos</h2> -<p class="footnote" id="f.1"><sup>1</sup> <strong>Emular</strong>. Tratar de imitar un modelo, aproximarse a este. Copiar su comportamiento o incluso mejorarlo. <a href="#r.1">↩</a></p> - -<p class="footnote" id="f.2"><sup>2</sup> <strong>Explícito</strong>. Suceso que ocurre de manera previamente avisada de una forma directa, anticipado <em>sin rodeos</em>. <a href="#r.2">↩</a></p> - -<p class="footnote" id="f.3"><sup>3</sup> <strong>Velocidad (en hercios)</strong>. Número de cálculos realizados por segundo. Un procesador con una velocidad de 100Hz es capaz de realizar 100 cálculos por segundo. <a href="#r.3">↩</a></p> - -<p class="footnote" id="f.4"><sup>4</sup> <strong>Base de datos</strong>. Lugar en el que se almacena de manera estructurada una información, como por ejemplo un censo que indique el nombre de las personas, sus apellidos, edad, etcétera. <a href="#r.4">↩</a></p> - -<p class="footnote" id="f.5"><sup>5</sup> <strong>Regresión</strong>. Las pruebas de regresión consisten en someter a un programa a una serie de pruebas para descubrir fallos en este cometidos accidentalmente con anterioridad en versiones anteriores. <a href="#r.5">↩</a></p> - -<h2 id="fuentes"><a class="anchor" href="#fuentes">¶</a>Fuentes</h2> -<ul> -<li><a href="http://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1">Evolución de la inteligencia artificial - Wait but why</a></li> -<li><a href="https://en.wikipedia.org/wiki/Machine_learning"><em>Machine learning</em> - Wikipedia</a></li> -</ul> -</main> -</body> -</html> - </content></entry></feed>
@@ -1,78 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Breaking Risk of Rain</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="breaking_risk_of_rain"><a class="anchor" href="#breaking_risk_of_rain">¶</a>Breaking Risk of Rain</h1> -<div class="date-created-modified">Created 2019-01-12<br> -Modified 2020-10-03</div> -<p><a href="https://riskofraingame.com/">Risk of Rain</a> is a fun little game you can spend a lot of hours on. It's incredibly challenging for new players, and fun once you have learnt the basics. This blog will go through what I've learnt and how to play the game correctly.</p> -<h2 id="getting_started"><a class="anchor" href="#getting_started">¶</a>Getting Started</h2> -<p>If you're new to the game, you may find it frustrating. You must learn very well to dodge.</p> -<p>Your first <a href="http://riskofrain.wikia.com/wiki/Category:Characters">character</a> will be <a href="http://riskofrain.wikia.com/wiki/Commando">Commando</a>. He's actually a very nice character. Use your third skill (dodge) to move faster, pass through large groups of enemies, and negate fall damage.</p> -<p>If there are a lot of monsters, remember to <strong>leave</strong> from there! It's really important for survival. Most enemies <strong>don't do body damage</strong>. Not even the body of the <a href="http://riskofrain.wikia.com/wiki/Magma_Worm">Magma Worm</a> or the <a href="http://riskofrain.wikia.com/wiki/Wandering_Vagrant">Wandering Vagrant</a> (just dodge the head and projectiles respectively).</p> -<p>The first thing you must do is always <strong>rush for the teleporter</strong>. Completing the levels quick will make the game easier. But make sure to take note of <strong>where the chests are</strong>! When you have time (even when the countdown finishes), go back for them and buy as many as you can. Generally, prefer <a href="http://riskofrain.wikia.com/wiki/Chest">chests</a> over <a href="http://riskofrain.wikia.com/wiki/Shrine">shrines</a> since they may eat all your money.</p> -<p>Completing the game on <a href="http://riskofrain.wikia.com/wiki/Difficulty">Drizzle</a> is really easy if you follow these tips.</p> -<h2 id="requisites"><a class="anchor" href="#requisites">¶</a>Requisites</h2> -<p>Before breaking the game, you must obtain several <a href="http://riskofrain.wikia.com/wiki/Item#Artifacts">artifacts</a>. We are interested in particular in the following:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Sacrifice">Sacrifice</a>. You really need this one, and may be a bit hard to get. With it, you will be able to farm the first level for 30 minutes and kill the final boss in 30 seconds.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Command">Command</a>. You need this unless you want to grind for hours to get enough of the items you really need for the rest of the game. Getting this one is easy.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Glass">Glass</a>. Your life will be very small (at the beginning…), but you will be able to one-shot everything easily.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Kin">Kin</a> (optional). It makes it easier to obtain a lot of boxes if you restart the first level until you get <a href="http://riskofrain.wikia.com/wiki/Lemurian">lemurians</a> or <a href="http://riskofrain.wikia.com/wiki/Jellyfish">jellyfish</a> as the monster, since they're cheap to spawn.</li> -</ul> -<p>With those, the game becomes trivial. Playing as <a href="http://riskofrain.wikia.com/wiki/Huntress">Huntress</a> is excellent since she can move at high speed while killing everything on screen.</p> -<h2 id="breaking_the_game"><a class="anchor" href="#breaking_the_game">¶</a>Breaking the Game</h2> -<p>The rest is easy! With the command artifact you want the following items.</p> -<h3 id="<a href="http://riskofrain.wikia.com/wiki/Category:Common_Items">common_items"><a class="anchor" href="#common_items">¶</a>Common Items</a></h3> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Soldier's_Syringe">Soldier's Syringe</a>. <strong>Stack 13</strong> of these and you will triple your attack speed. You can get started with 4 or so.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Paul's_Goat_Hoof">Paul's Goat Hoof</a>. <strong>Stack +30</strong> of these and your movement speed will be insane. You can get a very good speed with 8 or so.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Crowbar">Crowbar</a>. <strong>Stack +20</strong> to guarantee you can one-shot bosses.</li> -</ul> -<p>If you want to be safer:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Hermit's_Scarf">Hermit's Scarf</a>. <strong>Stack 6</strong> of these to dodge 1/3 of the attacks.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Monster_Tooth">Monster Tooth</a>. <strong>Stack 9</strong> of these to recover 50 life on kill. This is plenty, since you will be killing <em>a lot</em>.</li> -</ul> -<p>If you don't have enough and want more fun, get one of these:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Gasoline">Gasoline</a>. Burn the ground on kill, and more will die!</li> -<li><a href="http://riskofrain.wikia.com/wiki/Headstompers">Headstompers</a>. They make a pleasing sound on fall, and hurt.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Lens-Maker's_Glasses">Lens-Maker's Glasses</a>. <strong>Stack 14</strong> and you will always deal a critical strike for double the damage.</li> -</ul> -<h3 id="<a href="http://riskofrain.wikia.com/wiki/Category:Uncommon_Items">uncommon_items"><a class="anchor" href="#uncommon_items">¶</a>Uncommon Items</a></h3> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Infusion">Infusion</a>. You only really need one of this. Your life will skyrocket after a while, since this gives you 1HP per kill.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Hopoo_Feather">Hopoo Feather</a>. <strong>Stack +10</strong> of these. You will pretty much be able to fly with so many jumps.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Guardian's_Heart">Guardian's Heart</a>. Not really necessary, but useful for early and late game, since it will absorb infinite damage the first hit.</li> -</ul> -<p>If, again, you want more fun, get one of these:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Ukulele">Ukelele</a>. Spazz your enemies!</li> -<li><a href="http://riskofrain.wikia.com/wiki/Will-o'-the-wisp">Will-o'-the-wisp</a>. Explode your enemies!</li> -<li><a href="http://riskofrain.wikia.com/wiki/Chargefield_Generator">Chargefield Generator</a>. It should cover your entire screen after a bit, hurting all enemies without moving a finger.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Golden_Gun">Golden Gun</a>. You will be rich, so this gives you +40% damage.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Predatory_Instincts">Predatory Instincts</a>. If you got 14 glasses, you will always be doing critical strikes, and this will give even more attack speed.</li> -<li><a href="http://riskofrain.wikia.com/wiki/56_Leaf_Clover">56 Leaf Clover</a>. More drops, in case you didn't have enough.</li> -</ul> -<h3 id="<a href="http://riskofrain.wikia.com/wiki/Category:Rare_Items">rare_items"><a class="anchor" href="#rare_items">¶</a>Rare Items</a></h3> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Ceremonial_Dagger">Ceremonial Dagger</a>. <strong>Stack +3</strong>, then killing one thing kills another thing and makes a chain reaction.</li> -<li><a href="http://riskofrain.wikia.com/wiki/Alien_Head">Alien Head</a>. <strong>Stack 3</strong>, and you will be able to use your abilities more often.</li> -</ul> -<p>For more fun:</p> -<ul> -<li><a href="http://riskofrain.wikia.com/wiki/Brilliant_Behemoth">Brilliant Behemoth</a>. Boom boom.</li> -</ul> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing Words</h2> -<p>You can now beat the game in Monsoon solo with any character. Have fun! And be careful with the sadly common crashes.</p> -</main> -</body> -</html> -
@@ -1,130 +0,0 @@
-/* containers */ - -body { - background-color: #fffff0; - margin: 0; -} - -main { - max-width: 720px; - margin: 0 auto; - padding: 10px 20px; - background-color: #fffff0; -} - -/* titles and special */ - -h1.title { - text-align: center; - font-family: serif; - font-size: 2.5em; - font-weight: lighter; - font-variant-caps: small-caps; - border-bottom: 4px double #000; -} - -h1, h2 { - padding-bottom: 10px; - border-bottom: 1px solid #000; -} - -h1:not(.title):hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { - opacity: 1; -} - -.anchor { - float: left; - padding-right: 0.4ch; - margin-left: -1.3ch; - opacity: 0; - transition: opacity 150ms; -} - -/* body text */ - -p, li { - font-family: sans-serif; - font-size: 1.1em; - line-height: 1.5; - text-align: justify; -} - -a { - text-decoration: none; - color: #f74c00; - border-bottom: 0 dashed rgba(0, 0, 0, 0); - transition: color 300ms, border-bottom 300ms; -} - -a:hover { - color: #e33b26; - border-bottom: 1px solid #e33b26; -} - -blockquote { - border-left: 4px solid #000; - padding-left: 8px; - font-style: italic; - color: #444; -} - -.footnote:target { - background-color: rgba(255, 255, 0, 0.2); -} - -/* code listing */ - -pre { - background-color: #eee; - padding: 4px; - overflow: auto; - max-height: 480px; -} - -/* tables */ - -table { - border-collapse: collapse; -} - -th { - background-color: #f7f7e8; -} - -th, td { - padding: 0.5em; - border: 1px solid #aaa; -} - -tr:nth-child(even) { - background-color: #f7f7e8; -} - -/* misc */ - -p.time { - text-align: right; - font-style: italic; - color: #777; - font-size: 0.9em; -} - -hr { - border: 0; - border-bottom: 2px dashed #aaa; -} - -kbd { - padding: 3px 5px; - font: 0.9em monospace; - color: #333; - background-color: #fafafa; - border: 1px solid #ddd; - border-radius: 4px; - box-shadow: 0 2px 0 #ddd; -} - -::selection { - background-color: #f74c00; - color: #fff; -}
@@ -1,283 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Python ctypes and Windows</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="python_ctypes_and_windows"><a class="anchor" href="#python_ctypes_and_windows">¶</a>Python ctypes and Windows</h1> -<div class="date-created-modified">Created 2019-06-19<br> -Modified 2020-10-03</div> -<p><a href="https://www.python.org/">Python</a>'s <a href="https://docs.python.org/3/library/ctypes.html"><code>ctypes</code></a> is quite a nice library to easily load and invoke C methods available in already-compiled <a href="https://en.wikipedia.org/wiki/Dynamic-link_library"><code>.dll</code> files</a> without any additional dependencies. And I <em>love</em> depending on as little as possible.</p> -<p>In this blog post, we will walk through my endeavors to use <code>ctypes</code> with the <a href="https://docs.microsoft.com/en-us/windows/desktop/api/">Windows API</a>, and do some cool stuff with it.</p> -<p>We will assume some knowledge of C/++ and Python, since we will need to read and write a bit of both. Please note that this post is only an introduction to <code>ctypes</code>, and if you need more information you should consult the <a href="https://docs.python.org/3/library/ctypes.html">Python's documentation for <code>ctypes</code></a>.</p> -<p>While the post focuses on Windows' API, the code here probably applies to unix-based systems with little modifications.</p> -<h2 id="basics"><a class="anchor" href="#basics">¶</a>Basics</h2> -<p>First of all, let's learn how to load a library. Let's say we want to load <code>User32.dll</code>:</p> -<pre><code class="language-python">import ctypes - -ctypes.windll.user32 -</code></pre> -<p>Yes, it's that simple. When you access an attribute of <code>windll</code>, said library will load. Since Windows is case-insensitive, we will use lowercase consistently.</p> -<p>Calling a function is just as simple. Let's say you want to call <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setcursorpos"><code>SetCursorPos</code></a>, which is defined as follows:</p> -<pre><code class="language-c">BOOL SetCursorPos( - int X, - int Y -); -</code></pre> -<p>Okay, it returns a <code>bool</code> and takes two inputs, <code>x</code> and <code>y</code>. So we can call it like so:</p> -<pre><code class="language-python">ctypes.windll.user32.SetCursorPos(100, 100) -</code></pre> -<p>Try it! Your cursor will move!</p> -<h2 id="funky_stuff"><a class="anchor" href="#funky_stuff">¶</a>Funky Stuff</h2> -<p>We can go a bit more crazy and make it form a spiral:</p> -<pre><code class="language-python">import math -import time - -for i in range(200): - x = int(500 + math.cos(i / 5) * i) - y = int(500 + math.sin(i / 5) * i) - ctypes.windll.user32.SetCursorPos(x, y) - time.sleep(0.05) -</code></pre> -<p>Ah, it's always so pleasant to do random stuff when programming. Sure makes it more fun.</p> -<h2 id="complex_structures"><a class="anchor" href="#complex_structures">¶</a>Complex Structures</h2> -<p><code>SetCursorPos</code> was really simple. It took two parameters and they both were integers. Let's go with something harder. Let's go with <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-sendinput"><code>SendInput</code></a>! Emulating input will be a fun exercise:</p> -<pre><code class="language-c">UINT SendInput( - UINT cInputs, - LPINPUT pInputs, - int cbSize -); -</code></pre> -<p>Okay, <code>LPINPUT</code>, what are you? Microsoft likes to prefix types with what they are. In this case, <code>LP</code> stands for "Long Pointer" (I guess?), so <code>LPINPUT</code> is just a Long Pointer to <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-taginput"><code>INPUT</code></a>:</p> -<pre><code class="language-c">typedef struct tagINPUT { - DWORD type; - union { - MOUSEINPUT mi; - KEYBDINPUT ki; - HARDWAREINPUT hi; - } DUMMYUNIONNAME; -} INPUT, *PINPUT, *LPINPUT; -</code></pre> -<p>Alright, that's new. We have a <code>struct</code> and <code>union</code>, two different concepts. We can define both with <code>ctypes</code>:</p> -<pre><code class="language-python">INPUT_MOUSE = 0 -INPUT_KEYBOARD = 1 -INPUT_HARDWARE = 2 - -class INPUT(ctypes.Structure): - _fields_ = [ - ('type', ctypes.c_long), - ... - ] -</code></pre> -<p>Structures are classes that subclass <code>ctypes.Structure</code>, and you define their fields in the <code>_fields_</code> class-level variable, which is a list of tuples <code>(field name, field type)</code>.</p> -<p>The C structure had a <code>DWORD type</code>. <code>DWORD</code> is a <code>c_long</code>, and <code>type</code> is a name like any other, which is why we did <code>('type', ctypes.c_long)</code>.</p> -<p>But what about the union? It's anonymous, and we can't make anonymous unions (<em>citation needed</em>) with <code>ctypes</code>. We will give it a concrete name and a type.</p> -<p>Before defining the union, we need to define its inner structures, <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-tagmouseinput"><code>MOUSEINPUT</code></a>, <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-tagkeybdinput"><code>KEYBDINPUT</code></a> and <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/ns-winuser-taghardwareinput"><code>HARDWAREINPUT</code></a>. We won't be using them all, but since they count towards the final struct size (C will choose the largest structure as the final size), we need them, or Windows' API will get confused and refuse to work (personal experience):</p> -<pre><code class="language-python">class MOUSEINPUT(ctypes.Structure): - _fields_ = [ - ('dx', ctypes.c_long), - ('dy', ctypes.c_long), - ('mouseData', ctypes.c_long), - ('dwFlags', ctypes.c_long), - ('time', ctypes.c_long), - ('dwExtraInfo', ctypes.POINTER(ctypes.c_ulong)) - ] - - -class KEYBDINPUT(ctypes.Structure): - _fields_ = [ - ('wVk', ctypes.c_short), - ('wScan', ctypes.c_short), - ('dwFlags', ctypes.c_long), - ('time', ctypes.c_long), - ('dwExtraInfo', ctypes.POINTER(ctypes.c_ulong)) - ] - - -class HARDWAREINPUT(ctypes.Structure): - _fields_ = [ - ('uMsg', ctypes.c_long), - ('wParamL', ctypes.c_short), - ('wParamH', ctypes.c_short) - ] - - -class INPUTUNION(ctypes.Union): - _fields_ = [ - ('mi', MOUSEINPUT), - ('ki', KEYBDINPUT), - ('hi', HARDWAREINPUT) - ] - - -class INPUT(ctypes.Structure): - _fields_ = [ - ('type', ctypes.c_long), - ('value', INPUTUNION) - ] -</code></pre> -<p>Some things to note:</p> -<ul> -<li>Pointers are defined as <code>ctypes.POINTER(inner type)</code>.</li> -<li>The field names can be anything you want. You can make them more "pythonic" if you want (such as changing <code>dwExtraInfo</code> for just <code>extra_info</code>), but I chose to stick with the original naming.</li> -<li>The union is very similar, but it uses <code>ctypes.Union</code> instead of <code>ctypes.Structure</code>.</li> -<li>We gave a name to the anonymous union, <code>INPUTUNION</code>, and used it inside <code>INPUT</code> with also a made-up name, <code>('value', INPUTUNION)</code>.</li> -</ul> -<p>Now that we have all the types we need defined, we can use them:</p> -<pre><code class="language-python">KEYEVENTF_KEYUP = 0x0002 - -def press(vk, down): - inputs = INPUT(type=INPUT_KEYBOARD, value=INPUTUNION(ki=KEYBDINPUT( - wVk=vk, - wScan=0, - dwFlags=0 if down else KEYEVENTF_KEYUP, - time=0, - dwExtraInfo=None - ))) - ctypes.windll.user32.SendInput(1, ctypes.byref(inputs), ctypes.sizeof(inputs)) - - -for char in 'HELLO': - press(ord(char), down=True) - press(ord(char), down=False) -</code></pre> -<p>Run it! It will press and release the keys <code>hello</code> to type the word <code>"hello"</code>!</p> -<p><code>vk</code> stands for "virtual key". Letters correspond with their upper-case ASCII value, which is what we did above. You can find all the available keys in the page with all the <a href="https://docs.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes">Virtual Key Codes</a>.</p> -<h2 id="dynamic_inputs_and_pointers"><a class="anchor" href="#dynamic_inputs_and_pointers">¶</a>Dynamic Inputs and Pointers</h2> -<p>What happens if a method wants something by reference? That is, a pointer to your thing? For example, <a href="https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-getcursorpos"><code>GetCursorPos</code></a>:</p> -<pre><code class="language-c">typedef struct tagPOINT { - LONG x; - LONG y; -} POINT, *PPOINT, *NPPOINT, *LPPOINT; - -BOOL GetCursorPos( - LPPOINT lpPoint -); -</code></pre> -<p>It wants a Long Pointer to <a href="https://docs.microsoft.com/en-us/windows/desktop/api/windef/ns-windef-point"><code>POINT</code></a>. We can do just that with <code>ctypes.byref</code>:</p> -<pre><code class="language-python">class POINT(ctypes.Structure): - _fields_ = [ - ('x', ctypes.c_long), - ('y', ctypes.c_long) - ] - - -def get_mouse(): - point = POINT() - ctypes.windll.user32.GetCursorPos(ctypes.byref(point)) - # pass our point by ref ^^^^^ - # this lets GetCursorPos fill its x and y fields - - return point.x, point.y - - -while True: - print(get_mouse()) - time.sleep(0.05) -</code></pre> -<p>Now you can track the mouse position! Make sure to <code>Ctrl+C</code> the program when you're tired of it.</p> -<p>What happens if a method wants a dynamically-sized input?</p> -<pre><code class="language-python">buffer = ctypes.create_string_buffer(size) -</code></pre> -<p>In that case, you can create an in-memory <code>buffer</code> of <code>size</code> with <code>ctypes.create_string_buffer</code>. It will return a character array of that size, which you can pass as a pointer directly (without <code>ctypes.byref</code>).</p> -<p>To access the buffer's contents, you can use either <code>.raw</code> or <code>.value</code>:</p> -<pre><code class="language-python">entire_buffer_as_bytes = buffer.raw -up_until_null = buffer.value -</code></pre> -<p>When the method fills in the data, you can <code>cast</code> your buffer back into a pointer of a concrete type:</p> -<pre><code class="language-python">result_ptr = ctypes.cast(buffer, ctypes.POINTER(ctypes.c_long)) -</code></pre> -<p>And you can de-reference pointers with <code>.contents</code>:</p> -<pre><code class="language-python">first_result = result_ptr.contents -</code></pre> -<h2 id="arrays"><a class="anchor" href="#arrays">¶</a>Arrays</h2> -<p>Arrays are defined as <code>type * size</code>. Your linter may not like that, and if you don't know the size beforehand, consider creating a 0-sized array. For example:</p> -<pre><code class="language-python"># 10 longs -ten_longs = (ctypes.c_long * 10)() -for i in range(10): - ten_longs[i] = 2 ** i - -# Unknown size of longs, e.g. inside some Structure -longs = (ctypes.c_long * 0) - -# Now you know how many longs it actually was -known_longs = ctypes.cast( - ctypes.byref(longs), - ctypes.POINTER(ctypes.c_long * size) -).contents -</code></pre> -<p>If there's a better way to initialize arrays, please let me know.</p> -<h2 id="wintypes"><a class="anchor" href="#wintypes">¶</a>wintypes</h2> -<p>Under Windows, the <code>ctypes</code> module has a <code>wintypes</code> submodule. This one contains definitions like <code>HWND</code> which may be useful and can be imported as:</p> -<pre><code class="language-python">from ctypes.wintypes import HWND, LPCWSTR, UINT -</code></pre> -<h2 id="callbacks"><a class="anchor" href="#callbacks">¶</a>Callbacks</h2> -<p>Some functions (I'm looking at you, <a href="https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumwindows"><code>EnumWindows</code></a>) ask us to pass a callback. In this case, it wants a <a href="https://docs.microsoft.com/en-us/previous-versions/windows/desktop/legacy/ms633498(v=vs.85)"><code>EnumWindowsProc</code></a>:</p> -<pre><code class="language-c">BOOL EnumWindows( - WNDENUMPROC lpEnumFunc, - LPARAM lParam -); - -BOOL CALLBACK EnumWindowsProc( - _In_ HWND hwnd, - _In_ LPARAM lParam -); -</code></pre> -<p>The naive approach won't work:</p> -<pre><code class="language-python">def callback(hwnd, lParam): - print(hwnd) - return True - -ctypes.windll.user32.EnumWindows(callback, 0) -# ctypes.ArgumentError: argument 1: <class 'TypeError'>: Don't know how to convert parameter 1 -# Aww. -</code></pre> -<p>Instead, you must wrap your function as a C definition like so:</p> -<pre><code class="language-python">from ctypes.wintypes import BOOL, HWND, LPARAM - -EnumWindowsProc = ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM) - -def callback(hwnd, lParam): - print(hwnd) - return True - -# Wrap the function in the C definition -callback = EnumWindowsProc(callback) - -ctypes.windll.user32.EnumWindows(callback, 0) -# Yay, it works. -</code></pre> -<p>You may have noticed this is what decorators do, wrap the function. So…</p> -<pre><code class="language-python">from ctypes.wintypes import BOOL, HWND, LPARAM - -@ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM) -def callback(hwnd, lParam): - print(hwnd) - return True - -ctypes.windll.user32.EnumWindows(callback, 0) -</code></pre> -<p>…will also work. And it is a <em>lot</em> fancier.</p> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing Words</h2> -<p>With the knowledge above and some experimentation, you should be able to call and do (almost) anything you want. That was pretty much all I needed on my project anyway :)</p> -<p>We have been letting Python convert Python values into C values, but you can do so explicitly too. For example, you can use <code>ctypes.c_short(17)</code> to make sure to pass that <code>17</code> as a <code>short</code>. And if you have a <code>c_short</code>, you can convert or cast it to its Python <code>.value</code> as <code>some_short.value</code>. The same applies for integers, longs, floats, doubles… pretty much anything, char pointers (strings) included.</p> -<p>If you can't find something in their online documentation, you can always <a href="https://github.com/BurntSushi/ripgrep"><code>rg</code></a> for it in the <code>C:\Program Files (x86)\Windows Kits\10\Include\*</code> directory.</p> -<p>Note that the <code>ctypes.Structure</code>'s that you define can have more methods of your own. For example, you can write them a <code>__str__</code> to easily view its fields, or define a <code>@property</code> to re-interpret some data in a meaningful way.</p> -<p>For enumerations, you can pass just the right integer number, make a constant for it, or if you prefer, use a <a href="https://docs.python.org/3/library/enum.html#enum.IntEnum"><code>enum.IntEnum</code></a>. For example, <a href="https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/dism/dismloglevel-enumeration"><code>DismLogLevel</code></a> would be:</p> -<pre><code class="language-python">class DismLogLevel(enum.IntEnum): - DismLogErrors = 0 - DismLogErrorsWarnings = 1 - DismLogErrorsWarningsInfo = 2 -</code></pre> -<p>And you <em>should</em> be able to pass <code>DismLogLevel.DismLogErrors</code> as the parameter now.</p> -<p>If you see a function definition like <code>Function(void)</code>, that's C's way of saying it takes no parameters, so just call it as <code>Function()</code>.</p> -<p>Make sure to pass all parameters, even if they seem optional they probably still want a <code>NULL</code> at least, and of course, read the documentation well. Some methods have certain pre-conditions.</p> -<p>Have fun hacking!</p> -</main> -</body> -</html> -
@@ -1,35 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Apuntes de bachillerato de Filosofía</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="apuntes_de_bachillerato_de_filosofía"><a class="anchor" href="#apuntes_de_bachillerato_de_filosofía">¶</a>Apuntes de bachillerato de Filosofía</h1> -<div class="date-created-modified">2016-06-21</div> -<p>Hay asignaturas que merecen la pena, y una de ellas es la filosofía. De verdad. Aprendes un montón de cosas y abres tu mente, comparas muchos puntos de vista y te das cuenta de grandes cosas. Por eso, quiero compartir mis apuntes con todo aquel interesado.</p> -<p>Personalmente, mi autor favorito es Friedrich Nietzsche (se pronuncia <em>/niche/</em>). Está en el tercer trimestre, el más interesante, aunque si prefieres algo de contexto, te recomiendo leerlo todo. Puedes leerlo como si fuera un libro cualquiera:</p> -<ul> -<li>Descargar en .pdf -<ul> -<li><a href="filo_trimestre1.pdf">Filosofía - Primer trimestre</a></li> -<li><a href="filo_trimestre2.pdf">Filosofía - Segundo trimestre</a></li> -<li><a href="filo_trimestre3.pdf">Filosofía - Tercer trimestre</a></li> -</ul> -</li> -<li>Descargar en .odt (lo puedes editar) -<ul> -<li><a href="filo_trimestre1.odt">Filosofía - Primer trimestre</a></li> -<li><a href="filo_trimestre2.odt">Filosofía - Segundo trimestre</a></li> -<li><a href="filo_trimestre3.odt">Filosofía - Tercer trimestre</a></li> -</ul> -</li> -</ul> -<p>Nota: Hay algunas palabras un tanto soez. ¡Añaden emoción y no son para tanto, a lo sumo dos o tres! :)</p> -</main> -</body> -</html> -
@@ -1,207 +0,0 @@
-// Enhancing prototypes -CanvasRenderingContext2D.prototype.clear = function() { - // http://stackoverflow.com/a/9722502/4759433 - this.clearRect(0, 0, this.canvas.width, this.canvas.height); - this.beginPath(); // Clear strokes -}; - -var TWOPI = 2 * Math.PI; -CanvasRenderingContext2D.prototype.circle = function(x, y, r) { - this.beginPath(); - this.arc(x, y, r, 0, TWOPI); - this.fill(); - this.beginPath(); -}; - -var SIXTHPI = Math.PI / 6.0; -CanvasRenderingContext2D.prototype.arrow = function( - x0, y0, x1, y1, headLen=10) { - // http://stackoverflow.com/a/6333775 - var angle = Math.atan2(y1 - y0, x1 - x0); - this.moveTo(x0, y0); - - this.lineTo(x1, y1); - this.lineTo(x1 - headLen * Math.cos(angle - SIXTHPI), - y1 - headLen * Math.sin(angle - SIXTHPI)); - - this.moveTo(x1, y1); - this.lineTo(x1 - headLen * Math.cos(angle + SIXTHPI), - y1 - headLen * Math.sin(angle + SIXTHPI)); - - this.stroke(); -} - -String.prototype.format = function() { - // http://stackoverflow.com/a/4673436/4759433 - var args = arguments; - return this.replace(/{(\d+)}/g, function(match, number) { - return typeof args[number] != 'undefined' ? args[number] : match; - }); -}; - -String.prototype.lpad = function(pad) { - return String(pad + this).slice(-pad.length); -}; - -Array.matrix = function(numrows, numcols, initial) { - // http://stackoverflow.com/a/30056867/4759433 - var arr = []; - for (var i = 0; i != numrows; ++i) { - var columns = []; - for (var j = 0; j != numcols; ++j) - columns[j] = initial; - arr[i] = columns; - } - return arr; -} - -function matrixCpy(src, dst) { - // Ensure it has at least one item - if (src.length != 0 && dst.length != 0) { - var ii = Math.min(src.length, dst.length); - var jj = Math.min(src[0].length, dst[0].length); - - for (var i = 0; i != ii; ++i) - for (var j = 0; j != jj; ++j) - dst[i][j] = src[i][j]; - } -} - -function matrixAdd(src, dst) { - // Ensure it has at least one item - if (src.length != 0 && dst.length != 0) { - var ii = Math.min(src.length, dst.length); - var jj = Math.min(src[0].length, dst[0].length); - - for (var i = 0; i != ii; ++i) - for (var j = 0; j != jj; ++j) - dst[i][j] += src[i][j]; - } -} - -function matrixMul(a, b) { - var ii = a.length; - var jj = b[0].length; - var c = Array.matrix(ii, jj, 0); - - var kk = a[0].length; - if (kk == b.length) // Ensure nxp times pxm - for (var i = 0; i != ii; ++i) - for (var j = 0; j != jj; ++j) - for (var k = 0; k != kk; ++k) - c[i][j] += a[i][k] * b[k][j]; - - return c; -} - -// Pops the i'th row and j'th column off the matrix -function matrixPop(matrix, i, j) { - if (!matrix || !matrix[0]) - return Array.matrix(0, 0, 0); - - var ii = matrix.length; - var jj = matrix[0].length; - if (i < 0 || i >= ii || j < 0 || j >= jj) - return matrix; - - var srci, srcj, dsti, dstj; - var result = Array.matrix(ii-1, jj-1, 0); - - dsti = 0; - for (srci = 0; srci < ii; ++srci) { - dstj = 0; - if (srci != i) { - for (srcj = 0; srcj < jj; ++srcj) { - if (srcj != j) { - result[dsti][dstj] = matrix[srci][srcj]; - ++dstj; - } - } - ++dsti; - } - } - - return result; -} - -function matrixStr(a) { - if (!a || !a[0]) - return '[]'; - - var ii = a.length; - var jj = a[0].length; - var jjm1 = jj - 1; - - var max = a[0][0]; - for (var i = 0; i != ii; ++i) - for (var j = 0; j != jj; ++j) - if (a[i][j] > max) - max = a[i][j]; - - var result = ''; - max = '' + max; - var pad = ''; - for (var i = 0; i != max; ++i) - pad += ' '; - - for (var i = 0; i != ii; ++i) { - result += '['; - for (var j = 0; j != jjm1; ++j) { - result += ('' + a[i][j]).lpad(pad); - result += ','; - } - result += ('' + a[i][jjm1]).lpad(pad); - result += ']\n'; - } - - return result; -} - -// highlight = [belowRow, belowCol, color] -function matrixRepr(matrix, table, highlight=null) { - if (!matrix || !matrix[0]) { - table.innerHTML = ''; - return; - } - - if (!highlight) - highlight = [-1, -1, '#000']; - - var result = ''; - var ii = matrix.length; - var jj = matrix[0].length; - - result += '<tr><td></td>'; - for (var j = 0; j != jj; ++j) - result += '<td><b>' + (j+1) + '</b></td>'; - result += '</tr>'; - - for (var i = 0; i != ii; ++i) { - result += '<tr><td><b>' + (i+1) + '</b></td>'; - for (var j = 0; j != jj; ++j) { - // We want to higlight 0..col on row and 0..row on col - if ((i <= highlight[0] && j == highlight[1]) || - (i == highlight[0] && j <= highlight[1])) { - result += '<td style="background-color:' + highlight[2] + - ';">' + matrix[i][j] + '</td>'; - } else { - result += '<td>' + matrix[i][j] + '</td>'; - } - } - result += '</tr>'; - } - - table.innerHTML = result; -} - -function lerp(start, end, t) { - return start + t * (end - start); -} - -function lerpArray(start, end, t) { - var result = []; - var ii = Math.min(start.length, end.length); - for (var i = 0; i != ii; ++i) - result.push(start[i] + t * (end[i] - start[i])); - return result; -}
@@ -1,306 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - id="svg8" - version="1.1" - viewBox="0 0 52.916665 51.064584" - height="193" - width="200" - sodipodi:docname="example1.svg" - inkscape:version="0.92.1 r15371"> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1366" - inkscape:window-height="744" - id="namedview53" - showgrid="false" - inkscape:zoom="1.0697256" - inkscape:cx="60.504485" - inkscape:cy="128.85834" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" - inkscape:current-layer="svg8" /> - <defs - id="defs2"> - <marker - orient="auto" - refY="0" - refX="0" - id="marker5335" - style="overflow:visible"> - <path - id="path5333" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - transform="matrix(0.8,0,0,0.8,10,0)" - inkscape:connector-curvature="0" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Lstart" - refX="0" - refY="0" - orient="auto"> - <path - transform="matrix(0.8,0,0,0.8,10,0)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - id="path4579" - inkscape:connector-curvature="0" /> - </marker> - <marker - style="overflow:visible" - id="marker5041" - refX="0" - refY="0" - orient="auto"> - <path - transform="matrix(-0.8,0,0,-0.8,-10,0)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - id="path5039" - inkscape:connector-curvature="0" /> - </marker> - <marker - orient="auto" - refY="0" - refX="0" - id="marker4989" - style="overflow:visible"> - <path - id="path4987" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - transform="matrix(-0.8,0,0,-0.8,-10,0)" - inkscape:connector-curvature="0" /> - </marker> - <marker - style="overflow:visible" - id="marker4943" - refX="0" - refY="0" - orient="auto"> - <path - transform="matrix(-0.8,0,0,-0.8,-10,0)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - id="path4941" - inkscape:connector-curvature="0" /> - </marker> - <marker - orient="auto" - refY="0" - refX="0" - id="marker4903" - style="overflow:visible"> - <path - id="path4901" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - transform="matrix(-0.8,0,0,-0.8,-10,0)" - inkscape:connector-curvature="0" /> - </marker> - <marker - orient="auto" - refY="0" - refX="0" - id="marker4869" - style="overflow:visible"> - <path - id="path4867" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - transform="matrix(-0.8,0,0,-0.8,-10,0)" - inkscape:connector-curvature="0" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Lend" - refX="0" - refY="0" - orient="auto"> - <path - transform="matrix(-0.8,0,0,-0.8,-10,0)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - id="path4582" - inkscape:connector-curvature="0" /> - </marker> - </defs> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - transform="matrix(1.2350865,0,0,1.2350865,-4.4147099e-8,-315.75609)" - id="layer1"> - <g - transform="translate(-58.254533,115.25159)" - id="g4513"> - <circle - style="fill:#b7c4c8;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="path4485" - cx="77.975891" - cy="144.92363" - r="4.1865373" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="75.418594" - y="145.38777" - id="text4489"><tspan - id="tspan4487" - x="75.418594" - y="145.38777" - style="stroke-width:0.26458332">s<tspan - style="font-size:3.52777767px" - id="tspan4491" - dx="0" - dy="2">2</tspan></tspan></text> - </g> - <g - transform="translate(-73.657062,129.99266)" - id="g4523"> - <circle - r="4.1865373" - cy="144.92363" - cx="77.975891" - id="circle4515" - style="fill:#b7c4c8;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - id="text4521" - y="145.38777" - x="75.418594" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="stroke-width:0.26458332" - y="145.38777" - x="75.418594" - id="tspan4519">s<tspan - dy="2" - id="tspan4555" - style="font-size:3.52777767px">1</tspan></tspan></text> - </g> - <g - id="g4533" - transform="translate(-39.450217,127.53582)"> - <circle - style="fill:#b7c4c8;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4525" - cx="77.975891" - cy="144.92363" - r="4.1865373" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="75.418594" - y="145.38777" - id="text4531"><tspan - id="tspan4529" - x="75.418594" - y="145.38777" - style="stroke-width:0.26458332">s<tspan - dy="2" - id="tspan4563" - style="font-size:3.52777767px">3</tspan></tspan></text> - </g> - <g - transform="translate(-65.530574,147.56855)" - id="g4543"> - <circle - r="4.1865373" - cy="144.92363" - cx="77.975891" - id="circle4535" - style="fill:#b7c4c8;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - id="text4541" - y="145.38777" - x="75.418594" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="stroke-width:0.26458332" - y="145.38777" - x="75.418594" - id="tspan4539">s<tspan - dy="2" - id="tspan4557" - style="font-size:3.52777767px">5</tspan></tspan></text> - </g> - <g - id="g4553" - transform="translate(-49.183104,147.75754)"> - <circle - style="fill:#b7c4c8;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4545" - cx="77.975891" - cy="144.92363" - r="4.1865373" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="75.418594" - y="145.38777" - id="text4551"><tspan - id="tspan4549" - x="75.418594" - y="145.38777" - style="stroke-width:0.26458332">s<tspan - dy="2" - id="tspan4561" - style="font-size:3.52777767px">4</tspan></tspan></text> - </g> - <path - id="path4565" - d="m 15.511855,264.18427 -7.2162772,6.81537" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow1Lstart);marker-end:url(#marker5041)" - inkscape:connector-curvature="0" /> - <path - id="path4567" - d="m 18.719089,265.25335 -5.078121,21.11429" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker4903)" - inkscape:connector-curvature="0" /> - <path - id="path4571" - d="M 27.208867,287.23737 22.130745,265.98945" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker4943)" - inkscape:connector-curvature="0" /> - <path - id="path4573" - d="m 31.147124,287.57035 4.543581,-10.28987" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#marker5335);marker-end:url(#marker4989)" - inkscape:connector-curvature="0" /> - <path - id="path4575" - d="m 17.650011,292.24757 h 5.479026" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker4869)" - inkscape:connector-curvature="0" /> - <path - id="path4577" - d="m 8.9637538,288.63943 -3.073601,-8.15172" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" - inkscape:connector-curvature="0" /> - </g> -</svg>
@@ -1,350 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - id="svg8" - version="1.1" - viewBox="0 0 52.916665 51.064584" - height="193" - width="200" - sodipodi:docname="example2.svg" - inkscape:version="0.92.1 r15371"> - <sodipodi:namedview - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1" - objecttolerance="10" - gridtolerance="10" - guidetolerance="10" - inkscape:pageopacity="0" - inkscape:pageshadow="2" - inkscape:window-width="1366" - inkscape:window-height="744" - id="namedview53" - showgrid="false" - inkscape:zoom="1.5128205" - inkscape:cx="65.358647" - inkscape:cy="121.33424" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" - inkscape:current-layer="svg8" /> - <defs - id="defs2"> - <marker - orient="auto" - refY="0" - refX="0" - id="marker5335" - style="overflow:visible"> - <path - id="path5333" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - transform="matrix(0.8,0,0,0.8,10,0)" - inkscape:connector-curvature="0" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Lstart" - refX="0" - refY="0" - orient="auto"> - <path - transform="matrix(0.8,0,0,0.8,10,0)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - id="path4579" - inkscape:connector-curvature="0" /> - </marker> - <marker - style="overflow:visible" - id="marker5041" - refX="0" - refY="0" - orient="auto"> - <path - transform="matrix(-0.8,0,0,-0.8,-10,0)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - id="path5039" - inkscape:connector-curvature="0" /> - </marker> - <marker - orient="auto" - refY="0" - refX="0" - id="marker4989" - style="overflow:visible"> - <path - id="path4987" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - transform="matrix(-0.8,0,0,-0.8,-10,0)" - inkscape:connector-curvature="0" /> - </marker> - <marker - style="overflow:visible" - id="marker4943" - refX="0" - refY="0" - orient="auto"> - <path - transform="matrix(-0.8,0,0,-0.8,-10,0)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - id="path4941" - inkscape:connector-curvature="0" /> - </marker> - <marker - orient="auto" - refY="0" - refX="0" - id="marker4903" - style="overflow:visible"> - <path - id="path4901" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - transform="matrix(-0.8,0,0,-0.8,-10,0)" - inkscape:connector-curvature="0" /> - </marker> - <marker - orient="auto" - refY="0" - refX="0" - id="marker4869" - style="overflow:visible"> - <path - id="path4867" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - transform="matrix(-0.8,0,0,-0.8,-10,0)" - inkscape:connector-curvature="0" /> - </marker> - <marker - style="overflow:visible" - id="Arrow1Lend" - refX="0" - refY="0" - orient="auto"> - <path - transform="matrix(-0.8,0,0,-0.8,-10,0)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" - d="M 0,0 5,-5 -12.5,0 5,5 Z" - id="path4582" - inkscape:connector-curvature="0" /> - </marker> - </defs> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - transform="matrix(1.2350865,0,0,1.2350865,-4.4147099e-8,-315.75609)" - id="layer1"> - <g - transform="translate(-58.254533,115.25159)" - id="g4513"> - <circle - style="fill:#5fbcd3;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="path4485" - cx="77.975891" - cy="144.92363" - r="4.1865373" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="75.418594" - y="145.38777" - id="text4489"><tspan - id="tspan4487" - x="75.418594" - y="145.38777" - style="stroke-width:0.26458332">s<tspan - style="font-size:3.52777767px" - id="tspan4491" - dx="0" - dy="2">2</tspan></tspan></text> - </g> - <g - transform="translate(-73.657062,129.99266)" - id="g4523"> - <circle - r="4.1865373" - cy="144.92363" - cx="77.975891" - id="circle4515" - style="fill:#ffb380;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - id="text4521" - y="145.38777" - x="75.418594" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="stroke-width:0.26458332" - y="145.38777" - x="75.418594" - id="tspan4519">s<tspan - dy="2" - id="tspan4555" - style="font-size:3.52777767px">1</tspan></tspan></text> - </g> - <g - id="g4533" - transform="translate(-39.450217,127.53582)"> - <circle - style="fill:#b7c4c8;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4525" - cx="77.975891" - cy="144.92363" - r="4.1865373" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="75.418594" - y="145.38777" - id="text4531"><tspan - id="tspan4529" - x="75.418594" - y="145.38777" - style="stroke-width:0.26458332">s<tspan - dy="2" - id="tspan4563" - style="font-size:3.52777767px">3</tspan></tspan></text> - </g> - <g - transform="translate(-65.530574,147.56855)" - id="g4543"> - <circle - r="4.1865373" - cy="144.92363" - cx="77.975891" - id="circle4535" - style="fill:#00ff00;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - id="text4541" - y="145.38777" - x="75.418594" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="stroke-width:0.26458332" - y="145.38777" - x="75.418594" - id="tspan4539">s<tspan - dy="2" - id="tspan4557" - style="font-size:3.52777767px">5</tspan></tspan></text> - </g> - <g - id="g4553" - transform="translate(-49.183104,147.75754)"> - <circle - style="fill:#ffb380;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4545" - cx="77.975891" - cy="144.92363" - r="4.1865373" /> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:5.64444447px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="75.418594" - y="145.38777" - id="text4551"><tspan - id="tspan4549" - x="75.418594" - y="145.38777" - style="stroke-width:0.26458332">s<tspan - dy="2" - id="tspan4561" - style="font-size:3.52777767px">4</tspan></tspan></text> - </g> - <path - id="path4565" - d="m 15.511855,264.18427 -7.2162772,6.81537" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#Arrow1Lstart);marker-end:url(#marker5041)" - inkscape:connector-curvature="0" /> - <path - id="path4567" - d="m 18.719089,265.25335 -5.078121,21.11429" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker4903)" - inkscape:connector-curvature="0" /> - <path - id="path4571" - d="M 27.208867,287.23737 22.130745,265.98945" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker4943)" - inkscape:connector-curvature="0" /> - <path - id="path4573" - d="m 31.147124,287.57035 4.543581,-10.28987" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:url(#marker5335);marker-end:url(#marker4989)" - inkscape:connector-curvature="0" /> - <path - id="path4575" - d="m 17.650011,292.24757 h 5.479026" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker4869)" - inkscape:connector-curvature="0" /> - <path - id="path4577" - d="m 8.9637538,288.63943 -3.073601,-8.15172" - style="fill:none;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" - inkscape:connector-curvature="0" /> - </g> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.85977268px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.22780183" - x="6.2450199" - y="47.761745" - id="text4579"><tspan - sodipodi:role="line" - id="tspan4577" - x="6.2450199" - y="47.761745" - style="stroke-width:0.22780183">1</tspan></text> - <text - id="text4631" - y="7.4923263" - x="30.73904" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.85977268px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.22780183" - xml:space="preserve"><tspan - style="stroke-width:0.22780183" - y="7.4923263" - x="30.73904" - id="tspan4629" - sodipodi:role="line">3</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.85977268px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.22780183" - x="1.26939" - y="17.198946" - id="text4583"><tspan - sodipodi:role="line" - id="tspan4581" - x="1.26939" - y="17.198946" - style="stroke-width:0.22780183">2.1</tspan></text> - <text - id="text4635" - y="46.231361" - x="41.495026" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4.85977268px;line-height:1.25;font-family:Serif;-inkscape-font-specification:Serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.22780183" - xml:space="preserve"><tspan - style="stroke-width:0.22780183" - y="46.231361" - x="41.495026" - id="tspan4633" - sodipodi:role="line">2.2</tspan></text> -</svg>
@@ -1,405 +0,0 @@
-// -------------------------------------------------------------------------- // -// Constants -var INTERPOLATION = 0.6; - -var BOX_HEIGHT = 0.15; // %, from and to which drop the items -var BOX_HOVER = [255, 0, 0]; -var BOX_NORMAL = [255, 200, 200]; - -var NODE_NORMAL = '#000'; -var NODE_TEXT = '#fff'; -var NODE_FONT = 'px Georgia'; - -var FRAME_DURATION = 25; // ms - -// -------------------------------------------------------------------------- // -// Retrieve used HTML elements -canvas = document.getElementById('canvas'); -matrixTable = document.getElementById('matrixTable'); -matrixOrder = document.getElementById('matrixOrder'); -matrixAccum = document.getElementById('matrixAccum'); -matrixTableWrapper = document.getElementById('matrixTableWrapper'); - -// -------------------------------------------------------------------------- // -// Variables -var orderShown, accumShown; -c = canvas.getContext('2d'); - -// Box color, from which and to which nodes should be dragged -var boxColor = BOX_NORMAL.slice(); - -// Available nodes and their connection matrix- these should be kept in sync -var nodes = []; -var connMatrix = Array.matrix(0, 0, 0); - -// Which node was the first we right clicked to create a new connection? -var startConn = null; - -// Are we dragging any node yet? -var anyDragging = false; - -// Highlight mode [row, col, color] for the matrix representing the graph -var highlight = [-1, -1, '#fff']; - -function updateOrder() { - orderShown = Number(matrixOrder.value); - accumShown = matrixAccum.checked; - calcShowConnMatrix(); -} -updateOrder(); - -// -------------------------------------------------------------------------- // -// Declare a prototype (Node) to render the selectable elements -function Node(x, y, r, id) { - this.x = x; - this.y = y; - this.r = r; - this.id = id; - this.color = null; - this.dragging = false; - - this.draw = function() { - if (this.dragging) { - c.fillStyle = NODE_NORMAL; - this.x = lerp(this.x, canvas.mouseX, INTERPOLATION); - this.y = lerp(this.y, canvas.mouseY, INTERPOLATION); - } else { - c.fillStyle = this.color; - } - c.circle(this.x, this.y, this.r); - - c.fillStyle = NODE_TEXT; - c.font = ''+r+NODE_FONT; - // Arbitrary but nice - var x = this.x - r * 0.3; - var y = this.y + r * 0.3; - - c.fillText(""+this.id, x, y); - } - - this.resetColor = function() { - this.color = '#777'; - } - this.resetColor(); - - this.inBounds = function(x, y) { - return Math.abs(this.x - x) < this.r && - Math.abs(this.y - y) < this.r; - } -} - -// -------------------------------------------------------------------------- // -// Node handling -function addNode(x, y) { - nodes.push(new Node(x, y, 20, nodes.length + 1)); - limitOrder(nodes.length); - - var newMatrix = Array.matrix(nodes.length, nodes.length, 0); - matrixCpy(connMatrix, newMatrix); - setConnMatrix(newMatrix); -} - -function deleteNode(at) { - nodes.splice(at, 1); - limitOrder(nodes.length); - - // Re-set the nodes IDs - for (var i = 0; i != nodes.length; ++i) { - nodes[i].id = i+1; - } - - // Pop the at'th row (connections from the node we deleted) - // and also the at'th column (connections to the node we deleted) - setConnMatrix(matrixPop(connMatrix, at, at)); -} - -function clearNodes() { - nodes.length = 0; - limitOrder(1); - resetConnections(); -} - -// -------------------------------------------------------------------------- // -// Connection matrix handling -function setConnMatrix(matrix) { - connMatrix = matrix; - makeNodesHighlightable(matrixTable, connMatrix); - calcShowConnMatrix(); -} - -function resetConnections() { - setConnMatrix(Array.matrix(nodes.length, nodes.length, 0)); -} - -// -------------------------------------------------------------------------- // -// Matrix representation -function calcShowConnMatrix() { - if (orderShown > 1) { - var multiplied = Array.matrix(nodes.length, nodes.length, 0); - matrixCpy(connMatrix, multiplied); - - if (accumShown) { - var shown = Array.matrix(nodes.length, nodes.length, 0); - matrixCpy(connMatrix, shown); - } - - for (var i = 1; i != orderShown; ++i) { - multiplied = matrixMul(connMatrix, multiplied); - if (accumShown) { - matrixAdd(multiplied, shown); - } - } - if (accumShown) { - matrixRepr(shown, matrixTable, highlight); - } else { - matrixRepr(multiplied, matrixTable, highlight); - } - } else { - matrixRepr(connMatrix, matrixTable, highlight); - } -} - -// Makes a table "highlightable" (when the mouse hovers, -// it will be redrawn) by using the specified matrix. -function makeNodesHighlightable(table, matrix) { - table.matrix = matrix; - table.addEventListener('mousemove', function(e) { - if (!table.matrix && !table.matrix[0]) - return; - - // TODO I know, this shouldn't have to go here and I should make a - // better script to show the whole path and stuff... oh well. - if (orderShown > 1) { - if (highlight[0] != -1 || highlight[1] != -1) { - highlight[0] = highlight[1] = -1; - for (var i = 0; i != nodes.length; ++i) - nodes[i].resetColor(); - calcShowConnMatrix(); - } - return; - } - - var rect = table.getBoundingClientRect(); - var x = e.clientX - rect.left; - var y = e.clientY - rect.top; - - var colWidth = rect.width / (table.matrix[0].length+1); - var col = Math.floor(x / colWidth)-1; - - var rowHeight = rect.height / (table.matrix.length+1); - var row = Math.floor(y / rowHeight)-1; - - if (row != highlight[0] || col != highlight[1]) { - highlight[0] = row; - highlight[1] = col; - if (row >= 0 && col >= 0) { - if (table.matrix[row][col]) { - // there is a connection so color them - nodes[row].color = '#77f'; - nodes[col].color = '#7f7'; - highlight[2] = '#afa'; - } else { - // no connection so reset its colors - for (var i = 0; i != nodes.length; ++i) - nodes[i].resetColor(); - - highlight[2] = '#faa'; - } - } - calcShowConnMatrix(); - } - - }, false); -} - -// -------------------------------------------------------------------------- // -// Canvas rendering -function renderElements() { - c.clear(); - if (canvas.mouseDown && canvas.mouseY < canvas.height * BOX_HEIGHT) { - boxColor = lerpArray(boxColor, BOX_HOVER, 0.2); - } else { - boxColor = lerpArray(boxColor, BOX_NORMAL, 0.2); - } - c.rect(0, 0, canvas.width, canvas.height * BOX_HEIGHT); - c.fillStyle = 'rgb(' + - Math.round(boxColor[0]) + ',' + - Math.round(boxColor[1]) + ',' + - Math.round(boxColor[2]) + ')'; - c.fill(); - - - if (nodes.length == 0) - return; - - for (var i = 0; i != nodes.length; ++i) - nodes[i].draw(); - - c.strokeStyle = '#f00'; - - var ii = connMatrix.length; - var jj = connMatrix.length; - - var x0, y0, x1, y1, cos, sin; - var rsq = Math.pow(nodes[0].r + 40, 2); // Radius SQuared + some margin - for (var i = 0; i != ii; ++i) { - for (var j = 0; j != jj; ++j) { - if (connMatrix[i][j]) { - // Non-zero item, this implies a connection between nodes. - // An element on the matrix connects row (i) -> column (j) - x0 = nodes[i].x; - y0 = nodes[i].y; - x1 = nodes[j].x; - y1 = nodes[j].y; - - // Interpolate a bit to exit the radius unless we're too close - if (Math.pow(y1 - y0, 2) + Math.pow(x1 - x0, 2) > rsq) { - var angle = Math.atan2(y1 - y0, x1 - x0); - cos = Math.cos(angle) * nodes[0].r; - sin = Math.sin(angle) * nodes[0].r; - x0 += cos; - y0 += sin; - x1 -= cos; - y1 -= sin; - } - c.arrow(x0, y0, x1, y1); - } - } - } - - if (startConn != null) { - c.arrow(nodes[startConn].x, nodes[startConn].y, - canvas.mouseX, canvas.mouseY); - } -} - -function renderLoop() { - renderElements(); - setTimeout(renderLoop, FRAME_DURATION); -} - -// -------------------------------------------------------------------------- // -// HTML interaction - -// To limit the maximum orden which can be specified on the HTML and -// also clamp the currently shown order to the limit if it's exceeded -function limitOrder(value) { - matrixOrder.max = value; - if (orderShown > value) { - orderShown = value; - matrixOrder.value = '' + value; - } -} - -canvas.addEventListener('mousedown', function(e) { - if (e.button == 0) { - if (canvas.mouseY < canvas.height * BOX_HEIGHT) { - // Add node - addNode(canvas.mouseX, 0); - nodes[nodes.length - 1].dragging = true; - anyDragging = true; - } else { - // Drag nodes - for (var i = nodes.length; i--;) { - if (nodes[i].inBounds(canvas.mouseX, canvas.mouseY)) { - nodes[i].dragging = true; - anyDragging = true; - break; - } - } - } - canvas.style.cursor = anyDragging ? "crosshair" : "default"; - - } else if (e.button == 2) { - // Right button, select two nodes to join - if (startConn == null) { - for (var i = nodes.length; i--;) { - if (nodes[i].inBounds(canvas.mouseX, canvas.mouseY)) { - startConn = i; - break; - } - } - } - } else if (e.button == 1) { - // Middle click, clear the connections from and to a given node - for (var i = nodes.length; i--;) { - if (nodes[i].inBounds(canvas.mouseX, canvas.mouseY)) { - for (var j = 0; j != nodes.length; ++j) - connMatrix[i][j] = 0; - break; - } - } - } - - canvas.mouseDown = e.button == 0 ? 'L' : 'R'; -}, false); - -canvas.addEventListener('mouseup', function(e) { - canvas.mouseDown = ''; - - if (anyDragging) { - anyDragging = false; - for (var i = nodes.length; i--; ) { - if (nodes[i].dragging) { - if (canvas.mouseY < canvas.height * BOX_HEIGHT) { - deleteNode(i); - } else { - nodes[i].dragging = false; - } - } - } - } else if (startConn != null) { - for (var i = nodes.length; i--;) { - if (nodes[i].inBounds(canvas.mouseX, canvas.mouseY)) { - // Node row connected to node column - if (i != startConn) - connMatrix[startConn][i] = 1; - break; - } - } - startConn = null; - } - - calcShowConnMatrix(); -}, false); - -canvas.addEventListener('mousemove', function(e) { - var rect = canvas.getBoundingClientRect(); - canvas.mouseX = e.clientX - rect.left; - canvas.mouseY = e.clientY - rect.top; - -}, false); - -// -------------------------------------------------------------------------- // -// Represent the example we walked through -function lilNoise() { - return (Math.random() - 0.5) * canvas.width * 0.05; -} - -function getNoiseX(relative) { - return canvas.width * relative + lilNoise(); -} - -function getNoiseY(relative) { - return canvas.height * relative + lilNoise(); -} - -addNode(getNoiseX(0.2), getNoiseY(0.5)); -addNode(getNoiseX(0.5), getNoiseY(0.3)); -addNode(getNoiseX(0.8), getNoiseY(0.5)); -addNode(getNoiseX(0.7), getNoiseY(0.7)); -addNode(getNoiseX(0.3), getNoiseY(0.7)); - -setConnMatrix([ - [0, 1, 0, 0, 0], - [1, 0, 0, 0, 1], - [0, 0, 0, 1, 0], - [0, 1, 1, 0, 0], - [1, 0, 0, 1, 0] -]); - -calcShowConnMatrix(); - - -// Let's go! -renderLoop();
@@ -1,155 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Graphs</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script> -<div class="date-created-modified">2017-06-02</div> -<noscript>There are a few things which won't render unless you enable -JavaScript. No tracking, I promise!</noscript> -<h1 class="title" id="graphs"><a class="anchor" href="#graphs">¶</a>Graphs</h1> -<blockquote> -<p>Don't know English? <a href="spanish.html">Read the Spanish version instead</a>.</p> -</blockquote> -<p>Let's imagine we have 5 bus stations, which we'll denote by \(s_i\):</p> -<p>(\begin{bmatrix} -& s_1 & s_2 & s_3 & s_4 & s_5 \ -s_1 & & V & & & \ -s_2 & V & & & & V \ -s_3 & & & & V & \ -s_4 & & V & V & & \ -s_5 & V & & & V & -\end{bmatrix})</p> -<p>This is known as a <i>"table of direct interconnections"</i>.</p> - <p>The \(V\) represent connected paths. For instance, on the first - row starting at \(s_1\), reaching the \(V\), - allows us to turn up to get to \(s_2\).</p> -<p>We can see the above table represented in a more graphical way:</p> - <img src="example1.svg" /> - <p>This type of graph is called, well, a <i>graph</i>, and it's a directed - graph (or <i>digraph</i>), since the direction on which the arrows go does - matter. It's made up of vertices, joined together by edges (also known as - lines or directed <b>arcs</b>).</p> -<p>One can walk from a node to another through different <b>paths</b>. For - example, \(s_4 \rightarrow s_2 \rightarrow s_5\) is an indirect path of <b>order</b> - two, because we must use two edges to go from \(s_4\) to - \(s_5\).</p> -<p>Let's now represent its adjacency matrix called A which represents the - same table, but uses <mark>1</mark> instead </mark>V</mark> to represent - a connection:</p> -<p>(\begin{bmatrix} -0 & 1 & 0 & 0 & 0 \ -1 & 0 & 0 & 0 & 1 \ -0 & 0 & 0 & 1 & 0 \ -0 & 1 & 1 & 0 & 0 \ -1 & 0 & 0 & 1 & 0 -\end{bmatrix})</p> -<p>This way we can see how the \(a_{2,1}\) element represents the - connection \(s_2 \rightarrow s_1\), and the \(a_{5,1}\) element the - \(s_5 \rightarrow s_1\) connection, etc.</p> -<p>In general, \(a_{i,j}\) represents a connection from - \(s_i \rightarrow s_j\)as long as \(a_{i,j}\geq 1\).</p> -<p>Working with matrices allows us to have a computable representation of - any graph, which is very useful.</p> -<hr /> -<p>Graphs have a lot of interesting properties besides being representable - by a computer. What would happen if, for instance, we calculated - \(A^2\)? We obtain the following matrix:</p> -<p>(\begin{bmatrix} -1 & 0 & 0 & 0 & 1 \ -1 & 1 & 0 & 1 & 0 \ -0 & 1 & 1 & 0 & 0 \ -1 & 0 & 0 & 1 & 1 \ -0 & 2 & 1 & 0 & 0 -\end{bmatrix})</p> -<p>We can interpret this as the paths of order <b>two</b>.</p> - <p>But what does the element \(a_{5,2}=2\) represent? It indicates - the amount of possible ways to go from \(s_5 \rightarrow s_i \rightarrow s_2\).</p> -<p>One can manually multiply the involved row and column to determine which - element is the one we need to pass through, this way we have the row - \([1 0 0 1 0]\) and the column \([1 0 0 1 0]\) (on - vertical). The elements \(s_i\geq 1\) are \(s_1\) and - \(s_4\). This is, we can go from \(s_5\) to - \(s_2\) via \(s_5 \rightarrow s_1 \rightarrow s_2\) or via - \(s_5 \rightarrow s_4 \rightarrow s_2\):</p> - <img src="example2.svg" /> -<p>It's important to note that graphs to not consider self-connections, this - is, \(s_i \rightarrow s_i\) is not allowed; neither we work with multigraphs - here (those which allow multiple connections, for instance, an arbitrary - number \(n\) of times).</p> -<p>(\begin{bmatrix} -1 & 1 & 0 & 1 & 0 \ -1 & 2 & \textbf{1} & 0 & 1 \ -1 & 0 & 0 & 1 & 1 \ -1 & 2 & 1 & 1 & 0 \ -2 & 0 & 0 & 1 & 2 -\end{bmatrix})</p> -<p>We can see how the first \(1\) just appeared on the element - \(a_{2,3}\), which means that the shortest path to it is at least - of order three.</mark> -<hr /> -<p>A graph is said to be <b>strongly connected</b> as long as there is a - way to reach <i>all</i> its elements.</p> -<p>We can see all the available paths until now by simply adding up all the - direct and indirect ways to reach a node, so for now, we can add - \(A+A^2+A^3\) in such a way that:</p> -<p>(\begin{bmatrix} -2 & 2 & 0 & 1 & 1 \ -3 & 3 & 1 & 1 & 3 \ -1 & 1 & 1 & 2 & 1 \ -2 & 3 & 2 & 2 & 1 \ -3 & 2 & 1 & 2 & 2 -\end{bmatrix})</p> -<p>There isn't a connection between \(s_1\) and \(s_3\) yet. - If we were to calculate \(A^4\):</p> -<p>(\begin{bmatrix} -1 & 2 & 1 & & \ -& & & & \ -& & & & \ -& & & & \ -& & & &<br /> -\end{bmatrix})</p> -<p>We don't need to calculate anymore. We now know that the graph is - strongly connected!</p> -<hr /> -<p>Congratulations! You've completed this tiny introduction to graphs. - Now you can play around with them and design your own connections.</p> -<p>Hold the left mouse button on the above area and drag it down to create - a new node, or drag a node to this area to delete it.</p> -<p>To create new connections, hold the right mouse button on the node you - want to start with, and drag it to the node you want it to be connected to.</p> -<p>To delete the connections coming from a specific node, middle click it.</p> -<table><tr><td style="width:100%;"> - <button onclick="resetConnections()">Reset connections</button> - <button onclick="clearNodes()">Clear all the nodes</button> - <br /> - <br /> - <label for="matrixOrder">Show matrix of order:</label> - <input id="matrixOrder" type="number" min="1" max="5" - value="1" oninput="updateOrder()"> - <br /> - <label for="matrixAccum">Show accumulated matrix</label> - <input id="matrixAccum" type="checkbox" onchange="updateOrder()"> - <br /> - <br /> - <div class="matrix"> - <table id="matrixTable"></table> - </div> - </td><td> - <canvas id="canvas" width="400" height="400" oncontextmenu="return false;"> - Looks like your browser won't let you see this fancy example :( - </canvas> - <br /> - </td></tr></table> -<script src="tinyparser.js"></script> -<script src="enhancements.js"></script> -<script src="graphs.js"></script> -</main> -</body> -</html> -
@@ -1,63 +0,0 @@
-// Custom tiny parser for csv tables. They're more comfortable. -var tables = document.getElementsByClassName('csv'); -for (var i = 0; i != tables.length; ++i) { - var lines = tables[i].innerHTML.split('\n'); - var result = ['<table>']; - var line = null; - for (var j = 0; j != lines.length; ++j) { - line = lines[j].trim(); - if (line) { - result.push('<tr><td>'); - result.push(lines[j].replace(/\s*;\s*/g, '</td><td>')); - result.push('</td></tr>'); - } - } - result.push('</table>'); - tables[i].innerHTML = result.join(''); -} - -// Custom tiny math parser. I like writing parsers. -// 'x^2n ' becomes 'x<sup>2n</sup> ' -// 'x_5n ' becomes 'x<sub>5n</sub> ' -// 'a * b' becomes 'a × b' -// ' ' becomes ' ' -function mathify(element) { - var c = null; - var closeOnSpace = null; - var content = element.innerHTML.split(''); - for (var j = 0; j != content.length; ++j) { - c = content[j]; - if (c == '*') { - content[j] = '×'; - } else if (c == '^') { - content[j] = '<sup>'; - closeOnSpace = '</sup>'; - } else if (c == '_') { - content[j] = '<sub>'; - closeOnSpace = '</sub>'; - } else if (c == ' ') { - if (closeOnSpace == null) { - content[j] = ' '; - } else { - content[j] = closeOnSpace + ' '; - closeOnSpace = null; - } - } else if (c == '\n' && closeOnSpace != null) { - content[j] = closeOnSpace + '\n'; - closeOnSpace = null; - } - } - if (closeOnSpace != null) { - content.push(closeOnSpace.trim()); - } - - element.innerHTML = content.join(''); -} - -var maths = document.getElementsByTagName('mark'); -for (var i = 0; i != maths.length; ++i) - mathify(maths[i]); - -var maths = document.getElementsByClassName('math'); -for (var i = 0; i != maths.length; ++i) - mathify(maths[i]);
@@ -1,14 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>pagong</title> -<link rel="stylesheet" href="css/style.css"> -</head> -<body> -<main> -<ul><li><a href="posts/index.html">Atemporal Blog Posts</a></li><li><a href="making-a-difference/index.html">Making a Difference</a></li><li><a href="university/index.html">University posts</a></li><li><a href="ctypes-and-windows/index.html">Python ctypes and Windows</a></li><li><a href="pixel-dungeon/index.html">Shattered Pixel Dungeon</a></li><li><a href="breaking-ror/index.html">Breaking Risk of Rain</a></li><li><a href="asyncio/index.html">An Introduction to Asyncio</a></li><li><a href="new-computer/index.html">My new computer</a></li><li><a href="tips-outpost/index.html">Tips for Outpost</a></li><li><a href="installing_nixos_2/index.html">Installing NixOS, Take 2</a></li><li><a href="installing_nixos/index.html">Installing NixOS</a></li><li><a href="world_edit/index.html">WorldEdit Commands</a></li><li><a href="sentences/index.html">Sentences</a></li><li><a href="index/index.html">Blog de Lonami</a></li><li><a href="graphs/index.html">Graphs</a></li><li><a href="filosofia/index.html">Apuntes de bachillerato de Filosofía</a></li><li><a href="reflexion_ia/index.html">Reflexión sobre la Inteligencia artificial</a></li><li><a href="inteligencia_artificial/index.html">Inteligencia artificial</a></li></ul></main> -</body> -</html> -
@@ -1,27 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Blog de Lonami</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="blog_de_lonami"><a class="anchor" href="#blog_de_lonami">¶</a>Blog de Lonami</h1> -<div class="date-created-modified">Created 2016-03-04<br> -Modified 2018-01-31</div> -<p>Hola | Hi.</p> -<p>Choose your language below:</p> -<ul> -<li><a href="#bienvenido-al-blog">Leer entradas en español</a></li> -<li><a href="#welcome-to-the-blog">Read English entries</a></li> -</ul> -<h2 id="bienvenido_al_blog"><a class="anchor" href="#bienvenido_al_blog">¶</a>Bienvenido al blog</h2> -<p>Bienvenido al mejor (o no) blog del mundo. En esta sección publicaré de manera muy puntual algunas entradas que espero resulten interesantes para el gran público.</p> -<h2 id="welcome_to_the_blog"><a class="anchor" href="#welcome_to_the_blog">¶</a>Welcome to the blog</h2> -<p>Welcome to the best (or not) blog in the entire world. On this blog I will occasionally post new entries which I find interesting.</p> -</main> -</body> -</html> -
@@ -1,90 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Installing NixOS</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="installing_nixos"><a class="anchor" href="#installing_nixos">¶</a>Installing NixOS</h1> -<div class="date-created-modified">Created 2017-05-13<br> -Modified 2019-02-16</div> -<h2 id="update"><a class="anchor" href="#update">¶</a>Update</h2> -<p><em>Please see <a href="../installing_nixos_2/index.html">my followup post with NixOS</a> for a far better experience with it</em></p> -<hr /> -<p>Today I decided to install <a href="http://nixos.org/">NixOS</a> as a recommendation, a purely functional Linux distribution, since <a href="https://xubuntu.org/">Xubuntu</a> kept crashing. Here's my journey, and how I managed to install it from a terminal for the first time in my life. Steps aren't hard, but they may not seem obvious at first.</p> -<ul> -<li> -<p>Grab the Live CD, burn it on a USB stick and boot. I recommend using <a href="https://etcher.io/">Etcher</a>.</p> -</li> -<li> -<p>Type <code>systemctl start display-manager</code> and wait.<sup class="footnote-reference" id="r.1"><a href="#f.1">1</a></sup></p> -</li> -<li> -<p>Open both the manual and the <code>konsole</code>.</p> -</li> -<li> -<p>Connect to the network using the GUI.</p> -</li> -<li> -<p>Create the disk partitions by using <code>fdisk</code>.</p> -<p>You can list them with <code>fdisk -l</code>, modify a certain drive with <code>fdisk /dev/sdX</code> (for instance, <code>/dev/sda</code>) and follow the instructions.</p> -<p>To create the file system, use <code>mkfs.ext4 -L <label> /dev/sdXY</code> and swap with <code>mkswap -L <label> /dev/sdXY</code>.</p> -<p>The EFI partition should be done with <code>mkfs.vfat</code>.</p> -</li> -<li> -<p>Mount the target to <code>/mnt</code> e.g. if the label was <code>nixos</code>, <code>mount /dev/disk/by-label/nixos /mnt</code></p> -</li> -<li> -<p><code>mkdir /mnt/boot</code> and then mount your EFI partition to it.</p> -</li> -<li> -<p>Generate a configuration template with <code>nixos-generate-config --root /mnt</code>, and modify it with <code>nano /etc/nixos/configuration.nix</code>.</p> -</li> -<li> -<p>While modifying the configuration, make sure to add <code>boot.loader.grub.device = "/dev/sda"</code></p> -</li> -<li> -<p>More useful configuration things are:</p> -<ul> -<li>Uncomment the whole <code>i18n</code> block.</li> -<li>Add some essential packages like <code>environment.systemPackages = with pkgs; [wget git firefox pulseaudio networkmanagerapplet];</code>.</li> -<li>If you want to use XFCE, add <code>services.xserver.desktopManager.xfce.enable = true;</code>, otherwise, you don't need <code>networkmanagerapplet</code> either. Make sure to add <code>networking.networkmanager.enable = true;</code> too.</li> -<li>Define some user for yourself (modify <code>guest</code> name) and use a UID greater than 1000. Also, add yourself to <code>extraGroups = ["wheel" "networkmanager"];</code> (the first to be able to <code>sudo</code>, the second to use network related things).</li> -</ul> -</li> -<li> -<p>Run <code>nixos-install</code>. If you ever modify that file again, to add more packages for instance (this is how they're installed), run <code>nixos-rebuild switch</code> (or use <code>test</code> to test but don't boot to it, or <code>boot</code> not to switch but to use on next boot.</p> -</li> -<li> -<p><code>reboot</code>.</p> -</li> -<li> -<p>Login as <code>root</code>, and set a password for your user with <code>passwd <user></code>. Done!</p> -</li> -</ul> -<p>I enjoyed the process of installing it, and it's really cool that it has versioning and is so clean to keep track of which packages you install. But not being able to run arbitrary binaries by default is something very limitting in my opinion, though they've done a good job.</p> -<p>I'm now back to Xubuntu, with a fresh install.</p> -<h2 id="update_2"><a class="anchor" href="#update_2">¶</a>Update</h2> -<p>It is not true that "they don't allow running arbitrary binaries by default", as pointed out in their <a href="https://nixos.org/nixpkgs/manual/#sec-fhs-environments">manual, buildFHSUserEnv</a>:</p> -<blockquote> -<p><code>buildFHSUserEnv</code> provides a way to build and run FHS-compatible lightweight sandboxes. It creates an isolated root with bound <code>/nix/store</code>, so its footprint in terms of disk space needed is quite small. This allows one to run software which is hard or unfeasible to patch for NixOS -- 3rd-party source trees with FHS assumptions, games distributed as tarballs, software with integrity checking and/or external self-updated binaries. It uses Linux namespaces feature to create temporary lightweight environments which are destroyed after all child processes exit, without root user rights requirement.</p> -</blockquote> -<p>Thanks to <a href="https://github.com/bb010g">@bb010g</a> for pointing this out.</p> -<h2 id="notes"><a class="anchor" href="#notes">¶</a>Notes</h2> -<p class="footnote" id="f.1"><sup>1</sup> The keyboard mapping is a bit strange. On my Spanish keyboard, the keys were as follows: <a href="#r.1">↩</a></p> -<table><thead><tr><th>Keyboard</th><th>Maps to</th><th>Shift</th></tr></thead><tbody> -<tr><td>'</td><td>-</td><td>_</td></tr> -<tr><td>´</td><td>'</td><td>"</td></tr> -<tr><td>`</td><td>[</td><td></td></tr> -<tr><td>+</td><td>]</td><td></td></tr> -<tr><td>¡</td><td>=</td><td></td></tr> -<tr><td>-</td><td>/</td><td></td></tr> -<tr><td>ñ</td><td>;</td><td></td></tr> -</tbody></table> -</main> -</body> -</html> -
@@ -1,109 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Installing NixOS, Take 2</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="installing_nixos_take_2"><a class="anchor" href="#installing_nixos_take_2">¶</a>Installing NixOS, Take 2</h1> -<div class="date-created-modified">Created 2019-02-15<br> -Modified 2019-02-16</div> -<p>This is my second take at installing NixOS, after a while being frustrated with Arch Linux and the fact that a few kernel upgrades ago, the system crashed randomly from time to time. <code>journalctl</code> did not have any helpful hints and I thought reinstalling could be worthwhile anyway.</p> -<p>This time, I started with more knowledge! The first step is heading to the <a href="https://nixos.org">NixOS website</a> and downloading their minimal installation CD for 64 bits. I didn't go with their graphical live CD, because their <a href="https://nixos.org/nixos/manual">installation manual</a> is a wonderful resource that guides you nicely.</p> -<p>Once you have downloaded their <code>.iso</code>, you should probably verify it's <code>sha256sum</code> and make sure that it matches. The easiest thing to do in my opinion is using an USB to burn the image in it. Plug it in and check its device name with <code>fdisk -l</code>. In my case, it was <code>/dev/sdb</code>, so I went ahead with it and ran <code>dd if=nixos.iso of=/dev/sdb status=progress</code>. Make sure to run <code>sync</code> once that's done.</p> -<p>If either <code>dd</code> or <code>sync</code> seem "stuck" in the end, they are just flushing the changes to disk to make sure all is good. This is normal, and depends on your drives.</p> -<p>Now, reboot your computer with the USB plugged in and make sure to boot into it. You should be welcome with a pretty screen. Just select the first option and wait until it logs you in as root. Once you're there you probably want to <code>loadkeys es</code> or whatever your keyboard layout is, or you will have a hard time with passwords, since the characters are all over the place.</p> -<p>In a clean disk, you would normally create the partitions now. In my case, I already had the partitions made (100MB for the EFI system, where <code>/boot</code> lives, 40GB for the root <code>/</code> partition with my old Linux installation, and 700G for <code>/home</code>), so I didn't need to do anything here. The manual showcases <code>parted</code>, but I personally use <code>fdisk</code>, which has very helpful help I check every time I use it.</p> -<p><strong>Important</strong>: The <code>XY</code> in <code>/dev/sdXY</code> is probably different in your system! Make sure you use <code>fdisk -l</code> to see the correct letters and numbers!</p> -<p>With the partitions ready in my UEFI system, I formatted both <code>/</code> and <code>/boot</code> just to be safe with <code>mkfs.ext4 -L nixos /dev/sda2</code> and <code>mkfs.fat -F 32 -n boot /dev/sda1</code> (remember that these are the letters and numbers used in my partition scheme). Don't worry about the warning in the second command regarding lowercase letters and Windows. It's not really an issue.</p> -<p>Now, since we gave each partition a label, we can easily mount them through <code>mount /dev/disk/by-label/nixos /mnt</code> and, in UEFI systems, be sure to <code>mkdir -p /mnt/boot</code> and <code>mount /dev/disk/by-label/boot /mnt/boot</code>. I didn't bother setting up swap, since I have 8GB of RAM in my laptop and that's really enough for my use case.</p> -<p>With that done, we will now ask the configuration wizard to do some work for us (in particular, generate a template) with <code>nixos-generate-config --root /mnt</code>. This generates a very well documented file that we should edit right now (and this is important!) with whatever editor you prefer. I used <code>vim</code>, but you can change it for <code>nano</code> if you prefer.</p> -<p>On to the configuration file, we need to enable a few things, so <code>vim /mnt/etc/nixos/configuration.nix</code> and start scrolling down. We want to make sure to uncomment:</p> -<pre><code># We really want network! -networking.wireless.enable = true; - -# This "fixes" the keyboard layout. Put the one you use. -i18n = { -consoleKeyMap = "es"; -} - -# Timezones are tricky so let's get this right. -time.timeZone = "Europe/Madrid"; - -# We *really* want some base packages installed, such as -# wpa_supplicant, or we won't have a way to connect to the -# network once we install... -environment.systemPackages = with pkgs; [ -wpa_supplicant wget curl vim neovim cmus mpv firefox git tdesktop -]; - -# Printing is useful, sure, enable CUPS -services.printing.enable = true; - -# We have speakers, let's make use of them. -sound.enable = true; -hardware.pulseaudio.enable = true; - -# We want the X11 windowing system enabled, in Spanish. -services.xserver.enable = true; -services.xserver.layout = "es"; - -# I want a desktop manager in my laptop. -# I personally prefer XFCE, but the manual shows plenty -# of other options, such as Plasma, i3 WM, or whatever. -services.xserver.desktopManager.xfce.enable = true; -services.xserver.desktopManager.default = "xfce"; - -# Touchpad is useful (although sometimes annoying) in a laptop -services.xserver.libinput.enable = true; - -# We don't want to do everything as root! -users.users.lonami = { -isNormalUser = true; -uid = 1000; -home = "/home/lonami"; -extraGroups = [ "wheel" "networkmanager" "audio" ]; -}; -</code></pre> -<p><em>(Fun fact, I overlooked the configuration file until I wrote this and hadn't noticed sound/pulseaudio was there. It wasn't hard to find online how to enable it though!)</em></p> -<p>Now, let's modify <code>hardware-configuration.nix</code>. But if you have <code>/home</code> in a separate partition like me, you should run <code>blkid</code> to figure out its UUID. To avoid typing it out myself, I just ran <code>blkid >> /mnt/etc/nixos/hardware-configuration.nix</code> so that I could easily move it around with <code>vim</code>:</p> -<pre><code># (stuff...) - -fileSystems."/home" = -{ device = "/dev/disk/by-uuid/d344c686-cae7-4dd3-840e-308eddf86608"; -fsType = "ext4"; -}; - -# (more stuff...) -</code></pre> -<p>Note that, obviously, you should put your own partition's UUID there. Modifying the configuration is where I think the current NixOS' manual should have made more emphasis, at this step of the installation. They do detail it below, but that was already too late in my first attempt. Anyway, you can boot from the USB and run <code>nixos-install</code> as many times as you need until you get it working!</p> -<p>But before installing, we need to configure the network since there are plenty of things to download. If you want to work from WiFi, you should first figure out the name of your network card with <code>ip link show</code>. In my case it's called <code>wlp3s0</code>. So with that knowledge we can run <code>wpa_supplicant -B -i wlp3s0 -c <(wpa_passphrase SSID key)</code>. Be sure to replace both <code>SSID</code> and <code>key</code> with the name of your network and password key, respectively. If they have spaces, surround them in quotes.</p> -<p>Another funny pitfall was typing <code>wpa_supplicant</code> in the command above twice (instead of <code>wpa_passphrase</code>). That sure spit out a few funny errors! Once you have ran that, wait a few seconds and <code>ping 1.1.1.1</code> to make sure that you can reach the internet. If you do, <code>^C</code> and let's install NixOS!</p> -<pre><code>nixos-install -</code></pre> -<p>Well, that was pretty painless. You can now <code>reboot</code> and enjoy your new, functional system.</p> -<h2 id="afterword"><a class="anchor" href="#afterword">¶</a>Afterword</h2> -<p>The process of installing NixOS was really painless once you have made sense out of what things mean. I was far more pleased this time than in my previous attempt, despite the four attempts I needed to have it up and running.</p> -<p>However not all is so good. I'm not sure where I went wrong, but the first time I tried with <code>i3</code> instead of <code>xfce</code>, all I was welcome with was a white, small terminal in the top left corner. I even generated a configuration file with <code>i3-config-wizard</code> to make sure it could detect my Mod1/Mod4 keys (which, it did), but even after rebooting, my commands weren't responding. For example, I couldn't manage to open another terminal with <code>Mod1+Enter</code>. I'm not even sure that I was in <code>i3</code>…</p> -<p>In my very first attempt, I pressed <code>Alt+F8</code> as suggested in the welcome message. This took me an offline copy of the manual, which is really nicely done. Funny enough, though, I couldn't exit <code>w3m</code>. Both <code>Q</code> and <code>B</code> to quit and take me back wouldn't work. Somehow, it kept throwing me back into <code>w3m</code>, so I had to forcibly shutdown.</p> -<p>In my second attempt, I also forgot to configure network, so I had no way to download <code>wpa_supplicant</code> without having <code>wpa_supplicant</code> itself to connect my laptop to the network! So, it was important to do that through the USB before installing it (which comes with the program preinstalled), just by making sure to add it in the configuration file.</p> -<p>Some other notes, if you can't reach the internet, don't add any DNS in <code>/etc/resolv.conf</code>. This should be done declaratively in <code>configuration.nix</code>.</p> -<p>In the end, I spent the entire afternoon playing around with it, taking breaks and what-not. I still haven't figured out why <code>nvim</code> was printing the literal escape character when going from normal to insert mode in the <code>xfce4-terminal</code> (and other actions also made it print this "garbage" to the console), why sometimes the network can reach the internet (and only some sites!) and sometimes not, and how to setup dualboot.</p> -<p>But despite all of this, I think it was a worth installing it again. One sure sees things from a different perspective, and gets the chance to write another blog post!</p> -<p>If there's something I overlooked or that could be done better, or maybe you can explain it differently, please be sure to <a href="https://lonami.dev/contact">contact me</a> to let me know!</p> -<h2 id="update"><a class="anchor" href="#update">¶</a>Update</h2> -<p>Well, that was surprisingly fast feedback. Thank you very much <a href="https://bb010g.keybase.pub/">@bb010g</a> for it! As they rightfully pointed out, one can avoid adding <code>/home</code> manually to <code>hardware-configuration.nix</code> if you mount it before generating the configuration files. However, the installation process doesn't need <code>/home</code> mounted, so I didn't do it.</p> -<p>The second weird issue with <code>w3m</code> is actually a funny one. <code>Alt+F8</code> <em>switches to another TTY</em>! That's why quitting the program wouldn't do anything. You'd still be in a different TTY! Normally, this is <code>Ctrl+Alt+FX</code>, so I hadn't even thought that this is what could be happening. Anyway, the solution is not quitting the program, but rather going back to the main TTY with <code>Alt+F1</code>. You can switch back and forth all you need to consult the manual.</p> -<p>More suggestions are having <a href="https://github.com/rycee/home-manager"><code>home-manager</code></a> manage the graphical sessions, since it should be easier to deal with than the alternatives.</p> -<p>Despite having followed the guide and having read it over and over several times, it seems like my thoughts in this blog post may be a bit messy. So I recommend you also reading through the guide to have two versions of all this, just in case.</p> -<p>Regarding network issues, they use <code>connman</code> so that may be worth checking out.</p> -<p>Regarding terminal issues with <code>nvim</code> printing the literal escape character, I was told off for not having checked what my <code>$TERM</code> was. I hadn't really looked into it much myself, just complained about it here, so sorry for being annoying about that. A quick search in the <code>nixpkgs</code> repository lets us find <a href="https://github.com/NixOS/nixpkgs/blob/release-18.09/pkgs/applications/editors/neovim/default.nix">neovim/default.nix</a>, with version 0.3.1. Looking at <a href="https://github.com/neovim/neovim">Neovim's main repository</a> we can see that this is a bit outdated, but that is fine.</p> -<p>If only I had bothered to look at <a href="https://github.com/neovim/neovim/wiki/FAQ#nvim-shows-weird-symbols-2-q-when-changing-modes">Neovim's wiki</a>, (which they found through <a href="https://github.com/neovim/neovim/issues/7749">Neovim's GitHub issues</a>) I would've seen that some terminals just don't support the program properly. The solution is, of course, to use a different terminal emulator with better support or to disable the <code>guicursor</code> in Neovim's config.</p> -<p>This is a pretty good life lesson. 30 seconds of searching, maybe two minutes and a half for also checking XFCE issues, are often more than enough to troubleshoot your issues. The internet is a big place and more people have surely came across the problem before, so make sure to look online first. In my defense I'll say that it didn't bother me so much so I didn't bother looking for that soon either.</p> -</main> -</body> -</html> -
@@ -1,893 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="480" - height="230" - viewBox="0 0 480 230" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - sodipodi:docname="bayesian_network.svg"> - <defs - id="defs4"> - <marker - inkscape:isstock="true" - style="overflow:visible" - id="marker5391" - refX="0" - refY="0" - orient="auto" - inkscape:stockid="Arrow1Lend"> - <path - transform="matrix(-0.8,0,0,-0.8,-10,0)" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z" - id="path5393" - inkscape:connector-curvature="0" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0" - refX="0" - id="marker5075" - style="overflow:visible" - inkscape:isstock="true" - inkscape:collect="always"> - <path - id="path5077" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="matrix(-0.8,0,0,-0.8,-10,0)" - inkscape:connector-curvature="0" /> - </marker> - <marker - inkscape:stockid="Arrow1Lend" - orient="auto" - refY="0" - refX="0" - id="Arrow1Lend" - style="overflow:visible" - inkscape:isstock="true" - inkscape:collect="always"> - <path - id="path4680" - d="M 0,0 5,-5 -12.5,0 5,5 0,0 Z" - style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1" - transform="matrix(-0.8,0,0,-0.8,-10,0)" - inkscape:connector-curvature="0" /> - </marker> - </defs> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="0.7" - inkscape:cx="111.75179" - inkscape:cy="243.66335" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - inkscape:window-width="1366" - inkscape:window-height="745" - inkscape:window-x="-8" - inkscape:window-y="-8" - inkscape:window-maximized="1" - units="px" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-822.36216)"> - <g - id="g5777"> - <rect - style="opacity:1;fill:#808080;fill-opacity:1;stroke:#000000;stroke-width:1.38805318;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4331" - width="160.26018" - height="86.903847" - x="319.04575" - y="823.05615" - ry="18.212736" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4470" - d="m 449.26648,872.37344 c -0.81362,1.4053 -2.61563,1.88679 -4.02487,1.07544 -1.40926,-0.81135 -1.89209,-2.6083 -1.07846,-4.0136 0.81362,-1.4053 6.15631,-4.75688 6.15631,-4.75688 0,0 -0.23935,6.28974 -1.05298,7.69504 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 447.79543,882.40525 c -0.55786,0.96354 -1.7934,1.29367 -2.75965,0.73737 -0.96624,-0.5563 -1.2973,-1.78837 -0.73944,-2.75191 0.55786,-0.96354 4.22106,-3.26154 4.22106,-3.26154 0,0 -0.16411,4.31254 -0.72197,5.27608 z" - id="path4472" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4474" - d="m 454.61642,879.47845 c -0.61483,1.06195 -1.97655,1.4258 -3.04149,0.81269 -1.06494,-0.61312 -1.4298,-1.97104 -0.81497,-3.03299 0.61483,-1.06195 4.65218,-3.59466 4.65218,-3.59466 0,0 -0.18086,4.75301 -0.79572,5.81496 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 455.97486,893.5466 c -0.7587,1.31045 -2.43906,1.75944 -3.75318,1.00285 -1.31413,-0.75658 -1.76437,-2.43224 -1.00567,-3.74268 0.7587,-1.31045 5.74076,-4.4358 5.74076,-4.4358 0,0 -0.22318,5.86519 -0.98191,7.17563 z" - id="path4476" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4478" - d="m 473.94035,882.58467 c -0.50293,0.86868 -1.61683,1.16631 -2.48795,0.66478 -0.87112,-0.50154 -1.16958,-1.61232 -0.66665,-2.481 0.50294,-0.86868 3.8055,-2.94045 3.8055,-2.94045 0,0 -0.14794,3.88799 -0.6509,4.75667 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 473.94035,882.58467 c -0.50293,0.86868 -1.61683,1.16631 -2.48795,0.66478 -0.87112,-0.50154 -1.16958,-1.61232 -0.66665,-2.481 0.50294,-0.86868 3.8055,-2.94045 3.8055,-2.94045 0,0 -0.14794,3.88799 -0.6509,4.75667 z" - id="path4480" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4405" - d="m 378.22829,839.53921 c -0.81362,1.40531 -2.61563,1.8868 -4.02487,1.07544 -1.40926,-0.81135 -1.89209,-2.6083 -1.07847,-4.0136 0.81363,-1.4053 6.15632,-4.75688 6.15632,-4.75688 0,0 -0.23935,6.28974 -1.05298,7.69504 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 376.75723,849.57102 c -0.55785,0.96354 -1.79339,1.29367 -2.75964,0.73737 -0.96625,-0.5563 -1.2973,-1.78837 -0.73944,-2.75191 0.55786,-0.96354 4.22105,-3.26154 4.22105,-3.26154 0,0 -0.1641,4.31254 -0.72197,5.27608 z" - id="path4408" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4410" - d="m 383.57823,846.64422 c -0.61483,1.06195 -1.97656,1.4258 -3.04149,0.81269 -1.06494,-0.61312 -1.42981,-1.97104 -0.81497,-3.03299 0.61483,-1.06195 4.65218,-3.59466 4.65218,-3.59466 0,0 -0.18087,4.75301 -0.79572,5.81496 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 384.93667,860.71237 c -0.7587,1.31045 -2.43907,1.75944 -3.75319,1.00285 -1.31413,-0.75658 -1.76437,-2.43224 -1.00567,-3.74268 0.7587,-1.31045 5.74076,-4.43579 5.74076,-4.43579 0,0 -0.22317,5.86518 -0.9819,7.17562 z" - id="path4412" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4414" - d="m 402.90216,849.75044 c -0.50294,0.86868 -1.61684,1.16631 -2.48796,0.66478 -0.87111,-0.50154 -1.16957,-1.61231 -0.66664,-2.481 0.50294,-0.86868 3.80549,-2.94044 3.80549,-2.94044 0,0 -0.14793,3.88798 -0.65089,4.75666 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 402.90216,849.75044 c -0.50294,0.86868 -1.61684,1.16631 -2.48796,0.66478 -0.87111,-0.50154 -1.16957,-1.61231 -0.66664,-2.481 0.50294,-0.86868 3.80549,-2.94044 3.80549,-2.94044 0,0 -0.14793,3.88798 -0.65089,4.75666 z" - id="path4416" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - id="path4391" - d="m 383.19525,823.05708 a 27.030959,26.955273 0 0 0 -1.16873,7.76705 27.030959,26.955273 0 0 0 27.03007,26.95438 27.030959,26.955273 0 0 0 4.45589,-0.37525 27.030959,26.955273 0 0 0 25.92306,19.37197 27.030959,26.955273 0 0 0 20.04557,-8.91663 27.030959,26.955273 0 0 0 19.08392,7.89016 27.030959,26.955273 0 0 0 0.74065,-0.0357 l 0,-34.44348 c 0,-10.08985 -8.14542,-18.21247 -18.26361,-18.21247 l -77.84682,0 z" - style="opacity:1;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - inkscape:connector-curvature="0" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 392.60914,864.40831 c -0.81363,1.4053 -2.61563,1.88679 -4.02487,1.07544 -1.40926,-0.81135 -1.89209,-2.6083 -1.07847,-4.0136 0.81363,-1.40531 6.15632,-4.75688 6.15632,-4.75688 0,0 -0.23936,6.28974 -1.05298,7.69504 z" - id="path4428" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4430" - d="m 391.13808,874.44012 c -0.55786,0.96354 -1.79339,1.29367 -2.75964,0.73737 -0.96625,-0.5563 -1.2973,-1.78837 -0.73944,-2.75192 0.55785,-0.96354 4.22105,-3.26154 4.22105,-3.26154 0,0 -0.1641,4.31255 -0.72197,5.27609 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 397.95908,871.51332 c -0.61483,1.06195 -1.97656,1.4258 -3.0415,0.81268 -1.06494,-0.61311 -1.4298,-1.97103 -0.81497,-3.03298 0.61483,-1.06196 4.65218,-3.59466 4.65218,-3.59466 0,0 -0.18086,4.75301 -0.79571,5.81496 z" - id="path4432" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4434" - d="m 399.31751,885.58147 c -0.7587,1.31044 -2.43906,1.75943 -3.75318,1.00285 -1.31413,-0.75659 -1.76437,-2.43224 -1.00567,-3.74269 0.7587,-1.31044 5.74076,-4.43579 5.74076,-4.43579 0,0 -0.22318,5.86519 -0.98191,7.17563 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 417.283,874.61953 c -0.50293,0.86869 -1.61683,1.16632 -2.48795,0.66478 -0.87112,-0.50153 -1.16958,-1.61231 -0.66665,-2.48099 0.50295,-0.86868 3.8055,-2.94045 3.8055,-2.94045 0,0 -0.14794,3.88798 -0.6509,4.75666 z" - id="path4436" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4438" - d="m 417.283,874.61953 c -0.50293,0.86869 -1.61683,1.16632 -2.48795,0.66478 -0.87112,-0.50153 -1.16958,-1.61231 -0.66665,-2.48099 0.50295,-0.86868 3.8055,-2.94045 3.8055,-2.94045 0,0 -0.14794,3.88798 -0.6509,4.75666 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4442" - d="m 410.37705,882.71132 c -0.81363,1.4053 -2.61563,1.88679 -4.02487,1.07544 -1.40926,-0.81135 -1.89209,-2.60831 -1.07847,-4.01361 0.81363,-1.4053 6.15632,-4.75688 6.15632,-4.75688 0,0 -0.23936,6.28974 -1.05298,7.69505 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 408.90599,892.74312 c -0.55786,0.96354 -1.79339,1.29368 -2.75964,0.73738 -0.96625,-0.5563 -1.2973,-1.78838 -0.73944,-2.75192 0.55785,-0.96354 4.22105,-3.26154 4.22105,-3.26154 0,0 -0.1641,4.31254 -0.72197,5.27608 z" - id="path4444" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4446" - d="m 415.72699,889.81632 c -0.61483,1.06196 -1.97656,1.42581 -3.0415,0.81269 -1.06494,-0.61312 -1.4298,-1.97103 -0.81497,-3.03299 0.61483,-1.06195 4.65218,-3.59466 4.65218,-3.59466 0,0 -0.18086,4.75301 -0.79571,5.81496 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 417.08542,903.88448 c -0.7587,1.31044 -2.43906,1.75943 -3.75318,1.00285 -1.31413,-0.75659 -1.76437,-2.43225 -1.00567,-3.74269 0.7587,-1.31045 5.74076,-4.43579 5.74076,-4.43579 0,0 -0.22318,5.86518 -0.98191,7.17563 z" - id="path4448" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4450" - d="m 435.05091,892.92254 c -0.50293,0.86868 -1.61683,1.16631 -2.48795,0.66478 -0.87112,-0.50153 -1.16958,-1.61231 -0.66665,-2.48099 0.50295,-0.86869 3.8055,-2.94045 3.8055,-2.94045 0,0 -0.14794,3.88798 -0.6509,4.75666 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 435.05091,892.92254 c -0.50293,0.86868 -1.61683,1.16631 -2.48795,0.66478 -0.87112,-0.50153 -1.16958,-1.61231 -0.66665,-2.48099 0.50295,-0.86869 3.8055,-2.94045 3.8055,-2.94045 0,0 -0.14794,3.88798 -0.6509,4.75666 z" - id="path4452" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 423.92847,879.86919 c -0.81363,1.4053 -2.61563,1.88679 -4.02487,1.07544 -1.40926,-0.81135 -1.89209,-2.60831 -1.07847,-4.01361 0.81363,-1.4053 6.15632,-4.75688 6.15632,-4.75688 0,0 -0.23936,6.28974 -1.05298,7.69505 z" - id="path4456" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4458" - d="m 422.45741,889.90099 c -0.55786,0.96354 -1.79339,1.29368 -2.75964,0.73738 -0.96625,-0.5563 -1.2973,-1.78838 -0.73944,-2.75192 0.55785,-0.96354 4.22105,-3.26154 4.22105,-3.26154 0,0 -0.1641,4.31254 -0.72197,5.27608 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 429.27841,886.97419 c -0.61483,1.06196 -1.97656,1.42581 -3.0415,0.81269 -1.06493,-0.61312 -1.4298,-1.97103 -0.81497,-3.03299 0.61483,-1.06195 4.65218,-3.59466 4.65218,-3.59466 0,0 -0.18086,4.75301 -0.79571,5.81496 z" - id="path4460" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4462" - d="m 430.63684,901.04235 c -0.7587,1.31044 -2.43906,1.75943 -3.75318,1.00285 -1.31413,-0.75659 -1.76437,-2.43225 -1.00567,-3.74269 0.7587,-1.31044 5.74076,-4.43579 5.74076,-4.43579 0,0 -0.22318,5.86518 -0.98191,7.17563 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 448.60233,890.08041 c -0.50293,0.86868 -1.61683,1.16632 -2.48795,0.66478 -0.87112,-0.50153 -1.16958,-1.61231 -0.66664,-2.48099 0.50294,-0.86869 3.80549,-2.94045 3.80549,-2.94045 0,0 -0.14793,3.88798 -0.6509,4.75666 z" - id="path4464" - inkscape:connector-curvature="0" - sodipodi:nodetypes="ssscs" /> - <path - sodipodi:nodetypes="ssscs" - inkscape:connector-curvature="0" - id="path4466" - d="m 448.60233,890.08041 c -0.50293,0.86868 -1.61683,1.16632 -2.48795,0.66478 -0.87112,-0.50153 -1.16958,-1.61231 -0.66664,-2.48099 0.50294,-0.86869 3.80549,-2.94045 3.80549,-2.94045 0,0 -0.14793,3.88798 -0.6509,4.75666 z" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#00ccff;fill-opacity:1;stroke:#000000;stroke-width:1.9121151;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4333" - width="305.96002" - height="86.380524" - x="113.66848" - y="965.02557" - ry="18.10306" /> - <path - inkscape:connector-curvature="0" - id="path4370" - d="m 118.77951,1001.0521 c 0,0 -3.178,5.2584 -5.11094,10.0106 l 0,22.2409 c 0,10.0291 8.09684,18.1033 18.1541,18.1033 l 269.65155,0 c 10.05726,0 18.15411,-8.0742 18.15411,-18.1033 l 0,-3.1668 c -0.43795,-1.6775 -0.89918,-3.7771 -0.9756,-5.589 0.0131,-0.2181 0.0183,-0.453 0.0418,-0.6472 0.12229,-1.0125 0.52123,-2.3698 0.93379,-3.6036 l 0,-2.8888 c -1.52518,2.1843 -3.04758,4.5989 -3.76502,6.4924 -0.39102,1.0319 -0.71148,2.1643 -0.98555,3.2978 l -0.81632,-4.5824 -1.20655,8.9027 c -0.57242,-3.0292 -1.20135,-7.4171 -0.85415,-10.9557 0.10051,-1.0241 0.36666,-2.2535 0.69088,-3.5301 1.50735,-3.2279 3.42853,-6.2263 3.42853,-6.2263 0,0 -1.20555,1.4921 -2.63212,3.397 1.27942,-4.1111 2.88896,-8.0172 2.88896,-8.0172 0,0 -3.51145,5.8176 -5.39565,10.7472 -1.22277,1.7299 -2.49455,3.8123 -2.84118,5.4262 -0.0633,0.2949 -0.11053,0.6117 -0.14336,0.9431 -1.6219,4.5766 -2.09853,10.7532 -2.09853,10.7532 0,0 -0.30446,-1.1813 -0.65704,-2.9663 -0.0312,-0.9478 -0.0192,-1.8499 0.0677,-2.5691 0.27915,-2.3111 2.05871,-6.6751 2.05871,-6.6751 0,0 -1.96311,2.0987 -2.94869,3.816 -0.21812,-2.0648 -0.32851,-4.2196 -0.14137,-6.127 0.48903,-4.9842 4.37626,-14.3746 4.37626,-14.3746 0,0 -5.48674,9.0358 -6.43497,14.1184 -0.68266,3.6593 -0.77998,8.4116 -0.58536,13.3323 l -0.95966,-5.3746 -1.2862,9.4984 c 0,0 -2.22415,-6.6463 -1.80188,-10.0106 0.5151,-4.1039 5.14878,-11.2952 5.14878,-11.2952 0,0 -6.2743,7.5585 -7.982,12.0655 -0.4087,1.0786 -0.744,2.2659 -1.02536,3.4507 -0.81419,-3.2131 -1.81375,-7.8563 -1.86759,-11.3984 1.30668,-4.6754 3.40863,-9.7664 3.40863,-9.7664 0,0 -0.48524,0.8099 -1.16275,2.0112 0.49058,-0.9801 0.90591,-1.7551 0.90591,-1.7551 0,0 -4.68942,5.3862 -5.40761,8.73 -0.18297,0.8519 -0.22749,1.8736 -0.18516,2.9682 -0.25591,0.7688 -0.46367,1.5032 -0.58735,2.1662 -0.50191,2.6902 -0.68006,5.9798 -0.66898,9.4824 l -0.87406,0.272 c 0,0 -0.86519,-5.8344 -0.51567,-8.728 0.27915,-2.3111 2.05871,-6.675 2.05871,-6.675 0,0 -2.66743,2.845 -3.3469,4.6201 -0.31086,0.8121 -0.53229,1.85 -0.71279,2.9484 -0.74346,-3.4279 -1.38439,-7.4115 -1.08908,-10.1357 0.29798,-2.7489 3.09006,-7.7015 3.09006,-7.7015 0,0 -2.70166,3.1101 -4.31654,6.0714 -0.65726,0.8509 -1.35545,1.7709 -2.16224,2.9087 0.17926,-0.4669 0.30064,-0.7644 0.30064,-0.7644 0,0 -2.66742,2.8451 -3.3469,4.6202 -0.21525,0.5623 -0.38738,1.238 -0.53757,1.9556 -0.18649,0.3888 -0.35691,0.7698 -0.49179,1.1258 -0.48483,1.2795 -0.86653,2.7056 -1.17469,4.1059 l -1.14284,-6.417 -0.97561,7.2111 c -0.13564,-1.4199 -0.17501,-2.7552 -0.0537,-3.8736 0.29798,-2.7489 3.08807,-7.7015 3.08807,-7.7015 0,0 -2.08686,2.4164 -3.69136,5.0152 0.0112,-0.5733 0.0347,-1.1375 0.0876,-1.6777 0.22492,-2.2924 1.17056,-5.5004 2.12442,-8.315 0.83423,-1.4659 1.47933,-2.4679 1.47933,-2.4679 0,0 -0.44556,0.5453 -1.10701,1.3858 0.97949,-2.7804 1.87952,-4.9795 1.87952,-4.9795 0,0 -2.45762,4.0742 -4.37029,8.2893 -1.7159,2.3871 -3.56755,5.2198 -4.38223,7.3699 -1.6434,4.3373 -2.16081,10.2275 -2.21799,10.9259 -0.0119,0.069 -0.0244,0.1351 -0.0359,0.2045 -0.0354,-0.1373 -1.66945,-6.5112 -1.70431,-12.0894 0.64553,-1.105 1.12692,-1.8643 1.12692,-1.8643 0,0 -0.45394,0.5539 -1.12095,1.4017 0.007,-0.6557 0.0313,-1.3016 0.0915,-1.9159 0.48902,-4.9842 4.37625,-14.3766 4.37625,-14.3766 0,0 -5.48873,9.0378 -6.43695,14.1205 -0.31067,1.6652 -0.4989,3.5616 -0.59731,5.591 -1.69097,2.3615 -3.49183,5.1314 -4.29264,7.2449 -0.50238,1.3259 -0.89124,2.8084 -1.20456,4.2568 -0.92135,-3.7544 -1.97676,-9.0115 -1.63264,-12.3972 0.40415,-1.4258 0.86886,-2.8813 1.33199,-4.2151 0.84093,-1.9138 1.76206,-3.5618 1.76206,-3.5618 0,0 -0.33054,0.3851 -0.81234,0.9828 0.58954,-1.5632 1.06918,-2.7797 1.06918,-2.7797 0,0 -1.37726,2.2695 -2.87106,5.1721 -1.20757,1.7161 -2.44938,3.7623 -2.7914,5.3548 -0.09,0.419 -0.13926,0.8883 -0.16923,1.3778 -0.26355,0.7863 -0.47703,1.5391 -0.60328,2.2158 -0.57487,3.0814 -0.73461,6.9412 -0.65704,11.0192 l -0.88799,0.276 c 0,0 -0.8652,-5.8344 -0.51567,-8.728 0.27914,-2.3111 2.0607,-6.6751 2.0607,-6.6751 0,0 -2.66743,2.8451 -3.3469,4.6202 -0.23377,0.6107 -0.41381,1.3585 -0.57143,2.1482 -0.56271,-2.9494 -0.96073,-6.0585 -0.71677,-8.3091 0.29798,-2.7489 3.09007,-7.7015 3.09007,-7.7015 0,0 -4.68743,5.3841 -5.40562,8.728 -0.37064,1.7257 -0.1841,4.1419 0.18119,6.4626 l -1.08311,7.9875 -0.39025,0.1211 c -0.45834,-1.4848 -1.46667,-5.0062 -1.58286,-7.7611 0.0131,-0.2182 0.0183,-0.453 0.0418,-0.6473 0.22309,-1.847 1.36805,-4.9055 1.83373,-6.0993 1.48757,-3.1283 3.31504,-5.9682 3.31504,-5.9682 0,0 -6.27229,7.5605 -7.98,12.0675 -0.39102,1.032 -0.71148,2.1643 -0.98555,3.2978 l -0.81632,-4.5824 -1.20655,8.9008 c -0.57231,-3.0292 -1.20127,-7.4159 -0.85415,-10.9537 0.10072,-1.0262 0.36768,-2.2587 0.69287,-3.5381 1.50686,-3.2251 3.42654,-6.2184 3.42654,-6.2184 0,0 -1.20495,1.4933 -2.63212,3.3991 1.27951,-4.1119 2.89096,-8.0192 2.89096,-8.0192 0,0 -4.46061,7.3545 -6.0288,12.5261 -0.15867,0.2517 -0.3074,0.4947 -0.45794,0.7446 -0.41228,-2.4864 -0.66964,-4.9742 -0.46589,-6.8538 0.29798,-2.7489 3.09006,-7.7015 3.09006,-7.7015 0,0 -4.68743,5.3861 -5.40562,8.73 -0.56135,2.6136 0.14706,6.784 0.83423,9.8279 -0.49151,1.4202 -0.87674,2.9618 -1.17072,4.4435 l -1.98106,0.6174 c 0,0 -0.86518,-5.8344 -0.51567,-8.728 0.27916,-2.3111 2.0607,-6.675 2.0607,-6.675 0,0 -0.37851,0.4198 -0.84021,0.9589 1.30876,-4.4219 3.15776,-8.9166 3.15776,-8.9166 0,0 -5.48874,9.0358 -6.43697,14.1185 -0.52346,2.8059 -0.69649,6.2645 -0.66698,9.9371 l -1.9074,-10.7075 -1.2862,9.4984 c 0,0 -2.22414,-6.6462 -1.80187,-10.0106 0.5151,-4.1039 5.14679,-11.2972 5.14679,-11.2972 0,0 -6.27231,7.5606 -7.98001,12.0676 -0.40912,1.0797 -0.74384,2.2686 -1.02537,3.4546 -0.81433,-3.213 -1.81357,-7.8586 -1.86758,-11.4024 1.30667,-4.6754 3.40863,-9.7664 3.40863,-9.7664 0,0 -0.48695,0.8136 -1.16674,2.0192 0.49272,-0.9849 0.9099,-1.763 0.9099,-1.763 0,0 -4.68942,5.3841 -5.40761,8.728 -0.18307,0.8524 -0.22762,1.8748 -0.18516,2.9702 -0.25591,0.7687 -0.46367,1.5011 -0.58735,2.1641 -0.5019,2.6903 -0.68205,5.9819 -0.67098,9.4845 l -0.87207,0.272 c 0,0 -0.86518,-5.8344 -0.51567,-8.728 0.27916,-2.3111 2.05872,-6.6751 2.05872,-6.6751 0,0 -2.66744,2.845 -3.34691,4.6201 -0.23375,0.6107 -0.41182,1.3586 -0.56943,2.1483 -0.56272,-2.9494 -0.96073,-6.0585 -0.71677,-8.3091 0.29798,-2.7489 3.09006,-7.7015 3.09006,-7.7015 0,0 -4.68941,5.3841 -5.4076,8.728 -0.37065,1.7257 -0.18213,4.1418 0.18317,6.4626 l -1.08311,7.9874 -0.38825,0.1212 c -0.45785,-1.4829 -1.46858,-5.0044 -1.58485,-7.7611 0.0131,-0.2185 0.0183,-0.4548 0.0418,-0.6493 0.21906,-1.8135 1.33361,-4.8146 1.81581,-6.0556 1.49105,-3.1446 3.33296,-6.0099 3.33296,-6.0099 0,0 -6.27229,7.5585 -7.97999,12.0655 -0.3912,1.0325 -0.71141,2.1658 -0.98556,3.2998 l -0.81632,-4.5824 -1.20655,8.9027 c -0.55706,-2.9479 -1.16175,-7.1774 -0.87406,-10.6658 0.78125,-1.7165 1.56494,-3.1151 1.56494,-3.1151 0,0 -0.63266,0.767 -1.39969,1.7531 0.12618,-0.7605 0.32803,-1.6015 0.54554,-2.4579 1.50735,-3.228 3.42853,-6.2264 3.42853,-6.2264 0,0 -1.20516,1.4886 -2.63013,3.3911 1.27912,-4.1089 2.88698,-8.0112 2.88698,-8.0112 0,0 -4.4619,7.3583 -6.02881,12.5301 -0.92604,1.4693 -1.74188,2.9253 -2.20803,4.1555 -0.39399,1.0399 -0.7162,2.1815 -0.99153,3.3237 -0.37208,0.4075 -1.42336,1.5874 -2.27972,2.855 -0.47912,-2.8827 -0.88555,-6.5175 -0.59132,-9.5162 0.48902,-4.9842 4.37624,-14.3766 4.37624,-14.3766 0,0 -5.48674,9.0378 -6.43497,14.1205 -0.064,0.343 -0.10315,0.7306 -0.15728,1.092 -1.4924,1.8551 -5.8862,7.4745 -7.30904,11.2297 -0.83983,2.2165 -1.38495,4.8778 -1.73019,7.0542 -0.31999,-1.0785 -1.46708,-5.1044 -2.19211,-9.5122 0.0159,-0.2964 0.0337,-0.5935 0.0617,-0.8796 0.48902,-4.9842 4.37625,-14.3746 4.37625,-14.3746 0,0 -3.01515,4.9697 -4.96161,9.6115 0.008,-0.3992 0.0308,-0.7804 0.0697,-1.1396 0.29799,-2.7489 3.09006,-7.7015 3.09006,-7.7015 0,0 -4.68941,5.3841 -5.40761,8.728 -0.42923,1.9985 -0.10448,4.9101 0.37431,7.5387 -0.20327,2.0287 -0.279,4.2629 -0.27077,6.5976 l -2.41909,0.7525 c 0,0 -0.86518,-5.8344 -0.51568,-8.728 0.27916,-2.3111 2.05871,-6.6751 2.05871,-6.6751 0,0 -2.15663,2.3115 -3.0801,4.0682 0.31859,-2.756 3.0801,-7.6618 3.0801,-7.6618 0,0 -4.68742,5.3841 -5.40561,8.728 -0.54841,2.5534 0.11873,6.5889 0.79044,9.6135 -0.0192,1.2438 -0.0179,2.1959 -0.0179,2.1959 l -1.98903,-11.1641 c 0.24803,-0.6578 0.44399,-1.1575 0.44399,-1.1575 0,0 -2.54004,2.7168 -3.28716,4.497 -0.28365,-1.5325 -0.46207,-3.0817 -0.31658,-4.2409 0.5151,-4.1039 5.14878,-11.2952 5.14878,-11.2952 0,0 -6.27231,7.5586 -7.98001,12.0655 -1.74579,4.6075 -2.24188,11.184 -2.24188,11.184 0,0 -0.62044,-2.4402 -1.11697,-5.6049 -0.0404,-0.6247 -0.0519,-1.2204 0.0119,-1.7293 0.5151,-4.1039 5.14877,-11.2952 5.14877,-11.2952 0,0 -3.24703,3.9268 -5.70625,7.8068 -0.0599,-1.2731 -0.0723,-2.5362 0.0418,-3.6989 0.48902,-4.9842 4.37626,-14.3766 4.37626,-14.3766 0,0 -5.48675,9.0378 -6.43497,14.1205 -0.50077,2.6842 -0.68111,5.9649 -0.67097,9.4586 -0.17465,0.5554 -0.33276,1.1169 -0.47785,1.6916 -0.76639,-2.9529 -1.7699,-7.3677 -1.9731,-10.9874 1.30864,-4.6465 3.37875,-9.6632 3.37875,-9.6632 0,0 -1.47315,2.4361 -3.02435,5.4799 0.80382,-2.7501 2.76752,-6.2482 2.76752,-6.2482 0,0 -4.68744,5.3841 -5.40562,8.728 -0.23148,1.0778 -0.2455,2.4279 -0.13539,3.8537 -0.2778,0.8188 -0.50613,1.605 -0.63712,2.3071 -0.4532,2.4292 -0.6545,5.3378 -0.68093,8.458 l -0.8641,0.27 c 0,0 -0.86518,-5.8344 -0.51568,-8.728 0.27916,-2.3111 2.06071,-6.6751 2.06071,-6.6751 0,0 -2.66743,2.8471 -3.3469,4.6222 -1.47683,3.8581 -1.28819,12.3216 -1.28819,12.3216 l -2.05871,-11.5533 -1.28819,9.4984 c 0,0 -2.22415,-6.6462 -1.80187,-10.0106 0.5151,-4.1039 5.14877,-11.2952 5.14877,-11.2952 0,0 -6.2723,7.5586 -7.98,12.0655 -0.40913,1.0798 -0.74384,2.2686 -1.02537,3.4547 -0.8144,-3.2133 -1.81372,-7.8585 -1.86758,-11.4024 1.30668,-4.6754 3.40863,-9.7664 3.40863,-9.7664 0,0 -0.47863,0.7956 -1.14683,1.9795 0.48279,-0.9628 0.88799,-1.7234 0.88799,-1.7234 0,0 -4.68743,5.3862 -5.40561,8.73 -0.18319,0.8529 -0.22975,1.8761 -0.18716,2.9722 -0.25527,0.7673 -0.46188,1.5003 -0.58536,2.1622 -0.5019,2.6903 -0.68204,5.9798 -0.67097,9.4825 l -0.87406,0.272 c 0,0 -0.86319,-5.8345 -0.51368,-8.7281 0.27915,-2.3111 2.05871,-6.675 2.05871,-6.675 0,0 -2.66743,2.845 -3.3469,4.6201 -0.23339,0.6098 -0.41394,1.3561 -0.57142,2.1443 -0.56228,-2.9481 -0.95862,-6.0556 -0.71478,-8.3051 0.29799,-2.7489 3.08807,-7.7015 3.08807,-7.7015 0,0 -4.68742,5.3841 -5.40561,8.728 -0.37064,1.7257 -0.1841,4.1419 0.18118,6.4626 l -1.08112,7.9854 -0.39024,0.1231 c -0.45866,-1.4858 -1.46788,-5.0115 -1.58286,-7.767 0.0131,-0.2159 0.0186,-0.4489 0.0418,-0.6413 0.21905,-1.8136 1.33361,-4.8166 1.81581,-6.0576 1.49104,-3.1446 3.33296,-6.0099 3.33296,-6.0099 0,0 -6.27429,7.5605 -7.98199,12.0675 -0.39123,1.0325 -0.7094,2.1657 -0.98356,3.2998 l -0.81831,-4.5844 -1.20656,8.9067 c -0.57259,-3.0293 -1.19949,-7.4196 -0.85215,-10.9597 0.10048,-1.024 0.36666,-2.2535 0.69088,-3.5301 1.50734,-3.2279 3.42853,-6.2263 3.42853,-6.2263 0,0 -1.20694,1.4932 -2.63411,3.3991 1.27951,-4.1119 2.89095,-8.0193 2.89095,-8.0193 0,0 -4.46424,7.3603 -6.03079,12.5322 -0.92543,1.4684 -1.74213,2.9239 -2.20804,4.1535 -1.74579,4.6075 -2.23989,11.184 -2.23989,11.184 0,0 -2.20854,-8.5302 -1.62069,-14.5215 0.48903,-4.9842 4.37625,-14.3746 4.37625,-14.3746 0,0 -5.48674,9.0358 -6.43497,14.1185 -0.61057,3.2727 -0.75918,7.4167 -0.64509,11.7756 -0.65467,-3.2038 -1.16918,-6.7247 -0.89994,-9.2085 0.29799,-2.7489 3.08807,-7.7015 3.08807,-7.7015 0,0 -4.68742,5.3842 -5.40561,8.728 -0.96076,4.4733 1.80187,13.6063 1.80187,13.6063 l -4.11942,1.2845 c 0,0 -0.86319,-5.8344 -0.51368,-8.728 0.27915,-2.3111 2.05871,-6.675 2.05871,-6.675 0,0 -2.66743,2.845 -3.3469,4.6201 -1.47683,3.8582 -1.2862,12.3217 -1.2862,12.3217 l -2.0607,-11.5513 -1.2862,9.4983 c 0,0 -2.22415,-6.6482 -1.80187,-10.0126 0.5151,-4.1038 5.14877,-11.2952 5.14877,-11.2952 0,0 -6.27429,7.5586 -7.98199,12.0656 -0.52252,1.379 -0.91963,2.9268 -1.23841,4.4295 -0.738,-3.4148 -1.37078,-7.3673 -1.07714,-10.0761 0.29798,-2.7489 3.08807,-7.7016 3.08807,-7.7016 0,0 -1.85965,2.1396 -3.41659,4.5586 1.30885,-4.4238 3.15975,-8.9226 3.15975,-8.9226 0,0 -4.61258,7.6014 -6.10646,12.7823 -0.46678,0.5091 -2.55592,2.8349 -3.16173,4.4176 -1.10212,2.8793 -1.27482,8.3127 -1.29217,10.8902 -0.17383,-0.595 -0.37492,-1.2953 -0.72872,-2.6823 l -1.32601,-7.4375 -0.0916,0.673 c -0.38427,-2.3932 -0.61828,-4.7679 -0.4221,-6.5777 0.0932,-0.8601 0.43862,-1.9357 0.85813,-3.008 0.94295,-1.6852 1.71626,-2.8967 1.71626,-2.8967 0,0 -0.40771,0.4926 -1.03533,1.2885 0.77676,-1.7029 1.54901,-3.0854 1.54901,-3.0854 0,0 -4.11962,4.732 -5.22642,8.0788 -0.78676,1.1573 -1.52857,2.3459 -2.15429,3.4805 0.573,-1.7557 1.20258,-3.3455 1.20258,-3.3455 0,0 -2.66743,2.847 -3.3469,4.6221 -1.35907,3.5506 -1.30516,10.7151 -1.28819,11.8809 -0.0541,-0.2152 -0.15697,-0.6411 -0.35042,-1.5407 l -0.79424,-4.4494 c -0.38098,-2.6283 -0.65005,-5.635 -0.3982,-8.2018 0.48902,-4.9842 4.37625,-14.3766 4.37625,-14.3766 0,0 -1.81852,3.0193 -3.54401,6.5341 -1.5478,1.9282 -5.86168,7.4705 -7.26722,11.18 -0.1745,0.4606 -0.32955,0.9501 -0.47983,1.4414 -0.83802,-3.6364 -1.65093,-8.1802 -1.32403,-11.1959 0.29798,-2.7489 3.09006,-7.7015 3.09006,-7.7015 0,0 -0.78672,0.9471 -1.70829,2.1582 0.52368,-1.376 0.93578,-2.4163 0.93578,-2.4163 0,0 -1.41195,2.3295 -2.9268,5.2832 -0.72578,1.1767 -1.35092,2.3822 -1.63064,3.4269 -0.85433,1.9259 -1.58703,3.8532 -1.87753,5.4103 -0.45434,2.4354 -0.6553,5.3528 -0.68093,8.4819 -0.23152,-1.8662 -0.60066,-5.3836 -0.35042,-7.4554 0.27915,-2.3111 2.0607,-6.675 2.0607,-6.675 0,0 -2.66743,2.847 -3.3469,4.6221 -1.47683,3.8582 -1.28819,12.3216 -1.28819,12.3216 l -2.05871,-11.5533 -1.2862,9.5004 c 0,0 -2.22614,-6.6482 -1.80386,-10.0126 0.5151,-4.1039 5.14877,-11.2952 5.14877,-11.2952 0,0 -6.2723,7.5586 -7.98,12.0655 -0.40913,1.0798 -0.74384,2.2687 -1.02537,3.4547 -0.8144,-3.2132 -1.81372,-7.8585 -1.86758,-11.4024 1.30668,-4.6754 3.40863,-9.7664 3.40863,-9.7664 0,0 -0.48524,0.8099 -1.16276,2.0113 0.49059,-0.9802 0.90392,-1.7552 0.90392,-1.7552 0,0 -4.68742,5.3862 -5.40561,8.73 -0.18319,0.853 -0.22975,1.8761 -0.18716,2.9722 -0.25527,0.7673 -0.46188,1.5004 -0.58536,2.1622 -0.5019,2.6903 -0.68204,5.9799 -0.67097,9.4825 l -0.87406,0.272 c 0,0 -0.86319,-5.8345 -0.51368,-8.728 0.27915,-2.3111 2.05871,-6.6751 2.05871,-6.6751 0,0 -2.66743,2.845 -3.3469,4.6201 -0.23375,0.6107 -0.41181,1.3586 -0.56943,2.1483 -0.56271,-2.9494 -0.96073,-6.0585 -0.71677,-8.3091 0.29799,-2.7489 3.08807,-7.7015 3.08807,-7.7015 0,0 -4.68742,5.3841 -5.40561,8.728 -0.37064,1.7257 -0.1841,4.1419 0.18118,6.4626 l -1.08112,7.9855 -0.39024,0.1231 c -0.45834,-1.4848 -1.46667,-5.0062 -1.58286,-7.7612 0.0131,-0.2181 0.0183,-0.4529 0.0418,-0.6472 0.21905,-1.8135 1.33361,-4.8166 1.81581,-6.0576 1.49104,-3.1446 3.33296,-6.0099 3.33296,-6.0099 0,0 -6.2723,7.5605 -7.98,12.0675 -0.39123,1.0325 -0.71139,2.1657 -0.98555,3.2998 l -0.81831,-4.5844 -1.20656,8.9067 c -0.57258,-3.0293 -1.19949,-7.4196 -0.85215,-10.9596 0.10048,-1.0241 0.36666,-2.2536 0.69088,-3.5301 1.50734,-3.228 3.42853,-6.2264 3.42853,-6.2264 0,0 -1.2063,1.4913 -2.63212,3.3951 1.27933,-4.1105 2.88896,-8.0152 2.88896,-8.0152 z m 42.10605,15.1727 c -0.99577,2.161 -1.87499,4.3819 -2.20206,6.135 -0.5064,2.7144 -0.6858,6.0398 -0.67098,9.5778 -0.55442,-2.1777 -1.10455,-4.9181 -0.87405,-6.7544 0.3296,-2.6261 2.33788,-6.497 3.74709,-8.9584 z m 220.4535,0.6671 c -0.42619,2.2552 0.0186,5.5804 0.58137,8.3647 l -0.77251,5.6903 -0.86211,0.27 c -0.62836,-2.2131 -1.51998,-5.8276 -1.23642,-8.0867 0.22377,-1.7828 1.2289,-4.1327 2.28967,-6.2383 z m -97.23138,0.2184 c -0.71166,5.0963 -0.51995,11.8041 0.006,18.1946 l -1.34593,-7.5546 -1.28818,9.4984 c 0,0 -2.22415,-6.6482 -1.80188,-10.0126 0.3883,-3.0937 3.11014,-7.9263 4.43002,-10.1258 z m -107.288,4.231 c -0.0388,0.1683 -0.0855,0.3435 -0.11548,0.5043 -0.70059,3.7553 -0.78731,8.6607 -0.57142,13.7194 l -0.45993,0.143 c 0,0 -0.86319,-5.8345 -0.51368,-8.728 0.19673,-1.6287 1.1212,-4.2169 1.66051,-5.6387 z m 112.23369,2.0768 c -0.79563,3.6291 -1.06121,7.0443 -1.06121,7.0443 0,0 -0.2089,-0.8354 -0.47386,-2.0867 0.31634,-1.6095 1.0613,-3.7072 1.53507,-4.9576 z m -138.68238,0.274 c 0.58178,3.6926 1.6187,7.1396 1.6187,7.1396 l -1.09506,0.3415 c -0.35541,-2.3538 -0.63183,-5.0473 -0.52364,-7.4811 z m -25.13461,0.7068 c 0.28153,1.0881 0.49377,1.8107 0.49377,1.8107 l -0.16326,0.05 -0.33051,-1.8603 z m 42.31511,0.131 c 0.29728,4.1591 1.61656,8.7681 1.8397,9.5262 l -0.0557,0.4189 -0.29467,0.091 c -0.46221,-1.4636 -1.96617,-6.5038 -1.60476,-9.3832 0.0262,-0.2084 0.0692,-0.4302 0.11548,-0.6532 z m 95.01138,1.0603 -1.16275,8.5771 c 0,0 -0.13745,-0.4184 -0.32454,-1.0404 -0.0305,-0.9418 -0.0186,-1.8382 0.0677,-2.5533 0.17063,-1.4126 0.87664,-3.5024 1.4196,-4.9834 z m 42.36888,0.3673 c 0.27938,1.0787 0.48979,1.7928 0.48979,1.7928 l -0.16128,0.05 -0.32851,-1.8425 z m 56.46726,0.012 c -0.0749,4.1838 0.17489,8.7786 0.56545,13.1575 l -0.16326,1.2052 c 0,0 -2.22415,-6.6482 -1.80187,-10.0126 0.15799,-1.2589 0.71924,-2.8069 1.39968,-4.3501 z m -228.19059,0.3852 c 0.0994,0.3532 0.24489,0.8835 0.24489,0.8835 l -0.1095,0.034 c -0.0449,-0.3081 -0.0944,-0.5994 -0.13539,-0.9173 z m 87.28026,0.6194 c 0.28085,1.0851 0.49377,1.8048 0.49377,1.8048 l -0.16326,0.05 -0.33051,-1.8544 z m 92.41112,0.9213 c 0.0994,0.3532 0.2449,0.8835 0.2449,0.8835 l -0.10952,0.034 c -0.0448,-0.308 -0.0944,-0.5994 -0.13538,-0.9173 z m -84.43908,1.0265 c 0.0994,0.3532 0.24489,0.8835 0.24489,0.8835 l -0.1095,0.034 c -0.0449,-0.3081 -0.0944,-0.5994 -0.13539,-0.9173 z m 162.70003,2.5671 c 0.0994,0.3532 0.24489,0.8836 0.24489,0.8836 l -0.1095,0.034 c -0.0448,-0.3081 -0.0944,-0.5994 -0.13539,-0.9173 z m -144.33687,0.415 c 0.244,0.9261 0.4181,1.497 0.4181,1.497 l -0.25485,0.079 c -0.0658,-0.5142 -0.11216,-1.0465 -0.16325,-1.5764 z m 98.78238,2.7796 c 0.27983,1.0807 0.49178,1.7968 0.49178,1.7968 l -0.16327,0.052 -0.32851,-1.8484 z" - style="fill:#00aa00;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <text - transform="scale(1.0014029,0.99859906)" - sodipodi:linespacing="125%" - id="text4234" - y="1024.4113" - x="265.60812" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40.71892548px;line-height:125%;font-family:Aileron;-inkscape-font-specification:Aileron;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - y="1024.4113" - x="265.60812" - id="tspan4236" - sodipodi:role="line">Hierba húmeda</tspan></text> - <rect - ry="18.159618" - y="823.18292" - x="0.8209275" - height="86.650398" - width="224.88033" - id="rect4329" - style="opacity:1;fill:#f2f2f2;fill-opacity:1;stroke:#000000;stroke-width:1.641855;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - transform="scale(1.0014029,0.99859906)" - sodipodi:linespacing="125%" - id="text4230" - y="882.40289" - x="397.9498" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40.71892548px;line-height:125%;font-family:Aileron;-inkscape-font-specification:Aileron;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - y="882.40289" - x="397.9498" - id="tspan4232" - sodipodi:role="line">Lluvia</tspan></text> - <path - id="rect4512" - d="m 0.82020767,891.66605 0,0.008 c 0,10.06043 8.12317003,18.15887 18.21185033,18.15887 l 188.457832,0 c 10.08868,0 18.21185,-8.09844 18.21185,-18.15887 l 0,-0.008 -224.88153233,0 z" - style="opacity:1;fill:#808080;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - inkscape:connector-curvature="0" /> - <rect - ry="2.0241551" - y="884.09607" - x="103.97713" - height="9.4393644" - width="18.567665" - id="rect4517" - style="opacity:1;fill:#808000;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="874.37567" - cx="47.838871" - id="path4519" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4521" - cx="177.44792" - cy="883.78241" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="876.44196" - cx="184.28316" - id="circle4523" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4525" - cx="33.469151" - cy="878.19641" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4527" - cx="30.643055" - cy="887.11475" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="874.6228" - cx="74.616142" - id="circle4529" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4531" - cx="19.679264" - cy="891.38293" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="855.85492" - cx="87.801125" - id="circle4533" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="865.89838" - cx="43.000645" - id="circle4535" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4537" - cx="61.099461" - cy="882.01807" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="882.133" - cx="163.95946" - id="circle4539" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4541" - cx="82.706062" - cy="845.0896" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4543" - cx="94.593269" - cy="872.27783" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="873.59332" - cx="49.030384" - id="circle4545" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4547" - cx="178.4698" - cy="875.96783" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="879.55194" - cx="116.26012" - id="circle4549" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="890.22119" - cx="44.396305" - id="circle4551" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4553" - cx="45.705967" - cy="879.98785" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="840.94855" - cx="143.11592" - id="circle4555" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4557" - cx="53.901478" - cy="884.62781" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4559" - cx="209.43462" - cy="871.9281" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="879.08624" - cx="201.1263" - id="circle4561" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4563" - cx="43.964039" - cy="889.69244" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="881.84027" - cx="49.856373" - id="circle4565" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="873.57916" - cx="16.237385" - id="circle4567" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4569" - cx="133.77803" - cy="884.23138" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="878.41895" - cx="176.10667" - id="circle4571" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4573" - cx="174.37386" - cy="883.27612" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4575" - cx="199.62434" - cy="887.39838" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="870.50201" - cx="77.127922" - id="circle4577" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4579" - cx="136.62419" - cy="857.6756" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="859.68036" - cx="102.93819" - id="circle4581" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="862.31866" - cx="123.20824" - id="circle4583" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4585" - cx="149.65666" - cy="870.02258" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="884.09174" - cx="201.19298" - id="circle4587" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4589" - cx="107.67751" - cy="844.36407" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4591" - cx="35.460438" - cy="885.48853" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="862.33563" - cx="47.575352" - id="circle4593" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4595" - cx="159.09386" - cy="888.82471" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="882.99445" - cx="213.20641" - id="circle4597" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="881.94281" - cx="192.40041" - id="circle4599" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4601" - cx="183.87141" - cy="864.2027" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="843.72821" - cx="139.69835" - id="circle4603" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4605" - cx="193.07372" - cy="892.599" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4607" - cx="97.447273" - cy="875.99255" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="874.26556" - cx="190.96544" - id="circle4609" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4611" - cx="15.090428" - cy="890.4538" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="873.85785" - cx="69.627007" - id="circle4613" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="875.13007" - cx="179.52736" - id="circle4615" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4617" - cx="37.392857" - cy="887.22388" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="844.81134" - cx="124.71972" - id="circle4619" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4621" - cx="143.52824" - cy="869.26886" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4623" - cx="121.59261" - cy="868.32147" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="846.16119" - cx="138.12941" - id="circle4625" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4627" - cx="160.31245" - cy="842.13684" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="847.33124" - cx="161.41139" - id="circle4629" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="889.40601" - cx="175.26646" - id="circle4631" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4633" - cx="108.81359" - cy="868.89734" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="888.61377" - cx="50.881107" - id="circle4635" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4637" - cx="155.37907" - cy="863.96887" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4639" - cx="117.3785" - cy="882.84583" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="852.88269" - cx="148.6971" - id="circle4641" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4643" - cx="145.36333" - cy="860.38068" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="844.05261" - cx="109.7109" - id="circle4645" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="864.93878" - cx="204.14308" - id="circle4647" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4649" - cx="166.79225" - cy="888.90369" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="888.47974" - cx="105.70071" - id="circle4651" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4653" - cx="184.02208" - cy="883.57819" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4655" - cx="115.05871" - cy="870.26837" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="873.42896" - cx="23.000599" - id="circle4657" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="circle4659" - cx="149.80882" - cy="873.91669" /> - <ellipse - ry="1.0910468" - rx="1.0941103" - cy="854.1792" - cx="152.18968" - id="circle4661" - style="opacity:1;fill:#00ffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - transform="scale(1.0014029,0.99859906)" - sodipodi:linespacing="125%" - id="text4226" - y="882.40289" - x="111.31236" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40.71892548px;line-height:125%;font-family:Aileron;-inkscape-font-specification:Aileron;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - y="882.40289" - x="111.31237" - id="tspan4228" - sodipodi:role="line">Rociador</tspan></text> - <path - inkscape:connector-curvature="0" - id="path4671" - d="m 299.64598,868.04839 -59.21066,0" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.01797318px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow1Lend)" /> - <path - sodipodi:nodetypes="cc" - inkscape:connector-curvature="0" - id="path5073" - d="M 365.03515,922.47237 345.4699,955.33214" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.01797318px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker5075)" /> - <path - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.01797318px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#marker5391)" - d="m 164.75456,922.47237 19.56524,32.85977" - id="path5389" - inkscape:connector-curvature="0" - sodipodi:nodetypes="cc" /> - </g> - </g> -</svg>
@@ -1,638 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="1400" - height="800" - viewBox="0 0 1400 800.00001" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - sodipodi:docname="decission_tree.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="0.35" - inkscape:cx="666.52844" - inkscape:cy="513.1507" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - inkscape:window-width="1366" - inkscape:window-height="745" - inkscape:window-x="-8" - inkscape:window-y="-8" - inkscape:window-maximized="1" - units="px" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-252.36216)"> - <g - id="g4537"> - <path - inkscape:connector-curvature="0" - id="path4335" - d="m 619.45408,462.04855 -4.84255,150.25129" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4271" - d="m 352.68783,613.19378 35.22036,141.00547" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4249" - d="m 616.84054,301.80669 1.95669,152.75593" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4251" - d="M 597.27367,462.39626 356.6012,587.73445" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4253" - d="M 648.14753,454.56262 871.20983,575.984" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4255" - d="M 916.21362,587.73445 1025.7881,856.03654" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4257" - d="M 904.4735,558.35832 1113.839,679.77969" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4259" - d="m 1166.6695,705.23902 125.228,127.29661" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4261" - d="m 1139.2759,720.90629 58.7006,283.96941" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4263" - d="M 642.27747,652.36196 830.1194,771.82493" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4265" - d="m 605.10042,634.73628 3.91337,186.04889" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4267" - d="M 648.14753,832.53563 789.02898,955.91542" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4269" - d="M 597.27367,832.53563 485.74253,977.45792" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4273" - d="M 319.42411,601.44332 100.27526,762.03289" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4275" - d="M 315.51075,628.86105 188.32614,899.12154" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.96893674px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <ellipse - ry="49.939438" - rx="96.855988" - cy="302.78589" - cx="621.7323" - id="path4155" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - transform="scale(0.99956011,1.0004401)" - sodipodi:linespacing="125%" - id="text4147" - y="317.12897" - x="622.75885" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="317.12897" - x="622.75885" - id="tspan4149" - sodipodi:role="line">Consulta</tspan></text> - <rect - y="401.80957" - x="535.74707" - height="103.86034" - width="168.79756" - id="rect4157" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4159" - width="168.79756" - height="103.86034" - x="263.76752" - y="548.69025" /> - <rect - y="580.02478" - x="527.92023" - height="103.86034" - width="168.79756" - id="rect4161" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4163" - width="168.79756" - height="103.86034" - x="790.11627" - y="519.31409" /> - <rect - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect4165" - width="168.79756" - height="103.86034" - x="527.92023" - y="775.86572" /> - <ellipse - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="ellipse4167" - cx="484.76419" - cy="962.7699" - rx="96.855988" - ry="49.939438" /> - <ellipse - ry="49.939438" - rx="96.855988" - cy="962.7699" - cx="791.96405" - id="ellipse4169" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="ellipse4171" - cx="838.92456" - cy="774.76257" - rx="96.855988" - ry="49.939438" /> - <ellipse - ry="49.939438" - rx="96.855988" - cy="764.97052" - cx="97.340225" - id="ellipse4173" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="ellipse4175" - cx="369.31967" - cy="761.05371" - rx="96.855988" - ry="49.939438" /> - <ellipse - ry="49.939438" - rx="96.855988" - cy="898.14233" - cx="191.26115" - id="ellipse4177" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - ry="49.939438" - rx="96.855988" - cy="878.55829" - cx="1034.5933" - id="ellipse4179" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="642.69391" - x="1032.7455" - height="103.86034" - width="168.79756" - id="rect4183" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <ellipse - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="ellipse4185" - cx="1196.9982" - cy="1001.9381" - rx="96.855988" - ry="49.939438" /> - <ellipse - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.96893674;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="ellipse4187" - cx="1302.6593" - cy="845.26532" - rx="96.855988" - ry="49.939438" /> - <text - transform="scale(0.99956011,1.0004401)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="618.84381" - y="467.86017" - id="text4189" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4191" - x="618.84381" - y="467.86017" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Color</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - sodipodi:linespacing="125%" - id="text4193" - y="589.22815" - x="869.40991" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="589.22815" - x="869.40991" - id="tspan4195" - sodipodi:role="line">Tamaño</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="1121.9336" - y="708.63855" - id="text4197" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4199" - x="1121.9336" - y="708.63855" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Sabor</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - sodipodi:linespacing="125%" - id="text4201" - y="647.95453" - x="607.09851" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="647.95453" - x="607.09851" - id="tspan4203" - sodipodi:role="line">Forma</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="348.70215" - y="616.63379" - id="text4205" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4207" - x="348.70215" - y="616.63379" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Tamaño</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - sodipodi:linespacing="125%" - id="text4209" - y="781.06781" - x="100.09353" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="781.06781" - x="100.09353" - id="tspan4211" - sodipodi:role="line">Sandía</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="366.32004" - y="771.28009" - id="text4213" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4215" - x="366.32004" - y="771.28009" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Uvas</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - sodipodi:linespacing="125%" - id="text4217" - y="910.26599" - x="192.09828" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="910.26599" - x="192.09828" - id="tspan4219" - sodipodi:role="line">Manzana</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="607.09845" - y="839.79425" - id="text4221" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4223" - x="607.09845" - y="839.79425" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Tamaño</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - sodipodi:linespacing="125%" - id="text4225" - y="972.90747" - x="479.85785" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="972.90747" - x="479.85785" - id="tspan4227" - sodipodi:role="line">Pomelo</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="834.17401" - y="790.85553" - id="text4229" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4231" - x="834.17401" - y="790.85553" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Plátano</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - sodipodi:linespacing="125%" - id="text4233" - y="972.90747" - x="783.27777" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="972.90747" - x="783.27777" - id="tspan4235" - sodipodi:role="line">Limón</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="1033.8439" - y="890.69049" - id="text4237" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4239" - x="1033.8439" - y="890.69049" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Manzana</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - sodipodi:linespacing="125%" - id="text4241" - y="859.36969" - x="1303.9855" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="859.36969" - x="1303.9855" - id="tspan4243" - sodipodi:role="line">Uva</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:37.14643478px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="1192.4053" - y="1012.0584" - id="text4245" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4247" - x="1192.4053" - y="1012.0584" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Cereza</tspan></text> - <text - transform="matrix(0.81157269,-0.58401192,0.58349823,0.81228716,0,0)" - sodipodi:linespacing="125%" - id="text4277" - y="668.25781" - x="-229.80688" - style="font-style:normal;font-weight:normal;font-size:21.05917931px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="668.25781" - x="-229.80688" - id="tspan4279" - sodipodi:role="line">Grande</tspan></text> - <text - transform="matrix(0.34225715,0.93996493,-0.93913815,0.34255846,0,0)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:26.32293129px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="1005.8774" - y="-676.61884" - id="text4289" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4291" - x="1005.8774" - y="-676.61884" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Mediano</tspan></text> - <text - transform="matrix(0.9160891,0.40022848,-0.39987645,0.91689559,0,0)" - sodipodi:linespacing="125%" - id="text4293" - y="149.85788" - x="1174.7745" - style="font-style:normal;font-weight:normal;font-size:20.7318058px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="149.85788" - x="1174.7745" - id="tspan4295" - sodipodi:role="line">Pequeño</tspan></text> - <text - transform="matrix(0.88742856,-0.46039514,0.45999018,0.88820982,0,0)" - sodipodi:linespacing="125%" - id="text4307" - y="674.89526" - x="185.33745" - style="font-style:normal;font-weight:normal;font-size:21.76940536px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="674.89526" - x="185.33745" - id="tspan4309" - sodipodi:role="line">Verde</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:20.46263123px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="572.30908" - y="554.45374" - id="text4311" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4313" - x="572.30908" - y="554.45374" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Amarillo</tspan></text> - <text - transform="matrix(0.94064864,0.33838128,-0.33808364,0.94147675,0,0)" - sodipodi:linespacing="125%" - id="text4315" - y="216.6124" - x="871.52502" - style="font-style:normal;font-weight:normal;font-size:26.06164169px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="216.6124" - x="871.52502" - id="tspan4317" - sodipodi:role="line">Rojo</tspan></text> - <text - transform="matrix(0.70679573,0.70741797,-0.70679573,0.70741797,0,0)" - sodipodi:linespacing="125%" - id="text4319" - y="-344.22678" - x="1420.978" - style="font-style:normal;font-weight:normal;font-size:24.88329887px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="-344.22678" - x="1420.978" - id="tspan4321" - sodipodi:role="line">Agrio</tspan></text> - <text - transform="matrix(0.2695615,0.96337374,-0.96252637,0.26979881,0,0)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:26.99650192px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="1189.4249" - y="-900.60632" - id="text4323" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4325" - x="1189.4249" - y="-900.60632" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Dulce</tspan></text> - <text - transform="matrix(0.89536218,0.44474125,-0.44435006,0.89615043,0,0)" - sodipodi:linespacing="125%" - id="text4327" - y="298.39502" - x="986.5733" - style="font-style:normal;font-weight:normal;font-size:23.97977066px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="298.39502" - x="986.5733" - id="tspan4329" - sodipodi:role="line">Delgado</tspan></text> - <text - transform="matrix(0.99955996,5.4236004e-4,-5.4188299e-4,1.0004399,0,0)" - sodipodi:linespacing="125%" - id="text4331" - y="739.12512" - x="558.90198" - style="font-style:normal;font-weight:normal;font-size:22.1249485px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="739.12512" - x="558.90198" - id="tspan4333" - sodipodi:role="line">Redondo</tspan></text> - <text - transform="scale(0.99956011,1.0004401)" - sodipodi:linespacing="125%" - id="text4337" - y="902.26685" - x="498.11777" - style="font-style:normal;font-weight:normal;font-size:19.15585709px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="902.26685" - x="498.11777" - id="tspan4339" - sodipodi:role="line">Mediano</tspan></text> - <text - transform="matrix(0.74827729,0.66330624,-0.66272279,0.74893605,0,0)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:18.89144516px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="1134.3363" - y="177.04033" - id="text4341" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4343" - x="1134.3363" - y="177.04033" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Pequeño</tspan></text> - <text - transform="matrix(0.99953094,-0.00764342,0.0076367,1.0004109,0,0)" - sodipodi:linespacing="125%" - id="text4345" - y="689.33502" - x="422.7298" - style="font-style:normal;font-weight:normal;font-size:23.94909096px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron" - y="689.33502" - x="422.7298" - id="tspan4347" - sodipodi:role="line">Pequeño</tspan></text> - <text - transform="matrix(0.41556212,-0.90988147,0.90908115,0.41592797,0,0)" - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:23.52765274px;line-height:125%;font-family:sans-serif;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="-594.17133" - y="537.99622" - id="text4349" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4351" - x="-594.17133" - y="537.99622" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Aileron;-inkscape-font-specification:Aileron">Mediano</tspan></text> - </g> - </g> -</svg>
@@ -1,124 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="600" - height="427" - viewBox="0 0 600.00001 427.00001" - id="svg2" - version="1.1" - inkscape:version="0.91 r13725" - sodipodi:docname="drawing.svg"> - <defs - id="defs4" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="0.7" - inkscape:cx="294.66008" - inkscape:cy="242.60004" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - inkscape:window-width="1366" - inkscape:window-height="745" - inkscape:window-x="-8" - inkscape:window-y="-8" - inkscape:window-maximized="1" - units="px" /> - <metadata - id="metadata7"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-625.36216)"> - <g - id="g4201" - transform="matrix(1.0858252,0,0,1.1801734,-100.88655,293.00672)"> - <path - inkscape:connector-curvature="0" - id="path4147" - d="m 138.3909,281.61581 0,314.15745 507.09658,0" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <text - transform="matrix(0,-1,1,0,0,0)" - sodipodi:linespacing="125%" - id="text4149" - y="118.0612" - x="-436.6539" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:33.98496246px;line-height:125%;font-family:aileron;-inkscape-font-specification:aileron;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#800141;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - xml:space="preserve"><tspan - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:aileron;-inkscape-font-specification:aileron;fill:#800141;fill-opacity:1" - y="118.0612" - x="-436.6539" - id="tspan4151" - sodipodi:role="line">Progreso humano</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:33.98496246px;line-height:125%;font-family:aileron;-inkscape-font-specification:aileron;text-align:center;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#800141;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - x="397.81177" - y="636.76599" - id="text4153" - sodipodi:linespacing="125%"><tspan - sodipodi:role="line" - id="tspan4155" - x="397.81177" - y="636.76599" - style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:aileron;-inkscape-font-specification:aileron;fill:#800141;fill-opacity:1">Tiempo</tspan></text> - <path - sodipodi:nodetypes="ccccccccccccccccccc" - inkscape:connector-curvature="0" - id="path4157" - d="m 137.9028,591.22079 c 13.7989,-0.22636 27.92645,1.01015 40.71429,-2.14286 27.72067,-2.86282 57.26327,-0.28419 85.43004,-2.14285 15.99648,-0.45263 32.42354,0.91867 48.14139,-0.71429 5.72845,-1.0112 11.1394,-1.56887 17.14285,-1.42857 7.21766,-2.25049 14.7175,-3.24615 22.85715,-2.85714 8.67613,-1.09828 17.33661,-0.73193 25.71428,-2.85715 19.64199,-2.40443 40.40392,-1.11356 60.71429,-1.42857 15.21116,-4.97803 34.05281,-2.08855 50.97128,-2.85714 9.30387,1.57985 16.53986,-3.01249 25.20766,-3.57143 9.54217,-0.39466 19.76332,0.84988 28.82106,-0.71428 5.81038,-3.79658 15.43012,-5.01928 21.89322,-7.85715 5.197,0.83489 10.91718,-1.37604 19.28572,-2.14285 9.6979,2.47098 12.57335,-5.29998 13.82106,-10.71429 1.17819,-8.67754 2.44634,-16.6896 4.28571,-25 0.40885,-3.66551 1.55773,-10.04969 3.79613,-19.50668 1.97168,-4.00856 2.92821,-46.54217 6.20387,-72.63618 4.39723,-17.97642 0.56595,-38.8502 2.98282,-58.188 1.18644,-21.31693 3.9398,-42.57798 3.44576,-63.95485" - style="fill:none;fill-rule:evenodd;stroke:#31c700;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4162" - d="m 612.42837,319.45866 c 0.92593,-0.89675 1.13939,-2.28735 2.09536,-3.16156 0.71531,-1.36676 1.61726,-2.62787 2.19515,-4.06343 0.74302,-1.66435 1.82927,-3.1575 2.41751,-4.89341 0.25358,-0.57085 0.49901,-1.82642 0.91484,-0.66484 0.65592,1.06746 1.06559,2.26602 1.26276,3.49816 0.25904,1.12137 0.40522,2.33952 1.15854,3.26189 0.34204,1.49848 0.96357,3.0829 2.37272,3.87918 0.27103,0.17045 0.55635,0.32338 0.79737,0.53683" - style="fill:none;fill-rule:evenodd;stroke:#31c700;stroke-width:4;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - sodipodi:nodetypes="ccccc" - inkscape:connector-curvature="0" - id="path4169" - d="m 580.26888,540.41722 c -1.29504,-0.0304 -2.76029,1.10183 -2.4902,2.49837 0.42493,1.6662 2.66317,2.52501 4.07385,1.51711 0.98406,-0.75056 0.86948,-2.24494 0.16896,-3.14875 -0.43502,-0.6157 -1.07433,-0.94235 -1.88115,-0.85634" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4171" - d="m 580.35816,545.14937 c 0.7349,2.44499 0.13044,5.01896 0.4795,7.50992 -0.0449,1.5878 0.23077,3.2213 -0.25634,4.76684" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4173" - d="m 578.21531,552.96187 c 0.60692,-1.16446 2.20743,-1.91413 3.38778,-1.12902 0.46439,0.25767 0.66163,0.74584 0.98701,1.129" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path4179" - d="m 578.46915,559.77056 c 0.66126,-0.86601 1.0905,-2.05193 2.14966,-2.51299 0.84539,-0.2873 1.26127,0.66796 1.91512,0.94024 0.13563,0.0734 0.26977,0.14971 0.39917,0.23366" - style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> - </g> - </g> -</svg>
@@ -1,128 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Inteligencia artificial</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="inteligencia_artificial"><a class="anchor" href="#inteligencia_artificial">¶</a>Inteligencia artificial</h1> -<div class="date-created-modified">Created 2016-02-24<br> -Modified 2016-03-05</div> -<h2 id="índice"><a class="anchor" href="#índice">¶</a>Índice</h2> -<ul> -<li><a href="#qu%C3%A9_es">Qué es</a></li> -<li><a href="#en_qu%C3%A9_consiste">En qué consiste</a></li> -<li><a href="#l%C3%ADmites">Límites</a></li> -<li><a href="#tipos_de_inteligencia_artificial">Tipos de inteligencia artificial</a></li> -<li><a href="#aplicaciones_pr%C3%A1cticas">Aplicaciones prácticas</a></li> -<li><a href="#implicaciones_%C3%A9ticas">Implicaciones éticas</a></li> -<li><a href="#ejemplos">Ejemplos</a></li> -<li><a href="#conceptos">Conceptos</a></li> -<li><a href="#fuentes">Fuentes</a></li> -</ul> -<h2 id="qué_es"><a class="anchor" href="#qué_es">¶</a>Qué es</h2> -<p>La inteligencia artificial es una rama apasionante que tiene su origen en la <strong>informática</strong> y se basa en el concepto de conseguir <em>emular</em><sup class="footnote-reference" id="r.1"><a href="#f.1">1</a></sup> al cerebro humano, mediante el desarrollo un programa que sea capaz de <strong>aprender y mejorar por sí sólo</strong> (normalmente bajo algún tipo de supervisión)</p> -<p>Fue un concepto acuñado por <em>John McCarthy</em> en un congreso de informática de 1956, y desde entonces este campo ha crecido de manera exponencial con unas buenas previsiones de futuro.</p></p> -<div class="image-container"> -<img src="human_progress_edge.svg" alt="Progreso humano en la inteligencia artificial" /> -<div class="image-caption"></div> -</div> -<p> -<p><em>Progreso humano en la inteligencia artificial. <a href="http://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1">Fuente</a></em></p> -<h2 id="en_qué_consiste"><a class="anchor" href="#en_qué_consiste">¶</a>En qué consiste</h2> -<p>La inteligencia artificial no consiste en escribir unas pautas fijas y finitas al igual que hacen la gran mayoría de programas, en los cuales introduces unos datos y producen siempre la misma salida, una salida predecible, programada e invariable, que además, tiene sus límites, ya que si introduces datos para los que la aplicación no está programada, esta aplicación no será capaz de manejarlos. No los entenderá y no producirá ningún resultado.</p> -<p>La inteligencia artificial consiste en dar un paso <strong>más allá</strong>. Una inteligencia artificial <em>entrenada</em> es capaz de manejar datos para los cuales no ha sido programada de manera explícita<sup class="footnote-reference" id="r.2"><a href="#f.2">2</a></sup></sup></p> -<h2 id="límites"><a class="anchor" href="#límites">¶</a>Límites</h2> -<p>Actualmente, la inteligencia artificial se ve limitada por la velocidad y capacidad de los dispositivos (ordenadores, teléfonos inteligentes).</p> -<p>A día de hoy, ya hemos conseguido emular el cerebro de un gusano de un milímetro de longitud, que consiste de un total de trescientas dos neuronas. El <strong>cerebro humano</strong> contiene unas <strong>cien mil millones de neuronas</strong>.</p> -<div class="image-container"> -<img src="exponential_grow.gif" alt="Progreso en la velocidad de los dispositivos" /> -<div class="image-caption"></div> -</div> -<p> -<p><em>Crecimiento en la velocidad de procesado de los dispositivos. <a href="http://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1">Fuente</a></em></p> -<p>Comparado con las neuronas de un cerebro humano (cuya velocidad<sup class="footnote-reference" id="r.3"><a href="#f.3">3</a></sup> máxima oscilan entre los 200Hz), los procesadores de hoy en día (mucho más lentos que los que tendremos dentro de algunos años) ya tienen una velocidad superior a los 2Ghz, es decir, <strong>10 millones de veces</strong> más rápidos que las neuronas. Y la comunicación interna del cerebro, que oscila entre los 120m/s, queda infinitamente distante de la velocidad de los ordenadores que se comunican de manera óptica a la <strong>velocidad de la luz</strong>.</p> -<p>Además de todo esto, la capacidad de los dispositivos puede ser <strong>ampliada</strong>, a diferencia del cerebro que tiene un tamaño ya determinado. Y, por último, un procesador puede estar <strong>trabajando sin parar</strong> nunca, sin cansarse.</p></p> -<!-- Boston dynamics artificial intelligence put some more examples, like Google or predicting models or big data, ocr --> -<h2 id="tipos_de_inteligencia_artificial"><a class="anchor" href="#tipos_de_inteligencia_artificial">¶</a>Tipos de inteligencia artificial</h2> -<h3 id="según_el_tipo_de_aprendizaje"><a class="anchor" href="#según_el_tipo_de_aprendizaje">¶</a>Según el tipo de aprendizaje</h3> -<ul> -<li><strong>Aprendizaje supervisado</strong>: se le presenta una entrada de datos y produce una salida de los datos procesados, y un "tutor" es el que determina si la salida es correcta o no.</li> -<li><strong>Aprendizaje sin supervisar</strong>: se le presenta una entrada de datos sin presentarle ningún otro tipo de información, para que encuentre la estructura de los datos por sí sóla.</li> -<li><strong>Aprendizaje por refuerzo</strong>: un ordenador interactua con un entorno variable en el que debe llevar a cabo una tarea concreta, sin que un tutor le indique cómo explícitamente.</li> -</ul> -<h3 id="según_la_forma_de_llevarlo_a_cabo_principales_métodos_"><a class="anchor" href="#según_la_forma_de_llevarlo_a_cabo_principales_métodos_">¶</a>Según la forma de llevarlo a cabo (principales métodos)</h3> -<ul> -<li> -<p><strong>Aprendizaje por árbol de decisiones</strong>. Este aprendizaje usa un árbol de decisiones, que almacena observaciones y conclusiones.</p> -<div class="image-container"> -<img src="decision_tree.svg" alt="Árbol de decisiones" /> -<div class="image-caption"></div> -</div> -<p> -</li> -<li> -<p><strong>Aprendizaje por asociación de reglas</strong>. Utilizado para descubrir relaciones en grandes bases de datos<sup class="footnote-reference" id="r.4"><a href="#f.4">4</a></sup>.</p> -</li> -<li> -<p><strong>Red neuronal artificial (RNA)</strong>. Inspirado en redes neuronales biológicas**. Los cálculos se estructuran en un grupo de neuronas artificiales interconectadas.</p> -</li> -<li> -<p><strong>Programación lógica inductiva (PLI)</strong>. Se aproxima de manera hipotética, dado un transfondo lógico y una entrada, a una solución que no se le había presentado antes.</p> -</li> -<li> -<p><strong>Máquinas de soporte vectorial (MSV)</strong>. Se usan para clasificar y problemas que necesitan de regresión<sup class="footnote-reference" id="r.5"><a href="#f.5">5</a></sup>. Dado una serie de ejemplos, una entrada será clasificada de una forma u otra.</p> -</li> -<li> -<p><em><strong>Clustering</strong></em>. Este tipo de análisis consiste en asignar observaciones a ciertas subcategorías (denominadas <em>clústeres</em>), para que aquellas que están en el mismo <em>clúster</em> sean similares**. Este tipo de aprendizaje es una técnica común en análisis estadístico.</p> -</li> -<li> -<p><strong>Redes bayesianas</strong>. Es un modelo probabilístico que organiza variables al azar según unas determinadas condiciones mediante un gráfico**. Un ejemplo de red bayesiana es el siguiente:</p> -<div class="image-container"> -<img src="bayesian_network.svg" alt="Red bayesiana" /> -<div class="image-caption"></div> -</div> -<p> -</li> -<li> -<p><strong>Algoritmos genéticos</strong>. Imita el proceso evolutivo de la selección natural, y usa métodos como la mutación para generar nuevos "genotipos" que, con algo de suerte, serán mejores en encontrar la solución correcta.</p> -</li> -</ul> -<h2 id="aplicaciones_prácticas"><a class="anchor" href="#aplicaciones_prácticas">¶</a>Aplicaciones prácticas</h2> -<p>La inteligencia artificial ya se encuentra desde hace algún tiempo entre nosotros, como por ejemplo el archiconocido <strong>buscador Google</strong>, que filtra los resultados más relevantes mediante una inteligencia artificial. Otros ejemplos son el reconocimiento de caracteres a partir de una foto, o incluso reconocimiento del habla con <strong>asistentes virtuales como Cortana o Siri</strong>, en los videojuegos, en bolsa, en los <strong>hospitales</strong>, industria pesada, transportes, juguetes, música, aviación, robótica, filtros anti-spam... y un largo etcétera.</p> -<h2 id="implicaciones_éticas"><a class="anchor" href="#implicaciones_éticas">¶</a>Implicaciones éticas</h2> -<p>Una vez tengamos la tecnología necesaria para recrear un cerebro humano, si enseñáramos a esta inteligencia artificial al igual que un humano, ¿llegaría a tener <strong>sentimientos</strong>? ¿Sería consciente de su existencia? ¿Podría sentir felicidad, alegría, tristeza, enfado? ¿Tendría <strong>creatividad</strong>? ¿Derecho a propiedad? Si la respuesta es que sí, y es la respuesta más lógica, significa que, en realidad, los sentimientos no son nada más que una manera de entender las cosas. No tienen valor por sí mismos. Seríamos capaces de recrearlos, y tendrían el mismo valor que un sentimiento humano, aunque esa inteligencia viviera dentro de un ordenador. Y acabar con esta inteligencia sería acabar con esta vida, <strong>una vida</strong> casi, por no decir enteramente, <strong>humana</strong>. Además, todo esto implicaría que todo comportamiento humano es predecible. Por último, si esta inteligencia es realmente como un humano, al utilizarla, ¿la estaríamos esclavizando al obligarla a trabajar para nosotros? ¿En qué momento dejaremos de llamarlos "ordenadores" y comenzaremos a tratarles como "humanos"? ¿Será la humanidad capaz de adaptarse al cambio?</p> -<!-- ¿y si sólo somos cerebro y logramos recrearlo? ¿tendría sentimientos? --> -<h2 id="ejemplos"><a class="anchor" href="#ejemplos">¶</a>Ejemplos</h2> -<p>En el siguiente algorítmo genético podemos ver como una figura aprende a saltar, obedeciendo a las leyes físicas (ver en <a href="https://youtu.be/Gl3EjiVlz_4">YouTube</a>):</p> -<iframe width="420" height="315" src="https://www.youtube.com/embed/Gl3EjiVlz_4" frameborder="0" allowfullscreen></iframe> -<p>Por el contrario, en el siguiente ejemplo, un algorítmo genético aprende a "luchar" contra otra figura: (ver en <a href="https://youtu.be/u2t77mQmJiY">YouTube</a>):</p> -<iframe width="560" height="315" src="https://www.youtube.com/embed/u2t77mQmJiY" frameborder="0" allowfullscreen></iframe> -<p>Estos cuatro increíbles ejemplos siguientes muestran un proceso evolutivo similar al sufrido por cualquier tipo de ser (ver en <a href="https://youtu.be/GOFws_hhZs8">YouTube</a>):</p> -<iframe width="560" height="315" src="https://www.youtube.com/embed/GOFws_hhZs8" frameborder="0" allowfullscreen></iframe> -<iframe width="560" height="315" src="https://www.youtube.com/embed/31dsH2Fs1IQ" frameborder="0" allowfullscreen></iframe> -<iframe width="560" height="315" src="https://www.youtube.com/embed/IVcvvqxtNwE" frameborder="0" allowfullscreen></iframe> -<iframe width="560" height="315" src="https://www.youtube.com/embed/KrTbJUJsDSw" frameborder="0" allowfullscreen></iframe> -<h2 id="conceptos"><a class="anchor" href="#conceptos">¶</a>Conceptos</h2> -<p class="footnote" id="f.1"><sup>1</sup> <strong>Emular</strong>. Tratar de imitar un modelo, aproximarse a este. Copiar su comportamiento o incluso mejorarlo. <a href="#r.1">↩</a></p> - -<p class="footnote" id="f.2"><sup>2</sup> <strong>Explícito</strong>. Suceso que ocurre de manera previamente avisada de una forma directa, anticipado <em>sin rodeos</em>. <a href="#r.2">↩</a></p> - -<p class="footnote" id="f.3"><sup>3</sup> <strong>Velocidad (en hercios)</strong>. Número de cálculos realizados por segundo. Un procesador con una velocidad de 100Hz es capaz de realizar 100 cálculos por segundo. <a href="#r.3">↩</a></p> - -<p class="footnote" id="f.4"><sup>4</sup> <strong>Base de datos</strong>. Lugar en el que se almacena de manera estructurada una información, como por ejemplo un censo que indique el nombre de las personas, sus apellidos, edad, etcétera. <a href="#r.4">↩</a></p> - -<p class="footnote" id="f.5"><sup>5</sup> <strong>Regresión</strong>. Las pruebas de regresión consisten en someter a un programa a una serie de pruebas para descubrir fallos en este cometidos accidentalmente con anterioridad en versiones anteriores. <a href="#r.5">↩</a></p> - -<h2 id="fuentes"><a class="anchor" href="#fuentes">¶</a>Fuentes</h2> -<ul> -<li><a href="http://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1">Evolución de la inteligencia artificial - Wait but why</a></li> -<li><a href="https://en.wikipedia.org/wiki/Machine_learning"><em>Machine learning</em> - Wikipedia</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,27 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Making a Difference</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="making_a_difference"><a class="anchor" href="#making_a_difference">¶</a>Making a Difference</h1> -<div class="date-created-modified">Created 2020-08-24<br> -Modified 2020-10-03</div> -<p>When I've thought about what "making a difference" means, I've always seen it as having to do something at very large scales. Something that changes everyone's lives. But I've realized that it doesn't need the case.</p> -<p>I'm thinking about certain people. I'm thinking about middle-school.</p> -<p>I'm thinking about my math teacher, who I remember saying that if he made a student fail with a grade very close to passing, then he would be a bad teacher because he could just "let them pass". But if he just passed that one student, he would fail as a teacher, because it's his job to get people to actually <em>learn</em> his subject. He didn't want to be mean, he was just trying to have everybody properly learn the subject. That made a difference on me, but I never got the chance to thank him.</p> -<p>I'm thinking about my English teacher, who has had to put up with a lot of stupidity from the rest of students, making the class not enjoyable. But I thought she was nice, and she thought I was nice. I remember of a day when she was grading my assignement and debating what grade I should get. I thought to myself, she should just grade whatever she considered fair. But she went something along the lines of "what the heck, you deserve it", and graded in my favour. I think of her as an honest person who also just wants to make other people learn, despite the other students not liking her much. I never got a chance to thank her.</p> -<p>I'm thinking about my philosophy teacher, who was a nice chap. He tried to make the lectures fun and had some really interesting ways of thinking. He was nice to talk to overall, but I never got to thank him for what he taught us.</p> -<p>I'm thinking about one of my lecturers at university who has let me express my feelings to her and helped me make the last push I needed to finish my university degree (I was really dreading some subjects and considering dropping out, but those days are finally over).</p> -<p>I'm thinking about all the people who has been in a long-distance relationship with me. None of the three I've had have worked out in the long-term so far, and I'm in a need of a break from those. But they were really invaluable to help me grow and learn a lot about how things actually work. I'm okay with the first two people now, maybe the third one can be my friend once more in the future as well. I'm sure I've told them how important they have been to me and my life.</p> -<p>I'm thinking about all the people who I've met online and have had overall a healthy relation, sharing interesting things between each other, playtime, thoughts, and other various lessons.</p> -<p>What I'm trying to get across is that you may be more impactful than you think you really are. And even if people don't say it, some are extremely thankful of your interactions with them. You can see this post as a sort of a "call for action" to be more thankful to the people that have affected you in important ways. If people take things for granted because they Just Work, the person who made those things should be proud of this achievement.</p> -<p>Thanks to all of them, to everyone who has shared good moments with me, and to all the people who enjoy the things I make.</p> -</main> -</body> -</html> -
@@ -1,135 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>A practical example with Hadoop</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>In our <a href="/blog/mdad/introduction-to-hadoop-and-its-mapreduce/">previous Hadoop post</a>, we learnt what it is, how it originated, and how it works, from a theoretical standpoint. Here we will instead focus on a more practical example with Hadoop.</p> -<div class="date-created-modified">Created 2020-03-30<br> -Modified 2020-04-18</div> -<p>This post will reproduce the example on Chapter 2 of the book <a href="http://www.hadoopbook.com/">Hadoop: The Definitive Guide, Fourth Edition</a> (<a href="http://grut-computing.com/HadoopBook.pdf">pdf,</a><a href="http://www.hadoopbook.com/code.html">code</a>), that is, finding the maximum global-wide temperature for a given year.</p> -<h2 class="title" id="installation"><a class="anchor" href="#installation">¶</a>Installation</h2> -<p>Before running any piece of software, its executable code must first be downloaded into our computers so that we can run it. Head over to <a href="http://hadoop.apache.org/releases.html">Apache Hadoop’s releases</a> and download the <a href="https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz">latest binary version</a> at the time of writing (3.2.1).</p> -<p>We will be using the <a href="https://linuxmint.com/">Linux Mint</a> distribution because I love its simplicity, although the process shown here should work just fine on any similar Linux distribution such as <a href="https://ubuntu.com/">Ubuntu</a>.</p> -<p>Once the archive download is complete, extract it with any tool of your choice (graphical or using the terminal) and execute it. Make sure you have a version of Java installed, such as <a href="https://openjdk.java.net/">OpenJDK</a>.</p> -<p>Here are all the three steps in the command line:</p> -<pre><code>wget https://apache.brunneis.com/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz -tar xf hadoop-3.2.1.tar.gz -hadoop-3.2.1/bin/hadoop version -</code></pre> -<p>We will be using the two example data files that they provide in <a href="https://github.com/tomwhite/hadoop-book/tree/master/input/ncdc/all">their GitHub repository</a>, although the full dataset is offered by the <a href="https://www.ncdc.noaa.gov/">National Climatic Data Center</a> (NCDC).</p> -<p>We will also unzip and concatenate both files into a single text file, to make it easier to work with. As a single command pipeline:</p> -<pre><code>curl https://raw.githubusercontent.com/tomwhite/hadoop-book/master/input/ncdc/all/190{1,2}.gz | gunzip > 190x -</code></pre> -<p>This should create a <code>190x</code> text file in the current directory, which will be our input data.</p> -<h2 id="processing_data"><a class="anchor" href="#processing_data">¶</a>Processing data</h2> -<p>To take advantage of Hadoop, we have to design our code to work in the MapReduce model. Both the map and reduce phase work on key-value pairs as input and output, and both have a programmer-defined function.</p> -<p>We will use Java, because it’s a dependency that we already have anyway, so might as well.</p> -<p>Our map function needs to extract the year and air temperature, which will prepare the data for later use (finding the maximum temperature for each year). We will also drop bad records here (if the temperature is missing, suspect or erroneous).</p> -<p>Copy or reproduce the following code in a file called <code>MaxTempMapper.java</code>, using any text editor of your choice:</p> -<pre><code>import java.io.IOException; - -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Mapper; - -public class MaxTempMapper extends Mapper<LongWritable, Text, Text, IntWritable> { - private static final int TEMP_MISSING = 9999; - private static final String GOOD_QUALITY_RE = "[01459]"; - - @Override - public void map(LongWritable key, Text value, Context context) - throws IOException, InterruptedException { - String line = value.toString(); - String year = line.substring(15, 19); - String temp = line.substring(87, 92).replaceAll("^\\+", ""); - String quality = line.substring(92, 93); - - int airTemperature = Integer.parseInt(temp); - if (airTemperature != TEMP_MISSING && quality.matches(GOOD_QUALITY_RE)) { - context.write(new Text(year), new IntWritable(airTemperature)); - } - } -} -</code></pre> -<p>Now, let’s create the <code>MaxTempReducer.java</code> file. Its job is to reduce the data from multiple values into just one. We do that by keeping the maximum out of all the values we receive:</p> -<pre><code>import java.io.IOException; -import java.util.Iterator; - -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Reducer; - -public class MaxTempReducer extends Reducer<Text, IntWritable, Text, IntWritable> { - @Override - public void reduce(Text key, Iterable<IntWritable> values, Context context) - throws IOException, InterruptedException { - Iterator<IntWritable> iter = values.iterator(); - if (iter.hasNext()) { - int maxValue = iter.next().get(); - while (iter.hasNext()) { - maxValue = Math.max(maxValue, iter.next().get()); - } - context.write(key, new IntWritable(maxValue)); - } - } -} -</code></pre> -<p>Except for some Java weirdness (…why can’t we just iterate over an <code>Iterator</code>? Or why can’t we just manually call <code>next()</code> on an <code>Iterable</code>?), our code is correct. There can’t be a maximum if there are no elements, and we want to avoid dummy values such as <code>Integer.MIN_VALUE</code>.</p> -<p>We can also take a moment to appreciate how absolutely tiny this code is, and it’s Java! Hadoop’s API is really awesome and lets us write such concise code to achieve what we need.</p> -<p>Last, let’s write the <code>main</code> method, or else we won’t be able to run it. In our new file <code>MaxTemp.java</code>:</p> -<pre><code>import org.apache.hadoop.fs.Path; -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Job; -import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; -import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; - -public class MaxTemp { - public static void main(String[] args) throws Exception { - if (args.length != 2) { - System.err.println("usage: java MaxTemp <input path> <output path>"); - System.exit(-1); - } - - Job job = Job.getInstance(); - - job.setJobName("Max temperature"); - job.setJarByClass(MaxTemp.class); - job.setMapperClass(MaxTempMapper.class); - job.setReducerClass(MaxTempReducer.class); - job.setOutputKeyClass(Text.class); - job.setOutputValueClass(IntWritable.class); - - FileInputFormat.addInputPath(job, new Path(args[0])); - FileOutputFormat.setOutputPath(job, new Path(args[1])); - - boolean result = job.waitForCompletion(true); - - System.exit(result ? 0 : 1); - } -} -</code></pre> -<p>And compile by including the required <code>.jar</code> dependencies in Java’s classpath with the <code>-cp</code> switch:</p> -<pre><code>javac -cp "hadoop-3.2.1/share/hadoop/common/*:hadoop-3.2.1/share/hadoop/mapreduce/*" *.java -</code></pre> -<p>At last, we can run it (also specifying the dependencies in the classpath, this one’s a mouthful):</p> -<pre><code>java -cp ".:hadoop-3.2.1/share/hadoop/common/*:hadoop-3.2.1/share/hadoop/common/lib/*:hadoop-3.2.1/share/hadoop/mapreduce/*:hadoop-3.2.1/share/hadoop/mapreduce/lib/*:hadoop-3.2.1/share/hadoop/yarn/*:hadoop-3.2.1/share/hadoop/yarn/lib/*:hadoop-3.2.1/share/hadoop/hdfs/*:hadoop-3.2.1/share/hadoop/hdfs/lib/*" MaxTemp 190x results -</code></pre> -<p>Hooray! We should have a new <code>results/</code> folder along with the following files:</p> -<pre><code>$ ls results -part-r-00000 _SUCCESS -$ cat results/part-r-00000 -1901 317 -1902 244 -</code></pre> -<p>It worked! Now this example was obviously tiny, but hopefully enough to demonstrate how to get the basics running on real world data.</p> -</main> -</body> -</html> -
@@ -1,1642 +0,0 @@
-<feed xmlns="http://www.w3.org/2005/Atom"><title>pagong</title><id>pagong</id><updated>2020-10-02T22:00:00+00:00</updated><entry><title>Data Mining and Data Warehousing</title><id>dist/index/index.html</id><updated>2020-10-02T22:00:00+00:00</updated><published>2020-10-02T22:00:00+00:00</published><summary>During 2020 at university, this subject ("Minería de Datos y Almacenes de Datos") had us write</summary><content type="html" src="dist/index/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Data Mining and Data Warehousing</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="data_mining_and_data_warehousing"><a class="anchor" href="#data_mining_and_data_warehousing">¶</a>Data Mining and Data Warehousing</h1> -<div class="date-created-modified">2020-10-03</div> -<p>During 2020 at university, this subject (&quot;Minería de Datos y Almacenes de Datos&quot;) had us write -blog posts as assignments. I think it would be really fun and I wanted to preserve that work -here, with the hopes it's interesting to someone.</p> -<p>The posts were auto-generated from the original HTML files and manually anonymized later.</p> -</main> -</body> -</html> - </content></entry><entry><title>Privado: Final NoSQL evaluation</title><id>dist/final-nosql-evaluation/index.html</id><updated>2020-05-13T22:00:00+00:00</updated><published>2020-05-12T22:00:00+00:00</published><summary>This evaluation is a bit different to my </summary><content type="html" src="dist/final-nosql-evaluation/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: Final NoSQL evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This evaluation is a bit different to my <a href="/blog/mdad/nosql-evaluation/">previous one</a> because this time I have been tasked to evaluate student <code>a(i - 2)</code>, and because I am <code>i = 11</code> that happens to be <code>a(9) =</code> a classmate.</p> -<div class="date-created-modified">Created 2020-05-13<br> -Modified 2020-05-14</div> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s Evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post I have evaluated is Trabajo en grupo – Bases de datos NoSQL, 3ª entrada: Aplicación con una Base de datos NoSQL seleccionada.</p> -<p>It starts with a very brief introduction with who has written the post, what data they will be using, and what database they have chosen.</p> -<p>They properly describe their objective, how they will do it and what library will be used.</p> -<p>They also explain where they obtain the data from, and what other things the site can do, which is a nice bonus.</p> -<p>The post continues listing and briefly explaining all the tools used and what they are for, including commands to execute.</p> -<p>At last, they list what files their project uses, what they do, and contains a showcase of images which lets the reader know what the application does.</p> -<p>All in all, in my opinion, it’s clear they have put work into this entry and I have not noticed any major flaws, so they deserve the highest grade.</p> -</main> -</body> -</html> - </content></entry><entry><title>A practical example with Hadoop</title><id>dist/a-practical-example-with-hadoop/index.html</id><updated>2020-04-17T22:00:00+00:00</updated><published>2020-03-29T22:00:00+00:00</published><summary>In our </summary><content type="html" src="dist/a-practical-example-with-hadoop/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>A practical example with Hadoop</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>In our <a href="/blog/mdad/introduction-to-hadoop-and-its-mapreduce/">previous Hadoop post</a>, we learnt what it is, how it originated, and how it works, from a theoretical standpoint. Here we will instead focus on a more practical example with Hadoop.</p> -<div class="date-created-modified">Created 2020-03-30<br> -Modified 2020-04-18</div> -<p>This post will reproduce the example on Chapter 2 of the book <a href="http://www.hadoopbook.com/">Hadoop: The Definitive Guide, Fourth Edition</a> (<a href="http://grut-computing.com/HadoopBook.pdf">pdf,</a><a href="http://www.hadoopbook.com/code.html">code</a>), that is, finding the maximum global-wide temperature for a given year.</p> -<h2 class="title" id="installation"><a class="anchor" href="#installation">¶</a>Installation</h2> -<p>Before running any piece of software, its executable code must first be downloaded into our computers so that we can run it. Head over to <a href="http://hadoop.apache.org/releases.html">Apache Hadoop’s releases</a> and download the <a href="https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz">latest binary version</a> at the time of writing (3.2.1).</p> -<p>We will be using the <a href="https://linuxmint.com/">Linux Mint</a> distribution because I love its simplicity, although the process shown here should work just fine on any similar Linux distribution such as <a href="https://ubuntu.com/">Ubuntu</a>.</p> -<p>Once the archive download is complete, extract it with any tool of your choice (graphical or using the terminal) and execute it. Make sure you have a version of Java installed, such as <a href="https://openjdk.java.net/">OpenJDK</a>.</p> -<p>Here are all the three steps in the command line:</p> -<pre><code>wget https://apache.brunneis.com/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz -tar xf hadoop-3.2.1.tar.gz -hadoop-3.2.1/bin/hadoop version -</code></pre> -<p>We will be using the two example data files that they provide in <a href="https://github.com/tomwhite/hadoop-book/tree/master/input/ncdc/all">their GitHub repository</a>, although the full dataset is offered by the <a href="https://www.ncdc.noaa.gov/">National Climatic Data Center</a> (NCDC).</p> -<p>We will also unzip and concatenate both files into a single text file, to make it easier to work with. As a single command pipeline:</p> -<pre><code>curl https://raw.githubusercontent.com/tomwhite/hadoop-book/master/input/ncdc/all/190{1,2}.gz | gunzip &gt; 190x -</code></pre> -<p>This should create a <code>190x</code> text file in the current directory, which will be our input data.</p> -<h2 id="processing_data"><a class="anchor" href="#processing_data">¶</a>Processing data</h2> -<p>To take advantage of Hadoop, we have to design our code to work in the MapReduce model. Both the map and reduce phase work on key-value pairs as input and output, and both have a programmer-defined function.</p> -<p>We will use Java, because it’s a dependency that we already have anyway, so might as well.</p> -<p>Our map function needs to extract the year and air temperature, which will prepare the data for later use (finding the maximum temperature for each year). We will also drop bad records here (if the temperature is missing, suspect or erroneous).</p> -<p>Copy or reproduce the following code in a file called <code>MaxTempMapper.java</code>, using any text editor of your choice:</p> -<pre><code>import java.io.IOException; - -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Mapper; - -public class MaxTempMapper extends Mapper&lt;LongWritable, Text, Text, IntWritable&gt; { - private static final int TEMP_MISSING = 9999; - private static final String GOOD_QUALITY_RE = &quot;[01459]&quot;; - - @Override - public void map(LongWritable key, Text value, Context context) - throws IOException, InterruptedException { - String line = value.toString(); - String year = line.substring(15, 19); - String temp = line.substring(87, 92).replaceAll(&quot;^\\+&quot;, &quot;&quot;); - String quality = line.substring(92, 93); - - int airTemperature = Integer.parseInt(temp); - if (airTemperature != TEMP_MISSING &amp;&amp; quality.matches(GOOD_QUALITY_RE)) { - context.write(new Text(year), new IntWritable(airTemperature)); - } - } -} -</code></pre> -<p>Now, let’s create the <code>MaxTempReducer.java</code> file. Its job is to reduce the data from multiple values into just one. We do that by keeping the maximum out of all the values we receive:</p> -<pre><code>import java.io.IOException; -import java.util.Iterator; - -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Reducer; - -public class MaxTempReducer extends Reducer&lt;Text, IntWritable, Text, IntWritable&gt; { - @Override - public void reduce(Text key, Iterable&lt;IntWritable&gt; values, Context context) - throws IOException, InterruptedException { - Iterator&lt;IntWritable&gt; iter = values.iterator(); - if (iter.hasNext()) { - int maxValue = iter.next().get(); - while (iter.hasNext()) { - maxValue = Math.max(maxValue, iter.next().get()); - } - context.write(key, new IntWritable(maxValue)); - } - } -} -</code></pre> -<p>Except for some Java weirdness (…why can’t we just iterate over an <code>Iterator</code>? Or why can’t we just manually call <code>next()</code> on an <code>Iterable</code>?), our code is correct. There can’t be a maximum if there are no elements, and we want to avoid dummy values such as <code>Integer.MIN_VALUE</code>.</p> -<p>We can also take a moment to appreciate how absolutely tiny this code is, and it’s Java! Hadoop’s API is really awesome and lets us write such concise code to achieve what we need.</p> -<p>Last, let’s write the <code>main</code> method, or else we won’t be able to run it. In our new file <code>MaxTemp.java</code>:</p> -<pre><code>import org.apache.hadoop.fs.Path; -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Job; -import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; -import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; - -public class MaxTemp { - public static void main(String[] args) throws Exception { - if (args.length != 2) { - System.err.println(&quot;usage: java MaxTemp &lt;input path&gt; &lt;output path&gt;&quot;); - System.exit(-1); - } - - Job job = Job.getInstance(); - - job.setJobName(&quot;Max temperature&quot;); - job.setJarByClass(MaxTemp.class); - job.setMapperClass(MaxTempMapper.class); - job.setReducerClass(MaxTempReducer.class); - job.setOutputKeyClass(Text.class); - job.setOutputValueClass(IntWritable.class); - - FileInputFormat.addInputPath(job, new Path(args[0])); - FileOutputFormat.setOutputPath(job, new Path(args[1])); - - boolean result = job.waitForCompletion(true); - - System.exit(result ? 0 : 1); - } -} -</code></pre> -<p>And compile by including the required <code>.jar</code> dependencies in Java’s classpath with the <code>-cp</code> switch:</p> -<pre><code>javac -cp &quot;hadoop-3.2.1/share/hadoop/common/*:hadoop-3.2.1/share/hadoop/mapreduce/*&quot; *.java -</code></pre> -<p>At last, we can run it (also specifying the dependencies in the classpath, this one’s a mouthful):</p> -<pre><code>java -cp &quot;.:hadoop-3.2.1/share/hadoop/common/*:hadoop-3.2.1/share/hadoop/common/lib/*:hadoop-3.2.1/share/hadoop/mapreduce/*:hadoop-3.2.1/share/hadoop/mapreduce/lib/*:hadoop-3.2.1/share/hadoop/yarn/*:hadoop-3.2.1/share/hadoop/yarn/lib/*:hadoop-3.2.1/share/hadoop/hdfs/*:hadoop-3.2.1/share/hadoop/hdfs/lib/*&quot; MaxTemp 190x results -</code></pre> -<p>Hooray! We should have a new <code>results/</code> folder along with the following files:</p> -<pre><code>$ ls results -part-r-00000 _SUCCESS -$ cat results/part-r-00000 -1901 317 -1902 244 -</code></pre> -<p>It worked! Now this example was obviously tiny, but hopefully enough to demonstrate how to get the basics running on real world data.</p> -</main> -</body> -</html> - </content></entry><entry><title>Developing a Python application for Cassandra</title><id>dist/developing-a-python-application-for-cassandra/index.html</id><updated>2020-04-15T22:00:00+00:00</updated><published>2020-03-22T23:00:00+00:00</published><summary>Warning</summary><content type="html" src="dist/developing-a-python-application-for-cassandra/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Developing a Python application for Cassandra</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p><em><strong>Warning</strong>: this post is, in fact, a shameless self-plug to my own library. If you continue reading, you accept that you are okay with this. Otherwise, please close the tab, shut down your computer, and set it on fire.__(Also, that was a joke. Please don’t do that.)</em></p> -<div class="date-created-modified">Created 2020-03-23<br> -Modified 2020-04-16</div> -<p>Let’s do some programming! Today we will be making a tiny CLI application in <a href="http://python.org/">Python</a> that queries <a href="https://core.telegram.org/api">Telegram’s API</a> and stores the data in <a href="http://cassandra.apache.org/">Cassandra</a>.</p> -<h2 class="title" id="our_goal"><a class="anchor" href="#our_goal">¶</a>Our goal</h2> -<p>Our goal is to make a Python console application. This application will connect to <a href="https://telegram.org/">Telegram</a>, and ask for your account credentials. Once you have logged in, the application will fetch all of your open conversations and we will store these in Cassandra.</p> -<p>With the data saved in Cassandra, we can now very efficiently query information about your conversations given their identifier offline (no need to query Telegram anymore).</p> -<p><strong>In short</strong>, we are making an application that performs efficient offline queries to Cassandra to print out information about your Telegram conversations given the ID you want to query.</p> -<h2 id="data_model"><a class="anchor" href="#data_model">¶</a>Data model</h2> -<p>The application itself is really simple, and we only need one table to store all the relevant information we will be needing. This table called <code>**users**</code> will contain the following columns:</p> -<ul> -<li><code>**id**</code>, of type <code>int</code>. This will also be the <code>primary key</code> and we’ll use it to query the database later on.</li> -<li><code>**first_name**</code>, of type <code>varchar</code>. This field contains the first name of the stored user.</li> -<li><code>**last_name**</code>, of type <code>varchar</code>. This field contains the last name of the stored user.</li> -<li><code>**username**</code>, of type <code>varchar</code>. This field contains the username of the stored user. -Because Cassandra uses a <a href="https://cassandra.apache.org/doc/latest/architecture/overview.html">wide column storage model</a>, direct access through a key is the most efficient way to query the database. In our case, the key is the primary key of the <code>users</code> table, using the <code>id</code> column. The index for the primary key is ready to be used as soon as we create the table, so we don’t need to create it on our own.</li> -</ul> -<h2 id="dependencies"><a class="anchor" href="#dependencies">¶</a>Dependencies</h2> -<p>Because we will program it in Python, you need Python installed. You can install it using a package manager of your choice or heading over to the <a href="https://www.python.org/downloads/">Python downloads section</a>, but if you’re on Linux, chances are you have it installed already.</p> -<p>Once Python 3.5 or above is installed, get a copy of the Cassandra driver for Python and Telethon through <code>pip</code>:</p> -<pre><code>pip install cassandra-driver telethon -</code></pre> -<p>For more details on that, see the <a href="https://docs.datastax.com/en/developer/python-driver/3.22/installation/">installation guide for <code>cassandra-driver</code></a>, or the <a href="https://docs.telethon.dev/en/latest/basic/installation.html">installation guide for <code>telethon</code></a>.</p> -<p>As we did in our <a href="/blog/mdad/cassandra-operaciones-basicas-y-arquitectura/">previous post</a>, we will setup a new keyspace for this application with <code>cqlsh</code>. We will also create a table to store the users into. This could all be automated in the Python code, but because it’s a one-time thing, we prefer to use <code>cqlsh</code>.</p> -<p>Make sure that Cassandra is running in the background. We can’t make queries to it if it’s not running.</p> -<pre><code>$ bin/cqlsh -Connected to Test Cluster at 127.0.0.1:9042. -[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4] -Use HELP for help. -cqlsh&gt; create keyspace mdad with replication = {'class': 'SimpleStrategy', 'replication_factor': 3}; -cqlsh&gt; use mdad; -cqlsh:mdad&gt; create table users(id int primary key, first_name varchar, last_name varchar, username varchar); -</code></pre> -<p>Python installed? Check. Python dependencies? Check. Cassandra ready? Check.</p> -<h2 id="the_code"><a class="anchor" href="#the_code">¶</a>The code</h2> -<h3 id="getting_users"><a class="anchor" href="#getting_users">¶</a>Getting users</h3> -<p>The first step is connecting to <a href="https://core.telegram.org/api">Telegram’s API</a>, for which we’ll use <a href="https://telethon.dev/">Telethon</a>, a wonderful (wink, wink) Python library to interface with it.</p> -<p>As with most APIs, we need to supply <a href="https://my.telegram.org/">our API key</a> in order to use it (here <code>API_ID</code> and <code>API_HASH</code>). We will refer to them as constants. At the end, you may download the entire code and use my own key for this example. But please don’t use those values for your other applications!</p> -<p>It’s pretty simple: we create a client, and for every dialog (that is, open conversation) we have, do some checks:</p> -<ul> -<li>If it’s an user, we just store that in a dictionary mapping <code>ID → User</code>.</li> -<li>Else if it’s a group, we iterate over the participants and store those users instead.</li> -</ul> -<pre><code>async def load_users(): - from telethon import TelegramClient - - users = {} - - async with TelegramClient(SESSION, API_ID, API_HASH) as client: - async for dialog in client.iter_dialogs(): - if dialog.is_user: - user = dialog.entity - users[user.id] = user - print('found user:', user.id, file=sys.stderr) - - elif dialog.is_group: - async for user in client.iter_participants(dialog): - users[user.id] = user - print('found member:', user.id, file=sys.stderr) - - return list(users.values()) -</code></pre> -<p>With this we have a mapping ID to user, so we know we won’t have duplicates. We simply return the list of user values, because that’s all we care about.</p> -<h3 id="saving_users"><a class="anchor" href="#saving_users">¶</a>Saving users</h3> -<p>Inserting users into Cassandra is pretty straightforward. We take the list of <code>User</code> objects as input, and prepare a new <code>INSERT</code> statement that we can reuse (because we will be using it in a loop, this is the best way to do it).</p> -<p>For each user, execute the statement with the user data as input parameters. Simple as that.</p> -<pre><code>def save_users(session, users): - insert_stmt = session.prepare( - 'INSERT INTO users (id, first_name, last_name, username) ' - 'VALUES (?, ?, ?, ?)') - - for user in users: - row = (user.id, user.first_name, user.last_name, user.username) - session.execute(insert_stmt, row) -</code></pre> -<h3 id="fetching_users"><a class="anchor" href="#fetching_users">¶</a>Fetching users</h3> -<p>Given a list of users, yield all of them from the database. Similar to before, we prepare a <code>SELECT</code> statement and just execute it repeatedly over the input user IDs.</p> -<pre><code>def fetch_users(session, users): - select_stmt = session.prepare('SELECT * FROM users WHERE id = ?') - - for user_id in users: - yield session.execute(select_stmt, (user_id,)).one() -</code></pre> -<h3 id="parsing_arguments"><a class="anchor" href="#parsing_arguments">¶</a>Parsing arguments</h3> -<p>We’ll be making a little CLI application, so we need to parse console arguments. It won’t be anything fancy, though. For that we’ll be using <a href="https://docs.python.org/3/library/argparse.html">Python’s <code>argparse</code> module</a>:</p> -<pre><code>def parse_args(): - import argparse - - parser = argparse.ArgumentParser( - description='Dump and query Telegram users') - - parser.add_argument('users', type=int, nargs='*', - help='one or more user IDs to query for') - - parser.add_argument('--load-users', action='store_true', - help='load users from Telegram (do this first run)') - - return parser.parse_args() -</code></pre> -<h3 id="all_together"><a class="anchor" href="#all_together">¶</a>All together</h3> -<p>Last, the entry point. We import a Cassandra Cluster, and connect to some default keyspace (we called it <code>mdad</code> earlier).</p> -<p>If the user wants to load the users into the database, we’ll do just that first.</p> -<p>Then, for each user we fetch from the database, we print it. Last names and usernames are optional, so don’t print those if they’re missing (<code>None</code>).</p> -<pre><code>async def main(args): - from cassandra.cluster import Cluster - - cluster = Cluster(CLUSTER_NODES) - session = cluster.connect(KEYSPACE) - - if args.load_users: - users = await load_users() - save_users(session, users) - - for user in fetch_users(session, args.users): - print('User', user.id, ':') - print(' First name:', user.first_name) - if user.last_name: - print(' Last name:', user.last_name) - if user.username: - print(' Username:', user.username) - - print() - -if __name__ == '__main__': - asyncio.run(main(parse_args())) -</code></pre> -<p>Because Telethon is an <code>[asyncio](https://docs.python.org/3/library/asyncio.html)</code> library, we define it as <code>async def main(...)</code> and run it with <code>asyncio.run(main(...))</code>.</p> -<p>Here’s what it looks like in action:</p> -<pre><code>$ python data.py --help -usage: data.py [-h] [--load-users] [users [users ...]] - -Dump and query Telegram users - -positional arguments: - users one or more user IDs to query for - -optional arguments: - -h, --help show this help message and exit - --load-users load users from Telegram (do this first run) - -$ python data.py --load-users -found user: 487158 -found member: 59794114 -found member: 487158 -found member: 191045991 -(...a lot more output) - -$ python data.py 487158 59794114 -User 487158 : - First name: Rick - Last name: Pickle - -User 59794114 : - Firt name: Peter - Username: pete -</code></pre> -<p>Telegram’s data now persists in Cassandra, and we can efficiently query it whenever we need to! I would’ve shown a video presenting its usage, but I’m afraid that would leak some of the data I want to keep private :-).</p> -<p>Feel free to download the code and try it yourself:</p> -<p><em>download removed</em></p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://docs.datastax.com/en/developer/python-driver/3.22/getting_started/">DataStax Python Driver for Apache Cassandra – Getting Started</a></li> -<li><a href="https://docs.telethon.dev/en/latest/">Telethon’s Documentation</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Introduction to Hadoop and its MapReduce</title><id>dist/introduction-to-hadoop-and-its-mapreduce/index.html</id><updated>2020-03-31T22:00:00+00:00</updated><published>2020-03-29T22:00:00+00:00</published><summary>Hadoop is an open-source, free, Java-based programming framework that helps processing large datasets in a distributed environment and the problems that arise when trying to harness the knowledge from BigData, capable of running on thousands of nodes and dealing with petabytes of data. It is based on Google File System (GFS) and originated from the work on the Nutch open-source project on search engines.</summary><content type="html" src="dist/introduction-to-hadoop-and-its-mapreduce/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Introduction to Hadoop and its MapReduce</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Hadoop is an open-source, free, Java-based programming framework that helps processing large datasets in a distributed environment and the problems that arise when trying to harness the knowledge from BigData, capable of running on thousands of nodes and dealing with petabytes of data. It is based on Google File System (GFS) and originated from the work on the Nutch open-source project on search engines.</p> -<div class="date-created-modified">Created 2020-03-30<br> -Modified 2020-04-01</div> -<p>Hadoop also offers a distributed filesystem (HDFS) enabling for fast transfer among nodes, and a way to program with MapReduce.</p> -<p>It aims to strive for the 4 V’s: Volume, Variety, Veracity and Velocity. For veracity, it is a secure environment that can be trusted.</p> -<h2 class="title" id="milestones"><a class="anchor" href="#milestones">¶</a>Milestones</h2> -<p>The creators of Hadoop are Doug Cutting and Mike Cafarella, who just wanted to design a search engine, Nutch, and quickly found the problems of dealing with large amounts of data. They found their solution with the papers Google published.</p> -<p>The name comes from the plush of Cutting’s child, a yellow elephant.</p> -<ul> -<li>In July 2005, Nutch used GFS to perform MapReduce operations.</li> -<li>In February 2006, Nutch started a Lucene subproject which led to Hadoop.</li> -<li>In April 2007, Yahoo used Hadoop in a 1 000-node cluster.</li> -<li>In January 2008, Apache took over and made Hadoop a top-level project.</li> -<li>In July 2008, Apache tested a 4000-node cluster. The performance was the fastest compared to other technologies that year.</li> -<li>In May 2009, Hadoop sorted a petabyte of data in 17 hours.</li> -<li>In December 2011, Hadoop reached 1.0.</li> -<li>In May 2012, Hadoop 2.0 was released with the addition of YARN (Yet Another Resource Navigator) on top of HDFS, splitting MapReduce and other processes into separate components, greatly improving the fault tolerance.</li> -</ul> -<p>From here onwards, many other alternatives have born, like Spark, Hive &amp; Drill, Kafka, HBase, built around the Hadoop ecosystem.</p> -<p>As of 2017, Amazon has clusters between 1 and 100 nodes, Yahoo has over 100 000 CPUs running Hadoop, AOL has clusters with 50 machines, and Facebook has a 320-machine (2 560 cores) and 1.3PB of raw storage.</p> -<h2 id="why_not_use_rdbms_"><a class="anchor" href="#why_not_use_rdbms_">¶</a>Why not use RDBMS?</h2> -<p>Relational database management systems simply cannot scale horizontally, and vertical scaling will require very expensive servers. Similar to RDBMS, Hadoop has a notion of jobs (analogous to transactions), but without ACID or concurrency control. Hadoop supports any form of data (unstructured or semi-structured) in read-only mode, and failures are common but there’s a simple yet efficient fault tolerance.</p> -<p>So what problems does Hadoop solve? It solves the way we should think about problems, and distributing them, which is key to do anything related with BigData nowadays. We start working with clusters of nodes, and coordinating the jobs between them. Hadoop’s API makes this really easy.</p> -<p>Hadoop also takes very seriously the loss of data with replication, and if a node falls, they are moved to a different node.</p> -<h2 id="major_components"><a class="anchor" href="#major_components">¶</a>Major components</h2> -<p>The previously-mentioned HDFS runs on commodity machine, which are cost-friendly. It is very fault-tolerant and efficient enough to process huge amounts of data, because it splits large files into smaller chunks (or blocks) that can be more easily handled. Multiple nodes can work on multiple chunks at the same time.</p> -<p>NameNode stores the metadata of the various datablocks (map of blocks) along with their location. It is the brain and the master in Hadoop’s master-slave architecture, also known as the namespace, and makes use of the DataNode.</p> -<p>A secondary NameNode is a replica that can be used if the first NameNode dies, so that Hadoop doesn’t shutdown and can restart.</p> -<p>DataNode stores the blocks of data, and are the slaves in the architecture. This data is split into one or more files. Their only job is to manage this access to the data. They are often distributed among racks to avoid data lose.</p> -<p>JobTracker creates and schedules jobs from the clients for either map or reduce operations.</p> -<p>TaskTracker runs MapReduce tasks assigned to the current data node.</p> -<p>When clients need data, they first interact with the NameNode and replies with the location of the data in the correct DataNode. Client proceeds with interaction with the DataNode.</p> -<h2 id="mapreduce"><a class="anchor" href="#mapreduce">¶</a>MapReduce</h2> -<p>MapReduce, as the name implies, is split into two steps: the map and the reduce. The map stage is the «divide and conquer» strategy, while the reduce part is about combining and reducing the results.</p> -<p>The mapper has to process the input data (normally a file or directory), commonly line-by-line, and produce one or more outputs. The reducer uses all the results from the mapper as its input to produce a new output file itself.</p> -<p><img src="bitmap.png" alt="" /></p> -<p>When reading the data, some may be junk that we can choose to ignore. If it is valid data, however, we label it with a particular type that can be useful for the upcoming process. Hadoop is responsible for splitting the data accross the many nodes available to execute this process in parallel.</p> -<p>There is another part to MapReduce, known as the Shuffle-and-Sort. In this part, types or categories from one node get moved to a different node. This happens with all nodes, so that every node can work on a complete category. These categories are known as «keys», and allows Hadoop to scale linearly.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://youtu.be/oT7kczq5A-0">YouTube – Hadoop Tutorial For Beginners | What Is Hadoop? | Hadoop Tutorial | Hadoop Training | Simplilearn</a></li> -<li><a href="https://youtu.be/bcjSe0xCHbE">YouTube – Learn MapReduce with Playing Cards</a></li> -<li><a href="https://youtu.be/j8ehT1_G5AY?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">YouTube – Video Post #2: Hadoop para torpes (I)-¿Qué es y para qué sirve?</a></li> -<li><a href="https://youtu.be/NQ8mjVPCDvk?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">Video Post #3: Hadoop para torpes (II)-¿Cómo funciona? HDFS y MapReduce</a></li> -<li><a href="https://hadoop.apache.org/old/releases.html">Apache Hadoop Releases</a></li> -<li><a href="https://youtu.be/20qWx2KYqYg?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">Video Post #4: Hadoop para torpes (III y fin)- Ecosistema y distribuciones</a></li> -<li><a href="http://www.hadoopbook.com/">Chapter 2 – Hadoop: The Definitive Guide, Fourth Edition</a> (<a href="http://grut-computing.com/HadoopBook.pdf">pdf,</a><a href="http://www.hadoopbook.com/code.html">code</a>)</li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Data Warehousing and OLAP</title><id>dist/data-warehousing-and-olap/index.html</id><updated>2020-03-31T22:00:00+00:00</updated><published>2020-03-22T23:00:00+00:00</published><summary>Business intelligence (BI) refers to systems used to gain insights from data, traditionally taken from relational databases and being used to build a data warehouse. Performance and scalability are key aspects of BI systems.</summary><content type="html" src="dist/data-warehousing-and-olap/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Data Warehousing and OLAP</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Business intelligence (BI) refers to systems used to gain insights from data, traditionally taken from relational databases and being used to build a data warehouse. Performance and scalability are key aspects of BI systems.</p> -<div class="date-created-modified">Created 2020-03-23<br> -Modified 2020-04-01</div> -<p>Commonly, the data in the warehouse is a transformation of the original, operational data into a form better suited for reporting and analysis.</p> -<p>This whole process is known as Online Analytical Processing (OLAP), and is different to the approach taken by relational databases, which is known as Online Transaction Processing (OLTP) and is optimized for individual transactions. OLAP is based on multidimensional databases simply by the way it works.</p> -<p>The Business Intelligence Semantic Model (BISM) refers to the different semantics in which data can be accessed and queried.</p> -<p>On the one hand, MDX is the language used for Microsoft’s BISM of multidimensional mode, and on the other, DAX is the language of tabular mode, based on Excel’s formula language and designed to be easy to use by those familiar with Excel.</p> -<h2 class="title" id="types_of_data"><a class="anchor" href="#types_of_data">¶</a>Types of data</h2> -<p>The business data is often called detail data or <em>fact</em> data, goes in a de-normalized table called the fact table. The term «facts» literally refers to the facts, such as number of products sold and amount received for products sold. Different tables will often represent different dimensions of the data, where «dimensions» simply means different ways to look at the data.</p> -<p>Data can also be referred to as measures, because most of it is numbers and subject to aggregations. By measures, we refer to these values and numbers.</p> -<p>Multidimensional databases are formed with separate fact and dimension tables, grouped to create a «cube» with both facts and dimensions.</p> -<h2 id="places_to_store_data"><a class="anchor" href="#places_to_store_data">¶</a>Places to store data</h2> -<p>Three different terms are often heard when talking about the places where data is stored: data lakes, data warehouses, and data marts. All of these have different target users, cost, size and growth.</p> -<p>The data lake contains <strong>all</strong> the data generated by your business. Nothing is filtered out, not even cancelled or invalid transactions. If there are future plans to use the data, or a need to analyze it in various ways, a data lake is often necessary.</p> -<p>The data warehouse contains <strong>structured</strong> data, or has already been modelled. It’s also multi-purpose, but often of a lot smaller scale. Operational users are able to easily evaluate reports or analyze performance here, since it is built for their needs.</p> -<p>The data mart contains a <strong>small portion</strong> of the data, and is often part of data warehouses themselves. It can be seen as a subsection built for specific departments, and as a benefit, users get isolated security and performance. The data here is clean, and subject-oriented.</p> -<h2 id="ways_to_store_data"><a class="anchor" href="#ways_to_store_data">¶</a>Ways to store data</h2> -<p>Data is often stored de-normalized, because it would not be feasible to store otherwise.</p> -<p>There are two main techniques to implement data warehouses, known as Inmon approach and Kimball approach. They are named after Ralph Kimball <em>et al.</em> for their work on «The Data Warehouse Lifecycle Toolkit», and Bill Inmon <em>et al.</em> for their work on «Corporate Information Factory» respectively.</p> -<p>When several independent systems identify and store data in different ways, we face what’s known as the problem of the stovepipe. Something as simple as trying to connect these systems or use their data in a warehouse results in an overly complicated system.</p> -<p>To tackle this issue, Kimball advocates the use of «conformed dimensions», that is, some dimensions will be «of interest», and have the same attributes and rollups (or at least a subset) in different data marts. This way, warehouses contain dimensional databases to ease analysis in the data marts it is composed of, and users query the warehouse.</p> -<p>The Inmon approach on the other hand has the warehouse laid out in third normal form, and users query the data marts, not the warehouse (so the data marts are dimensional in nature).</p> -<h2 id="key_takeaways"><a class="anchor" href="#key_takeaways">¶</a>Key takeaways</h2> -<ul> -<li>«BI» stands for «Business Intelligence» and refers to the system that <em>perform</em> data analysis.</li> -<li>«BISM» stands for «Business Intelligence Semantic Model», and Microsoft has two languages to query data: MDX and DAX.</li> -<li>«OLAP» stands for «Online Analytical Processing», and «OLTP» for «Online Transaction Processing».</li> -<li>Data mart, warehouse and lake refer to places at different scales and with different needs to store data.</li> -<li>Inmon and Kimbal are different ways to implement data warehouses.</li> -<li>Data facts contains various measures arranged into different dimensions, which together form a data cube.</li> -</ul> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://media.wiley.com/product_data/excerpt/03/11181011/1118101103-157.pdf">Chapter 1 – Professional Microsoft SQL Server 2012 Analysis Services with MDX and DAX (Harinath et al., 2012)</a></li> -<li><a href="https://youtu.be/m_DzhW-2pWI">YouTube – Data Mining in SQL Server Analysis Services</a></li> -<li>Almacenes de Datos y Procesamiento Analítico On-Line (Félix R.)</li> -<li><a href="https://youtu.be/qkJOace9FZg">YouTube – What are Dimensions and Measures?</a></li> -<li><a href="https://www.holistics.io/blog/data-lake-vs-data-warehouse-vs-data-mart/">Data Lake vs Data Warehouse vs Data Mart</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Cassandra: Introducción</title><id>dist/cassandra-introduccion/index.html</id><updated>2020-03-29T22:00:00+00:00</updated><published>2020-03-04T23:00:00+00:00</published><summary>Este es el primer post en la serie sobre Cassandra, en el cuál introduciremos dicha bases de datos NoSQL y veremos sus características e instalación.</summary><content type="html" src="dist/cassandra-introduccion/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Cassandra: Introducción</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p><img src="1200px-Cassandra_logo.png" alt="" /></p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-30</div> -<p>Este es el primer post en la serie sobre Cassandra, en el cuál introduciremos dicha bases de datos NoSQL y veremos sus características e instalación.</p> -<p>Otros posts en esta serie:</p> -<ul> -<li><a href="/blog/mdad/cassandra-introduccion/">Cassandra: Introducción</a> (este post)</li> -<li><a href="/blog/mdad/cassandra-operaciones-basicas-y-arquitectura/">Cassandra: Operaciones Básicas y Arquitectura</a></li> -</ul> -<p>Este post está hecho en colaboración con un compañero.</p> -<hr /> -<h2 class="title" id="finalidad_de_la_tecnología"><a class="anchor" href="#finalidad_de_la_tecnología">¶</a>Finalidad de la tecnología</h2> -<p>Apache Cassandra es una base de datos NoSQL distribuida y de código abierto (<a href="https://github.com/apache/cassandra">con un espejo en GitHub</a>). Su filosofía es de tipo «clave-valor», y puede manejar grandes volúmenes de datos</p> -<p>Entre sus objetivos, busca ser escalable horizontalmente (puede replicarse en varios centros manteniendo la latencia baja) y alta disponibilidad sin ceder en rendimiento.</p> -<h2 id="cómo_funciona"><a class="anchor" href="#cómo_funciona">¶</a>Cómo funciona</h2> -<p>Instancias de Cassandra se distribuyen en nodos iguales (es decir, no hay maestro-esclavo) que se comunican entre sí (P2P). De este modo, da buen soporte entre varios centros de datos, con redundancia y réplicas síncronas.</p> -<p><img src="multiple-data-centers-and-data-replication-in-cassandra.jpg" alt="" /></p> -<p>Con respecto al modelo de datos, Cassandra particiona las filas con el objetivo de re-organizarla a lo largo distintas tablas. Como clave primaria, se usa un primer componente conocido como «clave de la partición». Dentro de cada partición, las filas se agrupan según el resto de columnas de la clave. Cualquier otra columna se puede indexar independientemente de la clave primaria.</p> -<p>Las tablas se pueden crear, borrar, actualizar y consultar sin bloqueos. No hay soporte para JOIN o subconsultas, pero Cassandra prefiere de-normalizar los datos haciendo uso de características como coleciones.</p> -<p>Para realizar las operaciones sobre cassandra se usa CQL (Cassandra Query Language), que tiene una sintaxis muy similar a SQL.</p> -<h2 id="características"><a class="anchor" href="#características">¶</a>Características</h2> -<p>Como ya hemos mencionado antes, la arquitectura de Cassandra es <strong>decentralizada</strong>. No tiene un único punto que pudiera fallar porque todos los nodos son iguales (sin maestros), y por lo tanto, cualquiera puede dar servicio a la petición.</p> -<p>Los datos se encuentran <strong>replicados</strong> entre los distintos nodos del clúster (lo que ofrece gran <strong>tolerancia a fallos</strong> sin necesidad de interrumpir la aplicación), y es trivial <strong>escalar</strong> añadiendo más nodos al sistema.</p> -<p>El nivel de <strong>consistencia</strong> para lecturas y escrituras es configurable.</p> -<p>Siendo de la familia Apache, Cassandra ofrece integración con Apache Hadoop para tener soporte MapReduce.</p> -<h2 id="arista_dentro_del_teorema_cap"><a class="anchor" href="#arista_dentro_del_teorema_cap">¶</a>Arista dentro del Teorema CAP</h2> -<p>Cassandra se encuentra dentro de la esquina «AP» junto con CouchDB y otros, porque garantiza tanto la disponibilidad como la tolerancia a fallos.</p> -<p>Sin embargo, puede configurarse como un sistema «CP» si se prefiere respetar la consistencia en todo momento.</p> -<p><img src="0.jpeg" alt="" /></p> -<h2 id="descarga"><a class="anchor" href="#descarga">¶</a>Descarga</h2> -<p>Se pueden seguir las instrucciones de la página oficial para <a href="https://cassandra.apache.org/download/">descargar Cassandra</a>. Para ello, se debe clicar en la <a href="https://www.apache.org/dyn/closer.lua/cassandra/3.11.6/apache-cassandra-3.11.6-bin.tar.gz">última versión para descargar el archivo</a>. En nuestro caso, esto es el enlace nombrado «3.11.6», versión que utilizamos.</p> -<h2 id="instalación"><a class="anchor" href="#instalación">¶</a>Instalación</h2> -<p>Cassandra no ofrece binarios para Windows, por lo que usaremos Linux para instalarlo. En nuestro caso, tenemos un sistema Linux Mint (derivado de Ubuntu), pero una máquina virtual con cualquier Linux debería funcionar.</p> -<p>Debemos asegurarnos de tener Java y Python 2 instalado mediante el siguiente comando:</p> -<pre><code>apt install openjdk-8-jdk openjdk-8-jre python2.7 -</code></pre> -<p>Para verificar que la instalación ha sido correcta, podemos mostrar las versiones de los programas:</p> -<pre><code>$ java -version -openjdk version &quot;1.8.0_242&quot; -OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08) -OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode) - -$ python2 --version -Python 2.7.17 -</code></pre> -<p>Una vez las dependencias estén instaladas, extraemos el fichero descargado o bien mediante la interfaz gráfica de nuestro sistema, o bien mediante un comando:</p> -<pre><code>tar xf apache-cassandra-3.11.6-bin.tar.gz -</code></pre> -<p>Y finalmente, lanzar la ejecución de Cassandra:</p> -<pre><code>apache-cassandra-3.11.6/bin/cassandra -</code></pre> -<p>Es posible que tarde un poco en abrirse, pero luego debería haber muchas líneas de log indicando. Para apagar el servidor, simplemente basta con pulsar <code>Ctrl+C</code>.</p> -<h2 id="referencias"><a class="anchor" href="#referencias">¶</a>Referencias</h2> -<ul> -<li><a href="https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/">Apache Cassandra Architecture Fundamentals – The Distributed SQL Blog</a></li> -<li><a href="https://cassandra.apache.org/">Apache Cassandra</a></li> -<li><a href="https://www.datastax.com/blog/2019/05/how-apache-cassandratm-balances-consistency-availability-and-performance">How Apache Cassandra™ Balances Consistency, Availability, and Performance – Datasax</a></li> -<li><a href="https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/">Apache Cassandra Architecture Fundamentals</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Privado: NoSQL evaluation</title><id>dist/nosql-evaluation/index.html</id><updated>2020-03-27T23:00:00+00:00</updated><published>2020-03-15T23:00:00+00:00</published><summary>This evaluation is based on the criteria for the first delivery described by Trabajos en grupo sobre Bases de Datos NoSQL.</summary><content type="html" src="dist/nosql-evaluation/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: NoSQL evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This evaluation is based on the criteria for the first delivery described by Trabajos en grupo sobre Bases de Datos NoSQL.</p> -<div class="date-created-modified">Created 2020-03-16<br> -Modified 2020-03-28</div> -<p>I have chosen to evaluate the following people and works:</p> -<ul> -<li>a12: Classmate (username) with Druid.</li> -<li>a21: Classmate (username) with Neo4J.</li> -</ul> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s Evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post evaluated is Bases de datos NoSQL – Apache Druid – Primera entrega.</p> -<p>It is a very well-written, complete post, with each section meeting one of the points in the required criteria. The only thing that bothered me a little is the abuse of strong emphasis in the text, which I found quite distracting. However, the content deserves the highest grading.</p> -<h2 id="classmate_s_evaluation_2"><a class="anchor" href="#classmate_s_evaluation_2">¶</a>Classmate’s Evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post evaluated is Bases de datos NoSQL – Neo4j – Primera entrega.</p> -<p>Well-written post, although a bit smaller than Classmate’s, but that’s not really an issue. It still talks about everything it should talk and includes photos to go along the text which help. There is no noticeable wrong things in it, so it gets the highest grading as well.</p> -</main> -</body> -</html> - </content></entry><entry><title>Mining of Massive Datasets</title><id>dist/mining-of-massive-datasets/index.html</id><updated>2020-03-27T23:00:00+00:00</updated><published>2020-03-15T23:00:00+00:00</published><summary>In this post we will talk about the Chapter 1 of the book Mining of Massive Datasets Leskovec, J. et al., available online, and I will summarize and share my thoughts on it.</summary><content type="html" src="dist/mining-of-massive-datasets/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Mining of Massive Datasets</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>In this post we will talk about the Chapter 1 of the book Mining of Massive Datasets Leskovec, J. et al., available online, and I will summarize and share my thoughts on it.</p> -<div class="date-created-modified">Created 2020-03-16<br> -Modified 2020-03-28</div> -<p>Data mining often refers to the discovery of models for data, where the model can be for statistics, machine learning, summarizing, extracting features, or other computational approaches to perform complex queries on the data.</p> -<p>Commonly, problems related to data mining involve discovering unusual events hidden in massive data sets. There is another problem when trying to achieve Total Information Awareness (TIA), though, a project that was proposed by the Bush administration but shut down. The problem is, if you look at so much data, and try to find activities that look like (for example) terrorist behavior, inevitably one will find other illicit activities that are not terrorism with bad consequences. So it is important to narrow the activities we are looking for, in this case.</p> -<p>When looking at data, even completely random data, for a certain event type, the event will likely occur. With more data, it will occur more times. However, these are bogus results. The Bonferroni correction gives a statistically sound way to avoid most of these bogus results, however, the Bonferroni’s Principle can be used as an informal version to achieve the same thing.</p> -<p>For that, we calculate the expected number of occurrences of the events you are looking for on the assumption that data is random. If this number is way larger than the number of real instances one hoped to find, then nearly everything will be Bogus.</p> -<hr /> -<p>When analysing documents, some words will be more important than others, and can help determine the topic of the document. One could think the most repeated words are the most important, but that’s far from the truth. The most common words are the stop-words, which carry no meaning, reason why we should remove them prior to processing. We are mostly looking for rare nouns.</p> -<p>There are of course formal measures for how concentrated into relatively few documents are the occurrences of a given word, known as TF.IDF (Term Frequency times In-verse Document Frequency). We won’t go into details on how to compute it, because there are multiple ways.</p> -<p>Hash functions are also frequently used, because they can turn hash keys into a bucket number (the index of the bucket where this hash key belongs). They «randomize» and spread the universe of keys into a smaller number of buckets, useful for storage and access.</p> -<p>An index is an efficient structure to query for values given a key, and can be built with hash functions and buckets.</p> -<p>Having all of these is important when analysing documents when doing data mining, because otherwise it would take far too long.</p> -</main> -</body> -</html> - </content></entry><entry><title>MongoDB: Operaciones Básicas y Arquitectura</title><id>dist/mongodb-operaciones-basicas-y-arquitectura/index.html</id><updated>2020-03-19T23:00:00+00:00</updated><published>2020-03-04T23:00:00+00:00</published><summary>Este es el segundo post en la serie sobre MongoDB, con una breve descripción de las operaciones básicas (tales como inserción, recuperación e indexado), y ejecución por completo junto con el modelo de datos y arquitectura.</summary><content type="html" src="dist/mongodb-operaciones-basicas-y-arquitectura/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>MongoDB: Operaciones Básicas y Arquitectura</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Este es el segundo post en la serie sobre MongoDB, con una breve descripción de las operaciones básicas (tales como inserción, recuperación e indexado), y ejecución por completo junto con el modelo de datos y arquitectura.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-20</div> -<p>Otros posts en esta serie:</p> -<ul> -<li><a href="/blog/mdad/mongodb-introduction/">MongoDB: Introducción</a></li> -<li><a href="/blog/mdad/mongodb-operaciones-basicas-y-arquitectura/">MongoDB: Operaciones Básicas y Arquitectura</a> (este post)</li> -</ul> -<p>Este post está hecho en colaboración con un compañero, y en él veremos algunos ejemplos de las operaciones básicas (<a href="https://stackify.com/what-are-crud-operations/">CRUD</a>) sobre MongoDB.</p> -<hr /> -<p>Empezaremos viendo cómo creamos una nueva base de datos dentro de MongoDB y una nueva colección donde poder insertar nuestros documentos.</p> -<h2 class="title" id="creación_de_una_base_de_datos_e_inserción_de_un_primer_documento"><a class="anchor" href="#creación_de_una_base_de_datos_e_inserción_de_un_primer_documento">¶</a>Creación de una base de datos e inserción de un primer documento</h2> -<p>Podemos ver las bases de datos que tenemos disponibles ejecutando el comando:</p> -<pre><code>&gt; show databases -admin 0.000GB -config 0.000GB -local 0.000GB -</code></pre> -<p>Para crear una nueva base de datos, o utilizar una de las que tenemos creadas ejecutamos <code>use</code> junto con el nombre que le vamos a dar:</p> -<pre><code>&gt; use new_DB -switched to db new_DB -</code></pre> -<p>Una vez hecho esto, podemos ver que si volvemos a ejecutar «show databases», la nueva base de datos no aparece. Esto es porque para que Mongo registre una base de datos en la lista de las existentes, necesitamos insertar al menos un nuevo documento en una colección de esta. Lo podemos hacer de la siguiente forma:</p> -<pre><code>&gt; db.movie.insert({&quot;name&quot;:&quot;tutorials point&quot;}) -WriteResult({ &quot;nInserted&quot; : 1 }) - -&gt; show databases -admin 0.000GB -config 0.000GB -local 0.000GB -movie 0.000GB -</code></pre> -<p>Al igual que podemos ver las bases de datos existentes, también podemos consultar las colecciones que existen dentro de estas. Siguiendo la anterior ejecución, si ejecutamos:</p> -<pre><code>&gt; show collections -movie -</code></pre> -<h3 id="borrar_base_de_datos"><a class="anchor" href="#borrar_base_de_datos">¶</a>Borrar base de datos</h3> -<p>Para borrar una base de datos tenemos que ejecutar el siguiente comando:</p> -<pre><code>&gt; db.dropDatabase() -{ &quot;dropped&quot; : &quot;new_DB&quot;, &quot;ok&quot; : 1 } -</code></pre> -<h3 id="crear_colección"><a class="anchor" href="#crear_colección">¶</a>Crear colección</h3> -<p>Para crear una colección podemos hacerlo de dos formas. O bien mediante el comando:</p> -<pre><code>db.createCollection(&lt;nombre de la colección&gt;, opciones) -</code></pre> -<p>Donde el primer parámetro es el nombre que le queremos asignar a la colección, y los siguientes, todos opcionales, pueden ser (entre otros):</p> -<table class=""> - <thead> - <tr> - <th> - Campo - </th> - <th> - Tipo - </th> - <th> - Descripción - </th> - </tr> - </thead> - <tbody> - <tr> - <td> - <code> - capped - </code> - </td> - <td> - Booleano - </td> - <td> - Si es - <code> - true - </code> - , - permite una colección limitada. Una colección limitada es una colección - de tamaño fijo que sobrescribe automáticamente sus entradas más -antiguas cuando alcanza su tamaño máximo. Si especifica - <code> - true - </code> - , también debe especificar el parámetro de - <code> - size - </code> - . - </td> - </tr> - <tr> - <td> - <code> - autoIndexId - </code> - </td> - <td> - Booleano - </td> - <td> - Si es - <code> - true - </code> - crea automáticamente un índice en el campo - <code> - _id - </code> - . Por defecto es - <code> - false - </code> - </td> - </tr> - <tr> - <td> - <code> - size - </code> - </td> - <td> - Número - </td> - <td> - Especifica el tamaño máximo en bytes para una colección limitada. Es obligatorio si el campo - <code> - capped - </code> - está a - <code> - true - </code> - . - </td> - </tr> - <tr> - <td> - <code> - max - </code> - </td> - <td> - Número - </td> - <td> - Especifica el número máximo de documentos que están permitidos en la colección limitada. - </td> - </tr> - </tbody> -</table> -<pre><code>&gt; use test -switched to db test - -&gt; db.createCollection(&quot;mycollection&quot;) -{ &quot;ok&quot; : 1 } - -&gt; db.createCollection(&quot;mycol&quot;, {capped : true, autoIndexId: true, size: 6142800, max: 10000}) -{ - &quot;note&quot; : &quot;the autoIndexId option is deprecated and will be removed in a future release&quot;, - &quot;ok&quot; : 1 -} - -&gt; show collections -mycol -mycollection -</code></pre> -<p>Como se ha visto anteriormente al crear la base de datos, podemos insertar un documento en una colección sin que la hayamos creado anteriormente. Esto es porque MongoDB crea automáticamente una colección cuando insertas algún documento en ella:</p> -<pre><code>&gt; db.tutorialspoint.insert({&quot;name&quot;:&quot;tutorialspoint&quot;}) -WriteResult({ &quot;nInserted&quot; : 1 }) - -&gt; show collections -mycol -mycollection -tutorialspoint -</code></pre> -<h3 id="borrar_colección"><a class="anchor" href="#borrar_colección">¶</a>Borrar colección</h3> -<p>Para borrar una colección basta con situarnos en la base de datos que la contiene, y ejecutar lo siguiente:</p> -<pre><code>db.&lt;nombre_de_la_colección&gt;.drop() -</code></pre> -<pre><code>&gt; db.mycollection.drop() -true - -&gt; show collections -mycol -tutorialspoint -</code></pre> -<h3 id="insertar_documento"><a class="anchor" href="#insertar_documento">¶</a>Insertar documento</h3> -<p>Para insertar datos en una colección de MongoDB necesitaremos usar el método <code>insert()</code> o <code>save()</code>.</p> -<p>Ejemplo del método <code>insert</code>:</p> -<pre><code>&gt; db.colection.insert({ -... title: 'Esto es una prueba para MDAD', -... description: 'MongoDB es una BD no SQL', -... by: 'Classmate and Me', -... tags: ['mongodb', 'database'], -... likes: 100 -... }) -WriteResults({ &quot;nInserted&quot; : 1 }) -</code></pre> -<p>En este ejemplo solo se ha insertado un único documento, pero podemos insertar los que queramos separándolos de la siguiente forma:</p> -<pre><code>db.collection.insert({documento}, {documento2}, {documento3}) -</code></pre> -<p>No hace falta especificar un ID ya que el propio mongo asigna un ID a cada documento automáticamente, aunque nos da la opción de poder asignarle uno mediante el atributo <code>_id</code> en la inserción de los datos</p> -<p>Como se indica en el título de este apartado también se puede insertar mediante el método <code>db.coleccion.save(documento)</code>, funcionando este como el método <code>insert</code>.</p> -<h3 id="método_"><a class="anchor" href="#método_">¶</a>Método <code>find()</code></h3> -<p>El método find en MongoDB es el que nos permite realizar consultas a las colecciones de nuestra base de datos:</p> -<pre><code>db.&lt;nombre_de_la_colección&gt;.find() -</code></pre> -<p>Este método mostrará de una forma no estructurada todos los documentos de la colección. Si le añadimos la función <code>pretty</code> a este método, se mostrarán de una manera más «bonita».</p> -<pre><code>&gt; db.colection.find() -{ &quot;_id&quot;: ObjectId(&quot;5e738f0989f85a7eafdf044a&quot;), &quot;title&quot; : &quot;Esto es una prueba para MDAD&quot;, &quot;description&quot; : &quot;MongoDB es una BD no SQL&quot;, &quot;by&quot; : &quot;Classmate and Me&quot;, &quot;tags&quot; : [ &quot;mongodb&quot;, &quot;database&quot; ], &quot;likes&quot; : 100 } - -&gt; db.colection.find().pretty() -{ - &quot;_id&quot;: ObjectId(&quot;5e738f0989f85a7eafdf044a&quot;), - &quot;title&quot; : &quot;Esto es una prueba para MDAD&quot;, - &quot;description&quot; : &quot;MongoDB es una BD no SQL&quot;, - &quot;by&quot; : &quot;Classmate and Me&quot;, - &quot;tags&quot; : [ - &quot;mongodb&quot;, - &quot;database&quot; - ], - &quot;likes&quot; : 100 -} -</code></pre> -<p>Los equivalentes del <code>where</code> en las bases de datos relacionales son:</p> -<table class=""> - <thead> - <tr> - <th> - Operación - </th> - <th> - Sintaxis - </th> - <th> - Ejemplo - </th> - <th> - Equivalente en RDBMS - </th> - </tr> - </thead> - <tbody> - <tr> - <td> - Igual - </td> - <td> - <code> - {&lt;clave&gt;:&lt;valor&gt;} - </code> - </td> - <td> - <code> - db.mycol.find({"by":"Classmate and Me"}) - </code> - </td> - <td> - <code> - where by = 'Classmate and Me' - </code> - </td> - </tr> - <tr> - <td> - Menor que - </td> - <td> - <code> - {&lt;clave&gt;:{$lt:&lt;valor&gt;}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$lt:60}}) - </code> - </td> - <td> - <code> - where likes &lt; 60 - </code> - </td> - </tr> - <tr> - <td> - Menor o igual que - </td> - <td> - <code> - {&lt;clave&gt;:{$lte:&lt;valor&gt;}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$lte:60}}) - </code> - </td> - <td> - <code> - where likes &lt;= 60 - </code> - </td> - </tr> - <tr> - <td> - Mayor que - </td> - <td> - <code> - {&lt;clave&gt;:{$gt:&lt;valor&gt;}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$gt:60}}) - </code> - </td> - <td> - <code> - where likes &gt; 60 - </code> - </td> - </tr> - <tr> - <td> - Mayor o igual que - </td> - <td> - <code> - {&lt;clave&gt;:{$gte:&lt;valor&gt;}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$gte:60}}) - </code> - </td> - <td> - <code> - where likes &gt;= 60 - </code> - </td> - </tr> - <tr> - <td> - No igual - </td> - <td> - <code> - {&lt;clave&gt;:{$ne:&lt;valor&gt;}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$ne:60}}) - </code> - </td> - <td> - <code> - where likes != 60 - </code> - </td> - </tr> - </tbody> -</table> -<p>En el método <code>find()</code> podemos añadir condiciones AND y OR de la siguiente manera:</p> -<pre><code>(AND) -&gt; db.colection.find({$and:[{&quot;by&quot;:&quot;Classmate and Me&quot;},{&quot;title&quot;: &quot;Esto es una prueba para MDAD&quot;}]}).pretty() - -(OR) -&gt; db.colection.find({$or:[{&quot;by&quot;:&quot;Classmate and Me&quot;},{&quot;title&quot;: &quot;Esto es una prueba para MDAD&quot;}]}).pretty() - -(Ambos a la vez) -&gt; db.colection.find({&quot;likes&quot;: {$gt:10}, $or: [{&quot;by&quot;: &quot;Classmate and Me&quot;}, {&quot;title&quot;: &quot;Esto es una prueba para MDAD&quot;}]}).pretty() -</code></pre> -<p>La última llamada con ambos a la vez equivalente en una consulta SQL a:</p> -<pre><code>where likes&gt;10 AND (by = 'Classmate and Me' OR title = 'Esto es una prueba para MDAD') -</code></pre> -<h3 id="actualizar_un_documento"><a class="anchor" href="#actualizar_un_documento">¶</a>Actualizar un documento</h3> -<p>En MongoDB se hace utilizando el método <code>update</code>:</p> -<pre><code>db.&lt;nombre_colección&gt;.update(&lt;criterio_de_selección&gt;, &lt;dato_actualizado&gt;) -</code></pre> -<p>Para este ejemplo vamos a actualizar el documento que hemos insertado en el apartado anterior:</p> -<pre><code>&gt; db.colection.update({'title':'Esto es una prueba para MDAD'},{$set:{'title':'Título actualizado'}}) -WriteResult({ &quot;nMatched&quot; : 1, &quot;nUpserted&quot; : 0, &quot;nModified&quot; : 1 }) -&gt; db.colection.find().pretty() -{ - &quot;_id&quot;: ObjectId(&quot;5e738f0989f85a7eafdf044a&quot;), - &quot;title&quot; : &quot;Título actualizado&quot;, - &quot;description&quot; : &quot;MongoDB es una BD no SQL&quot;, - &quot;by&quot; : &quot;Classmate and Me&quot;, - &quot;tags&quot; : [ - &quot;mongodb&quot;, - &quot;database&quot; - ], - &quot;likes&quot; : 100 -} -</code></pre> -<p>Anteriormente se ha mencionado el método <code>save()</code> para la inserción de documentos, pero también podemos utilizarlo para sustituir documentos enteros por uno nuevo:</p> -<pre><code>&gt; db.&lt;nombre_de_la_colección&gt;.save({_id:ObjectId(), &lt;nuevo_documento&gt;}) -</code></pre> -<p>Con nuestro documento:</p> -<pre><code>&gt; db.colection.save( -... { -... &quot;_id&quot;: ObjectId(&quot;5e738f0989f85a7eafdf044a&quot;), &quot;title&quot;: &quot;Este es el nuevo título&quot;, &quot;by&quot;: &quot;MDAD&quot; -... } -... ) -WriteResult({ &quot;nMatched&quot; : 1, &quot;nUpserted&quot; : 0, &quot;nModified&quot; : 1 }) - -&gt; db.colection.find() -{ - &quot;_id&quot;: ObjectId(&quot;5e738f0989f85a7eafdf044a&quot;), - &quot;title&quot;: &quot;Este es el nuevo título&quot;, - &quot;by&quot;: &quot;MDAD&quot; -} -</code></pre> -<h3 id="borrar_documento"><a class="anchor" href="#borrar_documento">¶</a>Borrar documento</h3> -<p>Para borrar un documento utilizaremos el método <code>remove()</code> de la siguiente manera:</p> -<pre><code>db.&lt;nombre_de_la_colección&gt;.remove(&lt;criterio_de_borrado&gt;) -</code></pre> -<p>Considerando la colección del apartado anterior borraremos el único documento que tenemos:</p> -<pre><code>&gt; db.colection.remove({'title': 'Este es el nuevo título'}) -WriteResult({ &quot;nRemoved&quot; : 1 }) -&gt; db.colection.find().pretty() -&gt; -</code></pre> -<p>Para borrar todos los documentos de una colección usamos:</p> -<pre><code>db.&lt;colección&gt;.remove({}) -</code></pre> -<h3 id="indexación"><a class="anchor" href="#indexación">¶</a>Indexación</h3> -<p>MongDB nos permite crear índices sobre atributos de una colección de la siguiente forma:</p> -<pre><code>db.&lt;colección&gt;.createIndex( {&lt;atributo&gt;:&lt;opciones&gt;}) -</code></pre> -<p>Como ejemplo:</p> -<pre><code>&gt; db.mycol.createIndex({&quot;title&quot;:1}) -{ - &quot;createdCollectionAutomatically&quot; : false, - &quot;numIndexesBefore&quot; : 1, - &quot;numIndexesAfter&quot; : 2, - &quot;ok&quot; : 1 -} -</code></pre> -<p>Si queremos más de un atributo en el índice lo haremos así:</p> -<pre><code>&gt; db.mycol.ensureIndex({&quot;title&quot;:1,&quot;description&quot;:-1}) -</code></pre> -<p>Los valores que puede tomar son <code>+1</code> para ascendente o <code>-1</code> para descendente.</p> -<h3 id="referencias"><a class="anchor" href="#referencias">¶</a>Referencias</h3> -<ul> -<li>Manual MongoDB. (n.d.). <a href="https://docs.mongodb.com/manual/">https://docs.mongodb.com/manual/</a></li> -<li>MongoDB Tutorial – Tutorialspoint. (n.d.). – <a href="https://www.tutorialspoint.com/mongodb/index.htm">https://www.tutorialspoint.com/mongodb/index.htm</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>MongoDB: Introducción</title><id>dist/mongodb-introduction/index.html</id><updated>2020-03-19T23:00:00+00:00</updated><published>2020-03-04T23:00:00+00:00</published><summary>Este es el primer post en la serie sobre Mongo, en el cuál introduciremos dicha bases de datos NoSQL y veremos sus características e instalación.</summary><content type="html" src="dist/mongodb-introduction/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>MongoDB: Introducción</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Este es el primer post en la serie sobre Mongo, en el cuál introduciremos dicha bases de datos NoSQL y veremos sus características e instalación.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-20</div> -<p>Otros posts en esta serie:</p> -<ul> -<li><a href="/blog/mdad/mongodb-introduction/">MongoDB: Introducción</a> (este post)</li> -<li><a href="/blog/mdad/mongodb-operaciones-basicas-y-arquitectura/">MongoDB: Operaciones Básicas y Arquitectura</a></li> -</ul> -<p>Este post está hecho en colaboración con un compañero.</p> -<hr /> -<p><img src="0LRP4__jIIkJ-0gl8j2RDzWscL1Rto-NwvdqzmYk0jmYBIVbJ78n1ZLByPgV.png" alt="" /></p> -<h2 class="title" id="definición"><a class="anchor" href="#definición">¶</a>Definición</h2> -<p>MongoDB es una base de datos orientada a documentos. Esto quiere decir que en lugar de guardar los datos en registros, guarda los datos en documentos. Estos documentos son almacenados en BSON, que es una representación binaria de JSON. Una de las principales diferencias respecto a las bases de datos relacionales es que no necesita seguir ningún esquema, los documentos de una misma colección pueden tener esquemas diferentes.</p> -<p>MongoDB está escrito en C++, aunque las consultas se hacen pasando objetos JSON como parámetro.</p> -<pre><code>{ - &quot;_id&quot; : ObjectId(&quot;52f602d787945c344bb4bda5&quot;), - &quot;name&quot; : &quot;Tyrion&quot;, - &quot;hobbies&quot; : [ - &quot;books&quot;, - &quot;girls&quot;, - &quot;wine&quot; - ], - &quot;friends&quot; : [ - { - &quot;name&quot; : &quot;Bronn&quot;, - &quot;ocuppation&quot; : &quot;sellsword&quot; - }, - { - &quot;name&quot; : &quot;Shae&quot;, - &quot;ocuppation&quot; : &quot;handmaiden&quot; - } - ] - } -</code></pre> -<h2 id="características"><a class="anchor" href="#características">¶</a>Características</h2> -<p><img src="WxZenSwSsimGvXVu5XH4cFUd3kr3Is_arrdSZGX8Hi0Ligqgw_ZTvGSIeXZm.png" alt="" /></p> -<p>MongoDB alcanza un balance perfecto entre rendimiento y funcionalidad gracias a su sistema de consulta de contenidos. Pero sus características principales no se limitan solo a esto, también cuenta con otras que lo posicionan como el preferido de muchos desarrolladores de aplicaciones como aplicaciones móviles, gaming, logging o e-commerce.</p> -<p>Algunas de las principales características de esta base de datos son:</p> -<ul> -<li>Almacenamiento orientado a documentos (documentos JSON con esquemas dinámicos).</li> -<li>Soporte Full index: puede crear índices sobre cualquier atributo y añadir múltiples índices secundarios.</li> -<li>Replicación y alta disponibilidad: espejos entre LANs y WANs.</li> -<li>Auto-Sharding: escalabilidad horizontal sin comprometer la funcionalidad, está limitada, actualmente, a 20 nodos, aunque el objetivo es alcanzar una cifra cercana a los 1000.</li> -<li>Consultas ricas y basadas en documentos.</li> -<li>Rápidas actualizaciones en el contexto.</li> -<li>Soporte comercial, capacitación y consultoría disponibles.</li> -<li>También puede ser utilizada para el almacenamiento de archivos aprovechando la capacidad de MongoDB para el balanceo de carga y la replicación de datos.</li> -</ul> -<p>En cuanto a la arquitectura, podríamos decir que divide en tres partes: las bases de datos, las colecciones y los documentos (que contienen los campos de cada entrada).</p> -<ul> -<li><strong>Base de datos</strong>: cada una de las bases de datos tiene un conjunto propio de archivos en el sistema de archivos con diversas bases de datos existentes en un solo servidor.</li> -<li><strong>Colección</strong>: un conjunto de documentos de base de datos. El equivalente RDBMS de la colección es una tabla. Toda colección existe dentro de una única base de datos.</li> -<li><strong>Documento</strong>: un conjunto de pares clave/valor. Los documentos están asociados con esquemas dinámicos. La ventaja de tener esquemas dinámicos es que el documento en una sola colección no tiene que tener la misma estructura o campos. </li> -</ul> -<h2 id="arista_dentro_del_teorema_cap"><a class="anchor" href="#arista_dentro_del_teorema_cap">¶</a>Arista dentro del Teorema CAP</h2> -<p><img src="t73Q1t-HXfWij-Q1o5AYEnO39Kz2oyLLCdQz6lWQQPaSQWamlDMjmptAn97h.png" alt="" /></p> -<p>MongoDB es CP por defecto, es decir, garantiza consistencia y tolerancia a particiones (fallos). Pero también podemos configurar el nivel de consistencia, eligiendo el número de nodos a los que se replicarán los datos. O podemos configurar si se pueden leer datos de los nodos secundarios (en MongoDB solo hay un servidor principal, que es el único que acepta inserciones o modificaciones). Si permitimos leer de un nodo secundario mediante la replicación, sacrificamos consistencia, pero ganamos disponibilidad.</p> -<h2 id="descarga_e_instalación"><a class="anchor" href="#descarga_e_instalación">¶</a>Descarga e instalación</h2> -<h3 id="windows"><a class="anchor" href="#windows">¶</a>Windows</h3> -<p>Descargar el archivo desde <a href="https://www.mongodb.com/download-center#production">https://www.mongodb.com/download-center#production</a></p> -<ol> -<li>Doble clic en el archivo <code>.msi</code></li> -<li>El instalador de Windows lo guía a través del proceso de instalación. -Si elige la opción de instalación personalizada, puede especificar un directorio de instalación. -MongoDB no tiene ninguna otra dependencia del sistema. Puede instalar y ejecutar MongoDB desde cualquier carpeta que elija.</li> -<li>Ejecutar el <code>.exe</code> que hemos instalado.</li> -</ol> -<h3 id="linux"><a class="anchor" href="#linux">¶</a>Linux</h3> -<p>Abrimos una terminal y ejecutamos:</p> -<pre><code>sudo apt-get update -sudo apt install -y mongodb-org -</code></pre> -<p>Luego comprobamos el estado del servicio:</p> -<pre><code>sudo systemctl start mongod -sudo systemctl status mongod -</code></pre> -<p>Finalmente ejecutamos la base de datos con el comando:</p> -<pre><code>sudo mongo -</code></pre> -<h3 id="macos"><a class="anchor" href="#macos">¶</a>macOS</h3> -<p>Abrimos una terminal y ejecutamos:</p> -<pre><code>brew update -brew install mongodb -</code></pre> -<p>Iniciamos el servicio:</p> -<pre><code>brew services start mongodb -</code></pre> -<h2 id="referencias"><a class="anchor" href="#referencias">¶</a>Referencias</h2> -<ul> -<li><a href="https://expertoenbigdata.com/que-es-mongodb/#La_arquitectura_de_MongoDB">Todo lo que debes saber sobre MongoDB</a></li> -<li><a href="https://www.ecured.cu/MongoDB">MongoDB – EcuRed</a></li> -<li><a href="https://mappinggis.com/2014/07/mongodb-y-gis/">Bases de datos NoSQL, MongoDB y GIS – MappingGIS</a></li> -<li><a href="https://es.slideshare.net/maxfontana90/caractersticas-mongo-db">Características MONGO DB</a></li> -<li><a href="https://openwebinars.net/blog/que-es-mongodb">Qué es MongoDB y características</a></li> -<li><a href="https://www.genbeta.com/desarrollo/mongodb-que-es-como-funciona-y-cuando-podemos-usarlo-o-no">MongoDB. Qué es, cómo funciona y cuándo podemos usarlo (o no)</a></li> -<li><a href="https://docs.mongodb.com/">MongoDB Documentation</a></li> -<li><a href="https://www.genbeta.com/desarrollo/nosql-clasificacion-de-las-bases-de-datos-segun-el-teorema-cap">NoSQL: Clasificación de las bases de datos según el teorema CAP</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Cassandra: Operaciones Básicas y Arquitectura</title><id>dist/cassandra-operaciones-basicas-y-arquitectura/index.html</id><updated>2020-03-19T23:00:00+00:00</updated><published>2020-03-04T23:00:00+00:00</published><summary>Este es el segundo post en la serie sobre Cassandra, con una breve descripción de las operaciones básicas (tales como inserción, recuperación e indexado), y ejecución por completo junto con el modelo de datos y arquitectura.</summary><content type="html" src="dist/cassandra-operaciones-basicas-y-arquitectura/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Cassandra: Operaciones Básicas y Arquitectura</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Este es el segundo post en la serie sobre Cassandra, con una breve descripción de las operaciones básicas (tales como inserción, recuperación e indexado), y ejecución por completo junto con el modelo de datos y arquitectura.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-20</div> -<p>Otros posts en esta serie:</p> -<ul> -<li><a href="/blog/mdad/cassandra-introduccion/">Cassandra: Introducción</a></li> -<li><a href="/blog/mdad/cassandra-operaciones-basicas-y-arquitectura/">Cassandra: Operaciones Básicas y Arquitectura</a> (este post)</li> -</ul> -<p>Este post está hecho en colaboración con un compañero.</p> -<hr /> -<p>Antes de poder ejecutar ninguna consulta, debemos lanzar la base de datos en caso de que no se encuentre en ejecución aún. Para ello, en una terminal, lanzamos el binario de <code>cassandra</code>:</p> -<pre><code>$ cassandra-3.11.6/bin/cassandra -</code></pre> -<p>Sin cerrar esta consola, abrimos otra en la que podamos usar la <a href="https://cassandra.apache.org/doc/latest/tools/cqlsh.html">CQL shell</a>:</p> -<pre><code>$ cassandra-3.11.6/bin/cqlsh -Connected to Test Cluster at 127.0.0.1:9042. -[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4] -Use HELP for help. -cqlsh&gt; -</code></pre> -<h2 class="title" id="crear"><a class="anchor" href="#crear">¶</a>Crear</h2> -<h3 id="crear_una_base_de_datos"><a class="anchor" href="#crear_una_base_de_datos">¶</a>Crear una base de datos</h3> -<p>Cassandra denomina a las «bases de datos» como «espacio de claves» (keyspace en inglés).</p> -<pre><code>cqlsh&gt; create keyspace helloworld with replication = {'class': 'SimpleStrategy', 'replication_factor': 3}; -</code></pre> -<p>Cuando creamos un nuevo <em>keyspace</em>, indicamos el nombre y la estrategia de replicación a usar. Nosotros usamos la estrategia simple con un factor 3 de replicación.</p> -<h3 id="crear_una_tabla"><a class="anchor" href="#crear_una_tabla">¶</a>Crear una tabla</h3> -<p>Una vez estemos dentro de un <em>keyspace</em>, podemos crear tablas. Vamos a crear una tabla llamada «greetings» con identificador (número entero), mensaje (texto) y lenguaje (<code>varchar</code>).</p> -<pre><code>cqlsh&gt; use helloworld; -cqlsh:helloworld&gt; create table greetings(id int primary key, message text, lang varchar); -</code></pre> -<h3 id="crear_una_fila"><a class="anchor" href="#crear_una_fila">¶</a>Crear una fila</h3> -<p>Insertar nuevas filas es similar a otros sistemas gestores de datos, mediante la sentencia <code>INSERT</code>:</p> -<pre><code>cqlsh:helloworld&gt; insert into greetings(id, message, lang) values(1, '¡Bienvenido!', 'es'); -cqlsh:helloworld&gt; insert into greetings(id, message, lang) values(2, 'Welcome!', 'es'); -</code></pre> -<h2 id="leer"><a class="anchor" href="#leer">¶</a>Leer</h2> -<p>La lectura se lleva a cabo mediante la sentencia <code>SELECT</code>:</p> -<pre><code>cqlsh:helloworld&gt; select * from greetings; - - id | lang | message -----+------+-------------- - 1 | es | ¡Bienvenido! - 2 | es | Welcome! - -(2 rows) -</code></pre> -<p><code>cqlsh</code> colorea la salida, lo cuál resulta muy útil para identificar la clave primaria y distintos tipos de datos como texto, cadenas o números:</p> -<p><img src="image.png" alt="" /></p> -<h2 id="actualizar"><a class="anchor" href="#actualizar">¶</a>Actualizar</h2> -<p>La actualización se lleva a cabo con la sentencia <code>UPDATE</code>. Vamos a arreglar el fallo que hemos cometido al insertar «Welcome!» como español:</p> -<pre><code>cqlsh:helloworld&gt; update greetings set lang = 'en' where id = 2; -</code></pre> -<h2 id="indexar"><a class="anchor" href="#indexar">¶</a>Indexar</h2> -<pre><code>cqlsh:helloworld&gt; create index langIndex on greetings(lang); -</code></pre> -<h2 id="borrar"><a class="anchor" href="#borrar">¶</a>Borrar</h2> -<p>Finalmente, el borrado se lleva a cabo con la sentencia <code>DELETE</code>. Es posible borrar solo campos individuales, lo cuál los pone a nulos:</p> -<pre><code>cqlsh:helloworld&gt; delete message from greetings where id = 1; -</code></pre> -<p>Para eliminar la fila entera, basta con no especificar la columna:</p> -<pre><code>cqlsh:helloworld&gt; delete from greetings where id = 1; -</code></pre> -<h2 id="referencias"><a class="anchor" href="#referencias">¶</a>Referencias</h2> -<ul> -<li><a href="https://www.tutorialspoint.com/cassandra/cassandra_create_keyspace.htm">tutorialspoint – Creating a Keyspace using Cqlsh</a></li> -<li><a href="https://www.tutorialspoint.com/cassandra/cassandra_cql_datatypes.htm">tutorialspoint – Cassandra – CQL Datatypes</a></li> -<li><a href="https://www.tutorialspoint.com/cassandra/cassandra_create_table.htm">tutorialspoint – Cassandra – Create Table</a></li> -<li><a href="https://data-flair.training/blogs/cassandra-crud-operation/">Data Flair – Cassandra Crud Operation – Create, Update, Read &amp; Delete</a></li> -<li><a href="https://cassandra.apache.org/doc/latest/cql/indexes.html">Cassandra Documentation – Secondary Indexes</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Visualizing Cáceres’ OpenData</title><id>dist/visualizing-caceres-opendata/index.html</id><updated>2020-03-18T23:00:00+00:00</updated><published>2020-03-08T23:00:00+00:00</published><summary>The city of Cáceres has online services to provide </summary><content type="html" src="dist/visualizing-caceres-opendata/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Visualizing Cáceres’ OpenData</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>The city of Cáceres has online services to provide <a href="http://opendata.caceres.es/">Open Data</a> over a wide range of <a href="http://opendata.caceres.es/dataset">categories</a>, all of which are very interesting to explore!</p> -<div class="date-created-modified">Created 2020-03-09<br> -Modified 2020-03-19</div> -<p>We have chosen two different datasets, and will explore four different ways to visualize the data.</p> -<p>This post is co-authored with Classmate.</p> -<h2 class="title" id="obtain_the_data"><a class="anchor" href="#obtain_the_data">¶</a>Obtain the data</h2> -<p>We are interested in the JSON format for the <a href="http://opendata.caceres.es/dataset/informacion-del-padron-de-caceres-2017">census in 2017</a> and those for the <a href="http://opendata.caceres.es/dataset/vias-urbanas-caceres">vias of the city</a>. This way, we can explore the population and their location in interesting ways! You may follow those two links and select the JSON format under Resources to download it.</p> -<p>Why JSON? We will be using <a href="https://python.org/">Python</a> (3.7 or above) and <a href="https://matplotlib.org/">matplotlib</a> for quick iteration, and loading the data with <a href="https://docs.python.org/3/library/json.html">Python’s <code>json</code> module</a> will be trivial.</p> -<h2 id="implementation"><a class="anchor" href="#implementation">¶</a>Implementation</h2> -<h3 id="imports_and_constants"><a class="anchor" href="#imports_and_constants">¶</a>Imports and constants</h3> -<p>We are going to need a lot of things in this code, such as <code>json</code> to load the data, <code>matplotlib</code> to visualize it, and other data types and type hinting for use in the code.</p> -<p>We also want automatic download of the JSON files if they’re missing, so we add their URLs and download paths as constants.</p> -<pre><code>import json -import re -import os -import sys -import urllib.request -import matplotlib.pyplot as plt -from dataclasses import dataclass -from collections import namedtuple -from datetime import date -from pathlib import Path -from typing import Optional - -CENSUS_URL = 'http://opendata.caceres.es/GetData/GetData?dataset=om:InformacionCENSUS&amp;year=2017&amp;format=json' -VIAS_URL = 'http://opendata.caceres.es/GetData/GetData?dataset=om:Via&amp;format=json' - -CENSUS_JSON = Path('data/demografia/Padrón_Cáceres_2017.json') -VIAS_JSON = Path('data/via/Vías_Cáceres.json') -</code></pre> -<h3 id="data_classes"><a class="anchor" href="#data_classes">¶</a>Data classes</h3> -<p><a href="https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/">Parse, don’t validate</a>. By defining a clear data model, we will be able to tell at a glance what information we have available. It will also be typed, so we won’t be confused as to what is what! Python 3.7 introduces <code>[dataclasses](https://docs.python.org/3/library/dataclasses.html)</code>, which are a wonderful feature to define… well, data classes concisely.</p> -<p>We also have a <code>[namedtuple](https://docs.python.org/3/library/collections.html#collections.namedtuple)</code> for points, because it’s extremely common to represent them as tuples.</p> -<pre><code>Point = namedtuple('Point', 'long lat') - -@dataclass -class Census: - year: int - via: int - count_per_year: dict - count_per_city: dict - count_per_gender: dict - count_per_nationality: dict - time_year: int - -@dataclass -class Via: - name: str - kind: str - code: int - history: Optional[str] - old_name: Optional[str] - length: Optional[float] - start: Optional[Point] - middle: Optional[Point] - end: Optional[Point] - geometry: Optional[list] -</code></pre> -<h3 id="helper_methods"><a class="anchor" href="#helper_methods">¶</a>Helper methods</h3> -<p>We will have a little helper method to automatically download the JSON when missing. This is just for convenience, we could as well just download it manually. But it is fun to automate things.</p> -<pre><code>def ensure_file(file, url): - if not file.is_file(): - print('Downloading', file.name, 'because it was missing...', end='', flush=True, file=sys.stderr) - file.parent.mkdir(parents=True, exist_ok=True) - urllib.request.urlretrieve(url, file) - print(' Done.', file=sys.stderr) -</code></pre> -<h3 id="parsing_the_data"><a class="anchor" href="#parsing_the_data">¶</a>Parsing the data</h3> -<p>I will be honest, parsing Cáceres’ OpenData is a pain in the neck! The official descriptions are huge and not all that helpful. Maybe if one needs documentation for a specific field. But luckily for us, the names are pretty self-descriptive, and we can explore the data to get a feel for what we will find.</p> -<p>We define two methods, one to iterate over <code>Census</code> values, and another to iterate over <code>Via</code> values. Here’s where our friend <code>[re](https://docs.python.org/3/library/re.html)</code> comes in, and oh boy the format of the data…</p> -<p>For example, the year and via identifier are best extracted from the URI! The information is also available in the <code>rdfs_label</code> field, but that’s just a Spanish text! At least the URI will be more reliable… hopefully.</p> -<p>Birth date. They could have used a JSON list, but nah, that would’ve been too simple. Instead, you are given a string separated by semicolons. The values? They could have been dictionaries with names for «year» and «age», but nah! That would’ve been too simple! Instead, you are given strings that look like «2001 (7)», and that’s the year and the count.</p> -<p>The birth place? Sometimes it’s «City (Province) (Count)», but sometimes the province is missing. Gender? Semicolon-separated. And there are only two genders. I know a few people who would be upset just reading this, but it’s not my data, it’s theirs. Oh, and plenty of things are optional. That was a lot of <code>AttributeError: 'NoneType' object has no attribute 'foo'</code> to work through!</p> -<p>But as a reward, we have nicely typed data, and we no longer have to deal with this mess when trying to visualize it. For brevity, we will only be showing how to parse the census data, and not the data for the vias. This post is already long enough on its own.</p> -<pre><code>def iter_census(file): - with file.open() as fd: - data = json.load(fd) - - for row in data['results']['bindings']: - year, via = map(int, row['uri']['value'].split('/')[-1].split('-')) - - count_per_year = {} - for item in row['schema_birthDate']['value'].split(';'): - y, c = map(int, re.match(r'(\d+) \((\d+)\)', item).groups()) - count_per_year[y] = c - - count_per_city = {} - for item in row['schema_birthPlace']['value'].split(';'): - match = re.match(r'([^(]+) \(([^)]+)\) \((\d+)\)', item) - if match: - l, _province, c = match.groups() - else: - l, c = re.match(r'([^(]+) \((\d+)\)', item).groups() - - count_per_city[l] = int(c) - - count_per_gender = {} - for item in row['foaf_gender']['value'].split(';'): - g, c = re.match(r'([^(]+) \((\d+)\)', item).groups() - count_per_gender[g] = int(c) - - count_per_nationality = {} - for item in row['schema_nationality']['value'].split(';'): - match = re.match(r'([^(]+) \((\d+)\)', item) - if match: - g, c = match.groups() - else: - g, _alt_name, c = re.match(r'([^(]+) \(([^)]+)\) \((\d+)\)', item).groups() - - count_per_nationality[g] = int(c) - time_year = int(row['time_year']['value']) - - yield Census( - year=year, - via=via, - count_per_year=count_per_year, - count_per_city=count_per_city, - count_per_gender=count_per_gender, - count_per_nationality=count_per_nationality, - time_year=time_year, - ) -</code></pre> -<h2 id="visualizing_the_data"><a class="anchor" href="#visualizing_the_data">¶</a>Visualizing the data</h2> -<p>Here comes the fun part! After parsing all the desired data from the mentioned JSON files, we plotted the data in four different graphics making use of Python’s <a href="https://matplotlib.org/"><code>matplotlib</code> library.</a> This powerful library helps with the creation of different visualizations in Python.</p> -<h3 id="visualizing_the_genders_in_a_pie_chart"><a class="anchor" href="#visualizing_the_genders_in_a_pie_chart">¶</a>Visualizing the genders in a pie chart</h3> -<p>After seeing that there are only two genders in the data of the census, we, displeased, started work in a chart for it. The pie chart was the best option since we wanted to show only the percentages of each gender. The result looks like this:</p> -<p><img src="pie_chart.png" alt="" /></p> -<p>Pretty straight forward, isn’t it? To display this wonderful graphic, we used the following code:</p> -<pre><code>def pie_chart(ax, data): - lists = sorted(data.items()) - - x, y = zip(*lists) - ax.pie(y, labels=x, autopct='%1.1f%%', - shadow=True, startangle=90) - ax.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle. -</code></pre> -<p>We pass the axis as the input parameter (later we will explain why) and the data collected from the JSON regarding the genders, which are in a dictionary with the key being the labels and the values the tally of each gender. We sort the data and with some unpacking magic we split it into two values: <code>x</code> being the labels and <code>y</code> the amount of each gender.</p> -<p>After that we plot the pie chart with the data and labels from <code>y</code> and <code>x</code>, we specify that we want the percentage with one decimal place with the <code>autopct</code> parameter, we enable shadows for the presentation, and specify the start angle at 90º.</p> -<h3 id="date_tick_labels"><a class="anchor" href="#date_tick_labels">¶</a>Date tick labels</h3> -<p>We wanted to know how many of the living people were born on each year, so we are making a date plot! In the census we have the year each person was born in, and using that information is an easy task after parsing the data (parsing was an important task of this work). The result looks as follows:</p> -<p><img src="date_tick.png" alt="" /></p> -<p>How did we do this? The following code was used:</p> -<pre><code>def date_tick(ax, data): - lists = sorted(data.items()) - - x, y = zip(*lists) - x = [date(year, 1, 1) for year in x] - ax.plot(x, y) -</code></pre> -<p>Again, we pass in an axis and the data related with the year born, we sort it, split it into two lists, being the keys the years and the values the number per year. After that, we put the years in a date format for the plot to be more accurate. Finally, we plot the values into that wonderful graphic.</p> -<h3 id="stacked_bar_chart"><a class="anchor" href="#stacked_bar_chart">¶</a>Stacked bar chart</h3> -<p>We wanted to know if there was any relation between the latitudes and count per gender, so we developed the following code:</p> -<pre><code>def stacked_bar_chart(ax, data): - labels = [] - males = [] - females = [] - - for latitude, genders in data.items(): - labels.append(str(latitude)) - males.append(genders['Male']) - females.append(genders['Female']) - - ax.bar(labels, males, label='Males') - ax.bar(labels, females, bottom=males, label='Females') - - ax.set_ylabel('Counts') - ax.set_xlabel('Latitudes') - ax.legend() -</code></pre> -<p>The key of the data dictionary is the latitude rounded to two decimals, and value is another dictionary, which is composed by the key that is the name of the gender and the value, the number of people per gender. So, in a single entry of the data dictionary we have the latitude and how many people per gender are in that latitude.</p> -<p>We iterate the dictionary to extract the different latitudes and people per gender (because we know only two genders are used, we hardcode it to two lists). Then we plot them putting the <code>males</code> and <code>females</code> lists at the bottom and set the labels of each axis. The result is the following:</p> -<p><img src="stacked_bar_chart-1.png" alt="" /></p> -<h3 id="scatter_plots"><a class="anchor" href="#scatter_plots">¶</a>Scatter plots</h3> -<p>This last graphic was very tricky to get right. It’s incredibly hard to find the extent of a city online! We were getting confused because some of the points were way farther than the centre of Cáceres, and the city background is a bit stretched even if the coordinates appear correct. But in the end, we did a pretty good job on it.</p> -<pre><code>def scatter_map(ax, data): - xs = [] - ys = [] - areas = [] - for (long, lat), count in data.items(): - xs.append(long) - ys.append(lat) - areas.append(count / 100) - - if CACERES_MAP.is_file(): - ax.imshow(plt.imread(str(CACERES_MAP)), extent=CACERES_EXTENT) - else: - print('Note:', CACERES_MAP, 'does not exist, not showing it', file=sys.stderr) - - ax.scatter(xs, ys, areas, alpha=0.1) -</code></pre> -<p>This time, the keys in the data dictionary are points and the values are the total count of people in that point. We use a normal <code>for</code> loop to create the different lists. For the areas on how big the circles we are going to represent will be, we divide the count of people by some number, like <code>100</code>, or otherwise they would be huge.</p> -<p>If the file of the map is present, we render it so that we can get a sense on where the points are, but if the file is missing we print a warning.</p> -<p>At last, we draw the scatter plot with some low alpha value (there’s a lot of overlapping points). The result is <em>absolutely gorgeous</em>. (For some definitions of gorgeous, anyway):</p> -<p><img src="scatter_map.png" alt="" /></p> -<p>Just for fun, here’s what it looks like if we don’t divide the count by 100 and lower the opacity to <code>0.01</code>:</p> -<p><img src="scatter_map-2.png" alt="" /></p> -<p>That’s a big solid blob, and the opacity is only set to <code>0.01</code>!</p> -<h3 id="drawing_all_the_graphs_in_the_same_window"><a class="anchor" href="#drawing_all_the_graphs_in_the_same_window">¶</a>Drawing all the graphs in the same window</h3> -<p>To draw all the graphs in the same window instead of getting four different windows we made use of the <a href="https://matplotlib.org/3.2.0/api/_as_gen/matplotlib.pyplot.subplots.html"><code>subplots</code> function</a>, like this:</p> -<pre><code>fig, axes = plt.subplots(2, 2) -</code></pre> -<p>This will create a matrix of two by two of axes that we store in the axes variable (fitting name!). Following this code are the different calls to the methods commented before, where we access each individual axis and pass it to the methods to draw on:</p> -<pre><code>pie_chart(axes[0, 0], genders) -date_tick(axes[0, 1], years) -stacked_bar_chart(axes[1, 0], latitudes) -scatter_map(axes[1, 1], positions) -</code></pre> -<p>Lastly, we plot the different graphics:</p> -<pre><code>plt.show() -</code></pre> -<p>Wrapping everything together, here’s the result:</p> -<p><img src="figures-1.png" alt="" /></p> -<p>The numbers in some of the graphs are a bit crammed together, but we’ll blame that on <code>matplotlib</code>.</p> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing words</h2> -<p>Wow, that was a long journey! We hope that this post helped you pick some interest in data exploration, it’s such a fun world. We also offer the full download for the code below, because we know it’s quite a bit!</p> -<p>Which of the graphs was your favourite? I personally like the count per date, I think it’s nice to see the growth. Let us know in the comments below!</p> -<p><em>download removed</em></p> -</main> -</body> -</html> - </content></entry><entry><title>What is an algorithm?</title><id>dist/what-is-an-algorithm/index.html</id><updated>2020-03-17T23:00:00+00:00</updated><published>2020-02-24T23:00:00+00:00</published><summary>Algorithms are a sequence of instructions that can be followed to achieve </summary><content type="html" src="dist/what-is-an-algorithm/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>What is an algorithm?</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Algorithms are a sequence of instructions that can be followed to achieve <em>something</em>. That something can be anything, and depends entirely on your problem!</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<p>For example, a recipe to cook some really nice food is an algorithm: it guides you, step by step, to cook something nice. People dealing with mathemathics also apply algorithms to transform their data. And computers <em>love</em> algorithms, too!</p> -<p>In reality, any computer program can basically be thought as an algorithm. It contains a series of instructions for the computer to execute. Running them is a process that takes time, consumes input and produces output. This is also why terms like «procedure» come up when talking about them.</p> -<p>Computer programs (their algorithms) are normally written in some more specific language, like Java or Python. The instructions are very clear here, which is what we need! A natural language like English is a lot harder to process, and ambiguous. I’m sure you’ve been in arguments because the other person didn’t understand you!</p> -<h2 class="title" id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li>algorithm – definition and meaning: <a href="https://www.wordnik.com/words/algorithm">https://www.wordnik.com/words/algorithm</a></li> -<li>Algorithm: <a href="https://en.wikipedia.org/wiki/Algorithm">https://en.wikipedia.org/wiki/Algorithm</a></li> -<li>What is a «computer algorithm»?: <a href="https://computer.howstuffworks.com/what-is-a-computer-algorithm.htm">https://computer.howstuffworks.com/what-is-a-computer-algorithm.htm</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Introduction to NoSQL</title><id>dist/introduction-to-nosql/index.html</id><updated>2020-03-17T23:00:00+00:00</updated><published>2020-02-24T23:00:00+00:00</published><summary>This post will primarly focus on the talk held in the </summary><content type="html" src="dist/introduction-to-nosql/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Introduction to NoSQL</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This post will primarly focus on the talk held in the <a href="https://youtu.be/qI_g07C_Q5I">GOTO 2012 conference: Introduction to NoSQL by Martin Fowler</a>. It can be seen as an informal, summarized transcript of the talk</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<hr /> -<p>The relational database model is affected by the <em><a href="https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch">impedance mismatch problem</a></em>. This occurs because we have to match our high-level design with the separate columns and rows used by relational databases.</p> -<p>Taking the in-memory objects and putting them into a relational database (which were dominant at the time) simply didn’t work out. Why? Relational databases were more than just databases, they served as a an integration mechanism across applications, up to the 2000s. For 20 years!</p> -<p>With the rise of the Internet and the sheer amount of traffic, databases needed to scale. Unfortunately, relational databases only scale well vertically (by upgrading a <em>single</em> node). This is <em>very</em> expensive, and not something many could afford.</p> -<p>The problem are those pesky <code>JOIN</code>‘s, and its friends <code>GROUP BY</code>. Because our program and reality model don’t match the tables used by SQL, we have to rely on them to query the data. It is because the model doesn’t map directly.</p> -<p>Furthermore, graphs don’t map very well at all to relational models.</p> -<p>We needed a way to scale horizontally (by increasing the <em>amount</em> of nodes), something relational databases were not designed to do.</p> -<blockquote> -<p><em>We need to do something different, relational across nodes is an unnatural act</em></p> -</blockquote> -<p>This inspired the NoSQL movement.</p> -<blockquote> -<p><em>#nosql was only meant to be a hashtag to advertise it, but unfortunately it’s how it is called now</em></p> -</blockquote> -<p>It is not possible to define NoSQL, but we can identify some of its characteristics:</p> -<ul> -<li>Non-relational</li> -<li><strong>Cluster-friendly</strong> (this was the original spark)</li> -<li>Open-source (until now, generally)</li> -<li>21st century web culture</li> -<li>Schema-less (easier integration or conjugation of several models, structure aggregation)</li> -</ul> -<p>These databases use different data models to those used by the relational model. However, it is possible to identify 4 broad chunks (some may say 3, or even 2!):</p> -<ul> -<li><strong>Key-value store</strong>. With a certain key, you obtain the value corresponding to it. It knows nothing else, nor does it care. We say the data is opaque.</li> -<li><strong>Document-based</strong>. It stores an entire mass of documents with complex structure, normally through the use of JSON (XML has been left behind). Then, you can ask for certain fields, structures, or portions. We say the data is transparent.</li> -<li><strong>Column-family</strong>. There is a «row key», and within it we store multiple «column families» (columns that fit together, our aggregate). We access by row-key and column-family name.</li> -</ul> -<p>All of these kind of serve to store documents without any <em>explicit</em> schema. Just shove in anything! This gives a lot of flexibility and ease of migration, except… that’s not really true. There’s an <em>implicit</em> schema when querying.</p> -<p>For example, a query where we may do <code>anOrder['price'] * anOrder['quantity']</code> is assuming that <code>anOrder</code> has both a <code>price</code> and a <code>quantity</code>, and that both of these can be multiplied together. «Schema-less» is a fuzzy term.</p> -<p>However, it is the lack of a <em>fixed</em> schema that gives flexibility.</p> -<p>One could argue that the line between key-value and document-based is very fuzzy, and they would be right! Key-value databases often let you include additional metadata that behaves like an index, and in document-based, documents often have an identifier anyway.</p> -<p>The common notion between these three types is what matters. They save an entire structure as an <em>unit</em>. We can refer to these as «Aggregate Oriented Databases». Aggregate, because we group things when designing or modeling our systems, as opposed to relational databases that scatter the information across many tables.</p> -<p>There exists a notable outlier, though, and that’s:</p> -<ul> -<li><strong>Graph</strong> databases. They use a node-and-arc graph structure. They are great for moving on relationships across things. Ironically, relational databases are not very good at jumping across relationships! It is possibly to perform very interesting queries in graph databases which would be really hard and costly on relational models. Unlike the aggregated databases, graphs break things into even smaller units. -NoSQL is not <em>the</em> solution. It depends on how you’ll work with your data. Do you need an aggregate database? Will you have a lot of relationships? Or would the relational model be good fit for you?</li> -</ul> -<p>NoSQL, however, is a good fit for large-scale projects (data will <em>always</em> grow) and faster development (the impedance mismatch is drastically reduced).</p> -<p>Regardless of our choice, it is important to remember that NoSQL is a young technology, which is still evolving really fast (SQL has been stable for <em>decades</em>). But the <em>polyglot persistence</em> is what matters. One must know the alternatives, and be able to choose.</p> -<hr /> -<p>Relational databases have the well-known ACID properties: Atomicity, Consistency, Isolation and Durability.</p> -<p>NoSQL (except graph-based!) are about being BASE instead: Basically Available, Soft state, Eventual consistency.</p> -<p>SQL needs transactions because we don’t want to perform a read while we’re only half-way done with a write! The readers and writers are the problem, and ensuring consistency results in a performance hit, even if the risk is low (two writers are extremely rare but it still must be handled).</p> -<p>NoSQL on the other hand doesn’t need ACID because the aggregate <em>is</em> the transaction boundary. Even before NoSQL itself existed! Any update is atomic by nature. When updating many documents it <em>is</em> a problem, but this is very rare.</p> -<p>We have to distinguish between logical and replication consistency. During an update and if a conflict occurs, it must be resolved to preserve the logical consistency. Replication consistency on the other hand is preserveed when distributing the data across many machines, for example during sharding or copies.</p> -<p>Replication buys us more processing power and resillence (at the cost of more storage) in case some of the nodes die. But what happens if what dies is the communication across the nodes? We could drop the requests and preserve the consistency, or accept the risk to continue and instead preserve the availability.</p> -<p>The choice on whether trading consistency for availability is acceptable or not depends on the domain rules. It is the domain’s choice, the business people will choose. If you’re Amazon, you always want to be able to sell, but if you’re a bank, you probably don’t want your clients to have negative numbers in their account!</p> -<p>Regardless of what we do, in a distributed system, the CAP theorem always applies: Consistecy, Availability, Partitioning-tolerancy (error tolerancy). It is <strong>impossible</strong> to guarantee all 3 at 100%. Most of the times, it does work, but it is mathematically impossible to guarantee at 100%.</p> -<p>A database has to choose what to give up at some point. When designing a distributed system, this must be considered. Normally, the choice is made between consistency or response time.</p> -<h2 class="title" id="further_reading"><a class="anchor" href="#further_reading">¶</a>Further reading</h2> -<ul> -<li><a href="https://www.martinfowler.com/articles/nosql-intro-original.pdf">The future is: <del>NoSQL Databases</del> Polyglot Persistence</a></li> -<li><a href="https://www.thoughtworks.com/insights/blog/nosql-databases-overview">NoSQL Databases: An Overview</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Big Data</title><id>dist/big-data/index.html</id><updated>2020-03-17T23:00:00+00:00</updated><published>2020-02-24T23:00:00+00:00</published><summary>Big Data sounds like a buzzword you may be hearing everywhere, but it’s actually here to stay!</summary><content type="html" src="dist/big-data/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Big Data</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Big Data sounds like a buzzword you may be hearing everywhere, but it’s actually here to stay!</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<h2 class="title" id="what_is_big_data_"><a class="anchor" href="#what_is_big_data_">¶</a>What is Big Data?</h2> -<p>And why is it so important? We use this term to refer to the large amount of data available, rapidly growing every day, that cannot be processed in conventional ways. It’s not only about the amount, it’s also about the variety and rate of growth.</p> -<p>Thanks to technological advancements, there are new ways to process this insane amount of data, which would otherwise be too costly for processing in traditional database systems.</p> -<h2 id="where_does_data_come_from_"><a class="anchor" href="#where_does_data_come_from_">¶</a>Where does data come from?</h2> -<p>It can be pictures in your phone, industry transactions, messages in social networks, a sensor in the mountains. It can come from anywhere, which makes the data very varied.</p> -<p>Just to give some numbers, over 12TB of data is generated on Twitter <em>daily</em>. If you purchase a laptop today (as of March 2020), the disk will be roughly 1TB, maybe 2TB. Twitter would fill 6 of those drives every day!</p> -<p>What about Facebook? It is estimated they store around 100PB of photos and videos. That would be 50000 laptop disks. Not a small number. And let’s not talk about worldwide network traffic…</p> -<h2 id="what_data_can_be_exploited_"><a class="anchor" href="#what_data_can_be_exploited_">¶</a>What data can be exploited?</h2> -<p>So, we have a lot of data. Should we attempt and process everything? We can distinguish several categories.</p> -<ul> -<li><strong>Web and Social Media</strong>: Clickstream Data, Twitter Feeds, Facebook Postings, Web content… Stuff coming from social networks.</li> -<li><strong>Biometrics</strong>: Facial Recognion, Genetics… Any kind of personal recognition.</li> -<li><strong>Machine-to-Machine</strong>: Utility Smart Meter Readings, RFID Readings, Oil Rig Sensor Readings, GPS Signals… Any sensor shared with other machines.</li> -<li><strong>Human Generated</strong>: Call Center Voice Recordings, Email, Electronic Medical Records… Even the voice notes one sends over WhatsApp count.</li> -<li><strong>Big Transaction Data</strong>: Healthcare Claims, Telecommunications Call Detail Records, Utility Billing Records… Financial transactions.</li> -</ul> -<p>But asking what to process is asking the wrong question. Instead, one should think about «What problem am I trying to solve?».</p> -<h2 id="how_to_exploit_this_data_"><a class="anchor" href="#how_to_exploit_this_data_">¶</a>How to exploit this data?</h2> -<p>What are some of the ways to deal with this data? If the problem fits the Map-Reduce paradigm then Hadoop is a great option! Hadoop is inspired by Google File System (GFS), and achieves great parallelism across the nodes of a cluster, and has the following components:</p> -<ul> -<li><strong>Hadoop Distributed File System</strong>. Data is divided into smaller «blocks» and distributed across the cluster, which makes it possible to execute the mapping and reduction in smaller subsets, and makes it possible to scale horizontally.</li> -<li><strong>Hadoop MapReduce</strong>. First, a data set is «mapped» into a different set, and data becomes a list of tuples (key, value). The «reduce» step works on these tuples and combines them into a smaller subset.</li> -<li><strong>Hadoop Common</strong>. These are a set of libraries that ease working with Hadoop.</li> -</ul> -<h2 id="key_insights"><a class="anchor" href="#key_insights">¶</a>Key insights</h2> -<p>Big Data is a field whose goal is to extract information from very large sets of data, and find ways to do so. To summarize its different dimensions, we can refer to what’s known as «the Four V’s of Big Data»:</p> -<ul> -<li><strong>Volume</strong>. Really large quantities.</li> -<li><strong>Velocity</strong>. Processing response time matters!</li> -<li><strong>Variety</strong>. Data comes from plenty of sources.</li> -<li><strong>Veracity.</strong> Can we trust all sources, though?</li> -</ul> -<p>Some sources talk about a fifth V for <strong>Value</strong>; because processing this data is costly, it is important we can get value out of it.</p> -<p>…And some other sources go as high as seven V’s, including <strong>Viability</strong> and <strong>Visualization</strong>. Computers can’t take decissions on their own (yet), a human has to. And they can only do so if they’re presented the data (and visualize it) in a meaningful way.</p> -<h2 id="infographics"><a class="anchor" href="#infographics">¶</a>Infographics</h2> -<p>Let’s see some pictures, we all love pictures:</p> -<p><img src="4-Vs-of-big-data.jpg" alt="" /></p> -<h2 id="common_patterns"><a class="anchor" href="#common_patterns">¶</a>Common patterns</h2> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li>¿Qué es Big Data? – <a href="https://www.ibm.com/developerworks/ssa/local/im/que-es-big-data/">https://www.ibm.com/developerworks/ssa/local/im/que-es-big-data/</a></li> -<li>The Four V’s of Big Data – <a href="https://www.ibmbigdatahub.com/infographic/four-vs-big-data">https://www.ibmbigdatahub.com/infographic/four-vs-big-data</a></li> -<li>Big data – <a href="https://en.wikipedia.org/wiki/Big_data">https://en.wikipedia.org/wiki/Big_data</a></li> -<li>Las 5 V’s del Big Data – <a href="https://www.quanticsolutions.es/big-data/las-5-vs-del-big-data">https://www.quanticsolutions.es/big-data/las-5-vs-del-big-data</a></li> -<li>Las 7 V del Big data: Características más importantes – <a href="https://www.iic.uam.es/innovacion/big-data-caracteristicas-mas-importantes-7-v/#viabilidad">https://www.iic.uam.es/innovacion/big-data-caracteristicas-mas-importantes-7-v/</a></li> -</ul> -</main> -</body> -</html> - </content></entry></feed>
@@ -1,63 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Big Data</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Big Data sounds like a buzzword you may be hearing everywhere, but it’s actually here to stay!</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<h2 class="title" id="what_is_big_data_"><a class="anchor" href="#what_is_big_data_">¶</a>What is Big Data?</h2> -<p>And why is it so important? We use this term to refer to the large amount of data available, rapidly growing every day, that cannot be processed in conventional ways. It’s not only about the amount, it’s also about the variety and rate of growth.</p> -<p>Thanks to technological advancements, there are new ways to process this insane amount of data, which would otherwise be too costly for processing in traditional database systems.</p> -<h2 id="where_does_data_come_from_"><a class="anchor" href="#where_does_data_come_from_">¶</a>Where does data come from?</h2> -<p>It can be pictures in your phone, industry transactions, messages in social networks, a sensor in the mountains. It can come from anywhere, which makes the data very varied.</p> -<p>Just to give some numbers, over 12TB of data is generated on Twitter <em>daily</em>. If you purchase a laptop today (as of March 2020), the disk will be roughly 1TB, maybe 2TB. Twitter would fill 6 of those drives every day!</p> -<p>What about Facebook? It is estimated they store around 100PB of photos and videos. That would be 50000 laptop disks. Not a small number. And let’s not talk about worldwide network traffic…</p> -<h2 id="what_data_can_be_exploited_"><a class="anchor" href="#what_data_can_be_exploited_">¶</a>What data can be exploited?</h2> -<p>So, we have a lot of data. Should we attempt and process everything? We can distinguish several categories.</p> -<ul> -<li><strong>Web and Social Media</strong>: Clickstream Data, Twitter Feeds, Facebook Postings, Web content… Stuff coming from social networks.</li> -<li><strong>Biometrics</strong>: Facial Recognion, Genetics… Any kind of personal recognition.</li> -<li><strong>Machine-to-Machine</strong>: Utility Smart Meter Readings, RFID Readings, Oil Rig Sensor Readings, GPS Signals… Any sensor shared with other machines.</li> -<li><strong>Human Generated</strong>: Call Center Voice Recordings, Email, Electronic Medical Records… Even the voice notes one sends over WhatsApp count.</li> -<li><strong>Big Transaction Data</strong>: Healthcare Claims, Telecommunications Call Detail Records, Utility Billing Records… Financial transactions.</li> -</ul> -<p>But asking what to process is asking the wrong question. Instead, one should think about «What problem am I trying to solve?».</p> -<h2 id="how_to_exploit_this_data_"><a class="anchor" href="#how_to_exploit_this_data_">¶</a>How to exploit this data?</h2> -<p>What are some of the ways to deal with this data? If the problem fits the Map-Reduce paradigm then Hadoop is a great option! Hadoop is inspired by Google File System (GFS), and achieves great parallelism across the nodes of a cluster, and has the following components:</p> -<ul> -<li><strong>Hadoop Distributed File System</strong>. Data is divided into smaller «blocks» and distributed across the cluster, which makes it possible to execute the mapping and reduction in smaller subsets, and makes it possible to scale horizontally.</li> -<li><strong>Hadoop MapReduce</strong>. First, a data set is «mapped» into a different set, and data becomes a list of tuples (key, value). The «reduce» step works on these tuples and combines them into a smaller subset.</li> -<li><strong>Hadoop Common</strong>. These are a set of libraries that ease working with Hadoop.</li> -</ul> -<h2 id="key_insights"><a class="anchor" href="#key_insights">¶</a>Key insights</h2> -<p>Big Data is a field whose goal is to extract information from very large sets of data, and find ways to do so. To summarize its different dimensions, we can refer to what’s known as «the Four V’s of Big Data»:</p> -<ul> -<li><strong>Volume</strong>. Really large quantities.</li> -<li><strong>Velocity</strong>. Processing response time matters!</li> -<li><strong>Variety</strong>. Data comes from plenty of sources.</li> -<li><strong>Veracity.</strong> Can we trust all sources, though?</li> -</ul> -<p>Some sources talk about a fifth V for <strong>Value</strong>; because processing this data is costly, it is important we can get value out of it.</p> -<p>…And some other sources go as high as seven V’s, including <strong>Viability</strong> and <strong>Visualization</strong>. Computers can’t take decissions on their own (yet), a human has to. And they can only do so if they’re presented the data (and visualize it) in a meaningful way.</p> -<h2 id="infographics"><a class="anchor" href="#infographics">¶</a>Infographics</h2> -<p>Let’s see some pictures, we all love pictures:</p> -<p><img src="4-Vs-of-big-data.jpg" alt="" /></p> -<h2 id="common_patterns"><a class="anchor" href="#common_patterns">¶</a>Common patterns</h2> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li>¿Qué es Big Data? – <a href="https://www.ibm.com/developerworks/ssa/local/im/que-es-big-data/">https://www.ibm.com/developerworks/ssa/local/im/que-es-big-data/</a></li> -<li>The Four V’s of Big Data – <a href="https://www.ibmbigdatahub.com/infographic/four-vs-big-data">https://www.ibmbigdatahub.com/infographic/four-vs-big-data</a></li> -<li>Big data – <a href="https://en.wikipedia.org/wiki/Big_data">https://en.wikipedia.org/wiki/Big_data</a></li> -<li>Las 5 V’s del Big Data – <a href="https://www.quanticsolutions.es/big-data/las-5-vs-del-big-data">https://www.quanticsolutions.es/big-data/las-5-vs-del-big-data</a></li> -<li>Las 7 V del Big data: Características más importantes – <a href="https://www.iic.uam.es/innovacion/big-data-caracteristicas-mas-importantes-7-v/#viabilidad">https://www.iic.uam.es/innovacion/big-data-caracteristicas-mas-importantes-7-v/</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,73 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Cassandra: Introducción</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p><img src="1200px-Cassandra_logo.png" alt="" /></p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-30</div> -<p>Este es el primer post en la serie sobre Cassandra, en el cuál introduciremos dicha bases de datos NoSQL y veremos sus características e instalación.</p> -<p>Otros posts en esta serie:</p> -<ul> -<li><a href="/blog/mdad/cassandra-introduccion/">Cassandra: Introducción</a> (este post)</li> -<li><a href="/blog/mdad/cassandra-operaciones-basicas-y-arquitectura/">Cassandra: Operaciones Básicas y Arquitectura</a></li> -</ul> -<p>Este post está hecho en colaboración con un compañero.</p> -<hr /> -<h2 class="title" id="finalidad_de_la_tecnología"><a class="anchor" href="#finalidad_de_la_tecnología">¶</a>Finalidad de la tecnología</h2> -<p>Apache Cassandra es una base de datos NoSQL distribuida y de código abierto (<a href="https://github.com/apache/cassandra">con un espejo en GitHub</a>). Su filosofía es de tipo «clave-valor», y puede manejar grandes volúmenes de datos</p> -<p>Entre sus objetivos, busca ser escalable horizontalmente (puede replicarse en varios centros manteniendo la latencia baja) y alta disponibilidad sin ceder en rendimiento.</p> -<h2 id="cómo_funciona"><a class="anchor" href="#cómo_funciona">¶</a>Cómo funciona</h2> -<p>Instancias de Cassandra se distribuyen en nodos iguales (es decir, no hay maestro-esclavo) que se comunican entre sí (P2P). De este modo, da buen soporte entre varios centros de datos, con redundancia y réplicas síncronas.</p> -<p><img src="multiple-data-centers-and-data-replication-in-cassandra.jpg" alt="" /></p> -<p>Con respecto al modelo de datos, Cassandra particiona las filas con el objetivo de re-organizarla a lo largo distintas tablas. Como clave primaria, se usa un primer componente conocido como «clave de la partición». Dentro de cada partición, las filas se agrupan según el resto de columnas de la clave. Cualquier otra columna se puede indexar independientemente de la clave primaria.</p> -<p>Las tablas se pueden crear, borrar, actualizar y consultar sin bloqueos. No hay soporte para JOIN o subconsultas, pero Cassandra prefiere de-normalizar los datos haciendo uso de características como coleciones.</p> -<p>Para realizar las operaciones sobre cassandra se usa CQL (Cassandra Query Language), que tiene una sintaxis muy similar a SQL.</p> -<h2 id="características"><a class="anchor" href="#características">¶</a>Características</h2> -<p>Como ya hemos mencionado antes, la arquitectura de Cassandra es <strong>decentralizada</strong>. No tiene un único punto que pudiera fallar porque todos los nodos son iguales (sin maestros), y por lo tanto, cualquiera puede dar servicio a la petición.</p> -<p>Los datos se encuentran <strong>replicados</strong> entre los distintos nodos del clúster (lo que ofrece gran <strong>tolerancia a fallos</strong> sin necesidad de interrumpir la aplicación), y es trivial <strong>escalar</strong> añadiendo más nodos al sistema.</p> -<p>El nivel de <strong>consistencia</strong> para lecturas y escrituras es configurable.</p> -<p>Siendo de la familia Apache, Cassandra ofrece integración con Apache Hadoop para tener soporte MapReduce.</p> -<h2 id="arista_dentro_del_teorema_cap"><a class="anchor" href="#arista_dentro_del_teorema_cap">¶</a>Arista dentro del Teorema CAP</h2> -<p>Cassandra se encuentra dentro de la esquina «AP» junto con CouchDB y otros, porque garantiza tanto la disponibilidad como la tolerancia a fallos.</p> -<p>Sin embargo, puede configurarse como un sistema «CP» si se prefiere respetar la consistencia en todo momento.</p> -<p><img src="0.jpeg" alt="" /></p> -<h2 id="descarga"><a class="anchor" href="#descarga">¶</a>Descarga</h2> -<p>Se pueden seguir las instrucciones de la página oficial para <a href="https://cassandra.apache.org/download/">descargar Cassandra</a>. Para ello, se debe clicar en la <a href="https://www.apache.org/dyn/closer.lua/cassandra/3.11.6/apache-cassandra-3.11.6-bin.tar.gz">última versión para descargar el archivo</a>. En nuestro caso, esto es el enlace nombrado «3.11.6», versión que utilizamos.</p> -<h2 id="instalación"><a class="anchor" href="#instalación">¶</a>Instalación</h2> -<p>Cassandra no ofrece binarios para Windows, por lo que usaremos Linux para instalarlo. En nuestro caso, tenemos un sistema Linux Mint (derivado de Ubuntu), pero una máquina virtual con cualquier Linux debería funcionar.</p> -<p>Debemos asegurarnos de tener Java y Python 2 instalado mediante el siguiente comando:</p> -<pre><code>apt install openjdk-8-jdk openjdk-8-jre python2.7 -</code></pre> -<p>Para verificar que la instalación ha sido correcta, podemos mostrar las versiones de los programas:</p> -<pre><code>$ java -version -openjdk version "1.8.0_242" -OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~18.04-b08) -OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode) - -$ python2 --version -Python 2.7.17 -</code></pre> -<p>Una vez las dependencias estén instaladas, extraemos el fichero descargado o bien mediante la interfaz gráfica de nuestro sistema, o bien mediante un comando:</p> -<pre><code>tar xf apache-cassandra-3.11.6-bin.tar.gz -</code></pre> -<p>Y finalmente, lanzar la ejecución de Cassandra:</p> -<pre><code>apache-cassandra-3.11.6/bin/cassandra -</code></pre> -<p>Es posible que tarde un poco en abrirse, pero luego debería haber muchas líneas de log indicando. Para apagar el servidor, simplemente basta con pulsar <code>Ctrl+C</code>.</p> -<h2 id="referencias"><a class="anchor" href="#referencias">¶</a>Referencias</h2> -<ul> -<li><a href="https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/">Apache Cassandra Architecture Fundamentals – The Distributed SQL Blog</a></li> -<li><a href="https://cassandra.apache.org/">Apache Cassandra</a></li> -<li><a href="https://www.datastax.com/blog/2019/05/how-apache-cassandratm-balances-consistency-availability-and-performance">How Apache Cassandra™ Balances Consistency, Availability, and Performance – Datasax</a></li> -<li><a href="https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/">Apache Cassandra Architecture Fundamentals</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,85 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Cassandra: Operaciones Básicas y Arquitectura</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Este es el segundo post en la serie sobre Cassandra, con una breve descripción de las operaciones básicas (tales como inserción, recuperación e indexado), y ejecución por completo junto con el modelo de datos y arquitectura.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-20</div> -<p>Otros posts en esta serie:</p> -<ul> -<li><a href="/blog/mdad/cassandra-introduccion/">Cassandra: Introducción</a></li> -<li><a href="/blog/mdad/cassandra-operaciones-basicas-y-arquitectura/">Cassandra: Operaciones Básicas y Arquitectura</a> (este post)</li> -</ul> -<p>Este post está hecho en colaboración con un compañero.</p> -<hr /> -<p>Antes de poder ejecutar ninguna consulta, debemos lanzar la base de datos en caso de que no se encuentre en ejecución aún. Para ello, en una terminal, lanzamos el binario de <code>cassandra</code>:</p> -<pre><code>$ cassandra-3.11.6/bin/cassandra -</code></pre> -<p>Sin cerrar esta consola, abrimos otra en la que podamos usar la <a href="https://cassandra.apache.org/doc/latest/tools/cqlsh.html">CQL shell</a>:</p> -<pre><code>$ cassandra-3.11.6/bin/cqlsh -Connected to Test Cluster at 127.0.0.1:9042. -[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4] -Use HELP for help. -cqlsh> -</code></pre> -<h2 class="title" id="crear"><a class="anchor" href="#crear">¶</a>Crear</h2> -<h3 id="crear_una_base_de_datos"><a class="anchor" href="#crear_una_base_de_datos">¶</a>Crear una base de datos</h3> -<p>Cassandra denomina a las «bases de datos» como «espacio de claves» (keyspace en inglés).</p> -<pre><code>cqlsh> create keyspace helloworld with replication = {'class': 'SimpleStrategy', 'replication_factor': 3}; -</code></pre> -<p>Cuando creamos un nuevo <em>keyspace</em>, indicamos el nombre y la estrategia de replicación a usar. Nosotros usamos la estrategia simple con un factor 3 de replicación.</p> -<h3 id="crear_una_tabla"><a class="anchor" href="#crear_una_tabla">¶</a>Crear una tabla</h3> -<p>Una vez estemos dentro de un <em>keyspace</em>, podemos crear tablas. Vamos a crear una tabla llamada «greetings» con identificador (número entero), mensaje (texto) y lenguaje (<code>varchar</code>).</p> -<pre><code>cqlsh> use helloworld; -cqlsh:helloworld> create table greetings(id int primary key, message text, lang varchar); -</code></pre> -<h3 id="crear_una_fila"><a class="anchor" href="#crear_una_fila">¶</a>Crear una fila</h3> -<p>Insertar nuevas filas es similar a otros sistemas gestores de datos, mediante la sentencia <code>INSERT</code>:</p> -<pre><code>cqlsh:helloworld> insert into greetings(id, message, lang) values(1, '¡Bienvenido!', 'es'); -cqlsh:helloworld> insert into greetings(id, message, lang) values(2, 'Welcome!', 'es'); -</code></pre> -<h2 id="leer"><a class="anchor" href="#leer">¶</a>Leer</h2> -<p>La lectura se lleva a cabo mediante la sentencia <code>SELECT</code>:</p> -<pre><code>cqlsh:helloworld> select * from greetings; - - id | lang | message -----+------+-------------- - 1 | es | ¡Bienvenido! - 2 | es | Welcome! - -(2 rows) -</code></pre> -<p><code>cqlsh</code> colorea la salida, lo cuál resulta muy útil para identificar la clave primaria y distintos tipos de datos como texto, cadenas o números:</p> -<p><img src="image.png" alt="" /></p> -<h2 id="actualizar"><a class="anchor" href="#actualizar">¶</a>Actualizar</h2> -<p>La actualización se lleva a cabo con la sentencia <code>UPDATE</code>. Vamos a arreglar el fallo que hemos cometido al insertar «Welcome!» como español:</p> -<pre><code>cqlsh:helloworld> update greetings set lang = 'en' where id = 2; -</code></pre> -<h2 id="indexar"><a class="anchor" href="#indexar">¶</a>Indexar</h2> -<pre><code>cqlsh:helloworld> create index langIndex on greetings(lang); -</code></pre> -<h2 id="borrar"><a class="anchor" href="#borrar">¶</a>Borrar</h2> -<p>Finalmente, el borrado se lleva a cabo con la sentencia <code>DELETE</code>. Es posible borrar solo campos individuales, lo cuál los pone a nulos:</p> -<pre><code>cqlsh:helloworld> delete message from greetings where id = 1; -</code></pre> -<p>Para eliminar la fila entera, basta con no especificar la columna:</p> -<pre><code>cqlsh:helloworld> delete from greetings where id = 1; -</code></pre> -<h2 id="referencias"><a class="anchor" href="#referencias">¶</a>Referencias</h2> -<ul> -<li><a href="https://www.tutorialspoint.com/cassandra/cassandra_create_keyspace.htm">tutorialspoint – Creating a Keyspace using Cqlsh</a></li> -<li><a href="https://www.tutorialspoint.com/cassandra/cassandra_cql_datatypes.htm">tutorialspoint – Cassandra – CQL Datatypes</a></li> -<li><a href="https://www.tutorialspoint.com/cassandra/cassandra_create_table.htm">tutorialspoint – Cassandra – Create Table</a></li> -<li><a href="https://data-flair.training/blogs/cassandra-crud-operation/">Data Flair – Cassandra Crud Operation – Create, Update, Read & Delete</a></li> -<li><a href="https://cassandra.apache.org/doc/latest/cql/indexes.html">Cassandra Documentation – Secondary Indexes</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,130 +0,0 @@
-/* containers */ - -body { - background-color: #fffff0; - margin: 0; -} - -main { - max-width: 720px; - margin: 0 auto; - padding: 10px 20px; - background-color: #fffff0; -} - -/* titles and special */ - -h1.title { - text-align: center; - font-family: serif; - font-size: 2.5em; - font-weight: lighter; - font-variant-caps: small-caps; - border-bottom: 4px double #000; -} - -h1, h2 { - padding-bottom: 10px; - border-bottom: 1px solid #000; -} - -h1:not(.title):hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { - opacity: 1; -} - -.anchor { - float: left; - padding-right: 0.4ch; - margin-left: -1.3ch; - opacity: 0; - transition: opacity 150ms; -} - -/* body text */ - -p, li { - font-family: sans-serif; - font-size: 1.1em; - line-height: 1.5; - text-align: justify; -} - -a { - text-decoration: none; - color: #f74c00; - border-bottom: 0 dashed rgba(0, 0, 0, 0); - transition: color 300ms, border-bottom 300ms; -} - -a:hover { - color: #e33b26; - border-bottom: 1px solid #e33b26; -} - -blockquote { - border-left: 4px solid #000; - padding-left: 8px; - font-style: italic; - color: #444; -} - -.footnote:target { - background-color: rgba(255, 255, 0, 0.2); -} - -/* code listing */ - -pre { - background-color: #eee; - padding: 4px; - overflow: auto; - max-height: 480px; -} - -/* tables */ - -table { - border-collapse: collapse; -} - -th { - background-color: #f7f7e8; -} - -th, td { - padding: 0.5em; - border: 1px solid #aaa; -} - -tr:nth-child(even) { - background-color: #f7f7e8; -} - -/* misc */ - -p.time { - text-align: right; - font-style: italic; - color: #777; - font-size: 0.9em; -} - -hr { - border: 0; - border-bottom: 2px dashed #aaa; -} - -kbd { - padding: 3px 5px; - font: 0.9em monospace; - color: #333; - background-color: #fafafa; - border: 1px solid #ddd; - border-radius: 4px; - box-shadow: 0 2px 0 #ddd; -} - -::selection { - background-color: #f74c00; - color: #fff; -}
@@ -1,53 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Data Warehousing and OLAP</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Business intelligence (BI) refers to systems used to gain insights from data, traditionally taken from relational databases and being used to build a data warehouse. Performance and scalability are key aspects of BI systems.</p> -<div class="date-created-modified">Created 2020-03-23<br> -Modified 2020-04-01</div> -<p>Commonly, the data in the warehouse is a transformation of the original, operational data into a form better suited for reporting and analysis.</p> -<p>This whole process is known as Online Analytical Processing (OLAP), and is different to the approach taken by relational databases, which is known as Online Transaction Processing (OLTP) and is optimized for individual transactions. OLAP is based on multidimensional databases simply by the way it works.</p> -<p>The Business Intelligence Semantic Model (BISM) refers to the different semantics in which data can be accessed and queried.</p> -<p>On the one hand, MDX is the language used for Microsoft’s BISM of multidimensional mode, and on the other, DAX is the language of tabular mode, based on Excel’s formula language and designed to be easy to use by those familiar with Excel.</p> -<h2 class="title" id="types_of_data"><a class="anchor" href="#types_of_data">¶</a>Types of data</h2> -<p>The business data is often called detail data or <em>fact</em> data, goes in a de-normalized table called the fact table. The term «facts» literally refers to the facts, such as number of products sold and amount received for products sold. Different tables will often represent different dimensions of the data, where «dimensions» simply means different ways to look at the data.</p> -<p>Data can also be referred to as measures, because most of it is numbers and subject to aggregations. By measures, we refer to these values and numbers.</p> -<p>Multidimensional databases are formed with separate fact and dimension tables, grouped to create a «cube» with both facts and dimensions.</p> -<h2 id="places_to_store_data"><a class="anchor" href="#places_to_store_data">¶</a>Places to store data</h2> -<p>Three different terms are often heard when talking about the places where data is stored: data lakes, data warehouses, and data marts. All of these have different target users, cost, size and growth.</p> -<p>The data lake contains <strong>all</strong> the data generated by your business. Nothing is filtered out, not even cancelled or invalid transactions. If there are future plans to use the data, or a need to analyze it in various ways, a data lake is often necessary.</p> -<p>The data warehouse contains <strong>structured</strong> data, or has already been modelled. It’s also multi-purpose, but often of a lot smaller scale. Operational users are able to easily evaluate reports or analyze performance here, since it is built for their needs.</p> -<p>The data mart contains a <strong>small portion</strong> of the data, and is often part of data warehouses themselves. It can be seen as a subsection built for specific departments, and as a benefit, users get isolated security and performance. The data here is clean, and subject-oriented.</p> -<h2 id="ways_to_store_data"><a class="anchor" href="#ways_to_store_data">¶</a>Ways to store data</h2> -<p>Data is often stored de-normalized, because it would not be feasible to store otherwise.</p> -<p>There are two main techniques to implement data warehouses, known as Inmon approach and Kimball approach. They are named after Ralph Kimball <em>et al.</em> for their work on «The Data Warehouse Lifecycle Toolkit», and Bill Inmon <em>et al.</em> for their work on «Corporate Information Factory» respectively.</p> -<p>When several independent systems identify and store data in different ways, we face what’s known as the problem of the stovepipe. Something as simple as trying to connect these systems or use their data in a warehouse results in an overly complicated system.</p> -<p>To tackle this issue, Kimball advocates the use of «conformed dimensions», that is, some dimensions will be «of interest», and have the same attributes and rollups (or at least a subset) in different data marts. This way, warehouses contain dimensional databases to ease analysis in the data marts it is composed of, and users query the warehouse.</p> -<p>The Inmon approach on the other hand has the warehouse laid out in third normal form, and users query the data marts, not the warehouse (so the data marts are dimensional in nature).</p> -<h2 id="key_takeaways"><a class="anchor" href="#key_takeaways">¶</a>Key takeaways</h2> -<ul> -<li>«BI» stands for «Business Intelligence» and refers to the system that <em>perform</em> data analysis.</li> -<li>«BISM» stands for «Business Intelligence Semantic Model», and Microsoft has two languages to query data: MDX and DAX.</li> -<li>«OLAP» stands for «Online Analytical Processing», and «OLTP» for «Online Transaction Processing».</li> -<li>Data mart, warehouse and lake refer to places at different scales and with different needs to store data.</li> -<li>Inmon and Kimbal are different ways to implement data warehouses.</li> -<li>Data facts contains various measures arranged into different dimensions, which together form a data cube.</li> -</ul> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://media.wiley.com/product_data/excerpt/03/11181011/1118101103-157.pdf">Chapter 1 – Professional Microsoft SQL Server 2012 Analysis Services with MDX and DAX (Harinath et al., 2012)</a></li> -<li><a href="https://youtu.be/m_DzhW-2pWI">YouTube – Data Mining in SQL Server Analysis Services</a></li> -<li>Almacenes de Datos y Procesamiento Analítico On-Line (Félix R.)</li> -<li><a href="https://youtu.be/qkJOace9FZg">YouTube – What are Dimensions and Measures?</a></li> -<li><a href="https://www.holistics.io/blog/data-lake-vs-data-warehouse-vs-data-mart/">Data Lake vs Data Warehouse vs Data Mart</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,178 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Developing a Python application for Cassandra</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p><em><strong>Warning</strong>: this post is, in fact, a shameless self-plug to my own library. If you continue reading, you accept that you are okay with this. Otherwise, please close the tab, shut down your computer, and set it on fire.__(Also, that was a joke. Please don’t do that.)</em></p> -<div class="date-created-modified">Created 2020-03-23<br> -Modified 2020-04-16</div> -<p>Let’s do some programming! Today we will be making a tiny CLI application in <a href="http://python.org/">Python</a> that queries <a href="https://core.telegram.org/api">Telegram’s API</a> and stores the data in <a href="http://cassandra.apache.org/">Cassandra</a>.</p> -<h2 class="title" id="our_goal"><a class="anchor" href="#our_goal">¶</a>Our goal</h2> -<p>Our goal is to make a Python console application. This application will connect to <a href="https://telegram.org/">Telegram</a>, and ask for your account credentials. Once you have logged in, the application will fetch all of your open conversations and we will store these in Cassandra.</p> -<p>With the data saved in Cassandra, we can now very efficiently query information about your conversations given their identifier offline (no need to query Telegram anymore).</p> -<p><strong>In short</strong>, we are making an application that performs efficient offline queries to Cassandra to print out information about your Telegram conversations given the ID you want to query.</p> -<h2 id="data_model"><a class="anchor" href="#data_model">¶</a>Data model</h2> -<p>The application itself is really simple, and we only need one table to store all the relevant information we will be needing. This table called <code>**users**</code> will contain the following columns:</p> -<ul> -<li><code>**id**</code>, of type <code>int</code>. This will also be the <code>primary key</code> and we’ll use it to query the database later on.</li> -<li><code>**first_name**</code>, of type <code>varchar</code>. This field contains the first name of the stored user.</li> -<li><code>**last_name**</code>, of type <code>varchar</code>. This field contains the last name of the stored user.</li> -<li><code>**username**</code>, of type <code>varchar</code>. This field contains the username of the stored user. -Because Cassandra uses a <a href="https://cassandra.apache.org/doc/latest/architecture/overview.html">wide column storage model</a>, direct access through a key is the most efficient way to query the database. In our case, the key is the primary key of the <code>users</code> table, using the <code>id</code> column. The index for the primary key is ready to be used as soon as we create the table, so we don’t need to create it on our own.</li> -</ul> -<h2 id="dependencies"><a class="anchor" href="#dependencies">¶</a>Dependencies</h2> -<p>Because we will program it in Python, you need Python installed. You can install it using a package manager of your choice or heading over to the <a href="https://www.python.org/downloads/">Python downloads section</a>, but if you’re on Linux, chances are you have it installed already.</p> -<p>Once Python 3.5 or above is installed, get a copy of the Cassandra driver for Python and Telethon through <code>pip</code>:</p> -<pre><code>pip install cassandra-driver telethon -</code></pre> -<p>For more details on that, see the <a href="https://docs.datastax.com/en/developer/python-driver/3.22/installation/">installation guide for <code>cassandra-driver</code></a>, or the <a href="https://docs.telethon.dev/en/latest/basic/installation.html">installation guide for <code>telethon</code></a>.</p> -<p>As we did in our <a href="/blog/mdad/cassandra-operaciones-basicas-y-arquitectura/">previous post</a>, we will setup a new keyspace for this application with <code>cqlsh</code>. We will also create a table to store the users into. This could all be automated in the Python code, but because it’s a one-time thing, we prefer to use <code>cqlsh</code>.</p> -<p>Make sure that Cassandra is running in the background. We can’t make queries to it if it’s not running.</p> -<pre><code>$ bin/cqlsh -Connected to Test Cluster at 127.0.0.1:9042. -[cqlsh 5.0.1 | Cassandra 3.11.6 | CQL spec 3.4.4 | Native protocol v4] -Use HELP for help. -cqlsh> create keyspace mdad with replication = {'class': 'SimpleStrategy', 'replication_factor': 3}; -cqlsh> use mdad; -cqlsh:mdad> create table users(id int primary key, first_name varchar, last_name varchar, username varchar); -</code></pre> -<p>Python installed? Check. Python dependencies? Check. Cassandra ready? Check.</p> -<h2 id="the_code"><a class="anchor" href="#the_code">¶</a>The code</h2> -<h3 id="getting_users"><a class="anchor" href="#getting_users">¶</a>Getting users</h3> -<p>The first step is connecting to <a href="https://core.telegram.org/api">Telegram’s API</a>, for which we’ll use <a href="https://telethon.dev/">Telethon</a>, a wonderful (wink, wink) Python library to interface with it.</p> -<p>As with most APIs, we need to supply <a href="https://my.telegram.org/">our API key</a> in order to use it (here <code>API_ID</code> and <code>API_HASH</code>). We will refer to them as constants. At the end, you may download the entire code and use my own key for this example. But please don’t use those values for your other applications!</p> -<p>It’s pretty simple: we create a client, and for every dialog (that is, open conversation) we have, do some checks:</p> -<ul> -<li>If it’s an user, we just store that in a dictionary mapping <code>ID → User</code>.</li> -<li>Else if it’s a group, we iterate over the participants and store those users instead.</li> -</ul> -<pre><code>async def load_users(): - from telethon import TelegramClient - - users = {} - - async with TelegramClient(SESSION, API_ID, API_HASH) as client: - async for dialog in client.iter_dialogs(): - if dialog.is_user: - user = dialog.entity - users[user.id] = user - print('found user:', user.id, file=sys.stderr) - - elif dialog.is_group: - async for user in client.iter_participants(dialog): - users[user.id] = user - print('found member:', user.id, file=sys.stderr) - - return list(users.values()) -</code></pre> -<p>With this we have a mapping ID to user, so we know we won’t have duplicates. We simply return the list of user values, because that’s all we care about.</p> -<h3 id="saving_users"><a class="anchor" href="#saving_users">¶</a>Saving users</h3> -<p>Inserting users into Cassandra is pretty straightforward. We take the list of <code>User</code> objects as input, and prepare a new <code>INSERT</code> statement that we can reuse (because we will be using it in a loop, this is the best way to do it).</p> -<p>For each user, execute the statement with the user data as input parameters. Simple as that.</p> -<pre><code>def save_users(session, users): - insert_stmt = session.prepare( - 'INSERT INTO users (id, first_name, last_name, username) ' - 'VALUES (?, ?, ?, ?)') - - for user in users: - row = (user.id, user.first_name, user.last_name, user.username) - session.execute(insert_stmt, row) -</code></pre> -<h3 id="fetching_users"><a class="anchor" href="#fetching_users">¶</a>Fetching users</h3> -<p>Given a list of users, yield all of them from the database. Similar to before, we prepare a <code>SELECT</code> statement and just execute it repeatedly over the input user IDs.</p> -<pre><code>def fetch_users(session, users): - select_stmt = session.prepare('SELECT * FROM users WHERE id = ?') - - for user_id in users: - yield session.execute(select_stmt, (user_id,)).one() -</code></pre> -<h3 id="parsing_arguments"><a class="anchor" href="#parsing_arguments">¶</a>Parsing arguments</h3> -<p>We’ll be making a little CLI application, so we need to parse console arguments. It won’t be anything fancy, though. For that we’ll be using <a href="https://docs.python.org/3/library/argparse.html">Python’s <code>argparse</code> module</a>:</p> -<pre><code>def parse_args(): - import argparse - - parser = argparse.ArgumentParser( - description='Dump and query Telegram users') - - parser.add_argument('users', type=int, nargs='*', - help='one or more user IDs to query for') - - parser.add_argument('--load-users', action='store_true', - help='load users from Telegram (do this first run)') - - return parser.parse_args() -</code></pre> -<h3 id="all_together"><a class="anchor" href="#all_together">¶</a>All together</h3> -<p>Last, the entry point. We import a Cassandra Cluster, and connect to some default keyspace (we called it <code>mdad</code> earlier).</p> -<p>If the user wants to load the users into the database, we’ll do just that first.</p> -<p>Then, for each user we fetch from the database, we print it. Last names and usernames are optional, so don’t print those if they’re missing (<code>None</code>).</p> -<pre><code>async def main(args): - from cassandra.cluster import Cluster - - cluster = Cluster(CLUSTER_NODES) - session = cluster.connect(KEYSPACE) - - if args.load_users: - users = await load_users() - save_users(session, users) - - for user in fetch_users(session, args.users): - print('User', user.id, ':') - print(' First name:', user.first_name) - if user.last_name: - print(' Last name:', user.last_name) - if user.username: - print(' Username:', user.username) - - print() - -if __name__ == '__main__': - asyncio.run(main(parse_args())) -</code></pre> -<p>Because Telethon is an <code>[asyncio](https://docs.python.org/3/library/asyncio.html)</code> library, we define it as <code>async def main(...)</code> and run it with <code>asyncio.run(main(...))</code>.</p> -<p>Here’s what it looks like in action:</p> -<pre><code>$ python data.py --help -usage: data.py [-h] [--load-users] [users [users ...]] - -Dump and query Telegram users - -positional arguments: - users one or more user IDs to query for - -optional arguments: - -h, --help show this help message and exit - --load-users load users from Telegram (do this first run) - -$ python data.py --load-users -found user: 487158 -found member: 59794114 -found member: 487158 -found member: 191045991 -(...a lot more output) - -$ python data.py 487158 59794114 -User 487158 : - First name: Rick - Last name: Pickle - -User 59794114 : - Firt name: Peter - Username: pete -</code></pre> -<p>Telegram’s data now persists in Cassandra, and we can efficiently query it whenever we need to! I would’ve shown a video presenting its usage, but I’m afraid that would leak some of the data I want to keep private :-).</p> -<p>Feel free to download the code and try it yourself:</p> -<p><em>download removed</em></p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://docs.datastax.com/en/developer/python-driver/3.22/getting_started/">DataStax Python Driver for Apache Cassandra – Getting Started</a></li> -<li><a href="https://docs.telethon.dev/en/latest/">Telethon’s Documentation</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,26 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: Final NoSQL evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This evaluation is a bit different to my <a href="/blog/mdad/nosql-evaluation/">previous one</a> because this time I have been tasked to evaluate student <code>a(i - 2)</code>, and because I am <code>i = 11</code> that happens to be <code>a(9) =</code> a classmate.</p> -<div class="date-created-modified">Created 2020-05-13<br> -Modified 2020-05-14</div> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s Evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post I have evaluated is Trabajo en grupo – Bases de datos NoSQL, 3ª entrada: Aplicación con una Base de datos NoSQL seleccionada.</p> -<p>It starts with a very brief introduction with who has written the post, what data they will be using, and what database they have chosen.</p> -<p>They properly describe their objective, how they will do it and what library will be used.</p> -<p>They also explain where they obtain the data from, and what other things the site can do, which is a nice bonus.</p> -<p>The post continues listing and briefly explaining all the tools used and what they are for, including commands to execute.</p> -<p>At last, they list what files their project uses, what they do, and contains a showcase of images which lets the reader know what the application does.</p> -<p>All in all, in my opinion, it’s clear they have put work into this entry and I have not noticed any major flaws, so they deserve the highest grade.</p> -</main> -</body> -</html> -
@@ -1,14 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>pagong</title> -<link rel="stylesheet" href="css/style.css"> -</head> -<body> -<main> -<ul><li><a href="index/index.html">Data Mining and Data Warehousing</a></li><li><a href="final-nosql-evaluation/index.html">Privado: Final NoSQL evaluation</a></li><li><a href="a-practical-example-with-hadoop/index.html">A practical example with Hadoop</a></li><li><a href="developing-a-python-application-for-cassandra/index.html">Developing a Python application for Cassandra</a></li><li><a href="introduction-to-hadoop-and-its-mapreduce/index.html">Introduction to Hadoop and its MapReduce</a></li><li><a href="data-warehousing-and-olap/index.html">Data Warehousing and OLAP</a></li><li><a href="cassandra-introduccion/index.html">Cassandra: Introducción</a></li><li><a href="nosql-evaluation/index.html">Privado: NoSQL evaluation</a></li><li><a href="mining-of-massive-datasets/index.html">Mining of Massive Datasets</a></li><li><a href="mongodb-operaciones-basicas-y-arquitectura/index.html">MongoDB: Operaciones Básicas y Arquitectura</a></li><li><a href="mongodb-introduction/index.html">MongoDB: Introducción</a></li><li><a href="cassandra-operaciones-basicas-y-arquitectura/index.html">Cassandra: Operaciones Básicas y Arquitectura</a></li><li><a href="visualizing-caceres-opendata/index.html">Visualizing Cáceres’ OpenData</a></li><li><a href="what-is-an-algorithm/index.html">What is an algorithm?</a></li><li><a href="introduction-to-nosql/index.html">Introduction to NoSQL</a></li><li><a href="big-data/index.html">Big Data</a></li></ul></main> -</body> -</html> -
@@ -1,20 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Data Mining and Data Warehousing</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="data_mining_and_data_warehousing"><a class="anchor" href="#data_mining_and_data_warehousing">¶</a>Data Mining and Data Warehousing</h1> -<div class="date-created-modified">2020-10-03</div> -<p>During 2020 at university, this subject ("Minería de Datos y Almacenes de Datos") had us write -blog posts as assignments. I think it would be really fun and I wanted to preserve that work -here, with the hopes it's interesting to someone.</p> -<p>The posts were auto-generated from the original HTML files and manually anonymized later.</p> -</main> -</body> -</html> -
@@ -1,62 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Introduction to Hadoop and its MapReduce</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Hadoop is an open-source, free, Java-based programming framework that helps processing large datasets in a distributed environment and the problems that arise when trying to harness the knowledge from BigData, capable of running on thousands of nodes and dealing with petabytes of data. It is based on Google File System (GFS) and originated from the work on the Nutch open-source project on search engines.</p> -<div class="date-created-modified">Created 2020-03-30<br> -Modified 2020-04-01</div> -<p>Hadoop also offers a distributed filesystem (HDFS) enabling for fast transfer among nodes, and a way to program with MapReduce.</p> -<p>It aims to strive for the 4 V’s: Volume, Variety, Veracity and Velocity. For veracity, it is a secure environment that can be trusted.</p> -<h2 class="title" id="milestones"><a class="anchor" href="#milestones">¶</a>Milestones</h2> -<p>The creators of Hadoop are Doug Cutting and Mike Cafarella, who just wanted to design a search engine, Nutch, and quickly found the problems of dealing with large amounts of data. They found their solution with the papers Google published.</p> -<p>The name comes from the plush of Cutting’s child, a yellow elephant.</p> -<ul> -<li>In July 2005, Nutch used GFS to perform MapReduce operations.</li> -<li>In February 2006, Nutch started a Lucene subproject which led to Hadoop.</li> -<li>In April 2007, Yahoo used Hadoop in a 1 000-node cluster.</li> -<li>In January 2008, Apache took over and made Hadoop a top-level project.</li> -<li>In July 2008, Apache tested a 4000-node cluster. The performance was the fastest compared to other technologies that year.</li> -<li>In May 2009, Hadoop sorted a petabyte of data in 17 hours.</li> -<li>In December 2011, Hadoop reached 1.0.</li> -<li>In May 2012, Hadoop 2.0 was released with the addition of YARN (Yet Another Resource Navigator) on top of HDFS, splitting MapReduce and other processes into separate components, greatly improving the fault tolerance.</li> -</ul> -<p>From here onwards, many other alternatives have born, like Spark, Hive & Drill, Kafka, HBase, built around the Hadoop ecosystem.</p> -<p>As of 2017, Amazon has clusters between 1 and 100 nodes, Yahoo has over 100 000 CPUs running Hadoop, AOL has clusters with 50 machines, and Facebook has a 320-machine (2 560 cores) and 1.3PB of raw storage.</p> -<h2 id="why_not_use_rdbms_"><a class="anchor" href="#why_not_use_rdbms_">¶</a>Why not use RDBMS?</h2> -<p>Relational database management systems simply cannot scale horizontally, and vertical scaling will require very expensive servers. Similar to RDBMS, Hadoop has a notion of jobs (analogous to transactions), but without ACID or concurrency control. Hadoop supports any form of data (unstructured or semi-structured) in read-only mode, and failures are common but there’s a simple yet efficient fault tolerance.</p> -<p>So what problems does Hadoop solve? It solves the way we should think about problems, and distributing them, which is key to do anything related with BigData nowadays. We start working with clusters of nodes, and coordinating the jobs between them. Hadoop’s API makes this really easy.</p> -<p>Hadoop also takes very seriously the loss of data with replication, and if a node falls, they are moved to a different node.</p> -<h2 id="major_components"><a class="anchor" href="#major_components">¶</a>Major components</h2> -<p>The previously-mentioned HDFS runs on commodity machine, which are cost-friendly. It is very fault-tolerant and efficient enough to process huge amounts of data, because it splits large files into smaller chunks (or blocks) that can be more easily handled. Multiple nodes can work on multiple chunks at the same time.</p> -<p>NameNode stores the metadata of the various datablocks (map of blocks) along with their location. It is the brain and the master in Hadoop’s master-slave architecture, also known as the namespace, and makes use of the DataNode.</p> -<p>A secondary NameNode is a replica that can be used if the first NameNode dies, so that Hadoop doesn’t shutdown and can restart.</p> -<p>DataNode stores the blocks of data, and are the slaves in the architecture. This data is split into one or more files. Their only job is to manage this access to the data. They are often distributed among racks to avoid data lose.</p> -<p>JobTracker creates and schedules jobs from the clients for either map or reduce operations.</p> -<p>TaskTracker runs MapReduce tasks assigned to the current data node.</p> -<p>When clients need data, they first interact with the NameNode and replies with the location of the data in the correct DataNode. Client proceeds with interaction with the DataNode.</p> -<h2 id="mapreduce"><a class="anchor" href="#mapreduce">¶</a>MapReduce</h2> -<p>MapReduce, as the name implies, is split into two steps: the map and the reduce. The map stage is the «divide and conquer» strategy, while the reduce part is about combining and reducing the results.</p> -<p>The mapper has to process the input data (normally a file or directory), commonly line-by-line, and produce one or more outputs. The reducer uses all the results from the mapper as its input to produce a new output file itself.</p> -<p><img src="bitmap.png" alt="" /></p> -<p>When reading the data, some may be junk that we can choose to ignore. If it is valid data, however, we label it with a particular type that can be useful for the upcoming process. Hadoop is responsible for splitting the data accross the many nodes available to execute this process in parallel.</p> -<p>There is another part to MapReduce, known as the Shuffle-and-Sort. In this part, types or categories from one node get moved to a different node. This happens with all nodes, so that every node can work on a complete category. These categories are known as «keys», and allows Hadoop to scale linearly.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://youtu.be/oT7kczq5A-0">YouTube – Hadoop Tutorial For Beginners | What Is Hadoop? | Hadoop Tutorial | Hadoop Training | Simplilearn</a></li> -<li><a href="https://youtu.be/bcjSe0xCHbE">YouTube – Learn MapReduce with Playing Cards</a></li> -<li><a href="https://youtu.be/j8ehT1_G5AY?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">YouTube – Video Post #2: Hadoop para torpes (I)-¿Qué es y para qué sirve?</a></li> -<li><a href="https://youtu.be/NQ8mjVPCDvk?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">Video Post #3: Hadoop para torpes (II)-¿Cómo funciona? HDFS y MapReduce</a></li> -<li><a href="https://hadoop.apache.org/old/releases.html">Apache Hadoop Releases</a></li> -<li><a href="https://youtu.be/20qWx2KYqYg?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">Video Post #4: Hadoop para torpes (III y fin)- Ecosistema y distribuciones</a></li> -<li><a href="http://www.hadoopbook.com/">Chapter 2 – Hadoop: The Definitive Guide, Fourth Edition</a> (<a href="http://grut-computing.com/HadoopBook.pdf">pdf,</a><a href="http://www.hadoopbook.com/code.html">code</a>)</li> -</ul> -</main> -</body> -</html> -
@@ -1,72 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Introduction to NoSQL</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This post will primarly focus on the talk held in the <a href="https://youtu.be/qI_g07C_Q5I">GOTO 2012 conference: Introduction to NoSQL by Martin Fowler</a>. It can be seen as an informal, summarized transcript of the talk</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<hr /> -<p>The relational database model is affected by the <em><a href="https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch">impedance mismatch problem</a></em>. This occurs because we have to match our high-level design with the separate columns and rows used by relational databases.</p> -<p>Taking the in-memory objects and putting them into a relational database (which were dominant at the time) simply didn’t work out. Why? Relational databases were more than just databases, they served as a an integration mechanism across applications, up to the 2000s. For 20 years!</p> -<p>With the rise of the Internet and the sheer amount of traffic, databases needed to scale. Unfortunately, relational databases only scale well vertically (by upgrading a <em>single</em> node). This is <em>very</em> expensive, and not something many could afford.</p> -<p>The problem are those pesky <code>JOIN</code>‘s, and its friends <code>GROUP BY</code>. Because our program and reality model don’t match the tables used by SQL, we have to rely on them to query the data. It is because the model doesn’t map directly.</p> -<p>Furthermore, graphs don’t map very well at all to relational models.</p> -<p>We needed a way to scale horizontally (by increasing the <em>amount</em> of nodes), something relational databases were not designed to do.</p> -<blockquote> -<p><em>We need to do something different, relational across nodes is an unnatural act</em></p> -</blockquote> -<p>This inspired the NoSQL movement.</p> -<blockquote> -<p><em>#nosql was only meant to be a hashtag to advertise it, but unfortunately it’s how it is called now</em></p> -</blockquote> -<p>It is not possible to define NoSQL, but we can identify some of its characteristics:</p> -<ul> -<li>Non-relational</li> -<li><strong>Cluster-friendly</strong> (this was the original spark)</li> -<li>Open-source (until now, generally)</li> -<li>21st century web culture</li> -<li>Schema-less (easier integration or conjugation of several models, structure aggregation)</li> -</ul> -<p>These databases use different data models to those used by the relational model. However, it is possible to identify 4 broad chunks (some may say 3, or even 2!):</p> -<ul> -<li><strong>Key-value store</strong>. With a certain key, you obtain the value corresponding to it. It knows nothing else, nor does it care. We say the data is opaque.</li> -<li><strong>Document-based</strong>. It stores an entire mass of documents with complex structure, normally through the use of JSON (XML has been left behind). Then, you can ask for certain fields, structures, or portions. We say the data is transparent.</li> -<li><strong>Column-family</strong>. There is a «row key», and within it we store multiple «column families» (columns that fit together, our aggregate). We access by row-key and column-family name.</li> -</ul> -<p>All of these kind of serve to store documents without any <em>explicit</em> schema. Just shove in anything! This gives a lot of flexibility and ease of migration, except… that’s not really true. There’s an <em>implicit</em> schema when querying.</p> -<p>For example, a query where we may do <code>anOrder['price'] * anOrder['quantity']</code> is assuming that <code>anOrder</code> has both a <code>price</code> and a <code>quantity</code>, and that both of these can be multiplied together. «Schema-less» is a fuzzy term.</p> -<p>However, it is the lack of a <em>fixed</em> schema that gives flexibility.</p> -<p>One could argue that the line between key-value and document-based is very fuzzy, and they would be right! Key-value databases often let you include additional metadata that behaves like an index, and in document-based, documents often have an identifier anyway.</p> -<p>The common notion between these three types is what matters. They save an entire structure as an <em>unit</em>. We can refer to these as «Aggregate Oriented Databases». Aggregate, because we group things when designing or modeling our systems, as opposed to relational databases that scatter the information across many tables.</p> -<p>There exists a notable outlier, though, and that’s:</p> -<ul> -<li><strong>Graph</strong> databases. They use a node-and-arc graph structure. They are great for moving on relationships across things. Ironically, relational databases are not very good at jumping across relationships! It is possibly to perform very interesting queries in graph databases which would be really hard and costly on relational models. Unlike the aggregated databases, graphs break things into even smaller units. -NoSQL is not <em>the</em> solution. It depends on how you’ll work with your data. Do you need an aggregate database? Will you have a lot of relationships? Or would the relational model be good fit for you?</li> -</ul> -<p>NoSQL, however, is a good fit for large-scale projects (data will <em>always</em> grow) and faster development (the impedance mismatch is drastically reduced).</p> -<p>Regardless of our choice, it is important to remember that NoSQL is a young technology, which is still evolving really fast (SQL has been stable for <em>decades</em>). But the <em>polyglot persistence</em> is what matters. One must know the alternatives, and be able to choose.</p> -<hr /> -<p>Relational databases have the well-known ACID properties: Atomicity, Consistency, Isolation and Durability.</p> -<p>NoSQL (except graph-based!) are about being BASE instead: Basically Available, Soft state, Eventual consistency.</p> -<p>SQL needs transactions because we don’t want to perform a read while we’re only half-way done with a write! The readers and writers are the problem, and ensuring consistency results in a performance hit, even if the risk is low (two writers are extremely rare but it still must be handled).</p> -<p>NoSQL on the other hand doesn’t need ACID because the aggregate <em>is</em> the transaction boundary. Even before NoSQL itself existed! Any update is atomic by nature. When updating many documents it <em>is</em> a problem, but this is very rare.</p> -<p>We have to distinguish between logical and replication consistency. During an update and if a conflict occurs, it must be resolved to preserve the logical consistency. Replication consistency on the other hand is preserveed when distributing the data across many machines, for example during sharding or copies.</p> -<p>Replication buys us more processing power and resillence (at the cost of more storage) in case some of the nodes die. But what happens if what dies is the communication across the nodes? We could drop the requests and preserve the consistency, or accept the risk to continue and instead preserve the availability.</p> -<p>The choice on whether trading consistency for availability is acceptable or not depends on the domain rules. It is the domain’s choice, the business people will choose. If you’re Amazon, you always want to be able to sell, but if you’re a bank, you probably don’t want your clients to have negative numbers in their account!</p> -<p>Regardless of what we do, in a distributed system, the CAP theorem always applies: Consistecy, Availability, Partitioning-tolerancy (error tolerancy). It is <strong>impossible</strong> to guarantee all 3 at 100%. Most of the times, it does work, but it is mathematically impossible to guarantee at 100%.</p> -<p>A database has to choose what to give up at some point. When designing a distributed system, this must be considered. Normally, the choice is made between consistency or response time.</p> -<h2 class="title" id="further_reading"><a class="anchor" href="#further_reading">¶</a>Further reading</h2> -<ul> -<li><a href="https://www.martinfowler.com/articles/nosql-intro-original.pdf">The future is: <del>NoSQL Databases</del> Polyglot Persistence</a></li> -<li><a href="https://www.thoughtworks.com/insights/blog/nosql-databases-overview">NoSQL Databases: An Overview</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,27 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Mining of Massive Datasets</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>In this post we will talk about the Chapter 1 of the book Mining of Massive Datasets Leskovec, J. et al., available online, and I will summarize and share my thoughts on it.</p> -<div class="date-created-modified">Created 2020-03-16<br> -Modified 2020-03-28</div> -<p>Data mining often refers to the discovery of models for data, where the model can be for statistics, machine learning, summarizing, extracting features, or other computational approaches to perform complex queries on the data.</p> -<p>Commonly, problems related to data mining involve discovering unusual events hidden in massive data sets. There is another problem when trying to achieve Total Information Awareness (TIA), though, a project that was proposed by the Bush administration but shut down. The problem is, if you look at so much data, and try to find activities that look like (for example) terrorist behavior, inevitably one will find other illicit activities that are not terrorism with bad consequences. So it is important to narrow the activities we are looking for, in this case.</p> -<p>When looking at data, even completely random data, for a certain event type, the event will likely occur. With more data, it will occur more times. However, these are bogus results. The Bonferroni correction gives a statistically sound way to avoid most of these bogus results, however, the Bonferroni’s Principle can be used as an informal version to achieve the same thing.</p> -<p>For that, we calculate the expected number of occurrences of the events you are looking for on the assumption that data is random. If this number is way larger than the number of real instances one hoped to find, then nearly everything will be Bogus.</p> -<hr /> -<p>When analysing documents, some words will be more important than others, and can help determine the topic of the document. One could think the most repeated words are the most important, but that’s far from the truth. The most common words are the stop-words, which carry no meaning, reason why we should remove them prior to processing. We are mostly looking for rare nouns.</p> -<p>There are of course formal measures for how concentrated into relatively few documents are the occurrences of a given word, known as TF.IDF (Term Frequency times In-verse Document Frequency). We won’t go into details on how to compute it, because there are multiple ways.</p> -<p>Hash functions are also frequently used, because they can turn hash keys into a bucket number (the index of the bucket where this hash key belongs). They «randomize» and spread the universe of keys into a smaller number of buckets, useful for storage and access.</p> -<p>An index is an efficient structure to query for values given a key, and can be built with hash functions and buckets.</p> -<p>Having all of these is important when analysing documents when doing data mining, because otherwise it would take far too long.</p> -</main> -</body> -</html> -
@@ -1,112 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>MongoDB: Introducción</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Este es el primer post en la serie sobre Mongo, en el cuál introduciremos dicha bases de datos NoSQL y veremos sus características e instalación.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-20</div> -<p>Otros posts en esta serie:</p> -<ul> -<li><a href="/blog/mdad/mongodb-introduction/">MongoDB: Introducción</a> (este post)</li> -<li><a href="/blog/mdad/mongodb-operaciones-basicas-y-arquitectura/">MongoDB: Operaciones Básicas y Arquitectura</a></li> -</ul> -<p>Este post está hecho en colaboración con un compañero.</p> -<hr /> -<p><img src="0LRP4__jIIkJ-0gl8j2RDzWscL1Rto-NwvdqzmYk0jmYBIVbJ78n1ZLByPgV.png" alt="" /></p> -<h2 class="title" id="definición"><a class="anchor" href="#definición">¶</a>Definición</h2> -<p>MongoDB es una base de datos orientada a documentos. Esto quiere decir que en lugar de guardar los datos en registros, guarda los datos en documentos. Estos documentos son almacenados en BSON, que es una representación binaria de JSON. Una de las principales diferencias respecto a las bases de datos relacionales es que no necesita seguir ningún esquema, los documentos de una misma colección pueden tener esquemas diferentes.</p> -<p>MongoDB está escrito en C++, aunque las consultas se hacen pasando objetos JSON como parámetro.</p> -<pre><code>{ - "_id" : ObjectId("52f602d787945c344bb4bda5"), - "name" : "Tyrion", - "hobbies" : [ - "books", - "girls", - "wine" - ], - "friends" : [ - { - "name" : "Bronn", - "ocuppation" : "sellsword" - }, - { - "name" : "Shae", - "ocuppation" : "handmaiden" - } - ] - } -</code></pre> -<h2 id="características"><a class="anchor" href="#características">¶</a>Características</h2> -<p><img src="WxZenSwSsimGvXVu5XH4cFUd3kr3Is_arrdSZGX8Hi0Ligqgw_ZTvGSIeXZm.png" alt="" /></p> -<p>MongoDB alcanza un balance perfecto entre rendimiento y funcionalidad gracias a su sistema de consulta de contenidos. Pero sus características principales no se limitan solo a esto, también cuenta con otras que lo posicionan como el preferido de muchos desarrolladores de aplicaciones como aplicaciones móviles, gaming, logging o e-commerce.</p> -<p>Algunas de las principales características de esta base de datos son:</p> -<ul> -<li>Almacenamiento orientado a documentos (documentos JSON con esquemas dinámicos).</li> -<li>Soporte Full index: puede crear índices sobre cualquier atributo y añadir múltiples índices secundarios.</li> -<li>Replicación y alta disponibilidad: espejos entre LANs y WANs.</li> -<li>Auto-Sharding: escalabilidad horizontal sin comprometer la funcionalidad, está limitada, actualmente, a 20 nodos, aunque el objetivo es alcanzar una cifra cercana a los 1000.</li> -<li>Consultas ricas y basadas en documentos.</li> -<li>Rápidas actualizaciones en el contexto.</li> -<li>Soporte comercial, capacitación y consultoría disponibles.</li> -<li>También puede ser utilizada para el almacenamiento de archivos aprovechando la capacidad de MongoDB para el balanceo de carga y la replicación de datos.</li> -</ul> -<p>En cuanto a la arquitectura, podríamos decir que divide en tres partes: las bases de datos, las colecciones y los documentos (que contienen los campos de cada entrada).</p> -<ul> -<li><strong>Base de datos</strong>: cada una de las bases de datos tiene un conjunto propio de archivos en el sistema de archivos con diversas bases de datos existentes en un solo servidor.</li> -<li><strong>Colección</strong>: un conjunto de documentos de base de datos. El equivalente RDBMS de la colección es una tabla. Toda colección existe dentro de una única base de datos.</li> -<li><strong>Documento</strong>: un conjunto de pares clave/valor. Los documentos están asociados con esquemas dinámicos. La ventaja de tener esquemas dinámicos es que el documento en una sola colección no tiene que tener la misma estructura o campos. </li> -</ul> -<h2 id="arista_dentro_del_teorema_cap"><a class="anchor" href="#arista_dentro_del_teorema_cap">¶</a>Arista dentro del Teorema CAP</h2> -<p><img src="t73Q1t-HXfWij-Q1o5AYEnO39Kz2oyLLCdQz6lWQQPaSQWamlDMjmptAn97h.png" alt="" /></p> -<p>MongoDB es CP por defecto, es decir, garantiza consistencia y tolerancia a particiones (fallos). Pero también podemos configurar el nivel de consistencia, eligiendo el número de nodos a los que se replicarán los datos. O podemos configurar si se pueden leer datos de los nodos secundarios (en MongoDB solo hay un servidor principal, que es el único que acepta inserciones o modificaciones). Si permitimos leer de un nodo secundario mediante la replicación, sacrificamos consistencia, pero ganamos disponibilidad.</p> -<h2 id="descarga_e_instalación"><a class="anchor" href="#descarga_e_instalación">¶</a>Descarga e instalación</h2> -<h3 id="windows"><a class="anchor" href="#windows">¶</a>Windows</h3> -<p>Descargar el archivo desde <a href="https://www.mongodb.com/download-center#production">https://www.mongodb.com/download-center#production</a></p> -<ol> -<li>Doble clic en el archivo <code>.msi</code></li> -<li>El instalador de Windows lo guía a través del proceso de instalación. -Si elige la opción de instalación personalizada, puede especificar un directorio de instalación. -MongoDB no tiene ninguna otra dependencia del sistema. Puede instalar y ejecutar MongoDB desde cualquier carpeta que elija.</li> -<li>Ejecutar el <code>.exe</code> que hemos instalado.</li> -</ol> -<h3 id="linux"><a class="anchor" href="#linux">¶</a>Linux</h3> -<p>Abrimos una terminal y ejecutamos:</p> -<pre><code>sudo apt-get update -sudo apt install -y mongodb-org -</code></pre> -<p>Luego comprobamos el estado del servicio:</p> -<pre><code>sudo systemctl start mongod -sudo systemctl status mongod -</code></pre> -<p>Finalmente ejecutamos la base de datos con el comando:</p> -<pre><code>sudo mongo -</code></pre> -<h3 id="macos"><a class="anchor" href="#macos">¶</a>macOS</h3> -<p>Abrimos una terminal y ejecutamos:</p> -<pre><code>brew update -brew install mongodb -</code></pre> -<p>Iniciamos el servicio:</p> -<pre><code>brew services start mongodb -</code></pre> -<h2 id="referencias"><a class="anchor" href="#referencias">¶</a>Referencias</h2> -<ul> -<li><a href="https://expertoenbigdata.com/que-es-mongodb/#La_arquitectura_de_MongoDB">Todo lo que debes saber sobre MongoDB</a></li> -<li><a href="https://www.ecured.cu/MongoDB">MongoDB – EcuRed</a></li> -<li><a href="https://mappinggis.com/2014/07/mongodb-y-gis/">Bases de datos NoSQL, MongoDB y GIS – MappingGIS</a></li> -<li><a href="https://es.slideshare.net/maxfontana90/caractersticas-mongo-db">Características MONGO DB</a></li> -<li><a href="https://openwebinars.net/blog/que-es-mongodb">Qué es MongoDB y características</a></li> -<li><a href="https://www.genbeta.com/desarrollo/mongodb-que-es-como-funciona-y-cuando-podemos-usarlo-o-no">MongoDB. Qué es, cómo funciona y cuándo podemos usarlo (o no)</a></li> -<li><a href="https://docs.mongodb.com/">MongoDB Documentation</a></li> -<li><a href="https://www.genbeta.com/desarrollo/nosql-clasificacion-de-las-bases-de-datos-segun-el-teorema-cap">NoSQL: Clasificación de las bases de datos según el teorema CAP</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,464 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>MongoDB: Operaciones Básicas y Arquitectura</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Este es el segundo post en la serie sobre MongoDB, con una breve descripción de las operaciones básicas (tales como inserción, recuperación e indexado), y ejecución por completo junto con el modelo de datos y arquitectura.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-20</div> -<p>Otros posts en esta serie:</p> -<ul> -<li><a href="/blog/mdad/mongodb-introduction/">MongoDB: Introducción</a></li> -<li><a href="/blog/mdad/mongodb-operaciones-basicas-y-arquitectura/">MongoDB: Operaciones Básicas y Arquitectura</a> (este post)</li> -</ul> -<p>Este post está hecho en colaboración con un compañero, y en él veremos algunos ejemplos de las operaciones básicas (<a href="https://stackify.com/what-are-crud-operations/">CRUD</a>) sobre MongoDB.</p> -<hr /> -<p>Empezaremos viendo cómo creamos una nueva base de datos dentro de MongoDB y una nueva colección donde poder insertar nuestros documentos.</p> -<h2 class="title" id="creación_de_una_base_de_datos_e_inserción_de_un_primer_documento"><a class="anchor" href="#creación_de_una_base_de_datos_e_inserción_de_un_primer_documento">¶</a>Creación de una base de datos e inserción de un primer documento</h2> -<p>Podemos ver las bases de datos que tenemos disponibles ejecutando el comando:</p> -<pre><code>> show databases -admin 0.000GB -config 0.000GB -local 0.000GB -</code></pre> -<p>Para crear una nueva base de datos, o utilizar una de las que tenemos creadas ejecutamos <code>use</code> junto con el nombre que le vamos a dar:</p> -<pre><code>> use new_DB -switched to db new_DB -</code></pre> -<p>Una vez hecho esto, podemos ver que si volvemos a ejecutar «show databases», la nueva base de datos no aparece. Esto es porque para que Mongo registre una base de datos en la lista de las existentes, necesitamos insertar al menos un nuevo documento en una colección de esta. Lo podemos hacer de la siguiente forma:</p> -<pre><code>> db.movie.insert({"name":"tutorials point"}) -WriteResult({ "nInserted" : 1 }) - -> show databases -admin 0.000GB -config 0.000GB -local 0.000GB -movie 0.000GB -</code></pre> -<p>Al igual que podemos ver las bases de datos existentes, también podemos consultar las colecciones que existen dentro de estas. Siguiendo la anterior ejecución, si ejecutamos:</p> -<pre><code>> show collections -movie -</code></pre> -<h3 id="borrar_base_de_datos"><a class="anchor" href="#borrar_base_de_datos">¶</a>Borrar base de datos</h3> -<p>Para borrar una base de datos tenemos que ejecutar el siguiente comando:</p> -<pre><code>> db.dropDatabase() -{ "dropped" : "new_DB", "ok" : 1 } -</code></pre> -<h3 id="crear_colección"><a class="anchor" href="#crear_colección">¶</a>Crear colección</h3> -<p>Para crear una colección podemos hacerlo de dos formas. O bien mediante el comando:</p> -<pre><code>db.createCollection(<nombre de la colección>, opciones) -</code></pre> -<p>Donde el primer parámetro es el nombre que le queremos asignar a la colección, y los siguientes, todos opcionales, pueden ser (entre otros):</p> -<table class=""> - <thead> - <tr> - <th> - Campo - </th> - <th> - Tipo - </th> - <th> - Descripción - </th> - </tr> - </thead> - <tbody> - <tr> - <td> - <code> - capped - </code> - </td> - <td> - Booleano - </td> - <td> - Si es - <code> - true - </code> - , - permite una colección limitada. Una colección limitada es una colección - de tamaño fijo que sobrescribe automáticamente sus entradas más -antiguas cuando alcanza su tamaño máximo. Si especifica - <code> - true - </code> - , también debe especificar el parámetro de - <code> - size - </code> - . - </td> - </tr> - <tr> - <td> - <code> - autoIndexId - </code> - </td> - <td> - Booleano - </td> - <td> - Si es - <code> - true - </code> - crea automáticamente un índice en el campo - <code> - _id - </code> - . Por defecto es - <code> - false - </code> - </td> - </tr> - <tr> - <td> - <code> - size - </code> - </td> - <td> - Número - </td> - <td> - Especifica el tamaño máximo en bytes para una colección limitada. Es obligatorio si el campo - <code> - capped - </code> - está a - <code> - true - </code> - . - </td> - </tr> - <tr> - <td> - <code> - max - </code> - </td> - <td> - Número - </td> - <td> - Especifica el número máximo de documentos que están permitidos en la colección limitada. - </td> - </tr> - </tbody> -</table> -<pre><code>> use test -switched to db test - -> db.createCollection("mycollection") -{ "ok" : 1 } - -> db.createCollection("mycol", {capped : true, autoIndexId: true, size: 6142800, max: 10000}) -{ - "note" : "the autoIndexId option is deprecated and will be removed in a future release", - "ok" : 1 -} - -> show collections -mycol -mycollection -</code></pre> -<p>Como se ha visto anteriormente al crear la base de datos, podemos insertar un documento en una colección sin que la hayamos creado anteriormente. Esto es porque MongoDB crea automáticamente una colección cuando insertas algún documento en ella:</p> -<pre><code>> db.tutorialspoint.insert({"name":"tutorialspoint"}) -WriteResult({ "nInserted" : 1 }) - -> show collections -mycol -mycollection -tutorialspoint -</code></pre> -<h3 id="borrar_colección"><a class="anchor" href="#borrar_colección">¶</a>Borrar colección</h3> -<p>Para borrar una colección basta con situarnos en la base de datos que la contiene, y ejecutar lo siguiente:</p> -<pre><code>db.<nombre_de_la_colección>.drop() -</code></pre> -<pre><code>> db.mycollection.drop() -true - -> show collections -mycol -tutorialspoint -</code></pre> -<h3 id="insertar_documento"><a class="anchor" href="#insertar_documento">¶</a>Insertar documento</h3> -<p>Para insertar datos en una colección de MongoDB necesitaremos usar el método <code>insert()</code> o <code>save()</code>.</p> -<p>Ejemplo del método <code>insert</code>:</p> -<pre><code>> db.colection.insert({ -... title: 'Esto es una prueba para MDAD', -... description: 'MongoDB es una BD no SQL', -... by: 'Classmate and Me', -... tags: ['mongodb', 'database'], -... likes: 100 -... }) -WriteResults({ "nInserted" : 1 }) -</code></pre> -<p>En este ejemplo solo se ha insertado un único documento, pero podemos insertar los que queramos separándolos de la siguiente forma:</p> -<pre><code>db.collection.insert({documento}, {documento2}, {documento3}) -</code></pre> -<p>No hace falta especificar un ID ya que el propio mongo asigna un ID a cada documento automáticamente, aunque nos da la opción de poder asignarle uno mediante el atributo <code>_id</code> en la inserción de los datos</p> -<p>Como se indica en el título de este apartado también se puede insertar mediante el método <code>db.coleccion.save(documento)</code>, funcionando este como el método <code>insert</code>.</p> -<h3 id="método_"><a class="anchor" href="#método_">¶</a>Método <code>find()</code></h3> -<p>El método find en MongoDB es el que nos permite realizar consultas a las colecciones de nuestra base de datos:</p> -<pre><code>db.<nombre_de_la_colección>.find() -</code></pre> -<p>Este método mostrará de una forma no estructurada todos los documentos de la colección. Si le añadimos la función <code>pretty</code> a este método, se mostrarán de una manera más «bonita».</p> -<pre><code>> db.colection.find() -{ "_id": ObjectId("5e738f0989f85a7eafdf044a"), "title" : "Esto es una prueba para MDAD", "description" : "MongoDB es una BD no SQL", "by" : "Classmate and Me", "tags" : [ "mongodb", "database" ], "likes" : 100 } - -> db.colection.find().pretty() -{ - "_id": ObjectId("5e738f0989f85a7eafdf044a"), - "title" : "Esto es una prueba para MDAD", - "description" : "MongoDB es una BD no SQL", - "by" : "Classmate and Me", - "tags" : [ - "mongodb", - "database" - ], - "likes" : 100 -} -</code></pre> -<p>Los equivalentes del <code>where</code> en las bases de datos relacionales son:</p> -<table class=""> - <thead> - <tr> - <th> - Operación - </th> - <th> - Sintaxis - </th> - <th> - Ejemplo - </th> - <th> - Equivalente en RDBMS - </th> - </tr> - </thead> - <tbody> - <tr> - <td> - Igual - </td> - <td> - <code> - {<clave>:<valor>} - </code> - </td> - <td> - <code> - db.mycol.find({"by":"Classmate and Me"}) - </code> - </td> - <td> - <code> - where by = 'Classmate and Me' - </code> - </td> - </tr> - <tr> - <td> - Menor que - </td> - <td> - <code> - {<clave>:{$lt:<valor>}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$lt:60}}) - </code> - </td> - <td> - <code> - where likes < 60 - </code> - </td> - </tr> - <tr> - <td> - Menor o igual que - </td> - <td> - <code> - {<clave>:{$lte:<valor>}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$lte:60}}) - </code> - </td> - <td> - <code> - where likes <= 60 - </code> - </td> - </tr> - <tr> - <td> - Mayor que - </td> - <td> - <code> - {<clave>:{$gt:<valor>}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$gt:60}}) - </code> - </td> - <td> - <code> - where likes > 60 - </code> - </td> - </tr> - <tr> - <td> - Mayor o igual que - </td> - <td> - <code> - {<clave>:{$gte:<valor>}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$gte:60}}) - </code> - </td> - <td> - <code> - where likes >= 60 - </code> - </td> - </tr> - <tr> - <td> - No igual - </td> - <td> - <code> - {<clave>:{$ne:<valor>}} - </code> - </td> - <td> - <code> - db.mycol.find({"likes":{$ne:60}}) - </code> - </td> - <td> - <code> - where likes != 60 - </code> - </td> - </tr> - </tbody> -</table> -<p>En el método <code>find()</code> podemos añadir condiciones AND y OR de la siguiente manera:</p> -<pre><code>(AND) -> db.colection.find({$and:[{"by":"Classmate and Me"},{"title": "Esto es una prueba para MDAD"}]}).pretty() - -(OR) -> db.colection.find({$or:[{"by":"Classmate and Me"},{"title": "Esto es una prueba para MDAD"}]}).pretty() - -(Ambos a la vez) -> db.colection.find({"likes": {$gt:10}, $or: [{"by": "Classmate and Me"}, {"title": "Esto es una prueba para MDAD"}]}).pretty() -</code></pre> -<p>La última llamada con ambos a la vez equivalente en una consulta SQL a:</p> -<pre><code>where likes>10 AND (by = 'Classmate and Me' OR title = 'Esto es una prueba para MDAD') -</code></pre> -<h3 id="actualizar_un_documento"><a class="anchor" href="#actualizar_un_documento">¶</a>Actualizar un documento</h3> -<p>En MongoDB se hace utilizando el método <code>update</code>:</p> -<pre><code>db.<nombre_colección>.update(<criterio_de_selección>, <dato_actualizado>) -</code></pre> -<p>Para este ejemplo vamos a actualizar el documento que hemos insertado en el apartado anterior:</p> -<pre><code>> db.colection.update({'title':'Esto es una prueba para MDAD'},{$set:{'title':'Título actualizado'}}) -WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) -> db.colection.find().pretty() -{ - "_id": ObjectId("5e738f0989f85a7eafdf044a"), - "title" : "Título actualizado", - "description" : "MongoDB es una BD no SQL", - "by" : "Classmate and Me", - "tags" : [ - "mongodb", - "database" - ], - "likes" : 100 -} -</code></pre> -<p>Anteriormente se ha mencionado el método <code>save()</code> para la inserción de documentos, pero también podemos utilizarlo para sustituir documentos enteros por uno nuevo:</p> -<pre><code>> db.<nombre_de_la_colección>.save({_id:ObjectId(), <nuevo_documento>}) -</code></pre> -<p>Con nuestro documento:</p> -<pre><code>> db.colection.save( -... { -... "_id": ObjectId("5e738f0989f85a7eafdf044a"), "title": "Este es el nuevo título", "by": "MDAD" -... } -... ) -WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) - -> db.colection.find() -{ - "_id": ObjectId("5e738f0989f85a7eafdf044a"), - "title": "Este es el nuevo título", - "by": "MDAD" -} -</code></pre> -<h3 id="borrar_documento"><a class="anchor" href="#borrar_documento">¶</a>Borrar documento</h3> -<p>Para borrar un documento utilizaremos el método <code>remove()</code> de la siguiente manera:</p> -<pre><code>db.<nombre_de_la_colección>.remove(<criterio_de_borrado>) -</code></pre> -<p>Considerando la colección del apartado anterior borraremos el único documento que tenemos:</p> -<pre><code>> db.colection.remove({'title': 'Este es el nuevo título'}) -WriteResult({ "nRemoved" : 1 }) -> db.colection.find().pretty() -> -</code></pre> -<p>Para borrar todos los documentos de una colección usamos:</p> -<pre><code>db.<colección>.remove({}) -</code></pre> -<h3 id="indexación"><a class="anchor" href="#indexación">¶</a>Indexación</h3> -<p>MongDB nos permite crear índices sobre atributos de una colección de la siguiente forma:</p> -<pre><code>db.<colección>.createIndex( {<atributo>:<opciones>}) -</code></pre> -<p>Como ejemplo:</p> -<pre><code>> db.mycol.createIndex({"title":1}) -{ - "createdCollectionAutomatically" : false, - "numIndexesBefore" : 1, - "numIndexesAfter" : 2, - "ok" : 1 -} -</code></pre> -<p>Si queremos más de un atributo en el índice lo haremos así:</p> -<pre><code>> db.mycol.ensureIndex({"title":1,"description":-1}) -</code></pre> -<p>Los valores que puede tomar son <code>+1</code> para ascendente o <code>-1</code> para descendente.</p> -<h3 id="referencias"><a class="anchor" href="#referencias">¶</a>Referencias</h3> -<ul> -<li>Manual MongoDB. (n.d.). <a href="https://docs.mongodb.com/manual/">https://docs.mongodb.com/manual/</a></li> -<li>MongoDB Tutorial – Tutorialspoint. (n.d.). – <a href="https://www.tutorialspoint.com/mongodb/index.htm">https://www.tutorialspoint.com/mongodb/index.htm</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,30 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: NoSQL evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This evaluation is based on the criteria for the first delivery described by Trabajos en grupo sobre Bases de Datos NoSQL.</p> -<div class="date-created-modified">Created 2020-03-16<br> -Modified 2020-03-28</div> -<p>I have chosen to evaluate the following people and works:</p> -<ul> -<li>a12: Classmate (username) with Druid.</li> -<li>a21: Classmate (username) with Neo4J.</li> -</ul> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s Evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post evaluated is Bases de datos NoSQL – Apache Druid – Primera entrega.</p> -<p>It is a very well-written, complete post, with each section meeting one of the points in the required criteria. The only thing that bothered me a little is the abuse of strong emphasis in the text, which I found quite distracting. However, the content deserves the highest grading.</p> -<h2 id="classmate_s_evaluation_2"><a class="anchor" href="#classmate_s_evaluation_2">¶</a>Classmate’s Evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post evaluated is Bases de datos NoSQL – Neo4j – Primera entrega.</p> -<p>Well-written post, although a bit smaller than Classmate’s, but that’s not really an issue. It still talks about everything it should talk and includes photos to go along the text which help. There is no noticeable wrong things in it, so it gets the highest grading as well.</p> -</main> -</body> -</html> -
@@ -1,231 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Visualizing Cáceres’ OpenData</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>The city of Cáceres has online services to provide <a href="http://opendata.caceres.es/">Open Data</a> over a wide range of <a href="http://opendata.caceres.es/dataset">categories</a>, all of which are very interesting to explore!</p> -<div class="date-created-modified">Created 2020-03-09<br> -Modified 2020-03-19</div> -<p>We have chosen two different datasets, and will explore four different ways to visualize the data.</p> -<p>This post is co-authored with Classmate.</p> -<h2 class="title" id="obtain_the_data"><a class="anchor" href="#obtain_the_data">¶</a>Obtain the data</h2> -<p>We are interested in the JSON format for the <a href="http://opendata.caceres.es/dataset/informacion-del-padron-de-caceres-2017">census in 2017</a> and those for the <a href="http://opendata.caceres.es/dataset/vias-urbanas-caceres">vias of the city</a>. This way, we can explore the population and their location in interesting ways! You may follow those two links and select the JSON format under Resources to download it.</p> -<p>Why JSON? We will be using <a href="https://python.org/">Python</a> (3.7 or above) and <a href="https://matplotlib.org/">matplotlib</a> for quick iteration, and loading the data with <a href="https://docs.python.org/3/library/json.html">Python’s <code>json</code> module</a> will be trivial.</p> -<h2 id="implementation"><a class="anchor" href="#implementation">¶</a>Implementation</h2> -<h3 id="imports_and_constants"><a class="anchor" href="#imports_and_constants">¶</a>Imports and constants</h3> -<p>We are going to need a lot of things in this code, such as <code>json</code> to load the data, <code>matplotlib</code> to visualize it, and other data types and type hinting for use in the code.</p> -<p>We also want automatic download of the JSON files if they’re missing, so we add their URLs and download paths as constants.</p> -<pre><code>import json -import re -import os -import sys -import urllib.request -import matplotlib.pyplot as plt -from dataclasses import dataclass -from collections import namedtuple -from datetime import date -from pathlib import Path -from typing import Optional - -CENSUS_URL = 'http://opendata.caceres.es/GetData/GetData?dataset=om:InformacionCENSUS&year=2017&format=json' -VIAS_URL = 'http://opendata.caceres.es/GetData/GetData?dataset=om:Via&format=json' - -CENSUS_JSON = Path('data/demografia/Padrón_Cáceres_2017.json') -VIAS_JSON = Path('data/via/Vías_Cáceres.json') -</code></pre> -<h3 id="data_classes"><a class="anchor" href="#data_classes">¶</a>Data classes</h3> -<p><a href="https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/">Parse, don’t validate</a>. By defining a clear data model, we will be able to tell at a glance what information we have available. It will also be typed, so we won’t be confused as to what is what! Python 3.7 introduces <code>[dataclasses](https://docs.python.org/3/library/dataclasses.html)</code>, which are a wonderful feature to define… well, data classes concisely.</p> -<p>We also have a <code>[namedtuple](https://docs.python.org/3/library/collections.html#collections.namedtuple)</code> for points, because it’s extremely common to represent them as tuples.</p> -<pre><code>Point = namedtuple('Point', 'long lat') - -@dataclass -class Census: - year: int - via: int - count_per_year: dict - count_per_city: dict - count_per_gender: dict - count_per_nationality: dict - time_year: int - -@dataclass -class Via: - name: str - kind: str - code: int - history: Optional[str] - old_name: Optional[str] - length: Optional[float] - start: Optional[Point] - middle: Optional[Point] - end: Optional[Point] - geometry: Optional[list] -</code></pre> -<h3 id="helper_methods"><a class="anchor" href="#helper_methods">¶</a>Helper methods</h3> -<p>We will have a little helper method to automatically download the JSON when missing. This is just for convenience, we could as well just download it manually. But it is fun to automate things.</p> -<pre><code>def ensure_file(file, url): - if not file.is_file(): - print('Downloading', file.name, 'because it was missing...', end='', flush=True, file=sys.stderr) - file.parent.mkdir(parents=True, exist_ok=True) - urllib.request.urlretrieve(url, file) - print(' Done.', file=sys.stderr) -</code></pre> -<h3 id="parsing_the_data"><a class="anchor" href="#parsing_the_data">¶</a>Parsing the data</h3> -<p>I will be honest, parsing Cáceres’ OpenData is a pain in the neck! The official descriptions are huge and not all that helpful. Maybe if one needs documentation for a specific field. But luckily for us, the names are pretty self-descriptive, and we can explore the data to get a feel for what we will find.</p> -<p>We define two methods, one to iterate over <code>Census</code> values, and another to iterate over <code>Via</code> values. Here’s where our friend <code>[re](https://docs.python.org/3/library/re.html)</code> comes in, and oh boy the format of the data…</p> -<p>For example, the year and via identifier are best extracted from the URI! The information is also available in the <code>rdfs_label</code> field, but that’s just a Spanish text! At least the URI will be more reliable… hopefully.</p> -<p>Birth date. They could have used a JSON list, but nah, that would’ve been too simple. Instead, you are given a string separated by semicolons. The values? They could have been dictionaries with names for «year» and «age», but nah! That would’ve been too simple! Instead, you are given strings that look like «2001 (7)», and that’s the year and the count.</p> -<p>The birth place? Sometimes it’s «City (Province) (Count)», but sometimes the province is missing. Gender? Semicolon-separated. And there are only two genders. I know a few people who would be upset just reading this, but it’s not my data, it’s theirs. Oh, and plenty of things are optional. That was a lot of <code>AttributeError: 'NoneType' object has no attribute 'foo'</code> to work through!</p> -<p>But as a reward, we have nicely typed data, and we no longer have to deal with this mess when trying to visualize it. For brevity, we will only be showing how to parse the census data, and not the data for the vias. This post is already long enough on its own.</p> -<pre><code>def iter_census(file): - with file.open() as fd: - data = json.load(fd) - - for row in data['results']['bindings']: - year, via = map(int, row['uri']['value'].split('/')[-1].split('-')) - - count_per_year = {} - for item in row['schema_birthDate']['value'].split(';'): - y, c = map(int, re.match(r'(\d+) \((\d+)\)', item).groups()) - count_per_year[y] = c - - count_per_city = {} - for item in row['schema_birthPlace']['value'].split(';'): - match = re.match(r'([^(]+) \(([^)]+)\) \((\d+)\)', item) - if match: - l, _province, c = match.groups() - else: - l, c = re.match(r'([^(]+) \((\d+)\)', item).groups() - - count_per_city[l] = int(c) - - count_per_gender = {} - for item in row['foaf_gender']['value'].split(';'): - g, c = re.match(r'([^(]+) \((\d+)\)', item).groups() - count_per_gender[g] = int(c) - - count_per_nationality = {} - for item in row['schema_nationality']['value'].split(';'): - match = re.match(r'([^(]+) \((\d+)\)', item) - if match: - g, c = match.groups() - else: - g, _alt_name, c = re.match(r'([^(]+) \(([^)]+)\) \((\d+)\)', item).groups() - - count_per_nationality[g] = int(c) - time_year = int(row['time_year']['value']) - - yield Census( - year=year, - via=via, - count_per_year=count_per_year, - count_per_city=count_per_city, - count_per_gender=count_per_gender, - count_per_nationality=count_per_nationality, - time_year=time_year, - ) -</code></pre> -<h2 id="visualizing_the_data"><a class="anchor" href="#visualizing_the_data">¶</a>Visualizing the data</h2> -<p>Here comes the fun part! After parsing all the desired data from the mentioned JSON files, we plotted the data in four different graphics making use of Python’s <a href="https://matplotlib.org/"><code>matplotlib</code> library.</a> This powerful library helps with the creation of different visualizations in Python.</p> -<h3 id="visualizing_the_genders_in_a_pie_chart"><a class="anchor" href="#visualizing_the_genders_in_a_pie_chart">¶</a>Visualizing the genders in a pie chart</h3> -<p>After seeing that there are only two genders in the data of the census, we, displeased, started work in a chart for it. The pie chart was the best option since we wanted to show only the percentages of each gender. The result looks like this:</p> -<p><img src="pie_chart.png" alt="" /></p> -<p>Pretty straight forward, isn’t it? To display this wonderful graphic, we used the following code:</p> -<pre><code>def pie_chart(ax, data): - lists = sorted(data.items()) - - x, y = zip(*lists) - ax.pie(y, labels=x, autopct='%1.1f%%', - shadow=True, startangle=90) - ax.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle. -</code></pre> -<p>We pass the axis as the input parameter (later we will explain why) and the data collected from the JSON regarding the genders, which are in a dictionary with the key being the labels and the values the tally of each gender. We sort the data and with some unpacking magic we split it into two values: <code>x</code> being the labels and <code>y</code> the amount of each gender.</p> -<p>After that we plot the pie chart with the data and labels from <code>y</code> and <code>x</code>, we specify that we want the percentage with one decimal place with the <code>autopct</code> parameter, we enable shadows for the presentation, and specify the start angle at 90º.</p> -<h3 id="date_tick_labels"><a class="anchor" href="#date_tick_labels">¶</a>Date tick labels</h3> -<p>We wanted to know how many of the living people were born on each year, so we are making a date plot! In the census we have the year each person was born in, and using that information is an easy task after parsing the data (parsing was an important task of this work). The result looks as follows:</p> -<p><img src="date_tick.png" alt="" /></p> -<p>How did we do this? The following code was used:</p> -<pre><code>def date_tick(ax, data): - lists = sorted(data.items()) - - x, y = zip(*lists) - x = [date(year, 1, 1) for year in x] - ax.plot(x, y) -</code></pre> -<p>Again, we pass in an axis and the data related with the year born, we sort it, split it into two lists, being the keys the years and the values the number per year. After that, we put the years in a date format for the plot to be more accurate. Finally, we plot the values into that wonderful graphic.</p> -<h3 id="stacked_bar_chart"><a class="anchor" href="#stacked_bar_chart">¶</a>Stacked bar chart</h3> -<p>We wanted to know if there was any relation between the latitudes and count per gender, so we developed the following code:</p> -<pre><code>def stacked_bar_chart(ax, data): - labels = [] - males = [] - females = [] - - for latitude, genders in data.items(): - labels.append(str(latitude)) - males.append(genders['Male']) - females.append(genders['Female']) - - ax.bar(labels, males, label='Males') - ax.bar(labels, females, bottom=males, label='Females') - - ax.set_ylabel('Counts') - ax.set_xlabel('Latitudes') - ax.legend() -</code></pre> -<p>The key of the data dictionary is the latitude rounded to two decimals, and value is another dictionary, which is composed by the key that is the name of the gender and the value, the number of people per gender. So, in a single entry of the data dictionary we have the latitude and how many people per gender are in that latitude.</p> -<p>We iterate the dictionary to extract the different latitudes and people per gender (because we know only two genders are used, we hardcode it to two lists). Then we plot them putting the <code>males</code> and <code>females</code> lists at the bottom and set the labels of each axis. The result is the following:</p> -<p><img src="stacked_bar_chart-1.png" alt="" /></p> -<h3 id="scatter_plots"><a class="anchor" href="#scatter_plots">¶</a>Scatter plots</h3> -<p>This last graphic was very tricky to get right. It’s incredibly hard to find the extent of a city online! We were getting confused because some of the points were way farther than the centre of Cáceres, and the city background is a bit stretched even if the coordinates appear correct. But in the end, we did a pretty good job on it.</p> -<pre><code>def scatter_map(ax, data): - xs = [] - ys = [] - areas = [] - for (long, lat), count in data.items(): - xs.append(long) - ys.append(lat) - areas.append(count / 100) - - if CACERES_MAP.is_file(): - ax.imshow(plt.imread(str(CACERES_MAP)), extent=CACERES_EXTENT) - else: - print('Note:', CACERES_MAP, 'does not exist, not showing it', file=sys.stderr) - - ax.scatter(xs, ys, areas, alpha=0.1) -</code></pre> -<p>This time, the keys in the data dictionary are points and the values are the total count of people in that point. We use a normal <code>for</code> loop to create the different lists. For the areas on how big the circles we are going to represent will be, we divide the count of people by some number, like <code>100</code>, or otherwise they would be huge.</p> -<p>If the file of the map is present, we render it so that we can get a sense on where the points are, but if the file is missing we print a warning.</p> -<p>At last, we draw the scatter plot with some low alpha value (there’s a lot of overlapping points). The result is <em>absolutely gorgeous</em>. (For some definitions of gorgeous, anyway):</p> -<p><img src="scatter_map.png" alt="" /></p> -<p>Just for fun, here’s what it looks like if we don’t divide the count by 100 and lower the opacity to <code>0.01</code>:</p> -<p><img src="scatter_map-2.png" alt="" /></p> -<p>That’s a big solid blob, and the opacity is only set to <code>0.01</code>!</p> -<h3 id="drawing_all_the_graphs_in_the_same_window"><a class="anchor" href="#drawing_all_the_graphs_in_the_same_window">¶</a>Drawing all the graphs in the same window</h3> -<p>To draw all the graphs in the same window instead of getting four different windows we made use of the <a href="https://matplotlib.org/3.2.0/api/_as_gen/matplotlib.pyplot.subplots.html"><code>subplots</code> function</a>, like this:</p> -<pre><code>fig, axes = plt.subplots(2, 2) -</code></pre> -<p>This will create a matrix of two by two of axes that we store in the axes variable (fitting name!). Following this code are the different calls to the methods commented before, where we access each individual axis and pass it to the methods to draw on:</p> -<pre><code>pie_chart(axes[0, 0], genders) -date_tick(axes[0, 1], years) -stacked_bar_chart(axes[1, 0], latitudes) -scatter_map(axes[1, 1], positions) -</code></pre> -<p>Lastly, we plot the different graphics:</p> -<pre><code>plt.show() -</code></pre> -<p>Wrapping everything together, here’s the result:</p> -<p><img src="figures-1.png" alt="" /></p> -<p>The numbers in some of the graphs are a bit crammed together, but we’ll blame that on <code>matplotlib</code>.</p> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing words</h2> -<p>Wow, that was a long journey! We hope that this post helped you pick some interest in data exploration, it’s such a fun world. We also offer the full download for the code below, because we know it’s quite a bit!</p> -<p>Which of the graphs was your favourite? I personally like the count per date, I think it’s nice to see the growth. Let us know in the comments below!</p> -<p><em>download removed</em></p> -</main> -</body> -</html> -
@@ -1,26 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>What is an algorithm?</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Algorithms are a sequence of instructions that can be followed to achieve <em>something</em>. That something can be anything, and depends entirely on your problem!</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<p>For example, a recipe to cook some really nice food is an algorithm: it guides you, step by step, to cook something nice. People dealing with mathemathics also apply algorithms to transform their data. And computers <em>love</em> algorithms, too!</p> -<p>In reality, any computer program can basically be thought as an algorithm. It contains a series of instructions for the computer to execute. Running them is a process that takes time, consumes input and produces output. This is also why terms like «procedure» come up when talking about them.</p> -<p>Computer programs (their algorithms) are normally written in some more specific language, like Java or Python. The instructions are very clear here, which is what we need! A natural language like English is a lot harder to process, and ambiguous. I’m sure you’ve been in arguments because the other person didn’t understand you!</p> -<h2 class="title" id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li>algorithm – definition and meaning: <a href="https://www.wordnik.com/words/algorithm">https://www.wordnik.com/words/algorithm</a></li> -<li>Algorithm: <a href="https://en.wikipedia.org/wiki/Algorithm">https://en.wikipedia.org/wiki/Algorithm</a></li> -<li>What is a «computer algorithm»?: <a href="https://computer.howstuffworks.com/what-is-a-computer-algorithm.htm">https://computer.howstuffworks.com/what-is-a-computer-algorithm.htm</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,256 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>My new computer</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="my_new_computer"><a class="anchor" href="#my_new_computer">¶</a>My new computer</h1> -<div class="date-created-modified">Created 2020-06-19<br> -Modified 2020-07-03</div> -<p>This post will be mostly me ranting about setting up a new laptop, but I also just want to share my upgrade. If you're considering installing Arch Linux with dual-boot for Windows, maybe this post will help. Or perhaps you will learn something new to troubleshoot systems in the future. Let's begin!</p> -<p>Last Sunday, I ordered a Asus Rog Strix G531GT-BQ165 for 900€ (on a 20% discount) with the following specifications:</p> -<ul> -<li>Intel® Core i7-9750H (6 cores, 12MB cache, 2.6GHz up to 4.5GHz, 64-bit)</li> -<li>16GB RAM (8GB*2) DDR4 2666MHz</li> -<li>512GB SSD M.2 PCIe® NVMe</li> -<li>Display 15.6" (1920x1080/16:9) 60Hz</li> -<li>Graphics NVIDIA® GeForce® GTX1650 4GB GDDR5 VRAM</li> -<li>LAN 10/100/1000</li> -<li>Wi-Fi 5 (802.11ac) 2x2 RangeBoost</li> -<li>Bluetooth 5.0</li> -<li>48Wh battery with 3 cells</li> -<li>3 x USB 3.1 (GEN1)</li> -</ul> -<p>I was mostly interested in a general upgrade (better processor, disk, more RAM), although the graphics card is a really nice addition which will allow me to take some time off on more games. After using it for a bit, I really love the feel of the keyboard, and I love the lack of numpad! (No sarcasm, I really don't like numpads.)</p> -<p>This is an upgrade from my previous laptop (Asus X554LA-XX822T), which I won in a competition before entering university in a programming challenge. It has served me really well for the past five years, and had the following specifications:</p> -<ul> -<li>Intel® Core™ i5-5200U</li> -<li>4GB RAM DDR3L 1600MHz (which I upgraded to have 8GB)</li> -<li>1TB HDD</li> -<li>Display 15.6" (1366x768/16:9)</li> -<li>Intel® HD Graphics 4400</li> -<li>LAN 10/100/1000</li> -<li>Wifi 802.11 bgn</li> -<li>Bluetooth 4.0</li> -<li>Battery 2 cells</li> -<li>1 x USB 2.0</li> -<li>2 x USB 3.0</li> -</ul> -<p>Prior to this one, I had a Lenovo (also won in the same competition of the previous year), and prior to that (just for the sake of history), it was HP Pavilion, AMD A4-3300M processor, which unfortunately ended with heating problems. But that's very old now.</p> -<h2 id="laptop_arrival"><a class="anchor" href="#laptop_arrival">¶</a>Laptop arrival</h2> -<p>The laptop arrived 2 days ago at roughly 19:00, which I put charged for 3 hours as the book said. The day after, nightmares began!</p> -<p>Trying to boot it the first two times was fun, as it comes with a somewhat loud sound on boot. I don't know why they would do this, and I immediately turned it off in the BIOS.</p> -<h2 id="installation_journey"><a class="anchor" href="#installation_journey">¶</a>Installation journey</h2> -<p>I spent all of yesterday trying to setup Windows and Arch Linux (and didn't even finish, it took me this morning too and even now it's only half functional). I absolutely <em>hate</em> the amount of partitions the Windows installer creates on a clean disk. So instead, I first went with Arch Linux, and followed the <a href="https://wiki.archlinux.org/index.php/Installation_guide">installation guide on the Arch wiki</a>. Pre-installation, setting up the wireless network, creating the partitions and formatting them went all good. I decided to avoid GRUB at first and go with rEFInd, but alas I missed a big warning on the wiki and after reboot (I would later find out) it was not mounting root properly, so all I had was whatever was in the Initramfs. Reboot didn't work, so I had to hold the power button.</p> -<p>Anyway, once the partitions were created, I went to install Windows (there was a lot of back and forth burning different <code>.iso</code> images on the USB, which was a bit annoying because it wasn't the fastest thing in the world). This was pretty painless, and the process was standard: select advanced to let me choose the right partition, pick the one, say "no" to everything in the services setup, and done. But this was the first Windows <code>.iso</code> I tried. It was an old revision, and the drivers were causing issues when running (something weird about their <code>.dll</code>, manually installing the <code>.ini</code> driver files seemed to work?). The Nvidia drivers didn't want to be installed on such an old revision, after updating everything I could via Windows updates. So back I went to burning a newer Windows <code>.iso</code> and going through the same process again…</p> -<p>Once Windows was ready and I verified that I could boot to it correctly, it was time to have a second go at Arch Linux. And I went through the setup at least three times, getting it wrong every single time, formatting root every single time, redownloading the packages every single pain. If only had I known earlier what the issue was!</p> -<p>Why bother with Arch? I was pretty happy with Linux Mint, and I lowkey wanted to try NixOS, but I had used Arch before and it's a really nice distro overall (up-to-date, has AUR, quite minimal, imperative), except for trying to install rEFInd while chrooted…</p> -<p>In the end I managed to get something half-working, I still need to properly configure WiFi and pulseaudio in my system but hey it works.</p> -<p>I like to be able to dual-boot Windows and Linux because Linux is amazing for productivity, but unfortunately, some games only work fine on Windows. Might as well have both systems and use one for gaming, while the other is my daily driver.</p> -<h2 id="setting_up_arch_linux"><a class="anchor" href="#setting_up_arch_linux">¶</a>Setting up Arch Linux</h2> -<p>This is the process I followed to install Arch Linux in the end, along with a brief explanation on what I think the things are doing and why we are doing them. I think the wiki could do a better job at this, but I also know it's hard to get it right for everyone. Something I do dislike is the link colour, after opening a link it becomes gray and it's a lot easier to miss the fact that it is a link in the first place, which was tough when re-reading it because some links actually matter a lot. Furthermore, important information may just be a single line, also easy to skim over. Anyway, on to the installation process…</p> -<p>The first thing we want to do is configure our keyboard layout or else the keys won't correspond to what we expect:</p> -<pre><code class="language-sh">loadkeys es -</code></pre> -<p>Because we're on a recent system, we want to verify that UEFI works correctly. If we see files listed, then it works fine:</p> -<pre><code class="language-sh">ls /sys/firmware/efi/efivars -</code></pre> -<p>The next thing we want to do is configure the WiFi, because I don't have any ethernet cable nearby. To do this, we check what network interfaces our laptop has (we're looking for the one prefixed with "w", presumably for wireless, such as "wlan0" or "wlo1"), we set it up, scan for available wireless network, and finally connect. In my case, the network has WPA security so we rely on <code>wpa_supplicant</code> to connect, passing the SSID (network name) and password:</p> -<pre><code class="language-sh">ip link -ip link set <IFACE> up -iw dev <IFACE> scan | less -wpa_supplicant -B -i <IFACE> -c <(wpa_passphrase <SSID> <PASS>) -</code></pre> -<p>After that's done, pinging an IP address like "1.1.1.1" should Just Work™, but to be able to resolve hostnames, we need to also setup a nameserver. I'm using Cloudflare's, but you could use any other:</p> -<pre><code class="language-sh">echo nameserver 1.1.1.1 > /etc/resolv.conf -ping archlinux.org -^C -</code></pre> -<p>If the ping works, then network works! If you still have issues, you may need to <a href="https://wiki.archlinux.org/index.php/Network_configuration#Static_IP_address">manually configure a static IP address</a> and add a route with the address of your, well, router. This basically shows if we have any address, adds a static address (so people know who we are), shows what route we have, and adds a default one (so our packets know where to go):</p> -<pre><code class="language-sh">ip address show -ip address add <YOUR ADDR>/24 broadcast + dev <IFACE> -ip route show -ip route add default via <ROUTER ADDR> dev <IFACE> -</code></pre> -<p>Now that we have network available, we can enable NTP to synchronize our system time (this may be required for network operations where certificates have a validity period, not sure; in any case nobody wants a wrong system time):</p> -<pre><code class="language-sh">timedatectl set-ntp true -</code></pre> -<p>After that, we can manage our disk and partitions using <code>fdisk</code>. We want to define partitions to tell the system where it should live. To determine the disk name, we first list them, and then edit it. <code>fdisk</code> is really nice and reminds you at every step that help can be accessed with "m", which you should constantly use to guide you through.</p> -<pre><code class="language-sh">fdisk -l -fdisk /dev/<DISK> -</code></pre> -<p>The partitions I made are the following:</p> -<ul> -<li>A 100MB one for the EFI system.</li> -<li>A 32GB one for Linux' root <code>/</code> partition.</li> -<li>A 200GB one for Linux' home <code>/home</code> partition.</li> -<li>The rest was unallocated for Windows because I did this first.</li> -</ul> -<p>I like to have <code>/home</code> and <code>/</code> separate because I can reinstall root without losing anything from home (projects, music, photos, screenshots, videos…).</p> -<p>After the partitions are made, we format them in FAT32 and EXT4 which are good defaults for EFI, root and home. They need to have a format, or else they won't be usable:</p> -<pre><code class="language-sh">mkfs.fat -F32 /dev/<DISK><PART1> -mkfs.ext4 /dev/<DISK><PART2> -mkfs.ext4 /dev/<DISK><PART3> -</code></pre> -<p>Because the laptop was new, there was no risk to lose anything, but if you're doing a install on a previous system, be very careful with the partition names. Make sure they match with the ones in <code>fdisk -l</code>.</p> -<p>Now that we have usable partitions, we need to mount them or they won't be accessible. We can do this with <code>mount</code>:</p> -<pre><code class="language-sh">mount /dev/<DISK><PART2> /mnt -mkdir /mnt/efi -mount /dev/<DISK><PART1> /mnt/efi -mkdir /mnt/home -mount /dev/<DISK><PART3> /mnt/home -</code></pre> -<p>Remember to use the correct partitions while mounting. We mount everything so that the system knows which partitions we care about, which we will let know about later on.</p> -<p>Next step is to setup the basic Arch Linux system on root, which can be done with <code>pacstrap</code>. What follows the directory is a list of packages, and you may choose any you wish (at least add <code>base</code>, <code>linux</code> and <code>linux-firmware</code>). These can be installed later, but I'd recommend having them from the beginning, just in case:</p> -<pre><code class="language-sh">pacstrap /mnt base linux linux-firmware sudo vim-minimal dhcpcd wpa_supplicant man-db man-pages intel-ucode grub efibootmgr os-prober ntfs-3g -</code></pre> -<p>Because my system has an intel CPU, I also installed <code>intel-ucode</code>.</p> -<p>Next up is generating the <code>fstab</code> file, which we tell to use UUIDs to be on the safe side through <code>-U</code>. This file is important, because without it the system won't know what partitions exist and will happily only boot with the initramfs, without anything of what we just installed at root. Not knowing this made me restart the entire installation process a few times.</p> -<pre><code class="language-sh">genfstab -U /mnt >> /mnt/etc/fstab -</code></pre> -<p>After that's done, we can change our root into our mount point and finish up configuration. We setup our timezone (so DST can be handled correctly if needed), synchronize the hardware clock (to persist the current time to the BIOS), uncomment our locales (exit <code>vim</code> by pressing ESC, then type <code>:wq</code> and press enter), generate locale files (which some applications need), configure language and keymap, update the hostname of our laptop and what indicate what <code>localhost</code> means…</p> -<pre><code class="language-sh">ln -sf /usr/share/zoneinfo/<REGION>/<CITY> /etc/localtime -hwclock --systohc -vim /etc/locale.gen -locale-gen -echo LANG=es_ES.UTF-8 > /etc/locale.conf -echo KEYMAP=es > /etc/vconsole.conf -echo <HOST> /etc/hostname -cat <<EOF > /etc/hosts -127.0.0.1 localhost -::1 localhost -127.0.1.1 <HOST>.localdomain <HOST> -EOF -</code></pre> -<p>Really, we could've done all of this later, and the same goes for setting root's password with <code>passwd</code> or creating users (some of the groups you probably want are <code>power</code> and <code>wheel</code>).</p> -<p>The important part here is installing GRUB (which also needed the <code>efibootmgr</code> package):</p> -<pre><code class="language-sh">grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB -</code></pre> -<p>If we want GRUB to find our Windows install, we also need the <code>os-prober</code> and <code>ntfs-3g</code> packages that we installed earlier with <code>pacstrap</code>, and with those we need to mount the Windows partition somewhere. It doesn't matter where. With that done, we can generate the GRUB configuration file which lists all the boot options:</p> -<pre><code class="language-sh">mkdir /windows -mount /dev/<DISK><PART5> /windows -grub-mkconfig -o /boot/grub/grub.cfg -</code></pre> -<p>(In my case, I installed Windows before completing the Arch install, which created an additional partition in between).</p> -<p>With GRUB ready, we can exit the chroot and reboot the system, and if all went well, you should be greeted with a choice of operating system to use:</p> -<pre><code class="language-sh">exit -reboot -</code></pre> -<p>If for some reason you need to find what mountpoints were active prior to rebooting (to <code>unmount</code> them for example), you can use <code>findmnt</code>.</p> -<p>Before GRUB I tried rEFInd, which as I explained had issues with for missing a warning. Then I tried systemd-boot, which did not pick up Arch at first. That's where the several reinstalls come from, I didn't want to work with a half-worked system so I mostly redid the entire process quite a few times.</p> -<h2 id="migrating_to_the_new_laptop"><a class="anchor" href="#migrating_to_the_new_laptop">¶</a>Migrating to the new laptop</h2> -<p>I had a external disk formatted with NTFS. Of course, after moving every file I cared about from my previous Linux install caused all the permissions to reset. All my <code>.git</code> repositories, dirty with file permission changes! This is going to take a while to fix, or maybe I should just <code>git config core.fileMode false</code>. Here is a <a href="https://stackoverflow.com/a/2083563">lovely command</a> to sort them out on a per-repository basis:</p> -<pre><code class="language-sh">git diff --summary | grep --color 'mode change 100644 => 100755' | cut -d' ' -f7- | xargs -d'\n' chmod -x -</code></pre> -<p>I never realized how much I had stored over the years, but it really was a lot. While moving things to the external disk, I tried to do some cleanup, such as removing some build artifacts which needlessly occupy space, or completely skipping all the binary application files. If I need those I will install them anyway. The process was mostly focused on finding all the projects and program data that I did care about, or even some game saves. Nothing too difficult, but definitely time consuming.</p> -<h2 id="tuning_arch"><a class="anchor" href="#tuning_arch">¶</a>Tuning Arch</h2> -<p>Now that our system is ready, install <code>pacman-contrib</code> to grab a copy of the <code>rankmirrors</code> speed. It should help speed up the download of whatever packages you want to install, since it will help us <a href="https://wiki.archlinux.org/index.php/Mirrors#List_by_speed">rank the mirrors by download speed</a>. Making a copy of the file is important, otherwise whenever you try to install something it will fail saying it can't find anything.</p> -<pre><code class="language-sh">cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup -sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.backup -rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup | tee /etc/pacman.d/mirrorlist -</code></pre> -<p>This will take a while, but it should be well worth it. We're using <code>tee</code> to see the progress as it goes.</p> -<p>Some other packages I installed after I had a working system in no particular order:</p> -<ul> -<li><code>xfce4</code> and <code>xorg-server</code>. I just love the simplicity of XFCE.</li> -<li><code>xfce4-whiskermenu-plugin</code>, a really nice start menu.</li> -<li><code>xfce4-pulseaudio-plugin</code> and <code>pavucontrol</code>, to quickly adjust the audio with my mouse.</li> -<li><code>xfce4-taskmanager</code>, a GUI alternative I generally prefer to <code>htop</code>.</li> -<li><code>pulseaudio</code> and <code>pulseaudio-alsa</code> to get nice integration with XFCE4 and audio mixing.</li> -<li><code>firefox</code>, which comes with fonts too. A really good web browser.</li> -<li><code>git</code>, to commit <del>crimes</del> code.</li> -<li><code>code</code>, a wonderful editor which I used to write this blog entry.</li> -<li><code>nano</code>, so much nicer to write a simple commit message.</li> -<li><code>python</code> and <code>python-pip</code>, my favourite language to toy around ideas or use as a calculator.</li> -<li><code>telegram-desktop</code>, for my needs on sharing memes.</li> -<li><code>cmus</code> and <code>mpv</code>, a simple terminal music player and media player.</li> -<li><code>openssh</code>, to connect into any VPS I have access to.</li> -<li><code>base-devel</code>, necessary to build most projects I'll find myself working with (or even compiling some projects Rust which I installed via <code>rustup</code>).</li> -<li><code>flac</code>, <code>libmad</code>, <code>opus</code>, and <code>libvorbis</code>, to be able to play more audio files.</li> -<li><code>inkscape</code>, to make random drawings.</li> -<li><code>ffmpeg</code>, to convert media or record screen.</li> -<li><code>xclip</code>, to automatically copy screenshots to my clipboard.</li> -<li><code>gvfs</code>, needed by Thunar to handle mounting and having a trash (perma-deletion by default can be nasty sometimes).</li> -<li><code>noto-fonts</code>, <code>noto-fonts-cjk</code>, <code>noto-fonts-extra</code> and <code>noto-fonts-emoji</code>, if you don't want missing gliphs everywhere.</li> -<li><code>xfce4-notifyd</code> and <code>libnotify</code>, for notifications.</li> -<li><code>cronie</code>, to be able to <code>crontab -e</code>. Make sure to <code>system enable cronie</code>.</li> -<li><code>xarchiver</code> (with <code>p7zip</code>, <code>zip</code>, <code>unzip</code> and <code>unrar</code>) to uncompress stuff.</li> -<li><code>xreader</code> to read <code>.pdf</code> files.</li> -<li><code>sqlitebrowser</code> is always nice to tinker around with SQLite databases.</li> -<li><code>jre8-openjdk</code> if you want to run Java applications.</li> -<li><code>smartmontools</code> is nice with a SSD to view your disk statistics.</li> -</ul> -<p>After that, I configured my Super L key to launch <code>xfce4-popup-whiskermenu</code> so that it opens the application menu, pretty much the same as it would on Windows, moved the panels around and configured them to my needs, and it feels like home once more.</p> -<p>I made some mistakes while <a href="https://wiki.archlinux.org/index.php/Systemd-networkd">configuring systemd-networkd</a> and accidentally added a service that was incorrect, which caused boot to wait for it to timeout before completing. My boot time was taking 90 seconds longer because of this! <a href="https://www.reddit.com/r/archlinux/comments/4nv9yi/my_arch_greets_me_now_with_a_start_job/">The solution was to remove said service</a>, so this is something to look out for.</p> -<p>In order to find what was taking long, I had to edit the <a href="https://wiki.archlinux.org/index.php/kernel_parameters">kernel parameters</a> to remove the <code>quiet</code> option. I prefer seeing the output on what my computer is doing anyway, because it gives me a sense of progress and most importantly is of great value when things go wrong. Another interesting option is <code>noauto,x-systemd.automount</code>, which makes a disk lazily-mounted. If you have a slow disk, this could help speed things up.</p> -<p>If you see a service taking long, you can also use <code>systemd-analyze blame</code> to see what takes the longest, and <code>systemctl list-dependencies</code> is also helpful to find what services are active.</p> -<p>My <code>locale charmap</code> was spitting out a bunch of warnings:</p> -<pre><code class="language-sh">$ locale charmap -locale: Cannot set LC_CTYPE to default locale: No such file or directory -locale: Cannot set LC_MESSAGES to default locale: No such file or directory -locale: Cannot set LC_ALL to default locale: No such file or directory -ANSI_X3.4-1968 -</code></pre> -<p>…ANSI encoding? Immediately I added the following to <code>~/.bashrc</code> and <code>~/.profile</code>:</p> -<pre><code class="language-sh">export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 -export LANGUAGE=en_US.UTF-8 -</code></pre> -<p>For some reason, I also had to edit <code>xfce4-terminal</code>'s preferences in advanced to change the default character encoding to UTF-8. This also solved my issues with pasting things into the terminal, and also proper rendering! I guess pastes were not working because it had some characters that could not be encoded.</p> -<p>To have working notifications, I added the following to <code>~/.bash_profile</code> after <code>exec startx</code>:</p> -<pre><code class="language-sh">systemctl --user start xfce4-notifyd.service -</code></pre> -<p>I'm pretty sure there's a better way to do this, or maybe it's not even necessary, but this works for me.</p> -<p>Some of the other things I had left to do was setting up <code>sccache</code> to speed up Rust builds:</p> -<pre><code class="language-sh">cargo install sccache -echo export RUSTC_WRAPPER=sccache >> ~/.bashrc -</code></pre> -<p>Once I had <code>cargo</code> ready, installed <code>hacksaw</code> and <code>shotgun</code> with it to perform screenshots.</p> -<p>I also disabled the security delay when downloading files in Firefox because it's just annoying, in <code>about:config</code> setting <code>security.dialog_enable_delay</code> to <code>0</code>, and added the <a href="https://alisdair.mcdiarmid.org/kill-sticky-headers/">Kill sticky headers</a> to my bookmarks (you may prefer <a href="https://github.com/t-mart/kill-sticky">the updated version</a>).</p> -<p>The <code>utils-linux</code> comes with a <code>fstrim</code> utility to <a href="https://wiki.archlinux.org/index.php/Solid_state_drive#Periodic_TRIM">trim the SSD weekly</a>, which I want enabled via <code>systemctl enable fstrim.timer</code> (you may also want to <code>start</code> it if you don't reboot often). For more SSD tips, check <a href="https://easylinuxtipsproject.blogspot.com/p/ssd.html">How to optimize your Solid State Drive</a>.</p> -<p>If the sound is funky prior to reboot, try <code>pulseaudio --kill</code> and <code>pulseaudio --start</code>, or delete <code>~/.config/pulse</code>.</p> -<p>I haven't been able to get the brightness keys to work yet, but it's not a big deal, because scrolling on the power manager plugin of Xfce does work (and also <code>xbacklight</code> works, or writing directly to <code>/sys/class/backlight/*</code>).</p> -<h2 id="tuning_windows"><a class="anchor" href="#tuning_windows">¶</a>Tuning Windows</h2> -<p>On the Windows side, I disabled the annoying Windows defender by running (<kbd>Ctrl+R</kbd>) <code>gpedit.msc</code> and editing:</p> -<ul> -<li><em>Computer Configuration > Administrative Templates > Windows Components > Windows Defender » Turn off Windows Defender » Enable</em></li> -<li><em>User Configuration > Administrative Templates > Start Menu and Taskbar » Remove Notifications and Action Center » Enable</em></li> -</ul> -<p>I also updated the <a href="https://github.com/WindowsLies/BlockWindows/raw/master/hosts"><code>hosts</code> file</a> (located at <code>%windir%\system32\Drivers\etc\hosts</code>) with the hope that it will stop some of the telemetry.</p> -<p>Last, to have consistent time on Windows and Linux, I changed the following registry key for a <code>qword</code> with value <code>1</code>:</p> -<pre><code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal -</code></pre> -<p>(The key might not exist, but you can create it if that's the case).</p> -<p>All this time, my laptop had the keyboard lights on, which have been quite annoying. Apparently, they also can cause <a href="https://www.reddit.com/r/ValveIndex/comments/cm6pos/psa_uninstalldisable_aura_sync_lighting_if_you/">massive FPS drops</a>. I headed over to <a href="https://rog.asus.com/downloads/">Asus Rog downloads</a>, selected Aura Sync…</p> -<pre><code class="language-md"># Not Found - -The requested URL /campaign/aura/us/Sync.html was not found on this server. - -Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. -</code></pre> -<p>…great! I'll just find the <a href="https://www.asus.com/campaign/aura/global/">Aura site</a> somewhere else…</p> -<pre><code class="language-md"># ASUS - -# We'll be back. - -Hi, our website is temporarily closed for service enhancements. - -We'll be back shortly.Thank you for your patience! -</code></pre> -<p>Oh come on. After waiting for the next day, I headed over, downloaded their software, tried to install it and it was an awful experience. It felt like I was purposedly installing malware. It spammed and flashed a lot of <code>cmd</code>'s on screen as if it was a virus. It was stuck at 100% doing that and then, Windows blue-screened with <code>KERNEL_MODE_HEAP_CORRUPTION</code>. Amazing. How do you screw up this bad?</p> -<p>Well, at least rebooting worked. I tried to <a href="https://answers.microsoft.com/en-us/windows/forum/all/unable-to-uninstall-asus-aura-sync-utility/e9bec36c-e62f-4773-80be-88fb68dace16">uninstall Aura, but of course that failed</a>. Using the <a href="https://support.microsoft.com/en-us/help/17588/windows-fix-problems-that-block-programs-being-installed-or-removed">troubleshooter to uninstall programs</a> helped me remove most of the crap that was installed.</p> -<p>After searching around how to disable the lights (because <a href="https://rog.asus.com/forum/showthread.php?112786-Option-to-Disable-Aura-Lights-on-Strix-G-series-(G531GT)-irrespective-of-OSes">my BIOS did not have this setting</a>), I stumbled upon <a href="https://rog.asus.com/us/innovation/armoury_crate/">"Armoury Crate"</a>. Okay, fine, I will install that.</p> -<p>The experience wasn't much better. It did the same thing with a lot of consoles flashing on screen. And of course, it resulted in another blue-screen, this time <code>KERNEL_SECURITY_CHECK_FAILURE</code>. To finish up, the BSOD kept happening as I rebooted the system. <del>Time to reinstall Windows once more.</del> After booting and crashing a few more times I could get into secure mode and perform the reinstall from there, which saved me from burning the <code>.iso</code> again.</p> -<p>Asus software might be good, but the software is utter crap.</p> -<p>After trying out <a href="https://github.com/wroberts/rogauracore">rogauracore</a> (which didn't list my model), it worked! I could disable the stupid lights from Linux, and <a href="https://gitlab.com/CalcProgrammer1/OpenRGB/-/wikis/home">OpenRGB</a> also works on Windows which may be worth checking out too.</p> -<p>Because <code>rougauracore</code> helped me and they linked to <a href="https://github.com/linuxhw/hw-probe/blob/master/README.md#appimage">hw-probe</a>, I decided to <a href="https://linux-hardware.org/?probe=0e3e48c501">run it on my system</a>, with the hopes it is useful for other people.</p> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing words</h2> -<p>I hope the installation journey is at least useful to someone, or that you enjoyed reading about it all. If not, sorry!</p> -</main> -</body> -</html> -
@@ -1,44 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Shattered Pixel Dungeon</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="shattered_pixel_dungeon"><a class="anchor" href="#shattered_pixel_dungeon">¶</a>Shattered Pixel Dungeon</h1> -<div class="date-created-modified">Created 2019-06-03<br> -Modified 2020-10-03</div> -<p><a href="https://shatteredpixel.com/shatteredpd/">Shattered Pixel Dungeon</a> is the classic roguelike RPG game with randomly-generated dungeons. As a new player, it was a bit frustrating to be constantly killed on the first levels of the dungeon, but with some practice it's easy to reach high levels if you can kill the first boss.</p> -<h2 id="basic_tips"><a class="anchor" href="#basic_tips">¶</a>Basic Tips</h2> -<p>The game comes with its own tips, but here's a short and straight-forward summary:</p> -<ul> -<li><strong>Don't rush into enemies</strong>. Abuse doors and small corridors to kill them one by one. You can use the clock on the bottom left to wait a turn without moving.</li> -<li><strong>Explore each level at full</strong>. You will find goodies and gain XP while doing so.</li> -<li><strong>Upon finding a special room</strong> (e.g. has a chest but is protected by piranhas), drink all potions that you found in that level until there's one that helps you (e.g. be invisible so piranhas leave you alone). There is guaranteed to be a helpful one per level with special rooms.</li> -<li><strong>Drink potions as early as possible</strong>. Harmful potions do less damage on early levels (and if you die, you lose less). This will keep them identified early for the rest of the game.</li> -<li><strong>Read scrolls as early as possible</strong> as well. This will keep them identified. It may be worth to wait until you have an item which may be cursed and until the level is clear, because some scrolls clean curses and others alert enemies.</li> -<li><strong>Food and health are resources</strong> that you have to <em>manage</em>, not keep them always at full. Even if you are starving and taking damage, you may not need to eat <em>just yet</em>, since food is scarce. Eat when you are low on health or in possible danger.</li> -<li><strong>Piranhas</strong>. Seriously, just leave them alone if you are melee. They're free food if you're playing ranged, though.</li> -<li><strong>Prefer armor over weapons</strong>. And make sure to identify or clean it from curses before wearing anything!</li> -<li><strong>Find a dew vial early</strong>. It's often a better idea to store dew (health) for later than to use it as soon as possible.</li> -</ul> -<h2 id="bosses"><a class="anchor" href="#bosses">¶</a>Bosses</h2> -<p>There is a boss every 5 levels.</p> -<ul> -<li><strong>Level 5 boss</strong>. Try to stay on water, but don't let <em>it</em> stay on water since it will heal. Be careful when he starts enraging.</li> -<li><strong>Level 10 boss</strong>. Ranged weapons are good against it.</li> -<li><strong>Level 15 boss</strong>. I somehow managed to tank it with a health potion.</li> -<li><strong>Level 20 boss</strong>. I didn't get this far just yet. You are advised to use scrolls of magic mapping in the last levels to skip straight to the boss, since there's nothing else of value.</li> -<li><strong>Level 25 boss</strong>. The final boss. Good job if you made it this far!</li> -</ul> -<h2 id="mage"><a class="anchor" href="#mage">¶</a>Mage</h2> -<p>If you followed the basic tips, you will sooner or later make use of two scrolls of upgrade in a single run. This will unlock the mage class, which is ridiculously powerful. He starts with a ranged-weapon, a magic missile wand, which is really helpful to keep enemies at a distance. Normally, you want to use this at first to surprise attack them soon, and if you are low on charges, you may go melee on normal enemies if you are confident.</p> -<h2 id="luck"><a class="anchor" href="#luck">¶</a>Luck</h2> -<p>This game is all about luck and patience! Some runs will be better than others, and you should thank and pray the RNG gods for them. If you don't, they will only give you cursed items and not a single scroll to clean them. So, good luck and enjoy playing!</p> -</main> -</body> -</html> -
@@ -1,102 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Atemporal Blog Posts</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="atemporal_blog_posts"><a class="anchor" href="#atemporal_blog_posts">¶</a>Atemporal Blog Posts</h1> -<div class="date-created-modified">2020-10-03</div> -<p>These are some interesting posts and links I've found around the web. I believe they are quite interesting and nice reads, so if you have the time, I encourage you to check some out.</p> -<h2 id="algorithms"><a class="anchor" href="#algorithms">¶</a>Algorithms</h2> -<ul> -<li>http://www.tannerhelland.com/4660/dithering-eleven-algorithms-source-code/. Image Dithering: Eleven Algorithms and Source Code. What does it mean and how to achieve it?</li> -<li>https://cristian.io/post/bloom-filters/. Idempotence layer on bloom filters. What are they and how can they help?</li> -<li>https://en.wikipedia.org/wiki/Huffman_coding. Huffman coding. This encoding is a simple yet interesting way of compressing information.</li> -<li>https://github.com/mxgmn/WaveFunctionCollapse. Wave Function Collapse. Bitmap & tilemap generation from a single example with the help of ideas from quantum mechanics.</li> -<li>https://blog.nelhage.com/2015/02/regular-expression-search-with-suffix-arrays/. Regular Expression Search with Suffix Arrays. A way to efficiently search large amounts of text.</li> -</ul> -<h2 id="culture"><a class="anchor" href="#culture">¶</a>Culture</h2> -<ul> -<li>https://www.wired.com/story/ideas-joi-ito-robot-overlords/. Why Westerners Fear Robots and the Japanese Do Not. Explains some possible reasons for this case.</li> -<li>http://catb.org/~esr/faqs/smart-questions.html. How To Ask Questions The Smart Way. Some bits of hacker culture and amazing tips on how to ask a question.</li> -<li>http://apenwarr.ca/log/?m=201809#14. XML, blockchains, and the strange shapes of progress. Some of history about XML and blockchain.</li> -<li>https://czep.net/17/legion-of-lobotomized-unices.html. Legion of lobotomized unices. A time where computers are treated a lot more nicely.</li> -<li>https://eli.thegreenplace.net/2016/the-expression-problem-and-its-solutions/. The Expression Problem and its solutions. What is it and what can we do to solve it?</li> -<li>http://allendowney.blogspot.com/2015/08/the-inspection-paradox-is-everywhere.html. The Inspection Paradox is Everywhere. Interesting and very common phenomena.</li> -<li>https://github.com/ChrisKnott/Algojammer. An experimental code editor for writing algorithms. Contains several links to different tools for reverse debugging.</li> -<li>http://habitatchronicles.com/2017/05/what-are-capabilities/. What Are Capabilities? Good ideas with great security implications.</li> -<li>https://blog.aurynn.com/2015/12/16-contempt-culture. Contempt Culture. Or why you should not speak crap about your non-favourite programming languages.</li> -<li>https://www.lesswrong.com/posts/tscc3e5eujrsEeFN4/well-kept-gardens-die-by-pacifism. Well-Kept Gardens Die By Pacifism. Risks any online community can run into.</li> -<li>https://ncase.me/. It's Nicky Case! They make some cool things worth checking out, I really like "we become what we behold".</li> -</ul> -<h2 id="debate"><a class="anchor" href="#debate">¶</a>Debate</h2> -<ul> -<li>https://steemit.com/opensource/@crell/open-source-is-awful. Open Source is awful. Has some points about why is it bad and how it could improve.</li> -<li>http://www.mondo2000.com/2018/01/17/pink-lexical-goop-dark-side-autocorrect/. Pink Lexical Goop: The Dark Side of Autocorrect. It can shape how you think.</li> -<li>http://blog.ploeh.dk/2015/08/03/idiomatic-or-idiosyncratic/. Idiomatic or idiosyncratic? Can porting code constructs from other languages have a positive effect?</li> -<li>https://gamasutra.com/view/news/169296/Indepth_Functional_programming_in_C.php. In-depth: Functional programming in C++. Is it useful to bother with functional concepts in a language like C++?</li> -<li>https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/. Notes on structured concurrency, or: Go statement considered harmful.</li> -<li>https://queue.acm.org/detail.cfm?id=3212479. C Is Not a Low-level Language. Could there be alternative programming models designed for more specialized CPUs?</li> -</ul> -<h2 id="food_for_thought"><a class="anchor" href="#food_for_thought">¶</a>Food for Thought</h2> -<ul> -<li>https://www.hillelwayne.com/post/divide-by-zero/. 1/0 = 0. Explores why it makes sense to redefine mathemathics under some circumstances, and why it is possible to do so.</li> -<li>https://jeremykun.com/2018/04/13/for-mathematicians-does-not-mean-equality/. For mathematicians, = does not mean equality. What other definitions does the equal sign have?</li> -<li>https://www.lesswrong.com/posts/2MD3NMLBPCqPfnfre/cached-thoughts. Cached Thoughts. How is it possible that our brains work at all?</li> -<li>http://tonsky.me/blog/disenchantment/. Software disenchantment. Faster hardware and slower software is a trend. -<ul> -<li>https://blackhole12.com/blog/software-engineering-is-bad-but-it-s-not-that-bad/. Software Engineering Is Bad, But That's Not Why. This post has some good counterpoints to Software disenchantment.</li> -</ul> -</li> -<li>http://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/. What Color is Your Function? Spoiler: can we approach asynchronous IO better?</li> -<li>https://hackernoon.com/im-harvesting-credit-card-numbers-and-passwords-from-your-site-here-s-how-9a8cb347c5b5. I'm harvesting credit card numbers and passwords from your site. A word of warning when mindlessly adding dependencies.</li> -<li>https://medium.com/message/everything-is-broken-81e5f33a24e1. Everything Is Broken. Some of the (probable) truths about our world.</li> -</ul> -<h2 id="funny"><a class="anchor" href="#funny">¶</a>Funny</h2> -<ul> -<li>http://thedailywtf.com/articles/We-Use-BobX. We Use BobX. BobX.</li> -<li>http://thedailywtf.com/articles/the-inner-json-effect. The Inner JSON Effect. For some reason, custom languages are in.</li> -<li>https://thedailywtf.com/articles/exponential-backup. Exponential Backup. Far better than git.</li> -<li>https://thedailywtf.com/articles/ITAPPMONROBOT. ITAPPMONROBOT. Solving software problems with hardware.</li> -<li>https://thedailywtf.com/articles/a-tapestry-of-threads. A Tapestry of Threads.More threads must mean faster code, right?</li> -<li>https://medium.com/commitlog/a-brief-totally-accurate-history-of-programming-languages-cd93ec806124. A Brief Totally Accurate History Of Programming Languages. Don't take offense for it!</li> -</ul> -<h2 id="graphics"><a class="anchor" href="#graphics">¶</a>Graphics</h2> -<ul> -<li>http://shaunlebron.github.io/visualizing-projections/. Visualizing Projections. Small post about different projection methods.</li> -<li>http://www.iquilezles.org/www/index.htm. A <em>lot</em> of useful and quality articles regarding computer graphics.</li> -</ul> -<h2 id="history"><a class="anchor" href="#history">¶</a>History</h2> -<ul> -<li>https://twobithistory.org/2018/08/18/ada-lovelace-note-g.html. What Did Ada Lovelace's Program Actually Do?. And other characters that took part in the beginning's of programming.</li> -<li>https://chrisdown.name/2018/01/02/in-defence-of-swap.html. In defence of swap: common misconceptions. Swap is still an useful concept.</li> -<li>https://www.pacifict.com/Story/. The Graphing Calculator Story. A great classic Apple tale.</li> -<li>https://twobithistory.org/2018/10/14/lisp.html. How Lisp Became God's Own Programming Language. Lisp as a foundational programming language.</li> -</ul> -<h2 id="motivational"><a class="anchor" href="#motivational">¶</a>Motivational</h2> -<ul> -<li>https://www.joelonsoftware.com/2002/01/06/fire-and-motion/. Fire And Motion. What does actually take to get things done?</li> -<li>https://realmensch.org/2017/08/25/the-parable-of-the-two-programmers/. The Parable of the Two Programmers. This tale is about two different types of programmer and their respective endings in a company, illustrating how the one you wouldn't expect to actually ends in a better situation.</li> -<li>https://byorgey.wordpress.com/2018/05/06/conversations-with-a-six-year-old-on-functional-programming/. Conversations with a six-year-old on functional programming. Little kids today can be really interested in technological topics.</li> -<li>https://bulletproofmusician.com/how-many-hours-a-day-should-you-practice/. How Many Hours a Day Should You Practice?. While the article is about music, it applies to any other areas.</li> -<li>http://nathanmarz.com/blog/suffering-oriented-programming.html. Suffering-oriented programming. A possibly new approach on how you could tackle your new projects.</li> -<li>https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/. Things You Should Never Do, Part I. There is no need to rewrite your code.</li> -</ul> -<h2 id="optimization"><a class="anchor" href="#optimization">¶</a>Optimization</h2> -<ul> -<li>http://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html. What Every C Programmer Should Know About Undefined Behavior #1/3. Explains what undefined behaviour is and why it makes sense.</li> -<li>http://ridiculousfish.com/blog/posts/labor-of-division-episode-i.html. Labor of Division (Episode I). Some tricks to divide without division.</li> -<li>http://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html. A Great Old-Timey Game-Programming Hack. Abusing instructions to make games playable even on the slowest hardware.</li> -<li>https://web.archive.org/web/20191213224640/https://people.eecs.berkeley.edu/~sangjin/2012/12/21/epoll-vs-kqueue.html. Scalable Event Multiplexing: epoll vs kqueue. How good OS primitives can really help performance and scability.</li> -<li>https://adamdrake.com/command-line-tools-can-be-235x-faster-than-your-hadoop-cluster.html. Command-line Tools can be 235x Faster than your Hadoop Cluster. Or how to use the right tool for the right job.</li> -<li>https://nullprogram.com/blog/2018/05/27/. When FFI Function Calls Beat Native C. How lua beat C at it and the explanation behind it.</li> -<li>http://igoro.com/archive/gallery-of-processor-cache-effects/. Gallery of Processor Cache Effects. Knowing a few things about the cache can make a big difference.</li> -</ul> -</main> -</body> -</html> -
@@ -1,31 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Reflexión sobre la Inteligencia artificial</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="reflexión_sobre_la_inteligencia_artificial"><a class="anchor" href="#reflexión_sobre_la_inteligencia_artificial">¶</a>Reflexión sobre la Inteligencia artificial</h1> -<div class="date-created-modified">2016-06-13</div> -<blockquote> -<p>Nota: esta reflexión ha sido sacada de una conversación en Telegram, aunque ha sido lo más adaptada posible a formato de blog.</p> -</blockquote> -<h2 id="conversación_del_12_03_16"><a class="anchor" href="#conversación_del_12_03_16">¶</a>Conversación del 12.03.16</h2> -<p>Pienso que para conseguir una verdadera inteligencia artificial debemos abstraernos mucho. Es decir, siempre hay una pequeña parte de <em>Pero es que el ser humano, los sentimientos, tal, cual</em>... Igual simplemente, absolutamente todo esté programado. Cuando actúas de manera que no sabes por qué por ejemplo, seguramente sea una serie de estímulos adecuados que producen esa respuesta porque se ha formado ese camino de neuronas en tu mente. Por ejemplo, el arco reflejo, que es un arco innato.</p> -<ul> -<li><em>Sensación de quemar → retirar</em></li> -<li><em><a href="https://es.wikipedia.org/wiki/Condicionamiento_cl%C3%A1sico">Un estímulo X → una respuesta Y</a></em></li> -</ul> -<p>Es una ida y vuelta instantanea entre sensación y respuesta. El cerebro simplemente es capaz de trabajar con combinaciones más complejas, como por ejemplo la suma, este número con este otro → sale otro número, y se le añade a otro... Hay una especie de <a href="https://es.wikipedia.org/wiki/Recursi%C3%B3n">recursión</a> también, aunque en realidad es que es el mismo estímulo el que <a href="https://es.wikipedia.org/wiki/M%C3%A9todo_%28inform%C3%A1tica%29">"llama"</a> a un determinado camino.</p> -<p>Pero lo verdaderamente impresionante es la consciencia, igual no tenemos consciencia de verdad, igual es como lo sentimos. Siempre nos han hablado de la consciencia pero nadie ha sabido probarla, por lo que sólo tenemos una idea, un concepto. Es aún más impresionante es el hecho de recordar y <a href="https://es.wikipedia.org/wiki/Memoria_de_trabajo">trabajar</a> con la información.</p> -<p>Cuando hablamos de consciencia, estamos simplemente tratando información sobre esa misma información, ¿cómo cojones sentimos lo que pensamos? Yo sé que estoy pensando porque hemos definido <em>pensar</em> como este proceso. ¿Pero cómo coño entiendo yo eso? Es decir, ¿cómo me doy cuenta? por qué lo situo en mi cabeza? Probablemente, aunque el cerebro esté trabajando con todo eso, la sensación sea externa a nosotros, es decir, ocurre en mi cabeza. ¿Pero de verdad lo siento en mi cabeza?</p> -<p>Me estoy rayando.</p> -<p>El verdadero problema está en saber cómo sabemos que estamos pensando. El cerebro se compone de neuronas y conexiones, esa es la base a parte de donde se encuentra todo y tal la base es esa, y las sensaciones táctiles son igual de complejas, las procesa mi cerebro pero las siento en mi mano. ¿Será cosa de costumbre? Yo siento algo y lo situo ahí. Sin embargo sentimos ahí y no por encima o por debajo de, vamos a poner, los dedos de la mano, lo siento justo ahí. ¿Qué coño es realmente la <a href="https://es.wikipedia.org/wiki/Memoria_a_corto_plazo">memoria a corto plazo</a>? (porque lo de la <a href="https://es.wikipedia.org/wiki/Memoria_a_largo_plazo">memoria a largo plazo</a> se traslada ahí cuando la necesitamos para trabajar con ella, por eso es <em>MCP</em> o memoria de trabajo según ciertas teorías).</p> -<p>En fin.</p> -</main> -</body> -</html> -
@@ -1,128 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>A practical example with Hadoop</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>In our <a href="/blog/ribw/introduction-to-hadoop-and-its-mapreduce/">previous Hadoop post</a>, we learnt what it is, how it originated, and how it works, from a theoretical standpoint. Here we will instead focus on a more practical example with Hadoop.</p> -<div class="date-created-modified">Created 2020-04-01<br> -Modified 2020-04-03</div> -<p>This post will showcase my own implementation to implement a word counter for any plain text document that you want to analyze.</p> -<h2 class="title" id="installation"><a class="anchor" href="#installation">¶</a>Installation</h2> -<p>Before running any piece of software, its executable code must first be downloaded into our computers so that we can run it. Head over to <a href="http://hadoop.apache.org/releases.html">Apache Hadoop’s releases</a> and download the <a href="https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz">latest binary version</a> at the time of writing (3.2.1).</p> -<p>We will be using the <a href="https://linuxmint.com/">Linux Mint</a> distribution because I love its simplicity, although the process shown here should work just fine on any similar Linux distribution such as <a href="https://ubuntu.com/">Ubuntu</a>.</p> -<p>Once the archive download is complete, extract it with any tool of your choice (graphical or using the terminal) and execute it. Make sure you have a version of Java installed, such as <a href="https://openjdk.java.net/">OpenJDK</a>.</p> -<p>Here are all the three steps in the command line:</p> -<pre><code>wget https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz -tar xf hadoop-3.2.1.tar.gz -hadoop-3.2.1/bin/hadoop version -</code></pre> -<h2 id="processing_data"><a class="anchor" href="#processing_data">¶</a>Processing data</h2> -<p>To take advantage of Hadoop, we have to design our code to work in the MapReduce model. Both the map and reduce phase work on key-value pairs as input and output, and both have a programmer-defined function.</p> -<p>We will use Java, because it’s a dependency that we already have anyway, so might as well.</p> -<p>Our map function needs to split each of the lines we receive as input into words, and we will also convert them to lowercase, thus preparing the data for later use (counting words). There won’t be bad records, so we don’t have to worry about that.</p> -<p>Copy or reproduce the following code in a file called <code>WordCountMapper.java</code>, using any text editor of your choice:</p> -<pre><code>import java.io.IOException; - -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Mapper; - -public class WordCountMapper extends Mapper<LongWritable, Text, Text, IntWritable> { - @Override - public void map(LongWritable key, Text value, Context context) - throws IOException, InterruptedException { - for (String word : value.toString().split("\\W")) { - context.write(new Text(word.toLowerCase()), new IntWritable(1)); - } - } -} -</code></pre> -<p>Now, let’s create the <code>WordCountReducer.java</code> file. Its job is to reduce the data from multiple values into just one. We do that by summing all the values (our word count so far):</p> -<pre><code>import java.io.IOException; -import java.util.Iterator; - -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Reducer; - -public class WordCountReducer extends Reducer<Text, IntWritable, Text, IntWritable> { - @Override - public void reduce(Text key, Iterable<IntWritable> values, Context context) - throws IOException, InterruptedException { - int count = 0; - for (IntWritable value : values) { - count += value.get(); - } - context.write(key, new IntWritable(count)); - } -} -</code></pre> -<p>Let’s just take a moment to appreciate how absolutely tiny this code is, and it’s Java! Hadoop’s API is really awesome and lets us write such concise code to achieve what we need.</p> -<p>Last, let’s write the <code>main</code> method, or else we won’t be able to run it. In our new file <code>WordCount.java</code>:</p> -<pre><code>import org.apache.hadoop.fs.Path; -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Job; -import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; -import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; - -public class WordCount { - public static void main(String[] args) throws Exception { - if (args.length != 2) { - System.err.println("usage: java WordCount <input path> <output path>"); - System.exit(-1); - } - - Job job = Job.getInstance(); - - job.setJobName("Word count"); - job.setJarByClass(WordCount.class); - job.setMapperClass(WordCountMapper.class); - job.setReducerClass(WordCountReducer.class); - job.setOutputKeyClass(Text.class); - job.setOutputValueClass(IntWritable.class); - - FileInputFormat.addInputPath(job, new Path(args[0])); - FileOutputFormat.setOutputPath(job, new Path(args[1])); - - boolean result = job.waitForCompletion(true); - - System.exit(result ? 0 : 1); - } -} -</code></pre> -<p>And compile by including the required <code>.jar</code> dependencies in Java’s classpath with the <code>-cp</code> switch:</p> -<pre><code>javac -cp "hadoop-3.2.1/share/hadoop/common/*:hadoop-3.2.1/share/hadoop/mapreduce/*" *.java -</code></pre> -<p>At last, we can run it (also specifying the dependencies in the classpath, this one’s a mouthful). Let’s run it on the same <code>WordCount.java</code> source file we wrote:</p> -<pre><code>java -cp ".:hadoop-3.2.1/share/hadoop/common/*:hadoop-3.2.1/share/hadoop/common/lib/*:hadoop-3.2.1/share/hadoop/mapreduce/*:hadoop-3.2.1/share/hadoop/mapreduce/lib/*:hadoop-3.2.1/share/hadoop/yarn/*:hadoop-3.2.1/share/hadoop/yarn/lib/*:hadoop-3.2.1/share/hadoop/hdfs/*:hadoop-3.2.1/share/hadoop/hdfs/lib/*" WordCount WordCount.java results -</code></pre> -<p>Hooray! We should have a new <code>results/</code> folder along with the following files:</p> -<pre><code>$ ls results -part-r-00000 _SUCCESS -$ cat results/part-r-00000 - 154 -0 2 -1 3 -2 1 -addinputpath 1 -apache 6 -args 4 -boolean 1 -class 6 -count 1 -err 1 -exception 1 --snip- (output cut for clarity) -</code></pre> -<p>It worked! Now this example was obviously tiny, but hopefully enough to demonstrate how to get the basics running on real world data.</p> -</main> -</body> -</html> -
@@ -1,433 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>About Boolean Retrieval</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This entry will discuss the section on the <em><a href="https://nlp.stanford.edu/IR-book/pdf/01bool.pdf">Boolean retrieval</a></em> section of the book <em><a href="https://nlp.stanford.edu/IR-book/pdf/irbookprint.pdf">An Introduction to Information Retrieval</a></em>.</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<h2 class="title" id="summary_on_the_topic"><a class="anchor" href="#summary_on_the_topic">¶</a>Summary on the topic</h2> -<p>Boolean retrieval is one of the many ways information retrieval (finding materials that satisfy an information need), often simply called <em>search</em>.</p> -<p>A simple way to retrieve information is to <em>grep</em> through the text (term named after the Unix tool <code>grep</code>), scanning text linearly and excluding it on certain criteria. However, this falls short when the volume of the data grows, more complex queries are desired, or one seeks some sort of ranking.</p> -<p>To avoid linear scanning, we build an <em>index</em> and record for each document whether it contains each term out of our full dictionary of terms (which may be words in a chapter and words in the book). This results in a binary term-document <em>incidence matrix</em>. Such a possible matrix is:</p> -<table class=""> - <tbody> - <tr> - <td> - <em> - word/play - </em> - </td> - <td> - <strong> - Antony and Cleopatra - </strong> - </td> - <td> - <strong> - Julius Caesar - </strong> - </td> - <td> - <strong> - The Tempest - </strong> - </td> - <td> - <strong> - … - </strong> - </td> - </tr> - <tr> - <td> - <strong> - Antony - </strong> - </td> - <td> - 1 - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - Brutus - </strong> - </td> - <td> - 1 - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - Caesar - </strong> - </td> - <td> - 1 - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - Calpurnia - </strong> - </td> - <td> - 0 - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - Cleopatra - </strong> - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - mercy - </strong> - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - 1 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - worser - </strong> - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - 1 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - … - </strong> - </td> - <td> - </td> - <td> - </td> - <td> - </td> - <td> - </td> - </tr> - </tbody> -</table> -<p>We can look at this matrix’s rows or columns to obtain a vector for each term indicating where it appears, or a vector for each document indicating the terms it contains.</p> -<p>Now, answering a query such as <code>Brutus AND Caesar AND NOT Calpurnia</code> becomes trivial:</p> -<pre><code>VECTOR(Brutus) AND VECTOR(Caesar) AND COMPLEMENT(VECTOR(Calpurnia)) -= 110 AND 110 AND COMPLEMENT(010) -= 110 AND 110 AND 101 -= 100 -</code></pre> -<p>The query is only satisfied for our first column.</p> -<p>The <em>Boolean retrieval model</em> is thus a model that treats documents as a set of terms, in which we can perform any query in the form of Boolean expressions of terms, combined with <code>OR</code>, <code>AND</code>, and <code>NOT</code>.</p> -<p>Now, building such a matrix is often not feasible due to the sheer amount of data (say, a matrix with 500,000 terms across 1,000,000 documents, each with roughly 1,000 terms). However, it is important to notice that most of the terms will be <em>missing</em> when examining each document. In our example, this means 99.8% or more of the cells will be 0. We can instead record the <em>positions</em> of the 1’s. This is known as an <em>inverted index</em>.</p> -<p>The inverted index is a dictionary of terms, each containing a list that records in which documents it appears (<em>postings</em>). Applied to boolean retrieval, we would:</p> -<ol> -<li>Collects the documents to be indexed, assign a unique identifier each</li> -<li>Tokenize the text in the documents into a list of terms</li> -<li>Normalize the tokens, which now become indexing terms</li> -<li>Index the documents</li> -</ol> -<table class=""> - <tbody> - <tr> - <td> - <strong> - Dictionary - </strong> - </td> - <td> - <strong> - Postings - </strong> - </td> - </tr> - <tr> - <td> - Brutus - </td> - <td> - 1, 2, 4, 11, 31, 45, 173, 174 - </td> - </tr> - <tr> - <td> - Caesar - </td> - <td> - 1, 2, 4, 5, 6, 16, 57, 132, … - </td> - </tr> - <tr> - <td> - Calpurnia - </td> - <td> - 2, 31, 54, 101 - </td> - </tr> - <tr> - <td> - … - </td> - <td> - </td> - </tr> - </tbody> -</table> -<p>Sort the pairs <code>(term, document_id)</code> so that the terms are alphabetical, and merge multiple occurences into one. Group instances of the same term and split again into a sorted list of postings.</p> -<table class=""> - <tbody> - <tr> - <td> - <strong> - term - </strong> - </td> - <td> - <strong> - document_id - </strong> - </td> - </tr> - <tr> - <td> - I - </td> - <td> - 1 - </td> - </tr> - <tr> - <td> - did - </td> - <td> - 1 - </td> - </tr> - <tr> - <td> - … - </td> - <td> - </td> - </tr> - <tr> - <td> - with - </td> - <td> - 2 - </td> - </tr> - </tbody> -</table> -<table class=""> - <tbody> - <tr> - <td> - <strong> - term - </strong> - </td> - <td> - <strong> - document_id - </strong> - </td> - </tr> - <tr> - <td> - be - </td> - <td> - 2 - </td> - </tr> - <tr> - <td> - brutus - </td> - <td> - 1 - </td> - </tr> - <tr> - <td> - brutus - </td> - <td> - 2 - </td> - </tr> - <tr> - <td> - … - </td> - <td> - </td> - </tr> - </tbody> -</table> -<table class=""> - <tbody> - <tr> - <td> - <strong> - term - </strong> - </td> - <td> - <strong> - frequency - </strong> - </td> - <td> - <strong> - postings list - </strong> - </td> - </tr> - <tr> - <td> - be - </td> - <td> - 1 - </td> - <td> - 2 - </td> - </tr> - <tr> - <td> - brutus - </td> - <td> - 2 - </td> - <td> - 1, 2 - </td> - </tr> - <tr> - <td> - capitol - </td> - <td> - 1 - </td> - <td> - 1 - </td> - </tr> - <tr> - <td> - … - </td> - <td> - </td> - <td> - </td> - </tr> - </tbody> -</table> -<p>Intersecting posting lists now becomes of transversing both lists in order:</p> -<pre><code>Brutus : 1 -> 2 -> 4 -> 11 -> 31 -> 45 -> 173 -> 174 -Calpurnia: 2 -> 31 -> 54 -> 101 -Intersect: 2 -> 31 -</code></pre> -<p>A simple conjunctive query (e.g. <code>Brutus AND Calpurnia</code>) is executed as follows:</p> -<ol> -<li>Locate <code>Brutus</code> in the dictionary</li> -<li>Retrieve its postings</li> -<li>Locate <code>Calpurnia</code> in the dictionary</li> -<li>Retrieve its postings</li> -<li>Intersect (<em>merge</em>) both postings</li> -</ol> -<p>Since the lists are sorted, walking both of them can be done in <em>O(n)</em> time. By also storing the frequency, we can optimize the order in which we execute arbitrary queries, although we won’t go into detail.</p> -<h2 id="thoughts"><a class="anchor" href="#thoughts">¶</a>Thoughts</h2> -<p>The boolean retrieval model can be implemented with relative ease, and can help with storage and efficient querying of the information if we intend to perform boolean queries.</p> -<p>However, the basic design lacks other useful operations, such as a «near» operator, or the ability to rank the results.</p> -<p>All in all, it’s an interesting way to look at the data and query it efficiently.</p> -</main> -</body> -</html> -
@@ -1,2946 +0,0 @@
-<feed xmlns="http://www.w3.org/2005/Atom"><title>pagong</title><id>pagong</id><updated>2020-10-02T22:00:00+00:00</updated><entry><title>Information Retrieval and Web Search</title><id>dist/index/index.html</id><updated>2020-10-02T22:00:00+00:00</updated><published>2020-10-02T22:00:00+00:00</published><summary>During 2020 at university, this subject ("Recuperación de la Información y Búsqueda en la Web")</summary><content type="html" src="dist/index/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Information Retrieval and Web Search</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="information_retrieval_and_web_search"><a class="anchor" href="#information_retrieval_and_web_search">¶</a>Information Retrieval and Web Search</h1> -<div class="date-created-modified">2020-10-03</div> -<p>During 2020 at university, this subject (&quot;Recuperación de la Información y Búsqueda en la Web&quot;) -had us write blog posts as assignments. I think it would be really fun and I wanted to preserve -that work here, with the hopes it's interesting to someone.</p> -<p>The posts were auto-generated from the original HTML files and manually anonymized later.</p> -</main> -</body> -</html> - </content></entry><entry><title>Privado: Final NoSQL evaluation</title><id>dist/final-nosql-evaluation/index.html</id><updated>2020-05-13T22:00:00+00:00</updated><published>2020-05-12T22:00:00+00:00</published><summary>This evaluation is a bit different to my </summary><content type="html" src="dist/final-nosql-evaluation/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: Final NoSQL evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This evaluation is a bit different to my <a href="/blog/ribw/16/nosql-evaluation/">previous one</a> because this time I have been tasked to evaluate the student <code>a(i - 2)</code>, and because I am <code>a = 9</code> that happens to be <code>a(7) =</code> Classmate.</p> -<div class="date-created-modified">Created 2020-05-13<br> -Modified 2020-05-14</div> -<p>Unfortunately for Classmate, the only entry related to NoSQL I have found in their blog is Prima y segunda Actividad: Base de datos NoSQL which does not develop an application as requested for the third entry (as of 14th of May).</p> -<p>This means that, instead, I will evaluate <code>a(i - 3)</code> which happens to be <code>a(6) =</code> Classmate and they do have an entry.</p> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s Evaluation</h2> -<p><strong>Grading: B.</strong></p> -<p>The post I have evaluated is BB.DD. NoSQL RethinkDB 3ª Fase. Aplicación.</p> -<p>It starts with an introduction, properly explaining what database they have chosen and why, but not what application they will be making.</p> -<p>This is detailed just below in the next section, although it’s a bit vague.</p> -<p>The next section talks about the Python dependencies that are required, but they never said they would be making a Python application or that we need to install Python!</p> -<p>The next section talks about the file structure of the project, and they detail what everything part does, although I have missed some code snippets.</p> -<p>The final result is pretty cool and contains many interesting graphs, they provide a download to the source code and list all the relevant references used.</p> -<p>Except for a weird «necesario falta» in the text, it’s otherwise well-written, although given the issues above I cannot grade it with the highest score.</p> -</main> -</body> -</html> - </content></entry><entry><title>Developing a Python application for MongoDB</title><id>dist/developing-a-python-application-for-mongodb/index.html</id><updated>2020-04-15T22:00:00+00:00</updated><published>2020-03-24T23:00:00+00:00</published><summary>This is the third and last post in the MongoDB series, where we will develop a Python application to process and store OpenData inside Mongo.</summary><content type="html" src="dist/developing-a-python-application-for-mongodb/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Developing a Python application for MongoDB</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the third and last post in the MongoDB series, where we will develop a Python application to process and store OpenData inside Mongo.</p> -<div class="date-created-modified">Created 2020-03-25<br> -Modified 2020-04-16</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/mongodb-an-introduction/">MongoDB: an Introduction</a></li> -<li><a href="/blog/ribw/mongodb-basic-operations-and-architecture/">MongoDB: Basic Operations and Architecture</a></li> -<li><a href="/blog/ribw/developing-a-python-application-for-mongodb/">Developing a Python application for MongoDB</a> (this post)</li> -</ul> -<p>This post is co-authored wih a Classmate.</p> -<hr /> -<h2 class="title" id="what_are_we_making_"><a class="anchor" href="#what_are_we_making_">¶</a>What are we making?</h2> -<p>We are going to develop a web application that renders a map, in this case, the town of Cáceres, with which users can interact. When the user clicks somewhere on the map, the selected location will be sent to the server to process. This server will perform geospatial queries to Mongo and once the results are ready, the information is presented back at the webpage.</p> -<p>The data used for the application comes from <a href="https://opendata.caceres.es/">Cáceres’ OpenData</a>, and our goal is that users will be able to find information about certain areas in a quick and intuitive way, such as precise coordinates, noise level, and such.</p> -<h2 id="what_are_we_using_"><a class="anchor" href="#what_are_we_using_">¶</a>What are we using?</h2> -<p>The web application will be using <a href="https://python.org/">Python</a> for the backend, <a href="https://svelte.dev/">Svelte</a> for the frontend, and <a href="https://www.mongodb.com/">Mongo</a> as our storage database and processing center.</p> -<ul> -<li><strong>Why Python?</strong> It’s a comfortable language to write and to read, and has a great ecosystem with <a href="https://pypi.org/">plenty of libraries</a>.</li> -<li><strong>Why Svelte?</strong> Svelte is the New Thing<strong>™</strong> in the world of component frameworks for JavaScript. It is similar to React or Vue, but compiled and with a lot less boilerplate. Check out their <a href="https://svelte.dev/blog/svelte-3-rethinking-reactivity">Svelte post</a> to learn more.</li> -<li><strong>Why Mongo?</strong> We believe NoSQL is the right approach for doing the kind of processing and storage that we expect, and it’s <a href="https://docs.mongodb.com/">very easy to use</a>. In addition, we will be making Geospatial Queries which <a href="https://docs.mongodb.com/manual/geospatial-queries/">Mongo supports</a>.</li> -</ul> -<p>Why didn’t we choose to make a smaller project, you may ask? You will be shocked to hear that we do not have an answer for that!</p> -<p>Note that we will not be embedding <strong>all</strong> the code of the project in this post, or it would be too long! We will include only the relevant snippets needed to understand the core ideas of the project, and not the unnecessary parts of it (for example, parsing configuration files to easily change the port where the server runs is not included).</p> -<h2 id="python_dependencies"><a class="anchor" href="#python_dependencies">¶</a>Python dependencies</h2> -<p>Because we will program it in Python, you need Python installed. You can install it using a package manager of your choice or heading over to the <a href="https://www.python.org/downloads/">Python downloads section</a>, but if you’re on Linux, chances are you have it installed already.</p> -<p>Once Python 3.7 or above is installed, install <a href="https://motor.readthedocs.io/en/stable/"><code>motor</code> (Asynchronous Python driver for MongoDB)</a> and the <a href="https://docs.aiohttp.org/en/stable/web.html"><code>aiohttp</code> server</a> through <code>pip</code>:</p> -<pre><code>pip install aiohttp motor -</code></pre> -<p>Make sure that Mongo is running in the background (this has been described in previous posts), and we should be able to get to work.</p> -<h2 id="web_dependencies"><a class="anchor" href="#web_dependencies">¶</a>Web dependencies</h2> -<p>To work with Svelte and its dependencies, we will need <code>[npm](https://www.npmjs.com/)</code> which comes with <a href="https://nodejs.org/en/">NodeJS</a>, so go and <a href="https://nodejs.org/en/download/">install Node from their site</a>. The download will be different depending on your operating system.</p> -<p>Following <a href="https://svelte.dev/blog/the-easiest-way-to-get-started">the easiest way to get started with Svelte</a>, we will put our project in a <code>client/</code> folder (because this is what the clients see, the frontend). Feel free to tinker a bit with the configuration files to change the name and such, although this isn’t relevant for the rest of the post.</p> -<h2 id="finding_the_data"><a class="anchor" href="#finding_the_data">¶</a>Finding the data</h2> -<p>We are going to work with the JSON files provided by <a href="http://opendata.caceres.es/">OpenData Cáceres</a>. In particular, we want information about the noise, census, vias and trees. To save you the time from <a href="http://opendata.caceres.es/dataset">searching each of these</a>, we will automate the download with code.</p> -<p>If you want to save the data offline or just know what data we’ll be using for other purposes though, you can right click on the following links and select «Save Link As…» with the name of the link:</p> -<ul> -<li><code>[noise.json](http://opendata.caceres.es/GetData/GetData?dataset=om:MedicionRuido&amp;format=json)</code></li> -<li><code>[census.json](http://opendata.caceres.es/GetData/GetData?dataset=om:InformacionPadron&amp;year=2017&amp;format=json)</code></li> -<li><code>[vias.json](http://opendata.caceres.es/GetData/GetData?dataset=om:InformacionPadron&amp;year=2017&amp;format=json)</code></li> -<li><code>[trees.json](http://opendata.caceres.es/GetData/GetData?dataset=om:Arbol&amp;format=json)</code></li> -</ul> -<h2 id="backend"><a class="anchor" href="#backend">¶</a>Backend</h2> -<p>It’s time to get started with some code! We will put it in a <code>server/</code> folder because it will contain the Python server, that is, the backend of our application.</p> -<p>We are using <code>aiohttp</code> because we would like our server to be <code>async</code>. We don’t expect a lot of users at the same time, but it’s good to know our server would be well-designed for that use-case. As a bonus, it makes IO points clear in the code, which can help reason about it. The implicit synchronization between <code>await</code> is also a nice bonus.</p> -<h3 id="saving_the_data_in_mongo"><a class="anchor" href="#saving_the_data_in_mongo">¶</a>Saving the data in Mongo</h3> -<p>Before running the server, we must ensure that the data we need is already stored and indexed in Mongo. Our <code>server/data.py</code> will take care of downloading the files, cleaning them up a little (Cáceres’ OpenData can be a bit awkward sometimes), inserting them into Mongo and indexing them.</p> -<p>Downloading the JSON data can be done with <code>[ClientSession.get](https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientSession.get)</code>. We also take this opportunity to clean up the messy encoding from the JSON, which does not seem to be UTF-8 in some cases.</p> -<pre><code>async def load_json(session, url): - fixes = [(old, new.encode('utf-8')) for old, new in [ - (b'\xc3\x83\\u2018', 'Ñ'), - (b'\xc3\x83\\u0081', 'Á'), - (b'\xc3\x83\\u2030', 'É'), - (b'\xc3\x83\\u008D', 'Í'), - (b'\xc3\x83\\u201C', 'Ó'), - (b'\xc3\x83\xc5\xa1', 'Ú'), - (b'\xc3\x83\xc2\xa1', 'á'), - ]] - - async with session.get(url) as resp: - data = await resp.read() - - # Yes, this feels inefficient, but it's not really worth improving. - for old, new in fixes: - data = data.replace(old, new) - - data = data.decode('utf-8') - return json.loads(data) -</code></pre> -<p>Later on, it can be reused for the various different URLs:</p> -<pre><code>import aiohttp - -NOISE_URL = 'http://opendata.caceres.es/GetData/GetData?dataset=om:MedicionRuido&amp;format=json' -# (...other needed URLs here) - -async def insert_to_db(db): - async with aiohttp.ClientSession() as session: - data = await load_json(session, NOISE_URL) - # now we have the JSON data cleaned up, ready to be parsed -</code></pre> -<h3 id="data_model"><a class="anchor" href="#data_model">¶</a>Data model</h3> -<p>With the JSON data in our hands, it’s time to parse it. Always remember to <a href="https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/">parse, don’t validate</a>. With <a href="https://docs.python.org/3/library/dataclasses.html">Python 3.7 <code>dataclasses</code></a> it’s trivial to define classes that will store only the fields we care about, typed, and with proper names:</p> -<pre><code>from dataclasses import dataclass - -Longitude = float -Latitude = float - -@dataclass -class GSON: - type: str - coordinates: (Longitude, Latitude) - -@dataclass -class Noise: - id: int - geo: GSON - level: float -</code></pre> -<p>This makes it really easy to see that, if we have a <code>Noise</code>, we can access its <code>geo</code> data which is a <code>GSON</code> with a <code>type</code> and <code>coordinates</code>, having <code>Longitude</code> and <code>Latitude</code> respectively. <code>dataclasses</code> and <code>[typing](https://docs.python.org/3/library/typing.html)</code> make dealing with this very easy and clear.</p> -<p>Every dataclass will be on its own collection inside Mongo, and these are:</p> -<ul> -<li> -<p>Noise</p> -</li> -<li> -<p>Integer <code>id</code></p> -</li> -<li> -<p>GeoJSON <code>geo</code></p> -</li> -<li> -<p>String <code>type</code></p> -</li> -<li> -<p>Longitude-latitude pair <code>coordinates</code></p> -</li> -<li> -<p>Floating-point number <code>level</code></p> -</li> -<li> -<p>Tree</p> -</li> -<li> -<p>String <code>name</code></p> -</li> -<li> -<p>String <code>gender</code></p> -</li> -<li> -<p>Integer <code>units</code></p> -</li> -<li> -<p>Floating-point number <code>height</code></p> -</li> -<li> -<p>Floating-point number <code>cup_diameter</code></p> -</li> -<li> -<p>Floating-point number <code>trunk_diameter</code></p> -</li> -<li> -<p>Optional string <code>variety</code></p> -</li> -<li> -<p>Optional string <code>distribution</code></p> -</li> -<li> -<p>GeoJSON <code>geo</code></p> -</li> -<li> -<p>Optional string <code>irrigation</code></p> -</li> -<li> -<p>Census</p> -</li> -<li> -<p>Integer <code>year</code></p> -</li> -<li> -<p>Via <code>via</code></p> -</li> -<li> -<p>String <code>name</code></p> -</li> -<li> -<p>String <code>kind</code></p> -</li> -<li> -<p>Integer <code>code</code></p> -</li> -<li> -<p>Optional string <code>history</code></p> -</li> -<li> -<p>Optional string <code>old_name</code></p> -</li> -<li> -<p>Optional floating-point number <code>length</code></p> -</li> -<li> -<p>Optional GeoJSON <code>start</code></p> -</li> -<li> -<p>GeoJSON <code>middle</code></p> -</li> -<li> -<p>Optional GeoJSON <code>end</code></p> -</li> -<li> -<p>Optional list with geometry pairs <code>geometry</code></p> -</li> -<li> -<p>Integer <code>count</code></p> -</li> -<li> -<p>Mapping year-to-count <code>count_per_year</code></p> -</li> -<li> -<p>Mapping gender-to-count <code>count_per_gender</code></p> -</li> -<li> -<p>Mapping nationality-to-count <code>count_per_nationality</code></p> -</li> -<li> -<p>Integer <code>time_year</code></p> -</li> -</ul> -<p>Now, let’s define a method to actually parse the JSON and yield instances from these new data classes:</p> -<pre><code>@classmethod -def iter_from_json(cls, data): - for row in data['results']['bindings']: - noise_id = int(row['uri']['value'].split('/')[-1]) - long = float(row['geo_long']['value']) - lat = float(row['geo_lat']['value']) - level = float(row['om_nivelRuido']['value']) - - yield cls( - id=noise_id, - geo=GSON(type='Point', coordinates=[long, lat]), - level=level - ) -</code></pre> -<p>Here we iterate over the input JSON <code>data</code> bindings and <code>yield cls</code> instances with more consistent naming than the original one. We also extract the data from the many unnecessary nested levels of the JSON and have something a lot flatter to work with.</p> -<p>For those of you who don’t know what <code>yield</code> does (after all, not everyone is used to seeing generators), here’s two functions that work nearly the same:</p> -<pre><code>def squares_return(n): - result = [] - for i in range(n): - result.append(n ** 2) - return result - -def squares_yield(n): - for i in range(n): - yield n ** 2 -</code></pre> -<p>The difference is that the one with <code>yield</code> is «lazy» and doesn’t need to do all the work up-front. It will generate (yield) more values as they are needed when you use a <code>for</code> loop. Generally, it’s a better idea to create generator functions than do all the work early which may be unnecessary. See <a href="https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do">What does the «yield» keyword do?</a> if you still have questions.</p> -<p>With everything parsed, it’s time to insert the data into Mongo. If the data was not present yet (0 documents), then we will download the file, parse it, insert it as documents into the given Mongo <code>db</code>, and index it:</p> -<pre><code>from dataclasses import asdict - -async def insert_to_db(db): - async with aiohttp.ClientSession() as session: - if await db.noise.estimated_document_count() == 0: - data = await load_json(session, NOISE_URL) - - await db.noise.insert_many(asdict(noise) for noise in Noise.iter_from_json(data)) - await db.noise.create_index([('geo', '2dsphere')]) -</code></pre> -<p>We repeat this process for all the other data, and just like that, Mongo is ready to be used in our server.</p> -<h3 id="indices"><a class="anchor" href="#indices">¶</a>Indices</h3> -<p>In order to execute our geospatial queries we have to create an index on the attribute that represents the location, because the operators that we will use requires it. This attribute can be a <a href="https://docs.mongodb.com/manual/reference/geojson/">GeoJSON object</a> or a legacy coordinate pair.</p> -<p>We have decided to use a GeoJSON object because we want to avoid legacy features that may be deprecated in the future.</p> -<p>The attribute is called <code>geo</code> for the <code>Tree</code> and <code>Noise</code> objects and <code>start</code>, <code>middle</code> or <code>end</code> for the <code>Via</code> class. In the <code>Via</code> we are going to index the attribute <code>middle</code> because it is the most representative field for us. Because the <code>Via</code> is inside the <code>Census</code> and it doesn’t have its own collection, we create the index on the <code>Census</code> collection.</p> -<p>The used index type is <code>2dsphere</code> because it supports queries that work on geometries on an earth-like sphere. Another option is the <code>2d</code> index but it’s not a good fit for our because it is for queries that calculate geometries on a two-dimensional plane.</p> -<h3 id="running_the_server"><a class="anchor" href="#running_the_server">¶</a>Running the server</h3> -<p>If we ignore the configuration part of the server creation, our <code>server.py</code> file is pretty simple. Its job is to create a <a href="https://aiohttp.readthedocs.io/en/stable/web.html">server application</a>, setup Mongo and return it to the caller so that they can run it:</p> -<pre><code>import asyncio -import subprocess -import motor.motor_asyncio - -from aiohttp import web - -from . import rest, data - -def create_app(): - ret = subprocess.run('npm run build', cwd='../client', shell=True).returncode - if ret != 0: - exit(ret) - - db = motor.motor_asyncio.AsyncIOMotorClient().opendata - loop = asyncio.get_event_loop() - loop.run_until_complete(data.insert_to_db(db)) - - app = web.Application() - app['db'] = db - - app.router.add_routes([ - web.get('/', lambda r: web.HTTPSeeOther('/index.html')), - *rest.ROUTES, - web.static('/', os.path.join(config['www']['root'], 'public')), - ]) - - return app -</code></pre> -<p>There’s a bit going on here, but it’s nothing too complex:</p> -<ul> -<li>We automatically run <code>npm run build</code> on the frontend because it’s very comfortable to have the frontend built automatically before the server runs.</li> -<li>We create a Motor client and access the <code>opendata</code> database. Into it, we load the data, effectively saving it in Mongo for the server to use.</li> -<li>We create the server application and save a reference to the Mongo database in it, so that it can be used later on any endpoint without needing to recreate it.</li> -<li>We define the routes of our app: root, REST and static (where the frontend files live). We’ll get to the <code>rest</code> part soon. -Running the server is now simple:</li> -</ul> -<pre><code>def main(): - from aiohttp import web - from . import server - - app = server.create_app() - web.run_app(app) - -if __name__ == '__main__': - main() -</code></pre> -<h3 id="rest_endpoints"><a class="anchor" href="#rest_endpoints">¶</a>REST endpoints</h3> -<p>The frontend will communicate with the backend via <a href="https://en.wikipedia.org/wiki/Representational_state_transfer">REST</a> calls, so that it can ask for things like «give me the information associated with this area», and the web server can query the Mongo server to reply with a HTTP response. This little diagram should help:</p> -<p><img src="bitmap.png" alt="" /></p> -<p>What we need to do, then, is define those REST endpoints we mentioned earlier when creating the server. We will process the HTTP request, ask Mongo for the data, and return the HTTP response:</p> -<pre><code>import asyncio -import pymongo - -from aiohttp import web - -async def get_area_info(request): - try: - long = float(request.query['long']) - lat = float(request.query['lat']) - distance = float(request.query['distance']) - except KeyError as e: - raise web.HTTPBadRequest(reason=f'a required parameter was missing: {e.args[0]}') - except ValueError: - raise web.HTTPBadRequest(reason='one of the parameters was not a valid float') - - geo_avg_noise_pipeline = [{ - '$geoNear': { - 'near' : {'type': 'Point', 'coordinates': [long, lat]}, - 'maxDistance': distance, - 'minDistance': 0, - 'spherical' : 'true', - 'distanceField' : 'distance' - } - }] - - db = request.app['db'] - - try: - noise_count, sum_noise, avg_noise = 0, 0, 0 - async for item in db.noise.aggregate(geo_avg_noise_pipeline): - noise_count += 1 - sum_noise += item['level'] - - if noise_count != 0: - avg_noise = sum_noise / noise_count - else: - avg_noise = None - - except pymongo.errors.ConnectionFailure: - raise web.HTTPServiceUnavailable(reason='no connection to database') - - return web.json_response({ - 'tree_count': tree_count, - 'trees_per_type': [[k, v] for k, v in trees_per_type.items()], - 'census_count': census_count, - 'avg_noise': avg_noise, - }) - -ROUTES = [ - web.get('/rest/get-area-info', get_area_info) -] -</code></pre> -<p>In this code, we’re only showing how to return the average noise because that’s the simplest we can do. The real code also fetches tree count, tree count per type, and census count.</p> -<p>Again, there’s quite a bit to go through, so let’s go step by step:</p> -<ul> -<li>We parse the frontend’s <code>request.query</code> into <code>float</code> that we can use. In particular, the frontend is asking us for information at a certain latitude, longitude, and distance. If the query is malformed, we return a proper error.</li> -<li>We create our query for Mongo outside, just so it’s clearer to read.</li> -<li>We access the database reference we stored earlier when creating the server with <code>request.app['db']</code>. Handy!</li> -<li>We try to query Mongo. It may fail if the Mongo server is not running, so we should handle that and tell the client what’s happening. If it succeeds though, we will gather information about the average noise.</li> -<li>We return a <code>json_response</code> with Mongo results for the frontend to present to the user. -You may have noticed we defined a <code>ROUTES</code> list at the bottom. This will make it easier to expand in the future, and the server creation won’t need to change anything in its code, because it’s already unpacking all the routes we define here.</li> -</ul> -<h3 id="geospatial_queries"><a class="anchor" href="#geospatial_queries">¶</a>Geospatial queries</h3> -<p>In order to retrieve the information from Mongo database we have defined two geospatial queries:</p> -<pre><code>geo_query = { - '$nearSphere' : { - '$geometry': { - 'type': 'Point', - 'coordinates': [long, lat] - }, - '$maxDistance': distance, - '$minDistance': 0 - } -} -</code></pre> -<p>This query uses <a href="https://docs.mongodb.com/manual/reference/operator/query/nearSphere/#op._S_nearSphere">the operator <code>$nearSphere</code></a> which return geospatial objects in proximity to a point on a sphere.</p> -<p>The sphere point is represented by the <code>$geometry</code> operator where it is specified the type of geometry and the coordinates (given by the HTTP request).</p> -<p>The maximum and minimum distance are represented by <code>$maxDistance</code> and <code>$minDistance</code> respectively. We specify that the maximum distance is the radio selected by the user.</p> -<pre><code>geo_avg_noise_pipeline = [{ - '$geoNear': { - 'near' : {'type': 'Point', 'coordinates': [long, lat]}, - 'maxDistance': distance, - 'minDistance': 0, - 'spherical' : 'true', - 'distanceField' : 'distance' - } -}] -</code></pre> -<p>This query uses the <a href="https://docs.mongodb.com/manual/core/aggregation-pipeline/">aggregation pipeline</a> stage <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/geoNear/#pipe._S_geoNear"><code>$geoNear</code></a> which returns an ordered stream of documents based on the proximity to a geospatial point. The output documents include an additional distance field.</p> -<p>The <code>near</code> field is mandatory and is the point for which to find the closest documents. In this field it is specified the type of geometry and the coordinates (given by the HTTP request).</p> -<p>The <code>distanceField</code> field is also mandatory and is the output field that will contain the calculated distance. In this case we’ve just called it <code>distance</code>.</p> -<p>Some other fields are <code>maxDistance</code> that indicates the maximum allowed distance from the center of the point, <code>minDistance</code> for the minimum distance, and <code>spherical</code> which tells MongoDB how to calculate the distance between two points.</p> -<p>We specify the maximum distance as the radio selected by the user in the frontend.</p> -<h2 id="frontend"><a class="anchor" href="#frontend">¶</a>Frontend</h2> -<p>As said earlier, our frontend will use Svelte. We already downloaded the template, so we can start developing. For some, this is the most fun part, because they can finally see and interact with some of the results. But for this interaction to work, we needed a functional backend which we now have!</p> -<h3 id="rest_queries"><a class="anchor" href="#rest_queries">¶</a>REST queries</h3> -<p>The frontend has to query the server to get any meaningful data to show on the page. The <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">Fetch API</a> does not throw an exception if the server doesn’t respond with HTTP OK, but we would like one if things go wrong, so that we can handle them gracefully. The first we’ll do is define our own exception <a href="https://stackoverflow.com/a/27724419">which is not pretty</a>:</p> -<pre><code>function NetworkError(message, status) { - var instance = new Error(message); - instance.name = 'NetworkError'; - instance.status = status; - Object.setPrototypeOf(instance, Object.getPrototypeOf(this)); - if (Error.captureStackTrace) { - Error.captureStackTrace(instance, NetworkError); - } - return instance; -} - -NetworkError.prototype = Object.create(Error.prototype, { - constructor: { - value: Error, - enumerable: false, - writable: true, - configurable: true - } -}); -Object.setPrototypeOf(NetworkError, Error); -</code></pre> -<p>But hey, now we have a proper and reusable <code>NetworkError</code>! Next, let’s make a proper and reusabe <code>query</code> function that deals with <code>fetch</code> for us:</p> -<pre><code>async function query(endpoint) { - const res = await fetch(endpoint, { - // if we ever use cookies, this is important - credentials: 'include' - }); - if (res.ok) { - return await res.json(); - } else { - throw new NetworkError(await res.text(), res.status); - } -} -</code></pre> -<p>At last, we can query our web server. The export here tells Svelte that this function should be visible to outer modules (public) as opposed to being private:</p> -<pre><code>export function get_area_info(long, lat, distance) { - return query(`/rest/get-area-info?long=${long}&amp;lat=${lat}&amp;distance=${distance}`); -} -</code></pre> -<p>The attentive reader will have noticed that <code>query</code> is <code>async</code>, but <code>get_area_info</code> is not. This is intentional, because we don’t need to <code>await</code> for anything inside of it. We can just return the <code>[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)</code> that <code>query</code> created and let the caller <code>await</code> it as they see fit. The <code>await</code> here would have been redundant.</p> -<p>For those of you who don’t know what a JavaScript promise is, think of it as an object that represents «an eventual result». The result may not be there yet, but we promised it will be present in the future, and we can <code>await</code> for it. You can also find the same concept in other languages like Python under a different name, such as <a href="https://docs.python.org/3/library/asyncio-future.html#asyncio.Future"><code>Future</code></a>.</p> -<h3 id="map_component"><a class="anchor" href="#map_component">¶</a>Map component</h3> -<p>In Svelte, we can define self-contained components that are issolated from the rest. This makes it really easy to create a modular application. Think of a Svelte component as your own HTML tag, which you can customize however you want, building upon the already-existing components HTML has to offer.</p> -<p>The main thing that our map needs to do is render the map as an image and overlay the selection area as the user hovers the map with their mouse. We could render the image in the canvas itself, but instead we’ll use the HTML <code>&lt;img&gt;</code> tag for that and put a transparent <code>&lt;canvas&gt;</code> on top with some CSS. This should make it cheaper and easier to render things on the canvas.</p> -<p>The <code>Map</code> component will thus render as the user moves the mouse over it, and produce an event when they click so that whatever component is using a <code>Map</code> knows that it was clicked. Here’s the final CSS and HTML:</p> -<pre><code>&lt;style&gt; -div { - position: relative; -} -canvas { - position: absolute; - left: 0; - top: 0; - cursor: crosshair; -} -&lt;/style&gt; - -&lt;div&gt; - &lt;img bind:this={img} on:load={handleLoad} {height} src=&quot;caceres-municipality.svg&quot; alt=&quot;Cáceres (municipality)&quot;/&gt; - &lt;canvas - bind:this={canvas} - on:mousemove={handleMove} - on:wheel={handleWheel} - on:mouseup={handleClick}/&gt; -&lt;/div&gt; -</code></pre> -<p>We hardcode a map source here, but ideally this would be provided by the server. The project is already complex enough, so we tried to avoid more complexity than necessary.</p> -<p>We bind the tags to some variables declared in the JavaScript code of the component, along with some functions and parameters to let the users of <code>Map</code> customize it just a little.</p> -<p>Here’s the gist of the JavaScript code:</p> -<pre><code>&lt;script&gt; - import { createEventDispatcher, onMount } from 'svelte'; - - export let height = 200; - - const dispatch = createEventDispatcher(); - - let img; - let canvas; - - const LONG_WEST = -6.426881; - const LONG_EAST = -6.354143; - const LAT_NORTH = 39.500064; - const LAT_SOUTH = 39.443201; - - let x = 0; - let y = 0; - let clickInfo = null; // [x, y, radius] - let radiusDelta = 0.005 * height; - let maxRadius = 0.2 * height; - let minRadius = 0.01 * height; - let radius = 0.05 * height; - - function handleLoad() { - canvas.width = img.width; - canvas.height = img.height; - } - - function handleMove(event) { - const { left, top } = this.getBoundingClientRect(); - x = Math.round(event.clientX - left); - y = Math.round(event.clientY - top); - } - - function handleWheel(event) { - if (event.deltaY &lt; 0) { - if (radius &lt; maxRadius) { - radius += radiusDelta; - } - } else { - if (radius &gt; minRadius) { - radius -= radiusDelta; - } - } - event.preventDefault(); - } - - function handleClick(event) { - dispatch('click', { - // the real code here maps the x/y/radius values to the right range, here omitted - x: ..., - y: ..., - radius: ..., - }); - } - - onMount(() =&gt; { - const ctx = canvas.getContext('2d'); - let frame; - - (function loop() { - frame = requestAnimationFrame(loop); - - // the real code renders mouse area/selection, here omitted for brevity - ... - }()); - - return () =&gt; { - cancelAnimationFrame(frame); - }; - }); -&lt;/script&gt; -</code></pre> -<p>Let’s go through bit-by-bit:</p> -<ul> -<li>We define a few variables and constants for later use in the final code.</li> -<li>We define the handlers to react to mouse movement and clicks. On click, we dispatch an event to outer components.</li> -<li>We setup the render loop with animation frames, and cancel the current frame appropriatedly if the component disappears.</li> -</ul> -<h3 id="app_component"><a class="anchor" href="#app_component">¶</a>App component</h3> -<p>Time to put everything together! We wil include our function to make REST queries along with our <code>Map</code> component to render things on screen.</p> -<pre><code>&lt;script&gt; - import Map from './Map.svelte'; - import { get_area_info } from './rest.js' - let selection = null; - let area_info_promise = null; - function handleMapSelection(event) { - selection = event.detail; - area_info_promise = get_area_info(selection.x, selection.y, selection.radius); - } - function format_avg_noise(avg_noise) { - if (avg_noise === null) { - return '(no data)'; - } else { - return `${avg_noise.toFixed(2)} dB`; - } - } -&lt;/script&gt; - -&lt;div class=&quot;container-fluid&quot;&gt; - &lt;div class=&quot;row&quot;&gt; - &lt;div class=&quot;col-3&quot; style=&quot;max-width: 300em;&quot;&gt; - &lt;div class=&quot;text-center&quot;&gt; - &lt;h1&gt;Caceres Data Consultory&lt;/h1&gt; - &lt;/div&gt; - &lt;Map height={400} on:click={handleMapSelection}/&gt; - &lt;div class=&quot;text-center mt-4&quot;&gt; - {#if selection === null} - &lt;p class=&quot;m-1 p-3 border border-bottom-0 bg-info text-white&quot;&gt;Click on the map to select the area you wish to see details for.&lt;/p&gt; - {:else} - &lt;h2 class=&quot;bg-dark text-white&quot;&gt;Selected area&lt;/h2&gt; - &lt;p&gt;&lt;b&gt;Coordinates:&lt;/b&gt; ({selection.x}, {selection.y})&lt;/p&gt; - &lt;p&gt;&lt;b&gt;Radius:&lt;/b&gt; {selection.radius} meters&lt;/p&gt; - {/if} - &lt;/div&gt; - &lt;/div&gt; - &lt;div class=&quot;col-sm-4&quot;&gt; - &lt;div class=&quot;row&quot;&gt; - {#if area_info_promise !== null} - {#await area_info_promise} - &lt;p&gt;Fetching area information…&lt;/p&gt; - {:then area_info} - &lt;div class=&quot;col&quot;&gt; - &lt;div class=&quot;text-center&quot;&gt; - &lt;h2 class=&quot;m-1 bg-dark text-white&quot;&gt;Area information&lt;/h2&gt; - &lt;ul class=&quot;list-unstyled&quot;&gt; - &lt;li&gt;There are &lt;b&gt;{area_info.tree_count} trees &lt;/b&gt; within the area&lt;/li&gt; - &lt;li&gt;The &lt;b&gt;average noise&lt;/b&gt; is &lt;b&gt;{format_avg_noise(area_info.avg_noise)}&lt;/b&gt;&lt;/li&gt; - &lt;li&gt;There are &lt;b&gt;{area_info.census_count} persons &lt;/b&gt; within the area&lt;/li&gt; - &lt;/ul&gt; - &lt;/div&gt; - {#if area_info.trees_per_type.length &gt; 0} - &lt;div class=&quot;text-center&quot;&gt; - &lt;h2 class=&quot;m-1 bg-dark text-white&quot;&gt;Tree count per type&lt;/h2&gt; - &lt;/div&gt; - &lt;ul class=&quot;list-group&quot;&gt; - {#each area_info.trees_per_type as [type, count]} - &lt;li class=&quot;list-group-item&quot;&gt;{type} &lt;span class=&quot;badge badge-dark float-right&quot;&gt;{count}&lt;/span&gt;&lt;/li&gt; - {/each} - &lt;/ul&gt; - {/if} - &lt;/div&gt; - {:catch error} - &lt;p&gt;Failed to fetch area information: {error.message}&lt;/p&gt; - {/await} - {/if} - &lt;/div&gt; - &lt;/div&gt; - &lt;/div&gt; -&lt;/div&gt; -</code></pre> -<ul> -<li>We import the <code>Map</code> component and REST function so we can use them.</li> -<li>We define a listener for the events that the <code>Map</code> produces. Such event will trigger a REST call to the server and save the result in a promise used later.</li> -<li>We’re using Bootstrap for the layout because it’s a lot easier. In the body we add our <code>Map</code> and another column to show the selection information.</li> -<li>We make use of Svelte’s <code>{#await}</code> to nicely notify the user when the call is being made, when it was successful, and when it failed. If it’s successful, we display the info.</li> -</ul> -<h2 id="results"><a class="anchor" href="#results">¶</a>Results</h2> -<p>Lo and behold, watch our application run!</p> -<p><video controls="controls" src="sr-2020-04-14_09-28-25.mp4"></video></p> -<p>In this video you can see our application running, but let’s describe what is happening in more detail.</p> -<p>When the application starts running (by opening it in your web browser of choice), you can see a map with the town of Cáceres. Then you, the user, can click to retrieve the information within the selected area.</p> -<p>It is important to note that one can make the selection area larger or smaller by trying to scroll up or down, respectively.</p> -<p>Once an area is selected, it is colored green in order to let the user know which area they have selected. Under the map, the selected coordinates and the radius (in meters) is also shown for the curious. At the right side the information concerning the selected area is shown, such as the number of trees, the average noise and the number of persons. If there are trees in the area, the application also displays the trees per type, sorted by the number of trees.</p> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>We hope you enjoyed reading this post as much as we enjoyed writing it! Feel free to download the final project and play around with it. Maybe you can adapt it for even more interesting purposes!</p> -<p><em>download removed</em></p> -<p>To run the above code:</p> -<ol> -<li>Unzip the downloaded file.</li> -<li>Make a copy of <code>example-server-config.ini</code> and rename it to <code>server-config.ini</code>, then edit the file to suit your needs.</li> -<li>Run the server with <code>python -m server</code>.</li> -<li>Open <a href="http://localhost:9000">localhost:9000</a> in your web browser (or whatever port you chose) and enjoy!</li> -</ol> -</main> -</body> -</html> - </content></entry><entry><title>MongoDB: an Introduction</title><id>dist/mongodb-an-introduction/index.html</id><updated>2020-04-07T22:00:00+00:00</updated><published>2020-03-04T23:00:00+00:00</published><summary>This is the first post in the MongoDB series, where we will introduce the MongoDB database system and take a look at its features and installation methods.</summary><content type="html" src="dist/mongodb-an-introduction/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>MongoDB: an Introduction</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the first post in the MongoDB series, where we will introduce the MongoDB database system and take a look at its features and installation methods.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-04-08</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/mongodb-an-introduction/">MongoDB: an Introduction</a> (this post)</li> -<li><a href="/blog/ribw/mongodb-basic-operations-and-architecture/">MongoDB: Basic Operations and Architecture</a></li> -<li><a href="/blog/ribw/developing-a-python-application-for-mongodb/">Developing a Python application for MongoDB</a></li> -</ul> -<p>This post is co-authored wih Classmate.</p> -<hr /> -<div class="image-container"> -<img src="mongodb.png" alt="NoSQL database – MongoDB – First delivery" /> -<div class="image-caption"></div> -</div> -<p> -<h2 class="title" id="purpose_of_technology"><a class="anchor" href="#purpose_of_technology">¶</a>Purpose of technology</h2> -<p>MongoDB is a <strong>general purpose, document-based, distributed database</strong> built for modern application developers and for the cloud era, with the scalability and flexibility that you want with the querying and indexing that you need. It being a document database means it stores data in JSON-like documents.</p> -<p>The Mongo team believes this is the most natural way to think about data, which is (they claim) much more expressive and powerful than the traditional row/column model, since programmers think in objects.</p> -<h2 id="how_it_works"><a class="anchor" href="#how_it_works">¶</a>How it works</h2> -<p>MongoDB’s architecture can be summarized as follows:</p> -<ul> -<li>Document data model.</li> -<li>Distributed systems design.</li> -<li>Unified experience with freedom to run it anywhere.</li> -</ul> -<p>For a more in-depth explanation, MongoDB offers a <a href="https://www.mongodb.com/collateral/mongodb-architecture-guide">download to the MongoDB Architecture Guide</a> with roughly ten pages worth of text.</p> -<p><img src="knGHenfTGA4kzJb1PHmS9EQvtZl2QlhbIPN15M38m8fZfZf7ODwYfhf0Tltr.png" alt="" /> -_ Overview of MongoDB’s architecture_</p> -<p>Regarding usage, MongoDB comes with a really nice introduction along with JavaScript, Python, Java, C++ or C# code at our choice, which describes the steps necessary to make it work. Below we will describe a common workflow.</p> -<p>First, we must <strong>connect</strong> to a running MongoDB instance. Once the connection succeeds, we can access individual «collections», which we can think of as <em>tables</em> where collections of data is stored.</p> -<p>For instance, we could <strong>insert</strong> an arbitrary JSON document into the <code>restaurants</code> collection to store information about a restaurant.</p> -<p>At any other point in time, we can <strong>query</strong> these collections. The queries range from trivial, empty ones (which would retrieve all the documents and fields) to more rich and complex queries (for instance, using AND and OR operators, checking if data exists, and then looking for a value in a list).</p> -<p>MongoDB also supports the creation of <strong>indices</strong>, similar to those in other database systems. It allows for the creation of indices on any field or subfields.</p> -<p>In Mongo, the <strong>aggregation pipeline</strong> allows us to filter and analyze data based on a given set of criteria. For example, we could pull all the documents in the <code>restaurants</code> collection that have a <code>category</code> of <code>Bakery</code> using the <code>$match</code> operator. Then, we can group them by their star rating using the <code>$group</code> operator. Using the accumulator operator, <code>$sum</code>, we can see how many bakeries in our collection have each star rating.</p> -<h2 id="features"><a class="anchor" href="#features">¶</a>Features</h2> -<p>The features can be seen all over the place in their site, because it’s something they make a lot of emphasis on:</p> -<ul> -<li> -<p><strong>Easy development</strong>, thanks to the document data model, something they claim to be «the best way to work with data».</p> -</li> -<li> -<p>Data is stored in flexible JSON-like documents.</p> -</li> -<li> -<p>This model directly maps to the objects in the application’s code.</p> -</li> -<li> -<p>Ad hoc queries, indexing, and real time aggregation provide powerful ways to access and analyze the data.</p> -</li> -<li> -<p><strong>Powerful query language</strong>, with a rich and expressive query language that allows filtering and sorting by any field, no matter how nested it may be within a document. The queries are themselves JSON, and thus easily composable.</p> -</li> -<li> -<p><strong>Support for aggregations</strong> and other modern use-cases such as geo-based search, graph search, and text search.</p> -</li> -<li> -<p><strong>A distributed systems design</strong>, which allows developers to intelligently put data where they want it. High availability, horizontal scaling, and geographic distribution are built in and easy to use.</p> -</li> -<li> -<p><strong>A unified experience</strong> with the freedom to run anywhere, which allows developers to future-proof their work and eliminate vendor lock-in.</p> -</li> -</ul> -<h2 id="corner_in_cap_theorem"><a class="anchor" href="#corner_in_cap_theorem">¶</a>Corner in CAP theorem</h2> -<p>MongoDB’s position in the CAP theorem (Consistency, Availability, Partition Tolerance) depends on the database and driver configurations, and the type of disaster.</p> -<ul> -<li>With <strong>no partitions</strong>, the main focus is <strong>CA</strong>.</li> -<li>If there are **partitions **but the system is <strong>strongly connected</strong>, the main focus is <strong>AP</strong>: non-synchronized writes from the old primary are ignored.</li> -<li>If there are <strong>partitions</strong> but the system is <strong>not strongly connected</strong>, the main focus is <strong>CP</strong>: only read access is provided to avoid inconsistencies. -The general consensus seems to be that Mongo is <strong>CP</strong>.</li> -</ul> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>We will be using the apt-based installation.</p> -<p>The Community version can be downloaded by anyone through <a href="https://www.mongodb.com/download-center/community">MongoDB Download Center</a>, where one can choose the version, Operating System and Package.MongoDB also seems to be <a href="https://packages.ubuntu.com/eoan/mongodb">available in Ubuntu’s PPAs</a>. </p> -<h2 id="installation"><a class="anchor" href="#installation">¶</a>Installation</h2> -<p>We will be using an Ubuntu-based system, with apt available. To install MongoDB, we open a terminal and run the following command:</p> -<pre><code>apt install mongodb -</code></pre> -<p>After confirming that we do indeed want to install the package, we should be able to run the following command to verify that the installation was successful:</p> -<pre><code>mongod --version -</code></pre> -<p>The output should be similar to the following: </p> -<pre><code>db version v4.0.16 -git version: 2a5433168a53044cb6b4fa8083e4cfd7ba142221 -OpenSSL version: OpenSSL 1.1.1 11 Sep 2018 -allocator: tcmalloc -modules: none -build environment: - distmod: ubuntu1804 - distarch: x86_64 - target_arch: x86_64 -</code></pre> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://www.mongodb.com/">MongoDB’s official site</a></li> -<li><a href="https://www.mongodb.com/what-is-mongodb">What is MongoDB?</a></li> -<li><a href="https://www.mongodb.com/mongodb-architecture">MongoDB Architecture</a></li> -<li><a href="https://stackoverflow.com/q/11292215/4759433">Where does mongodb stand in the CAP theorem?</a></li> -<li><a href="https://medium.com/@bikas.katwal10/mongodb-vs-cassandra-vs-rdbms-where-do-they-stand-in-the-cap-theorem-1bae779a7a15">What is the CAP Theorem? MongoDB vs Cassandra vs RDBMS, where do they stand in the CAP theorem?</a></li> -<li><a href="https://www.quora.com/Why-doesnt-MongoDB-have-availability-in-the-CAP-theorem">Why doesn’t MongoDB have availability in the CAP theorem?</a></li> -<li><a href="https://docs.mongodb.com/manual/installation/">Install MongoDB</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>MongoDB: Basic Operations and Architecture</title><id>dist/mongodb-basic-operations-and-architecture/index.html</id><updated>2020-04-07T22:00:00+00:00</updated><published>2020-03-04T23:00:00+00:00</published><summary>This is the second post in the MongoDB series, where we will take a look at the </summary><content type="html" src="dist/mongodb-basic-operations-and-architecture/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>MongoDB: Basic Operations and Architecture</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the second post in the MongoDB series, where we will take a look at the <a href="https://stackify.com/what-are-crud-operations/">CRUD operations</a> they support, the data model and architecture used.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-04-08</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/mongodb-an-introduction/">MongoDB: an Introduction</a></li> -<li><a href="/blog/ribw/mongodb-basic-operations-and-architecture/">MongoDB: Basic Operations and Architecture</a> (this post)</li> -<li><a href="/blog/ribw/developing-a-python-application-for-mongodb/">Developing a Python application for MongoDB</a></li> -</ul> -<p>This post is co-authored wih Classmate, and in it we will take an explorative approach using the <code>mongo</code> command line shell to execute commands against the database. It even has TAB auto-completion, which is awesome!</p> -<hr /> -<p>Before creating any documents, we first need to create somewhere for the documents to be in. And before we create anything, the database has to be running, so let’s do that first. If we don’t have a service installed, we can run the <code>mongod</code> command ourselves in some local folder to make things easier:</p> -<pre><code>$ mkdir -p mongo-database -$ mongod --dbpath mongo-database -</code></pre> -<p>Just like that, we will have Mongo running. Now, let’s connect to it using the <code>mongo</code> command in another terminal (don’t close the terminal where the server is running, we need it!). By default, it connects to localhost, which is just what we need.</p> -<pre><code>$ mongo -</code></pre> -<h2 class="title" id="create"><a class="anchor" href="#create">¶</a>Create</h2> -<h3 id="create_a_database"><a class="anchor" href="#create_a_database">¶</a>Create a database</h3> -<p>Let’s list the databases:</p> -<pre><code>&gt; show databases -admin 0.000GB -config 0.000GB -local 0.000GB -</code></pre> -<p>Oh, how interesting! There’s already some databases, even though we just created the directory where Mongo will store everything. However, they seem empty, which make sense.</p> -<p>Creating a new database is done by <code>use</code>-ing a name that doesn’t exist. Let’s call our new database «helloworld».</p> -<pre><code>&gt; use helloworld -switched to db helloworld -</code></pre> -<p>Good! Now the «local variable» called <code>db</code> points to our <code>helloworld</code> database.</p> -<pre><code>&gt; db -helloworld -</code></pre> -<p>What happens if we print the databases again? Surely our new database will show up now…</p> -<pre><code>&gt; show databases -admin 0.000GB -config 0.000GB -local 0.000GB -</code></pre> -<p>…maybe not! It seems Mongo won’t create the database until we create some collections and documents in it. Databases contain collections, and inside collections (which you can think of as tables) we can insert new documents (which you can think of as rows). Like in many programming languages, the dot operator is used to access these «members».</p> -<h3 id="create_a_document"><a class="anchor" href="#create_a_document">¶</a>Create a document</h3> -<p>Let’s add a new greeting into the <code>greetings</code> collection:</p> -<pre><code>&gt; db.greetings.insert({message: &quot;¡Bienvenido!&quot;, lang: &quot;es&quot;}) -WriteResult({ &quot;nInserted&quot; : 1 }) - -&gt; show collections -greetings - -&gt; show databases -admin 0.000GB -config 0.000GB -helloworld 0.000GB -local 0.000GB -</code></pre> -<p>That looks promising! We can also see our new <code>helloworld</code> database also shows up. The Mongo shell actually works on JavaScript-like code, which is why we can use a variant of JSON (BSON) to insert documents (note the lack of quotes around the keys, convenient!).</p> -<p>The <a href="https://docs.mongodb.com/manual/reference/method/db.collection.insert/index.html"><code>insert</code></a> method actually supports a list of documents, and by default Mongo will assign a unique identifier to each. If we don’t want that though, all we have to do is add the <code>_id</code> key to our documents.</p> -<pre><code>&gt; db.greetings.insert([ -... {message: &quot;Welcome!&quot;, lang: &quot;en&quot;}, -... {message: &quot;Bonjour!&quot;, lang: &quot;fr&quot;}, -... ]) -BulkWriteResult({ - &quot;writeErrors&quot; : [ ], - &quot;writeConcernErrors&quot; : [ ], - &quot;nInserted&quot; : 2, - &quot;nUpserted&quot; : 0, - &quot;nMatched&quot; : 0, - &quot;nModified&quot; : 0, - &quot;nRemoved&quot; : 0, - &quot;upserted&quot; : [ ] -}) -</code></pre> -<h3 id="create_a_collection"><a class="anchor" href="#create_a_collection">¶</a>Create a collection</h3> -<p>In this example, we created the collection <code>greetings</code> implicitly, but behind the scenes Mongo made a call to <a href="https://docs.mongodb.com/manual/reference/method/db.createCollection/"><code>createCollection</code></a>. Let’s do just that:</p> -<pre><code>&gt; db.createCollection(&quot;goodbyes&quot;) -{ &quot;ok&quot; : 1 } - -&gt; show collections -goodbyes -greetings -</code></pre> -<p>The method actually has a default parameter to configure other options, like the maximum size of the collection or maximum amount of documents in it, validation-related options, and so on. These are all described in more details in the documentation.</p> -<h2 id="read"><a class="anchor" href="#read">¶</a>Read</h2> -<p>To read the contents of a document, we have to <a href="https://docs.mongodb.com/manual/reference/method/db.collection.find/index.html"><code>find</code></a> it.</p> -<pre><code>&gt; db.greetings.find() -{ &quot;_id&quot; : ObjectId(&quot;5e74829a0659f802b15f18dd&quot;), &quot;message&quot; : &quot;¡Bienvenido!&quot;, &quot;lang&quot; : &quot;es&quot; } -{ &quot;_id&quot; : ObjectId(&quot;5e7487b90659f802b15f18de&quot;), &quot;message&quot; : &quot;Welcome!&quot;, &quot;lang&quot; : &quot;en&quot; } -{ &quot;_id&quot; : ObjectId(&quot;5e7487b90659f802b15f18df&quot;), &quot;message&quot; : &quot;Bonjour!&quot;, &quot;lang&quot; : &quot;fr&quot; } -</code></pre> -<p>That’s a bit unreadable for my taste, can we make it more <a href="https://docs.mongodb.com/manual/reference/method/cursor.pretty/index.html"><code>pretty</code></a>?</p> -<pre><code>&gt; db.greetings.find().pretty() -{ - &quot;_id&quot; : ObjectId(&quot;5e74829a0659f802b15f18dd&quot;), - &quot;message&quot; : &quot;¡Bienvenido!&quot;, - &quot;lang&quot; : &quot;es&quot; -} -{ - &quot;_id&quot; : ObjectId(&quot;5e7487b90659f802b15f18de&quot;), - &quot;message&quot; : &quot;Welcome!&quot;, - &quot;lang&quot; : &quot;en&quot; -} -{ - &quot;_id&quot; : ObjectId(&quot;5e7487b90659f802b15f18df&quot;), - &quot;message&quot; : &quot;Bonjour!&quot;, - &quot;lang&quot; : &quot;fr&quot; -} -</code></pre> -<p>Gorgeous! We can clearly see Mongo created an identifier for us automatically. The queries are also JSON, and support a bunch of operators (prefixed by <code>$</code>), known as <a href="https://docs.mongodb.com/manual/reference/operator/query/">Query Selectors</a>. Here’s a few:</p> -<table> - <thead> - <tr> - <th> - Operation - </th> - <th> - Syntax - </th> - <th> - RDBMS equivalent - </th> - </tr> - </thead> - <tbody> - <tr> - <td> - Equals - </td> - <td> - <code> - {key: {$eq: value}} - </code> - <br/> - Shorthand: - <code> - {key: value} - </code> - </td> - <td> - <code> - where key = value - </code> - </td> - </tr> - <tr> - <td> - Less Than - </td> - <td> - <code> - {key: {$lte: value}} - </code> - </td> - <td> - <code> - where key &lt; value - </code> - </td> - </tr> - <tr> - <td> - Less Than or Equal - </td> - <td> - <code> - {key: {$lt: value}} - </code> - </td> - <td> - <code> - where key &lt;= value - </code> - </td> - </tr> - <tr> - <td> - Greater Than - </td> - <td> - <code> - {key: {$gt: value}} - </code> - </td> - <td> - <code> - where key &gt; value - </code> - </td> - </tr> - <tr> - <td> - Greater Than or Equal - </td> - <td> - <code> - {key: {$gte: value}} - </code> - </td> - <td> - <code> - where key &gt;= value - </code> - </td> - </tr> - <tr> - <td> - Not Equal - </td> - <td> - <code> - {key: {$ne: value}} - </code> - </td> - <td> - <code> - where key != value - </code> - </td> - </tr> - <tr> - <td> - And - </td> - <td> - <code> - {$and: [{k1: v1}, {k2: v2}]} - </code> - </td> - <td> - <code> - where k1 = v1 and k2 = v2 - </code> - </td> - </tr> - <tr> - <td> - Or - </td> - <td> - <code> - {$or: [{k1: v1}, {k2: v2}]} - </code> - </td> - <td> - <code> - where k1 = v1 or k2 = v2 - </code> - </td> - </tr> - </tbody> -</table> -<p>The operations all do what you would expect them to do, and their names are really intuitive. Aggregating operations with <code>$and</code> or <code>$or</code> can be done anywhere in the query, nested any level deep.</p> -<h2 id="update"><a class="anchor" href="#update">¶</a>Update</h2> -<p>Updating a document can be done by using <a href="https://docs.mongodb.com/manual/reference/method/db.collection.save/index.html"><code>save</code></a> on an already-existing document (that is, the document we want to save has <code>_id</code> and it’s in the collection already). If the document is not in the collection yet, this method will create it.</p> -<pre><code>&gt; db.greetings.save({_id: ObjectId(&quot;5e74829a0659f802b15f18dd&quot;), message: &quot;¡Bienvenido, humano!&quot;, &quot;lang&quot; : &quot;es&quot;}) -WriteResult({ &quot;nMatched&quot; : 1, &quot;nUpserted&quot; : 0, &quot;nModified&quot; : 1 }) - -&gt; db.greetings.find({lang: &quot;es&quot;}) -{ &quot;_id&quot; : ObjectId(&quot;5e74829a0659f802b15f18dd&quot;), &quot;message&quot; : &quot;¡Bienvenido, humano!&quot;, &quot;lang&quot; : &quot;es&quot; } -</code></pre> -<p>Alternatively, the <a href="https://docs.mongodb.com/manual/reference/method/db.collection.update/index.html"><code>update</code></a> method takes a query and new value.</p> -<pre><code>&gt; db.greetings.update({lang: &quot;en&quot;}, {$set: {message: &quot;Welcome, human!&quot;}}) -WriteResult({ &quot;nMatched&quot; : 1, &quot;nUpserted&quot; : 0, &quot;nModified&quot; : 1 }) - -&gt; db.greetings.find({lang: &quot;en&quot;}) -{ &quot;_id&quot; : ObjectId(&quot;5e7487b90659f802b15f18de&quot;), &quot;message&quot; : &quot;Welcome, human!&quot;, &quot;lang&quot; : &quot;en&quot; } -</code></pre> -<h2 id="indexing"><a class="anchor" href="#indexing">¶</a>Indexing</h2> -<p>Creating an index is done with <a href="https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/index.html"><code>createIndex</code></a>:</p> -<pre><code>&gt; db.greetings.createIndex({lang: +1}) -{ - &quot;createdCollectionAutomatically&quot; : false, - &quot;numIndexesBefore&quot; : 1, - &quot;numIndexesAfter&quot; : 2, - &quot;ok&quot; : 1 -} -</code></pre> -<p>Here, we create an ascending index on the lang key. Descending order is done with <code>-1</code>. Now a query for <code>lang</code> in our three documents will be fast… well maybe iteration over three documents was faster than an index.</p> -<h2 id="delete"><a class="anchor" href="#delete">¶</a>Delete</h2> -<h3 id="delete_a_document"><a class="anchor" href="#delete_a_document">¶</a>Delete a document</h3> -<p>I have to confess, I can’t talk French. I learnt it long ago and it’s long forgotten, so let’s remove the translation I copied online from our greetings with <a href="https://docs.mongodb.com/manual/reference/method/db.collection.remove/index.html"><code>remove</code></a>.</p> -<pre><code>&gt; db.greetings.remove({lang: &quot;fr&quot;}) -WriteResult({ &quot;nRemoved&quot; : 1 }) -</code></pre> -<h3 id="delete_a_collection"><a class="anchor" href="#delete_a_collection">¶</a>Delete a collection</h3> -<p>We never really used the <code>goodbyes</code> collection. Can we get rid of that?</p> -<pre><code>&gt; db.goodbyes.drop() -true -</code></pre> -<p>Yes, it is <code>true</code> that we can <a href="https://docs.mongodb.com/manual/reference/method/db.collection.drop/index.html"><code>drop</code></a> it.</p> -<h3 id="delete_a_database"><a class="anchor" href="#delete_a_database">¶</a>Delete a database</h3> -<p>Now, I will be honest, I don’t really like our <code>greetings</code> database either. It stinks. Let’s get rid of it as well:</p> -<pre><code>&gt; db.dropDatabase() -{ &quot;dropped&quot; : &quot;helloworld&quot;, &quot;ok&quot; : 1 } -</code></pre> -<p>Yeah, take that! The <a href="https://docs.mongodb.com/manual/reference/method/db.dropDatabase/"><code>dropDatabase</code></a> can be used to drop databases.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<p>The examples in this post are all fictional, and the methods that could be used where taken from Classmate’s post, and of course <a href="https://docs.mongodb.com/manual/reference/method/">Mongo’s documentation</a>.</p> -</main> -</body> -</html> - </content></entry><entry><title>Introduction to Hadoop and its MapReduce</title><id>dist/introduction-to-hadoop-and-its-mapreduce/index.html</id><updated>2020-04-02T22:00:00+00:00</updated><published>2020-03-31T22:00:00+00:00</published><summary>Hadoop is an open-source, free, Java-based programming framework that helps processing large datasets in a distributed environment and the problems that arise when trying to harness the knowledge from BigData, capable of running on thousands of nodes and dealing with petabytes of data. It is based on Google File System (GFS) and originated from the work on the Nutch open-source project on search engines.</summary><content type="html" src="dist/introduction-to-hadoop-and-its-mapreduce/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Introduction to Hadoop and its MapReduce</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Hadoop is an open-source, free, Java-based programming framework that helps processing large datasets in a distributed environment and the problems that arise when trying to harness the knowledge from BigData, capable of running on thousands of nodes and dealing with petabytes of data. It is based on Google File System (GFS) and originated from the work on the Nutch open-source project on search engines.</p> -<div class="date-created-modified">Created 2020-04-01<br> -Modified 2020-04-03</div> -<p>Hadoop also offers a distributed filesystem (HDFS) enabling for fast transfer among nodes, and a way to program with MapReduce.</p> -<p>It aims to strive for the 4 V’s: Volume, Variety, Veracity and Velocity. For veracity, it is a secure environment that can be trusted.</p> -<h2 class="title" id="milestones"><a class="anchor" href="#milestones">¶</a>Milestones</h2> -<p>The creators of Hadoop are Doug Cutting and Mike Cafarella, who just wanted to design a search engine, Nutch, and quickly found the problems of dealing with large amounts of data. They found their solution with the papers Google published.</p> -<p>The name comes from the plush of Cutting’s child, a yellow elephant.</p> -<ul> -<li>In July 2005, Nutch used GFS to perform MapReduce operations.</li> -<li>In February 2006, Nutch started a Lucene subproject which led to Hadoop.</li> -<li>In April 2007, Yahoo used Hadoop in a 1 000-node cluster.</li> -<li>In January 2008, Apache took over and made Hadoop a top-level project.</li> -<li>In July 2008, Apache tested a 4000-node cluster. The performance was the fastest compared to other technologies that year.</li> -<li>In May 2009, Hadoop sorted a petabyte of data in 17 hours.</li> -<li>In December 2011, Hadoop reached 1.0.</li> -<li>In May 2012, Hadoop 2.0 was released with the addition of YARN (Yet Another Resource Navigator) on top of HDFS, splitting MapReduce and other processes into separate components, greatly improving the fault tolerance.</li> -</ul> -<p>From here onwards, many other alternatives have born, like Spark, Hive &amp; Drill, Kafka, HBase, built around the Hadoop ecosystem.</p> -<p>As of 2017, Amazon has clusters between 1 and 100 nodes, Yahoo has over 100 000 CPUs running Hadoop, AOL has clusters with 50 machines, and Facebook has a 320-machine (2 560 cores) and 1.3PB of raw storage.</p> -<h2 id="why_not_use_rdbms_"><a class="anchor" href="#why_not_use_rdbms_">¶</a>Why not use RDBMS?</h2> -<p>Relational database management systems simply cannot scale horizontally, and vertical scaling will require very expensive servers. Similar to RDBMS, Hadoop has a notion of jobs (analogous to transactions), but without ACID or concurrency control. Hadoop supports any form of data (unstructured or semi-structured) in read-only mode, and failures are common but there’s a simple yet efficient fault tolerance.</p> -<p>So what problems does Hadoop solve? It solves the way we should think about problems, and distributing them, which is key to do anything related with BigData nowadays. We start working with clusters of nodes, and coordinating the jobs between them. Hadoop’s API makes this really easy.</p> -<p>Hadoop also takes very seriously the loss of data with replication, and if a node falls, they are moved to a different node.</p> -<h2 id="major_components"><a class="anchor" href="#major_components">¶</a>Major components</h2> -<p>The previously-mentioned HDFS runs on commodity machine, which are cost-friendly. It is very fault-tolerant and efficient enough to process huge amounts of data, because it splits large files into smaller chunks (or blocks) that can be more easily handled. Multiple nodes can work on multiple chunks at the same time.</p> -<p>NameNode stores the metadata of the various datablocks (map of blocks) along with their location. It is the brain and the master in Hadoop’s master-slave architecture, also known as the namespace, and makes use of the DataNode.</p> -<p>A secondary NameNode is a replica that can be used if the first NameNode dies, so that Hadoop doesn’t shutdown and can restart.</p> -<p>DataNode stores the blocks of data, and are the slaves in the architecture. This data is split into one or more files. Their only job is to manage this access to the data. They are often distributed among racks to avoid data lose.</p> -<p>JobTracker creates and schedules jobs from the clients for either map or reduce operations.</p> -<p>TaskTracker runs MapReduce tasks assigned to the current data node.</p> -<p>When clients need data, they first interact with the NameNode and replies with the location of the data in the correct DataNode. Client proceeds with interaction with the DataNode.</p> -<h2 id="mapreduce"><a class="anchor" href="#mapreduce">¶</a>MapReduce</h2> -<p>MapReduce, as the name implies, is split into two steps: the map and the reduce. The map stage is the «divide and conquer» strategy, while the reduce part is about combining and reducing the results.</p> -<p>The mapper has to process the input data (normally a file or directory), commonly line-by-line, and produce one or more outputs. The reducer uses all the results from the mapper as its input to produce a new output file itself.</p> -<p><img src="bitmap.png" alt="" /></p> -<p>When reading the data, some may be junk that we can choose to ignore. If it is valid data, however, we label it with a particular type that can be useful for the upcoming process. Hadoop is responsible for splitting the data accross the many nodes available to execute this process in parallel.</p> -<p>There is another part to MapReduce, known as the Shuffle-and-Sort. In this part, types or categories from one node get moved to a different node. This happens with all nodes, so that every node can work on a complete category. These categories are known as «keys», and allows Hadoop to scale linearly.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://youtu.be/oT7kczq5A-0">YouTube – Hadoop Tutorial For Beginners | What Is Hadoop? | Hadoop Tutorial | Hadoop Training | Simplilearn</a></li> -<li><a href="https://youtu.be/bcjSe0xCHbE">YouTube – Learn MapReduce with Playing Cards</a></li> -<li><a href="https://youtu.be/j8ehT1_G5AY?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">YouTube – Video Post #2: Hadoop para torpes (I)-¿Qué es y para qué sirve?</a></li> -<li><a href="https://youtu.be/NQ8mjVPCDvk?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">Video Post #3: Hadoop para torpes (II)-¿Cómo funciona? HDFS y MapReduce</a></li> -<li><a href="https://hadoop.apache.org/old/releases.html">Apache Hadoop Releases</a></li> -<li><a href="https://youtu.be/20qWx2KYqYg?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">Video Post #4: Hadoop para torpes (III y fin)- Ecosistema y distribuciones</a></li> -<li><a href="http://www.hadoopbook.com/">Chapter 2 – Hadoop: The Definitive Guide, Fourth Edition</a> (<a href="http://grut-computing.com/HadoopBook.pdf">pdf,</a><a href="http://www.hadoopbook.com/code.html">code</a>)</li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Google’s BigTable</title><id>dist/googles-bigtable/index.html</id><updated>2020-04-02T22:00:00+00:00</updated><published>2020-03-31T22:00:00+00:00</published><summary>Let’s talk about BigTable, and why it is what it is. But before we get into that, let’s see some important aspects anybody should consider when dealing with a lot of data (something BigTable does!).</summary><content type="html" src="dist/googles-bigtable/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Google’s BigTable</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Let’s talk about BigTable, and why it is what it is. But before we get into that, let’s see some important aspects anybody should consider when dealing with a lot of data (something BigTable does!).</p> -<div class="date-created-modified">Created 2020-04-01<br> -Modified 2020-04-03</div> -<h2 class="title" id="the_basics"><a class="anchor" href="#the_basics">¶</a>The basics</h2> -<p>Converting a text document into a different format is often a great way to greatly speed up scanning of it in the future. It allows for efficient searches.</p> -<p>In addition, you generally want to store everything in a single, giant file. This will save a lot of time opening and closing files, because everything is in the same file! One proposal to make this happen is <a href="https://trec.nist.gov/file_help.html">Web TREC</a> (see also the <a href="https://en.wikipedia.org/wiki/Text_Retrieval_Conference">Wikipedia page on TREC</a>), which is basically HTML but every document is properly delimited from one another.</p> -<p>Because we will have a lot of data, it’s often a good idea to compress it. Most text consists of the same words, over and over again. Classic compression techniques such as <code>DEFLATE</code> or <code>LZW</code> do an excellent job here.</p> -<h2 id="so_what_s_bigtable_"><a class="anchor" href="#so_what_s_bigtable_">¶</a>So what’s BigTable?</h2> -<p>Okay, enough of an introduction to the basics on storing data. BigTable is what Google uses to store documents, and it’s a customized approach to save, search and update web pages.</p> -<p>BigTable is is a distributed storage system for managing structured data, able to scale to petabytes of data across thousands of commodity servers, with wide applicability, scalability, high performance, and high availability.</p> -<p>In a way, it’s kind of like databases and shares many implementation strategies with them, like parallel databases, or main-memory databases, but of course, with a different schema.</p> -<p>It consists of a big table known as the «Root tablet», with pointers to many other «tablets» (or metadata in between). These are stored in a replicated filesystem accessible by all BigTable servers. Any change to a tablet gets logged (said log also gets stored in a replicated filesystem).</p> -<p>If any of the tablets servers gets locked, a different one can take its place, read the log and deal with the problem.</p> -<p>There’s no query language, transactions occur at row-level only. Every read or write in a row is atomic. Each row stores a single web page, and by combining the row and column keys along with a timestamp, it is possible to retrieve a single cell in the row. More formally, it’s a map that looks like this:</p> -<pre><code>fetch(row: string, column: string, time: int64) -&gt; string -</code></pre> -<p>A row may have as many columns as it needs, and these column groups are the same for everyone (but the columns themselves may vary), which is importan to reduce disk read time.</p> -<p>Rows are split in different tablets based on the row keys, which simplifies determining an appropriated server for them. The keys can be up to 64KB big, although most commonly they range 10-100 bytes.</p> -<h2 id="conclusions"><a class="anchor" href="#conclusions">¶</a>Conclusions</h2> -<p>BigTable is Google’s way to deal with large amounts of data on many of their services, and the ideas behind it are not too complex to understand.</p> -</main> -</body> -</html> - </content></entry><entry><title>A practical example with Hadoop</title><id>dist/a-practical-example-with-hadoop/index.html</id><updated>2020-04-02T22:00:00+00:00</updated><published>2020-03-31T22:00:00+00:00</published><summary>In our </summary><content type="html" src="dist/a-practical-example-with-hadoop/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>A practical example with Hadoop</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>In our <a href="/blog/ribw/introduction-to-hadoop-and-its-mapreduce/">previous Hadoop post</a>, we learnt what it is, how it originated, and how it works, from a theoretical standpoint. Here we will instead focus on a more practical example with Hadoop.</p> -<div class="date-created-modified">Created 2020-04-01<br> -Modified 2020-04-03</div> -<p>This post will showcase my own implementation to implement a word counter for any plain text document that you want to analyze.</p> -<h2 class="title" id="installation"><a class="anchor" href="#installation">¶</a>Installation</h2> -<p>Before running any piece of software, its executable code must first be downloaded into our computers so that we can run it. Head over to <a href="http://hadoop.apache.org/releases.html">Apache Hadoop’s releases</a> and download the <a href="https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz">latest binary version</a> at the time of writing (3.2.1).</p> -<p>We will be using the <a href="https://linuxmint.com/">Linux Mint</a> distribution because I love its simplicity, although the process shown here should work just fine on any similar Linux distribution such as <a href="https://ubuntu.com/">Ubuntu</a>.</p> -<p>Once the archive download is complete, extract it with any tool of your choice (graphical or using the terminal) and execute it. Make sure you have a version of Java installed, such as <a href="https://openjdk.java.net/">OpenJDK</a>.</p> -<p>Here are all the three steps in the command line:</p> -<pre><code>wget https://www.apache.org/dyn/closer.cgi/hadoop/common/hadoop-3.2.1/hadoop-3.2.1.tar.gz -tar xf hadoop-3.2.1.tar.gz -hadoop-3.2.1/bin/hadoop version -</code></pre> -<h2 id="processing_data"><a class="anchor" href="#processing_data">¶</a>Processing data</h2> -<p>To take advantage of Hadoop, we have to design our code to work in the MapReduce model. Both the map and reduce phase work on key-value pairs as input and output, and both have a programmer-defined function.</p> -<p>We will use Java, because it’s a dependency that we already have anyway, so might as well.</p> -<p>Our map function needs to split each of the lines we receive as input into words, and we will also convert them to lowercase, thus preparing the data for later use (counting words). There won’t be bad records, so we don’t have to worry about that.</p> -<p>Copy or reproduce the following code in a file called <code>WordCountMapper.java</code>, using any text editor of your choice:</p> -<pre><code>import java.io.IOException; - -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.LongWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Mapper; - -public class WordCountMapper extends Mapper&lt;LongWritable, Text, Text, IntWritable&gt; { - @Override - public void map(LongWritable key, Text value, Context context) - throws IOException, InterruptedException { - for (String word : value.toString().split(&quot;\\W&quot;)) { - context.write(new Text(word.toLowerCase()), new IntWritable(1)); - } - } -} -</code></pre> -<p>Now, let’s create the <code>WordCountReducer.java</code> file. Its job is to reduce the data from multiple values into just one. We do that by summing all the values (our word count so far):</p> -<pre><code>import java.io.IOException; -import java.util.Iterator; - -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Reducer; - -public class WordCountReducer extends Reducer&lt;Text, IntWritable, Text, IntWritable&gt; { - @Override - public void reduce(Text key, Iterable&lt;IntWritable&gt; values, Context context) - throws IOException, InterruptedException { - int count = 0; - for (IntWritable value : values) { - count += value.get(); - } - context.write(key, new IntWritable(count)); - } -} -</code></pre> -<p>Let’s just take a moment to appreciate how absolutely tiny this code is, and it’s Java! Hadoop’s API is really awesome and lets us write such concise code to achieve what we need.</p> -<p>Last, let’s write the <code>main</code> method, or else we won’t be able to run it. In our new file <code>WordCount.java</code>:</p> -<pre><code>import org.apache.hadoop.fs.Path; -import org.apache.hadoop.io.IntWritable; -import org.apache.hadoop.io.Text; -import org.apache.hadoop.mapreduce.Job; -import org.apache.hadoop.mapreduce.lib.input.FileInputFormat; -import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; - -public class WordCount { - public static void main(String[] args) throws Exception { - if (args.length != 2) { - System.err.println(&quot;usage: java WordCount &lt;input path&gt; &lt;output path&gt;&quot;); - System.exit(-1); - } - - Job job = Job.getInstance(); - - job.setJobName(&quot;Word count&quot;); - job.setJarByClass(WordCount.class); - job.setMapperClass(WordCountMapper.class); - job.setReducerClass(WordCountReducer.class); - job.setOutputKeyClass(Text.class); - job.setOutputValueClass(IntWritable.class); - - FileInputFormat.addInputPath(job, new Path(args[0])); - FileOutputFormat.setOutputPath(job, new Path(args[1])); - - boolean result = job.waitForCompletion(true); - - System.exit(result ? 0 : 1); - } -} -</code></pre> -<p>And compile by including the required <code>.jar</code> dependencies in Java’s classpath with the <code>-cp</code> switch:</p> -<pre><code>javac -cp &quot;hadoop-3.2.1/share/hadoop/common/*:hadoop-3.2.1/share/hadoop/mapreduce/*&quot; *.java -</code></pre> -<p>At last, we can run it (also specifying the dependencies in the classpath, this one’s a mouthful). Let’s run it on the same <code>WordCount.java</code> source file we wrote:</p> -<pre><code>java -cp &quot;.:hadoop-3.2.1/share/hadoop/common/*:hadoop-3.2.1/share/hadoop/common/lib/*:hadoop-3.2.1/share/hadoop/mapreduce/*:hadoop-3.2.1/share/hadoop/mapreduce/lib/*:hadoop-3.2.1/share/hadoop/yarn/*:hadoop-3.2.1/share/hadoop/yarn/lib/*:hadoop-3.2.1/share/hadoop/hdfs/*:hadoop-3.2.1/share/hadoop/hdfs/lib/*&quot; WordCount WordCount.java results -</code></pre> -<p>Hooray! We should have a new <code>results/</code> folder along with the following files:</p> -<pre><code>$ ls results -part-r-00000 _SUCCESS -$ cat results/part-r-00000 - 154 -0 2 -1 3 -2 1 -addinputpath 1 -apache 6 -args 4 -boolean 1 -class 6 -count 1 -err 1 -exception 1 --snip- (output cut for clarity) -</code></pre> -<p>It worked! Now this example was obviously tiny, but hopefully enough to demonstrate how to get the basics running on real world data.</p> -</main> -</body> -</html> - </content></entry><entry><title>How does Google’s Search Engine work?</title><id>dist/how-does-googles-search-engine-work/index.html</id><updated>2020-03-27T23:00:00+00:00</updated><published>2020-03-17T23:00:00+00:00</published><summary>The original implementation was written in C/++ for Linux/Solaris.</summary><content type="html" src="dist/how-does-googles-search-engine-work/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>How does Google’s Search Engine work?</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>The original implementation was written in C/++ for Linux/Solaris.</p> -<div class="date-created-modified">Created 2020-03-18<br> -Modified 2020-03-28</div> -<p>There are three major components in the system’s anatomy, which can be thought as steps to be performed for Google to be what it is today.</p> -<p><img src="image-1024x649.png" alt="" /></p> -<p>But before we talk about the different components, let’s take a look at how they store all of this information.</p> -<h2 class="title" id="data_structures"><a class="anchor" href="#data_structures">¶</a>Data structures</h2> -<p>A «BigFile» is a virtual file addressable by 64 bits.</p> -<p>There exists a repository with the full HTML of every page compressed, along with a document identifier, length and URL.</p> -<table class=""> - <tbody> - <tr> - <td> - sync - </td> - <td> - length - </td> - <td> - compressed packet - </td> - </tr> - </tbody> -</table> -<p>The Document Index has the document identifier, a pointer into the repository, a checksum and various other statistics.</p> -<table class=""> - <tbody> - <tr> - <td> - doc id - </td> - <td> - ecode - </td> - <td> - url len - </td> - <td> - page len - </td> - <td> - url - </td> - <td> - page - </td> - </tr> - </tbody> -</table> -<p>A Lexicon stores the repository of words, implemented with a hashtable over pointers linking to the barrels (sorted linked lists) of the Inverted Index.</p> -<table class=""> - <tbody> - <tr> - <td> - word id - </td> - <td> - n docs - </td> - </tr> - <tr> - <td> - word id - </td> - <td> - n docs - </td> - </tr> - </tbody> -</table> -<p>The Hit Lists store occurences of a word in a document.</p> -<table class=""> - <tbody> - <tr> - <td> - <strong> - plain - </strong> - </td> - <td> - cap: 1 - </td> - <td> - imp: 3 - </td> - <td> - pos: 12 - </td> - </tr> - <tr> - <td> - <strong> - fancy - </strong> - </td> - <td> - cap: 1 - </td> - <td> - imp: 7 - </td> - <td> - type: 4 - </td> - <td> - pos: 8 - </td> - </tr> - <tr> - <td> - <strong> - anchor - </strong> - </td> - <td> - cap: 1 - </td> - <td> - imp: 7 - </td> - <td> - type: 4 - </td> - <td> - hash: 4 - </td> - <td> - pos: 8 - </td> - </tr> - </tbody> -</table> -<p>The Forward Index is a barrel with a range of word identifiers (document identifier and list of word identifiers).</p> -<table class=""> - <tbody> - <tr> - <td rowspan="3"> - doc id - </td> - <td> - word id: 24 - </td> - <td> - n hits: 8 - </td> - <td> - hit hit hit hit hit hit hit hit - </td> - </tr> - <tr> - <td> - word id: 24 - </td> - <td> - n hits: 8 - </td> - <td> - hit hit hit hit hit hit hit hit - </td> - </tr> - <tr> - <td> - null word id - </td> - </tr> - </tbody> -</table> -<p>The Inverted Index can be sorted by either document identifier or by ranking of word occurence.</p> -<table class=""> - <tbody> - <tr> - <td> - doc id: 23 - </td> - <td> - n hits: 5 - </td> - <td> - hit hit hit hit hit - </td> - </tr> - <tr> - <td> - doc id: 23 - </td> - <td> - n hits: 3 - </td> - <td> - hit hit hit - </td> - </tr> - <tr> - <td> - doc id: 23 - </td> - <td> - n hits: 4 - </td> - <td> - hit hit hit hit - </td> - </tr> - <tr> - <td> - doc id: 23 - </td> - <td> - n hits: 2 - </td> - <td> - hit hit - </td> - </tr> - </tbody> -</table> -<p>Back in 1998, Google compressed its repository to 53GB and had 24 million pages. The indices, lexicon, and other temporary storage required about 55GB.</p> -<h2 id="crawling"><a class="anchor" href="#crawling">¶</a>Crawling</h2> -<p>The crawling must be reliable, fast and robust, and also respect the decision of some authors not wanting their pages crawled. Originally, it took a week or more, so simultaneous execution became a must.</p> -<p>Back in 1998, Google had between 3 and 4 crawlers running at 100 web pages per second maximum. These were implemented in Python.</p> -<p>The crawled pages need parsing to deal with typos or formatting issues.</p> -<h2 id="indexing"><a class="anchor" href="#indexing">¶</a>Indexing</h2> -<p>Indexing is about putting the pages into barrels, converting words into word identifiers, and occurences into hit lists.</p> -<p>Once indexing is done, sorting of the barrels happens to have them ordered by word identifier, producing the inverted index. This process also had to be done in parallel over many machines, or would otherwise have been too slow.</p> -<h2 id="searching"><a class="anchor" href="#searching">¶</a>Searching</h2> -<p>We need to find quality results efficiently. Plenty of weights are considered nowadays, but at its heart, PageRank is used. It is the algorithm they use to map the web, which is formally defined as follows:</p> -<p><img src="8e1e61b119e107fcb4bdd7e78f649985.png" alt="" /> -<em>PR(A) = (1-d) + d(PR(T1)/C(T1) + … + PR(Tn)/C(Tn))</em></p> -<p>Where:</p> -<ul> -<li><code>A</code> is a given page</li> -<li><code>T&lt;sub&gt;n&lt;/sub&gt;</code> are pages that point to A</li> -<li><code>d</code> is the damping factor in the range <code>[0, 1]</code> (often 0.85)</li> -<li><code>C(A)</code> is the number of links going out of page <code>A</code></li> -<li><code>PR(A)</code> is the page rank of page <code>A</code> -This formula indicates the probability that a random surfer visits a certain page, and <code>1 - d</code> is used to indicate when it will «get bored» and stop surfing. More intuitively, the page rank of a page will grow as more pages link to it, or the few that link to it have high page rank.</li> -</ul> -<p>The anchor text in the links also help provide a better description and helps indexing for even better results.</p> -<p>While searching, the concern is disk I/O which takes up most of the time. Caching is very important to improve performance up to 30 times.</p> -<p>Now, in order to turn user queries into something we can search, we must parse the query and convert the words into word identifiers.</p> -<h2 id="conclusion"><a class="anchor" href="#conclusion">¶</a>Conclusion</h2> -<p>Google is designed to be a efficient, scalable, high-quality search engine. There are still bottlenecks in CPU, memory, disk speed and network I/O, but major data structures are used to make efficient use of the resources.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://snap.stanford.edu/class/cs224w-readings/Brin98Anatomy.pdf">The anatomy of a large-scale hypertextual Web search engine</a></li> -<li><a href="https://www.site.uottawa.ca/%7Ediana/csi4107/Google_SearchEngine.pdf">The Anatomy of a Large-Scale Hypertextual Web Search Engine (slides)</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Privado: PC-Crawler evaluation 2</title><id>dist/pc-crawler-evaluation-2/index.html</id><updated>2020-03-27T23:00:00+00:00</updated><published>2020-03-15T23:00:00+00:00</published><summary>As the student </summary><content type="html" src="dist/pc-crawler-evaluation-2/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: PC-Crawler evaluation 2</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>As the student <code>a(i)</code> where <code>i = 9</code>, I have been assigned to evaluate students <code>a(i - 1)</code> and <code>a(i - 2)</code>, these being:</p> -<div class="date-created-modified">Created 2020-03-16<br> -Modified 2020-03-28</div> -<ul> -<li>a08: Classmate (username)</li> -<li>a07: Classmate (username)</li> -</ul> -<p>The evaluation is done according to the criteria described in Segunda entrega del PC-Crawler.</p> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>This is the evaluation of Crawler – Thesauro.</p> -<p>It’s a well-written post, properly using WordPress code blocks, and they explain the process of improving the code and what it does. Because there are no noticeable issues with the post, they get the highest grading.</p> -<h2 id="classmate_s_evaluation_2"><a class="anchor" href="#classmate_s_evaluation_2">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: B.</strong></p> -<p>This is the evaluation of Actividad 2-Crawler.</p> -<p>They start with an introduction on what they will do.</p> -<p>Next, they show the code they have written, also describing what it does, although they don’t explain <em>why</em> they chose the data structures they used.</p> -<p>The style of the code leaves a lot to be desired, and they should have embedded the code in the post instead of taking screenshots. People that rely on screen readers will not be able to see the code.</p> -<p>I have graded them B and not A for this last reason.</p> -</main> -</body> -</html> - </content></entry><entry><title>What is ElasticSearch and why should you care?</title><id>dist/what-is-elasticsearch-and-why-should-you-care/index.html</id><updated>2020-03-26T23:00:00+00:00</updated><published>2020-03-17T23:00:00+00:00</published><summary>ElasticSearch is a giant search index with powerful analytics capabilities. It’s like a database and search engine on steroids, really easy and fast to get up and running. One can think of it as your own Google, a search engine with analytics.</summary><content type="html" src="dist/what-is-elasticsearch-and-why-should-you-care/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>What is ElasticSearch and why should you care?</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>ElasticSearch is a giant search index with powerful analytics capabilities. It’s like a database and search engine on steroids, really easy and fast to get up and running. One can think of it as your own Google, a search engine with analytics.</p> -<div class="date-created-modified">Created 2020-03-18<br> -Modified 2020-03-27</div> -<p>ElasticSearch is rich, stable, performs well, is well maintained, and able to scale to petabytes of any kind of data, whether it’s structured, semi-structured or not at all. It’s cost-effective and can be used to make business decisions.</p> -<p>Or, described in 10 seconds:</p> -<blockquote> -<p>Schema-free, REST &amp; JSON based distributed document store -Open source: Apache License 2.0 -Zero configuration</p> -</blockquote> -<p>-- Alex Reelsen</p> -<h2 class="title" id="basic_capabilities"><a class="anchor" href="#basic_capabilities">¶</a>Basic capabilities</h2> -<p>ElasticSearch lets you ask questions about your data, not just make queries. You may think SQL can do this too, but what’s important is making a pipeline of facets, and feed the results from query to query.</p> -<p>Instead of changing your data, you can be flexible with your questions with no need to re-index it every time the questions change.</p> -<p>ElasticSearch is not just to search for full-text data, either. It can search for structured data and return more than just the results. It also yields additional data, such as ranking, highlights, and allows for pagination.</p> -<p>It doesn’t take a lot of configuration to get running, either, which can be a good boost on productivity.</p> -<h2 id="how_does_it_work_"><a class="anchor" href="#how_does_it_work_">¶</a>How does it work?</h2> -<p>ElasticSearch depends on Java, and can work in a distributed cluster if you execute multiple instances. Data will be replicated and sharded as needed. The current version at the time of writing is 7.6.1, and it’s being developed fast!</p> -<p>It also has support for plugins, with an ever-growing ecosystem and integration on many programming languages. Tools around it are being built around it, too, like Kibana which helps you visualize your data.</p> -<p>The way you use it is through a JSON API, served over HTTP/S.</p> -<h2 id="how_can_i_use_it_"><a class="anchor" href="#how_can_i_use_it_">¶</a>How can I use it?</h2> -<p><a href="https://www.elastic.co/downloads/">You can try ElasticSearch out for free on Elastic Cloud</a>, however, it can also be <a href="https://www.elastic.co/downloads/elasticsearch">downloaded and ran offline</a>, which is what we’ll do. Download the file corresponding to your operating system, unzip it, and execute the binary. Running it is as simple as that!</p> -<p>Now you can make queries to it over HTTP, with for example <code>curl</code>:</p> -<pre><code>curl -X PUT localhost:9200/orders/order/1 -d ' -{ - &quot;created_at&quot;: &quot;2013/09/05 15:45:10&quot;, - &quot;items&quot;: [ - { - name: &quot;HD Monitor&quot; - } - ], - &quot;total&quot;: 249.95 -}' -</code></pre> -<p>This will create a new order with some information, such as when it was created, what items it contains, and the total cost of the order.</p> -<p>You can then query or filter as needed, script it or even create statistics.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://youtu.be/sKnkQSec1U0">YouTube – What is Elasticsearch?</a></li> -<li><a href="https://youtu.be/yWNiRC_hUAw">YouTube – GOTO 2013 • Elasticsearch – Beyond Full-text Search • Alex Reelsen</a></li> -<li><a href="https://www.elastic.co/kibana">Kibana – Your window into the Elastic Stack</a></li> -<li><a href="https://www.elastic.co/guide/index.html">Elastic Stack and Product Documentation</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Privado: NoSQL evaluation</title><id>dist/nosql-evaluation/index.html</id><updated>2020-03-26T23:00:00+00:00</updated><published>2020-03-15T23:00:00+00:00</published><summary>I have decided to evaluate Classmate‘s post and Classmate‘s post, because they review databases I have not seen or used before, and I think it would be interesting to see new ones.</summary><content type="html" src="dist/nosql-evaluation/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: NoSQL evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>I have decided to evaluate Classmate‘s post and Classmate‘s post, because they review databases I have not seen or used before, and I think it would be interesting to see new ones.</p> -<div class="date-created-modified">Created 2020-03-16<br> -Modified 2020-03-27</div> -<p>The evaluation is based on the requirements defined by Trabajos en grupo sobre Bases de Datos NoSQL:</p> -<blockquote> -<p><strong>1ª entrada:</strong> Descripción de la finalidad de la tecnología y cómo funciona o trabaja la BD NoSQL, sus características, la arista que ocupa en el Teorema CAP, de dónde se descarga, y cómo se instala.</p> -</blockquote> -<p>-- Teacher</p> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post I have evaluated is BB.DD. NoSQL: Voldemort 1ª Fase.</p> -<p>The post doesn’t start very well, because the first sentence has (emphasis mine):</p> -<blockquote> -<p>En él repasaremos en qué consiste <strong>MongoDB</strong>, sus características, y cómo se instala, entre otros.</p> -</blockquote> -<p>-- Classmate</p> -<p>…yet the post is about Voldemort!</p> -<p>The post does detail how it works, its architecture, corner in the CAP theorem, download and installation.</p> -<p>I have graded the post with A because I think it meets all the requirements, even if they slipped a bit in the beginning.</p> -<h2 id="classmate_s_evaluation_2"><a class="anchor" href="#classmate_s_evaluation_2">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post I have evaluted is Raven.</p> -<p>They have done a good job describing the project’s goals, corner in the CAP theorem, download, and provide an extensive installation section.</p> -<p>They don’t seem to use some of WordPress features, such as lists, but otherwise the post is good and deserves an A grading.</p> -</main> -</body> -</html> - </content></entry><entry><title>Integrating Apache Tika into our Crawler</title><id>dist/integrating-apache-tika-into-our-crawler/index.html</id><updated>2020-03-24T23:00:00+00:00</updated><published>2020-03-17T23:00:00+00:00</published><summary>In our last crawler post</summary><content type="html" src="dist/integrating-apache-tika-into-our-crawler/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Integrating Apache Tika into our Crawler</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p><a href="/blog/ribw/upgrading-our-baby-crawler/">In our last crawler post</a>, we detailed how our crawler worked, and although it did a fine job, it’s time for some extra upgrading.</p> -<div class="date-created-modified">Created 2020-03-18<br> -Modified 2020-03-25</div> -<h2 class="title" id="what_kind_of_upgrades_"><a class="anchor" href="#what_kind_of_upgrades_">¶</a>What kind of upgrades?</h2> -<p>A small but useful one. We are adding support for file types that contain text but cannot be processed by normal text editors because they are structured and not just plain text (such as PDF files, Excel, Word documents…).</p> -<p>And for this task, we will make use of the help offered by <a href="https://tika.apache.org/">Tika</a>, our friendly Apache tool.</p> -<h2 id="what_is_tika_"><a class="anchor" href="#what_is_tika_">¶</a>What is Tika?</h2> -<p><a href="https://tika.apache.org/">Tika</a> is a set of libraries offered by <a href="https://en.wikipedia.org/wiki/The_Apache_Software_Foundation">The Apache Software Foundation</a> that we can include in our project in order to extract the text and metadata of files from a <a href="https://tika.apache.org/1.24/formats.html">long list of supported formats</a>.</p> -<h2 id="changes_in_the_code"><a class="anchor" href="#changes_in_the_code">¶</a>Changes in the code</h2> -<p>Not much has changed in the structure of the crawler, we simply have added a new method in <code>Utils</code> that uses the class <code>Tika</code> from the previously mentioned library so as to process and extract the text of more filetypes.</p> -<p>Then, we use this text just like we would for our standard text file (checking the thesaurus and adding it to the word map) and voilà! We have just added support for a big range of file types.</p> -<h2 id="incorporating_gradle"><a class="anchor" href="#incorporating_gradle">¶</a>Incorporating Gradle</h2> -<p>In order for the previous code to work, we need to make use of external libraries. To make this process easier and because the project is growing, we decided to use <a href="https://gradle.org/">Gradle</a>, a build system that can be used for projects in various programming languages, such as Java.</p> -<p>We followed their <a href="https://guides.gradle.org/building-java-applications/">guide to Building Java Applications</a>, and in a few steps added the required <code>.gradle</code> files. Now we can compile and run the code without having to worry about juggling with Java and external dependencies in a single command:</p> -<pre><code>./gradlew run -</code></pre> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>And here you can download the final result:</p> -<p><em>download removed</em></p> -</main> -</body> -</html> - </content></entry><entry><title>Cassandra: Basic Operations and Architecture</title><id>dist/nosql-databases-basic-operations-and-architecture/index.html</id><updated>2020-03-23T23:00:00+00:00</updated><published>2020-03-04T23:00:00+00:00</published><summary>This is the second post in the NoSQL Databases series, with a brief description on the basic operations (such as insertion, retrieval, indexing…), and complete execution along with the data model / architecture.</summary><content type="html" src="dist/nosql-databases-basic-operations-and-architecture/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Cassandra: Basic Operations and Architecture</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the second post in the NoSQL Databases series, with a brief description on the basic operations (such as insertion, retrieval, indexing…), and complete execution along with the data model / architecture.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-24</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/nosql-databases-an-introduction/">Cassandra: an Introduction</a></li> -<li><a href="/blog/ribw/nosql-databases-basic-operations-and-architecture/">Cassandra: Basic Operations and Architecture</a> (this post)</li> -</ul> -<hr /> -<p>Cassandra uses it own Query Language for managing the databases, it is known as **CQL **(<strong>Cassandra Query Language</strong>). Cassandra stores data in <strong><em>tables</em></strong>, as in relational databases, and these tables are grouped in <strong><em>keyspaces</em></strong>. A keyspace defines a number of options that applies to all the tables it contains. The most used option is the **replication strategy. **It is recommended to have only one keyspace by application.</p> -<p>It is important to mention that <strong>tables and keyspaces</strong> are** case insensitive**, so myTable is equivalent to mytable, but it is possible to <strong>force case sensitivity</strong> using <strong>double-quotes</strong>.</p> -<p>To begin with the basic operations it is necessary to deploy Cassandra:</p> -<ol> -<li>Open a terminal in the root of the Apache Cassandra folder downloaded in the previous post.</li> -<li>Run the command:</li> -</ol> -<pre><code>$ bin/cassandra -</code></pre> -<p>Once Cassandra is deployed, it is time to open a** CQL Shell**, in <strong>other terminal</strong>, with the command: </p> -<pre><code>$ bin/cqlsh -</code></pre> -<p>It is possible to check if Cassandra is deployed if the SQL Shell prints the next message:</p> -<p><img src="uwqQgQte-cuYb_pePFOuY58re23kngrDKNgL1qz4yOfnBDZkqMIH3fFuCrye.png" alt="" /> -<em>CQL Shell</em></p> -<h2 class="title" id="create_insert"><a class="anchor" href="#create_insert">¶</a>Create/Insert</h2> -<h3 id="ddl_data_definition_language_"><a class="anchor" href="#ddl_data_definition_language_">¶</a>DDL (Data Definition Language)</h3> -<h4 id="create_keyspace"><a class="anchor" href="#create_keyspace">¶</a>Create keyspace</h4> -<p>A keyspace is created using a **CREATE KEYSPACE **statement:</p> -<pre><code>$ **CREATE** KEYSPACE [ **IF** **NOT** **EXISTS** ] keyspace_name **WITH** options; -</code></pre> -<p>The supported “<strong>options</strong>” are:</p> -<ul> -<li>“<strong>replication</strong>”: this is **mandatory **and defines the <strong>replication strategy</strong> and the <strong>replication factor</strong> (the number of nodes that will have a copy of the data). Within this option there is a property called “<strong>class</strong>” in which the <strong>replication strategy</strong> is specified (“SimpleStrategy” or “NetworkTopologyStrategy”)</li> -<li>“<strong>durable_writes</strong>”: this is <strong>not mandatory</strong> and it is possible to use the <strong>commit logs for updates</strong>. -Attempting to create an already existing keyspace will return an error unless the **IF NOT EXISTS **directive is used. </li> -</ul> -<p>The example associated to this statement is create a keyspace with name “test_keyspace” with “SimpleStrategy” as “class” of replication and a “replication_factor” of 3.</p> -<pre><code>**CREATE** KEYSPACE test_keyspace - **WITH** **replication** = {'class': 'SimpleStrategy', - 'replication_factor' : 3}; -</code></pre> -<p>The **USE **statement allows to <strong>change</strong> the current <strong>keyspace</strong>. The syntax of this statement is very simple: </p> -<pre><code>**USE** keyspace_name; -</code></pre> -<p><img src="RDWIG2RwvEevUFQv6TGFtGzRm4_9ERpxPf0feriflaj3alvWw3FEIAr_ZdF1.png" alt="" /> -<em>USE statement</em></p> -<p>It is also possible to get the metadata from a keyspace with the **DESCRIBE **statement.</p> -<pre><code>**DESCRIBE** KEYSPACES | KEYSPACE keyspace_name; -</code></pre> -<h4 id="create_table"><a class="anchor" href="#create_table">¶</a>Create table</h4> -<p>Creating a new table uses the **CREATE TABLE **statement:</p> -<pre><code>**CREATE** **TABLE** [ **IF** **NOT** **EXISTS** ] table_name - '(' - column_definition - ( ',' column_definition )* - [ ',' **PRIMARY** **KEY** '(' primary_key ')' ] - ')' [ **WITH** table_options ]; -</code></pre> -<p>With “column_definition” as: column_name cql_type [ STATIC ] [ PRIMARY KEY]; “primary_key” as: partition_key [ ‘,’ clustering_columns ]; and “table_options” as: COMPACT STORAGE [ AND table_options ] or CLUSTERING ORDER BY ‘(‘ clustering_order ‘)’ [ AND table_options ] or “options”.</p> -<p>Attempting to create an already existing table will return an error unless the <strong>IF NOT EXISTS</strong> directive is used.</p> -<p>The <strong>CQL types</strong> are described in the References section.</p> -<p>For example, we are going to create a table called “species_table” in the keyspace “test_keyspace” in which we will have a “species” text (as PRIMARY KEY), a “common_name” text, a “population” varint, a “average_size” int and a “sex” text. Besides, we are going to add a comment to the table: “Some species records”;</p> -<pre><code>**CREATE** **TABLE** species_table ( - species text **PRIMARY** **KEY**, - common_name text, - population varint, - average_size **int**, - sex text, -) **WITH** **comment**='Some species records'; -</code></pre> -<p>It is also possible to get the metadata from a table with the **DESCRIBE **statement.</p> -<pre><code>**DESCRIBE** **TABLES** | **TABLE** [keyspace_name.]table_name; -</code></pre> -<h3 id="dml_data_manipulation_language_"><a class="anchor" href="#dml_data_manipulation_language_">¶</a>DML (Data Manipulation Language)</h3> -<h4 id="insert_data"><a class="anchor" href="#insert_data">¶</a>Insert data</h4> -<p>Inserting data for a row is done using an **INSERT **statement:</p> -<pre><code>**INSERT** **INTO** table_name ( names_values | json_clause ) - [ **IF** **NOT** **EXISTS** ] - [ **USING** update_parameter ( **AND** update_parameter )* ]; -</code></pre> -<p>Where “names_values” is: names VALUES tuple_literal; “json_clause” is: JSON string [ DEFAULT ( NULL | UNSET ) ]; and “update_parameter” is usually: TTL.</p> -<p>For example we are going to use both VALUES and JSON clauses to insert data in the table “species_table”. In the VALUES clause it is necessary to supply the list of columns, not as in the JSON clause that is optional.</p> -<p>Note: TTL (Time To Live) and Timestamp are metrics for expiring data, so, when the time set is passed, the operation is expired.</p> -<p>In the VALUES clause we are going to insert a new specie called “White monkey”, with an average size of 3, its common name is “Copito de nieve”, population 0 and sex “male”.</p> -<pre><code>**INSERT** **INTO** species_table (species, common_name, population, average_size, sex) - **VALUES** ('White monkey', 'Copito de nieve', 0, 3, 'male'); -</code></pre> -<p>In the JSON clause we are going to insert a new specie called “Cloned sheep”, with an average size of 1, its common name is “Dolly the sheep”, population 0 and sex “female”.</p> -<pre><code>**INSERT** **INTO** species_table JSON '{&quot;species&quot;: &quot;Cloned Sheep&quot;, - &quot;common_name&quot;: &quot;Dolly the Sheep&quot;, - &quot;average_size&quot;:1, - &quot;population&quot;:0, - &quot;sex&quot;: &quot;female&quot;}'; -</code></pre> -<p>Note: all updates for an **INSERT **are applied **atomically **and in <strong>isolation.</strong></p> -<h2 id="read"><a class="anchor" href="#read">¶</a>Read</h2> -<p>Querying data from data is done using a **SELECT **statement:</p> -<pre><code>**SELECT** [ JSON | **DISTINCT** ] ( select_clause | '*' ) - **FROM** table_name - [ **WHERE** where_clause ] - [ **GROUP** **BY** group_by_clause ] - [ **ORDER** **BY** ordering_clause ] - [ PER **PARTITION** **LIMIT** (**integer** | bind_marker) ] - [ **LIMIT** (**integer** | bind_marker) ] - [ ALLOW FILTERING ]; -</code></pre> -<p>The **CQL SELECT **statement is very **similar **to the **SQL SELECT **statement due to the fact that both allows filtering (<strong>WHERE</strong>), grouping data (<strong>GROUP BY</strong>), ordering the data (<strong>ORDER BY</strong>) and limit the number of data (<strong>LIMIT</strong>). Besides, **CQL offers **a **limit per partition **and allow the **filtering **of <strong>data</strong>.</p> -<p>Note: as in SQL it it possible to set alias to the data with the statement <strong>AS.</strong></p> -<p>For example we are going to retrieve all the information about those values from the tables “species_table” which “sex” is “male”. Allow filtering is mandatory when there is a WHERE statement.</p> -<pre><code>**SELECT** * **FROM** species_table **WHERE** sex = 'male' ALLOW FILTERING; -</code></pre> -<p><img src="s6GrKIGATvOSD7oGRNScUU5RnLN_-3X1JXvnVi_wDT_hrmPMZdnCdBI8DpIJ.png" alt="" /> -<em>SELECT statement</em></p> -<p>Furthermore, we are going to test the SELECT JSON statement. For this, we are going to retrieve only the species name with a population of 0. </p> -<pre><code>**SELECT** JSON species **FROM** species_table **WHERE** population = 0 ALLOW FILTERING; -</code></pre> -<p><img src="Up_eHlqKQp2RI5XIbgPOvj1B5J3gLxz7v7EI0NDRgezQTipecdfDT6AQoso0.png" alt="" /> -<em>SELECT JSON statement</em></p> -<h2 id="update"><a class="anchor" href="#update">¶</a>Update</h2> -<h3 id="ddl_data_definition_language__2"><a class="anchor" href="#ddl_data_definition_language__2">¶</a>DDL (Data Definition Language)</h3> -<h4 id="alter_keyspace"><a class="anchor" href="#alter_keyspace">¶</a>Alter keyspace</h4> -<p>The statement **ALTER KEYSPACE **allows to modify the options of a keyspace:</p> -<pre><code>**ALTER** KEYSPACE keyspace_name **WITH** options; -</code></pre> -<p>Note: the supported **options **are the same than for creating a keyspace, “<strong>replication</strong>” and “<strong>durable_writes</strong>”.</p> -<p>The example associated to this statement is to modify the keyspace with name “test_keyspace” and set a “replication_factor” of 4.</p> -<pre><code>**ALTER** KEYSPACE test_keyspace - **WITH** **replication** = {'class': 'SimpleStrategy', 'replication_factor' : 4}; -</code></pre> -<h4 id="alter_table"><a class="anchor" href="#alter_table">¶</a>Alter table</h4> -<p>Altering an existing table uses the **ALTER TABLE **statement:</p> -<pre><code>**ALTER** **TABLE** table_name alter_table_instruction; -</code></pre> -<p>Where “alter_table_instruction” can be: ADD column_name cql_type ( ‘,’ column_name cql_type )<em>; or DROP column_name ( column_name )</em>; or WITH options</p> -<p>The example associated to this statement is to ADD a new column to the table “species_table”, called “extinct” with type “boolean”.</p> -<pre><code>**ALTER** **TABLE** species_table **ADD** extinct **boolean**; -</code></pre> -<p>Another example is to DROP the column called “sex” from the table “species_table”.</p> -<pre><code>**ALTER** **TABLE** species_table **DROP** sex; -</code></pre> -<p>Finally, alter the comment with the WITH clause and set the comment to “All species records”. </p> -<pre><code>**ALTER** **TABLE** species_table **WITH** **comment**='All species records'; -</code></pre> -<p>These changes can be checked with the **DESCRIBE **statement:</p> -<pre><code>**DESCRIBE** **TABLE** species_table; -</code></pre> -<p><img src="xebKPqkWkn97YVHpRVXZYWvRUfeRUyCH-vPDs67aFaEeU53YTRbDOFscOlAr.png" alt="" /> -<em>DESCRIBE table</em></p> -<h3 id="dml_data_manipulation_language__2"><a class="anchor" href="#dml_data_manipulation_language__2">¶</a>DML (Data Manipulation Language)</h3> -<h4 id="update_data"><a class="anchor" href="#update_data">¶</a>Update data</h4> -<p>Updating a row is done using an **UPDATE **statement:</p> -<pre><code>**UPDATE** table_name -[ **USING** update_parameter ( **AND** update_parameter )* ] -**SET** assignment ( ',' assignment )* -**WHERE** where_clause -[ **IF** ( **EXISTS** | condition ( **AND** condition )*) ]; -</code></pre> -<p>Where the update_parameter is: ( TIMESTAMP | TTL) (integer | bind_marker)</p> -<p>It is important to mention that the **WHERE **clause is used to select the row to update and **must <strong>include ** all columns</strong> composing the <strong>PRIMARY KEY.</strong></p> -<p>We are going to test this statement updating the column “extinct” to true to the column with name ‘White monkey’.</p> -<pre><code>**UPDATE** species_table **SET** extinct = **true** **WHERE** species='White monkey'; -</code></pre> -<p><img src="IcaCe6VEC5c0ZQIygz-CiclzFyt491u7xPMg2muJLR8grmqaiUzkoQsVCoHf.png" alt="" /> -<em>SELECT statement</em></p> -<h2 id="delete"><a class="anchor" href="#delete">¶</a>Delete</h2> -<h3 id="ddl_data_definition_language__3"><a class="anchor" href="#ddl_data_definition_language__3">¶</a>DDL (Data Definition Language)</h3> -<h4 id="drop_keyspace"><a class="anchor" href="#drop_keyspace">¶</a>Drop keyspace</h4> -<p>Dropping a keyspace can be done using the **DROP KEYSPACE **statement:</p> -<pre><code>**DROP** KEYSPACE [ **IF** **EXISTS** ] keyspace_name; -</code></pre> -<p>For example, drop the keyspace called “test_keyspace_2” if it exists:</p> -<pre><code>**DROP** KEYSPACE **IF** **EXISTS** test_keyspace_2; -</code></pre> -<p>As this keyspace does not exists, this sentence will do nothing.</p> -<h4 id="drop_table"><a class="anchor" href="#drop_table">¶</a>Drop table</h4> -<p>Dropping a table uses the **DROP TABLE **statement:</p> -<pre><code>**DROP** **TABLE** [ **IF** **EXISTS** ] table_name; -</code></pre> -<p>For example, drop the table called “species_2” if it exists: </p> -<pre><code>**DROP** **TABLE** **IF** **EXISTS** species_2; -</code></pre> -<p>As this table does not exists, this sentence will do nothing.</p> -<h4 id="truncate_table_"><a class="anchor" href="#truncate_table_">¶</a>Truncate (table)</h4> -<p>A table can be truncated using the **TRUNCATE **statement:</p> -<pre><code>**TRUNCATE** [ **TABLE** ] table_name; -</code></pre> -<p>Do not execute this command now, because if you do it, you will need to insert the previous data again.</p> -<p>Note: as tables are the only object that can be truncated the keyword TABLE can be omitted.</p> -<p><img src="FOkhfpxlWFQCzcdfeWxLTy7wx5inDv0xwVeVhE79Pqtk3yYzWsZJnz_SBhUi.png" alt="" /> -<em>TRUNCATE statement</em></p> -<h3 id="dml_data_manipulation_language__3"><a class="anchor" href="#dml_data_manipulation_language__3">¶</a>DML (Data Manipulation Language)</h3> -<h4 id="delete_data"><a class="anchor" href="#delete_data">¶</a>Delete data</h4> -<p>Deleting rows or parts of rows uses the **DELETE **statement:</p> -<pre><code>**DELETE** [ simple_selection ( ',' simple_selection ) ] - **FROM** table_name - [ **USING** update_parameter ( **AND** update_parameter )* ] - **WHERE** where_clause - [ **IF** ( **EXISTS** | condition ( **AND** condition )*) ] -</code></pre> -<p>Now we are going to delete the value of the column “average_size” from “Cloned Sheep”. </p> -<pre><code>**DELETE** average_size **FROM** species_table **WHERE** species = 'Cloned Sheep'; -</code></pre> -<p><img src="CyuQokVL5J9TAelq-WEWhNl6kFtbIYs0R1AeU5NX4EkG-YQI81mNHdnf2yWN.png" alt="" /> -<em>DELETE value statement</em></p> -<p>And we are going to delete the same row as mentioned before. </p> -<pre><code>**DELETE** **FROM** species_table **WHERE** species = 'Cloned Sheep'; -</code></pre> -<p><img src="jvQ5cXJ5GTVQ6giVhBEpPJmrJw-zwKKyB9nsTm5PRcGSTzkmh-WO4kTeuLpB.png" alt="" /> -<em>DELETE row statement</em></p> -<h2 id="batch"><a class="anchor" href="#batch">¶</a>Batch</h2> -<p>Multiple <strong>INSERT</strong>, **UPDATE **and **DELETE **can be executed in a <strong>single statement</strong> by grouping them through a **BATCH **statement.</p> -<pre><code>**BEGIN** [ UNLOGGED | COUNTER ] BATCH - [ **USING** update_parameter ( **AND** update_parameter )* ] - modification_statement ( ';' modification_statement )* - APPLY BATCH; -</code></pre> -<p>Where modification_statement can be a insert_statement or an update_statement or a delete_statement.</p> -<ul> -<li>**UNLOGGED **means that either all operations in a batch eventually complete or none will.</li> -<li><strong>COUNTER</strong> means that the updates are not idempotent, so each time we execute the updates in a batch, we will have different results. -For example:</li> -</ul> -<pre><code>**BEGIN** BATCH - **INSERT** **INTO** species_table (species, common_name, population, average_size, extinct) - **VALUES** ('Blue Shark', 'Tiburillo', 30, 10, **false**); - **INSERT** **INTO** species_table (species, common_name, population, average_size, extinct) - **VALUES** ('Cloned sheep', 'Dolly the Sheep', 1, 1, **true**); - **UPDATE** species_table **SET** population = 2 **WHERE** species='Cloned sheep'; - **DELETE** **FROM** species_table **WHERE** species = 'White monkey'; -APPLY BATCH; -</code></pre> -<p><img src="EL9Dac26o0FqkVoeAKmopEKQe0wWq-xYI14b9RzGxtUkFJA3i2eTiR6qkuuJ.png" alt="" /> -<em>BATCH statement</em></p> -<h2 id="index"><a class="anchor" href="#index">¶</a>Index</h2> -<p>CQL support creating secondary indexes on tables, allowing queries on the table to use those indexes. </p> -<p>**Creating **a secondary index on a table uses the **CREATE INDEX **statement:</p> -<pre><code>**CREATE** [ CUSTOM ] **INDEX** [ **IF** **NOT** **EXISTS** ] [ index_name ] - **ON** table_name '(' index_identifier ')' - [ **USING** string [ **WITH** OPTIONS = map_literal ] ]; -</code></pre> -<p>For example we are going to create a index called “population_idx” that is related to the column “population” in the table “species_table”.</p> -<pre><code>**CREATE** **INDEX** population_idx **ON** species_table (population); -</code></pre> -<p>**Dropping **a secondary index uses the <strong>DROP INDEX</strong> statement: </p> -<pre><code>**DROP** **INDEX** [ **IF** **EXISTS** ] index_name; -</code></pre> -<p>Now, we are going to drop the previous index: </p> -<pre><code>**DROP** **INDEX** **IF** **EXISTS** population_idx; -</code></pre> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://cassandra.apache.org/doc/latest/cql/ddl.html">Cassandra CQL</a></li> -<li><a href="https://techdifferences.com/difference-between-ddl-and-dml-in-dbms.html">Differences between DML and DDL</a></li> -<li><a href="https://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/cqlReferenceTOC.html">Datastax CQL</a></li> -<li><a href="https://cassandra.apache.org/doc/latest/cql/types.html#grammar-token-cql-type">Cassandra CQL Types</a></li> -<li><a href="https://cassandra.apache.org/doc/latest/cql/indexes.html">Cassandra Index</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Upgrading our Baby Crawler</title><id>dist/upgrading-our-baby-crawler/index.html</id><updated>2020-03-17T23:00:00+00:00</updated><published>2020-03-10T23:00:00+00:00</published><summary>In our </summary><content type="html" src="dist/upgrading-our-baby-crawler/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Upgrading our Baby Crawler</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>In our <a href="/blog/ribw/build-your-own-pc/">last post on this series</a>, we presented the code for our Personal Crawler. However, we didn’t quite explain what a crawler even is! We will use this moment to go a bit more in-depth, and make some upgrades to it.</p> -<div class="date-created-modified">Created 2020-03-11<br> -Modified 2020-03-18</div> -<h2 class="title" id="what_is_a_crawler_"><a class="anchor" href="#what_is_a_crawler_">¶</a>What is a Crawler?</h2> -<p>A crawler is a program whose job is to analyze documents and extract data from them. For example, search engines like <a href="http://duckduckgo.com/">DuckDuckGo</a>, <a href="https://bing.com/">Bing</a> or <a href="http://google.com/">Google</a> all have crawlers to analyze websites and build a database around them. They are some kind of «trackers», because they keep track of everything they find.</p> -<p>Their basic behaviour can be described as follows: given a starting list of URLs, follow them all and identify hyperlinks inside the documents. Add these to the list of links to follow, and repeat <em>ad infinitum</em>.</p> -<ul> -<li>This lets us create an index to quickly search across them all.</li> -<li>We can also identify broken links.</li> -<li>We can gather any other type of information that we found. -Our crawler will work offline, within our own computer, scanning the text documents it finds on the root we tell it to scan.</li> -</ul> -<h2 id="design_decissions"><a class="anchor" href="#design_decissions">¶</a>Design Decissions</h2> -<ul> -<li>We will use Java. Its runtime is quite ubiquitous, so it should be able to run in virtually anywhere. The language is typed, which helps catch errors early on.</li> -<li>Our solution is iterative. While recursion can be seen as more elegants by some, iterative solutions are often more performant with less need for optimization.</li> -</ul> -<h2 id="requirements"><a class="anchor" href="#requirements">¶</a>Requirements</h2> -<p>If you don’t have Java installed yet, you can <a href="https://java.com/en/download/">Download Free Java Software</a> from Oracle’s site. To compile the code, the <a href="https://www.oracle.com/java/technologies/javase-jdk8-downloads.html">Java Development Kit</a> is also necessary.</p> -<p>We don’t depend on any other external libraries, for easier deployment and compilation.</p> -<h2 id="implementation"><a class="anchor" href="#implementation">¶</a>Implementation</h2> -<p>Because the code was getting pretty large, it has been split into several files, and we have also upgraded it to use a Graphical User Interface instead! We decided to use Swing, based on the Java tutorial <a href="https://docs.oracle.com/javase/tutorial/uiswing/">Creating a GUI With JFC/Swing</a>.</p> -<h3 id="app"><a class="anchor" href="#app">¶</a>App</h3> -<p>This file is the entry point of our application. Its job is to initialize the components, lay them out in the main panel, and connect the event handlers.</p> -<p>Most widgets are pretty standard, and are defined as class variables. However, some variables are notable. The <code>[DefaultTableModel](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableModel.html)</code> is used because it allows to <a href="https://stackoverflow.com/a/22550106">dynamically add rows</a>, and we also have a <code>[SwingWorker](https://docs.oracle.com/javase/8/docs/api/javax/swing/SwingWorker.html)</code> subclass responsible for performing the word analysis (which is quite CPU intensive and should not be ran in the UI thread!).</p> -<p>There’s a few utility methods to ease some common operations, such as <code>updateStatus</code> which changes the status label in the main window, informing the user of the latest changes.</p> -<h3 id="thesaurus"><a class="anchor" href="#thesaurus">¶</a>Thesaurus</h3> -<p>A thesaurus is a collection of words or terms used to represent concepts. In literature this is commonly known as a dictionary.</p> -<p>On the subject of this project, we are using a thesaurus based on how relevant is a word for the meaning of a sentence, filtering out those that barely give us any information.</p> -<p>This file contains a simple thesaurus implementation, which can trivially be used as a normal or inverted thesaurus. However, we only treat it as inverted, and its job is loading itself and determining if words are valid or should otherwise be ignored.</p> -<h3 id="utils"><a class="anchor" href="#utils">¶</a>Utils</h3> -<p>Several utility functions used across the codebase.</p> -<h3 id="wordmap"><a class="anchor" href="#wordmap">¶</a>WordMap</h3> -<p>This file is the important one, and its implementation hasn’t changed much since our last post. Instances of a word map contain… wait for it… a map of words! It stores the mapping <code>word → count</code> in memory, and offers methods to query the count of a word or iterate over the word count entries.</p> -<p>It can be loaded from cache or told to analyze a root path. Once an instance is created, additional files could be analyzed one by one if desired.</p> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>The code was getting a bit too large to embed it within the blog post itself, so instead you can download it as a<code>.zip</code> file.</p> -<p><em>download removed</em></p> -</main> -</body> -</html> - </content></entry><entry><title>Cassandra: an Introduction</title><id>dist/cassandra-an-introduction/index.html</id><updated>2020-03-17T23:00:00+00:00</updated><published>2020-03-04T23:00:00+00:00</published><summary>This is the first post in the Cassandra series, where we will introduce the Cassandra database system and take a look at its features and installation methods.</summary><content type="html" src="dist/cassandra-an-introduction/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Cassandra: an Introduction</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the first post in the Cassandra series, where we will introduce the Cassandra database system and take a look at its features and installation methods.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-18</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/cassandra-an-introduction/">Cassandra: an Introduction</a> (this post)</li> -</ul> -<p>This post is co-authored wih Classmate.</p> -<hr /> -<div class="image-container"> -<img src="cassandra-database-e1584191543401.jpg" alt="NoSQL database – Apache Cassandra – First delivery" /> -<div class="image-caption"></div> -</div> -<p> -<h2 class="title" id="purpose_of_technology"><a class="anchor" href="#purpose_of_technology">¶</a>Purpose of technology</h2> -<p>Apache Cassandra is a <strong>NoSQL</strong>, <strong>open-source</strong>, <strong>distributed “key-value” database</strong>. It allows <strong>large volumes of distributed data</strong>. The main **goal **is provide <strong>linear scalability and availabilitywithout compromising performance</strong>. Besides, Cassandra <strong>supports replication</strong> across multiple datacenters, providing low latency. </p> -<h2 id="how_it_works"><a class="anchor" href="#how_it_works">¶</a>How it works</h2> -<p>Cassandra’s distributed **architecture **is based on a series of <strong>equal nodes</strong> that communicate with a <strong>P2P protocol</strong> so that <strong>redundancy is maximum</strong>. It offers robust support for multiple datacenters, with <strong>asynchronous replication</strong> without the need for a master server. </p> -<p>Besides, Cassandra’s <strong>data model consists of partitioning the rows</strong>, which are rearranged into <strong>different tables</strong>. The primary keys of each table have a first component that is the <strong>partition key</strong>. Within a partition, the rows are grouped by the remaining columns of the key. The other columns can be indexed separately from the primary key.</p> -<p>These tables can be <strong>created, deleted, updated and queried****at runtime without blocking</strong> each other. However it does <strong>not support joins or subqueries</strong>, but instead <strong>emphasizes denormalization</strong> through features like collections.</p> -<p>Nowadays, Cassandra uses its own query language called <strong>CQL</strong> (<strong>Cassandra Query Language</strong>), with a <strong>similar syntax to SQL</strong>. It also allows access from <strong>JDBC</strong>.</p> -<p><img src="s0GHpggGZXOFcdhypRWV4trU-PkSI6lukEv54pLZnoirh0GlDVAc4LamB1Dy.png" alt="" /> -_ Cassandra architecture _</p> -<h2 id="features"><a class="anchor" href="#features">¶</a>Features</h2> -<ul> -<li><strong>Decentralized</strong>: there are <strong>no single points of failure</strong>, every **node **in the cluster has the <strong>same role</strong> and there is <strong>no master node</strong>, so each node <strong>can service any request</strong>, besides the data is distributed across the cluster.</li> -<li>Supports **replication **and multiple replication of <strong>data center</strong>: the replication strategies are <strong>configurable</strong>. </li> -<li>**Scalability: **reading and writing performance increases linearly as new nodes are added, also <strong>new nodes</strong> can be <strong>added without interrupting</strong> application <strong>execution</strong>.</li> -<li><strong>Fault tolerance: data replication</strong> is done **automatically **in several nodes in order to recover from failures. It is possible to <strong>replace failure nodes****without <strong>making</strong> inactivity time or interruptions</strong> to the application.</li> -<li>**Consistency: **a choice of consistency level is provided for <strong>reading and writing</strong>.</li> -<li><strong>MapReduce support</strong>: it is **integrated **with <strong>Apache Hadoop</strong> to support MapReduce.</li> -<li><strong>Query language</strong>: it has its own query language called **CQL (Cassandra Query Language) **</li> -</ul> -<h2 id="corner_in_cap_theorem"><a class="anchor" href="#corner_in_cap_theorem">¶</a>Corner in CAP theorem</h2> -<p><strong>Apache Cassandra</strong> is usually described as an “<strong>AP</strong>” system because it guarantees <strong>availability</strong> and <strong>partition/fault tolerance</strong>. So it errs on the side of ensuring data availability even if this means <strong>sacrificing consistency</strong>. But, despite this fact, Apache Cassandra <strong>seeks to satisfy all three requirements</strong> (Consistency, Availability and Fault tolerance) simultaneously and can be <strong>configured to behave</strong> like a “<strong>CP</strong>” database, guaranteeing <strong>consistency and partition/fault tolerance</strong>. </p> -<p><img src="rf3n9LTOKCQVbx4qrn7NPSVcRcwE1LxR_khi-9Qc51Hcbg6BHHPu-0GZjUwD.png" alt="" /> -<em>Cassandra in CAP Theorem</em></p> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>In order to download the file, with extension .tar.gz. you must visit the <a href="https://cassandra.apache.org/download/">download site</a> and click on the file “<a href="https://ftp.cixug.es/apache/cassandra/3.11.6/apache-cassandra-3.11.6-bin.tar.gz">https://ftp.cixug.es/apache/cassandra/3.11.6/apache-cassandra-3.11.6-bin.tar.gz</a>”. It is important to mention that the previous link is related to the 3.11.6 version.</p> -<h2 id="installation"><a class="anchor" href="#installation">¶</a>Installation</h2> -<p>This database can only be installed on Linux distributions and Mac OS X systems, so, it is not possible to install it on Microsoft Windows.</p> -<p>The first main requirement is having installed Java 8 in <strong>Ubuntu</strong>, the OS that we will use. Therefore, the Java 8 installation is explained below. First open a terminal and execute the next command:</p> -<pre><code>sudo apt update -sudo apt install openjdk-8-jdk openjdk-8-jre -</code></pre> -<p>In order to establish Java as a environment variable it is needed to open the file “/.bashrc”: </p> -<pre><code>nano ~/.bashrc -</code></pre> -<p>And add at the end of it the path where Java is installed, as follows: </p> -<pre><code>export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/ -export PATH=$PATH:$JAVA_HOME/bin -</code></pre> -<p>At this point, save the file and execute the next command, note that it does the same effect re-opening the terminal: </p> -<pre><code>source ~/.bashrc -</code></pre> -<p>In order to check if the Java environment variable is set correctly, run the next command: </p> -<pre><code>echo $JAVA_HOME -</code></pre> -<p><img src="JUUmX5MIHynJR_K9EdCgKeJcpINeCGRRt2QRu4JLPtRhCVidOhcbWwVTQjyu.png" alt="" /> -<em>$JAVAHOME variable</em></p> -<p>Afterwards, it is possible to check the installed Java version with the command: </p> -<pre><code>java -version -</code></pre> -<p><img src="z9v1-0hpZwjI4U5UZej9cRGN5-Y4AZl0WUPWyQ_-JlzTAIvZtTFPnKY2xMQ_.png" alt="" /> -<em>Java version</em></p> -<p>The next requirement is having installed the latest version of Python 2.7. This can be checked with the command: </p> -<pre><code>python --version -</code></pre> -<p>If it is not installed, to install it, it is as simple as run the next command in the terminal: </p> -<pre><code>sudo apt install python -</code></pre> -<p>Note: it is better to use “python2” instead of “python” because in that way, you force to user Python 2.7. Modern distributions will use Python 3 for the «python» command.</p> -<p>Therefore, it is possible to check the installed Python version with the command:</p> -<pre><code>python --version -</code></pre> -<p><img src="Ger5Vw_e1HIK84QgRub-BwGmzIGKasgiYb4jHdfRNRrvG4d6Msp_3Vk62-9i.png" alt="" /> -<em>Python version</em></p> -<p>Once both requirements are ready, next step is to unzip the file previously downloaded, right click on the file and select “Extract here” or with the next command, on the directory where is the downloaded file. </p> -<pre><code>tar -zxvf apache-cassandra-x.x.x-bin.tar.gz -</code></pre> -<p>In order to check if the installation is completed, you can execute the next command, in the root folder of the project. This will start Cassandra in a single node. </p> -<pre><code>/bin/cassandra -</code></pre> -<p>It is possible to make a get some data from Cassandra with CQL (Cassandra Query Language). To check this execute the next command in another terminal. </p> -<pre><code>/bin/cqlsh localhost -</code></pre> -<p>Once CQL is open, type the next sentence and check the result: </p> -<pre><code>SELECT cluster_name, listen_address from system.local; -</code></pre> -<p>The output should be:</p> -<p><img src="miUO60A-RtyEAOOVFJqlkPRC18H4RKUhot6RWzhO9FmtzgTPOYHFtwxqgZEf.png" alt="" /> -<em>Sentence output</em></p> -<p>Finally, the installation guide provided by the website of the database is attached in this <a href="https://cassandra.apache.org/doc/latest/getting_started/installing.html">installation guide</a>. </p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://es.wikipedia.org/wiki/Apache_Cassandra">Wikipedia</a></li> -<li><a href="https://cassandra.apache.org/">Apache Cassandra</a></li> -<li><a href="https://www.datastax.com/blog/2019/05/how-apache-cassandratm-balances-consistency-availability-and-performance">Datastax</a></li> -<li><a href="https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/">yugabyte</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Privado: PC-Crawler evaluation</title><id>dist/pc-crawler-evaluation/index.html</id><updated>2020-03-17T23:00:00+00:00</updated><published>2020-03-03T23:00:00+00:00</published><summary>As the student </summary><content type="html" src="dist/pc-crawler-evaluation/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: PC-Crawler evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>As the student <code>a(i)</code> where <code>i = 9</code>, I have been assigned to evaluate students <code>a(i + 3)</code> and <code>a(i + 4)</code>, these being:</p> -<div class="date-created-modified">Created 2020-03-04<br> -Modified 2020-03-18</div> -<ul> -<li>a12: Classmate (username)</li> -<li>a13: Classmate (username)</li> -</ul> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: B.</strong></p> -<p>I think they mix up a bit their considerations with program usage and how it works, not justifying why the considerations are the ones they chose, or what the alternatives would be.</p> -<p>The implementation notes are quite well-written. Even someone without knowledge of Java’s syntax can read the notes and more or less make sense of what’s going on, with the relevant code excerpts on each section.</p> -<p>Implementation-wise, some methods could definitely use some improvement:</p> -<ul> -<li><code>esExtensionTextual</code> is overly complicated. It could use a <code>for</code> loop and Java’s <code>String.endsWith</code>.</li> -<li><code>calcularFrecuencia</code> has quite some duplication (e.g. <code>this.getFicherosYDirectorios().remove(0)</code>) and could definitely be cleaned up.</li> -</ul> -<p>However, all the desired functionality is implemented.</p> -<p>Style-wise, some of the newlines and avoiding braces on <code>if</code> and <code>while</code> could be changed to improve the readability.</p> -<p>The post is written in Spanish, but uses some words that don’t translate well («remover» could better be said as «eliminar» or «quitar»).</p> -<h2 id="classmate_s_evaluation_2"><a class="anchor" href="#classmate_s_evaluation_2">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: B.</strong></p> -<p>Their post starts with an explanation on what a crawler is, common uses for them, and what type of crawler they will be developing. This is a very good start. Regarding the post style, it seems they are not properly using some of WordPress features, such as lists, and instead rely on paragraphs with special characters prefixing each list item.</p> -<p>The post also contains some details on how to install the requirements to run the program, which can be very useful for someone not used to working with Java.</p> -<p>They do not explain their implementation and the filename of the download has a typo.</p> -<p>Implementation-wise, the code seems to be well-organized, into several packages and files, although the naming is a bit inconsistent. They even designed a GUI, which is quite impressive.</p> -<p>Some of the methods are documented, although the code inside them is not very commented, including missing rationale for the data structures chosen. There also seem to be several other unused main functions, which I’m unsure why they were kept.</p> -<p>However, all the desired functionality is implemented.</p> -<p>Similar to Classmate, the code style could be improved and settled on some standard, as well as making use of Java features such as <code>for</code> loops over iterators instead of manual loops.</p> -</main> -</body> -</html> - </content></entry><entry><title>Introduction to NoSQL</title><id>dist/introduction-to-nosql/index.html</id><updated>2020-03-17T23:00:00+00:00</updated><published>2020-02-24T23:00:00+00:00</published><summary>This post will primarly focus on the talk held in the </summary><content type="html" src="dist/introduction-to-nosql/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Introduction to NoSQL</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This post will primarly focus on the talk held in the <a href="https://youtu.be/qI_g07C_Q5I">GOTO 2012 conference: Introduction to NoSQL by Martin Fowler</a>. It can be seen as an informal, summarized transcript of the talk</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<hr /> -<p>The relational database model is affected by the <em><a href="https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch">impedance mismatch problem</a></em>. This occurs because we have to match our high-level design with the separate columns and rows used by relational databases.</p> -<p>Taking the in-memory objects and putting them into a relational database (which were dominant at the time) simply didn’t work out. Why? Relational databases were more than just databases, they served as a an integration mechanism across applications, up to the 2000s. For 20 years!</p> -<p>With the rise of the Internet and the sheer amount of traffic, databases needed to scale. Unfortunately, relational databases only scale well vertically (by upgrading a <em>single</em> node). This is <em>very</em> expensive, and not something many could afford.</p> -<p>The problem are those pesky <code>JOIN</code>‘s, and its friends <code>GROUP BY</code>. Because our program and reality model don’t match the tables used by SQL, we have to rely on them to query the data. It is because the model doesn’t map directly.</p> -<p>Furthermore, graphs don’t map very well at all to relational models.</p> -<p>We needed a way to scale horizontally (by increasing the <em>amount</em> of nodes), something relational databases were not designed to do.</p> -<blockquote> -<p><em>We need to do something different, relational across nodes is an unnatural act</em></p> -</blockquote> -<p>This inspired the NoSQL movement.</p> -<blockquote> -<p><em>#nosql was only meant to be a hashtag to advertise it, but unfortunately it’s how it is called now</em></p> -</blockquote> -<p>It is not possible to define NoSQL, but we can identify some of its characteristics:</p> -<ul> -<li> -<p>Non-relational</p> -</li> -<li> -<p><strong>Cluster-friendly</strong> (this was the original spark)</p> -</li> -<li> -<p>Open-source (until now, generally)</p> -</li> -<li> -<p>21st century web culture</p> -</li> -<li> -<p>Schema-less (easier integration or conjugation of several models, structure aggregation) -These databases use different data models to those used by the relational model. However, it is possible to identify 4 broad chunks (some may say 3, or even 2!):</p> -</li> -<li> -<p><strong>Key-value store</strong>. With a certain key, you obtain the value corresponding to it. It knows nothing else, nor does it care. We say the data is opaque.</p> -</li> -<li> -<p><strong>Document-based</strong>. It stores an entire mass of documents with complex structure, normally through the use of JSON (XML has been left behind). Then, you can ask for certain fields, structures, or portions. We say the data is transparent.</p> -</li> -<li> -<p><strong>Column-family</strong>. There is a «row key», and within it we store multiple «column families» (columns that fit together, our aggregate). We access by row-key and column-family name. -All of these kind of serve to store documents without any <em>explicit</em> schema. Just shove in anything! This gives a lot of flexibility and ease of migration, except… that’s not really true. There’s an <em>implicit</em> schema when querying.</p> -</li> -</ul> -<p>For example, a query where we may do <code>anOrder['price'] * anOrder['quantity']</code> is assuming that <code>anOrder</code> has both a <code>price</code> and a <code>quantity</code>, and that both of these can be multiplied together. «Schema-less» is a fuzzy term.</p> -<p>However, it is the lack of a <em>fixed</em> schema that gives flexibility.</p> -<p>One could argue that the line between key-value and document-based is very fuzzy, and they would be right! Key-value databases often let you include additional metadata that behaves like an index, and in document-based, documents often have an identifier anyway.</p> -<p>The common notion between these three types is what matters. They save an entire structure as an <em>unit</em>. We can refer to these as «Aggregate Oriented Databases». Aggregate, because we group things when designing or modeling our systems, as opposed to relational databases that scatter the information across many tables.</p> -<p>There exists a notable outlier, though, and that’s:</p> -<ul> -<li><strong>Graph</strong> databases. They use a node-and-arc graph structure. They are great for moving on relationships across things. Ironically, relational databases are not very good at jumping across relationships! It is possibly to perform very interesting queries in graph databases which would be really hard and costly on relational models. Unlike the aggregated databases, graphs break things into even smaller units. -NoSQL is not <em>the</em> solution. It depends on how you’ll work with your data. Do you need an aggregate database? Will you have a lot of relationships? Or would the relational model be good fit for you?</li> -</ul> -<p>NoSQL, however, is a good fit for large-scale projects (data will <em>always</em> grow) and faster development (the impedance mismatch is drastically reduced).</p> -<p>Regardless of our choice, it is important to remember that NoSQL is a young technology, which is still evolving really fast (SQL has been stable for <em>decades</em>). But the <em>polyglot persistence</em> is what matters. One must know the alternatives, and be able to choose.</p> -<hr /> -<p>Relational databases have the well-known ACID properties: Atomicity, Consistency, Isolation and Durability.</p> -<p>NoSQL (except graph-based!) are about being BASE instead: Basically Available, Soft state, Eventual consistency.</p> -<p>SQL needs transactions because we don’t want to perform a read while we’re only half-way done with a write! The readers and writers are the problem, and ensuring consistency results in a performance hit, even if the risk is low (two writers are extremely rare but it still must be handled).</p> -<p>NoSQL on the other hand doesn’t need ACID because the aggregate <em>is</em> the transaction boundary. Even before NoSQL itself existed! Any update is atomic by nature. When updating many documents it <em>is</em> a problem, but this is very rare.</p> -<p>We have to distinguish between logical and replication consistency. During an update and if a conflict occurs, it must be resolved to preserve the logical consistency. Replication consistency on the other hand is preserveed when distributing the data across many machines, for example during sharding or copies.</p> -<p>Replication buys us more processing power and resillence (at the cost of more storage) in case some of the nodes die. But what happens if what dies is the communication across the nodes? We could drop the requests and preserve the consistency, or accept the risk to continue and instead preserve the availability.</p> -<p>The choice on whether trading consistency for availability is acceptable or not depends on the domain rules. It is the domain’s choice, the business people will choose. If you’re Amazon, you always want to be able to sell, but if you’re a bank, you probably don’t want your clients to have negative numbers in their account!</p> -<p>Regardless of what we do, in a distributed system, the CAP theorem always applies: Consistecy, Availability, Partitioning-tolerancy (error tolerancy). It is <strong>impossible</strong> to guarantee all 3 at 100%. Most of the times, it does work, but it is mathematically impossible to guarantee at 100%.</p> -<p>A database has to choose what to give up at some point. When designing a distributed system, this must be considered. Normally, the choice is made between consistency or response time.</p> -<h2 class="title" id="further_reading"><a class="anchor" href="#further_reading">¶</a>Further reading</h2> -<ul> -<li><a href="https://www.martinfowler.com/articles/nosql-intro-original.pdf">The future is: <del>NoSQL Databases</del> Polyglot Persistence</a></li> -<li><a href="https://www.thoughtworks.com/insights/blog/nosql-databases-overview">NoSQL Databases: An Overview</a></li> -</ul> -</main> -</body> -</html> - </content></entry><entry><title>Build your own PC</title><id>dist/build-your-own-pc/index.html</id><updated>2020-03-17T23:00:00+00:00</updated><published>2020-02-24T23:00:00+00:00</published><summary>…where PC obviously stands for Personal Crawler</summary><content type="html" src="dist/build-your-own-pc/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Build your own PC</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p><em>…where PC obviously stands for Personal Crawler</em>.</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<hr /> -<p>This post contains the source code for a very simple crawler written in Java. You can compile and run it on any file or directory, and it will calculate the frequency of all the words it finds.</p> -<h2 class="title" id="source_code"><a class="anchor" href="#source_code">¶</a>Source code</h2> -<p>Paste the following code in a new file called <code>Crawl.java</code>:</p> -<pre><code>import java.io.*; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -class Crawl { - // Regex used to tokenize the words from a line of text - private final static Pattern WORDS = Pattern.compile(&quot;\\w+&quot;); - - // The file where we will cache our results - private final static File INDEX_FILE = new File(&quot;index.bin&quot;); - - // Helper method to determine if a file is a text file or not - private static boolean isTextFile(File file) { - String name = file.getName().toLowerCase(); - return name.endsWith(&quot;.txt&quot;) - || name.endsWith(&quot;.java&quot;) - || name.endsWith(&quot;.c&quot;) - || name.endsWith(&quot;.cpp&quot;) - || name.endsWith(&quot;.h&quot;) - || name.endsWith(&quot;.hpp&quot;) - || name.endsWith(&quot;.html&quot;) - || name.endsWith(&quot;.css&quot;) - || name.endsWith(&quot;.js&quot;); - } - - // Normalizes a string by converting it to lowercase and removing accents - private static String normalize(String string) { - return string.toLowerCase() - .replace(&quot;á&quot;, &quot;a&quot;) - .replace(&quot;é&quot;, &quot;e&quot;) - .replace(&quot;í&quot;, &quot;i&quot;) - .replace(&quot;ó&quot;, &quot;o&quot;) - .replace(&quot;ú&quot;, &quot;u&quot;); - } - - // Recursively fills the map with the count of words found on all the text files - static void fillWordMap(Map&lt;String, Integer&gt; map, File root) throws IOException { - // Our file queue begins with the root - Queue&lt;File&gt; fileQueue = new ArrayDeque&lt;&gt;(); - fileQueue.add(root); - - // For as long as the queue is not empty... - File file; - while ((file = fileQueue.poll()) != null) { - if (!file.exists() || !file.canRead()) { - // ...ignore files for which we don't have permission... - System.err.println(&quot;warning: cannot read file: &quot; + file); - } else if (file.isDirectory()) { - // ...else if it's a directory, extend our queue with its files... - File[] files = file.listFiles(); - if (files == null) { - System.err.println(&quot;warning: cannot list dir: &quot; + file); - } else { - fileQueue.addAll(Arrays.asList(files)); - } - } else if (isTextFile(file)) { - // ...otherwise, count the words in the file. - countWordsInFile(map, file); - } - } - } - - // Counts the words in a single file and adds the count to the map. - public static void countWordsInFile(Map&lt;String, Integer&gt; map, File file) throws IOException { - BufferedReader reader = new BufferedReader(new FileReader(file)); - - String line; - while ((line = reader.readLine()) != null) { - Matcher matcher = WORDS.matcher(line); - while (matcher.find()) { - String token = normalize(matcher.group()); - Integer count = map.get(token); - if (count == null) { - map.put(token, 1); - } else { - map.put(token, count + 1); - } - } - } - - reader.close(); - } - - // Prints the map of word count to the desired output stream. - public static void printWordMap(Map&lt;String, Integer&gt; map, PrintStream writer) { - List&lt;String&gt; keys = new ArrayList&lt;&gt;(map.keySet()); - Collections.sort(keys); - for (String key : keys) { - writer.println(key + &quot;\t&quot; + map.get(key)); - } - } - - @SuppressWarnings(&quot;unchecked&quot;) - public static void main(String[] args) throws IOException, ClassNotFoundException { - // Validate arguments - if (args.length == 1 &amp;&amp; args[0].equals(&quot;--help&quot;)) { - System.err.println(&quot;usage: java Crawl [input]&quot;); - return; - } - - File root = new File(args.length &gt; 0 ? args[0] : &quot;.&quot;); - - // Loading or generating the map where we aggregate the data {word: count} - Map&lt;String, Integer&gt; map; - if (INDEX_FILE.isFile()) { - System.err.println(&quot;Found existing index file: &quot; + INDEX_FILE); - try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(INDEX_FILE))) { - map = (Map&lt;String, Integer&gt;) ois.readObject(); - } - } else { - System.err.println(&quot;Index file not found: &quot; + INDEX_FILE + &quot;; indexing...&quot;); - map = new TreeMap&lt;&gt;(); - fillWordMap(map, root); - // Cache the results to avoid doing the work a next time - try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(INDEX_FILE))) { - out.writeObject(map); - } - } - - // Ask the user in a loop to query for words - Scanner scanner = new Scanner(System.in); - while (true) { - System.out.print(&quot;Escriba palabra a consultar (o Enter para salir): &quot;); - System.out.flush(); - String line = scanner.nextLine().trim(); - if (line.isEmpty()) { - break; - } - - line = normalize(line); - Integer count = map.get(line); - if (count == null) { - System.out.println(String.format(&quot;La palabra \&quot;%s\&quot; no está presente&quot;, line)); - } else if (count == 1) { - System.out.println(String.format(&quot;La palabra \&quot;%s\&quot; está presente 1 vez&quot;, line)); - } else { - System.out.println(String.format(&quot;La palabra \&quot;%s\&quot; está presente %d veces&quot;, line, count)); - } - } - } -} -</code></pre> -<p>It can be compiled and executed as follows:</p> -<pre><code>javac Crawl.java -java Crawl -</code></pre> -<p>Instead of copy-pasting the code, you may also download it as a <code>.zip</code>:</p> -<p><em>(contents removed)</em></p> -<h2 id="addendum"><a class="anchor" href="#addendum">¶</a>Addendum</h2> -<p>The following simple function can be used if one desires to print the contents of a file:</p> -<pre><code>public static void printFile(File file) { - if (isTextFile(file)) { - System.out.println('\n' + file.getName()); - try (BufferedReader reader = new BufferedReader(new FileReader(file))) { - String line; - while ((line = reader.readLine()) != null) { - System.out.println(line); - } - } catch (FileNotFoundException ignored) { - System.err.println(&quot;warning: file disappeared while reading: &quot; + file); - } catch (IOException e) { - e.printStackTrace(); - } - } -} -</code></pre> -</main> -</body> -</html> - </content></entry><entry><title>About Boolean Retrieval</title><id>dist/about-boolean-retrieval/index.html</id><updated>2020-03-17T23:00:00+00:00</updated><published>2020-02-24T23:00:00+00:00</published><summary>This entry will discuss the section on the </summary><content type="html" src="dist/about-boolean-retrieval/index.html"><!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>About Boolean Retrieval</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This entry will discuss the section on the <em><a href="https://nlp.stanford.edu/IR-book/pdf/01bool.pdf">Boolean retrieval</a></em> section of the book <em><a href="https://nlp.stanford.edu/IR-book/pdf/irbookprint.pdf">An Introduction to Information Retrieval</a></em>.</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<h2 class="title" id="summary_on_the_topic"><a class="anchor" href="#summary_on_the_topic">¶</a>Summary on the topic</h2> -<p>Boolean retrieval is one of the many ways information retrieval (finding materials that satisfy an information need), often simply called <em>search</em>.</p> -<p>A simple way to retrieve information is to <em>grep</em> through the text (term named after the Unix tool <code>grep</code>), scanning text linearly and excluding it on certain criteria. However, this falls short when the volume of the data grows, more complex queries are desired, or one seeks some sort of ranking.</p> -<p>To avoid linear scanning, we build an <em>index</em> and record for each document whether it contains each term out of our full dictionary of terms (which may be words in a chapter and words in the book). This results in a binary term-document <em>incidence matrix</em>. Such a possible matrix is:</p> -<table class=""> - <tbody> - <tr> - <td> - <em> - word/play - </em> - </td> - <td> - <strong> - Antony and Cleopatra - </strong> - </td> - <td> - <strong> - Julius Caesar - </strong> - </td> - <td> - <strong> - The Tempest - </strong> - </td> - <td> - <strong> - … - </strong> - </td> - </tr> - <tr> - <td> - <strong> - Antony - </strong> - </td> - <td> - 1 - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - Brutus - </strong> - </td> - <td> - 1 - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - Caesar - </strong> - </td> - <td> - 1 - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - Calpurnia - </strong> - </td> - <td> - 0 - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - Cleopatra - </strong> - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - 0 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - mercy - </strong> - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - 1 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - worser - </strong> - </td> - <td> - 1 - </td> - <td> - 0 - </td> - <td> - 1 - </td> - <td> - </td> - </tr> - <tr> - <td> - <strong> - … - </strong> - </td> - <td> - </td> - <td> - </td> - <td> - </td> - <td> - </td> - </tr> - </tbody> -</table> -<p>We can look at this matrix’s rows or columns to obtain a vector for each term indicating where it appears, or a vector for each document indicating the terms it contains.</p> -<p>Now, answering a query such as <code>Brutus AND Caesar AND NOT Calpurnia</code> becomes trivial:</p> -<pre><code>VECTOR(Brutus) AND VECTOR(Caesar) AND COMPLEMENT(VECTOR(Calpurnia)) -= 110 AND 110 AND COMPLEMENT(010) -= 110 AND 110 AND 101 -= 100 -</code></pre> -<p>The query is only satisfied for our first column.</p> -<p>The <em>Boolean retrieval model</em> is thus a model that treats documents as a set of terms, in which we can perform any query in the form of Boolean expressions of terms, combined with <code>OR</code>, <code>AND</code>, and <code>NOT</code>.</p> -<p>Now, building such a matrix is often not feasible due to the sheer amount of data (say, a matrix with 500,000 terms across 1,000,000 documents, each with roughly 1,000 terms). However, it is important to notice that most of the terms will be <em>missing</em> when examining each document. In our example, this means 99.8% or more of the cells will be 0. We can instead record the <em>positions</em> of the 1’s. This is known as an <em>inverted index</em>.</p> -<p>The inverted index is a dictionary of terms, each containing a list that records in which documents it appears (<em>postings</em>). Applied to boolean retrieval, we would:</p> -<ol> -<li>Collects the documents to be indexed, assign a unique identifier each</li> -<li>Tokenize the text in the documents into a list of terms</li> -<li>Normalize the tokens, which now become indexing terms</li> -<li>Index the documents</li> -</ol> -<table class=""> - <tbody> - <tr> - <td> - <strong> - Dictionary - </strong> - </td> - <td> - <strong> - Postings - </strong> - </td> - </tr> - <tr> - <td> - Brutus - </td> - <td> - 1, 2, 4, 11, 31, 45, 173, 174 - </td> - </tr> - <tr> - <td> - Caesar - </td> - <td> - 1, 2, 4, 5, 6, 16, 57, 132, … - </td> - </tr> - <tr> - <td> - Calpurnia - </td> - <td> - 2, 31, 54, 101 - </td> - </tr> - <tr> - <td> - … - </td> - <td> - </td> - </tr> - </tbody> -</table> -<p>Sort the pairs <code>(term, document_id)</code> so that the terms are alphabetical, and merge multiple occurences into one. Group instances of the same term and split again into a sorted list of postings.</p> -<table class=""> - <tbody> - <tr> - <td> - <strong> - term - </strong> - </td> - <td> - <strong> - document_id - </strong> - </td> - </tr> - <tr> - <td> - I - </td> - <td> - 1 - </td> - </tr> - <tr> - <td> - did - </td> - <td> - 1 - </td> - </tr> - <tr> - <td> - … - </td> - <td> - </td> - </tr> - <tr> - <td> - with - </td> - <td> - 2 - </td> - </tr> - </tbody> -</table> -<table class=""> - <tbody> - <tr> - <td> - <strong> - term - </strong> - </td> - <td> - <strong> - document_id - </strong> - </td> - </tr> - <tr> - <td> - be - </td> - <td> - 2 - </td> - </tr> - <tr> - <td> - brutus - </td> - <td> - 1 - </td> - </tr> - <tr> - <td> - brutus - </td> - <td> - 2 - </td> - </tr> - <tr> - <td> - … - </td> - <td> - </td> - </tr> - </tbody> -</table> -<table class=""> - <tbody> - <tr> - <td> - <strong> - term - </strong> - </td> - <td> - <strong> - frequency - </strong> - </td> - <td> - <strong> - postings list - </strong> - </td> - </tr> - <tr> - <td> - be - </td> - <td> - 1 - </td> - <td> - 2 - </td> - </tr> - <tr> - <td> - brutus - </td> - <td> - 2 - </td> - <td> - 1, 2 - </td> - </tr> - <tr> - <td> - capitol - </td> - <td> - 1 - </td> - <td> - 1 - </td> - </tr> - <tr> - <td> - … - </td> - <td> - </td> - <td> - </td> - </tr> - </tbody> -</table> -<p>Intersecting posting lists now becomes of transversing both lists in order:</p> -<pre><code>Brutus : 1 -&gt; 2 -&gt; 4 -&gt; 11 -&gt; 31 -&gt; 45 -&gt; 173 -&gt; 174 -Calpurnia: 2 -&gt; 31 -&gt; 54 -&gt; 101 -Intersect: 2 -&gt; 31 -</code></pre> -<p>A simple conjunctive query (e.g. <code>Brutus AND Calpurnia</code>) is executed as follows:</p> -<ol> -<li>Locate <code>Brutus</code> in the dictionary</li> -<li>Retrieve its postings</li> -<li>Locate <code>Calpurnia</code> in the dictionary</li> -<li>Retrieve its postings</li> -<li>Intersect (<em>merge</em>) both postings</li> -</ol> -<p>Since the lists are sorted, walking both of them can be done in <em>O(n)</em> time. By also storing the frequency, we can optimize the order in which we execute arbitrary queries, although we won’t go into detail.</p> -<h2 id="thoughts"><a class="anchor" href="#thoughts">¶</a>Thoughts</h2> -<p>The boolean retrieval model can be implemented with relative ease, and can help with storage and efficient querying of the information if we intend to perform boolean queries.</p> -<p>However, the basic design lacks other useful operations, such as a «near» operator, or the ability to rank the results.</p> -<p>All in all, it’s an interesting way to look at the data and query it efficiently.</p> -</main> -</body> -</html> - </content></entry></feed>
@@ -1,188 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Build your own PC</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p><em>…where PC obviously stands for Personal Crawler</em>.</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<hr /> -<p>This post contains the source code for a very simple crawler written in Java. You can compile and run it on any file or directory, and it will calculate the frequency of all the words it finds.</p> -<h2 class="title" id="source_code"><a class="anchor" href="#source_code">¶</a>Source code</h2> -<p>Paste the following code in a new file called <code>Crawl.java</code>:</p> -<pre><code>import java.io.*; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -class Crawl { - // Regex used to tokenize the words from a line of text - private final static Pattern WORDS = Pattern.compile("\\w+"); - - // The file where we will cache our results - private final static File INDEX_FILE = new File("index.bin"); - - // Helper method to determine if a file is a text file or not - private static boolean isTextFile(File file) { - String name = file.getName().toLowerCase(); - return name.endsWith(".txt") - || name.endsWith(".java") - || name.endsWith(".c") - || name.endsWith(".cpp") - || name.endsWith(".h") - || name.endsWith(".hpp") - || name.endsWith(".html") - || name.endsWith(".css") - || name.endsWith(".js"); - } - - // Normalizes a string by converting it to lowercase and removing accents - private static String normalize(String string) { - return string.toLowerCase() - .replace("á", "a") - .replace("é", "e") - .replace("í", "i") - .replace("ó", "o") - .replace("ú", "u"); - } - - // Recursively fills the map with the count of words found on all the text files - static void fillWordMap(Map<String, Integer> map, File root) throws IOException { - // Our file queue begins with the root - Queue<File> fileQueue = new ArrayDeque<>(); - fileQueue.add(root); - - // For as long as the queue is not empty... - File file; - while ((file = fileQueue.poll()) != null) { - if (!file.exists() || !file.canRead()) { - // ...ignore files for which we don't have permission... - System.err.println("warning: cannot read file: " + file); - } else if (file.isDirectory()) { - // ...else if it's a directory, extend our queue with its files... - File[] files = file.listFiles(); - if (files == null) { - System.err.println("warning: cannot list dir: " + file); - } else { - fileQueue.addAll(Arrays.asList(files)); - } - } else if (isTextFile(file)) { - // ...otherwise, count the words in the file. - countWordsInFile(map, file); - } - } - } - - // Counts the words in a single file and adds the count to the map. - public static void countWordsInFile(Map<String, Integer> map, File file) throws IOException { - BufferedReader reader = new BufferedReader(new FileReader(file)); - - String line; - while ((line = reader.readLine()) != null) { - Matcher matcher = WORDS.matcher(line); - while (matcher.find()) { - String token = normalize(matcher.group()); - Integer count = map.get(token); - if (count == null) { - map.put(token, 1); - } else { - map.put(token, count + 1); - } - } - } - - reader.close(); - } - - // Prints the map of word count to the desired output stream. - public static void printWordMap(Map<String, Integer> map, PrintStream writer) { - List<String> keys = new ArrayList<>(map.keySet()); - Collections.sort(keys); - for (String key : keys) { - writer.println(key + "\t" + map.get(key)); - } - } - - @SuppressWarnings("unchecked") - public static void main(String[] args) throws IOException, ClassNotFoundException { - // Validate arguments - if (args.length == 1 && args[0].equals("--help")) { - System.err.println("usage: java Crawl [input]"); - return; - } - - File root = new File(args.length > 0 ? args[0] : "."); - - // Loading or generating the map where we aggregate the data {word: count} - Map<String, Integer> map; - if (INDEX_FILE.isFile()) { - System.err.println("Found existing index file: " + INDEX_FILE); - try (ObjectInputStream ois = new ObjectInputStream(new FileInputStream(INDEX_FILE))) { - map = (Map<String, Integer>) ois.readObject(); - } - } else { - System.err.println("Index file not found: " + INDEX_FILE + "; indexing..."); - map = new TreeMap<>(); - fillWordMap(map, root); - // Cache the results to avoid doing the work a next time - try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(INDEX_FILE))) { - out.writeObject(map); - } - } - - // Ask the user in a loop to query for words - Scanner scanner = new Scanner(System.in); - while (true) { - System.out.print("Escriba palabra a consultar (o Enter para salir): "); - System.out.flush(); - String line = scanner.nextLine().trim(); - if (line.isEmpty()) { - break; - } - - line = normalize(line); - Integer count = map.get(line); - if (count == null) { - System.out.println(String.format("La palabra \"%s\" no está presente", line)); - } else if (count == 1) { - System.out.println(String.format("La palabra \"%s\" está presente 1 vez", line)); - } else { - System.out.println(String.format("La palabra \"%s\" está presente %d veces", line, count)); - } - } - } -} -</code></pre> -<p>It can be compiled and executed as follows:</p> -<pre><code>javac Crawl.java -java Crawl -</code></pre> -<p>Instead of copy-pasting the code, you may also download it as a <code>.zip</code>:</p> -<p><em>(contents removed)</em></p> -<h2 id="addendum"><a class="anchor" href="#addendum">¶</a>Addendum</h2> -<p>The following simple function can be used if one desires to print the contents of a file:</p> -<pre><code>public static void printFile(File file) { - if (isTextFile(file)) { - System.out.println('\n' + file.getName()); - try (BufferedReader reader = new BufferedReader(new FileReader(file))) { - String line; - while ((line = reader.readLine()) != null) { - System.out.println(line); - } - } catch (FileNotFoundException ignored) { - System.err.println("warning: file disappeared while reading: " + file); - } catch (IOException e) { - e.printStackTrace(); - } - } -} -</code></pre> -</main> -</body> -</html> -
@@ -1,114 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Cassandra: an Introduction</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the first post in the Cassandra series, where we will introduce the Cassandra database system and take a look at its features and installation methods.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-18</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/cassandra-an-introduction/">Cassandra: an Introduction</a> (this post)</li> -</ul> -<p>This post is co-authored wih Classmate.</p> -<hr /> -<div class="image-container"> -<img src="cassandra-database-e1584191543401.jpg" alt="NoSQL database – Apache Cassandra – First delivery" /> -<div class="image-caption"></div> -</div> -<p> -<h2 class="title" id="purpose_of_technology"><a class="anchor" href="#purpose_of_technology">¶</a>Purpose of technology</h2> -<p>Apache Cassandra is a <strong>NoSQL</strong>, <strong>open-source</strong>, <strong>distributed “key-value” database</strong>. It allows <strong>large volumes of distributed data</strong>. The main **goal **is provide <strong>linear scalability and availabilitywithout compromising performance</strong>. Besides, Cassandra <strong>supports replication</strong> across multiple datacenters, providing low latency. </p> -<h2 id="how_it_works"><a class="anchor" href="#how_it_works">¶</a>How it works</h2> -<p>Cassandra’s distributed **architecture **is based on a series of <strong>equal nodes</strong> that communicate with a <strong>P2P protocol</strong> so that <strong>redundancy is maximum</strong>. It offers robust support for multiple datacenters, with <strong>asynchronous replication</strong> without the need for a master server. </p> -<p>Besides, Cassandra’s <strong>data model consists of partitioning the rows</strong>, which are rearranged into <strong>different tables</strong>. The primary keys of each table have a first component that is the <strong>partition key</strong>. Within a partition, the rows are grouped by the remaining columns of the key. The other columns can be indexed separately from the primary key.</p> -<p>These tables can be <strong>created, deleted, updated and queried****at runtime without blocking</strong> each other. However it does <strong>not support joins or subqueries</strong>, but instead <strong>emphasizes denormalization</strong> through features like collections.</p> -<p>Nowadays, Cassandra uses its own query language called <strong>CQL</strong> (<strong>Cassandra Query Language</strong>), with a <strong>similar syntax to SQL</strong>. It also allows access from <strong>JDBC</strong>.</p> -<p><img src="s0GHpggGZXOFcdhypRWV4trU-PkSI6lukEv54pLZnoirh0GlDVAc4LamB1Dy.png" alt="" /> -_ Cassandra architecture _</p> -<h2 id="features"><a class="anchor" href="#features">¶</a>Features</h2> -<ul> -<li><strong>Decentralized</strong>: there are <strong>no single points of failure</strong>, every **node **in the cluster has the <strong>same role</strong> and there is <strong>no master node</strong>, so each node <strong>can service any request</strong>, besides the data is distributed across the cluster.</li> -<li>Supports **replication **and multiple replication of <strong>data center</strong>: the replication strategies are <strong>configurable</strong>. </li> -<li>**Scalability: **reading and writing performance increases linearly as new nodes are added, also <strong>new nodes</strong> can be <strong>added without interrupting</strong> application <strong>execution</strong>.</li> -<li><strong>Fault tolerance: data replication</strong> is done **automatically **in several nodes in order to recover from failures. It is possible to <strong>replace failure nodes****without <strong>making</strong> inactivity time or interruptions</strong> to the application.</li> -<li>**Consistency: **a choice of consistency level is provided for <strong>reading and writing</strong>.</li> -<li><strong>MapReduce support</strong>: it is **integrated **with <strong>Apache Hadoop</strong> to support MapReduce.</li> -<li><strong>Query language</strong>: it has its own query language called **CQL (Cassandra Query Language) **</li> -</ul> -<h2 id="corner_in_cap_theorem"><a class="anchor" href="#corner_in_cap_theorem">¶</a>Corner in CAP theorem</h2> -<p><strong>Apache Cassandra</strong> is usually described as an “<strong>AP</strong>” system because it guarantees <strong>availability</strong> and <strong>partition/fault tolerance</strong>. So it errs on the side of ensuring data availability even if this means <strong>sacrificing consistency</strong>. But, despite this fact, Apache Cassandra <strong>seeks to satisfy all three requirements</strong> (Consistency, Availability and Fault tolerance) simultaneously and can be <strong>configured to behave</strong> like a “<strong>CP</strong>” database, guaranteeing <strong>consistency and partition/fault tolerance</strong>. </p> -<p><img src="rf3n9LTOKCQVbx4qrn7NPSVcRcwE1LxR_khi-9Qc51Hcbg6BHHPu-0GZjUwD.png" alt="" /> -<em>Cassandra in CAP Theorem</em></p> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>In order to download the file, with extension .tar.gz. you must visit the <a href="https://cassandra.apache.org/download/">download site</a> and click on the file “<a href="https://ftp.cixug.es/apache/cassandra/3.11.6/apache-cassandra-3.11.6-bin.tar.gz">https://ftp.cixug.es/apache/cassandra/3.11.6/apache-cassandra-3.11.6-bin.tar.gz</a>”. It is important to mention that the previous link is related to the 3.11.6 version.</p> -<h2 id="installation"><a class="anchor" href="#installation">¶</a>Installation</h2> -<p>This database can only be installed on Linux distributions and Mac OS X systems, so, it is not possible to install it on Microsoft Windows.</p> -<p>The first main requirement is having installed Java 8 in <strong>Ubuntu</strong>, the OS that we will use. Therefore, the Java 8 installation is explained below. First open a terminal and execute the next command:</p> -<pre><code>sudo apt update -sudo apt install openjdk-8-jdk openjdk-8-jre -</code></pre> -<p>In order to establish Java as a environment variable it is needed to open the file “/.bashrc”: </p> -<pre><code>nano ~/.bashrc -</code></pre> -<p>And add at the end of it the path where Java is installed, as follows: </p> -<pre><code>export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/ -export PATH=$PATH:$JAVA_HOME/bin -</code></pre> -<p>At this point, save the file and execute the next command, note that it does the same effect re-opening the terminal: </p> -<pre><code>source ~/.bashrc -</code></pre> -<p>In order to check if the Java environment variable is set correctly, run the next command: </p> -<pre><code>echo $JAVA_HOME -</code></pre> -<p><img src="JUUmX5MIHynJR_K9EdCgKeJcpINeCGRRt2QRu4JLPtRhCVidOhcbWwVTQjyu.png" alt="" /> -<em>$JAVAHOME variable</em></p> -<p>Afterwards, it is possible to check the installed Java version with the command: </p> -<pre><code>java -version -</code></pre> -<p><img src="z9v1-0hpZwjI4U5UZej9cRGN5-Y4AZl0WUPWyQ_-JlzTAIvZtTFPnKY2xMQ_.png" alt="" /> -<em>Java version</em></p> -<p>The next requirement is having installed the latest version of Python 2.7. This can be checked with the command: </p> -<pre><code>python --version -</code></pre> -<p>If it is not installed, to install it, it is as simple as run the next command in the terminal: </p> -<pre><code>sudo apt install python -</code></pre> -<p>Note: it is better to use “python2” instead of “python” because in that way, you force to user Python 2.7. Modern distributions will use Python 3 for the «python» command.</p> -<p>Therefore, it is possible to check the installed Python version with the command:</p> -<pre><code>python --version -</code></pre> -<p><img src="Ger5Vw_e1HIK84QgRub-BwGmzIGKasgiYb4jHdfRNRrvG4d6Msp_3Vk62-9i.png" alt="" /> -<em>Python version</em></p> -<p>Once both requirements are ready, next step is to unzip the file previously downloaded, right click on the file and select “Extract here” or with the next command, on the directory where is the downloaded file. </p> -<pre><code>tar -zxvf apache-cassandra-x.x.x-bin.tar.gz -</code></pre> -<p>In order to check if the installation is completed, you can execute the next command, in the root folder of the project. This will start Cassandra in a single node. </p> -<pre><code>/bin/cassandra -</code></pre> -<p>It is possible to make a get some data from Cassandra with CQL (Cassandra Query Language). To check this execute the next command in another terminal. </p> -<pre><code>/bin/cqlsh localhost -</code></pre> -<p>Once CQL is open, type the next sentence and check the result: </p> -<pre><code>SELECT cluster_name, listen_address from system.local; -</code></pre> -<p>The output should be:</p> -<p><img src="miUO60A-RtyEAOOVFJqlkPRC18H4RKUhot6RWzhO9FmtzgTPOYHFtwxqgZEf.png" alt="" /> -<em>Sentence output</em></p> -<p>Finally, the installation guide provided by the website of the database is attached in this <a href="https://cassandra.apache.org/doc/latest/getting_started/installing.html">installation guide</a>. </p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://es.wikipedia.org/wiki/Apache_Cassandra">Wikipedia</a></li> -<li><a href="https://cassandra.apache.org/">Apache Cassandra</a></li> -<li><a href="https://www.datastax.com/blog/2019/05/how-apache-cassandratm-balances-consistency-availability-and-performance">Datastax</a></li> -<li><a href="https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/">yugabyte</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,130 +0,0 @@
-/* containers */ - -body { - background-color: #fffff0; - margin: 0; -} - -main { - max-width: 720px; - margin: 0 auto; - padding: 10px 20px; - background-color: #fffff0; -} - -/* titles and special */ - -h1.title { - text-align: center; - font-family: serif; - font-size: 2.5em; - font-weight: lighter; - font-variant-caps: small-caps; - border-bottom: 4px double #000; -} - -h1, h2 { - padding-bottom: 10px; - border-bottom: 1px solid #000; -} - -h1:not(.title):hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { - opacity: 1; -} - -.anchor { - float: left; - padding-right: 0.4ch; - margin-left: -1.3ch; - opacity: 0; - transition: opacity 150ms; -} - -/* body text */ - -p, li { - font-family: sans-serif; - font-size: 1.1em; - line-height: 1.5; - text-align: justify; -} - -a { - text-decoration: none; - color: #f74c00; - border-bottom: 0 dashed rgba(0, 0, 0, 0); - transition: color 300ms, border-bottom 300ms; -} - -a:hover { - color: #e33b26; - border-bottom: 1px solid #e33b26; -} - -blockquote { - border-left: 4px solid #000; - padding-left: 8px; - font-style: italic; - color: #444; -} - -.footnote:target { - background-color: rgba(255, 255, 0, 0.2); -} - -/* code listing */ - -pre { - background-color: #eee; - padding: 4px; - overflow: auto; - max-height: 480px; -} - -/* tables */ - -table { - border-collapse: collapse; -} - -th { - background-color: #f7f7e8; -} - -th, td { - padding: 0.5em; - border: 1px solid #aaa; -} - -tr:nth-child(even) { - background-color: #f7f7e8; -} - -/* misc */ - -p.time { - text-align: right; - font-style: italic; - color: #777; - font-size: 0.9em; -} - -hr { - border: 0; - border-bottom: 2px dashed #aaa; -} - -kbd { - padding: 3px 5px; - font: 0.9em monospace; - color: #333; - background-color: #fafafa; - border: 1px solid #ddd; - border-radius: 4px; - box-shadow: 0 2px 0 #ddd; -} - -::selection { - background-color: #f74c00; - color: #fff; -}
@@ -1,657 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Developing a Python application for MongoDB</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the third and last post in the MongoDB series, where we will develop a Python application to process and store OpenData inside Mongo.</p> -<div class="date-created-modified">Created 2020-03-25<br> -Modified 2020-04-16</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/mongodb-an-introduction/">MongoDB: an Introduction</a></li> -<li><a href="/blog/ribw/mongodb-basic-operations-and-architecture/">MongoDB: Basic Operations and Architecture</a></li> -<li><a href="/blog/ribw/developing-a-python-application-for-mongodb/">Developing a Python application for MongoDB</a> (this post)</li> -</ul> -<p>This post is co-authored wih a Classmate.</p> -<hr /> -<h2 class="title" id="what_are_we_making_"><a class="anchor" href="#what_are_we_making_">¶</a>What are we making?</h2> -<p>We are going to develop a web application that renders a map, in this case, the town of Cáceres, with which users can interact. When the user clicks somewhere on the map, the selected location will be sent to the server to process. This server will perform geospatial queries to Mongo and once the results are ready, the information is presented back at the webpage.</p> -<p>The data used for the application comes from <a href="https://opendata.caceres.es/">Cáceres’ OpenData</a>, and our goal is that users will be able to find information about certain areas in a quick and intuitive way, such as precise coordinates, noise level, and such.</p> -<h2 id="what_are_we_using_"><a class="anchor" href="#what_are_we_using_">¶</a>What are we using?</h2> -<p>The web application will be using <a href="https://python.org/">Python</a> for the backend, <a href="https://svelte.dev/">Svelte</a> for the frontend, and <a href="https://www.mongodb.com/">Mongo</a> as our storage database and processing center.</p> -<ul> -<li><strong>Why Python?</strong> It’s a comfortable language to write and to read, and has a great ecosystem with <a href="https://pypi.org/">plenty of libraries</a>.</li> -<li><strong>Why Svelte?</strong> Svelte is the New Thing<strong>™</strong> in the world of component frameworks for JavaScript. It is similar to React or Vue, but compiled and with a lot less boilerplate. Check out their <a href="https://svelte.dev/blog/svelte-3-rethinking-reactivity">Svelte post</a> to learn more.</li> -<li><strong>Why Mongo?</strong> We believe NoSQL is the right approach for doing the kind of processing and storage that we expect, and it’s <a href="https://docs.mongodb.com/">very easy to use</a>. In addition, we will be making Geospatial Queries which <a href="https://docs.mongodb.com/manual/geospatial-queries/">Mongo supports</a>.</li> -</ul> -<p>Why didn’t we choose to make a smaller project, you may ask? You will be shocked to hear that we do not have an answer for that!</p> -<p>Note that we will not be embedding <strong>all</strong> the code of the project in this post, or it would be too long! We will include only the relevant snippets needed to understand the core ideas of the project, and not the unnecessary parts of it (for example, parsing configuration files to easily change the port where the server runs is not included).</p> -<h2 id="python_dependencies"><a class="anchor" href="#python_dependencies">¶</a>Python dependencies</h2> -<p>Because we will program it in Python, you need Python installed. You can install it using a package manager of your choice or heading over to the <a href="https://www.python.org/downloads/">Python downloads section</a>, but if you’re on Linux, chances are you have it installed already.</p> -<p>Once Python 3.7 or above is installed, install <a href="https://motor.readthedocs.io/en/stable/"><code>motor</code> (Asynchronous Python driver for MongoDB)</a> and the <a href="https://docs.aiohttp.org/en/stable/web.html"><code>aiohttp</code> server</a> through <code>pip</code>:</p> -<pre><code>pip install aiohttp motor -</code></pre> -<p>Make sure that Mongo is running in the background (this has been described in previous posts), and we should be able to get to work.</p> -<h2 id="web_dependencies"><a class="anchor" href="#web_dependencies">¶</a>Web dependencies</h2> -<p>To work with Svelte and its dependencies, we will need <code>[npm](https://www.npmjs.com/)</code> which comes with <a href="https://nodejs.org/en/">NodeJS</a>, so go and <a href="https://nodejs.org/en/download/">install Node from their site</a>. The download will be different depending on your operating system.</p> -<p>Following <a href="https://svelte.dev/blog/the-easiest-way-to-get-started">the easiest way to get started with Svelte</a>, we will put our project in a <code>client/</code> folder (because this is what the clients see, the frontend). Feel free to tinker a bit with the configuration files to change the name and such, although this isn’t relevant for the rest of the post.</p> -<h2 id="finding_the_data"><a class="anchor" href="#finding_the_data">¶</a>Finding the data</h2> -<p>We are going to work with the JSON files provided by <a href="http://opendata.caceres.es/">OpenData Cáceres</a>. In particular, we want information about the noise, census, vias and trees. To save you the time from <a href="http://opendata.caceres.es/dataset">searching each of these</a>, we will automate the download with code.</p> -<p>If you want to save the data offline or just know what data we’ll be using for other purposes though, you can right click on the following links and select «Save Link As…» with the name of the link:</p> -<ul> -<li><code>[noise.json](http://opendata.caceres.es/GetData/GetData?dataset=om:MedicionRuido&format=json)</code></li> -<li><code>[census.json](http://opendata.caceres.es/GetData/GetData?dataset=om:InformacionPadron&year=2017&format=json)</code></li> -<li><code>[vias.json](http://opendata.caceres.es/GetData/GetData?dataset=om:InformacionPadron&year=2017&format=json)</code></li> -<li><code>[trees.json](http://opendata.caceres.es/GetData/GetData?dataset=om:Arbol&format=json)</code></li> -</ul> -<h2 id="backend"><a class="anchor" href="#backend">¶</a>Backend</h2> -<p>It’s time to get started with some code! We will put it in a <code>server/</code> folder because it will contain the Python server, that is, the backend of our application.</p> -<p>We are using <code>aiohttp</code> because we would like our server to be <code>async</code>. We don’t expect a lot of users at the same time, but it’s good to know our server would be well-designed for that use-case. As a bonus, it makes IO points clear in the code, which can help reason about it. The implicit synchronization between <code>await</code> is also a nice bonus.</p> -<h3 id="saving_the_data_in_mongo"><a class="anchor" href="#saving_the_data_in_mongo">¶</a>Saving the data in Mongo</h3> -<p>Before running the server, we must ensure that the data we need is already stored and indexed in Mongo. Our <code>server/data.py</code> will take care of downloading the files, cleaning them up a little (Cáceres’ OpenData can be a bit awkward sometimes), inserting them into Mongo and indexing them.</p> -<p>Downloading the JSON data can be done with <code>[ClientSession.get](https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientSession.get)</code>. We also take this opportunity to clean up the messy encoding from the JSON, which does not seem to be UTF-8 in some cases.</p> -<pre><code>async def load_json(session, url): - fixes = [(old, new.encode('utf-8')) for old, new in [ - (b'\xc3\x83\\u2018', 'Ñ'), - (b'\xc3\x83\\u0081', 'Á'), - (b'\xc3\x83\\u2030', 'É'), - (b'\xc3\x83\\u008D', 'Í'), - (b'\xc3\x83\\u201C', 'Ó'), - (b'\xc3\x83\xc5\xa1', 'Ú'), - (b'\xc3\x83\xc2\xa1', 'á'), - ]] - - async with session.get(url) as resp: - data = await resp.read() - - # Yes, this feels inefficient, but it's not really worth improving. - for old, new in fixes: - data = data.replace(old, new) - - data = data.decode('utf-8') - return json.loads(data) -</code></pre> -<p>Later on, it can be reused for the various different URLs:</p> -<pre><code>import aiohttp - -NOISE_URL = 'http://opendata.caceres.es/GetData/GetData?dataset=om:MedicionRuido&format=json' -# (...other needed URLs here) - -async def insert_to_db(db): - async with aiohttp.ClientSession() as session: - data = await load_json(session, NOISE_URL) - # now we have the JSON data cleaned up, ready to be parsed -</code></pre> -<h3 id="data_model"><a class="anchor" href="#data_model">¶</a>Data model</h3> -<p>With the JSON data in our hands, it’s time to parse it. Always remember to <a href="https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/">parse, don’t validate</a>. With <a href="https://docs.python.org/3/library/dataclasses.html">Python 3.7 <code>dataclasses</code></a> it’s trivial to define classes that will store only the fields we care about, typed, and with proper names:</p> -<pre><code>from dataclasses import dataclass - -Longitude = float -Latitude = float - -@dataclass -class GSON: - type: str - coordinates: (Longitude, Latitude) - -@dataclass -class Noise: - id: int - geo: GSON - level: float -</code></pre> -<p>This makes it really easy to see that, if we have a <code>Noise</code>, we can access its <code>geo</code> data which is a <code>GSON</code> with a <code>type</code> and <code>coordinates</code>, having <code>Longitude</code> and <code>Latitude</code> respectively. <code>dataclasses</code> and <code>[typing](https://docs.python.org/3/library/typing.html)</code> make dealing with this very easy and clear.</p> -<p>Every dataclass will be on its own collection inside Mongo, and these are:</p> -<ul> -<li> -<p>Noise</p> -</li> -<li> -<p>Integer <code>id</code></p> -</li> -<li> -<p>GeoJSON <code>geo</code></p> -</li> -<li> -<p>String <code>type</code></p> -</li> -<li> -<p>Longitude-latitude pair <code>coordinates</code></p> -</li> -<li> -<p>Floating-point number <code>level</code></p> -</li> -<li> -<p>Tree</p> -</li> -<li> -<p>String <code>name</code></p> -</li> -<li> -<p>String <code>gender</code></p> -</li> -<li> -<p>Integer <code>units</code></p> -</li> -<li> -<p>Floating-point number <code>height</code></p> -</li> -<li> -<p>Floating-point number <code>cup_diameter</code></p> -</li> -<li> -<p>Floating-point number <code>trunk_diameter</code></p> -</li> -<li> -<p>Optional string <code>variety</code></p> -</li> -<li> -<p>Optional string <code>distribution</code></p> -</li> -<li> -<p>GeoJSON <code>geo</code></p> -</li> -<li> -<p>Optional string <code>irrigation</code></p> -</li> -<li> -<p>Census</p> -</li> -<li> -<p>Integer <code>year</code></p> -</li> -<li> -<p>Via <code>via</code></p> -</li> -<li> -<p>String <code>name</code></p> -</li> -<li> -<p>String <code>kind</code></p> -</li> -<li> -<p>Integer <code>code</code></p> -</li> -<li> -<p>Optional string <code>history</code></p> -</li> -<li> -<p>Optional string <code>old_name</code></p> -</li> -<li> -<p>Optional floating-point number <code>length</code></p> -</li> -<li> -<p>Optional GeoJSON <code>start</code></p> -</li> -<li> -<p>GeoJSON <code>middle</code></p> -</li> -<li> -<p>Optional GeoJSON <code>end</code></p> -</li> -<li> -<p>Optional list with geometry pairs <code>geometry</code></p> -</li> -<li> -<p>Integer <code>count</code></p> -</li> -<li> -<p>Mapping year-to-count <code>count_per_year</code></p> -</li> -<li> -<p>Mapping gender-to-count <code>count_per_gender</code></p> -</li> -<li> -<p>Mapping nationality-to-count <code>count_per_nationality</code></p> -</li> -<li> -<p>Integer <code>time_year</code></p> -</li> -</ul> -<p>Now, let’s define a method to actually parse the JSON and yield instances from these new data classes:</p> -<pre><code>@classmethod -def iter_from_json(cls, data): - for row in data['results']['bindings']: - noise_id = int(row['uri']['value'].split('/')[-1]) - long = float(row['geo_long']['value']) - lat = float(row['geo_lat']['value']) - level = float(row['om_nivelRuido']['value']) - - yield cls( - id=noise_id, - geo=GSON(type='Point', coordinates=[long, lat]), - level=level - ) -</code></pre> -<p>Here we iterate over the input JSON <code>data</code> bindings and <code>yield cls</code> instances with more consistent naming than the original one. We also extract the data from the many unnecessary nested levels of the JSON and have something a lot flatter to work with.</p> -<p>For those of you who don’t know what <code>yield</code> does (after all, not everyone is used to seeing generators), here’s two functions that work nearly the same:</p> -<pre><code>def squares_return(n): - result = [] - for i in range(n): - result.append(n ** 2) - return result - -def squares_yield(n): - for i in range(n): - yield n ** 2 -</code></pre> -<p>The difference is that the one with <code>yield</code> is «lazy» and doesn’t need to do all the work up-front. It will generate (yield) more values as they are needed when you use a <code>for</code> loop. Generally, it’s a better idea to create generator functions than do all the work early which may be unnecessary. See <a href="https://stackoverflow.com/questions/231767/what-does-the-yield-keyword-do">What does the «yield» keyword do?</a> if you still have questions.</p> -<p>With everything parsed, it’s time to insert the data into Mongo. If the data was not present yet (0 documents), then we will download the file, parse it, insert it as documents into the given Mongo <code>db</code>, and index it:</p> -<pre><code>from dataclasses import asdict - -async def insert_to_db(db): - async with aiohttp.ClientSession() as session: - if await db.noise.estimated_document_count() == 0: - data = await load_json(session, NOISE_URL) - - await db.noise.insert_many(asdict(noise) for noise in Noise.iter_from_json(data)) - await db.noise.create_index([('geo', '2dsphere')]) -</code></pre> -<p>We repeat this process for all the other data, and just like that, Mongo is ready to be used in our server.</p> -<h3 id="indices"><a class="anchor" href="#indices">¶</a>Indices</h3> -<p>In order to execute our geospatial queries we have to create an index on the attribute that represents the location, because the operators that we will use requires it. This attribute can be a <a href="https://docs.mongodb.com/manual/reference/geojson/">GeoJSON object</a> or a legacy coordinate pair.</p> -<p>We have decided to use a GeoJSON object because we want to avoid legacy features that may be deprecated in the future.</p> -<p>The attribute is called <code>geo</code> for the <code>Tree</code> and <code>Noise</code> objects and <code>start</code>, <code>middle</code> or <code>end</code> for the <code>Via</code> class. In the <code>Via</code> we are going to index the attribute <code>middle</code> because it is the most representative field for us. Because the <code>Via</code> is inside the <code>Census</code> and it doesn’t have its own collection, we create the index on the <code>Census</code> collection.</p> -<p>The used index type is <code>2dsphere</code> because it supports queries that work on geometries on an earth-like sphere. Another option is the <code>2d</code> index but it’s not a good fit for our because it is for queries that calculate geometries on a two-dimensional plane.</p> -<h3 id="running_the_server"><a class="anchor" href="#running_the_server">¶</a>Running the server</h3> -<p>If we ignore the configuration part of the server creation, our <code>server.py</code> file is pretty simple. Its job is to create a <a href="https://aiohttp.readthedocs.io/en/stable/web.html">server application</a>, setup Mongo and return it to the caller so that they can run it:</p> -<pre><code>import asyncio -import subprocess -import motor.motor_asyncio - -from aiohttp import web - -from . import rest, data - -def create_app(): - ret = subprocess.run('npm run build', cwd='../client', shell=True).returncode - if ret != 0: - exit(ret) - - db = motor.motor_asyncio.AsyncIOMotorClient().opendata - loop = asyncio.get_event_loop() - loop.run_until_complete(data.insert_to_db(db)) - - app = web.Application() - app['db'] = db - - app.router.add_routes([ - web.get('/', lambda r: web.HTTPSeeOther('/index.html')), - *rest.ROUTES, - web.static('/', os.path.join(config['www']['root'], 'public')), - ]) - - return app -</code></pre> -<p>There’s a bit going on here, but it’s nothing too complex:</p> -<ul> -<li>We automatically run <code>npm run build</code> on the frontend because it’s very comfortable to have the frontend built automatically before the server runs.</li> -<li>We create a Motor client and access the <code>opendata</code> database. Into it, we load the data, effectively saving it in Mongo for the server to use.</li> -<li>We create the server application and save a reference to the Mongo database in it, so that it can be used later on any endpoint without needing to recreate it.</li> -<li>We define the routes of our app: root, REST and static (where the frontend files live). We’ll get to the <code>rest</code> part soon. -Running the server is now simple:</li> -</ul> -<pre><code>def main(): - from aiohttp import web - from . import server - - app = server.create_app() - web.run_app(app) - -if __name__ == '__main__': - main() -</code></pre> -<h3 id="rest_endpoints"><a class="anchor" href="#rest_endpoints">¶</a>REST endpoints</h3> -<p>The frontend will communicate with the backend via <a href="https://en.wikipedia.org/wiki/Representational_state_transfer">REST</a> calls, so that it can ask for things like «give me the information associated with this area», and the web server can query the Mongo server to reply with a HTTP response. This little diagram should help:</p> -<p><img src="bitmap.png" alt="" /></p> -<p>What we need to do, then, is define those REST endpoints we mentioned earlier when creating the server. We will process the HTTP request, ask Mongo for the data, and return the HTTP response:</p> -<pre><code>import asyncio -import pymongo - -from aiohttp import web - -async def get_area_info(request): - try: - long = float(request.query['long']) - lat = float(request.query['lat']) - distance = float(request.query['distance']) - except KeyError as e: - raise web.HTTPBadRequest(reason=f'a required parameter was missing: {e.args[0]}') - except ValueError: - raise web.HTTPBadRequest(reason='one of the parameters was not a valid float') - - geo_avg_noise_pipeline = [{ - '$geoNear': { - 'near' : {'type': 'Point', 'coordinates': [long, lat]}, - 'maxDistance': distance, - 'minDistance': 0, - 'spherical' : 'true', - 'distanceField' : 'distance' - } - }] - - db = request.app['db'] - - try: - noise_count, sum_noise, avg_noise = 0, 0, 0 - async for item in db.noise.aggregate(geo_avg_noise_pipeline): - noise_count += 1 - sum_noise += item['level'] - - if noise_count != 0: - avg_noise = sum_noise / noise_count - else: - avg_noise = None - - except pymongo.errors.ConnectionFailure: - raise web.HTTPServiceUnavailable(reason='no connection to database') - - return web.json_response({ - 'tree_count': tree_count, - 'trees_per_type': [[k, v] for k, v in trees_per_type.items()], - 'census_count': census_count, - 'avg_noise': avg_noise, - }) - -ROUTES = [ - web.get('/rest/get-area-info', get_area_info) -] -</code></pre> -<p>In this code, we’re only showing how to return the average noise because that’s the simplest we can do. The real code also fetches tree count, tree count per type, and census count.</p> -<p>Again, there’s quite a bit to go through, so let’s go step by step:</p> -<ul> -<li>We parse the frontend’s <code>request.query</code> into <code>float</code> that we can use. In particular, the frontend is asking us for information at a certain latitude, longitude, and distance. If the query is malformed, we return a proper error.</li> -<li>We create our query for Mongo outside, just so it’s clearer to read.</li> -<li>We access the database reference we stored earlier when creating the server with <code>request.app['db']</code>. Handy!</li> -<li>We try to query Mongo. It may fail if the Mongo server is not running, so we should handle that and tell the client what’s happening. If it succeeds though, we will gather information about the average noise.</li> -<li>We return a <code>json_response</code> with Mongo results for the frontend to present to the user. -You may have noticed we defined a <code>ROUTES</code> list at the bottom. This will make it easier to expand in the future, and the server creation won’t need to change anything in its code, because it’s already unpacking all the routes we define here.</li> -</ul> -<h3 id="geospatial_queries"><a class="anchor" href="#geospatial_queries">¶</a>Geospatial queries</h3> -<p>In order to retrieve the information from Mongo database we have defined two geospatial queries:</p> -<pre><code>geo_query = { - '$nearSphere' : { - '$geometry': { - 'type': 'Point', - 'coordinates': [long, lat] - }, - '$maxDistance': distance, - '$minDistance': 0 - } -} -</code></pre> -<p>This query uses <a href="https://docs.mongodb.com/manual/reference/operator/query/nearSphere/#op._S_nearSphere">the operator <code>$nearSphere</code></a> which return geospatial objects in proximity to a point on a sphere.</p> -<p>The sphere point is represented by the <code>$geometry</code> operator where it is specified the type of geometry and the coordinates (given by the HTTP request).</p> -<p>The maximum and minimum distance are represented by <code>$maxDistance</code> and <code>$minDistance</code> respectively. We specify that the maximum distance is the radio selected by the user.</p> -<pre><code>geo_avg_noise_pipeline = [{ - '$geoNear': { - 'near' : {'type': 'Point', 'coordinates': [long, lat]}, - 'maxDistance': distance, - 'minDistance': 0, - 'spherical' : 'true', - 'distanceField' : 'distance' - } -}] -</code></pre> -<p>This query uses the <a href="https://docs.mongodb.com/manual/core/aggregation-pipeline/">aggregation pipeline</a> stage <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/geoNear/#pipe._S_geoNear"><code>$geoNear</code></a> which returns an ordered stream of documents based on the proximity to a geospatial point. The output documents include an additional distance field.</p> -<p>The <code>near</code> field is mandatory and is the point for which to find the closest documents. In this field it is specified the type of geometry and the coordinates (given by the HTTP request).</p> -<p>The <code>distanceField</code> field is also mandatory and is the output field that will contain the calculated distance. In this case we’ve just called it <code>distance</code>.</p> -<p>Some other fields are <code>maxDistance</code> that indicates the maximum allowed distance from the center of the point, <code>minDistance</code> for the minimum distance, and <code>spherical</code> which tells MongoDB how to calculate the distance between two points.</p> -<p>We specify the maximum distance as the radio selected by the user in the frontend.</p> -<h2 id="frontend"><a class="anchor" href="#frontend">¶</a>Frontend</h2> -<p>As said earlier, our frontend will use Svelte. We already downloaded the template, so we can start developing. For some, this is the most fun part, because they can finally see and interact with some of the results. But for this interaction to work, we needed a functional backend which we now have!</p> -<h3 id="rest_queries"><a class="anchor" href="#rest_queries">¶</a>REST queries</h3> -<p>The frontend has to query the server to get any meaningful data to show on the page. The <a href="https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API">Fetch API</a> does not throw an exception if the server doesn’t respond with HTTP OK, but we would like one if things go wrong, so that we can handle them gracefully. The first we’ll do is define our own exception <a href="https://stackoverflow.com/a/27724419">which is not pretty</a>:</p> -<pre><code>function NetworkError(message, status) { - var instance = new Error(message); - instance.name = 'NetworkError'; - instance.status = status; - Object.setPrototypeOf(instance, Object.getPrototypeOf(this)); - if (Error.captureStackTrace) { - Error.captureStackTrace(instance, NetworkError); - } - return instance; -} - -NetworkError.prototype = Object.create(Error.prototype, { - constructor: { - value: Error, - enumerable: false, - writable: true, - configurable: true - } -}); -Object.setPrototypeOf(NetworkError, Error); -</code></pre> -<p>But hey, now we have a proper and reusable <code>NetworkError</code>! Next, let’s make a proper and reusabe <code>query</code> function that deals with <code>fetch</code> for us:</p> -<pre><code>async function query(endpoint) { - const res = await fetch(endpoint, { - // if we ever use cookies, this is important - credentials: 'include' - }); - if (res.ok) { - return await res.json(); - } else { - throw new NetworkError(await res.text(), res.status); - } -} -</code></pre> -<p>At last, we can query our web server. The export here tells Svelte that this function should be visible to outer modules (public) as opposed to being private:</p> -<pre><code>export function get_area_info(long, lat, distance) { - return query(`/rest/get-area-info?long=${long}&lat=${lat}&distance=${distance}`); -} -</code></pre> -<p>The attentive reader will have noticed that <code>query</code> is <code>async</code>, but <code>get_area_info</code> is not. This is intentional, because we don’t need to <code>await</code> for anything inside of it. We can just return the <code>[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)</code> that <code>query</code> created and let the caller <code>await</code> it as they see fit. The <code>await</code> here would have been redundant.</p> -<p>For those of you who don’t know what a JavaScript promise is, think of it as an object that represents «an eventual result». The result may not be there yet, but we promised it will be present in the future, and we can <code>await</code> for it. You can also find the same concept in other languages like Python under a different name, such as <a href="https://docs.python.org/3/library/asyncio-future.html#asyncio.Future"><code>Future</code></a>.</p> -<h3 id="map_component"><a class="anchor" href="#map_component">¶</a>Map component</h3> -<p>In Svelte, we can define self-contained components that are issolated from the rest. This makes it really easy to create a modular application. Think of a Svelte component as your own HTML tag, which you can customize however you want, building upon the already-existing components HTML has to offer.</p> -<p>The main thing that our map needs to do is render the map as an image and overlay the selection area as the user hovers the map with their mouse. We could render the image in the canvas itself, but instead we’ll use the HTML <code><img></code> tag for that and put a transparent <code><canvas></code> on top with some CSS. This should make it cheaper and easier to render things on the canvas.</p> -<p>The <code>Map</code> component will thus render as the user moves the mouse over it, and produce an event when they click so that whatever component is using a <code>Map</code> knows that it was clicked. Here’s the final CSS and HTML:</p> -<pre><code><style> -div { - position: relative; -} -canvas { - position: absolute; - left: 0; - top: 0; - cursor: crosshair; -} -</style> - -<div> - <img bind:this={img} on:load={handleLoad} {height} src="caceres-municipality.svg" alt="Cáceres (municipality)"/> - <canvas - bind:this={canvas} - on:mousemove={handleMove} - on:wheel={handleWheel} - on:mouseup={handleClick}/> -</div> -</code></pre> -<p>We hardcode a map source here, but ideally this would be provided by the server. The project is already complex enough, so we tried to avoid more complexity than necessary.</p> -<p>We bind the tags to some variables declared in the JavaScript code of the component, along with some functions and parameters to let the users of <code>Map</code> customize it just a little.</p> -<p>Here’s the gist of the JavaScript code:</p> -<pre><code><script> - import { createEventDispatcher, onMount } from 'svelte'; - - export let height = 200; - - const dispatch = createEventDispatcher(); - - let img; - let canvas; - - const LONG_WEST = -6.426881; - const LONG_EAST = -6.354143; - const LAT_NORTH = 39.500064; - const LAT_SOUTH = 39.443201; - - let x = 0; - let y = 0; - let clickInfo = null; // [x, y, radius] - let radiusDelta = 0.005 * height; - let maxRadius = 0.2 * height; - let minRadius = 0.01 * height; - let radius = 0.05 * height; - - function handleLoad() { - canvas.width = img.width; - canvas.height = img.height; - } - - function handleMove(event) { - const { left, top } = this.getBoundingClientRect(); - x = Math.round(event.clientX - left); - y = Math.round(event.clientY - top); - } - - function handleWheel(event) { - if (event.deltaY < 0) { - if (radius < maxRadius) { - radius += radiusDelta; - } - } else { - if (radius > minRadius) { - radius -= radiusDelta; - } - } - event.preventDefault(); - } - - function handleClick(event) { - dispatch('click', { - // the real code here maps the x/y/radius values to the right range, here omitted - x: ..., - y: ..., - radius: ..., - }); - } - - onMount(() => { - const ctx = canvas.getContext('2d'); - let frame; - - (function loop() { - frame = requestAnimationFrame(loop); - - // the real code renders mouse area/selection, here omitted for brevity - ... - }()); - - return () => { - cancelAnimationFrame(frame); - }; - }); -</script> -</code></pre> -<p>Let’s go through bit-by-bit:</p> -<ul> -<li>We define a few variables and constants for later use in the final code.</li> -<li>We define the handlers to react to mouse movement and clicks. On click, we dispatch an event to outer components.</li> -<li>We setup the render loop with animation frames, and cancel the current frame appropriatedly if the component disappears.</li> -</ul> -<h3 id="app_component"><a class="anchor" href="#app_component">¶</a>App component</h3> -<p>Time to put everything together! We wil include our function to make REST queries along with our <code>Map</code> component to render things on screen.</p> -<pre><code><script> - import Map from './Map.svelte'; - import { get_area_info } from './rest.js' - let selection = null; - let area_info_promise = null; - function handleMapSelection(event) { - selection = event.detail; - area_info_promise = get_area_info(selection.x, selection.y, selection.radius); - } - function format_avg_noise(avg_noise) { - if (avg_noise === null) { - return '(no data)'; - } else { - return `${avg_noise.toFixed(2)} dB`; - } - } -</script> - -<div class="container-fluid"> - <div class="row"> - <div class="col-3" style="max-width: 300em;"> - <div class="text-center"> - <h1>Caceres Data Consultory</h1> - </div> - <Map height={400} on:click={handleMapSelection}/> - <div class="text-center mt-4"> - {#if selection === null} - <p class="m-1 p-3 border border-bottom-0 bg-info text-white">Click on the map to select the area you wish to see details for.</p> - {:else} - <h2 class="bg-dark text-white">Selected area</h2> - <p><b>Coordinates:</b> ({selection.x}, {selection.y})</p> - <p><b>Radius:</b> {selection.radius} meters</p> - {/if} - </div> - </div> - <div class="col-sm-4"> - <div class="row"> - {#if area_info_promise !== null} - {#await area_info_promise} - <p>Fetching area information…</p> - {:then area_info} - <div class="col"> - <div class="text-center"> - <h2 class="m-1 bg-dark text-white">Area information</h2> - <ul class="list-unstyled"> - <li>There are <b>{area_info.tree_count} trees </b> within the area</li> - <li>The <b>average noise</b> is <b>{format_avg_noise(area_info.avg_noise)}</b></li> - <li>There are <b>{area_info.census_count} persons </b> within the area</li> - </ul> - </div> - {#if area_info.trees_per_type.length > 0} - <div class="text-center"> - <h2 class="m-1 bg-dark text-white">Tree count per type</h2> - </div> - <ul class="list-group"> - {#each area_info.trees_per_type as [type, count]} - <li class="list-group-item">{type} <span class="badge badge-dark float-right">{count}</span></li> - {/each} - </ul> - {/if} - </div> - {:catch error} - <p>Failed to fetch area information: {error.message}</p> - {/await} - {/if} - </div> - </div> - </div> -</div> -</code></pre> -<ul> -<li>We import the <code>Map</code> component and REST function so we can use them.</li> -<li>We define a listener for the events that the <code>Map</code> produces. Such event will trigger a REST call to the server and save the result in a promise used later.</li> -<li>We’re using Bootstrap for the layout because it’s a lot easier. In the body we add our <code>Map</code> and another column to show the selection information.</li> -<li>We make use of Svelte’s <code>{#await}</code> to nicely notify the user when the call is being made, when it was successful, and when it failed. If it’s successful, we display the info.</li> -</ul> -<h2 id="results"><a class="anchor" href="#results">¶</a>Results</h2> -<p>Lo and behold, watch our application run!</p> -<p><video controls="controls" src="sr-2020-04-14_09-28-25.mp4"></video></p> -<p>In this video you can see our application running, but let’s describe what is happening in more detail.</p> -<p>When the application starts running (by opening it in your web browser of choice), you can see a map with the town of Cáceres. Then you, the user, can click to retrieve the information within the selected area.</p> -<p>It is important to note that one can make the selection area larger or smaller by trying to scroll up or down, respectively.</p> -<p>Once an area is selected, it is colored green in order to let the user know which area they have selected. Under the map, the selected coordinates and the radius (in meters) is also shown for the curious. At the right side the information concerning the selected area is shown, such as the number of trees, the average noise and the number of persons. If there are trees in the area, the application also displays the trees per type, sorted by the number of trees.</p> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>We hope you enjoyed reading this post as much as we enjoyed writing it! Feel free to download the final project and play around with it. Maybe you can adapt it for even more interesting purposes!</p> -<p><em>download removed</em></p> -<p>To run the above code:</p> -<ol> -<li>Unzip the downloaded file.</li> -<li>Make a copy of <code>example-server-config.ini</code> and rename it to <code>server-config.ini</code>, then edit the file to suit your needs.</li> -<li>Run the server with <code>python -m server</code>.</li> -<li>Open <a href="http://localhost:9000">localhost:9000</a> in your web browser (or whatever port you chose) and enjoy!</li> -</ol> -</main> -</body> -</html> -
@@ -1,28 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: Final NoSQL evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This evaluation is a bit different to my <a href="/blog/ribw/16/nosql-evaluation/">previous one</a> because this time I have been tasked to evaluate the student <code>a(i - 2)</code>, and because I am <code>a = 9</code> that happens to be <code>a(7) =</code> Classmate.</p> -<div class="date-created-modified">Created 2020-05-13<br> -Modified 2020-05-14</div> -<p>Unfortunately for Classmate, the only entry related to NoSQL I have found in their blog is Prima y segunda Actividad: Base de datos NoSQL which does not develop an application as requested for the third entry (as of 14th of May).</p> -<p>This means that, instead, I will evaluate <code>a(i - 3)</code> which happens to be <code>a(6) =</code> Classmate and they do have an entry.</p> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s Evaluation</h2> -<p><strong>Grading: B.</strong></p> -<p>The post I have evaluated is BB.DD. NoSQL RethinkDB 3ª Fase. Aplicación.</p> -<p>It starts with an introduction, properly explaining what database they have chosen and why, but not what application they will be making.</p> -<p>This is detailed just below in the next section, although it’s a bit vague.</p> -<p>The next section talks about the Python dependencies that are required, but they never said they would be making a Python application or that we need to install Python!</p> -<p>The next section talks about the file structure of the project, and they detail what everything part does, although I have missed some code snippets.</p> -<p>The final result is pretty cool and contains many interesting graphs, they provide a download to the source code and list all the relevant references used.</p> -<p>Except for a weird «necesario falta» in the text, it’s otherwise well-written, although given the issues above I cannot grade it with the highest score.</p> -</main> -</body> -</html> -
@@ -1,34 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Google’s BigTable</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Let’s talk about BigTable, and why it is what it is. But before we get into that, let’s see some important aspects anybody should consider when dealing with a lot of data (something BigTable does!).</p> -<div class="date-created-modified">Created 2020-04-01<br> -Modified 2020-04-03</div> -<h2 class="title" id="the_basics"><a class="anchor" href="#the_basics">¶</a>The basics</h2> -<p>Converting a text document into a different format is often a great way to greatly speed up scanning of it in the future. It allows for efficient searches.</p> -<p>In addition, you generally want to store everything in a single, giant file. This will save a lot of time opening and closing files, because everything is in the same file! One proposal to make this happen is <a href="https://trec.nist.gov/file_help.html">Web TREC</a> (see also the <a href="https://en.wikipedia.org/wiki/Text_Retrieval_Conference">Wikipedia page on TREC</a>), which is basically HTML but every document is properly delimited from one another.</p> -<p>Because we will have a lot of data, it’s often a good idea to compress it. Most text consists of the same words, over and over again. Classic compression techniques such as <code>DEFLATE</code> or <code>LZW</code> do an excellent job here.</p> -<h2 id="so_what_s_bigtable_"><a class="anchor" href="#so_what_s_bigtable_">¶</a>So what’s BigTable?</h2> -<p>Okay, enough of an introduction to the basics on storing data. BigTable is what Google uses to store documents, and it’s a customized approach to save, search and update web pages.</p> -<p>BigTable is is a distributed storage system for managing structured data, able to scale to petabytes of data across thousands of commodity servers, with wide applicability, scalability, high performance, and high availability.</p> -<p>In a way, it’s kind of like databases and shares many implementation strategies with them, like parallel databases, or main-memory databases, but of course, with a different schema.</p> -<p>It consists of a big table known as the «Root tablet», with pointers to many other «tablets» (or metadata in between). These are stored in a replicated filesystem accessible by all BigTable servers. Any change to a tablet gets logged (said log also gets stored in a replicated filesystem).</p> -<p>If any of the tablets servers gets locked, a different one can take its place, read the log and deal with the problem.</p> -<p>There’s no query language, transactions occur at row-level only. Every read or write in a row is atomic. Each row stores a single web page, and by combining the row and column keys along with a timestamp, it is possible to retrieve a single cell in the row. More formally, it’s a map that looks like this:</p> -<pre><code>fetch(row: string, column: string, time: int64) -> string -</code></pre> -<p>A row may have as many columns as it needs, and these column groups are the same for everyone (but the columns themselves may vary), which is importan to reduce disk read time.</p> -<p>Rows are split in different tablets based on the row keys, which simplifies determining an appropriated server for them. The keys can be up to 64KB big, although most commonly they range 10-100 bytes.</p> -<h2 id="conclusions"><a class="anchor" href="#conclusions">¶</a>Conclusions</h2> -<p>BigTable is Google’s way to deal with large amounts of data on many of their services, and the ideas behind it are not too complex to understand.</p> -</main> -</body> -</html> -
@@ -1,261 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>How does Google’s Search Engine work?</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>The original implementation was written in C/++ for Linux/Solaris.</p> -<div class="date-created-modified">Created 2020-03-18<br> -Modified 2020-03-28</div> -<p>There are three major components in the system’s anatomy, which can be thought as steps to be performed for Google to be what it is today.</p> -<p><img src="image-1024x649.png" alt="" /></p> -<p>But before we talk about the different components, let’s take a look at how they store all of this information.</p> -<h2 class="title" id="data_structures"><a class="anchor" href="#data_structures">¶</a>Data structures</h2> -<p>A «BigFile» is a virtual file addressable by 64 bits.</p> -<p>There exists a repository with the full HTML of every page compressed, along with a document identifier, length and URL.</p> -<table class=""> - <tbody> - <tr> - <td> - sync - </td> - <td> - length - </td> - <td> - compressed packet - </td> - </tr> - </tbody> -</table> -<p>The Document Index has the document identifier, a pointer into the repository, a checksum and various other statistics.</p> -<table class=""> - <tbody> - <tr> - <td> - doc id - </td> - <td> - ecode - </td> - <td> - url len - </td> - <td> - page len - </td> - <td> - url - </td> - <td> - page - </td> - </tr> - </tbody> -</table> -<p>A Lexicon stores the repository of words, implemented with a hashtable over pointers linking to the barrels (sorted linked lists) of the Inverted Index.</p> -<table class=""> - <tbody> - <tr> - <td> - word id - </td> - <td> - n docs - </td> - </tr> - <tr> - <td> - word id - </td> - <td> - n docs - </td> - </tr> - </tbody> -</table> -<p>The Hit Lists store occurences of a word in a document.</p> -<table class=""> - <tbody> - <tr> - <td> - <strong> - plain - </strong> - </td> - <td> - cap: 1 - </td> - <td> - imp: 3 - </td> - <td> - pos: 12 - </td> - </tr> - <tr> - <td> - <strong> - fancy - </strong> - </td> - <td> - cap: 1 - </td> - <td> - imp: 7 - </td> - <td> - type: 4 - </td> - <td> - pos: 8 - </td> - </tr> - <tr> - <td> - <strong> - anchor - </strong> - </td> - <td> - cap: 1 - </td> - <td> - imp: 7 - </td> - <td> - type: 4 - </td> - <td> - hash: 4 - </td> - <td> - pos: 8 - </td> - </tr> - </tbody> -</table> -<p>The Forward Index is a barrel with a range of word identifiers (document identifier and list of word identifiers).</p> -<table class=""> - <tbody> - <tr> - <td rowspan="3"> - doc id - </td> - <td> - word id: 24 - </td> - <td> - n hits: 8 - </td> - <td> - hit hit hit hit hit hit hit hit - </td> - </tr> - <tr> - <td> - word id: 24 - </td> - <td> - n hits: 8 - </td> - <td> - hit hit hit hit hit hit hit hit - </td> - </tr> - <tr> - <td> - null word id - </td> - </tr> - </tbody> -</table> -<p>The Inverted Index can be sorted by either document identifier or by ranking of word occurence.</p> -<table class=""> - <tbody> - <tr> - <td> - doc id: 23 - </td> - <td> - n hits: 5 - </td> - <td> - hit hit hit hit hit - </td> - </tr> - <tr> - <td> - doc id: 23 - </td> - <td> - n hits: 3 - </td> - <td> - hit hit hit - </td> - </tr> - <tr> - <td> - doc id: 23 - </td> - <td> - n hits: 4 - </td> - <td> - hit hit hit hit - </td> - </tr> - <tr> - <td> - doc id: 23 - </td> - <td> - n hits: 2 - </td> - <td> - hit hit - </td> - </tr> - </tbody> -</table> -<p>Back in 1998, Google compressed its repository to 53GB and had 24 million pages. The indices, lexicon, and other temporary storage required about 55GB.</p> -<h2 id="crawling"><a class="anchor" href="#crawling">¶</a>Crawling</h2> -<p>The crawling must be reliable, fast and robust, and also respect the decision of some authors not wanting their pages crawled. Originally, it took a week or more, so simultaneous execution became a must.</p> -<p>Back in 1998, Google had between 3 and 4 crawlers running at 100 web pages per second maximum. These were implemented in Python.</p> -<p>The crawled pages need parsing to deal with typos or formatting issues.</p> -<h2 id="indexing"><a class="anchor" href="#indexing">¶</a>Indexing</h2> -<p>Indexing is about putting the pages into barrels, converting words into word identifiers, and occurences into hit lists.</p> -<p>Once indexing is done, sorting of the barrels happens to have them ordered by word identifier, producing the inverted index. This process also had to be done in parallel over many machines, or would otherwise have been too slow.</p> -<h2 id="searching"><a class="anchor" href="#searching">¶</a>Searching</h2> -<p>We need to find quality results efficiently. Plenty of weights are considered nowadays, but at its heart, PageRank is used. It is the algorithm they use to map the web, which is formally defined as follows:</p> -<p><img src="8e1e61b119e107fcb4bdd7e78f649985.png" alt="" /> -<em>PR(A) = (1-d) + d(PR(T1)/C(T1) + … + PR(Tn)/C(Tn))</em></p> -<p>Where:</p> -<ul> -<li><code>A</code> is a given page</li> -<li><code>T<sub>n</sub></code> are pages that point to A</li> -<li><code>d</code> is the damping factor in the range <code>[0, 1]</code> (often 0.85)</li> -<li><code>C(A)</code> is the number of links going out of page <code>A</code></li> -<li><code>PR(A)</code> is the page rank of page <code>A</code> -This formula indicates the probability that a random surfer visits a certain page, and <code>1 - d</code> is used to indicate when it will «get bored» and stop surfing. More intuitively, the page rank of a page will grow as more pages link to it, or the few that link to it have high page rank.</li> -</ul> -<p>The anchor text in the links also help provide a better description and helps indexing for even better results.</p> -<p>While searching, the concern is disk I/O which takes up most of the time. Caching is very important to improve performance up to 30 times.</p> -<p>Now, in order to turn user queries into something we can search, we must parse the query and convert the words into word identifiers.</p> -<h2 id="conclusion"><a class="anchor" href="#conclusion">¶</a>Conclusion</h2> -<p>Google is designed to be a efficient, scalable, high-quality search engine. There are still bottlenecks in CPU, memory, disk speed and network I/O, but major data structures are used to make efficient use of the resources.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://snap.stanford.edu/class/cs224w-readings/Brin98Anatomy.pdf">The anatomy of a large-scale hypertextual Web search engine</a></li> -<li><a href="https://www.site.uottawa.ca/%7Ediana/csi4107/Google_SearchEngine.pdf">The Anatomy of a Large-Scale Hypertextual Web Search Engine (slides)</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,14 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>pagong</title> -<link rel="stylesheet" href="css/style.css"> -</head> -<body> -<main> -<ul><li><a href="index/index.html">Information Retrieval and Web Search</a></li><li><a href="final-nosql-evaluation/index.html">Privado: Final NoSQL evaluation</a></li><li><a href="developing-a-python-application-for-mongodb/index.html">Developing a Python application for MongoDB</a></li><li><a href="mongodb-an-introduction/index.html">MongoDB: an Introduction</a></li><li><a href="mongodb-basic-operations-and-architecture/index.html">MongoDB: Basic Operations and Architecture</a></li><li><a href="introduction-to-hadoop-and-its-mapreduce/index.html">Introduction to Hadoop and its MapReduce</a></li><li><a href="googles-bigtable/index.html">Google’s BigTable</a></li><li><a href="a-practical-example-with-hadoop/index.html">A practical example with Hadoop</a></li><li><a href="how-does-googles-search-engine-work/index.html">How does Google’s Search Engine work?</a></li><li><a href="pc-crawler-evaluation-2/index.html">Privado: PC-Crawler evaluation 2</a></li><li><a href="what-is-elasticsearch-and-why-should-you-care/index.html">What is ElasticSearch and why should you care?</a></li><li><a href="nosql-evaluation/index.html">Privado: NoSQL evaluation</a></li><li><a href="integrating-apache-tika-into-our-crawler/index.html">Integrating Apache Tika into our Crawler</a></li><li><a href="nosql-databases-basic-operations-and-architecture/index.html">Cassandra: Basic Operations and Architecture</a></li><li><a href="upgrading-our-baby-crawler/index.html">Upgrading our Baby Crawler</a></li><li><a href="cassandra-an-introduction/index.html">Cassandra: an Introduction</a></li><li><a href="pc-crawler-evaluation/index.html">Privado: PC-Crawler evaluation</a></li><li><a href="introduction-to-nosql/index.html">Introduction to NoSQL</a></li><li><a href="build-your-own-pc/index.html">Build your own PC</a></li><li><a href="about-boolean-retrieval/index.html">About Boolean Retrieval</a></li></ul></main> -</body> -</html> -
@@ -1,20 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Information Retrieval and Web Search</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="information_retrieval_and_web_search"><a class="anchor" href="#information_retrieval_and_web_search">¶</a>Information Retrieval and Web Search</h1> -<div class="date-created-modified">2020-10-03</div> -<p>During 2020 at university, this subject ("Recuperación de la Información y Búsqueda en la Web") -had us write blog posts as assignments. I think it would be really fun and I wanted to preserve -that work here, with the hopes it's interesting to someone.</p> -<p>The posts were auto-generated from the original HTML files and manually anonymized later.</p> -</main> -</body> -</html> -
@@ -1,33 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Integrating Apache Tika into our Crawler</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p><a href="/blog/ribw/upgrading-our-baby-crawler/">In our last crawler post</a>, we detailed how our crawler worked, and although it did a fine job, it’s time for some extra upgrading.</p> -<div class="date-created-modified">Created 2020-03-18<br> -Modified 2020-03-25</div> -<h2 class="title" id="what_kind_of_upgrades_"><a class="anchor" href="#what_kind_of_upgrades_">¶</a>What kind of upgrades?</h2> -<p>A small but useful one. We are adding support for file types that contain text but cannot be processed by normal text editors because they are structured and not just plain text (such as PDF files, Excel, Word documents…).</p> -<p>And for this task, we will make use of the help offered by <a href="https://tika.apache.org/">Tika</a>, our friendly Apache tool.</p> -<h2 id="what_is_tika_"><a class="anchor" href="#what_is_tika_">¶</a>What is Tika?</h2> -<p><a href="https://tika.apache.org/">Tika</a> is a set of libraries offered by <a href="https://en.wikipedia.org/wiki/The_Apache_Software_Foundation">The Apache Software Foundation</a> that we can include in our project in order to extract the text and metadata of files from a <a href="https://tika.apache.org/1.24/formats.html">long list of supported formats</a>.</p> -<h2 id="changes_in_the_code"><a class="anchor" href="#changes_in_the_code">¶</a>Changes in the code</h2> -<p>Not much has changed in the structure of the crawler, we simply have added a new method in <code>Utils</code> that uses the class <code>Tika</code> from the previously mentioned library so as to process and extract the text of more filetypes.</p> -<p>Then, we use this text just like we would for our standard text file (checking the thesaurus and adding it to the word map) and voilà! We have just added support for a big range of file types.</p> -<h2 id="incorporating_gradle"><a class="anchor" href="#incorporating_gradle">¶</a>Incorporating Gradle</h2> -<p>In order for the previous code to work, we need to make use of external libraries. To make this process easier and because the project is growing, we decided to use <a href="https://gradle.org/">Gradle</a>, a build system that can be used for projects in various programming languages, such as Java.</p> -<p>We followed their <a href="https://guides.gradle.org/building-java-applications/">guide to Building Java Applications</a>, and in a few steps added the required <code>.gradle</code> files. Now we can compile and run the code without having to worry about juggling with Java and external dependencies in a single command:</p> -<pre><code>./gradlew run -</code></pre> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>And here you can download the final result:</p> -<p><em>download removed</em></p> -</main> -</body> -</html> -
@@ -1,62 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Introduction to Hadoop and its MapReduce</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>Hadoop is an open-source, free, Java-based programming framework that helps processing large datasets in a distributed environment and the problems that arise when trying to harness the knowledge from BigData, capable of running on thousands of nodes and dealing with petabytes of data. It is based on Google File System (GFS) and originated from the work on the Nutch open-source project on search engines.</p> -<div class="date-created-modified">Created 2020-04-01<br> -Modified 2020-04-03</div> -<p>Hadoop also offers a distributed filesystem (HDFS) enabling for fast transfer among nodes, and a way to program with MapReduce.</p> -<p>It aims to strive for the 4 V’s: Volume, Variety, Veracity and Velocity. For veracity, it is a secure environment that can be trusted.</p> -<h2 class="title" id="milestones"><a class="anchor" href="#milestones">¶</a>Milestones</h2> -<p>The creators of Hadoop are Doug Cutting and Mike Cafarella, who just wanted to design a search engine, Nutch, and quickly found the problems of dealing with large amounts of data. They found their solution with the papers Google published.</p> -<p>The name comes from the plush of Cutting’s child, a yellow elephant.</p> -<ul> -<li>In July 2005, Nutch used GFS to perform MapReduce operations.</li> -<li>In February 2006, Nutch started a Lucene subproject which led to Hadoop.</li> -<li>In April 2007, Yahoo used Hadoop in a 1 000-node cluster.</li> -<li>In January 2008, Apache took over and made Hadoop a top-level project.</li> -<li>In July 2008, Apache tested a 4000-node cluster. The performance was the fastest compared to other technologies that year.</li> -<li>In May 2009, Hadoop sorted a petabyte of data in 17 hours.</li> -<li>In December 2011, Hadoop reached 1.0.</li> -<li>In May 2012, Hadoop 2.0 was released with the addition of YARN (Yet Another Resource Navigator) on top of HDFS, splitting MapReduce and other processes into separate components, greatly improving the fault tolerance.</li> -</ul> -<p>From here onwards, many other alternatives have born, like Spark, Hive & Drill, Kafka, HBase, built around the Hadoop ecosystem.</p> -<p>As of 2017, Amazon has clusters between 1 and 100 nodes, Yahoo has over 100 000 CPUs running Hadoop, AOL has clusters with 50 machines, and Facebook has a 320-machine (2 560 cores) and 1.3PB of raw storage.</p> -<h2 id="why_not_use_rdbms_"><a class="anchor" href="#why_not_use_rdbms_">¶</a>Why not use RDBMS?</h2> -<p>Relational database management systems simply cannot scale horizontally, and vertical scaling will require very expensive servers. Similar to RDBMS, Hadoop has a notion of jobs (analogous to transactions), but without ACID or concurrency control. Hadoop supports any form of data (unstructured or semi-structured) in read-only mode, and failures are common but there’s a simple yet efficient fault tolerance.</p> -<p>So what problems does Hadoop solve? It solves the way we should think about problems, and distributing them, which is key to do anything related with BigData nowadays. We start working with clusters of nodes, and coordinating the jobs between them. Hadoop’s API makes this really easy.</p> -<p>Hadoop also takes very seriously the loss of data with replication, and if a node falls, they are moved to a different node.</p> -<h2 id="major_components"><a class="anchor" href="#major_components">¶</a>Major components</h2> -<p>The previously-mentioned HDFS runs on commodity machine, which are cost-friendly. It is very fault-tolerant and efficient enough to process huge amounts of data, because it splits large files into smaller chunks (or blocks) that can be more easily handled. Multiple nodes can work on multiple chunks at the same time.</p> -<p>NameNode stores the metadata of the various datablocks (map of blocks) along with their location. It is the brain and the master in Hadoop’s master-slave architecture, also known as the namespace, and makes use of the DataNode.</p> -<p>A secondary NameNode is a replica that can be used if the first NameNode dies, so that Hadoop doesn’t shutdown and can restart.</p> -<p>DataNode stores the blocks of data, and are the slaves in the architecture. This data is split into one or more files. Their only job is to manage this access to the data. They are often distributed among racks to avoid data lose.</p> -<p>JobTracker creates and schedules jobs from the clients for either map or reduce operations.</p> -<p>TaskTracker runs MapReduce tasks assigned to the current data node.</p> -<p>When clients need data, they first interact with the NameNode and replies with the location of the data in the correct DataNode. Client proceeds with interaction with the DataNode.</p> -<h2 id="mapreduce"><a class="anchor" href="#mapreduce">¶</a>MapReduce</h2> -<p>MapReduce, as the name implies, is split into two steps: the map and the reduce. The map stage is the «divide and conquer» strategy, while the reduce part is about combining and reducing the results.</p> -<p>The mapper has to process the input data (normally a file or directory), commonly line-by-line, and produce one or more outputs. The reducer uses all the results from the mapper as its input to produce a new output file itself.</p> -<p><img src="bitmap.png" alt="" /></p> -<p>When reading the data, some may be junk that we can choose to ignore. If it is valid data, however, we label it with a particular type that can be useful for the upcoming process. Hadoop is responsible for splitting the data accross the many nodes available to execute this process in parallel.</p> -<p>There is another part to MapReduce, known as the Shuffle-and-Sort. In this part, types or categories from one node get moved to a different node. This happens with all nodes, so that every node can work on a complete category. These categories are known as «keys», and allows Hadoop to scale linearly.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://youtu.be/oT7kczq5A-0">YouTube – Hadoop Tutorial For Beginners | What Is Hadoop? | Hadoop Tutorial | Hadoop Training | Simplilearn</a></li> -<li><a href="https://youtu.be/bcjSe0xCHbE">YouTube – Learn MapReduce with Playing Cards</a></li> -<li><a href="https://youtu.be/j8ehT1_G5AY?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">YouTube – Video Post #2: Hadoop para torpes (I)-¿Qué es y para qué sirve?</a></li> -<li><a href="https://youtu.be/NQ8mjVPCDvk?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">Video Post #3: Hadoop para torpes (II)-¿Cómo funciona? HDFS y MapReduce</a></li> -<li><a href="https://hadoop.apache.org/old/releases.html">Apache Hadoop Releases</a></li> -<li><a href="https://youtu.be/20qWx2KYqYg?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi">Video Post #4: Hadoop para torpes (III y fin)- Ecosistema y distribuciones</a></li> -<li><a href="http://www.hadoopbook.com/">Chapter 2 – Hadoop: The Definitive Guide, Fourth Edition</a> (<a href="http://grut-computing.com/HadoopBook.pdf">pdf,</a><a href="http://www.hadoopbook.com/code.html">code</a>)</li> -</ul> -</main> -</body> -</html> -
@@ -1,86 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Introduction to NoSQL</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This post will primarly focus on the talk held in the <a href="https://youtu.be/qI_g07C_Q5I">GOTO 2012 conference: Introduction to NoSQL by Martin Fowler</a>. It can be seen as an informal, summarized transcript of the talk</p> -<div class="date-created-modified">Created 2020-02-25<br> -Modified 2020-03-18</div> -<hr /> -<p>The relational database model is affected by the <em><a href="https://en.wikipedia.org/wiki/Object-relational_impedance_mismatch">impedance mismatch problem</a></em>. This occurs because we have to match our high-level design with the separate columns and rows used by relational databases.</p> -<p>Taking the in-memory objects and putting them into a relational database (which were dominant at the time) simply didn’t work out. Why? Relational databases were more than just databases, they served as a an integration mechanism across applications, up to the 2000s. For 20 years!</p> -<p>With the rise of the Internet and the sheer amount of traffic, databases needed to scale. Unfortunately, relational databases only scale well vertically (by upgrading a <em>single</em> node). This is <em>very</em> expensive, and not something many could afford.</p> -<p>The problem are those pesky <code>JOIN</code>‘s, and its friends <code>GROUP BY</code>. Because our program and reality model don’t match the tables used by SQL, we have to rely on them to query the data. It is because the model doesn’t map directly.</p> -<p>Furthermore, graphs don’t map very well at all to relational models.</p> -<p>We needed a way to scale horizontally (by increasing the <em>amount</em> of nodes), something relational databases were not designed to do.</p> -<blockquote> -<p><em>We need to do something different, relational across nodes is an unnatural act</em></p> -</blockquote> -<p>This inspired the NoSQL movement.</p> -<blockquote> -<p><em>#nosql was only meant to be a hashtag to advertise it, but unfortunately it’s how it is called now</em></p> -</blockquote> -<p>It is not possible to define NoSQL, but we can identify some of its characteristics:</p> -<ul> -<li> -<p>Non-relational</p> -</li> -<li> -<p><strong>Cluster-friendly</strong> (this was the original spark)</p> -</li> -<li> -<p>Open-source (until now, generally)</p> -</li> -<li> -<p>21st century web culture</p> -</li> -<li> -<p>Schema-less (easier integration or conjugation of several models, structure aggregation) -These databases use different data models to those used by the relational model. However, it is possible to identify 4 broad chunks (some may say 3, or even 2!):</p> -</li> -<li> -<p><strong>Key-value store</strong>. With a certain key, you obtain the value corresponding to it. It knows nothing else, nor does it care. We say the data is opaque.</p> -</li> -<li> -<p><strong>Document-based</strong>. It stores an entire mass of documents with complex structure, normally through the use of JSON (XML has been left behind). Then, you can ask for certain fields, structures, or portions. We say the data is transparent.</p> -</li> -<li> -<p><strong>Column-family</strong>. There is a «row key», and within it we store multiple «column families» (columns that fit together, our aggregate). We access by row-key and column-family name. -All of these kind of serve to store documents without any <em>explicit</em> schema. Just shove in anything! This gives a lot of flexibility and ease of migration, except… that’s not really true. There’s an <em>implicit</em> schema when querying.</p> -</li> -</ul> -<p>For example, a query where we may do <code>anOrder['price'] * anOrder['quantity']</code> is assuming that <code>anOrder</code> has both a <code>price</code> and a <code>quantity</code>, and that both of these can be multiplied together. «Schema-less» is a fuzzy term.</p> -<p>However, it is the lack of a <em>fixed</em> schema that gives flexibility.</p> -<p>One could argue that the line between key-value and document-based is very fuzzy, and they would be right! Key-value databases often let you include additional metadata that behaves like an index, and in document-based, documents often have an identifier anyway.</p> -<p>The common notion between these three types is what matters. They save an entire structure as an <em>unit</em>. We can refer to these as «Aggregate Oriented Databases». Aggregate, because we group things when designing or modeling our systems, as opposed to relational databases that scatter the information across many tables.</p> -<p>There exists a notable outlier, though, and that’s:</p> -<ul> -<li><strong>Graph</strong> databases. They use a node-and-arc graph structure. They are great for moving on relationships across things. Ironically, relational databases are not very good at jumping across relationships! It is possibly to perform very interesting queries in graph databases which would be really hard and costly on relational models. Unlike the aggregated databases, graphs break things into even smaller units. -NoSQL is not <em>the</em> solution. It depends on how you’ll work with your data. Do you need an aggregate database? Will you have a lot of relationships? Or would the relational model be good fit for you?</li> -</ul> -<p>NoSQL, however, is a good fit for large-scale projects (data will <em>always</em> grow) and faster development (the impedance mismatch is drastically reduced).</p> -<p>Regardless of our choice, it is important to remember that NoSQL is a young technology, which is still evolving really fast (SQL has been stable for <em>decades</em>). But the <em>polyglot persistence</em> is what matters. One must know the alternatives, and be able to choose.</p> -<hr /> -<p>Relational databases have the well-known ACID properties: Atomicity, Consistency, Isolation and Durability.</p> -<p>NoSQL (except graph-based!) are about being BASE instead: Basically Available, Soft state, Eventual consistency.</p> -<p>SQL needs transactions because we don’t want to perform a read while we’re only half-way done with a write! The readers and writers are the problem, and ensuring consistency results in a performance hit, even if the risk is low (two writers are extremely rare but it still must be handled).</p> -<p>NoSQL on the other hand doesn’t need ACID because the aggregate <em>is</em> the transaction boundary. Even before NoSQL itself existed! Any update is atomic by nature. When updating many documents it <em>is</em> a problem, but this is very rare.</p> -<p>We have to distinguish between logical and replication consistency. During an update and if a conflict occurs, it must be resolved to preserve the logical consistency. Replication consistency on the other hand is preserveed when distributing the data across many machines, for example during sharding or copies.</p> -<p>Replication buys us more processing power and resillence (at the cost of more storage) in case some of the nodes die. But what happens if what dies is the communication across the nodes? We could drop the requests and preserve the consistency, or accept the risk to continue and instead preserve the availability.</p> -<p>The choice on whether trading consistency for availability is acceptable or not depends on the domain rules. It is the domain’s choice, the business people will choose. If you’re Amazon, you always want to be able to sell, but if you’re a bank, you probably don’t want your clients to have negative numbers in their account!</p> -<p>Regardless of what we do, in a distributed system, the CAP theorem always applies: Consistecy, Availability, Partitioning-tolerancy (error tolerancy). It is <strong>impossible</strong> to guarantee all 3 at 100%. Most of the times, it does work, but it is mathematically impossible to guarantee at 100%.</p> -<p>A database has to choose what to give up at some point. When designing a distributed system, this must be considered. Normally, the choice is made between consistency or response time.</p> -<h2 class="title" id="further_reading"><a class="anchor" href="#further_reading">¶</a>Further reading</h2> -<ul> -<li><a href="https://www.martinfowler.com/articles/nosql-intro-original.pdf">The future is: <del>NoSQL Databases</del> Polyglot Persistence</a></li> -<li><a href="https://www.thoughtworks.com/insights/blog/nosql-databases-overview">NoSQL Databases: An Overview</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,116 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>MongoDB: an Introduction</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the first post in the MongoDB series, where we will introduce the MongoDB database system and take a look at its features and installation methods.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-04-08</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/mongodb-an-introduction/">MongoDB: an Introduction</a> (this post)</li> -<li><a href="/blog/ribw/mongodb-basic-operations-and-architecture/">MongoDB: Basic Operations and Architecture</a></li> -<li><a href="/blog/ribw/developing-a-python-application-for-mongodb/">Developing a Python application for MongoDB</a></li> -</ul> -<p>This post is co-authored wih Classmate.</p> -<hr /> -<div class="image-container"> -<img src="mongodb.png" alt="NoSQL database – MongoDB – First delivery" /> -<div class="image-caption"></div> -</div> -<p> -<h2 class="title" id="purpose_of_technology"><a class="anchor" href="#purpose_of_technology">¶</a>Purpose of technology</h2> -<p>MongoDB is a <strong>general purpose, document-based, distributed database</strong> built for modern application developers and for the cloud era, with the scalability and flexibility that you want with the querying and indexing that you need. It being a document database means it stores data in JSON-like documents.</p> -<p>The Mongo team believes this is the most natural way to think about data, which is (they claim) much more expressive and powerful than the traditional row/column model, since programmers think in objects.</p> -<h2 id="how_it_works"><a class="anchor" href="#how_it_works">¶</a>How it works</h2> -<p>MongoDB’s architecture can be summarized as follows:</p> -<ul> -<li>Document data model.</li> -<li>Distributed systems design.</li> -<li>Unified experience with freedom to run it anywhere.</li> -</ul> -<p>For a more in-depth explanation, MongoDB offers a <a href="https://www.mongodb.com/collateral/mongodb-architecture-guide">download to the MongoDB Architecture Guide</a> with roughly ten pages worth of text.</p> -<p><img src="knGHenfTGA4kzJb1PHmS9EQvtZl2QlhbIPN15M38m8fZfZf7ODwYfhf0Tltr.png" alt="" /> -_ Overview of MongoDB’s architecture_</p> -<p>Regarding usage, MongoDB comes with a really nice introduction along with JavaScript, Python, Java, C++ or C# code at our choice, which describes the steps necessary to make it work. Below we will describe a common workflow.</p> -<p>First, we must <strong>connect</strong> to a running MongoDB instance. Once the connection succeeds, we can access individual «collections», which we can think of as <em>tables</em> where collections of data is stored.</p> -<p>For instance, we could <strong>insert</strong> an arbitrary JSON document into the <code>restaurants</code> collection to store information about a restaurant.</p> -<p>At any other point in time, we can <strong>query</strong> these collections. The queries range from trivial, empty ones (which would retrieve all the documents and fields) to more rich and complex queries (for instance, using AND and OR operators, checking if data exists, and then looking for a value in a list).</p> -<p>MongoDB also supports the creation of <strong>indices</strong>, similar to those in other database systems. It allows for the creation of indices on any field or subfields.</p> -<p>In Mongo, the <strong>aggregation pipeline</strong> allows us to filter and analyze data based on a given set of criteria. For example, we could pull all the documents in the <code>restaurants</code> collection that have a <code>category</code> of <code>Bakery</code> using the <code>$match</code> operator. Then, we can group them by their star rating using the <code>$group</code> operator. Using the accumulator operator, <code>$sum</code>, we can see how many bakeries in our collection have each star rating.</p> -<h2 id="features"><a class="anchor" href="#features">¶</a>Features</h2> -<p>The features can be seen all over the place in their site, because it’s something they make a lot of emphasis on:</p> -<ul> -<li> -<p><strong>Easy development</strong>, thanks to the document data model, something they claim to be «the best way to work with data».</p> -</li> -<li> -<p>Data is stored in flexible JSON-like documents.</p> -</li> -<li> -<p>This model directly maps to the objects in the application’s code.</p> -</li> -<li> -<p>Ad hoc queries, indexing, and real time aggregation provide powerful ways to access and analyze the data.</p> -</li> -<li> -<p><strong>Powerful query language</strong>, with a rich and expressive query language that allows filtering and sorting by any field, no matter how nested it may be within a document. The queries are themselves JSON, and thus easily composable.</p> -</li> -<li> -<p><strong>Support for aggregations</strong> and other modern use-cases such as geo-based search, graph search, and text search.</p> -</li> -<li> -<p><strong>A distributed systems design</strong>, which allows developers to intelligently put data where they want it. High availability, horizontal scaling, and geographic distribution are built in and easy to use.</p> -</li> -<li> -<p><strong>A unified experience</strong> with the freedom to run anywhere, which allows developers to future-proof their work and eliminate vendor lock-in.</p> -</li> -</ul> -<h2 id="corner_in_cap_theorem"><a class="anchor" href="#corner_in_cap_theorem">¶</a>Corner in CAP theorem</h2> -<p>MongoDB’s position in the CAP theorem (Consistency, Availability, Partition Tolerance) depends on the database and driver configurations, and the type of disaster.</p> -<ul> -<li>With <strong>no partitions</strong>, the main focus is <strong>CA</strong>.</li> -<li>If there are **partitions **but the system is <strong>strongly connected</strong>, the main focus is <strong>AP</strong>: non-synchronized writes from the old primary are ignored.</li> -<li>If there are <strong>partitions</strong> but the system is <strong>not strongly connected</strong>, the main focus is <strong>CP</strong>: only read access is provided to avoid inconsistencies. -The general consensus seems to be that Mongo is <strong>CP</strong>.</li> -</ul> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>We will be using the apt-based installation.</p> -<p>The Community version can be downloaded by anyone through <a href="https://www.mongodb.com/download-center/community">MongoDB Download Center</a>, where one can choose the version, Operating System and Package.MongoDB also seems to be <a href="https://packages.ubuntu.com/eoan/mongodb">available in Ubuntu’s PPAs</a>. </p> -<h2 id="installation"><a class="anchor" href="#installation">¶</a>Installation</h2> -<p>We will be using an Ubuntu-based system, with apt available. To install MongoDB, we open a terminal and run the following command:</p> -<pre><code>apt install mongodb -</code></pre> -<p>After confirming that we do indeed want to install the package, we should be able to run the following command to verify that the installation was successful:</p> -<pre><code>mongod --version -</code></pre> -<p>The output should be similar to the following: </p> -<pre><code>db version v4.0.16 -git version: 2a5433168a53044cb6b4fa8083e4cfd7ba142221 -OpenSSL version: OpenSSL 1.1.1 11 Sep 2018 -allocator: tcmalloc -modules: none -build environment: - distmod: ubuntu1804 - distarch: x86_64 - target_arch: x86_64 -</code></pre> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://www.mongodb.com/">MongoDB’s official site</a></li> -<li><a href="https://www.mongodb.com/what-is-mongodb">What is MongoDB?</a></li> -<li><a href="https://www.mongodb.com/mongodb-architecture">MongoDB Architecture</a></li> -<li><a href="https://stackoverflow.com/q/11292215/4759433">Where does mongodb stand in the CAP theorem?</a></li> -<li><a href="https://medium.com/@bikas.katwal10/mongodb-vs-cassandra-vs-rdbms-where-do-they-stand-in-the-cap-theorem-1bae779a7a15">What is the CAP Theorem? MongoDB vs Cassandra vs RDBMS, where do they stand in the CAP theorem?</a></li> -<li><a href="https://www.quora.com/Why-doesnt-MongoDB-have-availability-in-the-CAP-theorem">Why doesn’t MongoDB have availability in the CAP theorem?</a></li> -<li><a href="https://docs.mongodb.com/manual/installation/">Install MongoDB</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,312 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>MongoDB: Basic Operations and Architecture</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the second post in the MongoDB series, where we will take a look at the <a href="https://stackify.com/what-are-crud-operations/">CRUD operations</a> they support, the data model and architecture used.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-04-08</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/mongodb-an-introduction/">MongoDB: an Introduction</a></li> -<li><a href="/blog/ribw/mongodb-basic-operations-and-architecture/">MongoDB: Basic Operations and Architecture</a> (this post)</li> -<li><a href="/blog/ribw/developing-a-python-application-for-mongodb/">Developing a Python application for MongoDB</a></li> -</ul> -<p>This post is co-authored wih Classmate, and in it we will take an explorative approach using the <code>mongo</code> command line shell to execute commands against the database. It even has TAB auto-completion, which is awesome!</p> -<hr /> -<p>Before creating any documents, we first need to create somewhere for the documents to be in. And before we create anything, the database has to be running, so let’s do that first. If we don’t have a service installed, we can run the <code>mongod</code> command ourselves in some local folder to make things easier:</p> -<pre><code>$ mkdir -p mongo-database -$ mongod --dbpath mongo-database -</code></pre> -<p>Just like that, we will have Mongo running. Now, let’s connect to it using the <code>mongo</code> command in another terminal (don’t close the terminal where the server is running, we need it!). By default, it connects to localhost, which is just what we need.</p> -<pre><code>$ mongo -</code></pre> -<h2 class="title" id="create"><a class="anchor" href="#create">¶</a>Create</h2> -<h3 id="create_a_database"><a class="anchor" href="#create_a_database">¶</a>Create a database</h3> -<p>Let’s list the databases:</p> -<pre><code>> show databases -admin 0.000GB -config 0.000GB -local 0.000GB -</code></pre> -<p>Oh, how interesting! There’s already some databases, even though we just created the directory where Mongo will store everything. However, they seem empty, which make sense.</p> -<p>Creating a new database is done by <code>use</code>-ing a name that doesn’t exist. Let’s call our new database «helloworld».</p> -<pre><code>> use helloworld -switched to db helloworld -</code></pre> -<p>Good! Now the «local variable» called <code>db</code> points to our <code>helloworld</code> database.</p> -<pre><code>> db -helloworld -</code></pre> -<p>What happens if we print the databases again? Surely our new database will show up now…</p> -<pre><code>> show databases -admin 0.000GB -config 0.000GB -local 0.000GB -</code></pre> -<p>…maybe not! It seems Mongo won’t create the database until we create some collections and documents in it. Databases contain collections, and inside collections (which you can think of as tables) we can insert new documents (which you can think of as rows). Like in many programming languages, the dot operator is used to access these «members».</p> -<h3 id="create_a_document"><a class="anchor" href="#create_a_document">¶</a>Create a document</h3> -<p>Let’s add a new greeting into the <code>greetings</code> collection:</p> -<pre><code>> db.greetings.insert({message: "¡Bienvenido!", lang: "es"}) -WriteResult({ "nInserted" : 1 }) - -> show collections -greetings - -> show databases -admin 0.000GB -config 0.000GB -helloworld 0.000GB -local 0.000GB -</code></pre> -<p>That looks promising! We can also see our new <code>helloworld</code> database also shows up. The Mongo shell actually works on JavaScript-like code, which is why we can use a variant of JSON (BSON) to insert documents (note the lack of quotes around the keys, convenient!).</p> -<p>The <a href="https://docs.mongodb.com/manual/reference/method/db.collection.insert/index.html"><code>insert</code></a> method actually supports a list of documents, and by default Mongo will assign a unique identifier to each. If we don’t want that though, all we have to do is add the <code>_id</code> key to our documents.</p> -<pre><code>> db.greetings.insert([ -... {message: "Welcome!", lang: "en"}, -... {message: "Bonjour!", lang: "fr"}, -... ]) -BulkWriteResult({ - "writeErrors" : [ ], - "writeConcernErrors" : [ ], - "nInserted" : 2, - "nUpserted" : 0, - "nMatched" : 0, - "nModified" : 0, - "nRemoved" : 0, - "upserted" : [ ] -}) -</code></pre> -<h3 id="create_a_collection"><a class="anchor" href="#create_a_collection">¶</a>Create a collection</h3> -<p>In this example, we created the collection <code>greetings</code> implicitly, but behind the scenes Mongo made a call to <a href="https://docs.mongodb.com/manual/reference/method/db.createCollection/"><code>createCollection</code></a>. Let’s do just that:</p> -<pre><code>> db.createCollection("goodbyes") -{ "ok" : 1 } - -> show collections -goodbyes -greetings -</code></pre> -<p>The method actually has a default parameter to configure other options, like the maximum size of the collection or maximum amount of documents in it, validation-related options, and so on. These are all described in more details in the documentation.</p> -<h2 id="read"><a class="anchor" href="#read">¶</a>Read</h2> -<p>To read the contents of a document, we have to <a href="https://docs.mongodb.com/manual/reference/method/db.collection.find/index.html"><code>find</code></a> it.</p> -<pre><code>> db.greetings.find() -{ "_id" : ObjectId("5e74829a0659f802b15f18dd"), "message" : "¡Bienvenido!", "lang" : "es" } -{ "_id" : ObjectId("5e7487b90659f802b15f18de"), "message" : "Welcome!", "lang" : "en" } -{ "_id" : ObjectId("5e7487b90659f802b15f18df"), "message" : "Bonjour!", "lang" : "fr" } -</code></pre> -<p>That’s a bit unreadable for my taste, can we make it more <a href="https://docs.mongodb.com/manual/reference/method/cursor.pretty/index.html"><code>pretty</code></a>?</p> -<pre><code>> db.greetings.find().pretty() -{ - "_id" : ObjectId("5e74829a0659f802b15f18dd"), - "message" : "¡Bienvenido!", - "lang" : "es" -} -{ - "_id" : ObjectId("5e7487b90659f802b15f18de"), - "message" : "Welcome!", - "lang" : "en" -} -{ - "_id" : ObjectId("5e7487b90659f802b15f18df"), - "message" : "Bonjour!", - "lang" : "fr" -} -</code></pre> -<p>Gorgeous! We can clearly see Mongo created an identifier for us automatically. The queries are also JSON, and support a bunch of operators (prefixed by <code>$</code>), known as <a href="https://docs.mongodb.com/manual/reference/operator/query/">Query Selectors</a>. Here’s a few:</p> -<table> - <thead> - <tr> - <th> - Operation - </th> - <th> - Syntax - </th> - <th> - RDBMS equivalent - </th> - </tr> - </thead> - <tbody> - <tr> - <td> - Equals - </td> - <td> - <code> - {key: {$eq: value}} - </code> - <br/> - Shorthand: - <code> - {key: value} - </code> - </td> - <td> - <code> - where key = value - </code> - </td> - </tr> - <tr> - <td> - Less Than - </td> - <td> - <code> - {key: {$lte: value}} - </code> - </td> - <td> - <code> - where key < value - </code> - </td> - </tr> - <tr> - <td> - Less Than or Equal - </td> - <td> - <code> - {key: {$lt: value}} - </code> - </td> - <td> - <code> - where key <= value - </code> - </td> - </tr> - <tr> - <td> - Greater Than - </td> - <td> - <code> - {key: {$gt: value}} - </code> - </td> - <td> - <code> - where key > value - </code> - </td> - </tr> - <tr> - <td> - Greater Than or Equal - </td> - <td> - <code> - {key: {$gte: value}} - </code> - </td> - <td> - <code> - where key >= value - </code> - </td> - </tr> - <tr> - <td> - Not Equal - </td> - <td> - <code> - {key: {$ne: value}} - </code> - </td> - <td> - <code> - where key != value - </code> - </td> - </tr> - <tr> - <td> - And - </td> - <td> - <code> - {$and: [{k1: v1}, {k2: v2}]} - </code> - </td> - <td> - <code> - where k1 = v1 and k2 = v2 - </code> - </td> - </tr> - <tr> - <td> - Or - </td> - <td> - <code> - {$or: [{k1: v1}, {k2: v2}]} - </code> - </td> - <td> - <code> - where k1 = v1 or k2 = v2 - </code> - </td> - </tr> - </tbody> -</table> -<p>The operations all do what you would expect them to do, and their names are really intuitive. Aggregating operations with <code>$and</code> or <code>$or</code> can be done anywhere in the query, nested any level deep.</p> -<h2 id="update"><a class="anchor" href="#update">¶</a>Update</h2> -<p>Updating a document can be done by using <a href="https://docs.mongodb.com/manual/reference/method/db.collection.save/index.html"><code>save</code></a> on an already-existing document (that is, the document we want to save has <code>_id</code> and it’s in the collection already). If the document is not in the collection yet, this method will create it.</p> -<pre><code>> db.greetings.save({_id: ObjectId("5e74829a0659f802b15f18dd"), message: "¡Bienvenido, humano!", "lang" : "es"}) -WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) - -> db.greetings.find({lang: "es"}) -{ "_id" : ObjectId("5e74829a0659f802b15f18dd"), "message" : "¡Bienvenido, humano!", "lang" : "es" } -</code></pre> -<p>Alternatively, the <a href="https://docs.mongodb.com/manual/reference/method/db.collection.update/index.html"><code>update</code></a> method takes a query and new value.</p> -<pre><code>> db.greetings.update({lang: "en"}, {$set: {message: "Welcome, human!"}}) -WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) - -> db.greetings.find({lang: "en"}) -{ "_id" : ObjectId("5e7487b90659f802b15f18de"), "message" : "Welcome, human!", "lang" : "en" } -</code></pre> -<h2 id="indexing"><a class="anchor" href="#indexing">¶</a>Indexing</h2> -<p>Creating an index is done with <a href="https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/index.html"><code>createIndex</code></a>:</p> -<pre><code>> db.greetings.createIndex({lang: +1}) -{ - "createdCollectionAutomatically" : false, - "numIndexesBefore" : 1, - "numIndexesAfter" : 2, - "ok" : 1 -} -</code></pre> -<p>Here, we create an ascending index on the lang key. Descending order is done with <code>-1</code>. Now a query for <code>lang</code> in our three documents will be fast… well maybe iteration over three documents was faster than an index.</p> -<h2 id="delete"><a class="anchor" href="#delete">¶</a>Delete</h2> -<h3 id="delete_a_document"><a class="anchor" href="#delete_a_document">¶</a>Delete a document</h3> -<p>I have to confess, I can’t talk French. I learnt it long ago and it’s long forgotten, so let’s remove the translation I copied online from our greetings with <a href="https://docs.mongodb.com/manual/reference/method/db.collection.remove/index.html"><code>remove</code></a>.</p> -<pre><code>> db.greetings.remove({lang: "fr"}) -WriteResult({ "nRemoved" : 1 }) -</code></pre> -<h3 id="delete_a_collection"><a class="anchor" href="#delete_a_collection">¶</a>Delete a collection</h3> -<p>We never really used the <code>goodbyes</code> collection. Can we get rid of that?</p> -<pre><code>> db.goodbyes.drop() -true -</code></pre> -<p>Yes, it is <code>true</code> that we can <a href="https://docs.mongodb.com/manual/reference/method/db.collection.drop/index.html"><code>drop</code></a> it.</p> -<h3 id="delete_a_database"><a class="anchor" href="#delete_a_database">¶</a>Delete a database</h3> -<p>Now, I will be honest, I don’t really like our <code>greetings</code> database either. It stinks. Let’s get rid of it as well:</p> -<pre><code>> db.dropDatabase() -{ "dropped" : "helloworld", "ok" : 1 } -</code></pre> -<p>Yeah, take that! The <a href="https://docs.mongodb.com/manual/reference/method/db.dropDatabase/"><code>dropDatabase</code></a> can be used to drop databases.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<p>The examples in this post are all fictional, and the methods that could be used where taken from Classmate’s post, and of course <a href="https://docs.mongodb.com/manual/reference/method/">Mongo’s documentation</a>.</p> -</main> -</body> -</html> -
@@ -1,271 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Cassandra: Basic Operations and Architecture</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>This is the second post in the NoSQL Databases series, with a brief description on the basic operations (such as insertion, retrieval, indexing…), and complete execution along with the data model / architecture.</p> -<div class="date-created-modified">Created 2020-03-05<br> -Modified 2020-03-24</div> -<p>Other posts in this series:</p> -<ul> -<li><a href="/blog/ribw/nosql-databases-an-introduction/">Cassandra: an Introduction</a></li> -<li><a href="/blog/ribw/nosql-databases-basic-operations-and-architecture/">Cassandra: Basic Operations and Architecture</a> (this post)</li> -</ul> -<hr /> -<p>Cassandra uses it own Query Language for managing the databases, it is known as **CQL **(<strong>Cassandra Query Language</strong>). Cassandra stores data in <strong><em>tables</em></strong>, as in relational databases, and these tables are grouped in <strong><em>keyspaces</em></strong>. A keyspace defines a number of options that applies to all the tables it contains. The most used option is the **replication strategy. **It is recommended to have only one keyspace by application.</p> -<p>It is important to mention that <strong>tables and keyspaces</strong> are** case insensitive**, so myTable is equivalent to mytable, but it is possible to <strong>force case sensitivity</strong> using <strong>double-quotes</strong>.</p> -<p>To begin with the basic operations it is necessary to deploy Cassandra:</p> -<ol> -<li>Open a terminal in the root of the Apache Cassandra folder downloaded in the previous post.</li> -<li>Run the command:</li> -</ol> -<pre><code>$ bin/cassandra -</code></pre> -<p>Once Cassandra is deployed, it is time to open a** CQL Shell**, in <strong>other terminal</strong>, with the command: </p> -<pre><code>$ bin/cqlsh -</code></pre> -<p>It is possible to check if Cassandra is deployed if the SQL Shell prints the next message:</p> -<p><img src="uwqQgQte-cuYb_pePFOuY58re23kngrDKNgL1qz4yOfnBDZkqMIH3fFuCrye.png" alt="" /> -<em>CQL Shell</em></p> -<h2 class="title" id="create_insert"><a class="anchor" href="#create_insert">¶</a>Create/Insert</h2> -<h3 id="ddl_data_definition_language_"><a class="anchor" href="#ddl_data_definition_language_">¶</a>DDL (Data Definition Language)</h3> -<h4 id="create_keyspace"><a class="anchor" href="#create_keyspace">¶</a>Create keyspace</h4> -<p>A keyspace is created using a **CREATE KEYSPACE **statement:</p> -<pre><code>$ **CREATE** KEYSPACE [ **IF** **NOT** **EXISTS** ] keyspace_name **WITH** options; -</code></pre> -<p>The supported “<strong>options</strong>” are:</p> -<ul> -<li>“<strong>replication</strong>”: this is **mandatory **and defines the <strong>replication strategy</strong> and the <strong>replication factor</strong> (the number of nodes that will have a copy of the data). Within this option there is a property called “<strong>class</strong>” in which the <strong>replication strategy</strong> is specified (“SimpleStrategy” or “NetworkTopologyStrategy”)</li> -<li>“<strong>durable_writes</strong>”: this is <strong>not mandatory</strong> and it is possible to use the <strong>commit logs for updates</strong>. -Attempting to create an already existing keyspace will return an error unless the **IF NOT EXISTS **directive is used. </li> -</ul> -<p>The example associated to this statement is create a keyspace with name “test_keyspace” with “SimpleStrategy” as “class” of replication and a “replication_factor” of 3.</p> -<pre><code>**CREATE** KEYSPACE test_keyspace - **WITH** **replication** = {'class': 'SimpleStrategy', - 'replication_factor' : 3}; -</code></pre> -<p>The **USE **statement allows to <strong>change</strong> the current <strong>keyspace</strong>. The syntax of this statement is very simple: </p> -<pre><code>**USE** keyspace_name; -</code></pre> -<p><img src="RDWIG2RwvEevUFQv6TGFtGzRm4_9ERpxPf0feriflaj3alvWw3FEIAr_ZdF1.png" alt="" /> -<em>USE statement</em></p> -<p>It is also possible to get the metadata from a keyspace with the **DESCRIBE **statement.</p> -<pre><code>**DESCRIBE** KEYSPACES | KEYSPACE keyspace_name; -</code></pre> -<h4 id="create_table"><a class="anchor" href="#create_table">¶</a>Create table</h4> -<p>Creating a new table uses the **CREATE TABLE **statement:</p> -<pre><code>**CREATE** **TABLE** [ **IF** **NOT** **EXISTS** ] table_name - '(' - column_definition - ( ',' column_definition )* - [ ',' **PRIMARY** **KEY** '(' primary_key ')' ] - ')' [ **WITH** table_options ]; -</code></pre> -<p>With “column_definition” as: column_name cql_type [ STATIC ] [ PRIMARY KEY]; “primary_key” as: partition_key [ ‘,’ clustering_columns ]; and “table_options” as: COMPACT STORAGE [ AND table_options ] or CLUSTERING ORDER BY ‘(‘ clustering_order ‘)’ [ AND table_options ] or “options”.</p> -<p>Attempting to create an already existing table will return an error unless the <strong>IF NOT EXISTS</strong> directive is used.</p> -<p>The <strong>CQL types</strong> are described in the References section.</p> -<p>For example, we are going to create a table called “species_table” in the keyspace “test_keyspace” in which we will have a “species” text (as PRIMARY KEY), a “common_name” text, a “population” varint, a “average_size” int and a “sex” text. Besides, we are going to add a comment to the table: “Some species records”;</p> -<pre><code>**CREATE** **TABLE** species_table ( - species text **PRIMARY** **KEY**, - common_name text, - population varint, - average_size **int**, - sex text, -) **WITH** **comment**='Some species records'; -</code></pre> -<p>It is also possible to get the metadata from a table with the **DESCRIBE **statement.</p> -<pre><code>**DESCRIBE** **TABLES** | **TABLE** [keyspace_name.]table_name; -</code></pre> -<h3 id="dml_data_manipulation_language_"><a class="anchor" href="#dml_data_manipulation_language_">¶</a>DML (Data Manipulation Language)</h3> -<h4 id="insert_data"><a class="anchor" href="#insert_data">¶</a>Insert data</h4> -<p>Inserting data for a row is done using an **INSERT **statement:</p> -<pre><code>**INSERT** **INTO** table_name ( names_values | json_clause ) - [ **IF** **NOT** **EXISTS** ] - [ **USING** update_parameter ( **AND** update_parameter )* ]; -</code></pre> -<p>Where “names_values” is: names VALUES tuple_literal; “json_clause” is: JSON string [ DEFAULT ( NULL | UNSET ) ]; and “update_parameter” is usually: TTL.</p> -<p>For example we are going to use both VALUES and JSON clauses to insert data in the table “species_table”. In the VALUES clause it is necessary to supply the list of columns, not as in the JSON clause that is optional.</p> -<p>Note: TTL (Time To Live) and Timestamp are metrics for expiring data, so, when the time set is passed, the operation is expired.</p> -<p>In the VALUES clause we are going to insert a new specie called “White monkey”, with an average size of 3, its common name is “Copito de nieve”, population 0 and sex “male”.</p> -<pre><code>**INSERT** **INTO** species_table (species, common_name, population, average_size, sex) - **VALUES** ('White monkey', 'Copito de nieve', 0, 3, 'male'); -</code></pre> -<p>In the JSON clause we are going to insert a new specie called “Cloned sheep”, with an average size of 1, its common name is “Dolly the sheep”, population 0 and sex “female”.</p> -<pre><code>**INSERT** **INTO** species_table JSON '{"species": "Cloned Sheep", - "common_name": "Dolly the Sheep", - "average_size":1, - "population":0, - "sex": "female"}'; -</code></pre> -<p>Note: all updates for an **INSERT **are applied **atomically **and in <strong>isolation.</strong></p> -<h2 id="read"><a class="anchor" href="#read">¶</a>Read</h2> -<p>Querying data from data is done using a **SELECT **statement:</p> -<pre><code>**SELECT** [ JSON | **DISTINCT** ] ( select_clause | '*' ) - **FROM** table_name - [ **WHERE** where_clause ] - [ **GROUP** **BY** group_by_clause ] - [ **ORDER** **BY** ordering_clause ] - [ PER **PARTITION** **LIMIT** (**integer** | bind_marker) ] - [ **LIMIT** (**integer** | bind_marker) ] - [ ALLOW FILTERING ]; -</code></pre> -<p>The **CQL SELECT **statement is very **similar **to the **SQL SELECT **statement due to the fact that both allows filtering (<strong>WHERE</strong>), grouping data (<strong>GROUP BY</strong>), ordering the data (<strong>ORDER BY</strong>) and limit the number of data (<strong>LIMIT</strong>). Besides, **CQL offers **a **limit per partition **and allow the **filtering **of <strong>data</strong>.</p> -<p>Note: as in SQL it it possible to set alias to the data with the statement <strong>AS.</strong></p> -<p>For example we are going to retrieve all the information about those values from the tables “species_table” which “sex” is “male”. Allow filtering is mandatory when there is a WHERE statement.</p> -<pre><code>**SELECT** * **FROM** species_table **WHERE** sex = 'male' ALLOW FILTERING; -</code></pre> -<p><img src="s6GrKIGATvOSD7oGRNScUU5RnLN_-3X1JXvnVi_wDT_hrmPMZdnCdBI8DpIJ.png" alt="" /> -<em>SELECT statement</em></p> -<p>Furthermore, we are going to test the SELECT JSON statement. For this, we are going to retrieve only the species name with a population of 0. </p> -<pre><code>**SELECT** JSON species **FROM** species_table **WHERE** population = 0 ALLOW FILTERING; -</code></pre> -<p><img src="Up_eHlqKQp2RI5XIbgPOvj1B5J3gLxz7v7EI0NDRgezQTipecdfDT6AQoso0.png" alt="" /> -<em>SELECT JSON statement</em></p> -<h2 id="update"><a class="anchor" href="#update">¶</a>Update</h2> -<h3 id="ddl_data_definition_language__2"><a class="anchor" href="#ddl_data_definition_language__2">¶</a>DDL (Data Definition Language)</h3> -<h4 id="alter_keyspace"><a class="anchor" href="#alter_keyspace">¶</a>Alter keyspace</h4> -<p>The statement **ALTER KEYSPACE **allows to modify the options of a keyspace:</p> -<pre><code>**ALTER** KEYSPACE keyspace_name **WITH** options; -</code></pre> -<p>Note: the supported **options **are the same than for creating a keyspace, “<strong>replication</strong>” and “<strong>durable_writes</strong>”.</p> -<p>The example associated to this statement is to modify the keyspace with name “test_keyspace” and set a “replication_factor” of 4.</p> -<pre><code>**ALTER** KEYSPACE test_keyspace - **WITH** **replication** = {'class': 'SimpleStrategy', 'replication_factor' : 4}; -</code></pre> -<h4 id="alter_table"><a class="anchor" href="#alter_table">¶</a>Alter table</h4> -<p>Altering an existing table uses the **ALTER TABLE **statement:</p> -<pre><code>**ALTER** **TABLE** table_name alter_table_instruction; -</code></pre> -<p>Where “alter_table_instruction” can be: ADD column_name cql_type ( ‘,’ column_name cql_type )<em>; or DROP column_name ( column_name )</em>; or WITH options</p> -<p>The example associated to this statement is to ADD a new column to the table “species_table”, called “extinct” with type “boolean”.</p> -<pre><code>**ALTER** **TABLE** species_table **ADD** extinct **boolean**; -</code></pre> -<p>Another example is to DROP the column called “sex” from the table “species_table”.</p> -<pre><code>**ALTER** **TABLE** species_table **DROP** sex; -</code></pre> -<p>Finally, alter the comment with the WITH clause and set the comment to “All species records”. </p> -<pre><code>**ALTER** **TABLE** species_table **WITH** **comment**='All species records'; -</code></pre> -<p>These changes can be checked with the **DESCRIBE **statement:</p> -<pre><code>**DESCRIBE** **TABLE** species_table; -</code></pre> -<p><img src="xebKPqkWkn97YVHpRVXZYWvRUfeRUyCH-vPDs67aFaEeU53YTRbDOFscOlAr.png" alt="" /> -<em>DESCRIBE table</em></p> -<h3 id="dml_data_manipulation_language__2"><a class="anchor" href="#dml_data_manipulation_language__2">¶</a>DML (Data Manipulation Language)</h3> -<h4 id="update_data"><a class="anchor" href="#update_data">¶</a>Update data</h4> -<p>Updating a row is done using an **UPDATE **statement:</p> -<pre><code>**UPDATE** table_name -[ **USING** update_parameter ( **AND** update_parameter )* ] -**SET** assignment ( ',' assignment )* -**WHERE** where_clause -[ **IF** ( **EXISTS** | condition ( **AND** condition )*) ]; -</code></pre> -<p>Where the update_parameter is: ( TIMESTAMP | TTL) (integer | bind_marker)</p> -<p>It is important to mention that the **WHERE **clause is used to select the row to update and **must <strong>include ** all columns</strong> composing the <strong>PRIMARY KEY.</strong></p> -<p>We are going to test this statement updating the column “extinct” to true to the column with name ‘White monkey’.</p> -<pre><code>**UPDATE** species_table **SET** extinct = **true** **WHERE** species='White monkey'; -</code></pre> -<p><img src="IcaCe6VEC5c0ZQIygz-CiclzFyt491u7xPMg2muJLR8grmqaiUzkoQsVCoHf.png" alt="" /> -<em>SELECT statement</em></p> -<h2 id="delete"><a class="anchor" href="#delete">¶</a>Delete</h2> -<h3 id="ddl_data_definition_language__3"><a class="anchor" href="#ddl_data_definition_language__3">¶</a>DDL (Data Definition Language)</h3> -<h4 id="drop_keyspace"><a class="anchor" href="#drop_keyspace">¶</a>Drop keyspace</h4> -<p>Dropping a keyspace can be done using the **DROP KEYSPACE **statement:</p> -<pre><code>**DROP** KEYSPACE [ **IF** **EXISTS** ] keyspace_name; -</code></pre> -<p>For example, drop the keyspace called “test_keyspace_2” if it exists:</p> -<pre><code>**DROP** KEYSPACE **IF** **EXISTS** test_keyspace_2; -</code></pre> -<p>As this keyspace does not exists, this sentence will do nothing.</p> -<h4 id="drop_table"><a class="anchor" href="#drop_table">¶</a>Drop table</h4> -<p>Dropping a table uses the **DROP TABLE **statement:</p> -<pre><code>**DROP** **TABLE** [ **IF** **EXISTS** ] table_name; -</code></pre> -<p>For example, drop the table called “species_2” if it exists: </p> -<pre><code>**DROP** **TABLE** **IF** **EXISTS** species_2; -</code></pre> -<p>As this table does not exists, this sentence will do nothing.</p> -<h4 id="truncate_table_"><a class="anchor" href="#truncate_table_">¶</a>Truncate (table)</h4> -<p>A table can be truncated using the **TRUNCATE **statement:</p> -<pre><code>**TRUNCATE** [ **TABLE** ] table_name; -</code></pre> -<p>Do not execute this command now, because if you do it, you will need to insert the previous data again.</p> -<p>Note: as tables are the only object that can be truncated the keyword TABLE can be omitted.</p> -<p><img src="FOkhfpxlWFQCzcdfeWxLTy7wx5inDv0xwVeVhE79Pqtk3yYzWsZJnz_SBhUi.png" alt="" /> -<em>TRUNCATE statement</em></p> -<h3 id="dml_data_manipulation_language__3"><a class="anchor" href="#dml_data_manipulation_language__3">¶</a>DML (Data Manipulation Language)</h3> -<h4 id="delete_data"><a class="anchor" href="#delete_data">¶</a>Delete data</h4> -<p>Deleting rows or parts of rows uses the **DELETE **statement:</p> -<pre><code>**DELETE** [ simple_selection ( ',' simple_selection ) ] - **FROM** table_name - [ **USING** update_parameter ( **AND** update_parameter )* ] - **WHERE** where_clause - [ **IF** ( **EXISTS** | condition ( **AND** condition )*) ] -</code></pre> -<p>Now we are going to delete the value of the column “average_size” from “Cloned Sheep”. </p> -<pre><code>**DELETE** average_size **FROM** species_table **WHERE** species = 'Cloned Sheep'; -</code></pre> -<p><img src="CyuQokVL5J9TAelq-WEWhNl6kFtbIYs0R1AeU5NX4EkG-YQI81mNHdnf2yWN.png" alt="" /> -<em>DELETE value statement</em></p> -<p>And we are going to delete the same row as mentioned before. </p> -<pre><code>**DELETE** **FROM** species_table **WHERE** species = 'Cloned Sheep'; -</code></pre> -<p><img src="jvQ5cXJ5GTVQ6giVhBEpPJmrJw-zwKKyB9nsTm5PRcGSTzkmh-WO4kTeuLpB.png" alt="" /> -<em>DELETE row statement</em></p> -<h2 id="batch"><a class="anchor" href="#batch">¶</a>Batch</h2> -<p>Multiple <strong>INSERT</strong>, **UPDATE **and **DELETE **can be executed in a <strong>single statement</strong> by grouping them through a **BATCH **statement.</p> -<pre><code>**BEGIN** [ UNLOGGED | COUNTER ] BATCH - [ **USING** update_parameter ( **AND** update_parameter )* ] - modification_statement ( ';' modification_statement )* - APPLY BATCH; -</code></pre> -<p>Where modification_statement can be a insert_statement or an update_statement or a delete_statement.</p> -<ul> -<li>**UNLOGGED **means that either all operations in a batch eventually complete or none will.</li> -<li><strong>COUNTER</strong> means that the updates are not idempotent, so each time we execute the updates in a batch, we will have different results. -For example:</li> -</ul> -<pre><code>**BEGIN** BATCH - **INSERT** **INTO** species_table (species, common_name, population, average_size, extinct) - **VALUES** ('Blue Shark', 'Tiburillo', 30, 10, **false**); - **INSERT** **INTO** species_table (species, common_name, population, average_size, extinct) - **VALUES** ('Cloned sheep', 'Dolly the Sheep', 1, 1, **true**); - **UPDATE** species_table **SET** population = 2 **WHERE** species='Cloned sheep'; - **DELETE** **FROM** species_table **WHERE** species = 'White monkey'; -APPLY BATCH; -</code></pre> -<p><img src="EL9Dac26o0FqkVoeAKmopEKQe0wWq-xYI14b9RzGxtUkFJA3i2eTiR6qkuuJ.png" alt="" /> -<em>BATCH statement</em></p> -<h2 id="index"><a class="anchor" href="#index">¶</a>Index</h2> -<p>CQL support creating secondary indexes on tables, allowing queries on the table to use those indexes. </p> -<p>**Creating **a secondary index on a table uses the **CREATE INDEX **statement:</p> -<pre><code>**CREATE** [ CUSTOM ] **INDEX** [ **IF** **NOT** **EXISTS** ] [ index_name ] - **ON** table_name '(' index_identifier ')' - [ **USING** string [ **WITH** OPTIONS = map_literal ] ]; -</code></pre> -<p>For example we are going to create a index called “population_idx” that is related to the column “population” in the table “species_table”.</p> -<pre><code>**CREATE** **INDEX** population_idx **ON** species_table (population); -</code></pre> -<p>**Dropping **a secondary index uses the <strong>DROP INDEX</strong> statement: </p> -<pre><code>**DROP** **INDEX** [ **IF** **EXISTS** ] index_name; -</code></pre> -<p>Now, we are going to drop the previous index: </p> -<pre><code>**DROP** **INDEX** **IF** **EXISTS** population_idx; -</code></pre> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://cassandra.apache.org/doc/latest/cql/ddl.html">Cassandra CQL</a></li> -<li><a href="https://techdifferences.com/difference-between-ddl-and-dml-in-dbms.html">Differences between DML and DDL</a></li> -<li><a href="https://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/cqlReferenceTOC.html">Datastax CQL</a></li> -<li><a href="https://cassandra.apache.org/doc/latest/cql/types.html#grammar-token-cql-type">Cassandra CQL Types</a></li> -<li><a href="https://cassandra.apache.org/doc/latest/cql/indexes.html">Cassandra Index</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,38 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: NoSQL evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>I have decided to evaluate Classmate‘s post and Classmate‘s post, because they review databases I have not seen or used before, and I think it would be interesting to see new ones.</p> -<div class="date-created-modified">Created 2020-03-16<br> -Modified 2020-03-27</div> -<p>The evaluation is based on the requirements defined by Trabajos en grupo sobre Bases de Datos NoSQL:</p> -<blockquote> -<p><strong>1ª entrada:</strong> Descripción de la finalidad de la tecnología y cómo funciona o trabaja la BD NoSQL, sus características, la arista que ocupa en el Teorema CAP, de dónde se descarga, y cómo se instala.</p> -</blockquote> -<p>-- Teacher</p> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post I have evaluated is BB.DD. NoSQL: Voldemort 1ª Fase.</p> -<p>The post doesn’t start very well, because the first sentence has (emphasis mine):</p> -<blockquote> -<p>En él repasaremos en qué consiste <strong>MongoDB</strong>, sus características, y cómo se instala, entre otros.</p> -</blockquote> -<p>-- Classmate</p> -<p>…yet the post is about Voldemort!</p> -<p>The post does detail how it works, its architecture, corner in the CAP theorem, download and installation.</p> -<p>I have graded the post with A because I think it meets all the requirements, even if they slipped a bit in the beginning.</p> -<h2 id="classmate_s_evaluation_2"><a class="anchor" href="#classmate_s_evaluation_2">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>The post I have evaluted is Raven.</p> -<p>They have done a good job describing the project’s goals, corner in the CAP theorem, download, and provide an extensive installation section.</p> -<p>They don’t seem to use some of WordPress features, such as lists, but otherwise the post is good and deserves an A grading.</p> -</main> -</body> -</html> -
@@ -1,33 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: PC-Crawler evaluation 2</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>As the student <code>a(i)</code> where <code>i = 9</code>, I have been assigned to evaluate students <code>a(i - 1)</code> and <code>a(i - 2)</code>, these being:</p> -<div class="date-created-modified">Created 2020-03-16<br> -Modified 2020-03-28</div> -<ul> -<li>a08: Classmate (username)</li> -<li>a07: Classmate (username)</li> -</ul> -<p>The evaluation is done according to the criteria described in Segunda entrega del PC-Crawler.</p> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: A.</strong></p> -<p>This is the evaluation of Crawler – Thesauro.</p> -<p>It’s a well-written post, properly using WordPress code blocks, and they explain the process of improving the code and what it does. Because there are no noticeable issues with the post, they get the highest grading.</p> -<h2 id="classmate_s_evaluation_2"><a class="anchor" href="#classmate_s_evaluation_2">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: B.</strong></p> -<p>This is the evaluation of Actividad 2-Crawler.</p> -<p>They start with an introduction on what they will do.</p> -<p>Next, they show the code they have written, also describing what it does, although they don’t explain <em>why</em> they chose the data structures they used.</p> -<p>The style of the code leaves a lot to be desired, and they should have embedded the code in the post instead of taking screenshots. People that rely on screen readers will not be able to see the code.</p> -<p>I have graded them B and not A for this last reason.</p> -</main> -</body> -</html> -
@@ -1,42 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Privado: PC-Crawler evaluation</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>As the student <code>a(i)</code> where <code>i = 9</code>, I have been assigned to evaluate students <code>a(i + 3)</code> and <code>a(i + 4)</code>, these being:</p> -<div class="date-created-modified">Created 2020-03-04<br> -Modified 2020-03-18</div> -<ul> -<li>a12: Classmate (username)</li> -<li>a13: Classmate (username)</li> -</ul> -<h2 class="title" id="classmate_s_evaluation"><a class="anchor" href="#classmate_s_evaluation">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: B.</strong></p> -<p>I think they mix up a bit their considerations with program usage and how it works, not justifying why the considerations are the ones they chose, or what the alternatives would be.</p> -<p>The implementation notes are quite well-written. Even someone without knowledge of Java’s syntax can read the notes and more or less make sense of what’s going on, with the relevant code excerpts on each section.</p> -<p>Implementation-wise, some methods could definitely use some improvement:</p> -<ul> -<li><code>esExtensionTextual</code> is overly complicated. It could use a <code>for</code> loop and Java’s <code>String.endsWith</code>.</li> -<li><code>calcularFrecuencia</code> has quite some duplication (e.g. <code>this.getFicherosYDirectorios().remove(0)</code>) and could definitely be cleaned up.</li> -</ul> -<p>However, all the desired functionality is implemented.</p> -<p>Style-wise, some of the newlines and avoiding braces on <code>if</code> and <code>while</code> could be changed to improve the readability.</p> -<p>The post is written in Spanish, but uses some words that don’t translate well («remover» could better be said as «eliminar» or «quitar»).</p> -<h2 id="classmate_s_evaluation_2"><a class="anchor" href="#classmate_s_evaluation_2">¶</a>Classmate’s evaluation</h2> -<p><strong>Grading: B.</strong></p> -<p>Their post starts with an explanation on what a crawler is, common uses for them, and what type of crawler they will be developing. This is a very good start. Regarding the post style, it seems they are not properly using some of WordPress features, such as lists, and instead rely on paragraphs with special characters prefixing each list item.</p> -<p>The post also contains some details on how to install the requirements to run the program, which can be very useful for someone not used to working with Java.</p> -<p>They do not explain their implementation and the filename of the download has a typo.</p> -<p>Implementation-wise, the code seems to be well-organized, into several packages and files, although the naming is a bit inconsistent. They even designed a GUI, which is quite impressive.</p> -<p>Some of the methods are documented, although the code inside them is not very commented, including missing rationale for the data structures chosen. There also seem to be several other unused main functions, which I’m unsure why they were kept.</p> -<p>However, all the desired functionality is implemented.</p> -<p>Similar to Classmate, the code style could be improved and settled on some standard, as well as making use of Java features such as <code>for</code> loops over iterators instead of manual loops.</p> -</main> -</body> -</html> -
@@ -1,52 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Upgrading our Baby Crawler</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>In our <a href="/blog/ribw/build-your-own-pc/">last post on this series</a>, we presented the code for our Personal Crawler. However, we didn’t quite explain what a crawler even is! We will use this moment to go a bit more in-depth, and make some upgrades to it.</p> -<div class="date-created-modified">Created 2020-03-11<br> -Modified 2020-03-18</div> -<h2 class="title" id="what_is_a_crawler_"><a class="anchor" href="#what_is_a_crawler_">¶</a>What is a Crawler?</h2> -<p>A crawler is a program whose job is to analyze documents and extract data from them. For example, search engines like <a href="http://duckduckgo.com/">DuckDuckGo</a>, <a href="https://bing.com/">Bing</a> or <a href="http://google.com/">Google</a> all have crawlers to analyze websites and build a database around them. They are some kind of «trackers», because they keep track of everything they find.</p> -<p>Their basic behaviour can be described as follows: given a starting list of URLs, follow them all and identify hyperlinks inside the documents. Add these to the list of links to follow, and repeat <em>ad infinitum</em>.</p> -<ul> -<li>This lets us create an index to quickly search across them all.</li> -<li>We can also identify broken links.</li> -<li>We can gather any other type of information that we found. -Our crawler will work offline, within our own computer, scanning the text documents it finds on the root we tell it to scan.</li> -</ul> -<h2 id="design_decissions"><a class="anchor" href="#design_decissions">¶</a>Design Decissions</h2> -<ul> -<li>We will use Java. Its runtime is quite ubiquitous, so it should be able to run in virtually anywhere. The language is typed, which helps catch errors early on.</li> -<li>Our solution is iterative. While recursion can be seen as more elegants by some, iterative solutions are often more performant with less need for optimization.</li> -</ul> -<h2 id="requirements"><a class="anchor" href="#requirements">¶</a>Requirements</h2> -<p>If you don’t have Java installed yet, you can <a href="https://java.com/en/download/">Download Free Java Software</a> from Oracle’s site. To compile the code, the <a href="https://www.oracle.com/java/technologies/javase-jdk8-downloads.html">Java Development Kit</a> is also necessary.</p> -<p>We don’t depend on any other external libraries, for easier deployment and compilation.</p> -<h2 id="implementation"><a class="anchor" href="#implementation">¶</a>Implementation</h2> -<p>Because the code was getting pretty large, it has been split into several files, and we have also upgraded it to use a Graphical User Interface instead! We decided to use Swing, based on the Java tutorial <a href="https://docs.oracle.com/javase/tutorial/uiswing/">Creating a GUI With JFC/Swing</a>.</p> -<h3 id="app"><a class="anchor" href="#app">¶</a>App</h3> -<p>This file is the entry point of our application. Its job is to initialize the components, lay them out in the main panel, and connect the event handlers.</p> -<p>Most widgets are pretty standard, and are defined as class variables. However, some variables are notable. The <code>[DefaultTableModel](https://docs.oracle.com/javase/8/docs/api/javax/swing/table/DefaultTableModel.html)</code> is used because it allows to <a href="https://stackoverflow.com/a/22550106">dynamically add rows</a>, and we also have a <code>[SwingWorker](https://docs.oracle.com/javase/8/docs/api/javax/swing/SwingWorker.html)</code> subclass responsible for performing the word analysis (which is quite CPU intensive and should not be ran in the UI thread!).</p> -<p>There’s a few utility methods to ease some common operations, such as <code>updateStatus</code> which changes the status label in the main window, informing the user of the latest changes.</p> -<h3 id="thesaurus"><a class="anchor" href="#thesaurus">¶</a>Thesaurus</h3> -<p>A thesaurus is a collection of words or terms used to represent concepts. In literature this is commonly known as a dictionary.</p> -<p>On the subject of this project, we are using a thesaurus based on how relevant is a word for the meaning of a sentence, filtering out those that barely give us any information.</p> -<p>This file contains a simple thesaurus implementation, which can trivially be used as a normal or inverted thesaurus. However, we only treat it as inverted, and its job is loading itself and determining if words are valid or should otherwise be ignored.</p> -<h3 id="utils"><a class="anchor" href="#utils">¶</a>Utils</h3> -<p>Several utility functions used across the codebase.</p> -<h3 id="wordmap"><a class="anchor" href="#wordmap">¶</a>WordMap</h3> -<p>This file is the important one, and its implementation hasn’t changed much since our last post. Instances of a word map contain… wait for it… a map of words! It stores the mapping <code>word → count</code> in memory, and offers methods to query the count of a word or iterate over the word count entries.</p> -<p>It can be loaded from cache or told to analyze a root path. Once an instance is created, additional files could be analyzed one by one if desired.</p> -<h2 id="download"><a class="anchor" href="#download">¶</a>Download</h2> -<p>The code was getting a bit too large to embed it within the blog post itself, so instead you can download it as a<code>.zip</code> file.</p> -<p><em>download removed</em></p> -</main> -</body> -</html> -
@@ -1,57 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>What is ElasticSearch and why should you care?</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<p>ElasticSearch is a giant search index with powerful analytics capabilities. It’s like a database and search engine on steroids, really easy and fast to get up and running. One can think of it as your own Google, a search engine with analytics.</p> -<div class="date-created-modified">Created 2020-03-18<br> -Modified 2020-03-27</div> -<p>ElasticSearch is rich, stable, performs well, is well maintained, and able to scale to petabytes of any kind of data, whether it’s structured, semi-structured or not at all. It’s cost-effective and can be used to make business decisions.</p> -<p>Or, described in 10 seconds:</p> -<blockquote> -<p>Schema-free, REST & JSON based distributed document store -Open source: Apache License 2.0 -Zero configuration</p> -</blockquote> -<p>-- Alex Reelsen</p> -<h2 class="title" id="basic_capabilities"><a class="anchor" href="#basic_capabilities">¶</a>Basic capabilities</h2> -<p>ElasticSearch lets you ask questions about your data, not just make queries. You may think SQL can do this too, but what’s important is making a pipeline of facets, and feed the results from query to query.</p> -<p>Instead of changing your data, you can be flexible with your questions with no need to re-index it every time the questions change.</p> -<p>ElasticSearch is not just to search for full-text data, either. It can search for structured data and return more than just the results. It also yields additional data, such as ranking, highlights, and allows for pagination.</p> -<p>It doesn’t take a lot of configuration to get running, either, which can be a good boost on productivity.</p> -<h2 id="how_does_it_work_"><a class="anchor" href="#how_does_it_work_">¶</a>How does it work?</h2> -<p>ElasticSearch depends on Java, and can work in a distributed cluster if you execute multiple instances. Data will be replicated and sharded as needed. The current version at the time of writing is 7.6.1, and it’s being developed fast!</p> -<p>It also has support for plugins, with an ever-growing ecosystem and integration on many programming languages. Tools around it are being built around it, too, like Kibana which helps you visualize your data.</p> -<p>The way you use it is through a JSON API, served over HTTP/S.</p> -<h2 id="how_can_i_use_it_"><a class="anchor" href="#how_can_i_use_it_">¶</a>How can I use it?</h2> -<p><a href="https://www.elastic.co/downloads/">You can try ElasticSearch out for free on Elastic Cloud</a>, however, it can also be <a href="https://www.elastic.co/downloads/elasticsearch">downloaded and ran offline</a>, which is what we’ll do. Download the file corresponding to your operating system, unzip it, and execute the binary. Running it is as simple as that!</p> -<p>Now you can make queries to it over HTTP, with for example <code>curl</code>:</p> -<pre><code>curl -X PUT localhost:9200/orders/order/1 -d ' -{ - "created_at": "2013/09/05 15:45:10", - "items": [ - { - name: "HD Monitor" - } - ], - "total": 249.95 -}' -</code></pre> -<p>This will create a new order with some information, such as when it was created, what items it contains, and the total cost of the order.</p> -<p>You can then query or filter as needed, script it or even create statistics.</p> -<h2 id="references"><a class="anchor" href="#references">¶</a>References</h2> -<ul> -<li><a href="https://youtu.be/sKnkQSec1U0">YouTube – What is Elasticsearch?</a></li> -<li><a href="https://youtu.be/yWNiRC_hUAw">YouTube – GOTO 2013 • Elasticsearch – Beyond Full-text Search • Alex Reelsen</a></li> -<li><a href="https://www.elastic.co/kibana">Kibana – Your window into the Elastic Stack</a></li> -<li><a href="https://www.elastic.co/guide/index.html">Elastic Stack and Product Documentation</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,40 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Sentences</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="sentences"><a class="anchor" href="#sentences">¶</a>Sentences</h1> -<div class="date-created-modified">2018-01-31</div> -<blockquote> -<p>Don't know English? <a href="spanish.html">Read the Spanish version instead</a>.</p> -</blockquote> -<p>Just a few sentences that I've been gathering among the years and I think are worthy of being kept somewhere.</p> -<ul> -<li>So far, you've survived 100% of your worst days. You're doing great</li> -<li>Money is not a concern, perfection is</li> -<li>The only limit to our realization of tomorrow will be our doubts today</li> -<li>Not all cultures deserve respect.</li> -<li>It's not the same knowing that you're not free that not being free.</li> -<li>Being alive is not a biolgical matter, rather mental.</li> -<li>Every mountain starts off as a grain of sand.</li> -<li>Time goes against desire.</li> -<li>The only way to respect is fear.</li> -<li>For those who have nothing I have so much.</li> -<li>One isn't what they think, it's what they do.</li> -<li>When your goal seems impossible, don't change the goal. Find new ways to get to it.</li> -<li>Be the change you wish to see in the world.</li> -<li>Tell me something, I'll forget. Show me something, I'll remember. But make me part of it and I'll understand it.</li> -<li>If you want something to happen, go and do it. Or wait sitting like a stupid until it happens that it never happens.</li> -<li>I'd rather be happy than be right.</li> -<li>The engines don’t move the ship at all. The ship stays where it is and the engines move the universe around it.</li> -<li>If I never try getting there, I'll never get there.</li> -</ul> -</main> -</body> -</html> -
@@ -1,118 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>Tips for Outpost</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="tips_for_outpost"><a class="anchor" href="#tips_for_outpost">¶</a>Tips for Outpost</h1> -<div class="date-created-modified">Created 2020-05-10<br> -Modified 2020-05-22</div> -<p><a href="https://store.steampowered.com/app/1127110/Outpost/">Outpost</a> is a fun little game by Open Mid Interactive that has popped in recently in my recommended section of Steam, and I decided to give it a try.</p> -<p>It's a fun tower-defense game with progression, different graphics and random world generation which makes it quite fun for a few hours. In this post I want to talk about some tips I found useful to get past night 50.</p> -<h2 id="build_pattern"><a class="anchor" href="#build_pattern">¶</a>Build Pattern</h2> -<p>At first, you may be inclined to design a checkerboard pattern like the following, where "C" is the Crystal shrine, "S" is a stone launcher and "B" is a booster:</p> -<div class="image-container"> -<img src="outpost-bad-pattern.svg" alt="Bad Outpost build pattern" /> -<div class="image-caption"></div> -</div> -<p> -<p>Indeed, this pattern will apply <strong>4</strong> boosts to every turret, but unfortunately, the other 4 slots of the booster are wasted! This is because boosters are able to power 8 different towers, and you really want to maximize that. Here's a better design:</p> -<div class="image-container"> -<img src="outpost-good-pattern.svg" alt="Good Outpost build pattern" /> -<div class="image-caption"></div> -</div> -<p> -<p>The shrine's tower does get boosted, but it's still not really worth it to boost it. This pattern works good, and it's really easy to tile: just repeat the same 3x3 pattern.</p> -<p>Nonetheless, we can do better. What if we applied multiple boosters to the same tower while still applying all 8 boosts?</p> -<div class="image-container"> -<img src="outpost-best-pattern.svg" alt="Best Outpost build pattern" /> -<div class="image-caption"></div> -</div> -<p> -<p>That's what peak performance looks like. You can actually apply multiple boosters to the same tower, and it works great.</p> -<p>Now, is it really worth it building anywhere except around the shrine? Not really. You never know where a boss will come from, so all sides need a lot of defense if you want to stand a chance.</p> -<p>The addition of traps in 1.6 is amazing. You want to build these outside your strong "core", mostly to slow the enemies down so your turrets have more time to finish them off. Don't waste boosters on the traps, and build them at a reasonable distance from the center (the sixth tile is a good spot):</p> -<div class="image-container"> -<img src="outpost-trap-pattern.svg" alt="Trap Outpost build pattern" /> -<div class="image-caption"></div> -</div> -<p> -<p>If you gather enough materials, you can build more trap and cannon layers outside, roughly at enough distance to slow them for enough duration until they reach the next layer of traps, and so on. Probably a single gap of "cannon, booster, cannon" is enough between trap layers, just not in the center where you need a lot of fire power.</p> -<h2 id="talents"><a class="anchor" href="#talents">¶</a>Talents</h2> -<p>Talents are the way progression works in the game. Generally, after a run, you will have enough experience to upgrade nearly all talents of roughly the same tier. However, some are worth upgrading more than others (which provide basically no value).</p> -<p>The best ones to upgrade are:</p> -<ul> -<li>Starting supplies. Amazing to get good tools early.</li> -<li>Shrine shield. Very useful to hold against tough bosses.</li> -<li>Better buildings (cannon, boosters, bed and traps). They're a must to deal the most damage.</li> -<li>Better pickaxe. Stone is limited, so better make good use of it.</li> -<li>Better chests. They provide an insane amount of resources early.</li> -<li>Winter slow. Turrets will have more time to deal damage, it's perfect.</li> -<li>More time. Useful if you're running out, although generally you enter nights early after having a good core anyway.</li> -<li>More rocks. Similar to a better pickaxe, more stone is always better.</li> -</ul> -<p>Some decent ones:</p> -<ul> -<li>In-shrine turret. It's okay to get past the first night without building but not much beyond that.</li> -<li>Better axe and greaves. Great to save some energy and really nice quality of life to move around.</li> -<li>Tree growth. Normally there's enough trees for this not to be an issue but it can save some time gathering wood.</li> -<li>Wisps. They're half-decent since they can provide materials once you max out or max out expensive gear.</li> -</ul> -<p>Some okay ones:</p> -<ul> -<li>Extra XP while playing. Generally not needed due to the way XP scales per night, but can be a good boost.</li> -<li>Runestones. Not as reliable as chests but some can grant more energy per day.</li> -</ul> -<p>Some crap ones:</p> -<ul> -<li>Boosts for other seasons. I mean, winter is already the best, no use there.</li> -<li>Bow. The bow is very useless at the moment, it's not worth your experience.</li> -<li>More energy per bush. Not really worth hunting for bushes since you will have enough energy to do well.</li> -</ul> -<h2 id="turrets"><a class="anchor" href="#turrets">¶</a>Turrets</h2> -<p>Always build the highest tier, there's no point in anything lower than that. You will need to deal a lot of damage in a small area, which means space is a premium.</p> -<h2 id="boosters"><a class="anchor" href="#boosters">¶</a>Boosters</h2> -<p>If you're very early in the game, I recommend alternating both the flag and torch in a checkerboard pattern where the boosters should go in the pattern above. This way your towers will get extra speed and extra range, which works great.</p> -<p>When you're in mid-game (stone launchers, gears and campfires), I do not recommend using campfires. The issue is their range boost is way too long, and the turrets will miss quite a few shots. It's better to put all your power into fire speed for increased DPS, at least near the center. If you manage to build too far out and some of the turrets hardly ever shoot, you may put campfires there.</p> -<p>In end-game, of course alternate both of the highest tier upgrades. They are really good, and provide the best benefit / cost ratio.</p> -<h2 id="gathering_materials"><a class="anchor" href="#gathering_materials">¶</a>Gathering Materials</h2> -<p>It is <strong>very</strong> important to use all your energy every day! Otherwise it will go to waste, and you will need a lot of materials.</p> -<p>As of 1.6, you can mine two things at once if they're close enough! I don't know if this is intended or a bug, but it sure is great.</p> -<p>Once you're in mid-game, your stone-based fort should stand pretty well against the nights on its own. After playing for a while you will notice, if your base can defend a boss, then it will have no issue carrying you through the nights until the next boss. You can (and should!) spend the nights gathering materials, but only when you're confident that the night won't run out.</p> -<p>Before the boss hits (every fifth night), come back to your base and use all of your materials. This is the next fort upgrade that will carry it the five next nights.</p> -<p>You may also speed up time during night, but make sure you use all your energy before hand. And also take care, in the current version of the game speeding up time only speeds up monster movement, not the fire rate or projectile speed of your turrets! This means they will miss more shots and can be pretty dangerous. If you're speeding up time, consider speeding it up for a little bit, then go back to normal until things are more calm, and repeat.</p> -<p>If you're in the end-game, try to rush for chests. They provide a huge amount of materials which is really helpful to upgrade all your tools early so you can make sure to get the most out of every rock left in the map.</p> -<p>In the end-game, after all stone has been collected, you don't really need to use all of your energy anymore. Just enough to have enough wood to build with the remaining stone. This will also be nice with the bow upgrades, which admitedly can get quite powerful, but it's best to have a strong fort first.</p> -<h2 id="season"><a class="anchor" href="#season">¶</a>Season</h2> -<p>In my opinion, winter is just the best of the seasons. You don't <em>really</em> need that much energy (it gets tiresome), or extra tree drops, or luck. Slower movement means your turrets will be able to shoot enemies for longer, dealing more damage over time, giving them more chance to take enemies out before they reach the shrine.</p> -<p>Feel free to re-roll the map a few times (play and exit, or even restart the game) until you get winter if you want to go for The Play.</p> -<h2 id="gear"><a class="anchor" href="#gear">¶</a>Gear</h2> -<p>In my opinion, you really should rush for the best pickaxe you can afford. Stone is a limited resource that doesn't regrow like trees, so once you run out, it's over. Better to make the best use out of it with a good pickaxe!</p> -<p>You may also upgrade your greaves, we all known faster movement is a <em>really</em> nice quality of life improvement.</p> -<p>Of course, you will eventually upgrade your axe to chop wood (otherwise it's wasted energy, really), but it's not as much of a priority as the pickaxe.</p> -<p>Now, the bow is completely useless. Don't bother with it. Your energy is better spent gathering materials to build permanent turrets that deal constant damage while you're away, and the damage adds up with every extra turret you build.</p> -<p>With regards to items you carry (like sword, or helmet), look for these (from best to worst):</p> -<ul> -<li>Less minion life.</li> -<li>Chance to not consume energy.</li> -<li>+1 turret damage.</li> -<li>Extra energy.</li> -<li>+1 drop from trees or stones.</li> -<li>+1 free wood or stone per day.</li> -</ul> -<p>Less minion life, nothing to say. You will need it near end-game.</p> -<p>The chance to not consume energy is better the more energy you have. With a 25% chance not to consume energy, you can think of it as 1 extra energy for every 4 energy you have on average.</p> -<p>Turret damage is a tough one, it's <em>amazing</em> mid-game (it basically doubles your damage) but falls short once you unlock the cannon where you may prefer other items. Definitely recommended if you're getting started. You may even try to roll it on low tiers by dying on the second night, because it's that good.</p> -<p>Extra energy is really good, because it means you can get more materials before it gets too rough. Make sure you have built at least two beds in the first night! This extra energy will pay of for the many nights to come.</p> -<p>The problem with free wood or stone per day is that you have, often, five times as much energy per day. By this I mean you can get easily 5 stone every day, which means 5 extra stone, whereas the other would provide just 1 per night. On a good run, you will get around 50 free stone or 250 extra stone. It's a clear winner.</p> -<p>In end-game, more quality of life are revealing chests so that you can rush them early, if you like to hunt for them try to make better use of the slot.</p> -<h2 id="closing_words"><a class="anchor" href="#closing_words">¶</a>Closing words</h2> -<p>I hope you enjoy the game as much as I do! Movement is sometimes janky and there's the occassional lag spikes, but despite this it should provide at least a few good hours of gameplay. Beware however a good run can take up to an hour!</p> -</main> -</body> -</html> -
@@ -1,1719 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="220" - height="220" - viewBox="0 0 58.208332 58.208334" - version="1.1" - id="svg8" - inkscape:version="0.92.3 (2405546, 2018-03-11)" - sodipodi:docname="outpost-bad-pattern.svg"> - <defs - id="defs2" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="4.0000001" - inkscape:cx="48.149205" - inkscape:cy="127.57923" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - units="px" - inkscape:window-width="1366" - inkscape:window-height="739" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" /> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-238.79165)"> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect815" - width="5.2916665" - height="5.2916665" - x="0" - y="291.70831" /> - <rect - y="291.70831" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect817" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect819" - width="5.2916665" - height="5.2916665" - x="10.583333" - y="291.70831" /> - <rect - y="291.70831" - x="15.875" - height="5.2916665" - width="5.2916665" - id="rect821" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect823" - width="5.2916665" - height="5.2916665" - x="21.166666" - y="291.70831" /> - <rect - y="291.70831" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect825" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect827" - width="5.2916665" - height="5.2916665" - x="31.749998" - y="291.70831" /> - <rect - y="291.70831" - x="37.041664" - height="5.2916665" - width="5.2916665" - id="rect829" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect831" - width="5.2916665" - height="5.2916665" - x="42.333328" - y="291.70831" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect835" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="291.70831" /> - <rect - y="291.70831" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect837" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="286.41666" - x="0" - height="5.2916665" - width="5.2916665" - id="rect839" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect841" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="286.41666" /> - <rect - y="286.41666" - x="10.583333" - height="5.2916665" - width="5.2916665" - id="rect843" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect845" - width="5.2916665" - height="5.2916665" - x="15.875" - y="286.41666" /> - <rect - y="286.41666" - x="21.166666" - height="5.2916665" - width="5.2916665" - id="rect847" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect849" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="286.41666" /> - <rect - y="286.41666" - x="31.749998" - height="5.2916665" - width="5.2916665" - id="rect851" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect853" - width="5.2916665" - height="5.2916665" - x="37.041664" - y="286.41666" /> - <rect - y="286.41666" - x="42.333328" - height="5.2916665" - width="5.2916665" - id="rect855" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="286.41666" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect857" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect859" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="286.41666" /> - <rect - y="281.125" - x="0" - height="5.2916665" - width="5.2916665" - id="rect861" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect863" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="281.125" /> - <rect - y="281.125" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect879" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect881" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="281.125" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect883" - width="5.2916665" - height="5.2916665" - x="0" - y="275.83334" /> - <rect - y="275.83334" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect885" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect901" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="275.83334" /> - <rect - y="275.83334" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect903" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="270.54169" - x="0" - height="5.2916665" - width="5.2916665" - id="rect905" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect907" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="270.54169" /> - <rect - y="270.54169" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect923" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect925" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="270.54169" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect927" - width="5.2916665" - height="5.2916665" - x="0" - y="265.25003" /> - <rect - y="265.25003" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect929" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect945" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="265.25003" /> - <rect - y="265.25003" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect947" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect949" - width="5.2916665" - height="5.2916665" - x="0" - y="259.95837" /> - <rect - y="259.95837" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect951" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect967" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="259.95837" /> - <rect - y="259.95837" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect969" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="254.66672" - x="0" - height="5.2916665" - width="5.2916665" - id="rect971" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect973" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="254.66672" /> - <rect - y="254.66672" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect989" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect991" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="254.66672" /> - <rect - y="249.37506" - x="0" - height="5.2916665" - width="5.2916665" - id="rect993" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect995" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="249.37506" /> - <rect - y="249.37506" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect1011" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1013" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="249.37506" /> - <rect - y="244.0834" - x="0" - height="5.2916665" - width="5.2916665" - id="rect1015" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1017" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="244.0834" /> - <rect - y="244.0834" - x="10.583333" - height="5.2916665" - width="5.2916665" - id="rect1019" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1021" - width="5.2916665" - height="5.2916665" - x="15.875" - y="244.0834" /> - <rect - y="244.0834" - x="21.166666" - height="5.2916665" - width="5.2916665" - id="rect1023" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1025" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="244.0834" /> - <rect - y="244.0834" - x="31.749998" - height="5.2916665" - width="5.2916665" - id="rect1027" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1029" - width="5.2916665" - height="5.2916665" - x="37.041664" - y="244.0834" /> - <rect - y="244.0834" - x="42.333328" - height="5.2916665" - width="5.2916665" - id="rect1031" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="244.0834" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect1033" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1035" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="244.0834" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1037" - width="5.2916665" - height="5.2916665" - x="0" - y="238.79175" /> - <rect - y="238.79175" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect1039" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1041" - width="5.2916665" - height="5.2916665" - x="10.583333" - y="238.79175" /> - <rect - y="238.79175" - x="15.875" - height="5.2916665" - width="5.2916665" - id="rect1043" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1045" - width="5.2916665" - height="5.2916665" - x="21.166666" - y="238.79175" /> - <rect - y="238.79175" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect1047" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1049" - width="5.2916665" - height="5.2916665" - x="31.749998" - y="238.79175" /> - <rect - y="238.79175" - x="37.041664" - height="5.2916665" - width="5.2916665" - id="rect1051" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1053" - width="5.2916665" - height="5.2916665" - x="42.333328" - y="238.79175" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1055" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="238.79175" /> - <rect - y="238.79175" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect1057" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <g - id="g1106"> - <rect - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect937" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="265.25003" /> - <text - id="text1101" - y="269.30844" - x="27.745592" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332;" - xml:space="preserve"><tspan - style="stroke-width:0.26458332;fill:#ffffff;" - y="269.30844" - x="27.745592" - id="tspan1099" - sodipodi:role="line">C</tspan></text> - </g> - <g - id="g1114" - transform="translate(-42.333332,26.458286)"> - <rect - y="265.25003" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect1108" - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="27.745592" - y="269.30844" - id="text1112"><tspan - sodipodi:role="line" - id="tspan1110" - x="27.745592" - y="269.30844" - style="fill:#ffffff;stroke-width:0.26458332">C</tspan></text> - </g> - <g - id="g1165" - transform="translate(35.6385,-11.263733)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1151" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1155" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1153" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.221833,-11.263733)" - id="g1173"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1167" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1171"><tspan - sodipodi:role="line" - id="tspan1169" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1181" - transform="translate(46.221832,-0.68041992)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1175" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1179" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1177" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(35.6385,-0.68041992)" - id="g1189"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1183" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1187"><tspan - sodipodi:role="line" - id="tspan1185" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(25.055168,-21.847046)" - id="g1197"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1191" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1195"><tspan - sodipodi:role="line" - id="tspan1193" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1205" - transform="translate(35.638501,-21.847046)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1199" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1203" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1201" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1213" - transform="translate(46.221832,-21.847046)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1207" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1211" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1209" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(56.805165,-21.847046)" - id="g1221"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1215" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1219"><tspan - sodipodi:role="line" - id="tspan1217" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(25.055168,-0.68041992)" - id="g1229"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1223" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1227"><tspan - sodipodi:role="line" - id="tspan1225" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1237" - transform="translate(25.055168,9.9028932)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1231" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1235" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1233" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(25.055169,-11.263733)" - id="g1245"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1239" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1243"><tspan - sodipodi:role="line" - id="tspan1241" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1253" - transform="translate(56.805163,-0.68041983)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1247" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1251" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1249" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(56.805163,9.9028933)" - id="g1261"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1255" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1259"><tspan - sodipodi:role="line" - id="tspan1257" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1269" - transform="translate(56.805164,-11.263733)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1263" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1267" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1265" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.221832,9.9028931)" - id="g1277"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1271" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1275"><tspan - sodipodi:role="line" - id="tspan1273" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1285" - transform="translate(35.6385,9.9028931)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1279" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1283" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1281" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1345" - transform="translate(30.346834,-16.555389)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1339" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1343" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1341" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(40.930167,-16.555389)" - id="g1353"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1347" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1351"><tspan - sodipodi:role="line" - id="tspan1349" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(51.513498,-16.555389)" - id="g1361"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1355" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1359"><tspan - sodipodi:role="line" - id="tspan1357" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(30.346833,-5.9720764)" - id="g1369"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1363" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1367"><tspan - sodipodi:role="line" - id="tspan1365" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1385" - transform="translate(51.513497,-5.9720764)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1379" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1383" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1381" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1393" - transform="translate(30.346833,4.6112366)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1387" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1391" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1389" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(40.930166,4.6112366)" - id="g1401"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1395" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1399"><tspan - sodipodi:role="line" - id="tspan1397" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(51.513497,4.6112366)" - id="g1409"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1403" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1407"><tspan - sodipodi:role="line" - id="tspan1405" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1458" - transform="translate(-1.4031647,9.9028864)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1452" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1456" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1454" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1474" - transform="translate(-2.8063296,10.797967)"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1460" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1464" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1462" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1482" - transform="translate(28.94367,-26.243621)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1476" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1480"><tspan - sodipodi:role="line" - id="tspan1478" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(23.652005,-20.951965)" - id="g1490"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1484" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1488" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1486" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1498" - transform="translate(34.235336,-20.951965)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1492" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1496"><tspan - sodipodi:role="line" - id="tspan1494" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(34.235335,-10.368652)" - id="g1506"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1500" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1504" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1502" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1514" - transform="translate(28.943669,-15.660309)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1508" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1512"><tspan - sodipodi:role="line" - id="tspan1510" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(23.652005,-10.368652)" - id="g1522"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1516" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1520" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1518" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1530" - transform="translate(28.943669,-5.0769958)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1524" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1528"><tspan - sodipodi:role="line" - id="tspan1526" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(23.652003,0.21466064)" - id="g1538"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1532" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1536" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1534" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1546" - transform="translate(28.943669,5.5063172)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1540" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1544"><tspan - sodipodi:role="line" - id="tspan1542" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(34.235336,0.21466065)" - id="g1554"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1548" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1552" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1550" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1562" - transform="translate(39.527002,-5.0769958)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1556" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1560"><tspan - sodipodi:role="line" - id="tspan1558" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(39.527002,5.5063171)" - id="g1570"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1564" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1568" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1566" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1578" - transform="translate(44.818666,0.21466067)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1572" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1576"><tspan - sodipodi:role="line" - id="tspan1574" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(50.110332,5.5063174)" - id="g1586"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1580" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1584" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1582" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1594" - transform="translate(55.401999,0.21466074)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1588" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1592"><tspan - sodipodi:role="line" - id="tspan1590" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(50.110334,-5.0769958)" - id="g1602"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1596" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1600" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1598" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1610" - transform="translate(55.401999,-10.368652)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1604" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1608"><tspan - sodipodi:role="line" - id="tspan1606" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(44.818669,-10.368652)" - id="g1618"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1612" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1616" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1614" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1626" - transform="translate(39.527003,-15.660309)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1620" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1624"><tspan - sodipodi:role="line" - id="tspan1622" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(50.110335,-15.660309)" - id="g1634"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1628" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1632" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1630" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1642" - transform="translate(44.818667,-20.951965)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1636" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1640"><tspan - sodipodi:role="line" - id="tspan1638" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(55.402,-20.951965)" - id="g1650"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1644" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1648" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1646" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1658" - transform="translate(50.110334,-26.243607)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1652" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1656"><tspan - sodipodi:role="line" - id="tspan1654" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(39.527003,-26.243622)" - id="g1666"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1660" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1664" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1662" - sodipodi:role="line">B</tspan></text> - </g> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1680" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="275.83334" /> - <rect - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.46266627;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1093" - width="10.583333" - height="10.583333" - x="10.583333" - y="249.37508" /> - </g> -</svg>
@@ -1,1715 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="220" - height="220" - viewBox="0 0 58.208332 58.208334" - version="1.1" - id="svg8" - inkscape:version="0.92.3 (2405546, 2018-03-11)" - sodipodi:docname="outpos-best-pattern.svg"> - <defs - id="defs2" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="2.0000001" - inkscape:cx="132.5362" - inkscape:cy="94.229796" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - units="px" - inkscape:window-width="1366" - inkscape:window-height="739" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" /> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-238.79165)"> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect815" - width="5.2916665" - height="5.2916665" - x="0" - y="291.70831" /> - <rect - y="291.70831" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect817" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect819" - width="5.2916665" - height="5.2916665" - x="10.583333" - y="291.70831" /> - <rect - y="291.70831" - x="15.875" - height="5.2916665" - width="5.2916665" - id="rect821" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect823" - width="5.2916665" - height="5.2916665" - x="21.166666" - y="291.70831" /> - <rect - y="291.70831" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect825" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect827" - width="5.2916665" - height="5.2916665" - x="31.749998" - y="291.70831" /> - <rect - y="291.70831" - x="37.041664" - height="5.2916665" - width="5.2916665" - id="rect829" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect831" - width="5.2916665" - height="5.2916665" - x="42.333328" - y="291.70831" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect835" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="291.70831" /> - <rect - y="291.70831" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect837" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="286.41666" - x="0" - height="5.2916665" - width="5.2916665" - id="rect839" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="286.41666" - x="21.166666" - height="5.2916665" - width="5.2916665" - id="rect847" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect849" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="286.41666" /> - <rect - y="286.41666" - x="31.749998" - height="5.2916665" - width="5.2916665" - id="rect851" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect859" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="286.41666" /> - <rect - y="281.125" - x="0" - height="5.2916665" - width="5.2916665" - id="rect861" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect881" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="281.125" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect883" - width="5.2916665" - height="5.2916665" - x="0" - y="275.83334" /> - <rect - y="275.83334" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect903" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="270.54169" - x="0" - height="5.2916665" - width="5.2916665" - id="rect905" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect907" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="270.54169" /> - <rect - y="270.54169" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect923" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect925" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="270.54169" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect927" - width="5.2916665" - height="5.2916665" - x="0" - y="265.25003" /> - <rect - y="265.25003" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect929" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect945" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="265.25003" /> - <rect - y="265.25003" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect947" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect949" - width="5.2916665" - height="5.2916665" - x="0" - y="259.95837" /> - <rect - y="259.95837" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect951" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect967" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="259.95837" /> - <rect - y="259.95837" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect969" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="254.66672" - x="0" - height="5.2916665" - width="5.2916665" - id="rect971" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect991" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="254.66672" /> - <rect - y="249.37506" - x="0" - height="5.2916665" - width="5.2916665" - id="rect993" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1013" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="249.37506" /> - <rect - y="244.0834" - x="0" - height="5.2916665" - width="5.2916665" - id="rect1015" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="244.0834" - x="21.166666" - height="5.2916665" - width="5.2916665" - id="rect1023" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1025" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="244.0834" /> - <rect - y="244.0834" - x="31.749998" - height="5.2916665" - width="5.2916665" - id="rect1027" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1035" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="244.0834" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1037" - width="5.2916665" - height="5.2916665" - x="0" - y="238.79175" /> - <rect - y="238.79175" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect1039" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1041" - width="5.2916665" - height="5.2916665" - x="10.583333" - y="238.79175" /> - <rect - y="238.79175" - x="15.875" - height="5.2916665" - width="5.2916665" - id="rect1043" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1045" - width="5.2916665" - height="5.2916665" - x="21.166666" - y="238.79175" /> - <rect - y="238.79175" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect1047" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1049" - width="5.2916665" - height="5.2916665" - x="31.749998" - y="238.79175" /> - <rect - y="238.79175" - x="37.041664" - height="5.2916665" - width="5.2916665" - id="rect1051" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1053" - width="5.2916665" - height="5.2916665" - x="42.333328" - y="238.79175" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1055" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="238.79175" /> - <rect - y="238.79175" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect1057" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <g - id="g1106"> - <rect - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect937" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="265.25003" /> - <text - id="text1101" - y="269.30844" - x="27.745592" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332;" - xml:space="preserve"><tspan - style="stroke-width:0.26458332;fill:#ffffff;" - y="269.30844" - x="27.745592" - id="tspan1099" - sodipodi:role="line">C</tspan></text> - </g> - <g - id="g1114" - transform="translate(-42.333332,26.458286)"> - <rect - y="265.25003" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect1108" - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="27.745592" - y="269.30844" - id="text1112"><tspan - sodipodi:role="line" - id="tspan1110" - x="27.745592" - y="269.30844" - style="fill:#ffffff;stroke-width:0.26458332">C</tspan></text> - </g> - <g - id="g1165" - transform="translate(35.6385,-11.263733)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1151" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1155" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1153" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1458" - transform="translate(-1.4031647,9.9028864)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1452" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1456" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1454" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1474" - transform="translate(-2.8063296,10.797967)"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1460" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1464" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1462" - sodipodi:role="line">B</tspan></text> - </g> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1680" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="275.83334" /> - <g - id="g1147" - transform="translate(40.930166,-11.263733)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1141" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1145" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1143" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(39.527002,-20.951965)" - id="g1415"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1409" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1413" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1411" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(35.6385,-16.555389)" - id="g1431"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1425" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1429"><tspan - sodipodi:role="line" - id="tspan1427" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1439" - transform="translate(35.6385,-21.847031)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1433" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1437" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1435" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(40.930166,-21.847031)" - id="g1447"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1441" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1445"><tspan - sodipodi:role="line" - id="tspan1443" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1455" - transform="translate(46.221832,-21.847031)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1449" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1453" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1451" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.221832,-16.555375)" - id="g1463"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1457" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1461"><tspan - sodipodi:role="line" - id="tspan1459" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(46.221833,-0.68042051)" - id="g1555"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1549" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1553"><tspan - sodipodi:role="line" - id="tspan1551" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(51.513499,-0.68042051)" - id="g1563"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1557" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1561"><tspan - sodipodi:role="line" - id="tspan1559" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1571" - transform="translate(50.110335,-10.368653)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1565" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1569"><tspan - sodipodi:role="line" - id="tspan1567" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1579" - transform="translate(46.221833,-5.9720765)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1573" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1577" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1575" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.221833,-11.263719)" - id="g1587"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1581" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1585"><tspan - sodipodi:role="line" - id="tspan1583" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1595" - transform="translate(51.513499,-11.263719)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1589" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1593" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1591" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(56.805165,-0.68040601)" - id="g1603"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1597" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1601"><tspan - sodipodi:role="line" - id="tspan1599" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1611" - transform="translate(56.805165,-5.9720625)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1605" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1609" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1607" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1639" - transform="translate(35.638501,9.9028786)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1633" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1637" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1635" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1647" - transform="translate(40.930167,9.9028786)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1641" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1645" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1643" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(39.527003,0.21464608)" - id="g1655"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1649" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1653" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1651" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(35.638501,4.6112226)" - id="g1663"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1657" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1661"><tspan - sodipodi:role="line" - id="tspan1659" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1671" - transform="translate(35.638501,-0.68041992)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1665" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1669" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1667" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(40.930167,-0.68041992)" - id="g1679"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1673" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1677"><tspan - sodipodi:role="line" - id="tspan1675" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1687" - transform="translate(46.221833,9.9028931)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1681" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1685" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1683" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.221833,4.6112366)" - id="g1695"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1689" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1693"><tspan - sodipodi:role="line" - id="tspan1691" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(56.805165,-11.263719)" - id="g1703"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1697" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1701"><tspan - sodipodi:role="line" - id="tspan1699" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(25.055168,-0.68041992)" - id="g1711"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1705" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1709"><tspan - sodipodi:role="line" - id="tspan1707" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(30.346834,-0.68041992)" - id="g1719"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1713" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1717"><tspan - sodipodi:role="line" - id="tspan1715" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1727" - transform="translate(28.94367,-10.368652)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1721" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1725"><tspan - sodipodi:role="line" - id="tspan1723" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1735" - transform="translate(25.055168,-5.9720759)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1729" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1733" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1731" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(25.055168,-11.263718)" - id="g1743"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1737" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1741"><tspan - sodipodi:role="line" - id="tspan1739" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1751" - transform="translate(30.346834,-11.263718)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1745" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1749" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1747" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(35.638501,-5.9720761)" - id="g1759"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1753" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1757"><tspan - sodipodi:role="line" - id="tspan1755" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(25.055167,4.6112372)" - id="g1862"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1856" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1860"><tspan - sodipodi:role="line" - id="tspan1858" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1870" - transform="translate(30.346834,9.9028791)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1864" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1868" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1866" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1910" - transform="translate(50.110335,0.21466067)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1904" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1908"><tspan - sodipodi:role="line" - id="tspan1906" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1918" - transform="translate(51.5135,9.9029076)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1912" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1916" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1914" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1934" - transform="translate(56.805166,4.6112655)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1928" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1932" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1930" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1974" - transform="translate(56.805162,-16.555375)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1968" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1972" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1970" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(50.110335,-20.951951)" - id="g1982"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1976" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1980" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1978" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(51.513496,-21.84703)" - id="g1990"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1984" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1988"><tspan - sodipodi:role="line" - id="tspan1986" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g2054" - transform="translate(28.94367,-20.951964)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect2048" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text2052"><tspan - sodipodi:role="line" - id="tspan2050" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(30.346835,-21.847045)" - id="g2086"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect2080" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text2084"><tspan - sodipodi:role="line" - id="tspan2082" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1204" - transform="translate(28.943669,0.21466127)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1198" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1202"><tspan - sodipodi:role="line" - id="tspan1200" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(56.805162,-16.555375)" - id="g1356" /> - <g - transform="translate(56.805162,-21.847031)" - id="g1383"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1377" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1381"><tspan - sodipodi:role="line" - id="tspan1379" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <rect - y="249.37505" - x="47.624992" - height="5.2916665" - width="5.2916665" - id="rect1473" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="244.08339" - x="42.333328" - height="5.2916665" - width="5.2916665" - id="rect1475" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1477" - width="5.2916665" - height="5.2916665" - x="47.624992" - y="244.08339" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1479" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="254.6667" /> - <rect - y="244.0834" - x="37.04166" - height="5.2916665" - width="5.2916665" - id="rect1481" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="286.41669" - x="37.041664" - height="5.2916665" - width="5.2916665" - id="rect1483" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="286.41669" - x="42.333332" - height="5.2916665" - width="5.2916665" - id="rect1485" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1487" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="286.41669" /> - <rect - y="281.12503" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect1489" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="275.83337" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect1491" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="286.41666" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect1530" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1532" - width="5.2916665" - height="5.2916665" - x="10.583333" - y="286.41666" /> - <rect - y="286.41666" - x="15.875" - height="5.2916665" - width="5.2916665" - id="rect1534" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1536" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="281.125" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1538" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="275.83334" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1574" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="254.66673" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1576" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="249.37508" /> - <rect - y="244.08342" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect1578" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1580" - width="5.2916665" - height="5.2916665" - x="10.583333" - y="244.08342" /> - <rect - y="244.08342" - x="15.875" - height="5.2916665" - width="5.2916665" - id="rect1582" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <g - id="g1621" - transform="translate(25.055168,-21.847031)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1615" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1619" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1617" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(25.055167,-16.555374)" - id="g1629"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1623" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1627"><tspan - sodipodi:role="line" - id="tspan1625" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1649" - transform="translate(25.055167,9.9028791)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1643" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1647" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1645" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(56.805164,9.9029236)" - id="g1657"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1651" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1655"><tspan - sodipodi:role="line" - id="tspan1653" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - </g> -</svg>
@@ -1,252 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="195" - height="195" - viewBox="0 0 51.593749 51.593751" - version="1.1" - id="svg8" - inkscape:version="0.92.3 (2405546, 2018-03-11)" - sodipodi:docname="outpost-brand.svg"> - <defs - id="defs2"> - <linearGradient - inkscape:collect="always" - id="linearGradient1398"> - <stop - style="stop-color:#63e500;stop-opacity:1" - offset="0" - id="stop1394" /> - <stop - id="stop1406" - offset="0.25" - style="stop-color:#a6e928;stop-opacity:0.74901962" /> - <stop - id="stop1402" - offset="0.5" - style="stop-color:#72ff8f;stop-opacity:0.49803922" /> - <stop - style="stop-color:#c4eddd;stop-opacity:0.63921571" - offset="0.75" - id="stop1404" /> - <stop - style="stop-color:#bfffff;stop-opacity:0.78494626" - offset="1" - id="stop1396" /> - </linearGradient> - <linearGradient - inkscape:collect="always" - xlink:href="#linearGradient1398" - id="linearGradient1400" - x1="-5.5511151e-17" - y1="245.40623" - x2="51.59375" - y2="297" - gradientUnits="userSpaceOnUse" /> - </defs> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="2" - inkscape:cx="42.490073" - inkscape:cy="108.35271" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - units="px" - inkscape:window-width="1366" - inkscape:window-height="739" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" /> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-245.40623)"> - <rect - style="opacity:1;fill:url(#linearGradient1400);fill-opacity:1;stroke:none;stroke-width:0.27449697;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1392" - width="51.59375" - height="51.59375" - x="-5.5511151e-17" - y="245.40623" /> - <rect - style="opacity:1;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:0.45617813;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1408" - width="13.229167" - height="13.229167" - x="19.182291" - y="264.58853" /> - <g - id="g847" - transform="translate(-1.7185197,1.9843955)"> - <path - d="m 32.098112,271.86455 -4.582718,2.64584 -4.582718,-2.64584 0,-5.29166 4.582718,-2.64584 4.582718,2.64584 z" - inkscape:randomized="0" - inkscape:rounded="1.04083e-17" - inkscape:flatsided="true" - sodipodi:arg2="1.0471976" - sodipodi:arg1="0.52359878" - sodipodi:r2="4.5827179" - sodipodi:r1="5.291667" - sodipodi:cy="269.21872" - sodipodi:cx="27.515394" - sodipodi:sides="6" - id="path821" - style="opacity:1;fill:#80ffff;fill-opacity:1;stroke:none;stroke-width:0.20531785;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - sodipodi:type="star" /> - <path - sodipodi:type="star" - style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.04927629;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="path823" - sodipodi:sides="6" - sodipodi:cx="26.03373" - sodipodi:cy="267.41956" - sodipodi:r1="1.2700001" - sodipodi:r2="1.0998524" - sodipodi:arg1="0.52359878" - sodipodi:arg2="1.0471976" - inkscape:flatsided="true" - inkscape:rounded="1.04083e-17" - inkscape:randomized="0" - d="m 27.133582,268.05456 -1.099852,0.635 -1.099853,-0.635 0,-1.27 1.099853,-0.635 1.099852,0.635 z" /> - </g> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:5.30142689px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.36146089" - x="1.1195526" - y="252.34299" - id="text827"><tspan - sodipodi:role="line" - x="1.1195526" - y="252.34299" - style="stroke-width:0.36146089" - id="tspan833">Early to late-game</tspan></text> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:5.25529337px;line-height:1.25;font-family:sans-serif;text-align:end;letter-spacing:0px;word-spacing:0px;text-anchor:end;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.35831544" - x="50.197937" - y="281.55966" - id="text837"><tspan - sodipodi:role="line" - id="tspan835" - x="50.197937" - y="281.55966" - style="text-align:end;text-anchor:end;stroke-width:0.35831544">• Gear</tspan><tspan - sodipodi:role="line" - x="50.197937" - y="288.12878" - style="text-align:end;text-anchor:end;stroke-width:0.35831544" - id="tspan839">• Materials</tspan><tspan - sodipodi:role="line" - x="50.197937" - y="294.69791" - style="text-align:end;text-anchor:end;stroke-width:0.35831544" - id="tspan841">• Gameplay tips</tspan></text> - <path - sodipodi:type="star" - style="opacity:1;fill:#999999;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="path849" - sodipodi:sides="6" - sodipodi:cx="12.083937" - sodipodi:cy="271.64813" - sodipodi:r1="4.1095676" - sodipodi:r2="3.55899" - sodipodi:arg1="1.0471976" - sodipodi:arg2="1.5707963" - inkscape:flatsided="true" - inkscape:rounded="1.04083e-17" - inkscape:randomized="0" - d="m 14.13872,275.20712 -4.109567,0 -2.054784,-3.55899 2.054784,-3.55899 4.109568,0 2.054783,3.55899 z" /> - <path - d="m 39.863412,262.76572 -4.109568,0 -2.054784,-3.55899 2.054784,-3.55899 4.109568,0 2.054784,3.55899 z" - inkscape:randomized="0" - inkscape:rounded="1.04083e-17" - inkscape:flatsided="true" - sodipodi:arg2="1.5707963" - sodipodi:arg1="1.0471976" - sodipodi:r2="3.55899" - sodipodi:r1="4.1095676" - sodipodi:cy="259.20674" - sodipodi:cx="37.808629" - sodipodi:sides="6" - id="path851" - style="opacity:1;fill:#999999;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - sodipodi:type="star" /> - <g - id="g864"> - <ellipse - ry="2.1047475" - rx="3.3675961" - cy="260.19028" - cx="24.789249" - id="path853" - style="opacity:1;fill:#a05a2c;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - id="rect855" - transform="matrix(0.26458333,0,0,0.26458333,0,245.40623)" - d="M 88.609375 37.419922 L 85.464844 38.599609 L 91.171875 53.828125 L 94.318359 52.648438 L 90.164062 41.568359 L 99.595703 45.033203 L 94.708984 58.070312 L 97.853516 59.25 L 103.5625 44.019531 L 103.51758 44.001953 L 103.875 43.027344 L 88.609375 37.419922 z " - style="opacity:1;fill:#c87137;fill-opacity:1;stroke:none;stroke-width:0.99999994;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - </g> - <g - id="g870" - transform="translate(-12.369271,0.13229167)"> - <ellipse - style="opacity:1;fill:#a05a2c;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="ellipse866" - cx="24.789249" - cy="260.19028" - rx="3.3675961" - ry="2.1047475" /> - <path - style="opacity:1;fill:#c87137;fill-opacity:1;stroke:none;stroke-width:0.99999994;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - d="m 88.609375,37.419922 -3.144531,1.179687 5.707031,15.228516 3.146484,-1.179687 -4.154297,-11.080079 9.431641,3.464844 -4.886719,13.037109 3.144532,1.179688 5.708984,-15.230469 -0.0449,-0.01758 0.35742,-0.974609 z" - transform="matrix(0.26458333,0,0,0.26458333,0,245.40623)" - id="path868" - inkscape:connector-curvature="0" /> - </g> - <g - transform="translate(14.022917,11.840104)" - id="g876"> - <ellipse - ry="2.1047475" - rx="3.3675961" - cy="260.19028" - cx="24.789249" - id="ellipse872" - style="opacity:1;fill:#a05a2c;fill-opacity:1;stroke:none;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <path - inkscape:connector-curvature="0" - id="path874" - transform="matrix(0.26458333,0,0,0.26458333,0,245.40623)" - d="m 88.609375,37.419922 -3.144531,1.179687 5.707031,15.228516 3.146484,-1.179687 -4.154297,-11.080079 9.431641,3.464844 -4.886719,13.037109 3.144532,1.179688 5.708984,-15.230469 -0.0449,-0.01758 0.35742,-0.974609 z" - style="opacity:1;fill:#c87137;fill-opacity:1;stroke:none;stroke-width:0.99999994;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - </g> - </g> -</svg>
@@ -1,2019 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="220" - height="220" - viewBox="0 0 58.208332 58.208334" - version="1.1" - id="svg8" - inkscape:version="0.92.3 (2405546, 2018-03-11)" - sodipodi:docname="outpost-good-pattern.svg"> - <defs - id="defs2" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="5.6568544" - inkscape:cx="29.205714" - inkscape:cy="182.75107" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - units="px" - inkscape:window-width="1366" - inkscape:window-height="739" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" /> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title /> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-238.79165)"> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect815" - width="5.2916665" - height="5.2916665" - x="0" - y="291.70831" /> - <rect - y="291.70831" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect817" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect819" - width="5.2916665" - height="5.2916665" - x="10.583333" - y="291.70831" /> - <rect - y="291.70831" - x="15.875" - height="5.2916665" - width="5.2916665" - id="rect821" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect823" - width="5.2916665" - height="5.2916665" - x="21.166666" - y="291.70831" /> - <rect - y="291.70831" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect825" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect827" - width="5.2916665" - height="5.2916665" - x="31.749998" - y="291.70831" /> - <rect - y="291.70831" - x="37.041664" - height="5.2916665" - width="5.2916665" - id="rect829" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect831" - width="5.2916665" - height="5.2916665" - x="42.333328" - y="291.70831" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect835" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="291.70831" /> - <rect - y="291.70831" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect837" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="286.41666" - x="0" - height="5.2916665" - width="5.2916665" - id="rect839" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="286.41666" - x="21.166666" - height="5.2916665" - width="5.2916665" - id="rect847" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect849" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="286.41666" /> - <rect - y="286.41666" - x="31.749998" - height="5.2916665" - width="5.2916665" - id="rect851" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect859" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="286.41666" /> - <rect - y="281.125" - x="0" - height="5.2916665" - width="5.2916665" - id="rect861" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect881" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="281.125" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect883" - width="5.2916665" - height="5.2916665" - x="0" - y="275.83334" /> - <rect - y="275.83334" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect903" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="270.54169" - x="0" - height="5.2916665" - width="5.2916665" - id="rect905" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect907" - width="5.2916665" - height="5.2916665" - x="5.2916665" - y="270.54169" /> - <rect - y="270.54169" - x="47.624996" - height="5.2916665" - width="5.2916665" - id="rect923" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect925" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="270.54169" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect927" - width="5.2916665" - height="5.2916665" - x="0" - y="265.25003" /> - <rect - y="265.25003" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect929" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect945" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="265.25003" /> - <rect - y="265.25003" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect947" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect949" - width="5.2916665" - height="5.2916665" - x="0" - y="259.95837" /> - <rect - y="259.95837" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect951" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect967" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="259.95837" /> - <rect - y="259.95837" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect969" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="254.66672" - x="0" - height="5.2916665" - width="5.2916665" - id="rect971" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect991" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="254.66672" /> - <rect - y="249.37506" - x="0" - height="5.2916665" - width="5.2916665" - id="rect993" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1013" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="249.37506" /> - <rect - y="244.0834" - x="0" - height="5.2916665" - width="5.2916665" - id="rect1015" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - y="244.0834" - x="21.166666" - height="5.2916665" - width="5.2916665" - id="rect1023" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1025" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="244.0834" /> - <rect - y="244.0834" - x="31.749998" - height="5.2916665" - width="5.2916665" - id="rect1027" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1035" - width="5.2916665" - height="5.2916665" - x="52.91666" - y="244.0834" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1037" - width="5.2916665" - height="5.2916665" - x="0" - y="238.79175" /> - <rect - y="238.79175" - x="5.2916665" - height="5.2916665" - width="5.2916665" - id="rect1039" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1041" - width="5.2916665" - height="5.2916665" - x="10.583333" - y="238.79175" /> - <rect - y="238.79175" - x="15.875" - height="5.2916665" - width="5.2916665" - id="rect1043" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1045" - width="5.2916665" - height="5.2916665" - x="21.166666" - y="238.79175" /> - <rect - y="238.79175" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect1047" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1049" - width="5.2916665" - height="5.2916665" - x="31.749998" - y="238.79175" /> - <rect - y="238.79175" - x="37.041664" - height="5.2916665" - width="5.2916665" - id="rect1051" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1053" - width="5.2916665" - height="5.2916665" - x="42.333328" - y="238.79175" /> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1055" - width="5.2916665" - height="5.2916665" - x="47.624996" - y="238.79175" /> - <rect - y="238.79175" - x="52.91666" - height="5.2916665" - width="5.2916665" - id="rect1057" - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <g - id="g1106"> - <rect - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect937" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="265.25003" /> - <text - id="text1101" - y="269.30844" - x="27.745592" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332;" - xml:space="preserve"><tspan - style="stroke-width:0.26458332;fill:#ffffff;" - y="269.30844" - x="27.745592" - id="tspan1099" - sodipodi:role="line">C</tspan></text> - </g> - <g - id="g1114" - transform="translate(-42.333332,26.458286)"> - <rect - y="265.25003" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect1108" - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="27.745592" - y="269.30844" - id="text1112"><tspan - sodipodi:role="line" - id="tspan1110" - x="27.745592" - y="269.30844" - style="fill:#ffffff;stroke-width:0.26458332">C</tspan></text> - </g> - <g - id="g1165" - transform="translate(35.6385,-11.263733)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1151" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1155" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1153" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1458" - transform="translate(-1.4031647,9.9028864)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1452" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1456" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1454" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1474" - transform="translate(-2.8063296,10.797967)"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1460" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1464" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1462" - sodipodi:role="line">B</tspan></text> - </g> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1680" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="275.83334" /> - <g - id="g1147" - transform="translate(40.930166,-11.263733)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1141" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1145" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1143" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(39.527002,-20.951965)" - id="g1415"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1409" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1413" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1411" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(35.6385,-16.555389)" - id="g1431"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1425" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1429"><tspan - sodipodi:role="line" - id="tspan1427" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1439" - transform="translate(35.6385,-21.847031)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1433" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1437" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1435" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(40.930166,-21.847031)" - id="g1447"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1441" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1445"><tspan - sodipodi:role="line" - id="tspan1443" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1455" - transform="translate(46.221832,-21.847031)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1449" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1453" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1451" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.221832,-16.555375)" - id="g1463"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1457" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1461"><tspan - sodipodi:role="line" - id="tspan1459" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(46.221833,-0.68042051)" - id="g1555"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1549" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1553"><tspan - sodipodi:role="line" - id="tspan1551" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(51.513499,-0.68042051)" - id="g1563"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1557" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1561"><tspan - sodipodi:role="line" - id="tspan1559" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1571" - transform="translate(50.110335,-10.368653)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1565" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1569"><tspan - sodipodi:role="line" - id="tspan1567" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1579" - transform="translate(46.221833,-5.9720765)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1573" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1577" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1575" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.221833,-11.263719)" - id="g1587"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1581" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1585"><tspan - sodipodi:role="line" - id="tspan1583" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1595" - transform="translate(51.513499,-11.263719)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1589" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1593" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1591" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(56.805165,-0.68040601)" - id="g1603"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1597" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1601"><tspan - sodipodi:role="line" - id="tspan1599" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1611" - transform="translate(56.805165,-5.9720625)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1605" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1609" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1607" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1639" - transform="translate(35.638501,9.9028786)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1633" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1637" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1635" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1647" - transform="translate(40.930167,9.9028786)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1641" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1645" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1643" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(39.527003,0.21464608)" - id="g1655"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1649" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1653" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1651" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(35.638501,4.6112226)" - id="g1663"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1657" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1661"><tspan - sodipodi:role="line" - id="tspan1659" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1671" - transform="translate(35.638501,-0.68041992)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1665" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1669" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1667" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(40.930167,-0.68041992)" - id="g1679"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1673" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1677"><tspan - sodipodi:role="line" - id="tspan1675" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1687" - transform="translate(46.221833,9.9028931)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1681" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1685" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1683" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.221833,4.6112366)" - id="g1695"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1689" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1693"><tspan - sodipodi:role="line" - id="tspan1691" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(56.805165,-11.263719)" - id="g1703"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1697" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1701"><tspan - sodipodi:role="line" - id="tspan1699" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(25.055168,-0.68041992)" - id="g1711"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1705" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1709"><tspan - sodipodi:role="line" - id="tspan1707" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(30.346834,-0.68041992)" - id="g1719"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1713" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1717"><tspan - sodipodi:role="line" - id="tspan1715" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1727" - transform="translate(28.94367,-10.368652)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1721" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1725"><tspan - sodipodi:role="line" - id="tspan1723" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1735" - transform="translate(25.055168,-5.9720759)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1729" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1733" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1731" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(25.055168,-11.263718)" - id="g1743"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1737" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1741"><tspan - sodipodi:role="line" - id="tspan1739" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1751" - transform="translate(30.346834,-11.263718)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1745" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1749" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1747" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(35.638501,-5.9720761)" - id="g1759"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1753" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1757"><tspan - sodipodi:role="line" - id="tspan1755" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(30.346833,4.6112222)" - id="g1806"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1800" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1804"><tspan - sodipodi:role="line" - id="tspan1802" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(30.346834,15.194535)" - id="g1814"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1808" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1812"><tspan - sodipodi:role="line" - id="tspan1810" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1822" - transform="translate(19.763501,15.194535)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1816" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1820" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1818" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1830" - transform="translate(25.055167,15.194535)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1824" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1828" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1826" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(23.652003,5.5063032)" - id="g1838"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1832" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1836" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1834" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(19.763501,9.9028793)" - id="g1846"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1840" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1844"><tspan - sodipodi:role="line" - id="tspan1842" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1854" - transform="translate(19.763501,4.6112372)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1848" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1852" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1850" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(25.055167,4.6112372)" - id="g1862"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1856" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1860"><tspan - sodipodi:role="line" - id="tspan1858" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1870" - transform="translate(30.346834,9.9028791)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1864" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1868" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1866" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1878" - transform="translate(62.096832,4.6112505)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1872" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1876" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1874" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1886" - transform="translate(62.096833,15.194563)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1880" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1884" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1882" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(51.5135,15.194563)" - id="g1894"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1888" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1892"><tspan - sodipodi:role="line" - id="tspan1890" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(56.805166,15.194563)" - id="g1902"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1896" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1900"><tspan - sodipodi:role="line" - id="tspan1898" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1910" - transform="translate(55.402002,5.5063315)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1904" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1908"><tspan - sodipodi:role="line" - id="tspan1906" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1918" - transform="translate(51.5135,9.9029076)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1912" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1916" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1914" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(51.5135,4.6112655)" - id="g1926"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1920" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1924"><tspan - sodipodi:role="line" - id="tspan1922" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1934" - transform="translate(56.805166,4.6112655)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1928" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1932" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1930" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(62.096833,9.9029074)" - id="g1942"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1936" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1940"><tspan - sodipodi:role="line" - id="tspan1938" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(62.096828,-27.138687)" - id="g1950"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1944" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1948"><tspan - sodipodi:role="line" - id="tspan1946" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(62.096829,-16.555375)" - id="g1958"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1952" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1956"><tspan - sodipodi:role="line" - id="tspan1954" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1966" - transform="translate(51.513496,-16.555375)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1960" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1964" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1962" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1974" - transform="translate(56.805162,-16.555375)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1968" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1972" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1970" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(55.401998,-26.243606)" - id="g1982"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1976" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1980" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1978" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(51.513496,-21.84703)" - id="g1990"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1984" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1988"><tspan - sodipodi:role="line" - id="tspan1986" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1998" - transform="translate(51.513496,-27.138672)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1992" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1996" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1994" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(56.805162,-27.138672)" - id="g2006"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect2000" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text2004"><tspan - sodipodi:role="line" - id="tspan2002" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g2014" - transform="translate(62.096829,-21.84703)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2008" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text2012" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan2010" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g2022" - transform="translate(30.346834,-27.138702)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2016" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text2020" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan2018" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g2030" - transform="translate(30.346835,-16.55539)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2024" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text2028" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan2026" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(19.763502,-16.55539)" - id="g2038"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect2032" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text2036"><tspan - sodipodi:role="line" - id="tspan2034" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(25.055168,-16.55539)" - id="g2046"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect2040" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text2044"><tspan - sodipodi:role="line" - id="tspan2042" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g2054" - transform="translate(23.652004,-26.243621)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect2048" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text2052"><tspan - sodipodi:role="line" - id="tspan2050" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g2062" - transform="translate(19.763502,-21.847045)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2056" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text2060" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan2058" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(19.763502,-27.138687)" - id="g2070"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect2064" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text2068"><tspan - sodipodi:role="line" - id="tspan2066" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g2078" - transform="translate(25.055168,-27.138687)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2072" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text2076" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan2074" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(30.346835,-21.847045)" - id="g2086"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect2080" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text2084"><tspan - sodipodi:role="line" - id="tspan2082" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <rect - style="opacity:1;fill:none;fill-opacity:1;stroke:#000000;stroke-width:0.26458332;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2101" - width="15.875" - height="15.875" - x="5.2916665" - y="244.0834" /> - </g> -</svg>
@@ -1,3873 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?> -<!-- Created with Inkscape (http://www.inkscape.org/) --> - -<svg - xmlns:dc="http://purl.org/dc/elements/1.1/" - xmlns:cc="http://creativecommons.org/ns#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:svg="http://www.w3.org/2000/svg" - xmlns="http://www.w3.org/2000/svg" - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" - width="260" - height="260" - viewBox="0 0 68.791665 68.791667" - version="1.1" - id="svg8" - inkscape:version="0.92.3 (2405546, 2018-03-11)" - sodipodi:docname="outpost-trap-pattern.svg"> - <defs - id="defs2" /> - <sodipodi:namedview - id="base" - pagecolor="#ffffff" - bordercolor="#666666" - borderopacity="1.0" - inkscape:pageopacity="0.0" - inkscape:pageshadow="2" - inkscape:zoom="1.4142136" - inkscape:cx="74.729176" - inkscape:cy="68.576247" - inkscape:document-units="px" - inkscape:current-layer="layer1" - showgrid="false" - units="px" - inkscape:window-width="1366" - inkscape:window-height="739" - inkscape:window-x="0" - inkscape:window-y="0" - inkscape:window-maximized="1" /> - <metadata - id="metadata5"> - <rdf:RDF> - <cc:Work - rdf:about=""> - <dc:format>image/svg+xml</dc:format> - <dc:type - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> - <dc:title></dc:title> - </cc:Work> - </rdf:RDF> - </metadata> - <g - inkscape:label="Layer 1" - inkscape:groupmode="layer" - id="layer1" - transform="translate(0,-228.20832)"> - <g - id="g1106" - transform="translate(5.2916728,-5.2916471)"> - <rect - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect937" - width="5.2916665" - height="5.2916665" - x="26.458332" - y="265.25003" /> - <text - id="text1101" - y="269.30844" - x="27.745592" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="269.30844" - x="27.745592" - id="tspan1099" - sodipodi:role="line">C</tspan></text> - </g> - <g - id="g1114" - transform="translate(-42.333332,20.658538)"> - <rect - y="265.25003" - x="26.458332" - height="5.2916665" - width="5.2916665" - id="rect1108" - style="opacity:1;fill:#008080;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="27.745592" - y="269.30844" - id="text1112"><tspan - sodipodi:role="line" - id="tspan1110" - x="27.745592" - y="269.30844" - style="fill:#ffffff;stroke-width:0.26458332">C</tspan></text> - </g> - <g - id="g1165" - transform="translate(40.930173,-16.55538)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1151" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1155" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1153" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1458" - transform="translate(-1.4031647,4.103138)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1452" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1456" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1454" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1474" - transform="translate(-2.8063296,4.9982186)"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1460" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1464" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1462" - sodipodi:role="line">B</tspan></text> - </g> - <rect - style="opacity:1;fill:#80ff80;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1680" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="270.0336" /> - <g - id="g1147" - transform="translate(46.221839,-16.55538)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1141" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1145" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1143" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(44.818675,-26.243612)" - id="g1415"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1409" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1413" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1411" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(40.930173,-21.847036)" - id="g1431"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1425" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1429"><tspan - sodipodi:role="line" - id="tspan1427" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1439" - transform="translate(40.930173,-27.138678)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1433" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1437" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1435" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.221839,-27.138678)" - id="g1447"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1441" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1445"><tspan - sodipodi:role="line" - id="tspan1443" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1455" - transform="translate(51.513505,-27.138678)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1449" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1453" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1451" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(51.513505,-21.847022)" - id="g1463"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1457" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1461"><tspan - sodipodi:role="line" - id="tspan1459" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(51.513506,-5.9720676)" - id="g1555"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1549" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1553"><tspan - sodipodi:role="line" - id="tspan1551" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(56.805172,-5.9720676)" - id="g1563"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1557" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1561"><tspan - sodipodi:role="line" - id="tspan1559" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1571" - transform="translate(55.402008,-15.6603)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1565" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1569"><tspan - sodipodi:role="line" - id="tspan1567" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1579" - transform="translate(51.513506,-11.263724)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1573" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1577" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1575" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(51.513506,-16.555366)" - id="g1587"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1581" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1585"><tspan - sodipodi:role="line" - id="tspan1583" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1595" - transform="translate(56.805172,-16.555366)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1589" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1593" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1591" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(62.096838,-5.9720531)" - id="g1603"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1597" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1601"><tspan - sodipodi:role="line" - id="tspan1599" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1611" - transform="translate(62.096838,-11.26371)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1605" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1609" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1607" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1639" - transform="translate(40.930174,4.6112315)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1633" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1637" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1635" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1647" - transform="translate(46.22184,4.6112315)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1641" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1645" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1643" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(44.818676,-5.077001)" - id="g1655"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1649" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1653" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1651" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(40.930174,-0.68042446)" - id="g1663"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1657" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1661"><tspan - sodipodi:role="line" - id="tspan1659" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1671" - transform="translate(40.930174,-5.972067)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1665" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1669" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1667" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.22184,-5.972067)" - id="g1679"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1673" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1677"><tspan - sodipodi:role="line" - id="tspan1675" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1687" - transform="translate(51.513506,4.611246)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1681" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1685" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1683" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(51.513506,-0.68041046)" - id="g1695"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1689" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1693"><tspan - sodipodi:role="line" - id="tspan1691" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(62.096838,-16.555366)" - id="g1703"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1697" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1701"><tspan - sodipodi:role="line" - id="tspan1699" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(30.346841,-5.972067)" - id="g1711"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1705" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1709"><tspan - sodipodi:role="line" - id="tspan1707" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(35.638507,-5.972067)" - id="g1719"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1713" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1717"><tspan - sodipodi:role="line" - id="tspan1715" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1727" - transform="translate(34.235343,-15.660299)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1721" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1725"><tspan - sodipodi:role="line" - id="tspan1723" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1735" - transform="translate(30.346841,-11.263723)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1729" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1733" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1731" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(30.346841,-16.555365)" - id="g1743"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1737" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1741"><tspan - sodipodi:role="line" - id="tspan1739" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1751" - transform="translate(35.638507,-16.555365)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1745" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1749" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1747" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(40.930174,-11.263723)" - id="g1759"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1753" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1757"><tspan - sodipodi:role="line" - id="tspan1755" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(30.34684,-0.68040986)" - id="g1862"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1856" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1860"><tspan - sodipodi:role="line" - id="tspan1858" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1870" - transform="translate(35.638507,4.611232)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1864" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1868" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1866" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1910" - transform="translate(55.402008,-5.0769864)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1904" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1908"><tspan - sodipodi:role="line" - id="tspan1906" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1918" - transform="translate(56.805173,4.6112605)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1912" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1916" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1914" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1934" - transform="translate(62.096839,-0.68038156)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1928" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1932" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1930" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1974" - transform="translate(62.096835,-21.847022)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1968" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1972" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1970" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(55.402008,-26.243598)" - id="g1982"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1976" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1980" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1978" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(56.805169,-27.138677)" - id="g1990"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1984" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1988"><tspan - sodipodi:role="line" - id="tspan1986" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g2054" - transform="translate(34.235343,-26.243611)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect2048" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text2052"><tspan - sodipodi:role="line" - id="tspan2050" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(35.638508,-27.138692)" - id="g2086"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect2080" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text2084"><tspan - sodipodi:role="line" - id="tspan2082" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1204" - transform="translate(34.235342,-5.0769858)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1198" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1202"><tspan - sodipodi:role="line" - id="tspan1200" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(56.805162,-16.555375)" - id="g1356" /> - <g - transform="translate(62.096835,-27.138678)" - id="g1383"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1377" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1381"><tspan - sodipodi:role="line" - id="tspan1379" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1621" - transform="translate(30.346841,-27.138678)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1615" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1619" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1617" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(30.34684,-21.847021)" - id="g1629"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1623" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1627"><tspan - sodipodi:role="line" - id="tspan1625" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1649" - transform="translate(30.34684,4.611232)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1643" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1647" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1645" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(62.096837,4.6112765)" - id="g1657"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1651" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1655"><tspan - sodipodi:role="line" - id="tspan1653" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1180" - transform="translate(44.818671,-36.826923)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1174" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1178"><tspan - sodipodi:role="line" - id="tspan1176" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1188" - transform="translate(55.402004,-36.826909)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1182" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1186"><tspan - sodipodi:role="line" - id="tspan1184" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(34.235339,-36.826922)" - id="g1196"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1190" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1194" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1192" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(44.818675,5.5063269)" - id="g1205"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1199" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1203" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1201" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(55.402008,5.5063409)" - id="g1213"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1207" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1211" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1209" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1221" - transform="translate(34.235343,5.5063279)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1215" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1219"><tspan - sodipodi:role="line" - id="tspan1217" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(65.985339,-15.660269)" - id="g1229"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1223" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1227" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1225" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(65.985339,-5.0769559)" - id="g1237"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1231" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1235" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1233" - sodipodi:role="line">B</tspan></text> - </g> - <g - transform="translate(65.985335,-36.826878)" - id="g1253"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1247" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1251" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1249" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1261" - transform="translate(65.985339,5.5063719)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1255" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1259"><tspan - sodipodi:role="line" - id="tspan1257" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1269" - transform="translate(23.652009,-15.660314)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1263" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1267"><tspan - sodipodi:role="line" - id="tspan1265" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - id="g1277" - transform="translate(23.652009,-5.0770004)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1271" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1275"><tspan - sodipodi:role="line" - id="tspan1273" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(23.652009,-26.243612)" - id="g1285"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1279" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1283" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1281" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1293" - transform="translate(23.652005,-36.826923)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1287" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1291"><tspan - sodipodi:role="line" - id="tspan1289" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(23.652009,5.5063269)" - id="g1301"> - <rect - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1295" - width="5.2916665" - height="5.2916665" - x="-13.06867" - y="275.61868" /> - <text - id="text1299" - y="279.67899" - x="-11.806991" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="279.67899" - x="-11.806991" - id="tspan1297" - sodipodi:role="line">B</tspan></text> - </g> - <g - id="g1355" - transform="translate(65.985337,-26.243597)"> - <rect - y="275.61868" - x="-13.06867" - height="5.2916665" - width="5.2916665" - id="rect1349" - style="opacity:1;fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-11.806991" - y="279.67899" - id="text1353"><tspan - sodipodi:role="line" - id="tspan1351" - x="-11.806991" - y="279.67899" - style="fill:#ffffff;stroke-width:0.26458332">B</tspan></text> - </g> - <g - transform="translate(40.93017,-37.722004)" - id="g1425"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1419" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1423"><tspan - sodipodi:role="line" - id="tspan1421" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1433" - transform="translate(46.221836,-37.722004)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1427" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1431" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1429" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(51.513502,-37.722004)" - id="g1441"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1435" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1439"><tspan - sodipodi:role="line" - id="tspan1437" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1449" - transform="translate(56.805166,-37.722003)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1443" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1447" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1445" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1457" - transform="translate(35.638505,-37.722018)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1451" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1455" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1453" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1465" - transform="translate(62.096832,-37.722004)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1459" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1463" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1461" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(30.346838,-37.722004)" - id="g1473"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1467" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1471"><tspan - sodipodi:role="line" - id="tspan1469" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(67.388499,-37.722004)" - id="g1481"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1475" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1479"><tspan - sodipodi:role="line" - id="tspan1477" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1489" - transform="translate(72.680166,-37.722004)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1483" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1487" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1485" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1497" - transform="translate(19.763503,-37.722004)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1491" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1495" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1493" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(25.05517,-37.722004)" - id="g1505"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1499" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1503"><tspan - sodipodi:role="line" - id="tspan1501" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1513" - transform="translate(19.763503,-11.263736)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1507" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1511" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1509" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(19.763503,-16.555392)" - id="g1521"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1515" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1519"><tspan - sodipodi:role="line" - id="tspan1517" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1529" - transform="translate(19.763503,-21.847034)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1523" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1527" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1525" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1537" - transform="translate(19.763502,-5.9720789)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1531" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1535" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1533" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(19.763503,-32.430347)" - id="g1545"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1539" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1543"><tspan - sodipodi:role="line" - id="tspan1541" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1553" - transform="translate(19.763502,-27.13869)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1547" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1551" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1549" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(19.763502,-0.68043706)" - id="g1561"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1555" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1559"><tspan - sodipodi:role="line" - id="tspan1557" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(19.763508,4.6112457)" - id="g1569"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1563" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1567"><tspan - sodipodi:role="line" - id="tspan1565" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(19.763507,9.9029029)" - id="g1577"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1571" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1575"><tspan - sodipodi:role="line" - id="tspan1573" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1585" - transform="translate(19.763507,15.194545)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1579" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1583" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1581" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1593" - transform="translate(40.930174,15.194545)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1587" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1591" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1589" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(46.22184,15.194545)" - id="g1601"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1595" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1599"><tspan - sodipodi:role="line" - id="tspan1597" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1609" - transform="translate(51.513506,15.194545)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1603" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1607" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1605" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(56.80517,15.194546)" - id="g1617"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1611" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1615"><tspan - sodipodi:role="line" - id="tspan1613" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(35.638509,15.194531)" - id="g1625"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1619" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1623"><tspan - sodipodi:role="line" - id="tspan1621" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(62.096836,15.194545)" - id="g1633"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1627" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1631"><tspan - sodipodi:role="line" - id="tspan1629" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1641" - transform="translate(30.346842,15.194545)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1635" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1639" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1637" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1650" - transform="translate(67.388503,15.194545)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1644" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1648" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1646" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(72.68017,15.194545)" - id="g1658"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1652" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1656"><tspan - sodipodi:role="line" - id="tspan1654" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1666" - transform="translate(25.055174,15.194545)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1660" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1664" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1662" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(72.680166,-11.263691)" - id="g1674"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1668" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1672"><tspan - sodipodi:role="line" - id="tspan1670" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1682" - transform="translate(72.680166,-16.555347)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1676" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1680" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1678" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(72.680166,-21.846989)" - id="g1690"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1684" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1688"><tspan - sodipodi:role="line" - id="tspan1686" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(72.680165,-5.972034)" - id="g1698"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1692" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1696"><tspan - sodipodi:role="line" - id="tspan1694" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1706" - transform="translate(72.680166,-32.430302)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1700" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1704" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1702" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(72.680165,-27.138645)" - id="g1714"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1708" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1712"><tspan - sodipodi:role="line" - id="tspan1710" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1722" - transform="translate(72.680165,-0.68039216)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1716" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1720" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1718" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1730" - transform="translate(72.680171,4.6112906)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1724" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1728" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1726" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1738" - transform="translate(72.68017,9.9029479)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1732" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1736" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1734" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1746" - transform="translate(67.388501,-5.9720201)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1740" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1744" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1742" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1754" - transform="translate(67.388501,-16.555333)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1748" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1752" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1750" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1762" - transform="translate(67.388498,-27.138645)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1756" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1760" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1758" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1770" - transform="translate(67.3885,4.6113095)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1764" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1768" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1766" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(25.055172,-5.9720656)" - id="g1778"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1772" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1776"><tspan - sodipodi:role="line" - id="tspan1774" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(25.055172,-16.555379)" - id="g1786"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1780" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1784"><tspan - sodipodi:role="line" - id="tspan1782" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(25.055169,-27.138691)" - id="g1794"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1788" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1792"><tspan - sodipodi:role="line" - id="tspan1790" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(25.055171,4.6112639)" - id="g1802"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1796" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1800"><tspan - sodipodi:role="line" - id="tspan1798" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(40.93017,-32.430333)" - id="g1810"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1804" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1808"><tspan - sodipodi:role="line" - id="tspan1806" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - transform="translate(51.513502,-32.430333)" - id="g1818"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1812" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1816"><tspan - sodipodi:role="line" - id="tspan1814" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1826" - transform="translate(62.096832,-32.430333)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1820" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1824" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1822" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(30.346838,-32.430333)" - id="g1834"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1828" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1832"><tspan - sodipodi:role="line" - id="tspan1830" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1842" - transform="translate(40.930171,9.9028899)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1836" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1840" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1838" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1850" - transform="translate(51.513503,9.9028899)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1844" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1848" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1846" - sodipodi:role="line">S</tspan></text> - </g> - <g - transform="translate(62.096833,9.9028899)" - id="g1858"> - <rect - y="271.22211" - x="-14.471835" - height="5.2916665" - width="5.2916665" - id="rect1852" - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-13.077519" - y="275.28052" - id="text1856"><tspan - sodipodi:role="line" - id="tspan1854" - x="-13.077519" - y="275.28052" - style="fill:#000000;stroke-width:0.26458332">S</tspan></text> - </g> - <g - id="g1866" - transform="translate(30.346839,9.9028899)"> - <rect - style="opacity:1;fill:#b3b3b3;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1860" - width="5.2916665" - height="5.2916665" - x="-14.471835" - y="271.22211" /> - <text - id="text1864" - y="275.28052" - x="-13.077519" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#000000;stroke-width:0.26458332" - y="275.28052" - x="-13.077519" - id="tspan1862" - sodipodi:role="line">S</tspan></text> - </g> - <g - id="g1882"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1868" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text1872" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan1870" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g1890" - transform="translate(15.875006,0.5080826)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect1884" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text1888"><tspan - sodipodi:role="line" - id="tspan1886" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(15.875006,-4.7835739)" - id="g1898"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1892" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text1896" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan1894" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(15.875001,-10.075243)" - id="g1906"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1900" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text1904" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan1902" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g1914" - transform="translate(15.875001,-15.366899)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect1908" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text1912"><tspan - sodipodi:role="line" - id="tspan1910" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(15.875007,-20.658529)" - id="g1922"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1916" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text1920" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan1918" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g1930" - transform="translate(15.875007,-25.950185)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect1924" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text1928"><tspan - sodipodi:role="line" - id="tspan1926" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - id="g1938" - transform="translate(15.875002,-31.241854)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect1932" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text1936"><tspan - sodipodi:role="line" - id="tspan1934" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(15.875002,-36.53351)" - id="g1946"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1940" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text1944" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan1942" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(15.875006,-41.82514)" - id="g1954"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1948" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text1952" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan1950" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(15.875001,-47.116809)" - id="g1962"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1956" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text1960" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan1958" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g1970" - transform="translate(15.875001,-52.408465)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect1964" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text1968"><tspan - sodipodi:role="line" - id="tspan1966" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - id="g1978" - transform="translate(15.875001,-57.700121)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect1972" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text1976"><tspan - sodipodi:role="line" - id="tspan1974" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(15.875001,-62.991777)" - id="g1986"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect1980" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text1984" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan1982" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g1994" - transform="translate(21.166669,-62.991779)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect1988" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text1992"><tspan - sodipodi:role="line" - id="tspan1990" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - id="g2002" - transform="translate(26.458337,-62.991779)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect1996" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2000"><tspan - sodipodi:role="line" - id="tspan1998" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(31.750005,-62.991781)" - id="g2010"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2004" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2008" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2006" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g2018" - transform="translate(37.041671,-62.991781)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2012" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2016"><tspan - sodipodi:role="line" - id="tspan2014" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(42.333339,-62.991783)" - id="g2026"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2020" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2024" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2022" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(47.625007,-62.991783)" - id="g2034"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2028" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2032" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2030" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g2042" - transform="translate(52.916675,-62.991785)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2036" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2040"><tspan - sodipodi:role="line" - id="tspan2038" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - id="g2050" - transform="translate(58.208329,-62.991777)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2044" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2048"><tspan - sodipodi:role="line" - id="tspan2046" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(63.499997,-62.991779)" - id="g2058"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2052" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2056" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2054" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(68.791665,-62.991779)" - id="g2066"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2060" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2064" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2062" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g2074" - transform="translate(74.083333,-62.991781)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2068" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2072"><tspan - sodipodi:role="line" - id="tspan2070" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(79.374999,-62.991781)" - id="g2082"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2076" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2080" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2078" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(79.375008,0.5081533)" - id="g2134"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2128" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2132" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2130" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g2142" - transform="translate(79.375008,-4.7835032)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2136" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2140"><tspan - sodipodi:role="line" - id="tspan2138" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - id="g2150" - transform="translate(79.375003,-10.075172)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2144" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2148"><tspan - sodipodi:role="line" - id="tspan2146" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(79.375003,-15.366828)" - id="g2158"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2152" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2156" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2154" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g2166" - transform="translate(79.375009,-20.658458)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2160" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2164"><tspan - sodipodi:role="line" - id="tspan2162" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(79.375009,-25.950114)" - id="g2174"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2168" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2172" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2170" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(79.375004,-31.241783)" - id="g2182"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2176" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2180" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2178" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g2190" - transform="translate(79.375004,-36.533439)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2184" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2188"><tspan - sodipodi:role="line" - id="tspan2186" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - id="g2198" - transform="translate(79.375008,-41.825069)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2192" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2196"><tspan - sodipodi:role="line" - id="tspan2194" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - id="g2206" - transform="translate(79.375003,-47.116738)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2200" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2204"><tspan - sodipodi:role="line" - id="tspan2202" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(79.375003,-52.408394)" - id="g2214"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2208" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2212" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2210" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(79.375003,-57.70005)" - id="g2222"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2216" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2220" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2218" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(21.166672,0.5080826)" - id="g2382"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2376" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2380" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2378" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(26.45834,0.5080826)" - id="g2390"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2384" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2388" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2386" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g2398" - transform="translate(31.750008,0.5080806)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2392" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2396"><tspan - sodipodi:role="line" - id="tspan2394" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(37.041674,0.5080806)" - id="g2406"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2400" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2404" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2402" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g2414" - transform="translate(42.333342,0.5080786)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2408" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2412"><tspan - sodipodi:role="line" - id="tspan2410" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - id="g2422" - transform="translate(47.62501,0.5080786)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2416" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2420"><tspan - sodipodi:role="line" - id="tspan2418" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(52.916678,0.5080766)" - id="g2430"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2424" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2428" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2426" - sodipodi:role="line">T</tspan></text> - </g> - <g - transform="translate(58.208332,0.5080846)" - id="g2438"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2432" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2436" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2434" - sodipodi:role="line">T</tspan></text> - </g> - <g - id="g2446" - transform="translate(63.5,0.5080826)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2440" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2444"><tspan - sodipodi:role="line" - id="tspan2442" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - id="g2454" - transform="translate(68.791668,0.5080826)"> - <rect - y="291.20023" - x="-15.875" - height="5.2916665" - width="5.2916665" - id="rect2448" - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> - <text - xml:space="preserve" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - x="-14.414366" - y="295.26053" - id="text2452"><tspan - sodipodi:role="line" - id="tspan2450" - x="-14.414366" - y="295.26053" - style="fill:#ffffff;stroke-width:0.26458332">T</tspan></text> - </g> - <g - transform="translate(74.083336,0.5080806)" - id="g2462"> - <rect - style="opacity:1;fill:#803300;fill-opacity:1;stroke:none;stroke-width:4.39278936;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" - id="rect2456" - width="5.2916665" - height="5.2916665" - x="-15.875" - y="291.20023" /> - <text - id="text2460" - y="295.26053" - x="-14.414366" - style="font-style:normal;font-weight:normal;font-size:3.88055563px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.26458332" - xml:space="preserve"><tspan - style="fill:#ffffff;stroke-width:0.26458332" - y="295.26053" - x="-14.414366" - id="tspan2458" - sodipodi:role="line">T</tspan></text> - </g> - </g> -</svg>
@@ -1,23 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>University posts</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="university_posts"><a class="anchor" href="#university_posts">¶</a>University posts</h1> -<div class="date-created-modified">Created 2020-07-03<br> -Modified 2020-10-03</div> -<p>During university, there were a few subjects where I had to write blog posts for (either as -evaluable tasks or just for fun). Currently, these are:</p> -<ul> -<li><a href="/blog/mdad">Data Mining and Data Warehousing</a></li> -<li><a href="/blog/ribw">Information Retrieval and Web Search</a></li> -</ul> -</main> -</body> -</html> -
@@ -1,85 +0,0 @@
-<!DOCTYPE html> -<html> -<head> -<meta charset="utf-8" /> -<meta name="viewport" content="width=device-width, initial-scale=1" /> -<title>WorldEdit Commands</title> -<link rel="stylesheet" href="../css/style.css"> -</head> -<body> -<main> -<h1 class="title" id="worldedit_commands"><a class="anchor" href="#worldedit_commands">¶</a>WorldEdit Commands</h1> -<div class="date-created-modified">2018-07-11</div> -<p><a href="https://dev.bukkit.org/projects/worldedit">WorldEdit</a> is an extremely powerful tool for modifying entire worlds within <a href="https://minecraft.net">Minecraft</a>, which can be used as either a mod for your single-player worlds or as a plugin for your <a href="https://getbukkit.org/">Bukkit</a> servers.</p> -<p>This command guide was written for Minecraft 1.12.1, version <a href="https://dev.bukkit.org/projects/worldedit/files/2460562">6.1.7.3</a>, but should work for newer versions too. All WorldEdit commands can be used with a double slash (<code>//</code>) so they don't conlict with built-in commands. This means you can get a list of all commands with <code>//help</code>. Let's explore different categories!</p> -<h2 id="movement"><a class="anchor" href="#movement">¶</a>Movement</h2> -<p>In order to edit a world properly you need to learn how to move in said world properly. There are several straightforward commands that let you move:</p> -<ul> -<li><code>//ascend</code> goes up one floor.</li> -<li><code>//descend</code> goes down one floor.</li> -<li><code>//thru</code> let's you pass through walls.</li> -<li><code>//jumpto</code> to go wherever you are looking.</li> -</ul> -<h2 id="information"><a class="anchor" href="#information">¶</a>Information</h2> -<p>Knowing your world properly is as important as knowing how to move within it, and will also let you change the information in said world if you need to.</p> -<ul> -<li><code>//biomelist</code> shows all known biomes.</li> -<li><code>//biomeinfo</code> shows the current biome.</li> -<li><code>//setbiome</code> lets you change the biome.</li> -</ul> -<h2 id="blocks"><a class="anchor" href="#blocks">¶</a>Blocks</h2> -<p>You can act over all blocks in a radius around you with quite a few commands. Some won't actually act over the entire range you specify, so 100 is often a good number.</p> -<h3 id="filling"><a class="anchor" href="#filling">¶</a>Filling</h3> -<p>You can fill pools with <code>//fill water 100</code> or caves with <code>//fillr water 100</code>, both of which act below your feet.</p> -<h3 id="fixing"><a class="anchor" href="#fixing">¶</a>Fixing</h3> -<p>If the water or lava is buggy use <code>//fixwater 100</code> or <code>//fixlava 100</code> respectively.</p> -<p>Some creeper removed the snow or the grass? Fear not, you can use <code>//snow 10</code> or <code>//grass 10</code>.</p> -<h3 id="emptying"><a class="anchor" href="#emptying">¶</a>Emptying</h3> -<p>You can empty a pool completely with <code>//drain 100</code>, remove the snow with <code>//thaw 10</code>, and remove fire with <code>//ex 10</code>.</p> -<h3 id="removing"><a class="anchor" href="#removing">¶</a>Removing</h3> -<p>You can remove blocks above and below you in some area with the <code>//removeabove N</code> and <code>//removebelow N</code>. You probably want to set a limit though, or you could fall off the world with <code>//removebelow 1 10</code> for radius and depth. You can also remove near blocks with <code>//removenear block 10</code>.</p> -<h3 id="shapes"><a class="anchor" href="#shapes">¶</a>Shapes</h3> -<p>Making a cylinder (or circle) can be done with through <code>//cyl stone 10</code>, a third argument for the height. The radius can be comma-separated to make a ellipses instead, such as <code>//cyl stone 5,10</code>.</p> -<p>Spheres are done with <code>//sphere stone 5</code>. This will build one right at your center, so you can raise it to be on your feet with <code>//sphere stone 5 yes</code>. Similar to cylinders, you can comma separate the radius <code>x,y,z</code>.</p> -<p>Pyramids can be done with <code>//pyramic stone 5</code>.</p> -<p>All these commands can be prefixed with "h" to make them hollow. For instance, <code>//hsphere stone 10</code>.</p> -<h2 id="regions"><a class="anchor" href="#regions">¶</a>Regions</h2> -<h3 id="basics"><a class="anchor" href="#basics">¶</a>Basics</h3> -<p>Operating over an entire region is really important, and the first thing you need to work comfortably with them is a tool to make selections. The default wooden-axe tool can be obtained with <code>//wand</code>, but you must be near the blocks to select. You can use a different tool, like a golden axe, to use as your "far wand" (wand usable over distance). Once you have one in your hand type <code>//farwand</code> to use it as your "far wand". You can select the two corners of your region with left and right click. If you have selected the wrong tool, use <code>//none</code> to clear it.</p> -<p>If there are no blocks but you want to use your current position as a corner, use <code>//pos1</code> or 2.</p> -<p>If you made a region too small, you can enlarge it with <code>//expand 10 up</code>, or <code>//expand vert</code> for the entire vertical range, etc., or make it smaller with <code>//contract 10 up</code> etc., or <code>//inset</code> it to contract in both directions. You can use short-names for the cardinal directions (NSEW).</p> -<p>Finally, if you want to move your selection, you can <code>//shift 1 north</code> it to wherever you need.</p> -<h3 id="information_2"><a class="anchor" href="#information_2">¶</a>Information</h3> -<p>You can get the <code>//size</code> of the selection or even <code>//count torch</code> in some area. If you want to count all blocks, get their distribution <code>//distr</code>.</p> -<h3 id="filling_2"><a class="anchor" href="#filling_2">¶</a>Filling</h3> -<p>With a region selected, you can <code>//set</code> it to be any block! For instance, you can use <code>//set air</code> to clear it entirely. You can use more than one block evenly by separting them with a comma <code>//set stone,dirt</code>, or with a custom chance <code>//set 20%stone,80%dirt</code>.</p> -<p>You can use <code>//replace from to</code> instead if you don't want to override all blocks in your selection.</p> -<p>You can make an hollow set with <code>//faces</code>, and if you just want the walls, use <code>//walls</code>.</p> -<h3 id="cleaning"><a class="anchor" href="#cleaning">¶</a>Cleaning</h3> -<p>If someone destroyed your wonderful snow landscape, fear not, you can use <code>//overlay snow</code> over it (although for this you actually have <code>//snow N</code> and its opposite <code>//thaw</code>).</p> -<p>If you set some rough area, you can always <code>//smooth</code> it, even more than one time with <code>//smooth 3</code>. You can get your dirt and stone back with <code>//naturalize</code> and put some plants with <code>//flora</code> or <code>//forest</code>, both of which support a density or even the type for the trees. If you already have the dirt use <code>//green</code> instead. If you want some pumpkins, with <code>//pumpkins</code>.</p> -<h3 id="moving"><a class="anchor" href="#moving">¶</a>Moving</h3> -<p>You can repeat an entire selection many times by stacking them with <code>//stack N DIR</code>. This is extremely useful to make things like corridors or elevators. For instance, you can make a small section of the corridor, select it entirely, and then repeat it 10 times with <code>//stack 10 north</code>. Or you can make the elevator and then <code>//stack 10 up</code>. If you need to also copy the air use <code>//stackair</code>.</p> -<p>Finally, if you don't need to repeat it and simply move it just a bit towards the right direction, you can use <code>//move N</code>. The default direction is "me" (towards where you are facing) but you can set one with <code>//move 1 up</code> for example.</p> -<h3 id="selecting"><a class="anchor" href="#selecting">¶</a>Selecting</h3> -<p>You can not only select cuboids. You can also select different shapes, or even just points:</p> -<ul> -<li><code>//sel cuboid</code> is the default.</li> -<li><code>//sel extend</code> expands the default.</li> -<li><code>//sel poly</code> first point with left click and right click to add new points.</li> -<li><code>//sel ellipsoid</code> first point to select the center and right click to select the different radius.</li> -<li><code>//sel sphere</code> first point to select the center and one more right click for the radius.</li> -<li><code>//sel cyl</code> for cylinders, first click being the center.</li> -<li><code>//sel convex</code> for convex shapes. This one is extremely useful for <code>//curve</code>.</li> -</ul> -<h2 id="brushes"><a class="anchor" href="#brushes">¶</a>Brushes</h2> -<p>Brushes are a way to paint in 3D without first bothering about making a selection, and there are spherical and cylinder brushes with e.g. <code>//brush sphere stone 2</code>, or the shorter form <code>//br s stone</code>. For cylinder, one must use <code>cyl</code> instead <code>sphere</code>.</p> -<p>There also exists a brush to smooth the terrain which can be enabled on the current item with <code>//br smooth</code>, which can be used with right-click like any other brush.</p> -<h2 id="clipboard"><a class="anchor" href="#clipboard">¶</a>Clipboard</h2> -<p>Finally, you can copy and cut things around like you would do with normal text with <code>//copy</code> and <code>//cut</code>. The copy is issued from wherever you issue the command, so when you use <code>//paste</code>, remember that if you were 4 blocks apart when copying, it will be 4 blocks apart when pasting.</p> -<p>The contents of the clipboard can be flipped to wherever you are looking via <code>//flip</code>, and can be rotated via the <code>//rotate 90</code> command (in degrees).</p> -<p>To remove the copy use <code>//clearclipboard</code>.</p> -</main> -</body> -</html> -
@@ -0,0 +1,13 @@
+# primary config +base_url = "https://lonami.dev" +title = "Lonami's Site" +default_language = "en" +minify_html = true + +# blog +generate_feed = true +feed_limit = 10 +taxonomies = [ + { name = "category" }, + { name = "tags" }, +]
@@ -1,10 +1,11 @@
-```meta -created: 2018-06-13 -updated: 2020-10-03 -``` - -An Introduction to Asyncio -========================== ++++ +title = "An Introduction to Asyncio" +date = 2018-06-13 +updated = 2020-10-03 +[taxonomies] +category = ["sw"] +tags = ["python", "asyncio"] ++++ Index -----@@ -437,4 +438,4 @@
Extra Material -------------- -If you want to understand how `asyncio` works under the hood, I recommend you to watch this hour-long talk [Get to grips with asyncio in Python 3](https://youtu.be/M-UcUs7IMIM) by Robert Smallshire. In the video, they will explain the differences between concurrency and parallelism, along with others concepts, and how to implement your own `asyncio` "scheduler" from scratch. +If you want to understand how `asyncio` works under the hood, I recommend you to watch this hour-long talk [Get to grips with asyncio in Python 3](https://youtu.be/M-UcUs7IMIM) by Robert Smallshire. In the video, they will explain the differences between concurrency and parallelism, along with others concepts, and how to implement your own `asyncio` "scheduler" from scratch.
@@ -0,0 +1,6 @@
++++ +title = "My Blog" +sort_by = "date" +template = "blog.html" +page_template = "blog-page.html" ++++
@@ -0,0 +1,180 @@
++++ +title = "Graphs" +date = 2017-06-02 +updated = 2017-06-02 +[taxonomies] +category = ["algos"] +tags = ["graphs"] ++++ + +<noscript>There are a few things which won't render unless you enable +JavaScript. No tracking, I promise!</noscript> + +> Don't know English? [Read the Spanish version instead](spanish.html). + +Let's imagine we have 5 bus stations, which we'll denote by ((s_i)): + +<div class="matrix"> + ' s_1 ' s_2 ' s_3 ' s_4 ' s_5 \\ +s_1 ' ' V ' ' ' \\ +s_2 ' V ' ' ' ' V \\ +s_3 ' ' ' ' V ' \\ +s_4 ' ' V ' V ' ' \\ +s_5 ' V ' ' ' V ' +</div> + +This is known as a "table of direct interconnections". +The ((V)) represent connected paths. For instance, on the first +row starting at ((s_1)), reaching the ((V)), +allows us to turn up to get to ((s_2)). + +We can see the above table represented in a more graphical way: + +![Table 1 as a Graph](example1.svg) + +This type of graph is called, well, a graph, and it's a directed +graph (or digraph), since the direction on which the arrows go does +matter. It's made up of vertices, joined together by edges (also known as +lines or directed arcs). + +One can walk from a node to another through different paths. For +example, ((s_4 $rightarrow s_2 $rightarrow s_5)) is an indirect path of order +two, because we must use two edges to go from ((s_4)) to +((s_5)). + +Let's now represent its adjacency matrix called A which represents the +same table, but uses 1 instead V to represent +a connection: + +<div class="matrix"> + 0 ' 1 ' 0 ' 0 ' 0 \\ + 1 ' 0 ' 0 ' 0 ' 1 \\ + 0 ' 0 ' 0 ' 1 ' 0 \\ + 0 ' 1 ' 1 ' 0 ' 0 \\ + 1 ' 0 ' 0 ' 1 ' 0 +</div> + +This way we can see how the ((a_{2,1})) element represents the +connection ((s_2 $rightarrow s_1)), and the ((a_{5,1})) element the +((s_5 $rightarrow s_1)) connection, etc. + +In general, ((a_{i,j})) represents a connection from + ((s_i $rightarrow s_j))as long as ((a_{i,j}$geq 1)). + +Working with matrices allows us to have a computable representation of +any graph, which is very useful. + +<hr /> + +Graphs have a lot of interesting properties besides being representable +by a computer. What would happen if, for instance, we calculated +((A^2))? We obtain the following matrix: + +<div class="matrix"> +1 ' 0 ' 0 ' 0 ' 1 \\ +1 ' 1 ' 0 ' 1 ' 0 \\ +0 ' 1 ' 1 ' 0 ' 0 \\ +1 ' 0 ' 0 ' 1 ' 1 \\ +0 ' 2 ' 1 ' 0 ' 0 +</div> + +We can interpret this as the paths of order two. +But what does the element ((a_{5,2}=2)) represent? It indicates +the amount of possible ways to go from ((s_5 $rightarrow s_i $rightarrow s_2)). + +One can manually multiply the involved row and column to determine which +element is the one we need to pass through, this way we have the row +(([1 0 0 1 0])) and the column (([1 0 0 1 0])) (on +vertical). The elements ((s_i$geq 1)) are ((s_1)) and +((s_4)). This is, we can go from ((s_5)) to +((s_2)) via ((s_5 $rightarrow s_1 $rightarrow s_2)) or via +((s_5 $rightarrow s_4 $rightarrow s_2)): +<img src="example2.svg" /> + +It's important to note that graphs to not consider self-connections, this +is, ((s_i $rightarrow s_i)) is not allowed; neither we work with multigraphs +here (those which allow multiple connections, for instance, an arbitrary +number ((n)) of times). + +<div class="matrix"> +1 ' 1 ' 0 ' 1 ' 0 \\ +1 ' 2 ' \textbf{1} ' 0 ' 1 \\ +1 ' 0 ' 0 ' 1 ' 1 \\ +1 ' 2 ' 1 ' 1 ' 0 \\ +2 ' 0 ' 0 ' 1 ' 2 +</div> + +We can see how the first ((1)) just appeared on the element + ((a_{2,3})), which means that the shortest path to it is at least +of order three. + +<hr /> + +A graph is said to be strongly connected as long as there is a +way to reach all its elements. + +We can see all the available paths until now by simply adding up all the +direct and indirect ways to reach a node, so for now, we can add +((A+A^2+A^3)) in such a way that: + +<div class="matrix"> +2 ' 2 ' 0 ' 1 ' 1 \\ +3 ' 3 ' 1 ' 1 ' 3 \\ +1 ' 1 ' 1 ' 2 ' 1 \\ +2 ' 3 ' 2 ' 2 ' 1 \\ +3 ' 2 ' 1 ' 2 ' 2 +</div> + +There isn't a connection between ((s_1)) and ((s_3)) yet. +If we were to calculate ((A^4)): + +<div class="matrix"> +1 ' 2 ' 1 ' ' \\ + ' ' ' ' \\ + ' ' ' ' \\ + ' ' ' ' \\ + ' ' ' ' +</div> + +We don't need to calculate anymore. We now know that the graph is +strongly connected! + +<hr /> + +Congratulations! You've completed this tiny introduction to graphs. +Now you can play around with them and design your own connections. + +Hold the left mouse button on the above area and drag it down to create +a new node, or drag a node to this area to delete it. + +To create new connections, hold the right mouse button on the node you +want to start with, and drag it to the node you want it to be connected to. + +To delete the connections coming from a specific node, middle click it. + +<table><tr><td style="width:100%;"> + <button onclick="resetConnections()">Reset connections</button> + <button onclick="clearNodes()">Clear all the nodes</button> + <br /> + <br /> + <label for="matrixOrder">Show matrix of order:</label> + <input id="matrixOrder" type="number" min="1" max="5" + value="1" oninput="updateOrder()"> + <br /> + <label for="matrixAccum">Show accumulated matrix</label> + <input id="matrixAccum" type="checkbox" onchange="updateOrder()"> + <br /> + <br /> + <div> + <table id="matrixTable"></table> + </div> +</td><td> + <canvas id="canvas" width="400" height="400" oncontextmenu="return false;"> + Looks like your browser won't let you see this fancy example :( + </canvas> + <br /> +</td></tr></table> + +<script src="tinyparser.js"></script> +<script src="enhancements.js"></script> +<script src="graphs.js"></script>
@@ -0,0 +1,64 @@
+const mathify = content => { + let result = '' + let close = null; + let symbol = null; + Array.from(content).forEach(c => { + if (symbol !== null) { + if (c === ' ') { + if (symbol === 'rightarrow') { + result += '→' + } else if (symbol === 'geq') { + result += '≥' + } else { + result += '?' + } + symbol = null; + result += ' ' + } else { + symbol += c + } + } else if (c == '$') { + symbol = '' + } else if (c === '*') { + result += '×' + } else if (c === '^') { + result += '<sup>' + close = '</sup>' + } else if (c === '_') { + result += '<sub>'; + close = '</sub>'; + } else if (c === ' ' || c == '\n') { + if (close !== null) { + result += close + close = null + } + result += ' ' + } else { + result += c + } + }) + if (close !== null) { + result += close; + } + return `<em class="math">${result.trim()}</em>` +} + +const parse_maths = html => html.replaceAll(/\(\(.+?\)\)/g, match => + mathify(match.slice(2, -2)) +); + +Array.from(document.getElementsByClassName('matrix')).forEach(matrix => { + let result = '<table>' + matrix.innerHTML.trim().split('\\').forEach(row => { + result += '<tr>' + row.trim().split("'").forEach(elem => { + result += `<td>${mathify(elem.trim())}</td>` + }) + result += '</tr>' + }) + matrix.innerHTML = result +}) + +Array.from(document.getElementsByTagName('p')).forEach(paragraph => { + paragraph.innerHTML = parse_maths(paragraph.innerHTML) +})
@@ -0,0 +1,9 @@
++++ +title = "Data Mining and Data Warehousing" +sort_by = "date" +template = "blog.html" +page_template = "blog-page.html" +[taxonomies] +category = ["algos"] +tags = ["series", "bigdata", "databases"] ++++
@@ -0,0 +1,9 @@
++++ +title = "Information Retrieval and Web Search" +sort_by = "date" +template = "blog.html" +page_template = "blog-page.html" +[taxonomies] +category = ["algos"] +tags = ["series", "bigdata", "databases"] ++++
@@ -0,0 +1,14 @@
++++ +title = "Data Mining, Warehousing and Information Retrieval" +date = 2020-07-03 +[taxonomies] +category = ["algos"] +tags = ["series", "bigdata", "databases"] ++++ + +During university, there were a few subjects where I had to write blog posts for (either as evaluable tasks or just for fun). I thought it was really fun and I wanted to preserve that work here, with the hopes it's interesting to someone. + +The posts series were auto-generated from the original HTML files and manually anonymized later. + +* [Data Mining and Data Warehousing](/blog/mdad) +* [Information Retrieval and Web Search](/blog/ribw)
@@ -1,9 +1,10 @@
-```meta -created: 2019-01-12 -``` - -Breaking Risk of Rain -===================== ++++ +title = "Breaking Risk of Rain" +date = 2019-01-12 +[taxonomies] +category = ["games"] +tags = ["tips"] ++++ [Risk of Rain](https://riskofraingame.com/) is a fun little game you can spend a lot of hours on. It's incredibly challenging for new players, and fun once you have learnt the basics. This blog will go through what I've learnt and how to play the game correctly.@@ -81,4 +82,4 @@
Closing Words ------------- -You can now beat the game in Monsoon solo with any character. Have fun! And be careful with the sadly common crashes. +You can now beat the game in Monsoon solo with any character. Have fun! And be careful with the sadly common crashes.
@@ -1,9 +1,10 @@
-```meta -created: 2019-06-19 -``` - -Python ctypes and Windows -========================= ++++ +title = "Python ctypes and Windows" +date = 2019-06-19 +[taxonomies] +category = ["sw"] +tags = ["python", "ffi", "windows"] ++++ [Python](https://www.python.org/)'s [`ctypes`](https://docs.python.org/3/library/ctypes.html) is quite a nice library to easily load and invoke C methods available in already-compiled [`.dll` files](https://en.wikipedia.org/wiki/Dynamic-link_library) without any additional dependencies. And I *love* depending on as little as possible.@@ -373,4 +374,4 @@ If you see a function definition like `Function(void)`, that's C's way of saying it takes no parameters, so just call it as `Function()`.
Make sure to pass all parameters, even if they seem optional they probably still want a `NULL` at least, and of course, read the documentation well. Some methods have certain pre-conditions. -Have fun hacking! +Have fun hacking!
@@ -1,10 +1,8 @@
-```meta -created: 2016-06-21 -updated: 2016-06-21 -``` - -Apuntes de bachillerato de Filosofía -==================================== ++++ +title = "Apuntes de bachillerato de Filosofía" +date = 2016-06-21 +updated = 2016-06-21 ++++ Hay asignaturas que merecen la pena, y una de ellas es la filosofía. De verdad. Aprendes un montón de cosas y abres tu mente, comparas muchos puntos de vista y te das cuenta de grandes cosas. Por eso, quiero compartir mis apuntes con todo aquel interesado.@@ -19,4 +17,4 @@ * [Filosofía - Primer trimestre](filo_trimestre1.odt)
* [Filosofía - Segundo trimestre](filo_trimestre2.odt) * [Filosofía - Tercer trimestre](filo_trimestre3.odt) -Nota: Hay algunas palabras un tanto soez. ¡Añaden emoción y no son para tanto, a lo sumo dos o tres! :) +Nota: Hay algunas palabras un tanto soez. ¡Añaden emoción y no son para tanto, a lo sumo dos o tres! :)
@@ -0,0 +1,6 @@
++++ +title = "My Golb" +sort_by = "date" +template = "golb.html" +page_template = "blog-page.html" ++++
@@ -1,178 +0,0 @@
-```meta -created: 2017-06-02 -updated: 2017-06-02 -``` - -<script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script> -<noscript>There are a few things which won't render unless you enable -JavaScript. No tracking, I promise!</noscript> - -Graphs -====== - -> Don't know English? [Read the Spanish version instead](spanish.html). - - <p>Let's imagine we have 5 bus stations, which we'll denote by \(s_i\):</p> - - \(\begin{bmatrix} - & s_1 & s_2 & s_3 & s_4 & s_5 \\ - s_1 & & V & & & \\ - s_2 & V & & & & V \\ - s_3 & & & & V & \\ - s_4 & & V & V & & \\ - s_5 & V & & & V & - \end{bmatrix}\) - - <p>This is known as a <i>"table of direct interconnections"</i>.</p> - <p>The \(V\) represent connected paths. For instance, on the first - row starting at \(s_1\), reaching the \(V\), - allows us to turn up to get to \(s_2\).</p> - - <p>We can see the above table represented in a more graphical way:</p> - <img src="example1.svg" /> - <p>This type of graph is called, well, a <i>graph</i>, and it's a directed - graph (or <i>digraph</i>), since the direction on which the arrows go does - matter. It's made up of vertices, joined together by edges (also known as - lines or directed <b>arcs</b>).</p> - - <p>One can walk from a node to another through different <b>paths</b>. For - example, \(s_4 \rightarrow s_2 \rightarrow s_5\) is an indirect path of <b>order</b> - two, because we must use two edges to go from \(s_4\) to - \(s_5\).</p> - - <p>Let's now represent its adjacency matrix called A which represents the - same table, but uses <mark>1</mark> instead </mark>V</mark> to represent - a connection:</p> - - \(\begin{bmatrix} - 0 & 1 & 0 & 0 & 0 \\ - 1 & 0 & 0 & 0 & 1 \\ - 0 & 0 & 0 & 1 & 0 \\ - 0 & 1 & 1 & 0 & 0 \\ - 1 & 0 & 0 & 1 & 0 -\end{bmatrix}\) - - <p>This way we can see how the \(a_{2,1}\) element represents the - connection \(s_2 \rightarrow s_1\), and the \(a_{5,1}\) element the - \(s_5 \rightarrow s_1\) connection, etc.</p> - - <p>In general, \(a_{i,j}\) represents a connection from - \(s_i \rightarrow s_j\)as long as \(a_{i,j}\geq 1\).</p> - - <p>Working with matrices allows us to have a computable representation of - any graph, which is very useful.</p> - - <hr /> - - <p>Graphs have a lot of interesting properties besides being representable - by a computer. What would happen if, for instance, we calculated - \(A^2\)? We obtain the following matrix:</p> - - \(\begin{bmatrix} - 1 & 0 & 0 & 0 & 1 \\ - 1 & 1 & 0 & 1 & 0 \\ - 0 & 1 & 1 & 0 & 0 \\ - 1 & 0 & 0 & 1 & 1 \\ - 0 & 2 & 1 & 0 & 0 - \end{bmatrix}\) - - <p>We can interpret this as the paths of order <b>two</b>.</p> - <p>But what does the element \(a_{5,2}=2\) represent? It indicates - the amount of possible ways to go from \(s_5 \rightarrow s_i \rightarrow s_2\).</p> - - <p>One can manually multiply the involved row and column to determine which - element is the one we need to pass through, this way we have the row - \([1 0 0 1 0]\) and the column \([1 0 0 1 0]\) (on - vertical). The elements \(s_i\geq 1\) are \(s_1\) and - \(s_4\). This is, we can go from \(s_5\) to - \(s_2\) via \(s_5 \rightarrow s_1 \rightarrow s_2\) or via - \(s_5 \rightarrow s_4 \rightarrow s_2\):</p> - <img src="example2.svg" /> - - <p>It's important to note that graphs to not consider self-connections, this - is, \(s_i \rightarrow s_i\) is not allowed; neither we work with multigraphs - here (those which allow multiple connections, for instance, an arbitrary - number \(n\) of times).</p> - - \(\begin{bmatrix} - 1 & 1 & 0 & 1 & 0 \\ - 1 & 2 & \textbf{1} & 0 & 1 \\ - 1 & 0 & 0 & 1 & 1 \\ - 1 & 2 & 1 & 1 & 0 \\ - 2 & 0 & 0 & 1 & 2 - \end{bmatrix}\) - - <p>We can see how the first \(1\) just appeared on the element - \(a_{2,3}\), which means that the shortest path to it is at least - of order three.</mark> - - <hr /> - - <p>A graph is said to be <b>strongly connected</b> as long as there is a - way to reach <i>all</i> its elements.</p> - - <p>We can see all the available paths until now by simply adding up all the - direct and indirect ways to reach a node, so for now, we can add - \(A+A^2+A^3\) in such a way that:</p> - - \(\begin{bmatrix} - 2 & 2 & 0 & 1 & 1 \\ - 3 & 3 & 1 & 1 & 3 \\ - 1 & 1 & 1 & 2 & 1 \\ - 2 & 3 & 2 & 2 & 1 \\ - 3 & 2 & 1 & 2 & 2 - \end{bmatrix}\) - - <p>There isn't a connection between \(s_1\) and \(s_3\) yet. - If we were to calculate \(A^4\):</p> - - \(\begin{bmatrix} - 1 & 2 & 1 & & \\ - & & & & \\ - & & & & \\ - & & & & \\ - & & & & - \end{bmatrix}\) - - <p>We don't need to calculate anymore. We now know that the graph is - strongly connected!</p> - - <hr /> - - <p>Congratulations! You've completed this tiny introduction to graphs. - Now you can play around with them and design your own connections.</p> - - <p>Hold the left mouse button on the above area and drag it down to create - a new node, or drag a node to this area to delete it.</p> - - <p>To create new connections, hold the right mouse button on the node you - want to start with, and drag it to the node you want it to be connected to.</p> - - <p>To delete the connections coming from a specific node, middle click it.</p> - - <table><tr><td style="width:100%;"> - <button onclick="resetConnections()">Reset connections</button> - <button onclick="clearNodes()">Clear all the nodes</button> - <br /> - <br /> - <label for="matrixOrder">Show matrix of order:</label> - <input id="matrixOrder" type="number" min="1" max="5" - value="1" oninput="updateOrder()"> - <br /> - <label for="matrixAccum">Show accumulated matrix</label> - <input id="matrixAccum" type="checkbox" onchange="updateOrder()"> - <br /> - <br /> - <div class="matrix"> - <table id="matrixTable"></table> - </div> - </td><td> - <canvas id="canvas" width="400" height="400" oncontextmenu="return false;"> - Looks like your browser won't let you see this fancy example :( - </canvas> - <br /> - </td></tr></table> - -<script src="tinyparser.js"></script> -<script src="enhancements.js"></script> -<script src="graphs.js"></script>
@@ -1,63 +0,0 @@
-// Custom tiny parser for csv tables. They're more comfortable. -var tables = document.getElementsByClassName('csv'); -for (var i = 0; i != tables.length; ++i) { - var lines = tables[i].innerHTML.split('\n'); - var result = ['<table>']; - var line = null; - for (var j = 0; j != lines.length; ++j) { - line = lines[j].trim(); - if (line) { - result.push('<tr><td>'); - result.push(lines[j].replace(/\s*;\s*/g, '</td><td>')); - result.push('</td></tr>'); - } - } - result.push('</table>'); - tables[i].innerHTML = result.join(''); -} - -// Custom tiny math parser. I like writing parsers. -// 'x^2n ' becomes 'x<sup>2n</sup> ' -// 'x_5n ' becomes 'x<sub>5n</sub> ' -// 'a * b' becomes 'a × b' -// ' ' becomes ' ' -function mathify(element) { - var c = null; - var closeOnSpace = null; - var content = element.innerHTML.split(''); - for (var j = 0; j != content.length; ++j) { - c = content[j]; - if (c == '*') { - content[j] = '×'; - } else if (c == '^') { - content[j] = '<sup>'; - closeOnSpace = '</sup>'; - } else if (c == '_') { - content[j] = '<sub>'; - closeOnSpace = '</sub>'; - } else if (c == ' ') { - if (closeOnSpace == null) { - content[j] = ' '; - } else { - content[j] = closeOnSpace + ' '; - closeOnSpace = null; - } - } else if (c == '\n' && closeOnSpace != null) { - content[j] = closeOnSpace + '\n'; - closeOnSpace = null; - } - } - if (closeOnSpace != null) { - content.push(closeOnSpace.trim()); - } - - element.innerHTML = content.join(''); -} - -var maths = document.getElementsByTagName('mark'); -for (var i = 0; i != maths.length; ++i) - mathify(maths[i]); - -var maths = document.getElementsByClassName('math'); -for (var i = 0; i != maths.length; ++i) - mathify(maths[i]);
@@ -1,24 +0,0 @@
-```meta -created: 2016-03-04 -updated: 2018-01-31 -``` - -Blog de Lonami -============== - -Hola | Hi. - -Choose your language below: - -* [Leer entradas en español](#bienvenido-al-blog) -* [Read English entries](#welcome-to-the-blog) - -Bienvenido al blog ------------------- - -Bienvenido al mejor (o no) blog del mundo. En esta sección publicaré de manera muy puntual algunas entradas que espero resulten interesantes para el gran público. - -Welcome to the blog -------------------- - -Welcome to the best (or not) blog in the entire world. On this blog I will occasionally post new entries which I find interesting.
@@ -1,10 +1,11 @@
-```meta -created: 2017-05-13 -updated: 2019-02-16 -``` - -Installing NixOS -================ ++++ +title = "Installing NixOS" +date = 2017-05-13 +updated = 2019-02-16 +[taxonomies] +category = ["sw"] +tags = ["os", "nixos"] ++++ Update ------@@ -67,4 +68,4 @@ |`|[| |
|+|]| | |¡|=| | |-|/| | -|ñ|;| | +|ñ|;| |
@@ -1,10 +1,11 @@
-```meta -created: 2019-02-15 -updated: 2019-02-16 -``` - -Installing NixOS, Take 2 -======================== ++++ +title = "Installing NixOS, Take 2" +date = 2019-02-15 +updated = 2019-02-16 +[taxonomies] +category = ["sw"] +tags = ["os", "nixos"] ++++ This is my second take at installing NixOS, after a while being frustrated with Arch Linux and the fact that a few kernel upgrades ago, the system crashed randomly from time to time. `journalctl` did not have any helpful hints and I thought reinstalling could be worthwhile anyway.@@ -139,4 +140,4 @@ Regarding terminal issues with `nvim` printing the literal escape character, I was told off for not having checked what my `$TERM` was. I hadn't really looked into it much myself, just complained about it here, so sorry for being annoying about that. A quick search in the `nixpkgs` repository lets us find [neovim/default.nix](https://github.com/NixOS/nixpkgs/blob/release-18.09/pkgs/applications/editors/neovim/default.nix), with version 0.3.1. Looking at [Neovim's main repository](https://github.com/neovim/neovim) we can see that this is a bit outdated, but that is fine.
If only I had bothered to look at [Neovim's wiki](https://github.com/neovim/neovim/wiki/FAQ#nvim-shows-weird-symbols-2-q-when-changing-modes), (which they found through [Neovim's GitHub issues](https://github.com/neovim/neovim/issues/7749)) I would've seen that some terminals just don't support the program properly. The solution is, of course, to use a different terminal emulator with better support or to disable the `guicursor` in Neovim's config. -This is a pretty good life lesson. 30 seconds of searching, maybe two minutes and a half for also checking XFCE issues, are often more than enough to troubleshoot your issues. The internet is a big place and more people have surely came across the problem before, so make sure to look online first. In my defense I'll say that it didn't bother me so much so I didn't bother looking for that soon either. +This is a pretty good life lesson. 30 seconds of searching, maybe two minutes and a half for also checking XFCE issues, are often more than enough to troubleshoot your issues. The internet is a big place and more people have surely came across the problem before, so make sure to look online first. In my defense I'll say that it didn't bother me so much so I didn't bother looking for that soon either.
@@ -1,10 +1,8 @@
-```meta -created: 2016-02-24 -updated: 2016-03-05 -``` - -Inteligencia artificial -======================= ++++ +title = "Inteligencia artificial" +date = 2016-02-24 +updated = 2016-03-05 ++++ Índice ------@@ -24,7 +22,7 @@ ------
La inteligencia artificial es una rama apasionante que tiene su origen en la **informática** y se basa en el concepto de conseguir *emular*[^1] al cerebro humano, mediante el desarrollo un programa que sea capaz de **aprender y mejorar por sí sólo** (normalmente bajo algún tipo de supervisión) -Fue un concepto acuñado por *John McCarthy* en un congreso de informática de 1956, y desde entonces este campo ha crecido de manera exponencial con unas buenas previsiones de futuro.</p> +Fue un concepto acuñado por *John McCarthy* en un congreso de informática de 1956, y desde entonces este campo ha crecido de manera exponencial con unas buenas previsiones de futuro. ![Progreso humano en la inteligencia artificial](human_progress_edge.svg)@@ -36,7 +34,7 @@ ---------------
La inteligencia artificial no consiste en escribir unas pautas fijas y finitas al igual que hacen la gran mayoría de programas, en los cuales introduces unos datos y producen siempre la misma salida, una salida predecible, programada e invariable, que además, tiene sus límites, ya que si introduces datos para los que la aplicación no está programada, esta aplicación no será capaz de manejarlos. No los entenderá y no producirá ningún resultado. -La inteligencia artificial consiste en dar un paso **más allá**. Una inteligencia artificial *entrenada* es capaz de manejar datos para los cuales no ha sido programada de manera explícita[^2]</sup> +La inteligencia artificial consiste en dar un paso **más allá**. Una inteligencia artificial *entrenada* es capaz de manejar datos para los cuales no ha sido programada de manera explícita[^2] Límites@@ -52,7 +50,7 @@ *Crecimiento en la velocidad de procesado de los dispositivos. [Fuente](http://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1)*
Comparado con las neuronas de un cerebro humano (cuya velocidad[^3] máxima oscilan entre los 200Hz), los procesadores de hoy en día (mucho más lentos que los que tendremos dentro de algunos años) ya tienen una velocidad superior a los 2Ghz, es decir, **10 millones de veces** más rápidos que las neuronas. Y la comunicación interna del cerebro, que oscila entre los 120m/s, queda infinitamente distante de la velocidad de los ordenadores que se comunican de manera óptica a la **velocidad de la luz**. -Además de todo esto, la capacidad de los dispositivos puede ser **ampliada**, a diferencia del cerebro que tiene un tamaño ya determinado. Y, por último, un procesador puede estar **trabajando sin parar** nunca, sin cansarse.</p> +Además de todo esto, la capacidad de los dispositivos puede ser **ampliada**, a diferencia del cerebro que tiene un tamaño ya determinado. Y, por último, un procesador puede estar **trabajando sin parar** nunca, sin cansarse. <!-- Boston dynamics artificial intelligence put some more examples, like Google or predicting models or big data, ocr -->@@ -140,4 +138,4 @@ Fuentes
------- * [Evolución de la inteligencia artificial - Wait but why](http://waitbutwhy.com/2015/01/artificial-intelligence-revolution-1) -* [*Machine learning* - Wikipedia](https://en.wikipedia.org/wiki/Machine_learning) +* [*Machine learning* - Wikipedia](https://en.wikipedia.org/wiki/Machine_learning)
@@ -1,8 +1,7 @@
-```meta -created: 2020-08-24 -``` - -# Making a Difference ++++ +title = "Making a Difference" +date = 2020-08-24 ++++ When I've thought about what "making a difference" means, I've always seen it as having to do something at very large scales. Something that changes everyone's lives. But I've realized that it doesn't need the case.@@ -22,4 +21,4 @@ I'm thinking about all the people who I've met online and have had overall a healthy relation, sharing interesting things between each other, playtime, thoughts, and other various lessons.
What I'm trying to get across is that you may be more impactful than you think you really are. And even if people don't say it, some are extremely thankful of your interactions with them. You can see this post as a sort of a "call for action" to be more thankful to the people that have affected you in important ways. If people take things for granted because they Just Work, the person who made those things should be proud of this achievement. -Thanks to all of them, to everyone who has shared good moments with me, and to all the people who enjoy the things I make. +Thanks to all of them, to everyone who has shared good moments with me, and to all the people who enjoy the things I make.
@@ -1,8 +1,8 @@
-```meta -title: A practical example with Hadoop -published: 2020-03-30T01:00:00+00:00 -updated: 2020-04-18T13:25:43+00:00 -``` ++++ +title = "A practical example with Hadoop" +date = 2020-03-30T01:00:00+00:00 +updated = 2020-04-18T13:25:43+00:00 ++++ In our [previous Hadoop post](/blog/mdad/introduction-to-hadoop-and-its-mapreduce/), we learnt what it is, how it originated, and how it works, from a theoretical standpoint. Here we will instead focus on a more practical example with Hadoop.@@ -155,9 +155,9 @@
``` $ ls results part-r-00000 _SUCCESS -$ cat results/part-r-00000 +$ cat results/part-r-00000 1901 317 1902 244 ``` -It worked! Now this example was obviously tiny, but hopefully enough to demonstrate how to get the basics running on real world data. +It worked! Now this example was obviously tiny, but hopefully enough to demonstrate how to get the basics running on real world data.
@@ -1,8 +1,8 @@
-```meta -title: Big Data -published: 2020-02-25T01:00:30+00:00 -updated: 2020-03-18T09:51:17+00:00 -``` ++++ +title = "Big Data" +date = 2020-02-25T01:00:30+00:00 +updated = 2020-03-18T09:51:17+00:00 ++++ Big Data sounds like a buzzword you may be hearing everywhere, but it’s actually here to stay!@@ -67,4 +67,4 @@ * ¿Qué es Big Data? – [https://www.ibm.com/developerworks/ssa/local/im/que-es-big-data/](https://www.ibm.com/developerworks/ssa/local/im/que-es-big-data/)
* The Four V’s of Big Data – [https://www.ibmbigdatahub.com/infographic/four-vs-big-data](https://www.ibmbigdatahub.com/infographic/four-vs-big-data) * Big data – [https://en.wikipedia.org/wiki/Big_data](https://en.wikipedia.org/wiki/Big_data) * Las 5 V’s del Big Data – [https://www.quanticsolutions.es/big-data/las-5-vs-del-big-data](https://www.quanticsolutions.es/big-data/las-5-vs-del-big-data) -* Las 7 V del Big data: Características más importantes – [https://www.iic.uam.es/innovacion/big-data-caracteristicas-mas-importantes-7-v/](https://www.iic.uam.es/innovacion/big-data-caracteristicas-mas-importantes-7-v/#viabilidad) +* Las 7 V del Big data: Características más importantes – [https://www.iic.uam.es/innovacion/big-data-caracteristicas-mas-importantes-7-v/](https://www.iic.uam.es/innovacion/big-data-caracteristicas-mas-importantes-7-v/#viabilidad)
@@ -1,8 +1,8 @@
-```meta -title: Cassandra: Introducción -published: 2020-03-05T00:00:33+00:00 -updated: 2020-03-30T09:28:07+00:00 -``` ++++ +title = "Cassandra: Introducción" +date = 2020-03-05T00:00:33+00:00 +updated = 2020-03-30T09:28:07+00:00 ++++ ![](1200px-Cassandra_logo.png)@@ -98,4 +98,4 @@
* [Apache Cassandra Architecture Fundamentals – The Distributed SQL Blog](https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/) * [Apache Cassandra](https://cassandra.apache.org/) * [How Apache Cassandra™ Balances Consistency, Availability, and Performance – Datasax](https://www.datastax.com/blog/2019/05/how-apache-cassandratm-balances-consistency-availability-and-performance) -* [Apache Cassandra Architecture Fundamentals](https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/) +* [Apache Cassandra Architecture Fundamentals](https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/)
@@ -1,8 +1,8 @@
-```meta -title: Cassandra: Operaciones Básicas y Arquitectura -published: 2020-03-05T02:00:41+00:00 -updated: 2020-03-20T11:36:18+00:00 -``` ++++ +title = "Cassandra: Operaciones Básicas y Arquitectura" +date = 2020-03-05T02:00:41+00:00 +updated = 2020-03-20T11:36:18+00:00 ++++ Este es el segundo post en la serie sobre Cassandra, con una breve descripción de las operaciones básicas (tales como inserción, recuperación e indexado), y ejecución por completo junto con el modelo de datos y arquitectura. Otros posts en esta serie:@@ -113,4 +113,4 @@ * [tutorialspoint – Creating a Keyspace using Cqlsh](https://www.tutorialspoint.com/cassandra/cassandra_create_keyspace.htm)
* [tutorialspoint – Cassandra – CQL Datatypes](https://www.tutorialspoint.com/cassandra/cassandra_cql_datatypes.htm) * [tutorialspoint – Cassandra – Create Table](https://www.tutorialspoint.com/cassandra/cassandra_create_table.htm) * [Data Flair – Cassandra Crud Operation – Create, Update, Read & Delete](https://data-flair.training/blogs/cassandra-crud-operation/) -* [Cassandra Documentation – Secondary Indexes](https://cassandra.apache.org/doc/latest/cql/indexes.html) +* [Cassandra Documentation – Secondary Indexes](https://cassandra.apache.org/doc/latest/cql/indexes.html)
@@ -1,8 +1,8 @@
-```meta -title: Data Warehousing and OLAP -published: 2020-03-23T01:00:00+00:00 -updated: 2020-04-01T09:45:41+00:00 -``` ++++ +title = "Data Warehousing and OLAP" +date = 2020-03-23T01:00:00+00:00 +updated = 2020-04-01T09:45:41+00:00 ++++ Business intelligence (BI) refers to systems used to gain insights from data, traditionally taken from relational databases and being used to build a data warehouse. Performance and scalability are key aspects of BI systems.@@ -59,4 +59,4 @@ * [Chapter 1 – Professional Microsoft SQL Server 2012 Analysis Services with MDX and DAX (Harinath et al., 2012)](https://media.wiley.com/product_data/excerpt/03/11181011/1118101103-157.pdf)
* [YouTube – Data Mining in SQL Server Analysis Services](https://youtu.be/m_DzhW-2pWI) * Almacenes de Datos y Procesamiento Analítico On-Line (Félix R.) * [YouTube – What are Dimensions and Measures?](https://youtu.be/qkJOace9FZg) -* [Data Lake vs Data Warehouse vs Data Mart](https://www.holistics.io/blog/data-lake-vs-data-warehouse-vs-data-mart/) +* [Data Lake vs Data Warehouse vs Data Mart](https://www.holistics.io/blog/data-lake-vs-data-warehouse-vs-data-mart/)
@@ -1,8 +1,8 @@
-```meta -title: Developing a Python application for Cassandra -published: 2020-03-23T00:00:00+00:00 -updated: 2020-04-16T07:52:26+00:00 -``` ++++ +title = "Developing a Python application for Cassandra" +date = 2020-03-23T00:00:00+00:00 +updated = 2020-04-16T07:52:26+00:00 ++++ _**Warning**: this post is, in fact, a shameless self-plug to my own library. If you continue reading, you accept that you are okay with this. Otherwise, please close the tab, shut down your computer, and set it on fire.__(Also, that was a joke. Please don’t do that.)_@@ -99,7 +99,7 @@
``` def save_users(session, users): insert_stmt = session.prepare( - 'INSERT INTO users (id, first_name, last_name, username) ' + 'INSERT INTO users (id, first_name, last_name, username) ' 'VALUES (?, ?, ?, ?)') for user in users:@@ -215,4 +215,4 @@
## References * [DataStax Python Driver for Apache Cassandra – Getting Started](https://docs.datastax.com/en/developer/python-driver/3.22/getting_started/) -* [Telethon’s Documentation](https://docs.telethon.dev/en/latest/) +* [Telethon’s Documentation](https://docs.telethon.dev/en/latest/)
@@ -1,8 +1,8 @@
-```meta -title: Privado: Final NoSQL evaluation -published: 2020-05-13T00:00:00+00:00 -updated: 2020-05-14T08:31:06+00:00 -``` ++++ +title = "Privado: Final NoSQL evaluation" +date = 2020-05-13T00:00:00+00:00 +updated = 2020-05-14T08:31:06+00:00 ++++ This evaluation is a bit different to my [previous one](/blog/mdad/nosql-evaluation/) because this time I have been tasked to evaluate student `a(i - 2)`, and because I am `i = 11` that happens to be `a(9) =` a classmate.@@ -22,4 +22,4 @@ The post continues listing and briefly explaining all the tools used and what they are for, including commands to execute.
At last, they list what files their project uses, what they do, and contains a showcase of images which lets the reader know what the application does. -All in all, in my opinion, it’s clear they have put work into this entry and I have not noticed any major flaws, so they deserve the highest grade. +All in all, in my opinion, it’s clear they have put work into this entry and I have not noticed any major flaws, so they deserve the highest grade.
@@ -1,7 +0,0 @@
-# Data Mining and Data Warehousing - -During 2020 at university, this subject ("Minería de Datos y Almacenes de Datos") had us write -blog posts as assignments. I think it would be really fun and I wanted to preserve that work -here, with the hopes it's interesting to someone. - -The posts were auto-generated from the original HTML files and manually anonymized later.
@@ -1,8 +1,8 @@
-```meta -title: Introduction to Hadoop and its MapReduce -published: 2020-03-30T00:00:00+00:00 -updated: 2020-04-01T11:01:46+00:00 -``` ++++ +title = "Introduction to Hadoop and its MapReduce" +date = 2020-04-01T01:00:00+00:00 +updated = 2020-04-03T08:43:44+00:00 ++++ Hadoop is an open-source, free, Java-based programming framework that helps processing large datasets in a distributed environment and the problems that arise when trying to harness the knowledge from BigData, capable of running on thousands of nodes and dealing with petabytes of data. It is based on Google File System (GFS) and originated from the work on the Nutch open-source project on search engines.@@ -73,4 +73,4 @@ * [YouTube – Video Post #2: Hadoop para torpes (I)-¿Qué es y para qué sirve?](https://youtu.be/j8ehT1_G5AY?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi)
* [Video Post #3: Hadoop para torpes (II)-¿Cómo funciona? HDFS y MapReduce](https://youtu.be/NQ8mjVPCDvk?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi) * [Apache Hadoop Releases](https://hadoop.apache.org/old/releases.html) * [Video Post #4: Hadoop para torpes (III y fin)- Ecosistema y distribuciones](https://youtu.be/20qWx2KYqYg?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi) -* [Chapter 2 – Hadoop: The Definitive Guide, Fourth Edition](http://www.hadoopbook.com/) ([pdf,](http://grut-computing.com/HadoopBook.pdf)[code](http://www.hadoopbook.com/code.html)) +* [Chapter 2 – Hadoop: The Definitive Guide, Fourth Edition](http://www.hadoopbook.com/) ([pdf,](http://grut-computing.com/HadoopBook.pdf)[code](http://www.hadoopbook.com/code.html))
@@ -1,8 +1,8 @@
-```meta -title: Introduction to NoSQL -published: 2020-02-25T02:00:30+00:00 -updated: 2020-03-18T09:51:33+00:00 -``` ++++ +title = "Introduction to NoSQL" +date = 2020-02-25T01:00:15+00:00 +updated = 2020-03-18T09:38:23+00:00 ++++ This post will primarly focus on the talk held in the [GOTO 2012 conference: Introduction to NoSQL by Martin Fowler](https://youtu.be/qI_g07C_Q5I). It can be seen as an informal, summarized transcript of the talk@@ -33,13 +33,11 @@ * **Cluster-friendly** (this was the original spark)
* Open-source (until now, generally) * 21st century web culture * Schema-less (easier integration or conjugation of several models, structure aggregation) - These databases use different data models to those used by the relational model. However, it is possible to identify 4 broad chunks (some may say 3, or even 2!): * **Key-value store**. With a certain key, you obtain the value corresponding to it. It knows nothing else, nor does it care. We say the data is opaque. * **Document-based**. It stores an entire mass of documents with complex structure, normally through the use of JSON (XML has been left behind). Then, you can ask for certain fields, structures, or portions. We say the data is transparent. * **Column-family**. There is a «row key», and within it we store multiple «column families» (columns that fit together, our aggregate). We access by row-key and column-family name. - All of these kind of serve to store documents without any _explicit_ schema. Just shove in anything! This gives a lot of flexibility and ease of migration, except… that’s not really true. There’s an _implicit_ schema when querying. For example, a query where we may do `anOrder['price'] * anOrder['quantity']` is assuming that `anOrder` has both a `price` and a `quantity`, and that both of these can be multiplied together. «Schema-less» is a fuzzy term.@@ -82,4 +80,4 @@
## Further reading * [The future is: ~~NoSQL Databases~~ Polyglot Persistence](https://www.martinfowler.com/articles/nosql-intro-original.pdf) -* [NoSQL Databases: An Overview](https://www.thoughtworks.com/insights/blog/nosql-databases-overview) +* [NoSQL Databases: An Overview](https://www.thoughtworks.com/insights/blog/nosql-databases-overview)
@@ -1,8 +1,8 @@
-```meta -title: Mining of Massive Datasets -published: 2020-03-16T01:00:00+00:00 -updated: 2020-03-28T19:09:44+00:00 -``` ++++ +title = "Mining of Massive Datasets" +date = 2020-03-16T01:00:00+00:00 +updated = 2020-03-28T19:09:44+00:00 ++++ In this post we will talk about the Chapter 1 of the book Mining of Massive Datasets Leskovec, J. et al., available online, and I will summarize and share my thoughts on it.@@ -24,4 +24,4 @@ Hash functions are also frequently used, because they can turn hash keys into a bucket number (the index of the bucket where this hash key belongs). They «randomize» and spread the universe of keys into a smaller number of buckets, useful for storage and access.
An index is an efficient structure to query for values given a key, and can be built with hash functions and buckets. -Having all of these is important when analysing documents when doing data mining, because otherwise it would take far too long. +Having all of these is important when analysing documents when doing data mining, because otherwise it would take far too long.
@@ -1,8 +1,8 @@
-```meta -title: MongoDB: Introducción -published: 2020-03-05T01:00:18+00:00 -updated: 2020-03-20T10:31:10+00:00 -``` ++++ +title = "MongoDB: Introducción" +date = 2020-03-05T01:00:18+00:00 +updated = 2020-03-20T10:31:10+00:00 ++++ Este es el primer post en la serie sobre Mongo, en el cuál introduciremos dicha bases de datos NoSQL y veremos sus características e instalación.@@ -27,16 +27,16 @@ ```
{ "_id" : ObjectId("52f602d787945c344bb4bda5"), "name" : "Tyrion", - "hobbies" : [ - "books", - "girls", + "hobbies" : [ + "books", + "girls", "wine" ], - "friends" : [ + "friends" : [ { "name" : "Bronn", "ocuppation" : "sellsword" - }, + }, { "name" : "Shae", "ocuppation" : "handmaiden"@@ -66,7 +66,7 @@ En cuanto a la arquitectura, podríamos decir que divide en tres partes: las bases de datos, las colecciones y los documentos (que contienen los campos de cada entrada).
* **Base de datos**: cada una de las bases de datos tiene un conjunto propio de archivos en el sistema de archivos con diversas bases de datos existentes en un solo servidor. * **Colección**: un conjunto de documentos de base de datos. El equivalente RDBMS de la colección es una tabla. Toda colección existe dentro de una única base de datos. -* **Documento**: un conjunto de pares clave/valor. Los documentos están asociados con esquemas dinámicos. La ventaja de tener esquemas dinámicos es que el documento en una sola colección no tiene que tener la misma estructura o campos. +* **Documento**: un conjunto de pares clave/valor. Los documentos están asociados con esquemas dinámicos. La ventaja de tener esquemas dinámicos es que el documento en una sola colección no tiene que tener la misma estructura o campos. ## Arista dentro del Teorema CAP@@ -74,7 +74,7 @@ ![](t73Q1t-HXfWij-Q1o5AYEnO39Kz2oyLLCdQz6lWQQPaSQWamlDMjmptAn97h.png)
MongoDB es CP por defecto, es decir, garantiza consistencia y tolerancia a particiones (fallos). Pero también podemos configurar el nivel de consistencia, eligiendo el número de nodos a los que se replicarán los datos. O podemos configurar si se pueden leer datos de los nodos secundarios (en MongoDB solo hay un servidor principal, que es el único que acepta inserciones o modificaciones). Si permitimos leer de un nodo secundario mediante la replicación, sacrificamos consistencia, pero ganamos disponibilidad. -## Descarga e instalación +## Descarga e instalación ### Windows@@ -82,7 +82,7 @@ Descargar el archivo desde [https://www.mongodb.com/download-center#production](https://www.mongodb.com/download-center#production)
1. Doble clic en el archivo `.msi` 2. El instalador de Windows lo guía a través del proceso de instalación. -Si elige la opción de instalación personalizada, puede especificar un directorio de instalación. +Si elige la opción de instalación personalizada, puede especificar un directorio de instalación. MongoDB no tiene ninguna otra dependencia del sistema. Puede instalar y ejecutar MongoDB desde cualquier carpeta que elija. 3. Ejecutar el `.exe` que hemos instalado.@@ -132,4 +132,4 @@ * [Características MONGO DB](https://es.slideshare.net/maxfontana90/caractersticas-mongo-db)
* [Qué es MongoDB y características](https://openwebinars.net/blog/que-es-mongodb) * [MongoDB. Qué es, cómo funciona y cuándo podemos usarlo (o no)](https://www.genbeta.com/desarrollo/mongodb-que-es-como-funciona-y-cuando-podemos-usarlo-o-no) * [MongoDB Documentation](https://docs.mongodb.com/) -* [NoSQL: Clasificación de las bases de datos según el teorema CAP](https://www.genbeta.com/desarrollo/nosql-clasificacion-de-las-bases-de-datos-segun-el-teorema-cap) +* [NoSQL: Clasificación de las bases de datos según el teorema CAP](https://www.genbeta.com/desarrollo/nosql-clasificacion-de-las-bases-de-datos-segun-el-teorema-cap)
@@ -1,8 +1,8 @@
-```meta -title: MongoDB: Operaciones Básicas y Arquitectura -published: 2020-03-05T03:00:53+00:00 -updated: 2020-03-20T11:42:15+00:00 -``` ++++ +title = "MongoDB: Operaciones Básicas y Arquitectura" +date = 2020-03-05T03:00:53+00:00 +updated = 2020-03-20T11:42:15+00:00 ++++ Este es el segundo post en la serie sobre MongoDB, con una breve descripción de las operaciones básicas (tales como inserción, recuperación e indexado), y ejecución por completo junto con el modelo de datos y arquitectura.@@ -105,7 +105,7 @@ true
</code> , permite una colección limitada. Una colección limitada es una colección - de tamaño fijo que sobrescribe automáticamente sus entradas más + de tamaño fijo que sobrescribe automáticamente sus entradas más antiguas cuando alcanza su tamaño máximo. Si especifica <code> true@@ -547,4 +547,4 @@
### Referencias * Manual MongoDB. (n.d.). [https://docs.mongodb.com/manual/](https://docs.mongodb.com/manual/) -* MongoDB Tutorial – Tutorialspoint. (n.d.). – [https://www.tutorialspoint.com/mongodb/index.htm](https://www.tutorialspoint.com/mongodb/index.htm) +* MongoDB Tutorial – Tutorialspoint. (n.d.). – [https://www.tutorialspoint.com/mongodb/index.htm](https://www.tutorialspoint.com/mongodb/index.htm)
@@ -1,8 +1,8 @@
-```meta -title: Privado: NoSQL evaluation -published: 2020-03-16T00:00:35+00:00 -updated: 2020-03-28T19:22:31+00:00 -``` ++++ +title = "Privado: NoSQL evaluation" +date = 2020-03-16T00:00:35+00:00 +updated = 2020-03-28T19:22:31+00:00 ++++ This evaluation is based on the criteria for the first delivery described by Trabajos en grupo sobre Bases de Datos NoSQL.@@ -25,4 +25,4 @@ **Grading: A.**
The post evaluated is Bases de datos NoSQL – Neo4j – Primera entrega. -Well-written post, although a bit smaller than Classmate’s, but that’s not really an issue. It still talks about everything it should talk and includes photos to go along the text which help. There is no noticeable wrong things in it, so it gets the highest grading as well. +Well-written post, although a bit smaller than Classmate’s, but that’s not really an issue. It still talks about everything it should talk and includes photos to go along the text which help. There is no noticeable wrong things in it, so it gets the highest grading as well.
@@ -1,8 +1,8 @@
-```meta -title: Visualizing Cáceres’ OpenData -published: 2020-03-09T00:00:08+00:00 -updated: 2020-03-19T14:38:41+00:00 -``` ++++ +title = "Visualizing Cáceres’ OpenData" +date = 2020-03-09T00:00:08+00:00 +updated = 2020-03-19T14:38:41+00:00 ++++ The city of Cáceres has online services to provide [Open Data](http://opendata.caceres.es/) over a wide range of [categories](http://opendata.caceres.es/dataset), all of which are very interesting to explore!@@ -299,4 +299,4 @@ Wow, that was a long journey! We hope that this post helped you pick some interest in data exploration, it’s such a fun world. We also offer the full download for the code below, because we know it’s quite a bit!
Which of the graphs was your favourite? I personally like the count per date, I think it’s nice to see the growth. Let us know in the comments below! -*download removed* +*download removed*
@@ -1,8 +1,8 @@
-```meta -title: What is an algorithm? -published: 2020-02-25T00:00:16+00:00 -updated: 2020-03-18T09:51:02+00:00 -``` ++++ +title = "What is an algorithm?" +date = 2020-02-25T00:00:16+00:00 +updated = 2020-03-18T09:51:02+00:00 ++++ Algorithms are a sequence of instructions that can be followed to achieve _something_. That something can be anything, and depends entirely on your problem!@@ -16,4 +16,4 @@ ## References
* algorithm – definition and meaning: [https://www.wordnik.com/words/algorithm](https://www.wordnik.com/words/algorithm) * Algorithm: [https://en.wikipedia.org/wiki/Algorithm](https://en.wikipedia.org/wiki/Algorithm) -* What is a «computer algorithm»?: [https://computer.howstuffworks.com/what-is-a-computer-algorithm.htm](https://computer.howstuffworks.com/what-is-a-computer-algorithm.htm) +* What is a «computer algorithm»?: [https://computer.howstuffworks.com/what-is-a-computer-algorithm.htm](https://computer.howstuffworks.com/what-is-a-computer-algorithm.htm)
@@ -1,9 +1,11 @@
-```meta -created: 2020-06-19 -modified: 2020-07-03 -``` - -# My new computer ++++ +title = "My new computer" +date = 2020-06-19 +updated = 2020-07-03 +[taxonomies] +category = ["hw"] +tags = ["showoff"] ++++ This post will be mostly me ranting about setting up a new laptop, but I also just want to share my upgrade. If you're considering installing Arch Linux with dual-boot for Windows, maybe this post will help. Or perhaps you will learn something new to troubleshoot systems in the future. Let's begin!@@ -364,4 +366,4 @@ Because `rougauracore` helped me and they linked to [hw-probe](https://github.com/linuxhw/hw-probe/blob/master/README.md#appimage), I decided to [run it on my system](https://linux-hardware.org/?probe=0e3e48c501), with the hopes it is useful for other people.
## Closing words -I hope the installation journey is at least useful to someone, or that you enjoyed reading about it all. If not, sorry! +I hope the installation journey is at least useful to someone, or that you enjoyed reading about it all. If not, sorry!
@@ -1,9 +1,10 @@
-```meta -created: 2019-06-03 -``` - -Shattered Pixel Dungeon -======================= ++++ +title = "Shattered Pixel Dungeon" +date = 2019-06-03 +[taxonomies] +category = ["games"] +tags = ["tips"] ++++ [Shattered Pixel Dungeon](https://shatteredpixel.com/shatteredpd/) is the classic roguelike RPG game with randomly-generated dungeons. As a new player, it was a bit frustrating to be constantly killed on the first levels of the dungeon, but with some practice it's easy to reach high levels if you can kill the first boss.@@ -41,4 +42,4 @@
Luck ---- -This game is all about luck and patience! Some runs will be better than others, and you should thank and pray the RNG gods for them. If you don't, they will only give you cursed items and not a single scroll to clean them. So, good luck and enjoy playing! +This game is all about luck and patience! Some runs will be better than others, and you should thank and pray the RNG gods for them. If you don't, they will only give you cursed items and not a single scroll to clean them. So, good luck and enjoy playing!
@@ -1,5 +1,10 @@
-Atemporal Blog Posts -==================== ++++ +title = "Atemporal Blog Posts" +date = 2018-02-03 +[taxonomies] +category = ["algos"] +tags = ["algorithms", "culture", "debate", "foodforthought", "graphics", "optimization"] ++++ These are some interesting posts and links I've found around the web. I believe they are quite interesting and nice reads, so if you have the time, I encourage you to check some out.
@@ -1,10 +1,8 @@
-```meta -created: 2016-06-13 -modified: 2016-06-13 -``` - -Reflexión sobre la Inteligencia artificial -========================================== ++++ +title = "TITReflexión sobre la Inteligencia artificialO" +date = 2016-06-13 +updated = 2016-06-13 ++++ > Nota: esta reflexión ha sido sacada de una conversación en Telegram, aunque ha sido lo más adaptada posible a formato de blog.@@ -26,4 +24,4 @@ Me estoy rayando.
El verdadero problema está en saber cómo sabemos que estamos pensando. El cerebro se compone de neuronas y conexiones, esa es la base a parte de donde se encuentra todo y tal la base es esa, y las sensaciones táctiles son igual de complejas, las procesa mi cerebro pero las siento en mi mano. ¿Será cosa de costumbre? Yo siento algo y lo situo ahí. Sin embargo sentimos ahí y no por encima o por debajo de, vamos a poner, los dedos de la mano, lo siento justo ahí. ¿Qué coño es realmente la [memoria a corto plazo](https://es.wikipedia.org/wiki/Memoria_a_corto_plazo)? (porque lo de la [memoria a largo plazo](https://es.wikipedia.org/wiki/Memoria_a_largo_plazo) se traslada ahí cuando la necesitamos para trabajar con ella, por eso es *MCP* o memoria de trabajo según ciertas teorías). -En fin. +En fin.
@@ -1,8 +1,8 @@
-```meta -title: A practical example with Hadoop -published: 2020-04-01T02:00:00+00:00 -updated: 2020-04-03T08:43:41+00:00 -``` ++++ +title = "A practical example with Hadoop" +date = 2020-04-01T02:00:00+00:00 +updated = 2020-04-03T08:43:41+00:00 ++++ In our [previous Hadoop post](/blog/ribw/introduction-to-hadoop-and-its-mapreduce/), we learnt what it is, how it originated, and how it works, from a theoretical standpoint. Here we will instead focus on a more practical example with Hadoop.@@ -131,7 +131,7 @@
``` $ ls results part-r-00000 _SUCCESS -$ cat results/part-r-00000 +$ cat results/part-r-00000 154 0 2 1 3@@ -147,4 +147,4 @@ exception 1
-snip- (output cut for clarity) ``` -It worked! Now this example was obviously tiny, but hopefully enough to demonstrate how to get the basics running on real world data. +It worked! Now this example was obviously tiny, but hopefully enough to demonstrate how to get the basics running on real world data.
@@ -1,8 +1,8 @@
-```meta -title: About Boolean Retrieval -published: 2020-02-25T00:00:29+00:00 -updated: 2020-03-18T09:38:02+00:00 -``` ++++ +title = "About Boolean Retrieval" +date = 2020-02-25T00:00:29+00:00 +updated = 2020-03-18T09:38:02+00:00 ++++ This entry will discuss the section on the _[Boolean retrieval](https://nlp.stanford.edu/IR-book/pdf/01bool.pdf)_ section of the book _[An Introduction to Information Retrieval](https://nlp.stanford.edu/IR-book/pdf/irbookprint.pdf)_.@@ -445,4 +445,4 @@ The boolean retrieval model can be implemented with relative ease, and can help with storage and efficient querying of the information if we intend to perform boolean queries.
However, the basic design lacks other useful operations, such as a «near» operator, or the ability to rank the results. -All in all, it’s an interesting way to look at the data and query it efficiently. +All in all, it’s an interesting way to look at the data and query it efficiently.
@@ -1,8 +1,8 @@
-```meta -title: Build your own PC -published: 2020-02-25T02:00:12+00:00 -updated: 2020-03-18T09:38:46+00:00 -``` ++++ +title = "Build your own PC" +date = 2020-02-25T02:00:12+00:00 +updated = 2020-03-18T09:38:46+00:00 ++++ _…where PC obviously stands for Personal Crawler_.@@ -190,4 +190,4 @@ e.printStackTrace();
} } } -``` +```
@@ -1,8 +1,8 @@
-```meta -title: Cassandra: an Introduction -published: 2020-03-05T00:00:45+00:00 -updated: 2020-03-18T09:47:05+00:00 -``` ++++ +title = "Cassandra: an Introduction" +date = 2020-03-05T00:00:45+00:00 +updated = 2020-03-18T09:47:05+00:00 ++++ This is the first post in the Cassandra series, where we will introduce the Cassandra database system and take a look at its features and installation methods.@@ -16,13 +16,13 @@ ----------
![NoSQL database – Apache Cassandra – First delivery](cassandra-database-e1584191543401.jpg) -## Purpose of technology +## Purpose of technology -Apache Cassandra is a **NoSQL**, **open-source**, **distributed “key-value” database**. It allows **large volumes of distributed data**. The main **goal **is provide **linear scalability and availabilitywithout compromising performance**. Besides, Cassandra **supports replication** across multiple datacenters, providing low latency. +Apache Cassandra is a **NoSQL**, **open-source**, **distributed “key-value” database**. It allows **large volumes of distributed data**. The main **goal **is provide **linear scalability and availabilitywithout compromising performance**. Besides, Cassandra **supports replication** across multiple datacenters, providing low latency. -## How it works +## How it works -Cassandra’s distributed **architecture **is based on a series of **equal nodes** that communicate with a **P2P protocol** so that **redundancy is maximum**. It offers robust support for multiple datacenters, with **asynchronous replication** without the need for a master server. +Cassandra’s distributed **architecture **is based on a series of **equal nodes** that communicate with a **P2P protocol** so that **redundancy is maximum**. It offers robust support for multiple datacenters, with **asynchronous replication** without the need for a master server. Besides, Cassandra’s **data model consists of partitioning the rows**, which are rearranged into **different tables**. The primary keys of each table have a first component that is the **partition key**. Within a partition, the rows are grouped by the remaining columns of the key. The other columns can be indexed separately from the primary key.@@ -33,19 +33,19 @@
![](s0GHpggGZXOFcdhypRWV4trU-PkSI6lukEv54pLZnoirh0GlDVAc4LamB1Dy.png) _ Cassandra architecture _ -## Features +## Features * **Decentralized**: there are **no single points of failure**, every **node **in the cluster has the **same role** and there is **no master node**, so each node **can service any request**, besides the data is distributed across the cluster. -* Supports **replication **and multiple replication of **data center**: the replication strategies are **configurable**. +* Supports **replication **and multiple replication of **data center**: the replication strategies are **configurable**. * **Scalability: **reading and writing performance increases linearly as new nodes are added, also **new nodes** can be **added without interrupting** application **execution**. * **Fault tolerance: data replication** is done **automatically **in several nodes in order to recover from failures. It is possible to **replace failure nodes****without **making** inactivity time or interruptions** to the application. * **Consistency: **a choice of consistency level is provided for **reading and writing**. * **MapReduce support**: it is **integrated **with **Apache Hadoop** to support MapReduce. * **Query language**: it has its own query language called **CQL (Cassandra Query Language) ** -## Corner in CAP theorem +## Corner in CAP theorem -**Apache Cassandra** is usually described as an “**AP**” system because it guarantees **availability** and **partition/fault tolerance**. So it errs on the side of ensuring data availability even if this means **sacrificing consistency**. But, despite this fact, Apache Cassandra **seeks to satisfy all three requirements** (Consistency, Availability and Fault tolerance) simultaneously and can be **configured to behave** like a “**CP**” database, guaranteeing **consistency and partition/fault tolerance**. +**Apache Cassandra** is usually described as an “**AP**” system because it guarantees **availability** and **partition/fault tolerance**. So it errs on the side of ensuring data availability even if this means **sacrificing consistency**. But, despite this fact, Apache Cassandra **seeks to satisfy all three requirements** (Consistency, Availability and Fault tolerance) simultaneously and can be **configured to behave** like a “**CP**” database, guaranteeing **consistency and partition/fault tolerance**. ![](rf3n9LTOKCQVbx4qrn7NPSVcRcwE1LxR_khi-9Qc51Hcbg6BHHPu-0GZjUwD.png) _Cassandra in CAP Theorem_@@ -54,7 +54,7 @@ ## Download
In order to download the file, with extension .tar.gz. you must visit the [download site](https://cassandra.apache.org/download/) and click on the file “[https://ftp.cixug.es/apache/cassandra/3.11.6/apache-cassandra-3.11.6-bin.tar.gz](https://ftp.cixug.es/apache/cassandra/3.11.6/apache-cassandra-3.11.6-bin.tar.gz)”. It is important to mention that the previous link is related to the 3.11.6 version. -## Installation +## Installation This database can only be installed on Linux distributions and Mac OS X systems, so, it is not possible to install it on Microsoft Windows.@@ -65,26 +65,26 @@ sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre ``` -In order to establish Java as a environment variable it is needed to open the file “/.bashrc”: +In order to establish Java as a environment variable it is needed to open the file “/.bashrc”: ``` nano ~/.bashrc ``` -And add at the end of it the path where Java is installed, as follows: +And add at the end of it the path where Java is installed, as follows: ``` export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre/ export PATH=$PATH:$JAVA_HOME/bin ``` - At this point, save the file and execute the next command, note that it does the same effect re-opening the terminal: + At this point, save the file and execute the next command, note that it does the same effect re-opening the terminal: ``` source ~/.bashrc ``` -In order to check if the Java environment variable is set correctly, run the next command: +In order to check if the Java environment variable is set correctly, run the next command: ``` echo $JAVA_HOME@@ -93,7 +93,7 @@
![](JUUmX5MIHynJR_K9EdCgKeJcpINeCGRRt2QRu4JLPtRhCVidOhcbWwVTQjyu.png) _$JAVAHOME variable_ -Afterwards, it is possible to check the installed Java version with the command: +Afterwards, it is possible to check the installed Java version with the command: ``` java -version@@ -102,13 +102,13 @@
![](z9v1-0hpZwjI4U5UZej9cRGN5-Y4AZl0WUPWyQ_-JlzTAIvZtTFPnKY2xMQ_.png) _Java version_ -The next requirement is having installed the latest version of Python 2.7. This can be checked with the command: +The next requirement is having installed the latest version of Python 2.7. This can be checked with the command: ``` python --version ``` -If it is not installed, to install it, it is as simple as run the next command in the terminal: +If it is not installed, to install it, it is as simple as run the next command in the terminal: ``` sudo apt install python@@ -125,25 +125,25 @@
![](Ger5Vw_e1HIK84QgRub-BwGmzIGKasgiYb4jHdfRNRrvG4d6Msp_3Vk62-9i.png) _Python version_ -Once both requirements are ready, next step is to unzip the file previously downloaded, right click on the file and select “Extract here” or with the next command, on the directory where is the downloaded file. +Once both requirements are ready, next step is to unzip the file previously downloaded, right click on the file and select “Extract here” or with the next command, on the directory where is the downloaded file. ``` tar -zxvf apache-cassandra-x.x.x-bin.tar.gz ``` -In order to check if the installation is completed, you can execute the next command, in the root folder of the project. This will start Cassandra in a single node. +In order to check if the installation is completed, you can execute the next command, in the root folder of the project. This will start Cassandra in a single node. ``` /bin/cassandra ``` -It is possible to make a get some data from Cassandra with CQL (Cassandra Query Language). To check this execute the next command in another terminal. +It is possible to make a get some data from Cassandra with CQL (Cassandra Query Language). To check this execute the next command in another terminal. ``` /bin/cqlsh localhost ``` -Once CQL is open, type the next sentence and check the result: +Once CQL is open, type the next sentence and check the result: ``` SELECT cluster_name, listen_address from system.local;@@ -154,11 +154,11 @@
![](miUO60A-RtyEAOOVFJqlkPRC18H4RKUhot6RWzhO9FmtzgTPOYHFtwxqgZEf.png) _Sentence output_ -Finally, the installation guide provided by the website of the database is attached in this [installation guide](https://cassandra.apache.org/doc/latest/getting_started/installing.html). +Finally, the installation guide provided by the website of the database is attached in this [installation guide](https://cassandra.apache.org/doc/latest/getting_started/installing.html). -## References +## References * [Wikipedia](https://es.wikipedia.org/wiki/Apache_Cassandra) * [Apache Cassandra](https://cassandra.apache.org/) * [Datastax](https://www.datastax.com/blog/2019/05/how-apache-cassandratm-balances-consistency-availability-and-performance) -* [yugabyte](https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/) +* [yugabyte](https://blog.yugabyte.com/apache-cassandra-architecture-how-it-works-lightweight-transactions/)
@@ -1,8 +1,8 @@
-```meta -title: Developing a Python application for MongoDB -published: 2020-03-25T00:00:04+00:00 -updated: 2020-04-16T08:01:23+00:00 -``` ++++ +title = "Developing a Python application for MongoDB" +date = 2020-03-25T00:00:04+00:00 +updated = 2020-04-16T08:01:23+00:00 ++++ This is the third and last post in the MongoDB series, where we will develop a Python application to process and store OpenData inside Mongo.@@ -644,7 +644,7 @@ <li>The <b>average noise</b> is <b>{format_avg_noise(area_info.avg_noise)}</b></li>
<li>There are <b>{area_info.census_count} persons </b> within the area</li> </ul> </div> - {#if area_info.trees_per_type.length > 0} + {#if area_info.trees_per_type.length > 0} <div class="text-center"> <h2 class="m-1 bg-dark text-white">Tree count per type</h2> </div>@@ -695,4 +695,4 @@
1. Unzip the downloaded file. 2. Make a copy of `example-server-config.ini` and rename it to `server-config.ini`, then edit the file to suit your needs. 3. Run the server with `python -m server`. -4. Open [localhost:9000](http://localhost:9000) in your web browser (or whatever port you chose) and enjoy! +4. Open [localhost:9000](http://localhost:9000) in your web browser (or whatever port you chose) and enjoy!
@@ -1,8 +1,8 @@
-```meta -title: Privado: Final NoSQL evaluation -published: 2020-05-13T00:00:00+00:00 -updated: 2020-05-14T07:30:08+00:00 -``` ++++ +title = "Privado: Final NoSQL evaluation" +date = 2020-05-13T00:00:00+00:00 +updated = 2020-05-14T07:30:08+00:00 ++++ This evaluation is a bit different to my [previous one](/blog/ribw/16/nosql-evaluation/) because this time I have been tasked to evaluate the student `a(i - 2)`, and because I am `a = 9` that happens to be `a(7) =` Classmate.@@ -26,4 +26,4 @@ The next section talks about the file structure of the project, and they detail what everything part does, although I have missed some code snippets.
The final result is pretty cool and contains many interesting graphs, they provide a download to the source code and list all the relevant references used. -Except for a weird «necesario falta» in the text, it’s otherwise well-written, although given the issues above I cannot grade it with the highest score. +Except for a weird «necesario falta» in the text, it’s otherwise well-written, although given the issues above I cannot grade it with the highest score.
@@ -1,8 +1,8 @@
-```meta -title: Google’s BigTable -published: 2020-04-01T00:00:00+00:00 -updated: 2020-04-03T09:30:05+00:00 -``` ++++ +title = "Google’s BigTable" +date = 2020-04-01T00:00:00+00:00 +updated = 2020-04-03T09:30:05+00:00 ++++ Let’s talk about BigTable, and why it is what it is. But before we get into that, let’s see some important aspects anybody should consider when dealing with a lot of data (something BigTable does!).@@ -38,4 +38,4 @@ Rows are split in different tablets based on the row keys, which simplifies determining an appropriated server for them. The keys can be up to 64KB big, although most commonly they range 10-100 bytes.
## Conclusions -BigTable is Google’s way to deal with large amounts of data on many of their services, and the ideas behind it are not too complex to understand. +BigTable is Google’s way to deal with large amounts of data on many of their services, and the ideas behind it are not too complex to understand.
@@ -1,8 +1,8 @@
-```meta -title: How does Google’s Search Engine work? -published: 2020-03-18T01:00:00+00:00 -updated: 2020-03-28T10:17:09+00:00 -``` ++++ +title = "How does Google’s Search Engine work?" +date = 2020-03-18T01:00:00+00:00 +updated = 2020-03-28T10:17:09+00:00 ++++ The original implementation was written in C/++ for Linux/Solaris.@@ -281,4 +281,4 @@
## References * [The anatomy of a large-scale hypertextual Web search engine](https://snap.stanford.edu/class/cs224w-readings/Brin98Anatomy.pdf) -* [The Anatomy of a Large-Scale Hypertextual Web Search Engine (slides)](https://www.site.uottawa.ca/~diana/csi4107/Google_SearchEngine.pdf) +* [The Anatomy of a Large-Scale Hypertextual Web Search Engine (slides)](https://www.site.uottawa.ca/~diana/csi4107/Google_SearchEngine.pdf)
@@ -1,7 +0,0 @@
-# Information Retrieval and Web Search - -During 2020 at university, this subject ("Recuperación de la Información y Búsqueda en la Web") -had us write blog posts as assignments. I think it would be really fun and I wanted to preserve -that work here, with the hopes it's interesting to someone. - -The posts were auto-generated from the original HTML files and manually anonymized later.
@@ -1,8 +1,8 @@
-```meta -title: Integrating Apache Tika into our Crawler -published: 2020-03-18T00:00:00+00:00 -updated: 2020-03-25T17:38:07+00:00 -``` ++++ +title = "Integrating Apache Tika into our Crawler" +date = 2020-03-18T00:00:00+00:00 +updated = 2020-03-25T17:38:07+00:00 ++++ [In our last crawler post](/blog/ribw/upgrading-our-baby-crawler/), we detailed how our crawler worked, and although it did a fine job, it’s time for some extra upgrading.@@ -36,4 +36,4 @@ ## Download
And here you can download the final result: -*download removed* +*download removed*
@@ -1,8 +1,8 @@
-```meta -title: Introduction to Hadoop and its MapReduce -published: 2020-04-01T01:00:00+00:00 -updated: 2020-04-03T08:43:44+00:00 -``` ++++ +title = "Introduction to Hadoop and its MapReduce" +date = 2020-03-30T00:00:00+00:00 +updated = 2020-04-01T11:01:46+00:00 ++++ Hadoop is an open-source, free, Java-based programming framework that helps processing large datasets in a distributed environment and the problems that arise when trying to harness the knowledge from BigData, capable of running on thousands of nodes and dealing with petabytes of data. It is based on Google File System (GFS) and originated from the work on the Nutch open-source project on search engines.@@ -73,4 +73,4 @@ * [YouTube – Video Post #2: Hadoop para torpes (I)-¿Qué es y para qué sirve?](https://youtu.be/j8ehT1_G5AY?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi)
* [Video Post #3: Hadoop para torpes (II)-¿Cómo funciona? HDFS y MapReduce](https://youtu.be/NQ8mjVPCDvk?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi) * [Apache Hadoop Releases](https://hadoop.apache.org/old/releases.html) * [Video Post #4: Hadoop para torpes (III y fin)- Ecosistema y distribuciones](https://youtu.be/20qWx2KYqYg?list=PLi4tp-TF_qjM_ed4lIzn03w7OnEh0D8Xi) -* [Chapter 2 – Hadoop: The Definitive Guide, Fourth Edition](http://www.hadoopbook.com/) ([pdf,](http://grut-computing.com/HadoopBook.pdf)[code](http://www.hadoopbook.com/code.html)) +* [Chapter 2 – Hadoop: The Definitive Guide, Fourth Edition](http://www.hadoopbook.com/) ([pdf,](http://grut-computing.com/HadoopBook.pdf)[code](http://www.hadoopbook.com/code.html))
@@ -1,8 +1,8 @@
-```meta -title: Introduction to NoSQL -published: 2020-02-25T01:00:15+00:00 -updated: 2020-03-18T09:38:23+00:00 -``` ++++ +title = "Introduction to NoSQL" +date = 2020-02-25T02:00:30+00:00 +updated = 2020-03-18T09:51:33+00:00 ++++ This post will primarly focus on the talk held in the [GOTO 2012 conference: Introduction to NoSQL by Martin Fowler](https://youtu.be/qI_g07C_Q5I). It can be seen as an informal, summarized transcript of the talk@@ -33,11 +33,13 @@ * **Cluster-friendly** (this was the original spark)
* Open-source (until now, generally) * 21st century web culture * Schema-less (easier integration or conjugation of several models, structure aggregation) + These databases use different data models to those used by the relational model. However, it is possible to identify 4 broad chunks (some may say 3, or even 2!): * **Key-value store**. With a certain key, you obtain the value corresponding to it. It knows nothing else, nor does it care. We say the data is opaque. * **Document-based**. It stores an entire mass of documents with complex structure, normally through the use of JSON (XML has been left behind). Then, you can ask for certain fields, structures, or portions. We say the data is transparent. * **Column-family**. There is a «row key», and within it we store multiple «column families» (columns that fit together, our aggregate). We access by row-key and column-family name. + All of these kind of serve to store documents without any _explicit_ schema. Just shove in anything! This gives a lot of flexibility and ease of migration, except… that’s not really true. There’s an _implicit_ schema when querying. For example, a query where we may do `anOrder['price'] * anOrder['quantity']` is assuming that `anOrder` has both a `price` and a `quantity`, and that both of these can be multiplied together. «Schema-less» is a fuzzy term.@@ -80,4 +82,4 @@
## Further reading * [The future is: ~~NoSQL Databases~~ Polyglot Persistence](https://www.martinfowler.com/articles/nosql-intro-original.pdf) -* [NoSQL Databases: An Overview](https://www.thoughtworks.com/insights/blog/nosql-databases-overview) +* [NoSQL Databases: An Overview](https://www.thoughtworks.com/insights/blog/nosql-databases-overview)
@@ -1,8 +1,8 @@
-```meta -title: MongoDB: an Introduction -published: 2020-03-05T01:00:06+00:00 -updated: 2020-04-08T17:38:22+00:00 -``` ++++ +title = "MongoDB: an Introduction" +date = 2020-03-05T01:00:06+00:00 +updated = 2020-04-08T17:38:22+00:00 ++++ This is the first post in the MongoDB series, where we will introduce the MongoDB database system and take a look at its features and installation methods.@@ -18,13 +18,13 @@ ----------
![NoSQL database – MongoDB – First delivery](mongodb.png) -## Purpose of technology +## Purpose of technology MongoDB is a **general purpose, document-based, distributed database** built for modern application developers and for the cloud era, with the scalability and flexibility that you want with the querying and indexing that you need. It being a document database means it stores data in JSON-like documents. The Mongo team believes this is the most natural way to think about data, which is (they claim) much more expressive and powerful than the traditional row/column model, since programmers think in objects. -## How it works +## How it works MongoDB’s architecture can be summarized as follows:@@ -49,7 +49,7 @@ MongoDB also supports the creation of **indices**, similar to those in other database systems. It allows for the creation of indices on any field or subfields.
In Mongo, the **aggregation pipeline** allows us to filter and analyze data based on a given set of criteria. For example, we could pull all the documents in the `restaurants` collection that have a `category` of `Bakery` using the `$match` operator. Then, we can group them by their star rating using the `$group` operator. Using the accumulator operator, `$sum`, we can see how many bakeries in our collection have each star rating. -## Features +## Features The features can be seen all over the place in their site, because it’s something they make a lot of emphasis on:@@ -63,7 +63,7 @@ * **Support for aggregations** and other modern use-cases such as geo-based search, graph search, and text search.
* **A distributed systems design**, which allows developers to intelligently put data where they want it. High availability, horizontal scaling, and geographic distribution are built in and easy to use. * **A unified experience** with the freedom to run anywhere, which allows developers to future-proof their work and eliminate vendor lock-in. -## Corner in CAP theorem +## Corner in CAP theorem MongoDB’s position in the CAP theorem (Consistency, Availability, Partition Tolerance) depends on the database and driver configurations, and the type of disaster.@@ -76,9 +76,9 @@ ## Download
We will be using the apt-based installation. -The Community version can be downloaded by anyone through [MongoDB Download Center](https://www.mongodb.com/download-center/community), where one can choose the version, Operating System and Package.MongoDB also seems to be [available in Ubuntu’s PPAs](https://packages.ubuntu.com/eoan/mongodb). +The Community version can be downloaded by anyone through [MongoDB Download Center](https://www.mongodb.com/download-center/community), where one can choose the version, Operating System and Package.MongoDB also seems to be [available in Ubuntu’s PPAs](https://packages.ubuntu.com/eoan/mongodb). -## Installation +## Installation We will be using an Ubuntu-based system, with apt available. To install MongoDB, we open a terminal and run the following command:@@ -92,7 +92,7 @@ ```
mongod --version ``` -The output should be similar to the following: +The output should be similar to the following: ``` db version v4.0.16@@ -106,7 +106,7 @@ distarch: x86_64
target_arch: x86_64 ``` -## References +## References * [MongoDB’s official site](https://www.mongodb.com/) * [What is MongoDB?](https://www.mongodb.com/what-is-mongodb)@@ -114,4 +114,4 @@ * [MongoDB Architecture](https://www.mongodb.com/mongodb-architecture)
* [Where does mongodb stand in the CAP theorem?](https://stackoverflow.com/q/11292215/4759433) * [What is the CAP Theorem? MongoDB vs Cassandra vs RDBMS, where do they stand in the CAP theorem?](https://medium.com/@bikas.katwal10/mongodb-vs-cassandra-vs-rdbms-where-do-they-stand-in-the-cap-theorem-1bae779a7a15) * [Why doesn’t MongoDB have availability in the CAP theorem?](https://www.quora.com/Why-doesnt-MongoDB-have-availability-in-the-CAP-theorem) -* [Install MongoDB](https://docs.mongodb.com/manual/installation/) +* [Install MongoDB](https://docs.mongodb.com/manual/installation/)
@@ -1,8 +1,8 @@
-```meta -title: MongoDB: Basic Operations and Architecture -published: 2020-03-05T04:00:08+00:00 -updated: 2020-04-08T17:36:25+00:00 -``` ++++ +title = "MongoDB: Basic Operations and Architecture" +date = 2020-03-05T04:00:08+00:00 +updated = 2020-04-08T17:36:25+00:00 ++++ This is the second post in the MongoDB series, where we will take a look at the [CRUD operations](https://stackify.com/what-are-crud-operations/) they support, the data model and architecture used.@@ -375,4 +375,4 @@ Yeah, take that! The [`dropDatabase`](https://docs.mongodb.com/manual/reference/method/db.dropDatabase/) can be used to drop databases.
## References -The examples in this post are all fictional, and the methods that could be used where taken from Classmate’s post, and of course [Mongo’s documentation](https://docs.mongodb.com/manual/reference/method/). +The examples in this post are all fictional, and the methods that could be used where taken from Classmate’s post, and of course [Mongo’s documentation](https://docs.mongodb.com/manual/reference/method/).
@@ -1,8 +1,8 @@
-```meta -title: Cassandra: Basic Operations and Architecture -published: 2020-03-05T02:00:36+00:00 -updated: 2020-03-24T17:57:05+00:00 -``` ++++ +title = "Cassandra: Basic Operations and Architecture" +date = 2020-03-05T02:00:36+00:00 +updated = 2020-03-24T17:57:05+00:00 ++++ This is the second post in the NoSQL Databases series, with a brief description on the basic operations (such as insertion, retrieval, indexing…), and complete execution along with the data model / architecture.@@ -26,7 +26,7 @@ ```
$ bin/cassandra ``` -Once Cassandra is deployed, it is time to open a** CQL Shell**, in **other terminal**, with the command: +Once Cassandra is deployed, it is time to open a** CQL Shell**, in **other terminal**, with the command: ``` $ bin/cqlsh@@ -37,11 +37,11 @@
![](uwqQgQte-cuYb_pePFOuY58re23kngrDKNgL1qz4yOfnBDZkqMIH3fFuCrye.png) _CQL Shell_ -## Create/Insert +## Create/Insert -### DDL (Data Definition Language) +### DDL (Data Definition Language) -#### Create keyspace +#### Create keyspace A keyspace is created using a **CREATE KEYSPACE **statement:@@ -53,7 +53,7 @@ The supported “**options**” are:
* “**replication**”: this is **mandatory **and defines the **replication strategy** and the **replication factor** (the number of nodes that will have a copy of the data). Within this option there is a property called “**class**” in which the **replication strategy** is specified (“SimpleStrategy” or “NetworkTopologyStrategy”) * “**durable_writes**”: this is **not mandatory** and it is possible to use the **commit logs for updates**. -Attempting to create an already existing keyspace will return an error unless the **IF NOT EXISTS **directive is used. +Attempting to create an already existing keyspace will return an error unless the **IF NOT EXISTS **directive is used. The example associated to this statement is create a keyspace with name “test_keyspace” with “SimpleStrategy” as “class” of replication and a “replication_factor” of 3.@@ -63,7 +63,7 @@ **WITH** **replication** = {'class': 'SimpleStrategy',
'replication_factor' : 3}; ``` -The **USE **statement allows to **change** the current **keyspace**. The syntax of this statement is very simple: +The **USE **statement allows to **change** the current **keyspace**. The syntax of this statement is very simple: ``` **USE** keyspace_name;@@ -78,7 +78,7 @@ ```
**DESCRIBE** KEYSPACES | KEYSPACE keyspace_name; ``` -#### Create table +#### Create table Creating a new table uses the **CREATE TABLE **statement:@@ -180,7 +180,7 @@
![](s6GrKIGATvOSD7oGRNScUU5RnLN_-3X1JXvnVi_wDT_hrmPMZdnCdBI8DpIJ.png) _SELECT statement_ -Furthermore, we are going to test the SELECT JSON statement. For this, we are going to retrieve only the species name with a population of 0. +Furthermore, we are going to test the SELECT JSON statement. For this, we are going to retrieve only the species name with a population of 0. ``` **SELECT** JSON species **FROM** species_table **WHERE** population = 0 ALLOW FILTERING;@@ -189,11 +189,11 @@
![](Up_eHlqKQp2RI5XIbgPOvj1B5J3gLxz7v7EI0NDRgezQTipecdfDT6AQoso0.png) _SELECT JSON statement_ -## Update +## Update ### DDL (Data Definition Language) -#### Alter keyspace +#### Alter keyspace The statement **ALTER KEYSPACE **allows to modify the options of a keyspace:@@ -232,7 +232,7 @@ ```
**ALTER** **TABLE** species_table **DROP** sex; ``` - Finally, alter the comment with the WITH clause and set the comment to “All species records”. + Finally, alter the comment with the WITH clause and set the comment to “All species records”. ``` **ALTER** **TABLE** species_table **WITH** **comment**='All species records';@@ -302,7 +302,7 @@ ```
**DROP** **TABLE** [ **IF** **EXISTS** ] table_name; ``` - For example, drop the table called “species_2” if it exists: + For example, drop the table called “species_2” if it exists: ``` **DROP** **TABLE** **IF** **EXISTS** species_2;@@ -339,7 +339,7 @@ **WHERE** where_clause
[ **IF** ( **EXISTS** | condition ( **AND** condition )*) ] ``` -Now we are going to delete the value of the column “average_size” from “Cloned Sheep”. +Now we are going to delete the value of the column “average_size” from “Cloned Sheep”. ``` **DELETE** average_size **FROM** species_table **WHERE** species = 'Cloned Sheep';@@ -348,7 +348,7 @@
![](CyuQokVL5J9TAelq-WEWhNl6kFtbIYs0R1AeU5NX4EkG-YQI81mNHdnf2yWN.png) _DELETE value statement_ -And we are going to delete the same row as mentioned before. +And we are going to delete the same row as mentioned before. ``` **DELETE** **FROM** species_table **WHERE** species = 'Cloned Sheep';@@ -390,7 +390,7 @@ _BATCH statement_
## Index -CQL support creating secondary indexes on tables, allowing queries on the table to use those indexes. +CQL support creating secondary indexes on tables, allowing queries on the table to use those indexes. **Creating **a secondary index on a table uses the **CREATE INDEX **statement:@@ -406,13 +406,13 @@ ```
**CREATE** **INDEX** population_idx **ON** species_table (population); ``` -**Dropping **a secondary index uses the **DROP INDEX** statement: +**Dropping **a secondary index uses the **DROP INDEX** statement: ``` **DROP** **INDEX** [ **IF** **EXISTS** ] index_name; ``` -Now, we are going to drop the previous index: +Now, we are going to drop the previous index: ``` **DROP** **INDEX** **IF** **EXISTS** population_idx;@@ -424,4 +424,4 @@ * [Cassandra CQL](https://cassandra.apache.org/doc/latest/cql/ddl.html)
* [Differences between DML and DDL](https://techdifferences.com/difference-between-ddl-and-dml-in-dbms.html) * [Datastax CQL](https://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/cqlReferenceTOC.html) * [Cassandra CQL Types](https://cassandra.apache.org/doc/latest/cql/types.html#grammar-token-cql-type) -* [Cassandra Index](https://cassandra.apache.org/doc/latest/cql/indexes.html) +* [Cassandra Index](https://cassandra.apache.org/doc/latest/cql/indexes.html)
@@ -1,8 +1,8 @@
-```meta -title: Privado: NoSQL evaluation -published: 2020-03-16T00:00:15+00:00 -updated: 2020-03-27T11:22:45+00:00 -``` ++++ +title = "Privado: NoSQL evaluation" +date = 2020-03-16T00:00:15+00:00 +updated = 2020-03-27T11:22:45+00:00 ++++ I have decided to evaluate Classmate‘s post and Classmate‘s post, because they review databases I have not seen or used before, and I think it would be interesting to see new ones.
@@ -1,8 +1,8 @@
-```meta -title: Privado: PC-Crawler evaluation 2 -published: 2020-03-16T01:00:47+00:00 -updated: 2020-03-28T10:29:49+00:00 -``` ++++ +title = "Privado: PC-Crawler evaluation 2" +date = 2020-03-16T01:00:47+00:00 +updated = 2020-03-28T10:29:49+00:00 ++++ As the student `a(i)` where `i = 9`, I have been assigned to evaluate students `a(i - 1)` and `a(i - 2)`, these being:@@ -31,4 +31,4 @@ Next, they show the code they have written, also describing what it does, although they don’t explain _why_ they chose the data structures they used.
The style of the code leaves a lot to be desired, and they should have embedded the code in the post instead of taking screenshots. People that rely on screen readers will not be able to see the code. -I have graded them B and not A for this last reason. +I have graded them B and not A for this last reason.
@@ -1,8 +1,8 @@
-```meta -title: Privado: PC-Crawler evaluation -published: 2020-03-04T00:00:23+00:00 -updated: 2020-03-18T09:39:27+00:00 -``` ++++ +title = "Privado: PC-Crawler evaluation" +date = 2020-03-04T00:00:23+00:00 +updated = 2020-03-18T09:39:27+00:00 ++++ As the student `a(i)` where `i = 9`, I have been assigned to evaluate students `a(i + 3)` and `a(i + 4)`, these being:@@ -44,4 +44,4 @@ Some of the methods are documented, although the code inside them is not very commented, including missing rationale for the data structures chosen. There also seem to be several other unused main functions, which I’m unsure why they were kept.
However, all the desired functionality is implemented. -Similar to Classmate, the code style could be improved and settled on some standard, as well as making use of Java features such as `for` loops over iterators instead of manual loops. +Similar to Classmate, the code style could be improved and settled on some standard, as well as making use of Java features such as `for` loops over iterators instead of manual loops.
@@ -1,8 +1,8 @@
-```meta -title: Upgrading our Baby Crawler -published: 2020-03-11T00:00:07+00:00 -updated: 2020-03-18T09:49:33+00:00 -``` ++++ +title = "Upgrading our Baby Crawler" +date = 2020-03-11T00:00:07+00:00 +updated = 2020-03-18T09:49:33+00:00 ++++ In our [last post on this series](/blog/ribw/build-your-own-pc/), we presented the code for our Personal Crawler. However, we didn’t quite explain what a crawler even is! We will use this moment to go a bit more in-depth, and make some upgrades to it.@@ -62,4 +62,4 @@ ## Download
The code was getting a bit too large to embed it within the blog post itself, so instead you can download it as a`.zip` file. -*download removed* +*download removed*
@@ -1,8 +1,8 @@
-```meta -title: What is ElasticSearch and why should you care? -published: 2020-03-18T02:00:00+00:00 -updated: 2020-03-27T11:04:45+00:00 -``` ++++ +title = "What is ElasticSearch and why should you care?" +date = 2020-03-18T02:00:00+00:00 +updated = 2020-03-27T11:04:45+00:00 ++++ ElasticSearch is a giant search index with powerful analytics capabilities. It’s like a database and search engine on steroids, really easy and fast to get up and running. One can think of it as your own Google, a search engine with analytics.@@ -62,4 +62,4 @@
* [YouTube – What is Elasticsearch?](https://youtu.be/sKnkQSec1U0) * [YouTube – GOTO 2013 • Elasticsearch – Beyond Full-text Search • Alex Reelsen](https://youtu.be/yWNiRC_hUAw) * [Kibana – Your window into the Elastic Stack](https://www.elastic.co/kibana) -* [Elastic Stack and Product Documentation](https://www.elastic.co/guide/index.html) +* [Elastic Stack and Product Documentation](https://www.elastic.co/guide/index.html)
@@ -1,10 +1,8 @@
-```meta -created: 2018-01-31 -updated: 2018-01-31 -``` - -Sentences -========= ++++ +title = "Sentences" +date = 2018-01-31 +updated = 2018-01-31 ++++ > Don't know English? [Read the Spanish version instead](spanish.html).@@ -28,4 +26,3 @@ * If you want something to happen, go and do it. Or wait sitting like a stupid until it happens that it never happens.
* I'd rather be happy than be right. * The engines don’t move the ship at all. The ship stays where it is and the engines move the universe around it. * If I never try getting there, I'll never get there. -
@@ -1,10 +1,8 @@
-```meta -created: 2018-01-31 -updated: 2018-01-31 -``` - -Frases -====== ++++ +title = "Frases" +date = 2018-01-31 +updated = 2018-01-31 ++++ Simplemente algunas frases que se han ido amontonando a lo largo de los años y que creo que merecen persistir en algún lugar.@@ -26,4 +24,3 @@ * Si quieres que pase, ve y hazlo. O espera sentado como un subnormal a que pase para que no pase nunca.
* Prefiero ser feliz a llevar la razón. * Los motores no mueven la nave en absoluto. La nave se queda donde está y los motores mueven el universo a su alrededor. * Si nunca aspiro a llegar, nunca llegaré -
@@ -1,130 +0,0 @@
-/* containers */ - -body { - background-color: #fffff0; - margin: 0; -} - -main { - max-width: 720px; - margin: 0 auto; - padding: 10px 20px; - background-color: #fffff0; -} - -/* titles and special */ - -h1.title { - text-align: center; - font-family: serif; - font-size: 2.5em; - font-weight: lighter; - font-variant-caps: small-caps; - border-bottom: 4px double #000; -} - -h1, h2 { - padding-bottom: 10px; - border-bottom: 1px solid #000; -} - -h1:not(.title):hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { - opacity: 1; -} - -.anchor { - float: left; - padding-right: 0.4ch; - margin-left: -1.3ch; - opacity: 0; - transition: opacity 150ms; -} - -/* body text */ - -p, li { - font-family: sans-serif; - font-size: 1.1em; - line-height: 1.5; - text-align: justify; -} - -a { - text-decoration: none; - color: #f74c00; - border-bottom: 0 dashed rgba(0, 0, 0, 0); - transition: color 300ms, border-bottom 300ms; -} - -a:hover { - color: #e33b26; - border-bottom: 1px solid #e33b26; -} - -blockquote { - border-left: 4px solid #000; - padding-left: 8px; - font-style: italic; - color: #444; -} - -.footnote:target { - background-color: rgba(255, 255, 0, 0.2); -} - -/* code listing */ - -pre { - background-color: #eee; - padding: 4px; - overflow: auto; - max-height: 480px; -} - -/* tables */ - -table { - border-collapse: collapse; -} - -th { - background-color: #f7f7e8; -} - -th, td { - padding: 0.5em; - border: 1px solid #aaa; -} - -tr:nth-child(even) { - background-color: #f7f7e8; -} - -/* misc */ - -p.time { - text-align: right; - font-style: italic; - color: #777; - font-size: 0.9em; -} - -hr { - border: 0; - border-bottom: 2px dashed #aaa; -} - -kbd { - padding: 3px 5px; - font: 0.9em monospace; - color: #333; - background-color: #fafafa; - border: 1px solid #ddd; - border-radius: 4px; - box-shadow: 0 2px 0 #ddd; -} - -::selection { - background-color: #f74c00; - color: #fff; -}
@@ -1,10 +1,11 @@
-```meta -created: 2020-05-10 -updated: 2020-05-22 -``` - -Tips for Outpost -================ ++++ +title = "Tips for Outpost" +date = 2020-05-10 +updated = 2020-05-22 +[taxonomies] +category = ["games"] +tags = ["tips"] ++++ [Outpost](https://store.steampowered.com/app/1127110/Outpost/) is a fun little game by Open Mid Interactive that has popped in recently in my recommended section of Steam, and I decided to give it a try.@@ -144,4 +145,4 @@
Closing words ------------- -I hope you enjoy the game as much as I do! Movement is sometimes janky and there's the occassional lag spikes, but despite this it should provide at least a few good hours of gameplay. Beware however a good run can take up to an hour! +I hope you enjoy the game as much as I do! Movement is sometimes janky and there's the occassional lag spikes, but despite this it should provide at least a few good hours of gameplay. Beware however a good run can take up to an hour!
@@ -1,11 +0,0 @@
-```meta -published: 2020-07-03 -``` - -# University posts - -During university, there were a few subjects where I had to write blog posts for (either as -evaluable tasks or just for fun). Currently, these are: - -* [Data Mining and Data Warehousing](/blog/mdad) -* [Information Retrieval and Web Search](/blog/ribw)
@@ -1,10 +1,11 @@
-```meta -created: 2018-07-11 -modified: 2018-07-11 -``` - -WorldEdit Commands -================== ++++ +title = "WorldEdit Commands" +date = 2018-07-11 +updated = 2018-07-11 +[taxonomies] +category = ["games"] +tags = ["minecraft", "worldedit", "tips"] ++++ [WorldEdit](https://dev.bukkit.org/projects/worldedit) is an extremely powerful tool for modifying entire worlds within [Minecraft](https://minecraft.net), which can be used as either a mod for your single-player worlds or as a plugin for your [Bukkit](https://getbukkit.org/) servers.@@ -125,4 +126,4 @@ Finally, you can copy and cut things around like you would do with normal text with `//copy` and `//cut`. The copy is issued from wherever you issue the command, so when you use `//paste`, remember that if you were 4 blocks apart when copying, it will be 4 blocks apart when pasting.
The contents of the clipboard can be flipped to wherever you are looking via `//flip`, and can be rotated via the `//rotate 90` command (in degrees). -To remove the copy use `//clearclipboard`. +To remove the copy use `//clearclipboard`.
@@ -1,127 +0,0 @@
-/* R.I.P. old blog CSS, 2018-02-03 to 2020-05-29 */ - -@font-face { - font-family: sf1; - src: url("../fonts/GeosansLight.ttf"); -} -@font-face { - font-family: sf2; - src: url("../fonts/inglobal.ttf"); -} -@font-face { - font-family: sf3; - src: url("../fonts/Larke Sans Light 2.ttf"); -} -@font-face { - font-family: sf4; - src: url("../fonts/weblysleekuil.ttf"); -} - -::selection { - background: #FFFF66; -} -::-moz-selection { - background: #FFFF66; -} - -body { - background-color: #F4F4F4; -} - -.minMargin { - margin: 50px 30px; -} - -.card { - margin: 20px auto; - padding: 8px 24px; - border-radius: 10px; - background-color: #FFF; - max-width: 640px; - box-shadow: 8px 8px 8px #B8B8B8; -} - -h1 { - font-family: sf1; - font-size: 64px; -} -h2 { - font-family: sf3; - font-size: 48px; - border-bottom: 1px solid #888888; - padding-bottom: 4px; -} -h3, .versalita { - font-family: sf4; - font-variant: small-caps; -} -.right { - text-align: right; -} - -p, ol, ul, td { - font-family: sf2; - font-size: 18px; - line-height: 125%; -} -td { - padding: 2px 20px; - vertical-align: top; -} - -hr { - border: 1px dashed #D0D0D0; - margin: 20px 10px; -} - -em { - color: #484848; -} - -img { - border-radius: 10px; - box-shadow: 4px 4px 4px #888888; -} - -.center { - text-align: center; - display: block; - margin: 0 auto; -} - -a { - text-decoration: none; - border-bottom: 0px solid #00CCCC; - margin-bottom: 3px; - color: #00CCCC; - transition: border-bottom 0.1s ease-in-out 0s, margin-bottom 0.1s ease-in-out 0s, color 0.2s ease-in-out 0s; -} -a:hover { - border-bottom: 3px solid #00AAAA; - margin-bottom: 0px; - color: #00AAAA; -} - -code { - background-color: #F7F7F7; - color: #F77; - padding: 2px; - font-size: 14px; - border-radius: 2px; -} - -li { - margin: 4px 0; -} - -table { - border-collapse: collapse; -} - -table, th, td { - border: 1px solid #777; -} - -th { - padding: 2px 8px; -}
@@ -1,89 +0,0 @@
-::-moz-selection { - background-color: #FFAA00; - color: #000000; -} - -::selection { - background-color: #FFAA00; - color: #000000; -} - -body { - background-color: #FFFFF0; -} - -div { - max-width: 720px; - margin: 0 auto; -} - -.body { - padding: 10px 20px; - border-radius: 4px; - background-color: #FFFFFF; - box-shadow: 5px 5px 10px #CCCCCC; -} - -h1, h2 { - font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; - font-size: 200%; - font-weight: lighter; - text-transform: capitalize; -} - -h1 { - text-align: center; -} - -p, li, dl { - font-family: Tahoma, Geneva, sans-serif; - font-size: 1.1em; -} - -a { - text-decoration: none; - transition: color 300ms, border-bottom 300ms; - color: #00AAFF; -} - -a:hover { - color: #44CCFF; -} - -.menu { - margin-top: 40px; -} - -.menu ul { - list-style-type: none; - margin: 0; - padding: 0; - margin-bottom: 8px; -} - -.menu li { - font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; - display: inline; - margin: 0 -4px; - font-size: 1.3em; -} - -.menu a { - color: #787878; - border-bottom: solid 2px #A8A8A8; - padding: 0 8px; -} - -.menu a.selected, .menu a:hover { - color: #000000; - border-bottom: solid 2px #444444; -} - -dl img { - margin-bottom: -0.4em; - margin-right: 0.6em; -} - -dd { - margin-bottom: 1em; -}
@@ -0,0 +1,10 @@
+set -e +zola build +# Forgetting to exclude `.git` has costed me several days worth of work (and over 30 commits). +find . -maxdepth 1 -not -name '.' -not -name '.git' -not -name 'public' -exec rm -r {} \; +mv public/* . +rmdir public/ +git add . +git commit --amend -m "Deploy site" +git push --force +git checkout master
@@ -1,26 +0,0 @@
-#!/bin/bash - -rm -rf blog -cp -r content /dev/shm -pushd /dev/shm - - mv content/{ribw,mdad} . - cp content/style.css ribw - cp content/style.css mdad - - pagong - mv dist blog - rm -r content - - mv ribw content - pagong - mv dist blog/ribw - rm -r content - - mv mdad content - pagong - mv dist blog/mdad - rm -r content - -popd -mv /dev/shm/blog .
@@ -1,105 +0,0 @@
-<!DOCTYPE html> -<html lang="en"> -<head> - <title>Lonami's Site</title> - <link rel="stylesheet" type="text/css" href="css/style.css"> - <meta name="description" content="Official Lonami's website"> - <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> -</head> -<body> - <div class="menu"> - <ul> - <li><a href="/index" class="selected">Lonami's Site</a></li> - <li><a href="/blog/index">Blog</a></li> - </ul> - </div> - <div class="body"> - <h1>Lonami's Site</h1> - <p>Welcome to my personal website! This page has had several redesigns - over time, but now I've decided to let it be as minimalist as possible - (proud to be under 32KB!).</p> - - <h2 id="about">About me</h2> - <p>Spanish male - <span id="age"><noscript>born in 1998</noscript></span>. - I have been programming - <span id="programming"><noscript>since 2012</noscript></span> - and it is my passion.</p> - - <p>I enjoy nature, taking pictures, playing video-games, - drawing vector graphics, or just chatting online.</p> - - <p>I can talk perfect Spanish, read and write perfect English - and Python, and have programmed in C#, Java, JavaScript, Rust, - some C and C++, and designed pages like this with plain HTML - and CSS.</p> - - <p>On the Internet, I'm often known as <i>Lonami</i>, although - my real name is simply my nick name, put the other way round.</p> - - <h2 id="projects">Project highlights</h2> - <ul> - <li> - <a href="https://github.com/LonamiWebs/Telethon/">Telethon</a>: - Python implementation of the Telegram's API. - </li> - <li> - <a href="klooni">1010! Klooni</a>: libGDX simple puzzle - game based on the original <i>1010!</i>. - </li> - <li> - <a href="https://github.com/LonamiWebs/Stringlate/">Stringlate</a>: - Android application that makes it easy to translate other FOSS apps. - </li> - </ul> - <p>These are only my <i>Top 3</i> projects, the ones I consider to be - the most successful. If you're curious about what else I've done, feel - free to check out my - <a href="https://github.com/LonamiWebs/">GitHub</a>.</p> - - <h2 id="more-links">More links</h2> - <dl> - <dt><a href="https://t.me/LonamiWebs"><img src="img/telegram.svg" alt="" /> My Telegram</a></dt> - <dd>Come meet me at my group in Telegram and talk about anything!</dd> - - <dt><a href="/blog/index"><img src="img/blog.svg" alt="blog" /> My blog</a></dt> - <dd>Sometimes I blog about things, whether it's games, techy stuff, or random life stuff.</dd> - - <dt><a href="https://github.com/LonamiWebs"><img src="img/github.svg" alt="github" /> My GitHub</a></dt> - <dd>By far what I'm most proud of. I love releasing my projects as open source. There is no reason not to!</dd> - - <dt><a href="/utils"><img src="img/utils.svg" alt="utilities" /> Several Utilities</a></dt> - <dd>Random things I've put online because I keep forgetting about them.</dd> - - <dt><a href="/stopwatch.html"><img src="stopwatch.svg" width="24" height="24" alt="stopwatch" /> stopwatch</a></dt> - <dd>An extremely simple JavaScript-based stopwatch.</dd> - - <dt><a href="donate"><img src="img/bitcoin.svg" alt="donate" /> Donate</a></dt> - <dd>Some people like what I do and want to compensate me for it, but I'm fine with compliments if you can't afford a donation!</dd> - - <dt><a href="humans.txt"><img src="img/humans.svg" alt="humans.txt" /> humans.txt</a></dt> - <dd><a href="http://humanstxt.org/">We are humans, not robots.</a></dd> - </dl> - - <h2 id="contact">Contact</h2> - <p>If you use Telegram you can join - <a href="https://t.me/LonamiWebs">@LonamiWebs</a> - and just chat about any topics you like politely.</p> - - <p>If you prefer, you can also send me a private email to - <a href="mailto:totufals@hotmail.com">totufals[at]hotmail[dot]com</a> - and I will try to reply as soon as I can. Please don't use the email - if you need help with a specific project, this is better discussed in - the group where everyone can benefit from it.</p> - </div> -<script type="text/javascript"> - now = (new Date()).getFullYear(); - - document.getElementById("age").innerHTML = - "aged " + (now - 1999); - - document.getElementById("programming").innerHTML = - "for " + (now - 2012) + " years"; -</script> -</body> -</html>
@@ -0,0 +1,216 @@
+/* main */ +body { + background-color: #FFFFF0; + margin: 0; +} + +nav, main { + max-width: 720px; + margin: 0 auto; +} + +main { + padding: 10px 20px; + border-radius: 4px; + background-color: #fffff7; + box-shadow: 0 0 10px #eee; +} + +/* navigation */ +nav.sections { + margin-top: 40px; + display: block; +} + +nav.sections ul { + list-style-type: none; + margin: 0; + padding: 0; + margin-bottom: 8px; +} + +nav.sections li { + font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; + display: inline; + margin: 0 -2px; + font-size: 1.3em; +} + +nav.sections a { + color: #787878; + border-bottom: solid 2px #A8A8A8; + padding: 0 16px; +} + +nav.sections a.selected, nav.sections a:hover { + color: #000000; + border-bottom: solid 2px #444444; +} + +/* headers */ +h1, h2 { + font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; + font-size: 200%; + font-weight: lighter; + text-transform: capitalize; + padding-bottom: 10px; + border-bottom: 1px solid #000; + text-align: center; +} + +h1.title { + text-align: center; + font-family: serif; + font-size: 2.5em; + font-weight: lighter; + font-variant-caps: small-caps; + border-bottom: 4px double #000; +} + +h1:not(.title):hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, h5:hover .anchor, h6:hover .anchor { + opacity: 1; +} + +.anchor { + float: left; + padding-right: 0.4ch; + margin-left: -1.3ch; + opacity: 0; + transition: opacity 150ms; +} + +/* body */ +p, li, dl { + font-family: Tahoma, Geneva, sans-serif; + font-size: 1.1em; + line-height: 1.5; +} + +img { + max-width: 100%; +} + +.dim { + color: #999; + font-size: smaller; +} + +a { + text-decoration: none; + color: #f74c00; + border-bottom: 0 dashed rgba(0, 0, 0, 0); + transition: color 300ms, border-bottom 300ms; +} + +a:hover { + color: #e33b26; + border-bottom: 1px solid #e33b26; +} + +blockquote { + border-left: 4px solid #000; + padding-left: 8px; + font-style: italic; + color: #444; +} + +.footnote:target { + background-color: rgba(255, 255, 0, 0.2); +} + +dl img { + margin-bottom: -0.4em; + margin-right: 0.6em; +} + +dd { + margin-bottom: 1em; +} + +div.time { + text-align: right; + font-style: italic; + color: #777; + font-size: 0.9em; +} + +div.time p { + line-height: 0.5; +} + +hr { + border: 0; + border-bottom: 2px dashed #aaa; +} + +/* code */ +pre { + background-color: #eee; + padding: 4px; + overflow: auto; + max-height: 480px; +} + +kbd { + padding: 3px 5px; + font: 0.9em monospace; + color: #333; + background-color: #fafafa; + border: 1px solid #ddd; + border-radius: 4px; + box-shadow: 0 2px 0 #ddd; +} + +/* tables */ +table { + border-collapse: collapse; +} + +th { + background-color: #f7f7e8; +} + +th, td { + padding: 0.5em; + border: 1px solid #aaa; +} + +tr:nth-child(even) { + background-color: #f7f7e8; +} + +/* graphs post */ +div.matrix table { + border-width: 0 2pt 0 2pt; + border-style: solid; + border-color: #000; +} + +/* poor man's matrix */ +div.matrix tr:first-child td:first-child, div.matrix tr:first-child td:last-child { + border-top: 2pt solid #000; +} + +div.matrix tr:last-child td:first-child, div.matrix tr:last-child td:last-child { + border-bottom: 2pt solid #000; +} + +div.matrix td { + border: none; +} + +em.math { + font-family: 'Times New Roman', Times, serif; + font-size: larger; +} + +/* special */ +::-moz-selection { + background-color: #FFAA00; + color: #000000; +} + +::selection { + background-color: #FFAA00; + color: #000000; +}
@@ -0,0 +1,38 @@
+<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8"> + <meta name="description" content="Official Lonami's website"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> + + <title> + {% block title %} + Lonami's + {% if current_path == '/'%} + Site + {% elif current_path is starting_with('/blog') %} + Blog + {% elif current_path is starting_with('/golb') %} + Golb + {% else %} + Confused + {% endif %} + {% endblock %} + </title> + {% block css %} + <link rel="stylesheet" type="text/css" href="/style.css"> + {% endblock %} +</head> +<body> + <nav class="sections"> + <ul> + <li><a href="/" class="{% if current_path == '/' %}selected{% endif %}">lonami's site</a></li> + <li><a href="/blog" class="{% if current_path is starting_with('/blog') %}selected{% endif %}">blog</a></li> + <li><a href="/golb" class="{% if current_path is starting_with('/golb') %}selected{% endif %}">golb</a></li> + </ul> + </nav> + <main> + {% block content %}{% endblock %} + </main> +</body> +</html>
@@ -0,0 +1,12 @@
+{% extends "base.html" %} + +{% block title %}{{ page.title }} | Lonami's Blog{% endblock %} + +{% block content %} +<h1 class="title">{{ page.title }}</h1> +<div class="time"> + <p>{{ page.date }}</p> + {% if page.updated and page.updated != page.date %}<p>last updated {{ page.updated }}</p>{% endif %} +</div> +{{ page.content | safe }} +{% endblock %}
@@ -0,0 +1,60 @@
+{% extends "base.html" %} + +{% block content %} +<h1 class="title">{{ section.title }}</h1> +<p id="welcome" onclick="pls_stop()">Welcome to my blog!</p> + +<p>Here I occasionally post new entries, mostly tech related. Perhaps it's tips for a new game I'm playing, perhaps it has something to do with FFI, or perhaps I'm fightning the borrow checker (just kidding, I'm over that. Mostly).</p> + +<hr> + +<ul> + {% for page in section.pages %} + <li><a href="{{ page.permalink | safe }}">{{ page.title }}</a><span class="dim"> + {% if page.taxonomies.category %} + [mod {{ page.taxonomies.category[0] }}; + {% for t in page.taxonomies.tags %}'{{ t }}{% if not loop.last %}, {% endif %}{% endfor %}] + {% endif %} + </span></li> + {% endfor %} +</ul> + +<script> + const WELCOME_EN = 'Welcome to my blog!' + const WELCOME_ES = '¡Bienvenido a mi blog!' + const APOLOGIES = "ok sorry i'll stop" + const REWRITE_DELAY = 5000 + const CHAR_DELAY = 30 + const welcome = document.getElementById('welcome') + + let deleting = true + let english = false + let stopped = false + + const pls_stop = () => { + stopped = true + welcome.innerHTML = APOLOGIES + } + + const begin_rewrite = () => { + if (stopped) { + // now our visitor is angry :( + } else if (deleting) { + if (welcome.innerHTML == '…') { + deleting = false + } else { + welcome.innerHTML = welcome.innerHTML.slice(0, -1) || '…' + } + setTimeout(begin_rewrite, CHAR_DELAY) + } else { + let text = english ? WELCOME_EN : WELCOME_ES + welcome.innerHTML = text.slice(0, welcome.innerHTML.length + 1) + deleting = welcome.innerHTML.length == text.length + english = deleting - english + setTimeout(begin_rewrite, deleting ? REWRITE_DELAY : CHAR_DELAY) + } + } + + setTimeout(begin_rewrite, REWRITE_DELAY) +</script> +{% endblock %}
@@ -0,0 +1,16 @@
+{% extends "base.html" %} + +{% block content %} +<h1 class="title">{{ section.title }}</h1> +<p>Welcome to my golb!</p> + +<p>It's like my blog, but with things that are a bit more… personal? Random? Spanish? Yeah!</p> + +<hr> + +<ul> + {% for page in section.pages %} + <li><a href="{{ page.permalink | safe }}">{{ page.title }}</a></li> + {% endfor %} +</ul> +{% endblock %}
@@ -0,0 +1,105 @@
+{% extends "base.html" %} + +{% block css %} +{{ super() }} + +<style> +.golb { + transform: scaleY(-1); + transition: transform 300ms; +} + +.golb:hover { + transform: scaleY(1); +} +</style> +{% endblock %} + +{% block content %} +<h1>Lonami's Site</h1> +<p>Welcome to my personal website! This page has had several redesigns +over time, but now I've decided to let it be as minimalist as possible +(proud to be under 32KB!).</p> + +<h2 id="about">About me</h2> +<p>Spanish male +<span id="age"><noscript>born in 1998</noscript></span>. +I have been programming +<span id="programming"><noscript>since 2012</noscript></span> +and it is my passion.</p> + +<p>I enjoy nature, taking pictures, playing video-games, +drawing vector graphics, or just chatting online.</p> + +<p>I can talk perfect Spanish, read and write perfect English +and Python, and have programmed in C#, Java, JavaScript, Rust, +some C and C++, and designed pages like this with plain HTML +and CSS.</p> + +<p>On the Internet, I'm often known as <i>Lonami</i>, although +my real name is simply my nick name, put the other way round.</p> + +<h2 id="projects">Project highlights</h2> +<ul> +<li> +<a href="https://github.com/LonamiWebs/Telethon/">Telethon</a>: +Python implementation of the Telegram's API. +</li> +<li> +<a href="klooni">1010! Klooni</a>: libGDX simple puzzle +game based on the original <i>1010!</i>. +</li> +<li> +<a href="https://github.com/LonamiWebs/Stringlate/">Stringlate</a>: +Android application that makes it easy to translate other FOSS apps. +</li> +</ul> +<p>These are only my <i>Top 3</i> projects, the ones I consider to be +the most successful. If you're curious about what else I've done, feel +free to check out my +<a href="https://github.com/LonamiWebs/">GitHub</a>.</p> + +<h2 id="more-links">More links</h2> +<dl> + <dt><a href="https://t.me/LonamiWebs"><img src="img/telegram.svg" alt="" /> My Telegram</a></dt> + <dd>Come meet me at my group in Telegram and talk about anything!</dd> + + <dt><a href="/blog"><img src="img/blog.svg" alt="blog" /> My blog</a></dt> + <dd>Sometimes I blog about things, whether it's games, techy stuff, or random life stuff.</dd> + + <dt><a href="/golb"><img src="img/blog.svg" class="golb" alt="golb" /> My golb</a></dt> + <dd>What? You don't know what a golb is? It's like a blog, but less conventional.</dd> + + <dt><a href="https://github.com/LonamiWebs"><img src="img/github.svg" alt="github" /> My GitHub</a></dt> + <dd>By far what I'm most proud of. I love releasing my projects as open source. There is no reason not to!</dd> + + <dt><a href="/utils"><img src="img/utils.svg" alt="utilities" /> Several Utilities</a></dt> + <dd>Random things I've put online because I keep forgetting about them.</dd> + + <dt><a href="/stopwatch.html"><img src="stopwatch.svg" width="24" height="24" alt="stopwatch" /> stopwatch</a></dt> + <dd>An extremely simple JavaScript-based stopwatch.</dd> + + <dt><a href="donate"><img src="img/bitcoin.svg" alt="donate" /> Donate</a></dt> + <dd>Some people like what I do and want to compensate me for it, but I'm fine with compliments if you can't afford a donation!</dd> + + <dt><a href="humans.txt"><img src="img/humans.svg" alt="humans.txt" /> humans.txt</a></dt> + <dd><a href="http://humanstxt.org/">We are humans, not robots.</a></dd> +</dl> + +<h2 id="contact">Contact</h2> +<p>If you use Telegram you can join +<a href="https://t.me/LonamiWebs">@LonamiWebs</a> +and just chat about any topics you like politely.</p> + +<p>If you prefer, you can also send me a private email to +<a href="mailto:totufals@hotmail.com">totufals[at]hotmail[dot]com</a> +and I will try to reply as soon as I can. Please don't use the email +if you need help with a specific project, this is better discussed in +the group where everyone can benefit from it.</p> +{% endblock %} + +<script type="text/javascript"> + now = (new Date()).getFullYear(); + document.getElementById("age").innerHTML = "aged " + (now - 1999); + document.getElementById("programming").innerHTML = "for " + (now - 2012) + " years"; +</script>