Overview of the Course
Computing in the Department
Steps to get set up:
- Introduction to departmental computing resources and policies by Jamison Orton, CSR.
- Statistics Computing Resources (login required; try again if you get "Access Denied").
- Introduction to the
rencher.byu.edu
server.
- Text-based login using SSH:
- Linux and Mac: Built-in SSH client.
- Windows: Use PuTTY.
- File transfer using SCP:
- Linux and Mac: Built-in SCP client.
- Windows: Use WinSCP.
- Access your account on
rencher
and change your password:
- Login:
ssh net_id@rencher.byu.edu
- Enter your temporary password.
- Change password using
passwd
and follow the prompts.
Introduction to vi
Familiarize yourself with basic UNIX commands:
cd
, ls
, mkdir
, rm
, rm -r
, cp
, vi
, mv
, scp
For off-campus access, install the VPN client.
Introduction to R and Python
Using Scripts in Batch Mode
Learn to run scripts in batch mode for R and Python.
Working with tmux
- Use tmux for split screen vi/R or vi/Python sessions.
- More on tmux: Cheat Sheet
Configuration Files
Setting Up Git for STAT 624
-
Generate an SSH key:
- Run:
ssh-keygen -C "your.email@example.com"
- Accept the default file location or specify your own.
- Optional: Provide a passphrase or press Enter to skip.
-
Add your SSH key to GitHub:
- View your key:
cat ~/.ssh/id_rsa.pub
- Copy the output and add it to GitHub under Settings > SSH and GPG Keys.
-
Clone repositories:
- General Repository:
git clone git@github.com:BYU-STAT624/general_624.git
- Personal Repository:
git clone git@github.com:BYU-STAT624/"net_id".git
Submitting Homework
- Pull updates:
git pull
- Stage files:
git add filename
or git add .
- Commit changes:
git commit -m "message"
- Push changes:
git push
Tip: Use git status
often to check for changes.
Best Coding Practices
- Well-commented code (3 pts)
- Scripts begin with a description of the contents
- Library calls appear at the start of the code
- Variables are well-labeled and meaningful
- Code is properly indented for readability
- Reusable values are assigned to variables
- File paths are local, not global
- Loops are avoided where possible
Examples:
Debugging Tips
- Ensure all necessary packages are loaded
- Check for matching parentheses
- Print small pieces of code for testing
- Run code line-by-line outside loops
- Create flags for debugging
- Use plots to verify intermediate results
- Note: Not all bugs throw errors
- Search errors on Google or AI bots
Recommended Resource: Debugging for Beginners
Practice Debugging: