Vous êtes sur la page 1sur 45

Fall 2013

CS2150: Program and Data Representation University of Virginia Computer Science

Aaron Bloomfield and Mark Floryan

Class 1: Introduction

Today
Course Structure and Logistics Honor Policy Grading Criteria Course Goals

Course Structure and Logistics


Also see the course syllabus on Collab

Instructional Staff
Aaron Bloomfield
403 Rice Hall aaron (at) virginia (dot) edu Office hours are M/W 1:30-3:00

Mark Floryan
203 Rice Hall mrf8t (at) virginia (dot) edu Office hours are Tu/Th 3:00-4:30

Instructional Staff
Teaching Assistants
Lots of undergraduate TAs 1 or 2 graduate graders or TAs

Collab
UVas fancy course management system Well use it for pretty much everything
Assignment submission All grading File downloads (labs, lecture notes, etc.) Wikis Blog Etc.

Well see a tour of the Collab tools either today or Friday


6

Contacting Us
Support requests submitted via the Collab tool
We will try to respond within 24 hours.

Or through Piazza
Its a new thing we are trying this semester

Office hours
Will start on Sunday Will have about 30 hours per week Will be posted on the Collab website
Please check before heading over in case there are any changes

Instructors are in their offices; the TAs are in the Thornton stacks OR in Rice 340 (we are still deciding)

Anonymous feedback
Also through Collab
7

Contacting You
Information (relevant notes, announce-ments, etc.) will be posted on the Collab class website Class Email
We use this sparingly we expect to send 5 (five!) emails this entire semester, unless something goes very wrong and weve already sent one of those five

The Collab announcements page


This is a twitter feed: @UVaCS2150 In an effort to keep your inbox size down, announcements are typically posted here, and not emailed out unless very important
I will e-mail out less than 6 emails the entire semester, unless something goes horribly wrong
9

Meetings
Classes:
MWF 11-11:50 in Olsson 120 (Bloomfield) or 12-12:50 in THN E316 (Floryan) Lectures will be recorded*, and posted on Collab

Lab meetings: 1 per week


Tues 9:00-10:35, 12:15-1:50, 3:50-5:25, 5:30-7:05, or 7:30-9:05
You cannot attend another lab section without prior permission

We cant register more than 44 people in a given lab. Sorry!

Lab Procedure
Pre-lab (due prior to coming to lab), which includes a tutorial In-lab (due at the end of lab) Post-lab (due on the Friday morning of the lab) Labs begin next week
Labs are posted Thursdays, generally by noon

There are late policies for the labs these are discussed in 10 the first lab

Fall 2013 registration issues


We cannot, for any reason, allow the registration for a given lab section to go above 44 students
There are not enough computers, and you cannot use your own computer

The dept is not able to offer a 6th lab section Which means we have very little room for registration
Priority goes to ALREADY declared computing majors

If you want to enroll, please http://tinyurl.com/lgt46ee


We will get back to you soon

fill

out

the

form

at

All others will not be able to take the course


Im really sorry about this

If you would like to complain about this, I have a list of people you can e-mail!
11

Expectations
Prerequisites:
(CS 2110 or CS 2220) and CS 2102, all with a C- or above

You understand basic programming (CS I & II):


Can write a program longer than a screen-full Understand references, classes, objects, templates (generics) Familiar with common control structures, procedures, recursive definitions

You remember some things from CS 2102 (or will learn/refresh your understanding when you need them):
Arithmetic, logarithms, sets, graphs Proof techniques (induction, contradiction) This material may be used in the context of a test question
12

CS 2102 as a co-req
If you have not already taken CS 2102 previously, you may take it this semester. However, by doing so, you understand and agree that any 2102 material that ends up on the exam is your bad luck
Thats why its listed as a pre-req!

For the fall 2013 semester, there are still some spots available in CS 2102

13

Labs / HWs
Labs are much bigger in this course
And basically are the homeworks

Labs will generally be made available on Thursday by noon, and due by the end of the following week
Pre-lab to be done BEFORE showing up to Tuesdays lab section: all are due at the same time on Tuesday
That time is the time the first lab section starts

In-lab to be done IN lab section Post-lab to be done AFTER lab section

Lab attendance is required


And you cant change sections without prior permission, as we dont have the computers or TAs to support this
14

Thanksgiving break!

What UVa defines as Thanksgiving break


15

Thanksgiving break!

What students define as Thanksgiving break

16

Thanksgiving and labs


As there are classes the Monday and Tuesday before Thanksgiving, there will be lecture and lab then as well We will be considerate of everybodys travel schedule, and the lab attendance requirement will be different
More details on this as we enter into November

But since most labs are done over the weekends, if you decide to take both Thanksgiving break weekends off, you are going to be in trouble when you return
17

Accounts
Olsson 001 Lab Accounts
There are two of these: one for Linux, one for Windows; we do not expect to use the Windows account You will receive two email about this, one for each account

Your Collab account


You have this already as well http://collab.itc.virginia.edu/portal

18

Unix
This class will program exclusively in a Unix (or Unix-like) environment Options (from easy to hard):
Run VirtualBox (its free) and use the course Linux image
This is the recommended method There will be an entire Collab wiki page on VirtualBox The machines there have Linux installed You can get a key for a $5 deposit (see me for this)

Program in Olsson 001 (when a lab is not in session)


Mac users can use a terminal window, as Mac OS X is based on Unix Install a Unix OS (Linux, etc.) on your home machine
Backup everything first!!! But you cant use an IDE! Note that some things (such as doxygen) are not compatible!

19

Unix honor pledge


