# Lab 0: Setting Up for CS15 <img style="display: block; margin: auto;" width="500" src="https://hackmd.io/_uploads/SyuQAJ-nC.gif"></img> **The setup is just as important as the action...** Welcome to your first lab! Labs are opportunities for you to get hands-on experience with lecture material. In general, labs are graded on completion and you have a week to finish them. If you don’t finish any lab during your section, you can finish the lab on your own time and get checked off during next week’s section/lab or during conceptual hours. However, this week’s lab *must* be completed before you work on Rattytouille. <b></b> **This first lab will cover:** * Basic information about using the *Terminal*, or *Command Prompt*, on your computer * How to use basic git commands and GitHub to download files * How to write, compile, and run a simple Java program Whew! That's a lot to do in one lab. It’s okay if you don’t understand everything covered here — and be sure to ask TAs for help if you’re confused at any point! # Assignment Roadmap :::info ## **[Getting Started ](#Getting-Started)** [The Terminal](#The-Terminal)\ [Opening Terminal](#Opening-Terminal)\ [A Quick Introduction to the File System](#A-Quick-Introduction-to-the-File-System) ## **[An Exploration of Shell Commands ](#An-Exploration-of-Shell-Commands)** [Navigating Directories](#Navigating-Directories)\ [Shortcuts for Directories: “.” and “..”](#Shortcuts-for-Directories)\ [Making Directories and Files](#Making-Directories-and-Files) ## **[Finishing Java Set-Up ](#Finishing-Java-Set-Up)** [Using IntelliJ](#Using-IntelliJ)\ [For MAC/LINUX Users](#For-MAC-and-LINUX-Users)\ [For WINDOWS Users](#For-WINDOWS-Users) ## **[Using Git and Downloading Files ](#Using-Git-and-Downloading-Files)** [What is Git and GitHub?](#What-is-Git-and-GitHub)\ [Configuring Git Settings (for everyone)](#Configuring-Git-Settings-(for-everyone))\ [Authentication to GitHub (for everyone)](#Authentication-to-GitHub-(for-everyone))\ [Cloning lab0 Stencil (for everyone)](#Cloning-lab0-Stencil) ## **[Writing Java Programs ](#Writing-Java-Programs)** [Writing, Compiling, and Running Java Programs](#Writing,-Compiling,-and-Running-Java-Programs)\ [Hello World!](#Hello-World!) ## **[Important Forms ](#Important-Forms)** ## **[Addendums](#Addendum:-Updating-Github-Credentials)** [Addendum: Updating GitHub Credentials](#Addendum:-Updating-Github-Credentials)\ [Addendum: If Windows Script Doesn’t Work](#Addendum:-If-Windows-Script-Doesn't-Work) ::: **Structure** * Bulleted lists have instructions for you to follow. * For labs, code will be represented with **`this font`**. **IntelliJ** Prior to the lab, you should’ve already followed [these instructions](https://docs.google.com/presentation/d/1zKLG1S0J12CZENjvnps0E-o5_w8_ePqbFUUwmLk4pJw/edit?usp=sharing) to set up IntelliJ, a software we use in CS15 to write code. If you have questions about the instructions, ask a TA now! **Gradescope** First task is to check that you can login to Gradescope! We use Gradescope to hand in and grade code. All assignments must be handed in through Gradescope this year. You should have been added to the CS15 Gradescope, but double check this now! **What We Assume** This lab assumes that you have basic familiarity with using computers — how to use a keyboard and mouse, a web browser, and navigation menus. Please speak to a TA if you feel you do not have this level of background knowledge. **If you have any questions during the lab, please raise your hand, and a TA will assist you as soon as possible!** # <ins>Getting Started</ins> ## The Terminal Although you may have never known it, your computer offers a way to go “behind” the graphics and work more closely with what the computer is actually doing. One way of doing this is through the use of a “terminal” (for Macs/Linux) or “command prompt” (for Windows). For the rest of this lab, we’ll refer to both as a “terminal”. A terminal is a window that allows you to interact with your computer directly through written commands. ## Opening Terminal * To open a terminal, search on your computer for the application “terminal” (Macs/Linux) or “command prompt” (Windows). Open the application! Welcome to the terminal! You’ll see a new window with something like: **`Macbook-Pro:~ %`** or **`C:\Users\yourName>_`** displayed on the first line. If you start typing, you’ll notice your input appearing on the same line. The terminal works by accepting some command from the user, then evaluating the command and often returning some output text. * Type a sequence of random letters and then press enter. You will probably get a message that says “command not found”. Now we’ll move on to learn some common commands! ## A Quick Introduction to the File System Let's take a look at a sample command: **`pwd`** for Macs/Linux, which stands for “print working directory”, or **`cd`**, which stands for “current directory”, for Windows. The Windows Explorer and Mac Finder have the concept of a "current location" when browsing the file system, and all files are organized hierarchically, with directories (also known as folders) located one within another. All files and folders are contained within a "root" folder (directory). This "root" directory is just called "/". The “path” to a file or directory (i.e. its location in the file system) can be specified as either absolute or relative. An absolute path is defined as specifying the location of a file/directory with the root directory "/" as the reference point and leaves no ambiguity about its location. A relative path, however, defines the location with the current working directory as the reference point. **It’s easiest to remember that an absolute path starts with a “/”, while a relative path does not.** > *<ins>A note for Windows users</ins>: The Windows file system uses backslashes (“\”) rather than forward slashes ("/"). To avoid unnecessary repetition in this handout, we will by default use forward slashes.* > *<ins>Another note for Windows users</ins>: in Windows, there are two ways to write absolute paths: it can start with a "\" (absolute path from the root of the current drive), or with a "C:\" (absolute path from the root of the C drive), with the ability to replace "C" with other drive letters.* All subdirectories are also separated by a /, so the absolute path **`/stuff/things/my_thing.txt`** would represent a text file called "**`my_thing.txt`**", which is contained in the directory "**`things`**", contained in a directory "**`stuff`**", contained within the root directory "**`/`**". If your current directory was “stuff,” the relative path **`things/my_thing.txt`** would have the same meaning. The location of the current working directory can be found by using the command **`pwd`** ("print working directory") on MacOS/Linux or **`cd`** ("current directory") on Windows. * At the command prompt, type the command relevant to your operating system: &emsp;&emsp;&emsp;**`pwd`** for MacOS/Linux\ &emsp;&emsp;&emsp;**`cd`** for Windows. &emsp;&emsp;And press “enter.” <img style="display: block; margin: auto;" src="https://hackmd.io/_uploads/ryQejeGhC.png "></img> By default, new shells will start in your home directory, which is what the results of the command show. It will most likely be something like **`/Users/<YourName>`** but may be a bit different. Whatever it prints for you is your home directory, which is often abbreviated with the tilde character, **`~`**. > *<ins>A note for Windows users</ins>: Your current location is displayed in the terminal prompt already!* ![2](https://hackmd.io/_uploads/rJLlugMn0.png) # <ins>An Exploration of Shell Commands</ins> Let’s try out some of the most commonly used terminal commands. Note: press enter after each command to enter it. ## Navigating Directories <img style="float: right; margin-left: 10px" width="300" src="https://hackmd.io/_uploads/HyxLseM20.png"></img> In this section you will navigate through directories on your file system, create files and folders, and delete them. * At the command prompt, type: &emsp;&emsp;&emsp;**`ls`** for MacOS/Linux\ &emsp;&emsp;&emsp;**`dir`** for Windows This command *lists* the contents of a directory. The list includes both files and directories. * Choose one of the directories listed above (for example, it’s likely that Desktop or cs15 was listed). Then type:\ &emsp;**`cd <directoryName>`** (Don’t actually include the “**`<>`**” characters, that just denotes that the input may be different per person.) When you follow it with another word (called the argument), **`cd`** command stands for *change directory*. **Note**: Some operating systems are case-sensitive. When you run a terminal command, make sure that you are using the correct case for your filename. It might believe that “Desktop” and “desktop” are two different folders, and if “desktop” doesn’t exist, you’ll encounter errors trying to access it. ## Shortcuts for Directories The terminal also provides a shortcut for you to refer to the current directory and its parent directory when working with relative paths. The symbol **`.`** refers to whatever the current directory you're working in is, and **`..`** refers to its parent. * Type:\ &emsp;&emsp;&emsp;**`cd .`** &emsp;&emsp;This will keep you in the directory you are in. * Type:\ &emsp;&emsp;&emsp;**`cd ..`** <p style="margin-left: 35px">This will bring you one level up, so you should be back where you started.</p> ## Making Directories and Files * Type:\ &emsp;&emsp;&emsp;**`mkdir NewDirectory`**\ The **`mkdir`** command is short for make directory. It takes the desired name of the directory as an argument. * Type:\ &emsp;&emsp;&emsp;**`ls`** for MacOS/Linux\ &emsp;&emsp;&emsp;**`dir`** for Windows to confirm that your **`NewDirectory`** is there. * Type:\ &emsp;&emsp;&emsp;**`cd NewDirectory`**\ which navigates into your new directory. Then type:\ &emsp;&emsp;&emsp;**`ls`** for MacOS/Linux\ &emsp;&emsp;&emsp;**`dir`** for Windows\ to view the contents of the directory. Soon this combination of entering a directory and listing its contents will become almost second nature! In this case, nothing should show up, since the directory you just made is empty. * Type:\ &emsp;&emsp;&emsp;**`touch MyNewFile.java`** for MacOS/Linux\ &emsp;&emsp;&emsp;**`type NUL >> MyNewFile.java`** for Windows (it’ll say there’s an error but works fine)\ which creates a new file. Then type:\ &emsp;&emsp;&emsp;**`ls`** for MacOS/Linux -note: that is not a “one” it is an “L”\ &emsp;&emsp;&emsp;**`dir`** for Windows to see that the new file is now listed. * Type:\ &emsp;&emsp;&emsp;**`rm MyNewFile.java`** for MacOS/Linux\ &emsp;&emsp;&emsp;**`del MyNewFile.java`** for Windows\ to delete your new file. * Type:\ &emsp;&emsp;&emsp;**`cd ..`**\ to change out of “**`NewDirectory`**” back to your **`cs15`** directory. * Type:\ &emsp;&emsp;&emsp;**`rmdir NewDirectory`**\ to remove the now-empty directory you’ve made. * Type:\ &emsp;&emsp;&emsp;**`pwd`** for MacOS/Linux\ &emsp;&emsp;&emsp;**`cd`** for Windows * Your files and shell are now in the same state that we started off in. You can close out of the terminal window you have open. # <ins>Finishing Java Set-Up</ins> We have one last piece to set up in order for Java to run on your computer! Go open your cs15 project in IntelliJ. <img style="display: block; margin: auto;" width="300" src="https://hackmd.io/_uploads/Bk5mgWG30.png"></img> ## Using IntelliJ Here is a sample of what IntelliJ will look like when you are editing files. **It won’t look quite like this yet.** <img style="display: block; margin: auto;" src="https://hackmd.io/_uploads/rk43eZz3A.png"></img> For now, the important parts of the interface are as follows: 1. The file structure of everything inside your cs15 folder (yours won’t match exactly yet). 2. Any files we currently have open. 3. A button to start a terminal in IntelliJ, which will open along the bottom of the interface. We’ll use this to compile and run your code, and it acts exactly like the terminal we’ve been using on your computer! This section is going to be different depending on your OS. Follow the steps that apply to you. ## For MAC and LINUX Users In the cs15 folder you just downloaded in the [Pre-lab setup slides](https://docs.google.com/presentation/d/1zKLG1S0J12CZENjvnps0E-o5_w8_ePqbFUUwmLk4pJw/edit#slide=id.gb71320a961_1_0), you’ll find a file called **`macSetup.sh`**. * Click the “Terminal” button to open the terminal in IntelliJ. * In the terminal, use the **`pwd`** command to make sure you’re in the **`cs15`** directory. If not, use the **`cd`** command to move into that directory (ask a TA if you’re unsure how!). * Next type in **`./macSetup.sh`** into the terminal. * If it prompts you for a password type in your computer password (the one you use to login to your Mac/Linux user account) * Note that as you type the password, the letters won’t appear on the terminal screen. That’s ok! * If the terminal prints “**`All set!`**”, you can move on! If not, call a TA over for help right away. * <u><b>Lastly, close out of IntelliJ and reopen it to let the new settings take effect. This step is super important!</b></u> ## For WINDOWS Users * In IntelliJ, click on *File > Settings*. ![file](https://hackmd.io/_uploads/HyQ8ZHGn0.png) * Then, in the search bar in the top left, search for *Terminal*. Select the page *Tools > Terminal*. In the *Shell path* setting, type *cmd.exe* and press Apply then *OK* in the bottom right corner. ![file2](https://hackmd.io/_uploads/rJWHGSMhC.png) For the next step, we need to run IntelliJ with special permissions. * Close out of IntelliJ, then search in the Windows search menu for IntelliJ. Right click IntelliJ when it appears, and choose “Run as administrator”. (This is the only time you’ll ever need to open IntelliJ with that setting.) ![file3 (1)](https://hackmd.io/_uploads/rk9w7rfhA.png) Right click and select “Run as administrator” or select the same option from the menu on the right. * Open your cs15 project in IntelliJ. Once the main window appears, click the “Terminal” button to open the terminal in IntelliJ. * In the terminal, use the **`cd`** command to make sure you’re in the **`cs15`** directory. If not, use the **`cd`** command to move into that directory (ask a TA if you’re unsure how!). * Then type **`.\windowsSetup`** and press enter. If the terminal prints “**`All set!`**”, you can move on! If not, call a TA over for help right away. * <u>Close out of IntelliJ (and any Command Prompts open) and reopen IntelliJ to let the new settings take effect (no need to run as administrator this time). This step is super important!</u> * To check that you set up the configuration correctly, open the IntelliJ terminal. * Type:\ &emsp;&emsp;**`java -version`**\ &emsp;&emsp;**`javac -version`** If the terminal prints out something like “**`javac 1.8.0_3**`**”, you’re all set! Otherwise, follow [these instructions at the bottom](#Addendum-If-Windows-Script-Doesn't-Work) to fix the configuration. Call over a TA for help at any point. Amazing! Now you’ve finished setting up Java for your computer. # <ins>Using Git and Downloading Files</ins> For labs and projects in CS15, you will always start with “stencil code”, which outlines your tasks and provides some code to start with. That stencil code is stored on GitHub, so you’ll be learning some basic git commands to retrieve each lab and project. ## What is Git and GitHub? GitHub is a code-hosting platform that is used by many programmers to save their code and access it from any machine. Think of it like “the cloud” or Google Drive but for code projects! You should have already created and verified your GitHub account during IntelliJ setup and finished installing git. **Note: please make sure you’ve submitted your GitHub username in [this form](https://docs.google.com/forms/d/107iMe9sJvAPWjlB9p35ZUHee9SOCZM6XpGN0RyuouzE/edit)!** ## Configuring Git Settings (for everyone) Now you have to connect git on your computer to your GitHub account. * First type into your terminal / command prompt window:\ **`git config --global user.email`** “<email>”\ where <email> is replaced with the email you used to make your GitHub account. * Then type:\ **`git config --global user.name`** “<name>” where <name> is replaced with your name! Nothing should print in the terminal when you do these steps, but they are important for when you are trying to update your GitHub code later! ## Authentication to GitHub (for everyone) When you connect to a GitHub repository from Git, you’ll need to provide credentials to prove that you are who you declare to be. To do this, you can create a Personal Access Token. Note that if you had a GitHub account before, you may have used a password-based authentication which is no longer supported so you also need to follow the steps below. * Use [this](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) guide to create your Personal Access Token * **Build a <u>classic</u> token, not fine-grained!** * On step 7, when giving your token an expiration date, choose the ‘No expiration date’ option. **(Ignore the github warning). If you choose any of the other options, you will have to create a new token when this one expires.** * On step 8, when defining the scope of the token, you can select as many scopes as you wish but make sure to select **repo** * Once created, copy the token and save it somewhere you can easily access e.g., notes or email ## Cloning lab0 Stencil (for everyone) Now it’s time to get the stencil code from GitHub. You’ll follow this same process (with a different link) for each lab and project. * First, follow [this link](https://classroom.github.com/a/SJ8eJuWZ) to be invited to the lab0 assignment in GitHub. If it is your first time using GitHub Classroom for CS15, you might be taken to a page asking you to authorize GitHub Classroom. Press the “authorize GitHub'' button. * Click the “Accept this assignment” green button. * After a few seconds, refresh the page.Two blue links should appear, but no need to click the top one! (If there’s only one link, that’s okay too.) Focus on the one under “*Access your Assignment*” - click it to go to your personal repository. If the link hasn’t appeared yet, try refreshing again in another minute. * You’ll need to copy your personal repository link in order to “clone”, or download, it onto your personal computer. Click the green “Code” button, which will open a dropdown that says “Clone”, then copy the link that is shown. <img style="display: block; margin: auto;" width="300" src="https://hackmd.io/_uploads/HyGeqHz30.png"></img> * In an IntelliJ terminal (in the bottom menu), move into the **`src`** folder (this is your “source” folder, where you’ll store all of your code this semester), using the **`cd`** command (probably **`cd src`**). Ensure you’re in the right folder with the **`pwd`** command (or **`cd`** for Windows). * the **`pwd`** or **`cd`** command should print out something like **`/Users/<yourName>/Desktop/cs15/src`** for MacOS/Linux\ **`C:\cs15\src`** for Windows * Now you’ll have to paste the link from before in order to clone the repository locally. You should type **`git clone <pasted link>`** (without the “<>” brackets). You might be prompted to enter your GitHub username and password. For password, paste the Personal Access Token you generated above. Note that it will look like nothing was pasted on your terminal– this is totally fine! Press enter. * If you are on Windows, you might be asked to log into GitHub using a browser when running git clone. Follow the instructions until you are logged in and the screen prompts you to exit the browser and return to your application. * If your repository was downloaded, hooray! You may proceed. If you ran into an error, check that you entered the token correctly. If so, see [Updating GitHub Credentials](https://docs.github.com/en/enterprise-server@3.2/authentication/keeping-your-account-and-data-secure/updating-your-github-access-credentials) for help troubleshooting the issue then try cloning the repository again. * Once the repository is completely downloaded, you’ll notice the blue **`src`** folder in the left pane will have an arrow to its left. Click that arrow and you’ll see a nested folder called **`lab0-<yourGitHubUsername>`**. * For each project and lab, we’ll need to rename the folder (or “package”) name to remove your username. To do this, right click on the folder, then go to *Refactor, Rename*… You **must** rename the folder to be just **`lab0`**. If it’s anything else, your code will not run. Then click *Refactor*. <img style="display: block; margin: auto;" width="400" src="https://hackmd.io/_uploads/HkV36BzhR.png"></img> **Note**: Because you have to rename the package, IntelliJ will most likely eventually show an error for an “*Invalid VCS root mapping*”: <img style="display: block; margin: auto;" width="400" src="https://hackmd.io/_uploads/HJKDRSfnA.png"></img> You can fix the error by choosing “Configure…”, then clicking the **`lab0-<yourGitHubUsername>`** option and then removing it with the “-” button, so that only the **`lab0`** option remains. If the **`lab0`** folder is not there or appears under “Unregistered Roots”, click the “+” button in the lower left and select it. <u>Be sure to click “Apply” then “OK” to register the changes.</u> Now you’ve used GitHub for the first time to clone the stencil files! # <ins>Writing Java Programs</ins> ## Writing, Compiling, and Running Java Programs Whenever you write a Java application, you start by editing Java files, which are saved with the extension **`.java`**. You compile your code by running those files through the *java compiler*, which translates your code into a format the computer can execute. Then, your program is ready to run. You'll learn more about the structure of a Java application as the semester progresses. For now, let's dive into an introductory example: ## Hello World! * Using the terminal inside IntelliJ, go into your **`lab0`** directory using **`cd lab0`**. * Triple check that you’re in the **`lab0`** folder using the **`pwd`** (Mac/Linux) or **`cd`** (Windows) command. Ask a TA if you’re confused about how to get to that directory. * Type:\ &emsp;&emsp;&emsp;**`touch HelloWorld.java`** for MacOS/Linux\ &emsp;&emsp;&emsp;**`type NUL >> HelloWorld.java`** for Windows to create a new file. (You can also create a new file easily in IntellIJ, but for now create the file using the terminal.) * After a moment, the new file **`HelloWorld.java`** should appear on the left side of the interface where it shows the files. Open the file by double-clicking on it. Type out the following code into this new file. You’ll notice that IntelliJ will try to help you auto-fill while typing — for now it might be confusing (and you can ignore it), but eventually it will be very helpful! * <u>Note that you should re-type this code rather than copy/pasting it—often times, text is encoded differently in the lab documents than it should be in a text editor, and this can wreak havoc with your Java compiler.</u> ``` package lab0; public class HelloWorld { public static void main(String[] args) { System.out.println("Hello world!"); } } ``` The **`System.out.println()`** command prints out text into your terminal. This is a great way of confirming your program has reached a certain point in the code, and will become one of your best friends throughout the course. * Once you’ve typed the code, compile your code by typing **`javac *.java`** in your IntelliJ terminal * If your code compiled successfully, nothing will print in your terminal. Two new files called **`HelloWorld.class`** and **`App.class`** will appear in your **`lab0`** directory. * If error messages did print out, make sure your document looks like this in IntelliJ: * *You may not have the cs0150.iml file, and that’s okay!* ![intelliJJJ](https://hackmd.io/_uploads/HJqaG8f3C.png) * Then recompile your code by typing **`javac *.java`** in your terminal * After you compile your code successfully (i.e. if nothing prints out to the terminal), move back into the **`src/`** directory by typing **`cd ..`** in order to run your code Run your code by typing **`java lab0.HelloWorld`** in your terminal. * If you get an error, use the **`pwd`** command (or **`cd`** for Windows users) to make sure you’re located in the **`cs0150/src`** directory. If you’re not, you’ll need to use the change directory (**`cd`**) command to move into that directory. Feel free to ask a TA for help here. * You should now see the text “**`Hello World!`**” printed out in your terminal. Congratulations! You just compiled and ran your first Java application! * As a check to make sure you’ve installed the CS15Support.jar and set Java variables correctly, also run **`java lab0.App`** in the terminal. If a window that says “Hello world!” appears, you’re all set! If you have problems, first close out of IntelliJ, reopen it, and try again. If that still doesn’t work, ask a TA for help. Last thing for now is to save your code! Although IntelliJ autosaves your code, we want to use the power of GitHub to save a “snapshot” of your code at this moment in case you ever have issues with your code locally or your computer crashes. * Move into the **`lab0`** folder (**`cd lab0`**) * First use the command **`git add -A`** * Then use the command **`git commit -m “<some descriptive messages>” `** * For example, here use **`git commit -m “Finished my first program”`** * Lastly, use the command **`git push`** If you have any issues with git, ask a TA to help. This process of **`add → commit → push`** should be completed every time you want to save your project to “the cloud” (and should be done frequently to prevent loss of work!). # <ins>Important Forms</ins> Please take the time to fill out the following 4 forms: * [Student Information Collection](https://docs.google.com/forms/d/11qKXzsLRm3GMUn66DYHNaR8bqAn8haF10nclhrjF3gk/edit) - This is just to ensure we have the correct emails, cs logins and preferred names * [Anonymous CS15 Initial Questionnaire](https://docs.google.com/forms/d/1pgOrqcnSmeQ9U6UrkqTpnHSvYI1Wpp2gTy_cnA7wEZM/edit) - This will provide the course with valuable insights into the demographics of the students taking it * [Github Username Form](https://docs.google.com/forms/d/107iMe9sJvAPWjlB9p35ZUHee9SOCZM6XpGN0RyuouzE/edit#settings) - Lets the staff view your CS15 github repositories for code debriefs, gradescope errors, etc. * [Mentorship Sign Up Form](https://docs.google.com/forms/d/1g7ywvhG-5hLVOejSHS6ltSDOkzXQLagGt2Dkc70HomY/edit) - Anyone who wants a mentor MUST complete this form to get matched with a TA mentor. This form is optional for all students, but is highly recommended! Many of the current TAs loved and valued the mentorship program and recommend everyone try it out!! (See all mentors [here](https://docs.google.com/document/d/19jcoUWB6t7dDDOiL5vWNNzhpM9C8IXhp9Ub9wIahlzE/edit) :)) # <ins>Sign Up for ATA</ins> ATA is CS15's version of ChatGPT in accordance with the collaboration policy! ATA is an alternative to Ed or project hours that you can use over the course of the semester. ATA can help with projects, lecture material, or course logistics. To learn more about how ATA fits in with the CS15 Collaboration Policy, read [here](https://docs.google.com/document/d/10rbbd0Y6s1JUzPe8VmoWcL_Mz26XczX-i7p2LUFa9vc/edit#heading=h.o0nwon5qvcc7). :::info TODO: Sign up for ATA using [this link](https://www.talktoata.com/join/brown-university-csci0150-fall-2024) ::: # <ins>Sign Up for Ed and Tophat</ins> * You need to sign up for TopHat in order to answer questions in lecture and earn participation credit. :::info TODO: To sign up, go to TopHat.com, click “Sign Up”, then “Student”. Enter the code 316062, then log in via Brown SSO. You can reference the [Brown TopHat guide](https://success.tophat.com/s/article/Brown-University-SSO) if you have any issues. ::: * We use Ed as an online forum to make announcements and for you to post questions to TAs and your fellow classmates. Ed will be an invaluable resource for you. :::info TODO: You can visit <b>[this link](https://edstem.org/us/courses/63887/discussion/)</b> to join the classroom and log in via your Brown account. ::: * **You need to be registered or have CS15 in your cab cart for this to work!** :::success <b ><u>Once you’ve finished the questionnaire, tell a TA and they’ll come over for the lab checkoff. Show a TA (1) “Hello World!” in the terminal, (2) the “Hello World!” window, (3) the git push confirmation, (4) the completed forms, and (5) The CS15 Ed, Tophat, and ATA Pages. Then they’ll check you off! </u></b> ![avatar-min](https://hackmd.io/_uploads/ByWzaIfhR.png) ::: # <ins>Addendums</ins> ## Addendum: Updating Github Credentials *Applicable if encountered error while cloning stencil If you had a GitHub account before, it is possible that your previous credentials are cached, causing authentication issues when you’re trying to clone the stencil. You can update these credentials and replace your old password with the token you generated above. Follow the steps that apply to you then try cloning the stencil again. If you run into any issues, call a TA over. **For MAC Users** Follow the instructions on [this](https://docs.github.com/en/get-started/getting-started-with-git/updating-credentials-from-the-macos-keychain#updating-your-credentials-via-keychain-access) page. You can either update the cached credentials or delete them altogether. **For Windows Users** Go to *Control Panel → Credential Manager → Windows Credentials → Generic Credentials*. Find the credentials related to your Git account and edit them to use your token. **For Linux Users** Type the command below. The next time you clone the stencil, you should be prompted for your username and password. Enter the token for password. **`git config --global credential.helper cache`** ## Addendum: If Windows Script Doesn't Work * First you’ll need to know where your Java SDK was installed. It should go into a folder like:\ &emsp;&emsp;&emsp;**`C:\Program Files\Java\jdk1.8.0_341`**\ Take note of the exact folder name. * In the built-in Windows search menu (which can be accessed through pressing the Windows start button), search for “Advanced System Settings”, and open it. * At the bottom of the new window that pops up should be a button that says “Environment Variables”. Click that button. * Under “System Variable”, click “New…” In the “Variable name” field, enter **`JAVA_HOME`** * Set the value of **`JAVA_HOME`** to the exact folder name of where the Java SDK was installed. Click OK. * Similarly, set the value of **`CLASSPATH`** to the exact location of the JAR file in your folder. You can find this by right-clicking on the **`CS15Support.jar`** file in IntelliJ, click on on *Copy path*, then selecting *Absolute path*. ![windows](https://hackmd.io/_uploads/SJ20RUfhR.png) &emsp;&emsp; *For the next 2 bullet points, you’ll probably find it very helpful to reference this image.* * Now look for a Variable with the name “Path”. Select it and click “Edit….” * In the “Edit environment variable” window, click “New”. Type in:\ &emsp;&emsp;**`%JAVA_HOME%\bin`**\ Then click OK, and OK again so that the Environment Variables are saved. * To check that you set up the configuration correctly, close the IntelliJ windows and open a ***new*** Command Prompt window (not the IntelliJ window). &emsp;&emsp;First type: &emsp;&emsp;&emsp;&emsp;**`echo %JAVA_HOME%`** <p style="margin-left: 30px">Make sure that the terminal prints out the path to the jdk folder (like <b>C:\Program Files\Java\304110.8.0_301</b>). Otherwise, call over a TA for help.</p> &emsp;&emsp;Then type: &emsp;&emsp;&emsp;&emsp;**`echo %CLASSPATH%`** <p style="margin-left: 30px"> Make sure that the terminal prints out the path to the JAR file (like <b>C:\cs15\CS15Support.jar</b>). Otherwise, call over a TA for help. </p> &emsp;&emsp;Finally, type: &emsp;&emsp;&emsp;&emsp;**`javac -version`**\ <p style="margin-left: 30px">If the terminal prints out something like “**`javac 1.8.0_301`**”, you’re all set! Otherwise, call over a TA for help.</p>