Day 3 - Tuesday, April 8, 2014

Summary: Review UNIX shell and version control, introduction to iPython Notebook, first Project Euler problem.


  1. Review UNIX Shell
    • nano .bash_profile
      • # My bash shell configuration
      • alias ipynb='ipython notebook'
      • export PATH="/Applications/Anaconda/bin:$PATH"
    • Save and close terminal, open a new one
    • cd PHYS202-S14
    • git pull origin master
    • rmdir Week1
    • mkdir iPython
    • mkdir ProjectEuler
    • cd
    • pwd
  2. Intro to ipython notebook
    • How to open it
    • Basic navigation, help, etc.
    • Create a new notebook in the iPython directory and type a few python commands into a cell
      • print "Hello"
      • a = 10
      • print a
      • for i in range(0,10): print i
      • etc.
    • Have them give it a name: NotebookPractice (pay attention to case)
    • Show them markdown vs. code cells and have them create a title cell at the top of the notebook
  3. Intro to Project Euler, their first pair programming experience
    • Show them the problem, have them create the first PE notebook with name ProjectEuler1 in the ProjectEuler directory (pay attention to spaces, case)
    • Have them use Markdown to create a Header cell for the title of the PE problem and another for the problem description.
    • Add a markdown cell with Navigator: <name> and Driver: <name> in each notebook.
    • Let them work on the solution together as pairs.
    • Once they have a solution, close the first notebook and switch roles so the other has the code in their directory. Try to do it without looking.
    • Check that their code runs after restarting the kernel. If it does, close the notebook and work on Codecademy til everyone is finished.
  4. Have them save the changes to their repo with
    • git status
    • git add <files in status>
    • git commit -m 'saving Tuesday practice and Project Euler 1'
    • git push origin master
    • git status
    • Check github to see that the results are there
  5. Keep working on Codecademy

All content is under a modified MIT License, and can be freely used and adapted. See the full license text here.