diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2018-09-23 23:30:10 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2018-09-23 23:30:10 +0200 |
| commit | eaf89064f0f6abb8ebeb09c7da49cd792514c897 (patch) | |
| tree | a826dd645ee18827ce28e1d4a734e818353355a3 /slides/presentations/basic-math-in-programming | |
| parent | bae600fe83b539e66220112c354df079f8c3dea7 (diff) | |
| download | mitjafelicijan.com-eaf89064f0f6abb8ebeb09c7da49cd792514c897.tar.gz | |
content update
Diffstat (limited to 'slides/presentations/basic-math-in-programming')
3 files changed, 417 insertions, 0 deletions
diff --git a/slides/presentations/basic-math-in-programming/default.pug b/slides/presentations/basic-math-in-programming/default.pug new file mode 100644 index 0000000..c84446d --- /dev/null +++ b/slides/presentations/basic-math-in-programming/default.pug | |||
| @@ -0,0 +1,150 @@ | |||
| 1 | section | ||
| 2 | h1 Why understanding of basic math is imporant for computer programing | ||
| 3 | p September 21, 2018 | ||
| 4 | a(href="https://twitter.com/mitjafelicijan") @mitjafelicijan | ||
| 5 | |||
| 6 | |||
| 7 | |||
| 8 | section.center | ||
| 9 | q We Cannot Solve Our Problems With The Same Thinking We Used When We Created Them. | ||
| 10 | footer — Albert Einstein | ||
| 11 | |||
| 12 | |||
| 13 | |||
| 14 | section | ||
| 15 | h2 How we usually find solutions and why this is problematic? | ||
| 16 | |||
| 17 | ul | ||
| 18 | li We search for code example instead of algorithms. | ||
| 19 | li We copy and paste and do testing on trial&error principle. | ||
| 20 | li We don't take enough time to properly understand problem we a re trying to solve. | ||
| 21 | li Brute force solutions we make are usually not optimized | ||
| 22 | |||
| 23 | |||
| 24 | section | ||
| 25 | h3 Grid example | ||
| 26 | div.grid.col-1-1 | ||
| 27 | div Lipsum | ||
| 28 | div Lipsum | ||
| 29 | |||
| 30 | div.grid.col-2-1 | ||
| 31 | div Lipsum | ||
| 32 | div Lipsum | ||
| 33 | |||
| 34 | div.grid.col-1-2 | ||
| 35 | div Lipsum | ||
| 36 | div Lipsum | ||
| 37 | |||
| 38 | section | ||
| 39 | h2 Basic linear algebra | ||
| 40 | |||
| 41 | pre | ||
| 42 | code.language-css | ||
| 43 | | body { | ||
| 44 | | background: black; | ||
| 45 | | } | ||
| 46 | |||
| 47 | pre | ||
| 48 | code.language-javascript | ||
| 49 | | $(document).ready(function() { | ||
| 50 | | $('pre code').each(function(i, block) { | ||
| 51 | | hljs.highlightBlock(block); | ||
| 52 | | }); | ||
| 53 | | }); | ||
| 54 | |||
| 55 | hr | ||
| 56 | figcaption.right Step 1: Finding nearest point | ||
| 57 | |||
| 58 | div.center | ||
| 59 | img(src="drawing1.svg") | ||
| 60 | |||
| 61 | hr | ||
| 62 | figcaption.right Step 1: Finding nearest point | ||
| 63 | |||
| 64 | $$ \large{ \mathbb{R}^2 ∈ \vec{a} \bar{a} } $$ | ||
| 65 | $$ \large{ e^{i\pi} + 1 = 0 } $$ | ||
| 66 | $$ \large{ x = {-b \pm \sqrt{b^2-4ac} \over 2a} } $$ | ||
| 67 | |||
| 68 | hr | ||
| 69 | figcaption.right Step 2: Finding nearest point | ||
| 70 | |||
| 71 | pre | ||
| 72 | code.language-python | ||
| 73 | | fruits = ["apple", "banana", "cherry"] | ||
| 74 | | for x in fruits: | ||
| 75 | | if x == "banana": | ||
| 76 | | break | ||
| 77 | | print(x) | ||
| 78 | |||
| 79 | hr | ||
| 80 | figcaption.right Finding nearest point | ||
| 81 | |||
| 82 | $$ \large{ \mathbb{R}^2 ∈ \vec{a} \bar{a} } $$ | ||
| 83 | $$ \large{ e^{i\pi} + 1 = 0 } $$ | ||
| 84 | $$ \large{ x = {-b \pm \sqrt{b^2-4ac} \over 2a} } $$ | ||
| 85 | |||
| 86 | hr | ||
| 87 | figcaption.right Finding nearest point | ||
| 88 | |||
| 89 | pre | ||
| 90 | code.language-c | ||
| 91 | | #include <stdio.h> | ||
| 92 | | int main () { | ||
| 93 | | for( ; ; ) { | ||
| 94 | | printf("This loop will run forever.\n"); | ||
| 95 | | } | ||
| 96 | | return 0; | ||
| 97 | | } | ||
| 98 | |||
| 99 | hr | ||
| 100 | figcaption.right Finding nearest point | ||
| 101 | |||
| 102 | pre | ||
| 103 | code.language-python | ||
| 104 | | fruits = ["apple", "banana", "cherry"] | ||
| 105 | | for x in fruits: | ||
| 106 | | if x == "banana": | ||
| 107 | | break | ||
| 108 | | print(x) | ||
| 109 | |||
| 110 | hr | ||
| 111 | figcaption.right Finding nearest point | ||
| 112 | |||
| 113 | pre | ||
| 114 | code.language-sql | ||
| 115 | | SELECT `CustomerName`, `City` FROM `Customers`; | ||
| 116 | |||
| 117 | hr | ||
| 118 | figcaption.right Finding nearest point | ||
| 119 | |||
| 120 | pre | ||
| 121 | code.language-go | ||
| 122 | | package main | ||
| 123 | | import "fmt" | ||
| 124 | | func main() { | ||
| 125 | | sum := 0 | ||
| 126 | | for i := 0; i < 10; i++ { | ||
| 127 | | sum += i | ||
| 128 | | } | ||
| 129 | | fmt.Println(sum) | ||
| 130 | | } | ||
| 131 | |||
| 132 | hr | ||
| 133 | figcaption.right Finding nearest point | ||
| 134 | |||
| 135 | pre | ||
| 136 | code.language-javascript | ||
| 137 | | $(document).ready(function() { | ||
| 138 | | $('pre code').each(function(i, block) { | ||
| 139 | | hljs.highlightBlock(block); | ||
| 140 | | }); | ||
| 141 | | }); | ||
| 142 | |||
| 143 | hr | ||
| 144 | figcaption.right Finding nearest point | ||
| 145 | |||
| 146 | pre | ||
| 147 | code.language-css | ||
| 148 | | body { | ||
| 149 | | background: black; | ||
| 150 | | } | ||
diff --git a/slides/presentations/basic-math-in-programming/drawing1.svg b/slides/presentations/basic-math-in-programming/drawing1.svg new file mode 100644 index 0000000..19212c3 --- /dev/null +++ b/slides/presentations/basic-math-in-programming/drawing1.svg | |||
| @@ -0,0 +1,264 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | <!-- Created with Inkscape (http://www.inkscape.org/) --> | ||
| 3 | |||
| 4 | <svg | ||
| 5 | xmlns:dc="http://purl.org/dc/elements/1.1/" | ||
| 6 | xmlns:cc="http://creativecommons.org/ns#" | ||
| 7 | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
| 8 | xmlns:svg="http://www.w3.org/2000/svg" | ||
| 9 | xmlns="http://www.w3.org/2000/svg" | ||
| 10 | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | ||
| 11 | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | ||
| 12 | width="500" | ||
| 13 | height="300" | ||
| 14 | viewBox="0 0 132.29167 79.374998" | ||
| 15 | version="1.1" | ||
| 16 | id="svg8" | ||
| 17 | inkscape:version="0.92.2 2405546, 2018-03-11" | ||
| 18 | sodipodi:docname="drawing1.svg"> | ||
| 19 | <defs | ||
| 20 | id="defs2"> | ||
| 21 | <marker | ||
| 22 | inkscape:isstock="true" | ||
| 23 | style="overflow:visible" | ||
| 24 | id="marker4942" | ||
| 25 | refX="0" | ||
| 26 | refY="0" | ||
| 27 | orient="auto" | ||
| 28 | inkscape:stockid="Arrow2Mend"> | ||
| 29 | <path | ||
| 30 | transform="scale(-0.6)" | ||
| 31 | d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" | ||
| 32 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" | ||
| 33 | id="path4940" | ||
| 34 | inkscape:connector-curvature="0" /> | ||
| 35 | </marker> | ||
| 36 | <marker | ||
| 37 | inkscape:stockid="Arrow1Lstart" | ||
| 38 | orient="auto" | ||
| 39 | refY="0" | ||
| 40 | refX="0" | ||
| 41 | id="Arrow1Lstart" | ||
| 42 | style="overflow:visible" | ||
| 43 | inkscape:isstock="true"> | ||
| 44 | <path | ||
| 45 | id="path838" | ||
| 46 | d="M 0,0 5,-5 -12.5,0 5,5 Z" | ||
| 47 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" | ||
| 48 | transform="matrix(0.8,0,0,0.8,10,0)" | ||
| 49 | inkscape:connector-curvature="0" /> | ||
| 50 | </marker> | ||
| 51 | <marker | ||
| 52 | inkscape:isstock="true" | ||
| 53 | style="overflow:visible" | ||
| 54 | id="marker4708" | ||
| 55 | refX="0" | ||
| 56 | refY="0" | ||
| 57 | orient="auto" | ||
| 58 | inkscape:stockid="Arrow2Mend"> | ||
| 59 | <path | ||
| 60 | transform="scale(-0.6)" | ||
| 61 | d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" | ||
| 62 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" | ||
| 63 | id="path4706" | ||
| 64 | inkscape:connector-curvature="0" /> | ||
| 65 | </marker> | ||
| 66 | <marker | ||
| 67 | inkscape:isstock="true" | ||
| 68 | style="overflow:visible" | ||
| 69 | id="marker4578" | ||
| 70 | refX="0" | ||
| 71 | refY="0" | ||
| 72 | orient="auto" | ||
| 73 | inkscape:stockid="Arrow2Mend"> | ||
| 74 | <path | ||
| 75 | transform="scale(-0.6)" | ||
| 76 | d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" | ||
| 77 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" | ||
| 78 | id="path4576" | ||
| 79 | inkscape:connector-curvature="0" /> | ||
| 80 | </marker> | ||
| 81 | <marker | ||
| 82 | inkscape:stockid="Arrow2Mend" | ||
| 83 | orient="auto" | ||
| 84 | refY="0" | ||
| 85 | refX="0" | ||
| 86 | id="marker4454" | ||
| 87 | style="overflow:visible" | ||
| 88 | inkscape:isstock="true"> | ||
| 89 | <path | ||
| 90 | id="path4452" | ||
| 91 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" | ||
| 92 | d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" | ||
| 93 | transform="scale(-0.6)" | ||
| 94 | inkscape:connector-curvature="0" /> | ||
| 95 | </marker> | ||
| 96 | <marker | ||
| 97 | inkscape:stockid="Arrow1Send" | ||
| 98 | orient="auto" | ||
| 99 | refY="0" | ||
| 100 | refX="0" | ||
| 101 | id="Arrow1Send" | ||
| 102 | style="overflow:visible" | ||
| 103 | inkscape:isstock="true"> | ||
| 104 | <path | ||
| 105 | id="path853" | ||
| 106 | d="M 0,0 5,-5 -12.5,0 5,5 Z" | ||
| 107 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" | ||
| 108 | transform="matrix(-0.2,0,0,-0.2,-1.2,0)" | ||
| 109 | inkscape:connector-curvature="0" /> | ||
| 110 | </marker> | ||
| 111 | <marker | ||
| 112 | inkscape:isstock="true" | ||
| 113 | style="overflow:visible" | ||
| 114 | id="marker1686" | ||
| 115 | refX="0" | ||
| 116 | refY="0" | ||
| 117 | orient="auto" | ||
| 118 | inkscape:stockid="Arrow2Mend"> | ||
| 119 | <path | ||
| 120 | transform="scale(-0.6)" | ||
| 121 | d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" | ||
| 122 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" | ||
| 123 | id="path1684" | ||
| 124 | inkscape:connector-curvature="0" /> | ||
| 125 | </marker> | ||
| 126 | <marker | ||
| 127 | inkscape:stockid="Arrow2Mend" | ||
| 128 | orient="auto" | ||
| 129 | refY="0" | ||
| 130 | refX="0" | ||
| 131 | id="Arrow2Mend" | ||
| 132 | style="overflow:visible" | ||
| 133 | inkscape:isstock="true" | ||
| 134 | inkscape:collect="always"> | ||
| 135 | <path | ||
| 136 | id="path865" | ||
| 137 | style="fill:#464646;fill-opacity:1;fill-rule:evenodd;stroke:#464646;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" | ||
| 138 | d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" | ||
| 139 | transform="scale(-0.6)" | ||
| 140 | inkscape:connector-curvature="0" /> | ||
| 141 | </marker> | ||
| 142 | <marker | ||
| 143 | inkscape:stockid="Arrow1Mend" | ||
| 144 | orient="auto" | ||
| 145 | refY="0" | ||
| 146 | refX="0" | ||
| 147 | id="Arrow1Mend" | ||
| 148 | style="overflow:visible" | ||
| 149 | inkscape:isstock="true"> | ||
| 150 | <path | ||
| 151 | id="path847" | ||
| 152 | d="M 0,0 5,-5 -12.5,0 5,5 Z" | ||
| 153 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" | ||
| 154 | transform="matrix(-0.4,0,0,-0.4,-4,0)" | ||
| 155 | inkscape:connector-curvature="0" /> | ||
| 156 | </marker> | ||
| 157 | <marker | ||
| 158 | inkscape:stockid="Arrow2Lend" | ||
| 159 | orient="auto" | ||
| 160 | refY="0" | ||
| 161 | refX="0" | ||
| 162 | id="Arrow2Lend" | ||
| 163 | style="overflow:visible" | ||
| 164 | inkscape:isstock="true"> | ||
| 165 | <path | ||
| 166 | id="path859" | ||
| 167 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.625;stroke-linejoin:round;stroke-opacity:1" | ||
| 168 | d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z" | ||
| 169 | transform="matrix(-1.1,0,0,-1.1,-1.1,0)" | ||
| 170 | inkscape:connector-curvature="0" /> | ||
| 171 | </marker> | ||
| 172 | <marker | ||
| 173 | inkscape:stockid="Arrow1Lend" | ||
| 174 | orient="auto" | ||
| 175 | refY="0" | ||
| 176 | refX="0" | ||
| 177 | id="Arrow1Lend" | ||
| 178 | style="overflow:visible" | ||
| 179 | inkscape:isstock="true"> | ||
| 180 | <path | ||
| 181 | id="path841" | ||
| 182 | d="M 0,0 5,-5 -12.5,0 5,5 Z" | ||
| 183 | style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000003pt;stroke-opacity:1" | ||
| 184 | transform="matrix(-0.8,0,0,-0.8,-10,0)" | ||
| 185 | inkscape:connector-curvature="0" /> | ||
| 186 | </marker> | ||
| 187 | </defs> | ||
| 188 | <sodipodi:namedview | ||
| 189 | id="base" | ||
| 190 | pagecolor="#ffffff" | ||
| 191 | bordercolor="#666666" | ||
| 192 | borderopacity="1.0" | ||
| 193 | inkscape:pageopacity="0.0" | ||
| 194 | inkscape:pageshadow="2" | ||
| 195 | inkscape:zoom="1.979899" | ||
| 196 | inkscape:cx="327.73013" | ||
| 197 | inkscape:cy="146.30044" | ||
| 198 | inkscape:document-units="px" | ||
| 199 | inkscape:current-layer="g5731" | ||
| 200 | showgrid="false" | ||
| 201 | units="px" | ||
| 202 | inkscape:window-width="2188" | ||
| 203 | inkscape:window-height="906" | ||
| 204 | inkscape:window-x="201" | ||
| 205 | inkscape:window-y="113" | ||
| 206 | inkscape:window-maximized="0" /> | ||
| 207 | <metadata | ||
| 208 | id="metadata5"> | ||
| 209 | <rdf:RDF> | ||
| 210 | <cc:Work | ||
| 211 | rdf:about=""> | ||
| 212 | <dc:format>image/svg+xml</dc:format> | ||
| 213 | <dc:type | ||
| 214 | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | ||
| 215 | <dc:title></dc:title> | ||
| 216 | </cc:Work> | ||
| 217 | </rdf:RDF> | ||
| 218 | </metadata> | ||
| 219 | <g | ||
| 220 | inkscape:label="Layer 1" | ||
| 221 | inkscape:groupmode="layer" | ||
| 222 | id="layer1" | ||
| 223 | transform="translate(0,-217.625)"> | ||
| 224 | <path | ||
| 225 | style="fill:none;stroke:#c4c4c4;stroke-width:0.79374999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" | ||
| 226 | d="M 1.2851185,292.22805 H 129.30504" | ||
| 227 | id="path815" | ||
| 228 | inkscape:connector-curvature="0" /> | ||
| 229 | <path | ||
| 230 | inkscape:connector-curvature="0" | ||
| 231 | id="path817" | ||
| 232 | d="M 5.7168896,296.14955 V 219.04241" | ||
| 233 | style="fill:none;stroke:#c4c4c4;stroke-width:0.79374999;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> | ||
| 234 | <path | ||
| 235 | style="fill:none;stroke:#464646;stroke-width:0.79375;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow2Mend)" | ||
| 236 | d="M 40.314366,280.70642 95.214838,247.11607" | ||
| 237 | id="path817-3" | ||
| 238 | inkscape:connector-curvature="0" /> | ||
| 239 | <g | ||
| 240 | id="g5181" | ||
| 241 | transform="matrix(1.186197,0,0,1.186197,-183.6456,-2.4153968)"> | ||
| 242 | <g | ||
| 243 | id="g5731" | ||
| 244 | transform="translate(-2.3658212,2.929112)"> | ||
| 245 | <text | ||
| 246 | xml:space="preserve" | ||
| 247 | style="font-style:normal;font-weight:normal;font-size:5.09894657px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.12747367" | ||
| 248 | x="210.89255" | ||
| 249 | y="218.83659" | ||
| 250 | id="text1674"><tspan | ||
| 251 | sodipodi:role="line" | ||
| 252 | id="tspan1672" | ||
| 253 | x="210.89255" | ||
| 254 | y="218.83659" | ||
| 255 | style="stroke-width:0.12747367;font-weight:bold">a</tspan></text> | ||
| 256 | <path | ||
| 257 | style="fill:none;stroke:#000000;stroke-width:0.32239249;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow1Send)" | ||
| 258 | d="m 210.87566,215.19789 h 2.77612" | ||
| 259 | id="path3398" | ||
| 260 | inkscape:connector-curvature="0" /> | ||
| 261 | </g> | ||
| 262 | </g> | ||
| 263 | </g> | ||
| 264 | </svg> | ||
diff --git a/slides/presentations/basic-math-in-programming/meta.json b/slides/presentations/basic-math-in-programming/meta.json new file mode 100644 index 0000000..c670b2f --- /dev/null +++ b/slides/presentations/basic-math-in-programming/meta.json | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | { | ||
| 2 | "title": "Example presentation" | ||
| 3 | } | ||
