.. _homework1: ========================================== Homework 1 ========================================== Due Wednesday, April 6, 2011, by 11:00pm PDT. The goals of this homework are to: * Make sure you are familiar with basic Unix commands (see :ref:`unix`) and an editor, (see :ref:`editors`), * Start using Mercurial (:ref:`hg`) to download course materials, * Create your own hg repository to keep your coursework and post homeworks to be graded. Before tackling this homework, you should read some of the class notes and links they point to. In particular, the following sections are relevant: * :ref:`unix` * :ref:`software_installation` * :ref:`editors` * :ref:`hg` * :ref:`bitbucket` * :ref:`biblio` You do not need to "turn in" anything for this homework, but by doing it you will create files in your repository that we can view to grade. #. First, if you have not already completed the survey on your background and computing needs, please do so now. You can find it `here `_. #. Make sure you have access to Mercurial on the computer you plan to use (see :ref:`software_installation`). Read the section :ref:`hg` and the documentation linked from there in order to get a sense of how it works. #. Clone the class repository following the :ref:`classhg`. Make sure you have set the environment variable *CLASSHG* since this is used below. #. Set up your own personal repository on Bitbucket, by carefully following all of the instructions at :ref:`myhg`. By following these instructions you will also create a clone of the repository and add a file to it called *testfile.txt*. Make sure you have set the environment variable *MYHG* since this is used below. #. In the clone of your repository, create a subdirectory *homeworks* and within this directory a subdirectory *homework1*, via the following commands:: $ cd $MYHG $ mkdir homeworks $ cd homeworks $ mkdir homework1 You should now be able to *cd* into this directory:: $ cd homework1 or later you can get there from anywhere via:: $ cd $MYHG/homeworks/homework1 #. Copy a file from the class repository to your own repository by:: $ cp $CLASSHG/homeworks/homework1/testpython.py $MYHG/homeworks/homework1 This should create a file *testpython.py* in the directory *$MYHG/homeworks/homework1*. Read the instructions in `the file <../../../homeworks/homework1/testpython.py>`_ and do as instructed. As part of this you will *add* two files using *hg*, *commit* this change, and *push* them to your Bitbucket repository so that we can view them. **Note:** If you have done this and also followed the instructions at :ref:`myhg` and in the file `testpython.py <../../../homeworks/homework1/testpython.py>`_, you should have 3 files in your repository: * $MYHG/testfile.txt * $MYHG/homeworks/homework1/testpython.py * $MYHG/homeworks/homework1/testoutput.txt These files should also be visible from your bitbucket webpage, by clicking on the "Source" tab, see :ref:`bitbucket`. **Note:** After running the test script, you will also have a file `test.f90` and perhaps `a.out` in your directory $MYHG. Do **not** add these to your repository with `hg add`. #. You created a private repository, so you will have to give us permission to view or clone it. Do so by clicking on the "Admin" tab at the top of your Bitbucket account page and then use the "Add reader" tool. You should add both *rjleveque* and *grady.lemoine* (the TA). #. Finally, let us know where your Bitbucket repository is so that we can clone it and/or view your source files online in order to grade it. If you are registered in the class, you should be able access the `class Catalyst webpage `_. Go to that page and follow instructions to send us this information.