Difference between revisions of "EGR 103/Fall 2020/LAB 01"
(→Getting Starter Files) |
(→Installation) |
||
Line 36: | Line 36: | ||
* Once installed, start the Anaconda Navigator. | * Once installed, start the Anaconda Navigator. | ||
* In the Navigator window, there may be multiple items. One of them should be Spyder 4.1.4. We will ask you to launch that during lab and we will briefly go through how to write a program in Python. | * In the Navigator window, there may be multiple items. One of them should be Spyder 4.1.4. We will ask you to launch that during lab and we will briefly go through how to write a program in Python. | ||
+ | * If Spyder asks about installing Kite, you can install Kite. It is an add on to Spyder that provides more in-depth help with Python commands. | ||
=== Your First Program! === | === Your First Program! === |
Revision as of 17:43, 19 August 2020
Contents
File Storage For EGR 103
You will be working with files on your computer but you will be backing them up with a system called Box. Duke students have 50 GB of free storage for academic purposes on the box system. Furthermore, you can have Box sync up with your local files (as long as you put them in the right place)!
Working From Off Campus
If you are not on Duke internet, you will need to connect using a security program known as a VPN. See Connecting from Off Campus for links to get the program.
Box Setup
- Go to https://box.duke.edu/.
- Click the LOG IN button.
- If asked if you are Part of Duke? Click Continue.
- Log In using your Duke credentials.
- You should now see your Duke Box - it may be empty.
Local Folder Setup
Next, you will create a folder on your local computer to synchronize with your Box folder.
- Go to https://duke.app.box.com/services/browse/newest/box_drive for information about Box Drive and the download links for Windows and Mac.
- Download the appropriate file and install it.
- Keep track of where the Box folder is placed on your drive.
- For Windows it is likely a spur off the main File Explorer window and located specifically at
C:\Users\USER\Box
where USER is your Windows user name. - For Mac, a Box drive will be mounted.
- For Windows it is likely a spur off the main File Explorer window and located specifically at
- To see it work, on your computer go into your Box drive, create a new folder, and call it EGR103F20 in all caps with no spaces. After you have created it, refresh the browser that is looking at your Box account and the folder should show up on your list!
- Box Drive generally works when you are online and thus keeps things in the cloud and only pulls them down when you need them. To make sure that you have access when you are offline, and to mitigate any internet connectivity issues, you will want to tell Drive to make your folders available offline.
- In the File Explorer or Finder, open your Box folder. Right-click EGR103F20 and in the context box find "Make Available Offline"
- Once things have synchronized, there should be a green check by the folder - that is the sign that the folder will be available offline.
- You will never need to set this up again for the computer you are currently working on, but if you end up working on a different computer you will need to install Drive. This also means you can work from public or other computers as your files will always be on Box.
Python
For the Fall 2020 semester, we will be using Anaconda's distribution of Python 3 and specifically using the Spyder Integrated Design Environment. The distribution is free and multiplatform. If you already have Python or Anaconda installed, you may still want to download and install the latest and greatest. Python is a work in progress, and Python 3.8 and its associated packages have differences from 3.7 that will come up later in the semester (for example, there are some default cases in 3.8 that are not in 3.7 for certain commands).
Installation
- Go to https://www.anaconda.com/products/individual and click the Download button.
- Pick the appropriate distribution and download the package. You will want to use the graphical installer and almost definitely the 64-bit unless you know you have a 32-bit processor.
- You are not required to create an Anaconda account, but you are certainly allowed to.
- You can use all the default recommendations for the installation or, if you are sure you know what you are doing, you can make changes.
- You can also look at the tutorial and such, though on your own time a little later in the lab :)
- Once installed, start the Anaconda Navigator.
- In the Navigator window, there may be multiple items. One of them should be Spyder 4.1.4. We will ask you to launch that during lab and we will briefly go through how to write a program in Python.
- If Spyder asks about installing Kite, you can install Kite. It is an add on to Spyder that provides more in-depth help with Python commands.
Your First Program!
- Start a new file by clicking the New file icon at the top left.
- Enter the code
print('Hello, world!')
in the first line under the comments that were pre-loaded. - Save the file by Flicking File and then Save. Save it in your Box/EGR103F20 folder as
start.py
. - Run the file by clicking the play button (single green arrow near the top of the screen). Clicking this button on a saved file will both change the Spyder working director to the folder that file is in and will run the file.
- Confirm that the Console window now, among other things, says
Hello, world!
Overleaf
This semester, we will be using a freemium tool called Overleaf for making lab documents. We will only need the free features for work this semester. Overleaf is a LaTeX editing and processing program. One drawback is that it cannot access files directly on your drive but rather needs you to upload them. As you go through the course, you will get a better and better idea of which files need to be uploaded. For this lab, we will explicitly talk about each part you need to upload.
Starting Up
- If you do not already have an Overleaf account, go to https://www.overleaf.com/ and register. Duke does not have an account, but you can still use your duke.edu address. If you already have an Overleaf account with a different login, you can certainly continue to use that.
- Once you have logged in, you will have the option to look at some templates or the Help Guide. We will look at those in the lab on my computer, so go ahead and progress straight to creating your first LaTeX project. Make it a blank project, and call it
EGR103LAB01
. Overleaf will create the main document with some boilerplate information in it.
Getting Starter Files
- Each week, I will give you access to at least the lab skeleton. This week, there are several files you will need. Here's how to get them:
- Go to https://duke.box.com/s/dv19vz9r2sc7a5knjsjiuf5p9xle53rx which is my shared Lab 1 Box folder.
- Click the Download link at the top right. Box will download the files. Depending on whether you are logged into Box, it might allow you to log in. You do not need to.
- Windows machines will download a zip file to open while macOS will open a folder to open. If on Windows, open the zip file, then copy the Lab01files folder from the zip file into your Box/EGR103F20 folder. If on macOS, just copy the folder into your Box/EGR103F20 folder. After the folder is copied and synchronized, the folder should get a green check.
- Now open the Box/EGR103F20/Lab01files folder and make a copy of the Lab1Sample_F20.tex file; call the new file lab1.tex.
- Next, in the Overleaf window, which should be pointing to your EGR103LAB01 project, click the upload icon (third from the left above the file list).
- Drag all the files from your Box/EGR103F20/Lab01files folder into the available space for uploading files and upload the files. This will copy them into Overleaf.
- Now you need to tell Overleaf to change the primary tex document. Click the Menu button at the top left of Overleaf. In the main document drop-down, select the
lab1.tex
file. - Finally, you need to recompile your project since the main document changed. Click the Recompile button and the lab skeleton will compile.