Lab 1: Logistics and Binary Representation


Due Tuesday, January 12th at 11:59:59 PM

Goals for This Week

By the time you have completed this work, you should be able to:

Provided files:

Step by Step Instructions

Step 1: Log Into a Computer

If you are unable to log in, make sure you join someone whose works.

If you need to request an account, click here.

Step 2: Sign up for Piazza (If You Have Not Already)

Click this link to sign up. All course announcements will be through Piazza, so it is very important that you sign up!

Step 3: Create a Directory for This Work

Back in your CSIL account, first create a directory for this course, if you have not already:

mkdir cs64

Then, if you want to confirm that it worked, list the contents of this directory

ls

That should show cs64 as one of the contents of the current directory.

Now go into the cs64 directory, create a lab1 directory inside it, and enter the lab1 directory:

cd cs64
mkdir lab1
cd lab1

Confirm that you are in the proper directory by checking the current path:

pwd

It should say your home directory's path, followed by cs64/lab1.

Note: You are expected to learn the unix commands presented in assignments. After today, I will expect that you know what mkdir, cd, and pwd do. If you forget them, you may refer back to these instructions.

Step 4: Get the Provided Files Into Your Work Directory

The provided lab1problems.txt and partner.txt files need to make their way into the directory you just created. There are a number of ways to do this. Perhaps the simplest thing to do is to copy the file directly from the website, like so:

cp ~kyledewey/public_html/cs64/labs/1/lab1problems.txt ~kyledewey/public_html/cs64/labs/1/partner.txt .

Note the use of the trailing . in the above command, which stipulates that the specified files (~kyledewey/public_html/cs64/labs/1/lab1problems.txt and ~kyledewey/public_html/cs64/labs/1/partner.txt) should be copied into the current directory.

Step 5: Change the File Permissions Appropriately

Depending on some factors, it may still be possible for others to read the contents of the files you just copied. This can lead to problems if you then put your answers in the files (as the rest of this assignment asks you to do), as someone else could potential read your answers. We can fix this problem by tightening up the permissions on the files so that only you can read them, like so:

chmod 600 lab1problems.txt partner.txt

The chmod command is used to change the permissions on files. The 600 in the command stipulates that you are giving yourself read and write access, while taking away any access to anyone else.

Step 5: Edit the Files In emacs, vi, or Another Text Editor of Your Choice

If you are already familiar with a particular text editor, go ahead and use it. If not, you may refer to one of the following links for a very basic tutorial of the corresponding text editor:

Using the editor of your choice, open the lab1problems.txt file. The file contains a series of questions for you to answer. The answers should be placed directly in the file itself. All questions must be answered correctly for full credit.

Make sure you save your answers before you exit.

If you partnered with someone, record the email address they are using for the class in partner.txt. For example, if your partner had the email address foo@bar.com, then the contents of partner.txt should be the following (and only the following):

Partner: foo@bar.com

If you did not partner with anyone, you do not need to (and should not) edit partner.txt.

Step 6: Turn in Your Code Using turnin

Assuming you are in the cs64/lab1 directory you created at the beginning, you can send in your answers via the following command:

turnin lab1@cs64 lab1problems.txt partner.txt

You may turn in the same assignment up to 100 times, which is useful if you are working on it incrementally. Note that only the last version you submitted will be graded.

Even if you did not partner with anyone, you should still turn in partner.txt, which should not have been modified.

(Optional) Step 7: Sign Up for CS Department Announcements

The CS department has a mailing list to tell you about department events specifically targeted towards undergrads. Many students are unaware of this, so I want to let you know about it. You should (but are not required to) subscribe to this so that you can find out about all of these opportunities. To do so, go to http://lists.cs.ucsb.edu/mailman/listinfo/ugrads/.

There is also a jobs list where you can find out about internship opportunities: http://lists.cs.ucsb.edu/mailman/listinfo/jobs/.


Prepared for Computer Science 64 by Prof. Diana Franklin, with slight adaptation by Kyle Dewey.