Skip to content

Commit bc344f7

Browse files
authored
Merge pull request #192 from eecs280staff/vscode-revisions
VS Code Tutorial Revisions
2 parents 66345e5 + 8f91337 commit bc344f7

22 files changed

+428
-309
lines changed

docs/Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Sample makefile for EECS 280 Setup Tutorials
2+
3+
CXX ?= g++
4+
CXXFLAGS ?= -Wall -Werror -pedantic -g --std=c++17 -Wno-sign-compare -Wno-comment
5+
6+
# Compile the main executable
7+
main.exe: main.cpp
8+
$(CXX) $(CXXFLAGS) main.cpp -o main.exe
9+
10+
# Remove automatically generated files
11+
clean :
12+
rm -rvf *.exe *~ *.out *.dSYM *.stackdump
13+
14+
# Disable built-in rules
15+
.SUFFIXES:

docs/images/vscode_macos_017.png

262 KB
Loading

docs/images/vscode_macos_030.png

-153 KB
Loading

docs/images/vscode_macos_031.png

-372 KB
Loading

docs/images/vscode_wsl_012.png

-36 KB
Loading

docs/images/vscode_wsl_013.png

2.53 KB
Loading

docs/images/vscode_wsl_013a.png

4.65 KB
Loading

docs/images/vscode_wsl_015.png

60.2 KB
Loading

docs/images/vscode_wsl_017.png

135 KB
Loading

docs/images/vscode_wsl_030.png

-55.8 KB
Loading

docs/images/vscode_wsl_031.png

-117 KB
Loading

docs/images/vscode_wsl_031a.png

-83.6 KB
Loading

docs/images/vscode_wsl_032.png

-176 KB
Binary file not shown.

docs/images/vscode_wsl_033.png

-5.42 KB
Loading

docs/images/vscode_wsl_034.png

-627 KB
Loading

docs/images/vscode_wsl_035.png

102 KB
Loading

docs/images/vscode_wsl_069.png

-9 KB
Binary file not shown.

docs/main.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
// main.cpp
2-
// Project UID 5366c7e2b77742d5b2142097e51561a5
1+
// Sample main.cpp for EECS 280 Setup Tutorials
32

4-
#include "stats.h"
5-
#include "p1_library.h"
63
#include <iostream>
4+
#include <vector>
75
using namespace std;
86

9-
int main() {
10-
cout << "hello from main!\n";
7+
double sum (const vector<double> &data) {
8+
double total = 0;
9+
for (size_t i=0; i<data.size(); ++i) {
10+
total += data[i];
11+
}
12+
return total;
1113
}
14+
15+
int main() {
16+
vector<double> data;
17+
data.push_back(10);
18+
data.push_back(20);
19+
data.push_back(30);
20+
cout << "sum(data) = " << sum(data) << endl;
21+
}

docs/setup_macos.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ macOS command line tools
99

1010
macOS comes with a Terminal and can run UNIX command-line tools directly.
1111

12-
When you see `$` in this tutorial, you should type into your shell the command that comes after the `$`.
12+
The macOS terminal command prompt ends with a `$`. To follow the steps below, type commands that appear after the `$` and hit enter.
1313

1414
## Open terminal
1515
Open the Terminal application which comes with macOS.
@@ -51,7 +51,7 @@ Close your terminal and reopen your terminal.
5151
Check your install. Your version might be different.
5252
```console
5353
$ brew --version
54-
Homebrew 3.6.14
54+
Homebrew 4.3.18
5555
```
5656

5757
## Install CLI tools
@@ -60,6 +60,36 @@ Use the Homebrew package manager to install a few command line programs.
6060
$ brew install wget git tree
6161
```
6262

63+
## Home Directory
64+
Run `cd ~`. This will take you to your Ubuntu home directory. Running `pwd` afterward confirms the location. (Your username will be different.)
65+
66+
```console
67+
$ cd ~
68+
$ pwd
69+
/Users/jjuett
70+
```
71+
72+
Create an EECS 280 folder by running `mkdir ~/eecs280`. Running `ls` afterward confirms the folder has been created.
73+
74+
```console
75+
$ mkdir ~/eecs280
76+
$ ls
77+
Desktop Downloads Movies Pictures eecs280
78+
Documents Library Music Public
79+
```
80+
81+
We highly recommend you store all coding work for EECS 280 projects and labs here.
82+
83+
<div class="primer-spec-callout warning" markdown="1">
84+
**Pitfall:** Avoid paths that contain spaces. Spaces cause problems with some command line tools.
85+
86+
| Bad Example | Good Example |
87+
|-----------------|----------------|
88+
| `EECS 280/` | `eecs280/` |
89+
| `Project 1 Stats/` | `p1-stats/` |
90+
91+
</div>
92+
6393
## Use CLI tools
6494
Now would be a great time to take a look at our [CLI Tutorial](cli.html).
6595

0 commit comments

Comments
 (0)