In order to take this class, you must agree to sign an honor pledge stating that you will not use any MS Windows development environment (including Visual Studio) for any work for this class. If you do, it will be an honor violation, and you will receive an automatic F for the course. Furthermore, you cannot use any IDE (Xcode, Eclipse, Netbeans, etc. Visual Studio) on any OS for the code development in this course (the reason for this is to teach you Unix, not a vendetta against IDEs)
20

Compiler usage
We are NOT using gcc/g++ this semester
This is a change from previous semesters

Instead we are using clang (from LLVM) If you dont know what this means, you can safely ignore it But if you are familiar with gcc/g++, please dont use it
clang has MUCH better error messages

21

Textbooks
There are none for this course
The books that exist are way too expensive and not all that good

Instead, we will have optional online readings for those who would like to read about the course material as well

22

Learning your names


I am determined to learn each of your (first) names
So if you raise your hand in lecture, and I dont call on you by name, you have to say your first name before your question

23

Honor Policy

Class Honor Policy


University of Virginia Honor Policy in effect In addition to the normal rules, we have this policy: If you are looking at another student's source code for ANY reason (including code from a student from a previous semester), you are in violation of the honor policy. You may look at another student's source code after the program has been finally submitted by BOTH parties.

25

Class Honor Policy


Any honor violation or cheating will be referred to the honor committee, and will result in immediate failure for the course I have done this before, and I will do it again. Please dont test me on this.
We will see the cheat-checking program later this semester, as we will have learned enough theory to understand how it works
26

Honor pledge quiz!


Do these count as honor violations?
Copying somebodys code completely, even if theyve taken the course a year ago
(answer: yes)

http://www.cplusplus.com/forum/beginner/35 616/
(answer: yes)

A student who, upon taking the class a second time, claimed s/he had already submitted the assignment before (being in the class previously), and thus was allowed to copy the assignment from somebody else
(answer: yes)
27

Grading Criteria

Grading Criteria
40% Labs
There will be 12 labs

30% Midterms, during lab and in lab classroom


Midterm 1: October 1st Midterm 2: November 12th

25% Final Exam, room TBA


Common exam time is Friday, December 13th, from 7 p.m. to 10 p.m. It can NOT be taken early, so dont even ask

5% Class participation
Some examples: random in-class quizzes on readings or previously covered topics, in-class questions, speaking up in class, using the wiki or newsgroup, etc.

We reserve the right to change this! course syllabus for details

See the
29

Final exam
Because there are two lecture periods, this class has a common exam time: Friday, December 13, from 7 p.m. to 10 p.m. You may NOT take it early for any reason. You may NOT take the exam at a different time because you have a busy final exam schedule Other classes that also have an exam then:
APMA 1090, 1110, 3080 MATH 1140, 1210, 1220, 13410, 1320

You must let me know by the end of September if you have a conflict
If you dont let us know by then, then you will have to take it at the common time
30

Compilation
You will receive zero credit for code that does not compile. No exceptions!
This is an advanced programming class, and under no circumstances should you submit code that does not compile

The submission system will compile the code when you submit it
We will have a guide as to how to work through compilation errors, and what to do if you cant get it to compile
31

Course Goals
Program and Data Representation

Course Goals
1. 2. 3. 4. 5. Levels of abstraction Implementing data structures Time and space complexity analysis Basic program execution model (hw/sw) Assembly language programming

33

Course Goal 1
Understand program representation from high-level programming language to machine level representation

34

Levels of Abstraction: Program


Real World Problem
High-Level Program

Physical Processor
35

Physical World

Virtual World
Machine Instructions

Course Goal 2
Be able to implement basic and advanced data structures in C++
linked lists stacks queues hash tables heaps trees etc.

36

Why do we care about data structures?


One answer (of many): time Consider a program that does the following:
Creates 5 list-like data structures Adds 50,000 elements (even integers from 0-100,000) Searches for 25,000 elements (integers from 0-25,000) Deletes 10,000 elements (integers from 0-10,000)

And records the time each data structure takes for these operations
See DataStructureComparison.java

What are the results?

37

The results
From a Pentium 3.0 Ghz PC with more than sufficient memory Vector: ArrayList: LinkedList: HashSet: TreeSet: 17.311 sec 17.281 sec 24.255 sec 0.122 sec 0.119 sec

A factor of ~150! A factor of ~200!

38

The results, in more detail


All times are in ms (1/1000th of a second)
Data structure Total time Insert time Search Delete time time

Vector
ArrayList LinkedList HashSet TreeSet Vector, sorted

17,311
17,281 24,255 122 119 294

30 12,620
28 12,609 54 17,934 103 93 36 9 14 19

4,661
4,644 6,267 10 12 239
39

Course Goal 3
Asymptotic time and space complexity analysis of programs
Given a program,
How much time does it take to run? How much space (memory) does it use?

40

Course Goal 4
Understand basic program model and the underlying hardware and software
Fetch-execute cycle Memory hierarchy Compiler Number representation
The Y2.038K (or Y2K38) problem

execution computer

41

Course Goal 5
Be able to implement basic control and data structures in assembly language
x86

42

CS 2150 Roadmap
Data Representation Program Representation Real World Problems
Hello [H,i,\0] 0x42381a, 3.14, x 01001010 Objects Arrays Addresses, Numbers, Characters
Java code High-level language

C++ code
JVML

Low-level language
Virtual Machine language

Bits

x86

Assembly

Real World Physics


43

Feedback from previous semesters


You can view my entire course evals on my personal website (including from last semester)

This has been the most informative/ difficult CS course I've taken so far, but definitely worth it This course was incredibly challenging, especially for me having not programmed in over a year This class changed my entire perspective on computer science, and is giving me an awesome foundation for the rest of my computer science education. Course was difficult, however I learned a lot. (and a bunch of complaints about the amount of work, blah, blah, blah)
45

Vous aimerez peut-être aussi