computer systems organization recitation - github pages · • if you want to send us a private...
TRANSCRIPT
![Page 1: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/1.jpg)
ComputerSystemsOrganizationRecitation
CSCI-UA0201-007
R01:Introduction&EnvironmentSetup
ManyslidesarebasedonJohnWesthoff’s Fall2019CSOrecitation
![Page 2: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/2.jpg)
Beforewegetstarted
• Gotohttps://nyu-cso.github.io/labs/ andstartthedownloadfortheversionofVirtualBox relevanttoyou• StartthedownloadfortheclassVMimage
2
![Page 3: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/3.jpg)
LogisticsImportantthingsyoushouldknow
3
![Page 4: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/4.jpg)
Whatisthisrecitationfor?
• Helpyoubetterunderstandthecoursecontents,includingbutnotlimitedto:- Reinforcethisweek’slecturecontent- Reviewpreviousweek’sassessment- Someexercisesmeanttohelpwiththelabs/assessments
• Makeusallsufferbyforcingusoutofbedearly
4
![Page 5: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/5.jpg)
Wherewereleasecoursematerials
• Coursewebsite- https://nyu-cso.github.io/- Recitationslidesalsoonthecourseschedulepage
• NYUClasses- Zoomlinks/recording
• CampusWire- It’syourresponsibilitytoreadInstructor’sNoteonCampuswire- YouareencouragedtoaskquestionsonCampuswire
• GitHub- AlllabsarereleasedonGitHub- YouwillsubmitalllabsonbothGitHubandGradescope
• Gradescope- Weeklymini-quizonGradescope
5
![Page 6: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/6.jpg)
Howtocontactus
• Don’tbeafraidtoaskquestions!• Ifyouhavegeneralquestionsaboutcoursecontentsorlabs
- AskonCampuswire- Cometoofficehours- Registerthein-personrecitation
• Ifyouwanttosendusaprivatemessage- [email protected]
- Includeyourname,yourGitHubusername,andyourNYUNetID
Ifyouwantmorepersonaltutorialorquestionanswering
6
![Page 7: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/7.jpg)
Howarewegoingtoproceed?
• Forthefirsttwoweeks,wewillfocusonenvironmentsetups,usageofbasictools,etc.- Todaywewillcoverenvironmentrelatedsetups- Nextrecitationwillcoverprogrammingtools(6labs,bonus)
• Fromthethirdweek- Wewillreviewweeklyassessment,reinforcesomecoursecontents,exercisestoprepareforyourlabs
• WeeklyassessmentswillbedueFriday9pmEST- DoneonGradescope,doitearly- Nolatesubmission
7
![Page 8: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/8.jpg)
AcademicIntegrity
• Allworkmustbeyourown– donotcopyorevenlookatassignmentsdonebyothers- Don’taskStackOverflow orChegg forhelp- ifyouneedit,askus!- Don’thiresomeonetodoyourworkforyou
• WereservetherighttousesoftwareplagiarismdetectiontoolssuchasMoss• It’snotworththerisk,justdon’tcheatandmakeussad
8
![Page 9: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/9.jpg)
GettingStartedImportantthingsyoumustdo
9
![Page 10: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/10.jpg)
Today’sTopics
• Settingupyourvirtualmachine• Settingupyourgit repositories• BasicUnixcommands• Programdevelopment• Editor(Sublime)• Versioncontrol(Git)
10
![Page 11: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/11.jpg)
Today’sGoal
• Bytheendoftoday’srecitation,yourshould• Havetheclassvirtualmachineinstalled• HaveGitHubreadyforyoutosubmitwork
• Anaccount• Lab-1repository• Knowhowtosubmitassignments
11
![Page 12: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/12.jpg)
Basicvirtualmachinesetup
• Followhttps://nyu-cso.github.io/labs/ instructionsto• DownloadVirtualBox 6.0.10• DownloadourVirtualBox image• LaunchVirtualBox andimporttheimage• LaunchLubuntu Linux
• Username“lab”,password“lab12345”
12
![Page 13: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/13.jpg)
AdvancedVMsetup
• Afterfinishingthebasicsetup,youaregoodtogo• Butifyouwantto• ResizetheVMwindowtofullscreennicely• CopyandpastebetweentheVMandyourlaptop• MovefilesbetweenyourlaptopandtheVM
• ThencheckourtheLabinstructionpage!• https://nyu-cso.github.io/labs/• Recommendit!
13
![Page 14: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/14.jpg)
Attention: YouMUST testyourcodeinyourclassvirtualmachine• Werecommendyoutodoyourlabsinyourvirtualmachineweprovidetoyou,andtestitbeforesubmission• MoretoolsareavailablefordebugginginVM(gdb etc.)• Gradescope runsthesametestscript• Ingeneral,thereshouldbenosurprises
• Ifyouchoosetodoyourlabsoutsideoftheclassvirtualmachine,wewillnotprovideanytechnicalsupportshouldyouencounteranyOS-relatedissuesindoingthelabs
14
![Page 15: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/15.jpg)
Openupaterminal
• Clickthe“LXterminal”icononthedesktop• ORclickstarticon(thebottomlefticon)• Click“SystemTools”andthen“LXterminal”
• ORusethekeyboardshortcut• Ctrl+Alt+T
• Tocopypasteinaterminal,youneedtouse• Ctrl+Shift+Ctocopy• Ctrl+Shift+Vtopaste• Orjustrightclick
15
![Page 16: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/16.jpg)
BasicCommands
• Someusefulcommandstoknow:• man• ls,cd,pwd,mkdir• cp,mv,rm• echo,cat• wc• grep• ctrl-c,ctrl-d,ctrl-z,fg,bg• |,>,<,>>• aptinstall/search• history,ctrl-r
16
![Page 17: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/17.jpg)
BasicCommands
• Wheneveryouwanttofindouthowtodosomethingusingcommandline,askGooglefirst• Hereisalinkcontainsusefulcommand,forbothbeginnersandexperiencedusers:• https://github.com/jlevy/the-art-of-command-line
17
![Page 18: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/18.jpg)
Editor
• Youneedagoodeditortocodewithforproductivity• Populareditorsusedbyprogrammers:• vim• emacs• vscode• sublime
• WerecommendyouuseSublimeText• WhichshouldbealreadyinstalledontheVMimage
18
![Page 19: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/19.jpg)
SetupGitHub/lab1repo
• CreateaGitHubaccountifyoudon’thaveone• WehavecreatedforyouacorrespondingprivatelabrepositoryonGithub.com• EnrollyourselfintheGitHubclassroom• Createyourlab-1repositorybyclickingthelinkbelow
• https://classroom.github.com/a/RvmnAdGI• SelectyourNYUNetID
• Veryimportant!• Don’tselectsomeoneelse’sNetID!
• IfyoucannotfindyourNetID,letmeknow!
19
![Page 20: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/20.jpg)
Git Overview
• Distributedversioncontrol system• Whatisversioncontrol?• Manageschanges todocuments,sourcefilesandothercollectionsofinformation
• Whyisversioncontrolindispensable?• Historytracking:trackcodechanges• Rollbacktoolderversion• Collaborate withothers(collaborativehistorytracking)
• Wearegoingtousethepopular“Git”asourversioncontrolsystem
Create things
Save things
Edit things
Savethethingagain
20
![Page 21: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/21.jpg)
Youneedtoconfig git first!
• git config --globaluser.email “<YourEmail>”• git config --globaluser.name “<YourName>”• Youcanissue“git config --list”tocheckyourconfiguration• Here,the<YourEmail> shouldbetheoneassociatedwithyourGitHubaccount
21
![Page 22: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/22.jpg)
Alistofgit commandsyouneed
• git clone• git status• git remote• git add<filename>• git commit-m<commitmessages>• git pushoriginmaster• git pullupstreammaster
22
![Page 23: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/23.jpg)
Git Overview
• GitHub:• provideshostingforsoftwaredevelopmentandversioncontrolusingGit.
YourVM
Makechangeslocally
SubmitassignmentstoGitHub
PullassignmentsfromGitHub(clonelabrepo)
GitHub
23
![Page 24: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/24.jpg)
Cloneyourlabrepolocally
• Incommandline,type:• mkdir cso-labs• cdcso-labs• git clonehttps://github.com/nyu-cso-fa20/clab-part1-<YourGithubUsername>.git lab1• Ifyoucopytheabovecommandtocommandline,don’tletthelinebreak• Replace<YourGitHubUsername>(includingtheanglebrackets)withyourGitHubusername.
• cdlab1
24
![Page 25: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/25.jpg)
Git SetupTheremotecopyisstoredinsomeefficientformat
25
![Page 26: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/26.jpg)
Acloserlookatyourlocalrepository
Localrepository26
![Page 27: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/27.jpg)
HowtointeractwithGit
• git addhello_world.c• Tellgit totrackchangestohello_world.c
• git commit• Storetrackedfileto.git
• git pushoriginmaster• Submitcommitstoyourremoterepository
27
![Page 28: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/28.jpg)
Foreachnewassignment
• CreatelabrepoonGitHub(clicklink,selectyourself)• Cloneyourlabrepolocally
• cdcso-labs• git clonehttps://github.com/nyu-cso-fa20/clab-part1-<YourGithubUsername>.git lab1
• ThenmakechangeslocallyintheVM• Tellgit totrackchanges
• git addfilenames
• Commityourchanges• git commit-m“commitmessages”
• Pushtoyourremoterepository(onGitHub)• git pushoriginmaster
28
![Page 29: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/29.jpg)
Git commit
• Whenyouissue“git commit”,youneedtoprovideamessagewhichisashortdescriptionofthechangesyoumade• Youcanuse“-m”optiontoprovidethecommitmessage• E.g.:git commit-m“myfirstcommit”
• Ifyoudon’tuse“-m”option,ancommandlineeditorwillpopupforyoutoeditthecommitmessage• Bydefault,nano
29
![Page 30: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/30.jpg)
HowtogetoutofNanoEditor
• ThedefaulteditoriscalledNano
• Toaddacommitmessagefromnano• Firsttypeinsomecommitmessage• HitCtrl+O tosaveyourcommitmessage(^meansCtrl)• HitCtrl+X toexit
30
![Page 31: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/31.jpg)
Doublecheckwith“git status”
• Sometimes,youmightforgettodosome(orall)of• git add,git commit,git push
• It’salwaysgoodtocheckthestatusofyourrepository• git statustellsyou• Whatfilesaregoingtocommit• Whatfilesarenottracked• Whetheryouforgettopushcommitstoremote
31
![Page 32: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/32.jpg)
TriplecheckwithGitHub
• Stillnotsure/confidentaboutwhetherassignmentwassubmittedproperly?• Gotogithub.com,thengotoyourrepo• Manuallycheckifeveryfilecontainstheup-to-dateinformation
32
![Page 33: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/33.jpg)
Git ismuchpowerfulthanthat
• Ourgit introductiononlycoversasmallpartofGit• Git tutorial:• https://www.atlassian.com/git/tutorials/what-is-versioncontrol• https://try.github.io/levels/1/challenges/1
33
![Page 34: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/34.jpg)
Allthegit commandsyouneedforCSO
• Forbeginners,it’ssupereasytomessupGit• Aftersettinglabrepository,youONLYneedtousethefollwing gitcommands:• git addfilenames• git commit-m“commitmessage”• git pushoriginmaster• git cloneyour-lab-repolab• git status
Warning:unlessyouknowwhatyouaredoing,donotuseanyothergit commandsorgit commandflags
34
![Page 35: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/35.jpg)
Askthestaffforhelp
• Ifyoureallycannotfixconflictsorothergit problems,youshouldaskcoursestaffforhelp• Youneedtoemailthestafforattendofficehours
• Onlinemakesthingsharder..• Youshouldstartyourlabearlier
• Don’trandomlyissuecommandstofurthermessthingsup
35
![Page 36: Computer Systems Organization Recitation - GitHub Pages · • If you want to send us a private message - Email cso-staff mailing list at cso-staff@cs.nyu.edu - Include your name,](https://reader035.vdocuments.us/reader035/viewer/2022062607/6054208d6587e8111504570e/html5/thumbnails/36.jpg)
ThingsyoushouldNEVER do
• Don’tusegit add*,git add.• Instead,youshouldalwaysspecifythefilenamesyouwanttocommit• Pleasedon’taddcompliedprogramstogit
• Don’tmodifyanyfileusingGitHubwebsite• Instead,youshouldalwaysmakechangeslocallyonyourlaptopandthenpushcommitstoGitHub• Otherwise,therewillbeconflicts,whichwillleadtosadness
36