11
ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Embed Size (px)

Citation preview

Page 1: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

ENEE150 – 0202ANDREW GOFFIN

Introduction to ENEE150

Page 2: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Welcome to class!

Contact information/Office Hours [email protected] Office Hours: TBA Willing to meet outside of discussion and office hours

– just ask!

Goffin – ENEE150

Page 3: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Grading

Main part of the class is actual, physical code Most of this grade is simply correctness Make sure match public tests’ format on the projects,

makes grading much easier. Style isn’t THAT important in this class… but I like

neat code If you have sufficient commenting, good variable names,

and proper indenting, you’ll get full credit “Sufficient” commenting is typically one comment per

function, then a comment for any non-obvious code Indent for every new code block!!

Page 4: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Setting up Glue

Glue is the system on which we run our programs for this class Students from 140 should be familiar with it All programs MUST execute correctly on Glue to get

full creditFor Linux/OSX users, just use the terminal

Type “ssh [email protected]” into the command line to get onto the machine

A bit more tricky for Windows users…

Goffin – ENEE150

Page 5: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Setting up Glue: Windows

Install PuTTYHost Name

linux.glue.umd.eduLeave all other options

alone!Press “Open”Log into glue using

UMD ID/password

Goffin – ENEE150

Page 6: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Crash Course on Unix

Get used to using the command line instead of a graphical interface

Two main kinds of objects: files and directories Files are what you expect Directories are like folders in Windows

Unix uses a directory tree, building from the root down /etc is the etc directory, which is one level down from

root (designated by the backwards slash)

Goffin – ENEE150

Page 7: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Crash Course in Unix II

Important commands: cd <directory> - change directory cp <file> <location> - copies file to location mv <file> <location> - moves file to location rm <file> - removes file (can remove directory with –r flag) mkdir <directory> - makes a directory ls – lists all items in the working directory (more detailed

listing with –l flag) ssh <IP address> - secure connection to another machine gcc <C Program> - compiles C file into an executable called

“a.out” man <command> - provides manual on how to use command

Goffin – ENEE150

Page 8: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Writing a C Program in Glue

Open a file called “helloworld.c” using your favorite text editor Text editors include vim, emacs, nano… matter of

preferenceType the following:

Include the stdio library

Prints the string “Hello world!” followed by a newline

Goffin – ENEE150

Page 9: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Writing a C Program in Glue

Save the text fileUse the command “gcc helloworld.c” to

compile a C executable This executable is called “a.out”

To run the executable, type “./a.out”Add a comment to the text file with your

name and section, and submit it Use assignment number 0

Goffin – ENEE150

Page 10: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Submit Command

On Glue, you can submit files using the “submit” command

The format for submit is year -> semester -> class -> section -> submission number -> file Submission numbers will be given for each

assignment If you forget this, just type “submit” and the terminal

will remind you!

Goffin – ENEE150

Page 11: ENEE150 – 0202 ANDREW GOFFIN Introduction to ENEE150

Further Notes on Submit

You can, and probably SHOULD, submit an assignment multiple times Older submissions will not be overwritten

After you’ve submitted, do not modify or save the file. In case submit has issues, I may need to be able to

check the timestamp on the file in Glue

Goffin – ENEE150