Coursewrap-upandVersioncontrol - - PowerPoint PPT Presentation
Coursewrap-upandVersioncontrol - - PowerPoint PPT Presentation
Coursewrap-upandVersioncontrol NENS230:AnalysisTechniquesinNeuroscience Outline 1. WhentouseMatlab 2. Morepractice 3. VersionControlwithGit/Github 4. Courserecap Outline 1.
Outline
- 1. WhentouseMatlab
- 2. Morepractice
- 3. VersionControlwithGit/Github
- 4. Courserecap
Outline
- 1. When'to'use'Matlab'
- 2. Morepractice
- 3. VersionControlwithGit/Github
- 4. Courserecap
WhentouseMatlab
Matlabstrengths:
— Fasttodevelopcode — Manybuilt-infunctions — Relativelyeasysyntax — Fastformatrix(array)operations — powerfulvisualization
Matlabweaknesses:
— Slow(comparedtoC,C++,othercompiledlanguages) — Licensesare$$$andannoying.Anyonerunningyourcode musthaveMatlabinstalled — Can’tdevelopstandaloneapplications — Notageneralpurposelanguage
ReasonstoChooseMatlab
- 1. Yourcommunity/labusesitbydefault
(andyouwantyourcodetobeusefultoothers)
- biosciences(notbioinformatics)
- mechanical,electrical,aerospaceengineering
- psychology
- manyothers
- 2. Youwanttoprototypesomethingquickly
- 3. Exploratorydataanalysis(w/numericaldata)
Alternatives
Scientific'Python''
— iPython,scipy,numpy,matplotlib — verypopular,free
R'
— Optimizedforstatistics — Free — Widelyusedbybioinformatics/statisticians
Octave'
— BuilttobeafreeMatlabalternative — CanrunbasicMatlabcode(m-files)withoutanyhassle
Julia'
— NewprojectfromMIT,freeandopensourcealternative. Fewercompromises(fast,simple,free,generalpurpose),but stillverynew.
Outline
- 1. WhentouseMatlab
- 2. More'practice'
- 3. VersionControlwithGit/Github
- 4. Courserecap
Chooseyourownadventure
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-094-introduction-to- matlab-january-iap-2010/assignments/
Chooseyourownadventure
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-094-introduction-to- matlab-january-iap-2010/assignments/
Chooseyourownadventure
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-094-introduction-to- matlab-january-iap-2010/assignments/
Outline
- 1. WhentouseMatlab
- 2. Morepractice
- 3. Version'Control'with'Git/Github'
- 4. Courserecap
VersionControl
“PiledHigherandDeeper”byJorgeCham
Soundfamiliar? Therehastobea betterway!
VersionControlwith
— Whatisversioncontrol?
— Methodofkeepingtrackofdifferentversionsoftextfiles. Usefulfor: — iterativedevelopment,experimentalcode — sharingcode
— Whatproblemsdoesitsolve?Haveyouever:
- Made a change to code, realized it was a mistake and wanted to revert back?
- Wanted to share your code, or let other people work on your code?
- Lost code or had a backup that was too old?
- Had to maintain multiple versions of some code?
- Wanted to experiment with a new feature without interfering with working code?
- Wanted to see the difference between two (or more) versions of your code?
- Wanted to prove that a particular change broke or fixed a piece of code?
- Wanted to review the history of some code?
- Wanted to submit a change to someone else's code?
http://stackoverflow.com/questions/1408450/why-should-i-use-version-control
VersionControlSoftware
Severaloptionsavailable
— Git,SVN,Mercurial
Gitisde-factostandardandubiquitous
OftenusedwithGithub(onlineservicetohostGitrepositories
Farmoretocoverthanwehavetimefor.Thisis worthteachingyourself! Severalusefulresources:
— Verysimpleintro:http://try.github.io — Moredetailed:http://git-scm.com/book
gitterminology
– Code is stored in a repository (‘repo’) – Working Tree - the directory containing your current code – Commit - When you want to save a snapshot of your project or are finished with some analysis/new feature. – HEAD - The name of the currently checked-out commit
startinggit
— CanusethecommandlineoraGUItool(eg:github app) — Startagitrepository: >>> cd /project/folder >>> git init >>> git add ./*.m (or specific files) >>> git commit
Gitbasics
http://software-carpentry.org/v5/novice/git/01-backup.html
Gitbasics
http://software-carpentry.org/v5/novice/git/01-backup.html
Gitbasics
http://software-carpentry.org/v5/novice/git/01-backup.html
Demo: ¡git
Collaboratingwithgit
— Howcanyoushareyourlocalrepositorywithothers? — Twonewgitcommands:pushandpull
http://www.slideshare.net/jomikr/quick-introduction-to-git
http://www.slideshare.net/jomikr/quick-introduction-to-git
http://www.slideshare.net/jomikr/quick-introduction-to-git
http://www.slideshare.net/jomikr/quick-introduction-to-git
http://www.slideshare.net/jomikr/quick-introduction-to-git
http://www.slideshare.net/jomikr/quick-introduction-to-git
http://www.slideshare.net/jomikr/quick-introduction-to-git
http://www.slideshare.net/jomikr/quick-introduction-to-git
http://www.slideshare.net/jomikr/quick-introduction-to-git
gitworkingmodel
http://www.slideshare.net/jomikr/quick-introduction-to-git
Pushingchanges
— aftercommit,pushchangestoremoterepository >>> git push
Demo: ¡Github
Outline
- 1. WhentouseMatlab
- 2. Morepractice
- 3. VersionControlwithGit/Github
- 4. Course'recap
Whatwe’velearned
- 1. Programmingbasics
- 2. Loading,manipulating,slicingdata
- 3. Datavisualization
- 4. Controlflow:forloops,ifstatements
- 5. Writinggoodcode:comments,spacing,style
- 6. Statistics,signalprocessing,imageprocessing
- 7. Versioncontrol