-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex2.html
545 lines (478 loc) · 20.1 KB
/
index2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Intro to Programming Concepts for True Beginners</title>
<meta name="description" content="">
<meta name="author" content="Boulder Girl Develop It">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="stylesheet" href="reveal/css/reveal.css">
<link rel="stylesheet" href="reveal/css/theme/gdilight.css" id="theme">
<!-- For syntax highlighting -->
<!-- light editor--><link rel="stylesheet" href="lib/css/light.css">
<!-- dark editor<link rel="stylesheet" href="reveal/lib/css/dark.css">-->
<!-- If use the PDF print sheet so students can print slides-->
<link rel="stylesheet" href="reveal/css/print/pdf.css" type="text/css" media="print">
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<div class="reveal">
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<!-- Opening -->
<section>
<img src = "images/gdi_logo_badge.png">
<h3>Introduction to Programming Concepts (for True Beginners!)</h3>
</section>
<section>
<h2>Thanks to our sponsor:</h2>
<img src="images/sponsors/sendgrid.jpg" style="border:none; width: 400px;"/>
</section>
<section>
<h2>Thanks to our sponsor:</h2>
<img src="images/sponsors/salesforce.jpg" style="border:none; width: 400px;"/>
</section>
<section>
<h3>Class notes</h3>
<ul>
<li>Class slides (streamlined): <a href="http://gdiboulder.github.io/gdi-boulder-intro-programming-concepts/">http://gdiboulder.github.io/gdi-boulder-intro-programming-concepts/</a></li>
<li>Detailed slides: <a href="http://gdiboulder.github.io/gdi-boulder-intro-programming-concepts/index2.html">http://gdiboulder.github.io/gdi-boulder-intro-programming-concepts/index2.html</a></li>
</ul>
</section>
<section>
<h2>A few quick announcements</h2>
</section>
<section>
<h3>Upcoming Events</h3>
<p>Introduction to Javascript & jQuery</p>
<p><strong>Saturday, July 26, 2014</strong></p>
<p>Simple Energy</p>
</section>
<!-- Welcome-->
<section class="hide-pdf">
<h3>Welcome!</h3>
<div class = "left-align">
<p>Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.</p>
<p class ="green">Some "rules"</p>
<ul>
<li>We are here for you!</li>
<li>Every question is important</li>
<li>Help each other</li>
<li>Have fun</li>
</ul>
</div>
</section>
<section class="hide-pdf">
<h3>Your instructors</h3>
<ul>
<li>Teri Charles</li>
<li>Jen Skiendzielewski</li>
<!--<li>Bullet Point</li>
<li>Twitter: <a href="http://twitter.com/[TWITTER]">@[TWITTER]</a></li>
<li>E-mail: <a href="mailto:[EMAIL]">[EMAIL]</a></li>-->
</ul>
</section>
<!--<section class="hide-pdf">
<h3>Welcome!</h3>
<div class = "left-align">
<p class = "blue">Tell us about yourself.</p>
<ul>
<li>Who are you?</li>
<li>What do you hope to get out of the class?</li>
</ul>
</div>
</section>-->
<!-- Copy this section over and over for each slide -->
<section>
<h3>Computer Programs</h3>
<ul>
<li>Computer programs are everywhere. They:
<ul>
<li>Run parts of your car.</li>
<li>Let you check your email.</li>
<li>Underlie that favorite app on your smartphone.</li>
</ul>
<li> But what are they, really?</li>
<ul/>
</section>
<section>
<h3>What is a Computer Program?</h3>
<ul>
<li>At its core, a computer program is a way of getting something done.</li>
<li>One of the ways to accomplish "getting something done" is a list of instructions that tells the computer exactly what to do and allows interaction with human beings.</li>
<li>Those instructions have to be written in a "language" that the computer can understand.</li>
</ul>
</section>
<section>
<h3>Programming Languages (1/2)</h3>
<ul>
<li>A programming language is basically a set of strings (letters, numbers, commands) that is changed into machine code that the computer can understand.</li>
<li>The language you use for a program depends on a number of things:</li>
<ul>
<li>How the program will be used.</li>
<li>What you want the program to do.</li>
<li>What languages you know.</li>
</ul>
</ul>
</section>
<section>
<h3>Programming Languages (2/2)</h3>
<ul>
<li>Computers don’t exactly understand programming languages (such as Java or Python). They need to be transformed into the computer language that they can understand.</li>
<li>That computer language is strings of 1’s and 0’s-- binary numbers that most people can’t read easily-- to be able to do anything with them.</li>
<ul>
<li>For example, the letter 'A' in a computer has the binary representation: 01000001.</li>
</ul>
<li>Despite being able to decipher those unintelligible strings of 1’s and 0’s, computers are actually pretty dumb. </li>
</ul>
</section>
<section>
<h3>Programming Languages</h3>
<!--<p>For example:</p>-->
<ul>
<li>To develop websites, you might use HTML, JavaScript, Python, Java, PHP.</li>
<li>To create databases and move information in and out of them, you might use MySQL, SQL, Dbase.</li>
<li>To write applications like Microsoft Word or Adobe Acrobat, you might use C++, Java, Visual Basic</li>
</ul>
</section>
<section>
<h3>Important to Remember</h3>
<ul>
<li>One of the most important things to remember is that when programming, you are doing something for people, and that the computer and the program mediate that. <a href="http://www.developsense.com" target-"_blank">~Michael Bolton</a> (Software Tester extraordinaire)</li>
</ul>
</section>
<section>
<h3>Computers are dumb</h3>
<ul>
<li>Computers can only do what they have instructions for-- and they take those instructions VERY literally.</li>
<li>As a result, you have to tell them every single thing you want them to do and every single thing to take into consideration. </li>
<li>If you leave any instructions out (or put them in the “wrong” order), the results might not be what you expect.</li>
</ul>
</section>
<section>
<h3>Demonstration</h3>
<ul>
<li>One person is the "program", and one person is the "computer".</li>
<li>The "computer" has to do literally what the "program" says to do!</li>
<li>We did one person (program) telling the other person (computer) what to do verbatim (answering the phone)</li>
</section>
<section>
<h3>Memory</h3>
<ul>
<li>A computer doesn’t have a memory like we do. Sure, a computer has “memory”-- In fact it has a couple of kinds...</li>
</ul>
</section>
<section>
<h3>Kinds of Memory - ROM</h3>
<ul>
<li><b>ROM</b> or <b>Read-only memory</b> is the more permanent kind.</li>
<li>ROM is used in the computer so that the processor does not have to look for important pieces of data when switched on, like the operating system.</li>
<li>For the most part, you cannot edit files in ROM and data on it cannot be erased by turning off your computer.</li>
</ul>
</section>
<section>
<h3>Kinds of Memory - Storage</h3>
<ul>
<li>More permanent, more long term memory.</li>
<li>This memory is what the computer uses to store programs and files that you create.</li>
<li>Examples would be the hard drive on the computer, thumb drive, or external hard drive.</li>
<ul>
</section>
<section>
<h3>Kinds of Memory - RAM</h3>
<ul>
<li><b>RAM</b> or <b>Random-access memory</b> is less permanent.</li>
<li>RAM is the memory that the computer uses to do its "thinking" (such as when you're working on a Word document, the changes you make before you hit Save, are stored in RAM).</li>
<li>When computer is turned off, data in RAM is gone and cannot be recovered unless it has been saved.</li>
</ul>
</section>
<section>
<h3>Programming structures</h3>
<ul>
<li>No matter what programming language you use, the structures that are available are fairly similar.</li>
<ul>
<li>Variables</li>
<li>Logical structures:</li>
<ul>
<li>If/Else statements</li>
<li>Loops</li>
</ul>
</ul>
</ul>
</section>
<section>
<h3>Variables</h3>
<ul>
<li>A variable is essentially a storage container for information.</li>
<li>Examples:</li>
<ul>
<li>age = 28</li>
<li>color = blue</li>
</ul>
<li>There are different kinds of variables based on the information that you want to store.</li>
</ul>
</section>
<section>
<h3>Integer Variables</h3>
<ul>
<li>Integer variables are used to store positive or negative whole numbers.</li>
<li>Examples:</li>
<ul>
<li>Amazon: number of books you can order is an integer (also the number in 'cart').</li>
<li>More than likely, Amazon stores this field as an integer because they’ll want to do calculations with it. If you order 2 copies of a book, the program multiplies the price by 2 to get the total cost.</li>
<li>Another example is in eBay. When you select something to order, the quantity is an integer. See what happens when you put in the letter 'a' or a special character like '@'.</li>
</ul>
</ul>
</section>
<section>
<h3>String Variables</h3>
<ul>
<li>String variables are used to store text.</li>
<li>Examples:</li>
<ul>
<li>Staying with Amazon, if you went into your profile, fields like name, address, state, and city are strings.</li>
<li>Usually when a string is created in the program, it's surrounded by quotation marks.</li>
</ul>
</ul>
</section>
<section>
<h3>Numbers as strings</h3>
<ul>
<li>You <b>can</b> store a number as a string variable.</li>
<li>If you store a number as a string variable, you can’t use it in any math calculations.</li>
<li>For example, credit card numbers are integers but you would never use them in a mathematical calculation.</li>
<li>Another example would be postal codes. Even though the USA uses only numbers, not all countries do. So if you make your zip code field an integer, no other country can use it except the USA.</li>
</ul>
</section>
<section>
<h3>Boolean Variables</h3>
<ul>
<li>Boolean variables are used to store the value <b>TRUE</b> or <b>FALSE</b> (yes or no).</li>
<li>You define a condition, then use a Boolean to tell the computer whether that condition is true or false.</li>
<li>Example:</li>
<ul>
<li>Amazon: If the login equals true, your name shows up, your cart is populated, etc.</li>
</ul>
</ul>
</section>
<section>
<h3>Logical structures</h3>
<ul>
<li>Now that you can store data, you probably want to do something with it.</li>
<li>Logical structures provide the framework for using that data to "get stuff done".</li>
<li>If you understand the concepts, you can learn how to represent them in most programming languages.</li>
</ul>
</section>
<section>
<h3>Operators</h3>
<ul>
<li>Operators are words or symbols that let you compare, combine, or evaulate something to produce an output.</li>
<li>A few xamples:
<ul>
<li>= (equal to)</li>
<li>> (greater than)</li>
<li>< (less than)</li>
<li>>= (greater than or equal to)</li>
<li>< = (less than or equal to)</li>
<li>!= (not equal)</li>
<li>and</li>
<li>or</li>
</ul>
</ul>
</section>
<section>
<h3>If/Then/Else</h3>
<ul>
<li>If/Then/Else statements evaluate a condition and take actions based on the result:</li>
<ul>
<li>If the condition is true, the computer does the action or actions that are listed after the <b>IF</b> statement (in some languages, the "Then" is implied).</li>
<li>If the condition is false, the computer does the action or actions that are listed in the <b>Else</b> statement.</li>
</ul>
</ul>
</section>
<section>
<h3>If/Then/Else Examples</h3>
<ul>
<li>Still staying with Amazon.</li>
<ul>
<li>"IF" you're logged in, show your name and cart numbers. "ELSE", show the login page.</li>
<li>"IF" you're an Amazon Prime member, you get free shipping. "ELSE", you get to pay for shipping!</li>
</ul>
</ul>
</section>
<section>
<h3>Let's Do Some If/Then/Else! (1/4)</h3>
</section>
<section>
<h3>If/Then/Else Excercises (2/4)</h3>
<ul>
<li>For this excercise, we're using <b>Ruby</b>.</li>
<li>Go to <a href="http://repl.it/languages" target="_blank">repl.it,</a> which is an online terminal to practice writing code.</li>
<li>Choose 'Ruby'.</li>
</ul>
</section>
<section>
<h3>IF Excercise (3/4)</h3>
<pre><code="html">
cart_total = 8
if cart_total > 2
print "You get free shipping!"
end
</code></pre>
<ul>
<li>Change the numbers to see what happens.</li>
<li>Change the operators (greater than, less than, etc.)</li>
</ul>
</section>
<section>
<h3>IF/THEN/ELSE Excercise (4/4)</h3>
<ul>
<li>ELSE is the companion to the IF statement. An IF/THEN/ELSE statement says "If the statement is true, run this block of code; if it's not true, run the code after the else statement."</li>
</ul>
<pre><code="html">
cart_total = 8
if cart_total > 2
print "You get free shipping!"
else
print "You'll have to pay for shipping."
end
</code></pre>
<ul>
<li>Change the numbers to see what happens.</li>
<li>Change the operators (greater than, less than, etc.)</li>
<li>Change the string statements.</li>
</ul>
</section>
<section>
<h3>Loops (1/2)</h3>
<ul>
<li>A loop is a list of instructions that repeats until a certain condition is reached.</li>
<li>Two kinds of loops are <b>For Loops</b> and <b>While Loops</b>.</li>
</ul>
</section>
<section>
<h3>Why Use Loops? (2/2)</h3>
<ul>
<li>Using loops is very powerful. One of the main reasons to use loops is to reduce your lines of code.</li>
<li>Depending on what you're doing, you could have hundreds of lines of code using "IF/THEN/ELSE", or you could write a simple Loop statement.</li>
</ul>
</section>
<section>
<h3>Let's Do Some Loops! (1/4)</h3>
</section>
<section>
<h3>Loop Excercise (2/4)</h3>
<ul>
<li>For this excercise, we're using Python.</li>
<li>Go to <a href="http://repl.it/languages" target="_blank">repl.it,</a> which is an online terminal to practice writing code.</li>
<li>Choose 'Python'.</li>
</ul>
</section>
<section>
<h3>Loop (while) Excercise (3/4)</h3>
<pre><code="html">
papers_to_deliver = 65
while papers_to_deliver > 0:
print papers_to_deliver
papers_to_deliver = papers_to_deliver - 1
print 'Out of papers! Go home!';
</code></pre>
<ul>
<li>Change the numbers to see what happens.</li>
<li>Change the operators (greater than, less than, etc.)</li>
<li>Change the string statements.</li>
<li>See the next slide that will explain what is happening in the loop (via a diagram).</li>
</ul>
</section>
<section>
<img src="images/loop-illustration.png" />
</section>
<section>
<h3>WHILE Loop Examples</h3>
<ul>
<li>Amazon or eBay: "WHILE" it's today, display the daily deals.</li>
<li>Amazon cart: "WHILE" it's this book, display the book's image, title, price, etc.</li>
</ul>
</section>
<section>
<h3>Beware the Infinite Loop!</h3>
<ul>
<li>An infinite loop is a loop that will never meet the condition to stop. It will keep going until it's used up all your computer's (or server's) memory (RAM). This is bad!</li>
<li>Example: In the While loop:</li>
<ul>
<li>If the "papers_to_deliver = papers_to_deliver - 1" line was missing, it would keep looping because 65 is always greater than 0!</li>
<li>If "papers_to_deliver = papers_to_deliver - 1" was changed to "+ 1", it would keep adding 1 to 65 forever!</li>
</ul>
</ul>
</section>
<section>
<h3>Project Implementation <br> Example</h3>
<ul>
<li>When companies implement a new program, they take various things into consideration:</li>
</ul>
<ol>
<li>Possible languages to use:
<ul>
<li>Python: computer program</li>
<li>SQL: manage the data</li>
<li>HTML/CSS: web development to share on the Internet</li>
</ul>
<li>Programming structures:</li>
<ul>
<li>Variables: place to store the information such as, colors, amounts, etc.</li>
<li>Detailed steps to tell the computer what to do.</li>
<li>Loops: Instructions that keeps repeating as neccessary.</li>
</ul>
</ol>
</section>
<section>
<h3>Coding Classes Resources (most are free) and Books</h3>
<ul>
<li>Code year:<a href="http://www.codecademy.com/tracks/code-year" target="_blank">www.codecademy.com/tracks/code-year</a></li>
<li>Codecademy: <a href="http://www.codecademy.com" target="_blank">www.codecademy.com</a></li>
<li>Coursera: <a href="https://www.coursera.org" target="_blank">www.coursera.org</a></li>
<li>Kahn Academy: <a href="https://www.khanacademy.org" target="_blank">www.khanacademy.org</a></li>
<li>Skillcrush: <a href="http://skillcrush.com" target="_blank">www.skillcrush.com</a></li>
<li>Udacity: <a href="https://www.udacity.com" target="_blank">www.udacity.com</a></li>
<li>Udemy: <a href="https://www.udemy.com" target="_blank">www.udemy.com</a></li>
<li>And of course, <a href="http://www.girldevelopit.com/chapters/boulder" target="_blank">GDIBoulder!</a></li>
<li> <a href="http://www.amazon.com/Program-Second-Edition-Facets-Series/dp/1934356360" target="_blank">Learn to Program</a>, by Chris Pine</li>
<li> <a href="http://www.amazon.com/Everyday-Scripting-Ruby-Teams-Testers/dp/0977616614/ref=sr_1_1?s=books&ie=UTF8&qid=1405369294&sr=1-1&keywords=everyday+scripting+with+ruby" target="_blank">Everyday Scripting in Ruby</a>, by Brian Marick</li>
</ul>
</section>
</div>
<footer>
<div class="copyright">
Introduction to Programming Concepts (for True Beginners!) ♥ Girl Develop It Boulder
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc/3.0/80x15.png" /></a>
</div>
</footer>
</div>
<script src="reveal/lib/js/head.min.js"></script>
<script src="reveal/js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/none
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'reveal/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'reveal/plugin/markdown/showdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'reveal/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
{ src: 'reveal/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>