forked from tch2/git-project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swc-sfu-062013-latest(1).html
357 lines (357 loc) · 14.5 KB
/
swc-sfu-062013-latest(1).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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<title>/swc-sfu-062013</title>
</head>
<body><b> Software Carpentry at Simon Fraser University</b><br
/>June 6-7 2013<br
/><br
/><br
/><i><u>Installation instructions.</u></i><br
/><br
/><b>PYTHON</b><br
/><br
/>We recommend the all-in-one scientific Python installer Anaconda CE <a href="http://continuum.io/downloads.html">http://continuum.io/downloads.html</a><br
/>Installation on Mac and Linux requires using the shell and if you aren't comfortable doing the installation yourself just download the installer and we'll help you at the boot camp.<br
/><br
/>For other options check the Python4Astronomers page on installing scientific Python <a href="http://python4astronomers.github.com/installation/python_install.html">http://python4astronomers.github.com/installation/python_install.html</a><br
/><br
/><br
/><b>EDITOR</b><br
/><br
/><b>Mac: </b>We recommend Text Wrangler (<a href="http://www.barebones.com/products/textwrangler/)">http://www.barebones.com/products/textwrangler/)</a>, Sublime Text (<a href="http://www.sublimetext.com/)">http://www.sublimetext.com/)</a>, or Text Mate 2 (<a href="https://github.com/textmate/textmate)">https://github.com/textmate/textmate)</a>.<br
/><b>Windows</b>: Notepad++ (<a href="http://notepad-plus-plus.org/)">http://notepad-plus-plus.org/)</a> is a popular free code editor for Windows.<br
/><b>Linux:</b> Kate (<a href="http://kate-editor.org/)">http://kate-editor.org/)</a> and gedit (<a href="http://projects.gnome.org/gedit/)">http://projects.gnome.org/gedit/)</a> are options for Linux users.<br
/><br
/><br
/><br
/><i>Even if you plan to install things yourself please download VirtualBox and the virtual machine as a backup. It can be extremely difficult to get everything set up correctly.</i><br
/><br
/><b>Virtual Machine</b><br
/>The simplest way to install all the requirements is to use a virtual machine. To get that, please install VirtualBox ( <a href="https://www.virtualbox.org/">https://www.virtualbox.org/</a> ) and download this virtual machine image (<a href="http://is.gd/MosNIh)">http://is.gd/MosNIh)</a>. Load the VM into VirtualBox by doing Import Appliance and loading the .ova file.<br
/><br
/><br
/>Schedule: <a href="https://github.com/SChamberlain/swc_sfu/blob/master/README.md">https://github.com/SChamberlain/swc_sfu/blob/master/README.md</a><br
/><br
/> Computing ID: lw1321<br
/>Your Password: H@Pb9j!E<br
/><br
/>Williams, Lynne<br
/>Your Computing ID: lw1322<br
/>Your Password: a6v8oN84<br
/><br
/>Elza, Dethe<br
/>Your Computing ID: lw1323<br
/>Your Password: z2UfD2RR<br
/><br
/>Gustavsen, Julia<br
/>Your Computing ID: lw1324<br
/>Your Password: aKg2R7mo <br
/><br
/>Andrew: if you want to get out of the virtual machine the command is "Right-Ctrl F"<br
/><br
/><br
/><br
/>In here, please write your favourite app<br
/><br
/>Date, Name, Price<br
/>2013-06-06,Dropbox, 0.00<br
/>2012-06-01, Dropbox, 0.00<br
/>2012-10-01, Skype, 0.00<br
/>2012-09-04, Earwolf, 0.00<br
/>2013-03-29, TripCase, $0.00 <br
/>2012 - jigoolibingool- 2$<br
/>2013-02-02, Google Sky, 0.00<br
/>2010-01-13, magicseaweed, 0.00<br
/>2011-01-01,Papers2,25.00<br
/>2013-31-05, Skype, 0.00<br
/>2013-01-01 TurkeyMaps 0.00 Turkey maps?! cool!Trip soon! Nice! me 2! when are you going?July (it's not a real app, though) What ever. I am going in july too. Have fun!<br
/>its not 100% yet though. You too :D Hooray for Turkey :) <br
/>2013-01-13, Flow, 0.00<br
/>2013-06-01, Papers2, 40.00<br
/>2013-06-06, foobar, 0.00<br
/>2013-01-30, Twitter, 0.00<br
/>2010-05-01, Papers, 19.95?<br
/>2013-06-06, Gobbeldygook, 1000000<br
/>2013-06-06, whatsapp, 0.00<br
/><br
/><br
/>history from session 1:<br
/><br
/> 503 whoami<br
/> 504 pwd<br
/> 505 cd /Volumes/GrosDisque/swc<br
/> 506 mkdir bootcamp<br
/> 507 echo Hello<br
/> 508 pwd<br
/> 509 mkdir bootcamp<br
/> 510 cd bootcamp<br
/> 511 pwd<br
/> 512 history<br
/> 513 history > file.txt<br
/> 514 ls<br
/> 515 cat file.txt<br
/> 516 rm file.txt<br
/> 517 ls<br
/> 518 mkdir toto<br
/> 519 echo making directory > anotherfile.txt<br
/> 520 pwd<br
/> 521 ls<br
/> 522 cat anotherfile.txt <br
/> 523 mv anotherfile.txt <br
/> 524 ls<br
/> 525 mv anotherfile.txt toto<br
/> 526 ls<br
/> 527 cd toto<br
/> 528 ls<br
/> 529 cd ..<br
/> 530 rm toto<br
/> 531 rmdir toto<br
/> 532 rm toto/anotherfile.txt <br
/> 533 rmdir toto<br
/> 534 ls<br
/> 535 echo Vlad > Vlad.txt<br
/> 536 cat Vlad<br
/> 537 cat Vlad.txt <br
/> 538 echo Wolfman > Vlad.txt<br
/> 539 cat Vlad.txt <br
/> 540 echo Vlad > Vlad.txt<br
/> 541 cat Vlad.txt <br
/> 542 echo Wolfman >> Vlad.txt <br
/> 543 cat Vlad.txt <br
/> 544 echo Vlad > Vlad.txt<br
/> 545 cat Vlad.txt <br
/> 546 echo Wolfman >> Vlad.txt <br
/> 547 cat Vlad.txt <br
/> 548 cat < Vlad.txt<br
/> 549 head -1 Vlad.txt<br
/> 550 tail -1 Vlad.txt <br
/> 551 cat Vlad.txt | less <br
/> 552 less Vlad.txt<br
/> 553 echo Unicorn >> Vlad.txt<br
/> 554 echo Dracula >> Vlad.txt<br
/> 555 cat Vlad.txt<br
/> 556 tail -2 Vlad.txt <br
/> 557 tail -2 Vlad.txt | head -1<br
/> 558 cp Vlad.txt Names.txt<br
/> 559 ls<br
/> 560 find -name V*<br
/> 561 find . -name V*<br
/> 562 find . -name V\*<br
/> 563 man find<br
/> 564 nano data.txt<br
/> 565 nano data.txt<br
/> 566 ls<br
/> 567 cat data.txt <br
/> 568 wc data.txt <br
/> 569 ls<br
/> 570 man wc<br
/> 571 wc -l data.txt <br
/> 572 wc -c data.txt <br
/> 573 mkdir backup<br
/> 574 ls<br
/> 575 mv data.txt backup/apps.txt<br
/> 576 ls<br
/> 577 ls backup/<br
/> 578 cd backup/<br
/> 579 ls<br
/> 580 cat apps.txt <br
/> 581 cut -d , -f 2 apps.txt <br
/> 582 cat apps.txt <br
/> 583 cut -d , -f 2 apps.txt > names_of_apps.txt<br
/> 584 cat names_of_apps.txt <br
/> 585 sort names_of_apps.txt <br
/> 586 sort names_of_apps.txt clear<br
/> 587 clear<br
/> 588 clear<br
/> 589 history | tail -87<br
/><br
/><br
/><br
/><br
/>Type this for git:<br
/><br
/>git config --global user.name "Bernhard Konrad"<br
/>git config --global user.email konradbe@math.ubc.ca<br
/>git config --global core.editor nano (on Windows, type: notepad instead of nano)<br
/>git config --global color.ui 'auto'<br
/>git config --global --list<br
/>cd ../<br
/>mkdir firstGit<br
/>cd firstGit/<br
/> pwd<br
/>>>/Users/user/Desktop/bootcamp/firstGit<br
/>git init<br
/>>>Initialized empty Git repository in /Users/user/Desktop/bootcamp/firstGit/.git/<br
/> ls -a<br
/>>>. .. .git<br
/><br
/>Task:<br
/>1) Create a new file that is a cheat sheet for the git commands we've learned so far. <br
/>2) Save the file as git_commands.txt<br
/>3) Commit the new file to your repository.<br
/>you will then have 2 files in your folder (and also in your repository)<br
/><br
/><br
/>Create a github account at <br
/><a href="https://github.com/">https://github.com/</a><br
/>and write your username in the etherpad here:<br
/><br
/><br
/><br
/>inspiration for "good" commit messages<br
/><a href="http://www.commitlogsfromlastnight.com/">http://www.commitlogsfromlastnight.com/</a><br
/><br
/><br
/># link to data file:<br
/><a href="https://raw.github.com/jkitzes/boot-camps/2013-04-ucb/python/sightings_tab_lg.csv">https://raw.github.com/jkitzes/boot-camps/2013-04-ucb/python/sightings_tab_lg.csv</a><br
/><br
/><br
/>Task: Print list of names of all animals in sightings.csv<br
/><br
/>#allAnimals.sh<br
/>cut -d , -f 3 ../data/sightings.csv | sort | uniq<br
/><br
/><br
/>Regular expression tester:<br
/><a href="http://regexpal.com/">http://regexpal.com/</a><br
/><br
/><br
/>If anything goes wrong in the shell, "CTRL+C" will solve it most of the time.<br
/><br
/><br
/>Please make sure you can log in to github:<br
/><br
/>www.github.com<br
/><br
/>Project we will be forking:<br
/><br
/><a href="https://github.com/LJWilliams/git-project">https://github.com/LJWilliams/git-project</a><br
/><br
/>add new sighting to sightings.csv and commit<br
/><br
/>Create an issue and assign it to somebody<br
/><br
/><br
/><br
/>Github user names:<br
/>LJWilliams<br
/>SChamberlain<br
/>reagananne<br
/>johnstongonzalez<br
/>christinaLK<br
/>sebpardo<br
/>jooolia<br
/>morobko<br
/>TBWarrington<br
/><br
/>LJWilliams<br
/> joelmsharding<br
/>castellarin<br
/>swsherry<br
/>FTswc<br
/>eringill<br
/>nickyrong (Nick Rong)<br
/>tch2<br
/>ask2<br
/>KumaDee<br
/>creeas<br
/>TBWarrington<br
/>mcetal<br
/>BernhardKonrad<br
/>Notgeekatall<br
/><br
/><br
/>----------------------------------------------------------------------------<br
/>----------------------------------------------------------------------------<br
/>----------------------------------------------------------------------------<br
/>END OF DAY 1<br
/>----------------------------------------------------------------------------<br
/>----------------------------------------------------------------------------<br
/>----------------------------------------------------------------------------<br
/>START DAY 2<br
/>----------------------------------------------------------------------------<br
/>----------------------------------------------------------------------------<br
/>----------------------------------------------------------------------------<br
/><br
/>Good morning everyone :)<br
/><br
/>Git "cheat sheet" is available from:<br
/><a href="http://www.git-tower.com/files/cheatsheet/Git_Cheat_Sheet_grey.pdf">http://www.git-tower.com/files/cheatsheet/Git_Cheat_Sheet_grey.pdf</a><br
/><br
/>Shell "cheat sheet" is available from:<br
/><a href="https://github.com/SChamberlain/swc_sfu/blob/master/shell/shell_cheatsheet.pdf">https://github.com/SChamberlain/swc_sfu/blob/master/shell/shell_cheatsheet.pdf</a><br
/><br
/>Things you will need today:<br
/><br
/><b>Python interpreter:</b><br
/><br
/>Type at your shell prompt:<br
/><br
/>$ python<br
/><br
/>You should get ">>>"<br
/><br
/>type "quit()" to exit<br
/><br
/><b>Ipython notebook:</b><br
/><br
/>Type at your shell prompt:<br
/><br
/>$ ipython notebook<br
/><br
/>You should get a browser page open with ipython notebook <br
/><br
/>git forked repository from yesterday afternoon: <br
/><br
/>e.g. <a href="https://github.com/jooolia/git-project.git">https://github.com/jooolia/git-project.git</a><br
/><br
/>Assign variables with the values 13,42 and "one million" with the types int, float and string respectively. Choose good variable names. <br
/><br
/>Bonus: Confirm the types of the variables. <br
/><br
/><br
/>Coerce your variables for 13 and 42 into strings. Check their type. <br
/><br
/>Calculate the mean of the numbers 2,3 and 10<br
/><br
/><b>How to share your ipython notebook</b>:<br
/><br
/>-commit your notebook in git<br
/>-push your commit to github<br
/>-pull up your file on your github.com page (e.g. <a href="https://github.com/jooolia/git-project/blob/master/SWC_SFU_pythonam.ipynb)">https://github.com/jooolia/git-project/blob/master/SWC_SFU_pythonam.ipynb)</a><br
/>-click on "raw" button (gives address like <a href="https://raw.github.com/jooolia/git-project/master/SWC_SFU_pythonam.ipynb)">https://raw.github.com/jooolia/git-project/master/SWC_SFU_pythonam.ipynb)</a><br
/>-insert url on this page: <a href="http://nbviewer.ipython.org/">http://nbviewer.ipython.org/</a><br
/><br
/>Use this to view your ipython notebook stored in your github repository:<br
/><a href="http://nbviewer.ipython.org/">http://nbviewer.ipython.org/</a><br
/><br
/><br
/><b>Python- Functions</b><br
/><br
/><br
/>In Matlab you are not forced to indent. Instead, you use an 'end' statement to indicate the end of a for-loop, function, etc. In C/C++/R it's {...}.<br
/>However, people still usually indent their code. Otherwise the logic is just unreadable. Hence the 'end' statement typically becomes redundant to the person who reads the code.<br
/>In other words: python forces everyone to use a good coding practice, making code much easier to read an understand. --> I was going to comment on this! I like having to put end at the conclusion of a loop or if/then statement, since it is easier to follow where the start and end point of each particular loop or if/then/else statement in the script is. Maybe I am biased though!<br
/><br
/><a href="http://nbviewer.ipython.org/urls/raw.github.com/dethe/swc_sfu/master/python/shell/Python%2520on%2520the%2520Command%2520Line.ipynb">http://nbviewer.ipython.org/urls/raw.github.com/dethe/swc_sfu/master/python/shell/Python%2520on%2520the%2520Command%2520Line.ipynb</a><br
/><br
/><br
/><br
/>Ted's repo:<br
/><br
/>webpage: <a href="https://github.com/emhart/SFU_SWC">https://github.com/emhart/SFU_SWC</a><br
/><br
/>git clone <a href="https://github.com/emhart/SFU_SWC.git">https://github.com/emhart/SFU_SWC.git</a><br
/><br
/>everything we did today is in your upstream repo (Including everything in the Etherpad). Before you leave for the day update your repo by <br
/><br
/>git pull upstream master<br
/><br
/><br
/><br
/><br
/></body>
</html>