0% found this document useful (0 votes)
36 views19 pages

CS 241 Section Week #1: January 26, 2011

This document provides an overview of topics covered in the first section of the CS 241 course, including homework assignment #1, reviewing Subversion (SVN) for managing code files, and examples of C code. It discusses using Piazza for getting help from peers, checking out and updating code files from the SVN repository, adding and committing new files to the repository, and practicing with example files provided for the discussion section.

Uploaded by

Waqas Mahmood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views19 pages

CS 241 Section Week #1: January 26, 2011

This document provides an overview of topics covered in the first section of the CS 241 course, including homework assignment #1, reviewing Subversion (SVN) for managing code files, and examples of C code. It discusses using Piazza for getting help from peers, checking out and updating code files from the SVN repository, adding and committing new files to the repository, and practicing with example files provided for the discussion section.

Uploaded by

Waqas Mahmood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 19

CS 241

Section Week #1
January 26, 2011
Topics This Section
• HW #1

• SVN Review (…by the command line!)

• C Code Examples

2
Piazza
Work as a team (staff and students) to offer help

Search for existing answer before asking


question

Improve the answer rather than following


up

3
Homework #1
• Easy?

4
Homework #1
• void Problem15(){
int x;
...
if(x < 0){
printf("invalid value.\n");
exit;
}
}
5
Homework #1
• void Problem15(){
int x;
...
if(x < 0){
printf("invalid value.\n");
exit;
}
}
6
Homework #1
• Problem #19
long int clear_bit(long int value, long int flag){

7
Homework #1
• Problem #20
long int is_equal(long int x, long int y){

8
svn
• Each week, there will be files we provide for
us to use in section.

9
svn
• To create a local “working copy” of the SVN,
you need to run an svn checkoout command:

svn checkout https://subversion.ews.illinois.edu/svn/sp12-


cs241/NETID cs241 (Link on the course website for you to copy and paste)

10
svn
• Make sure your checkout worked:
$ cd cs241
$ ls
ds hw1
$ cd ds
$ ls
ds1
$ cd ds1
$ ls
1.c 2.c 3.c 4.c 5.c

11
svn
• You only need to checkout files once!

• From now on, you can get the latest changes


from the server by running an svn update.
svn up
svn update

12
svn
• When you’ve got something working, you will
want to commit the changes you made back
to the server with an svn commit:

svn ci -m ""
svn commit -m "some message"

13
svn
• When you’ve got something working, you will
want to commit the changes you made back
to the server with an svn commit:

svn ci -m ""
svn commit -m "some message"

We will grade your latest committed


version of each MP!
14
svn
• Often, you will only need to modify the files
we provide to you on the svn. However, you
will occasionally need to add a new file to your
svn with svn add:
svn add FILENAME

15
svn
• Lets add a file, and verify we added it:
(You should probably be in your ds1 directory for this.)

cat "Hello World" >hello.txt

svn add hello.txt

svn ci -m "First SVN commit!"

16
svn
• What time did you make the submission? Did
you make it in on time?

svn log hello.txt

------------------------------------------------------------------------
r3866 | netid | 2011-22-08 22:07:59 -0600 (Mon, 22 Aug 2011) | 1 line

First SVN commit!


------------------------------------------------------------------------

17
svn
• Oh no! Your latest changes breaks everything!

svn revert hello.txt


OR
svn up –r ## hello.txt

18
Discussion Section Practice
• Five different files, each having code snippets
similar to HW1.
• In your svn: ds/ds1/
• 1.c, 2.c, 3.c, 4.c, 5.c

• To compile: gcc 1.c


• To run: ./a.out

19

You might also like