Working On Your Homework
Where to Find Your Homework and Feedback
To find your homework, go to Google Drive, and click on Shared with me. There, you should find two folders:
- CSE 30 <quarter> youremail@ucsc.edu : The folder contains your assigned homework.
- CSE 30 <quarter> Feedback youremail@ucsc.edu : The folder contains your graded homework, once it is graded.
Once you find the folders, I suggest you right-click (or something-click) on it and choose "Add a shortcut to Drive", so that you can find them faster in the future. The shortcut can be added to your base Drive folder, or to other folders.
Homework Format
Each homework assignment consits in a Jupyter Notebook. In turn, a Jupyther Notebook consists of various types of cells:
- Text: you can read them :-)
- Code: you should run them, as they may set up the problems that you are asked to solve.
- Solution: These are cells where you should enter a solution. You will see a marker in these cells that indicates where your work should be inserted.
# YOUR CODE HERE
- Test: These cells contains some tests, and are worth some points. You should run the cells as a way to debug your code, and to see if you understood the question, and whether the output of your code is produced in the correct format. The notebook contains both the tests you see, and some secret ones that you cannot see. This prevents you from using the simple trick of hard-coding the desired output.
Working on Your Notebook in Colab
Google Colab is an environment that lets you work on your notebooks in the cloud. This gives us several advantages:
- You don't need to install anything. All you need is a browser.
- Google provides the virtual machines (the "computers") on which the code is run.
- The notebook is shared with the TAs, tutors, and with the instructor. So when you report that you have difficulties, they can open your notebook and help you.
- The notebook preserves the revision history, which is useful for many reasons, among which that none of your work can be lost, and we can see how you reached the solution.
If you wish, you can also work on the notebooks locally, rather than in Colab. However, if you do that, make sure you submit on time and you submit the right thing, as we cannot go back to look at the revision history to rescue your work.
Using Colab for the first time (in this class)
Set indent to 4 spaces. If this is the first time you use Colab, click on the gear icon on the top right, then on Editor. There, set the indentation width to 4 spaces: this will keep your code correctly indented, which is very important. You can configure the other options at your pleasure.
Running your notebook
Running a cell. To run a cell of the notebook, either click on the icon to its top left, or press shift-ENTER (or shift-Return).
Disconnections. When you open a notebook, Google automatically connects a server to the web page, so that you can type code in your browser, and the code is run on that server. If you are idle for more than a few minutes, Google keeps all you typed (none of your work is lost), but the server may be disconnected due to inactivity. When the server is disconnected, it loses all memory of anything you have defined (functions, classes, variables, etc).
If you do get disconnected, select Runtime > Run All (or Runtime > Run before) to ensure everything is defined as it should.
DO NOT
- Do not add, delete, reorder, remove cells. This breaks the relationship between your work, and the grading system, making it impossible to grade your work.
- Do not import non-standard Python modules. Typically, you do not need to import any Python modules to do your work; everything is already imported for you. If you import non-standard modules that are not installed in the grading environment, grading will fail and you will not get your due credit.
Debugging
To debug, you can add print statements to your code. They should have no effect on the tests. Just be careful that if you add too many of them inside loops and similar, you may cause for some of the tests we will do such an enormous amount of output that grading might timeout (and you may not get credit for an answer).
Asking for help
The tutors and TAs should have access to the notebook; otherwise, you can always share a link with them. In this way, they can take a look at your work and help you with debugging and with any questions you might have.
Submitting Your Work
To submit:
-
Check your work. Before submitting, select:
- Runtime > Restart Runtime
- Runtime > Run All
- and check that you don't get any unexpected error.
- Download the notebook. Click on File > Download .ipynb . Do not download the .py file.
- Upload. Upload the .ipynb file to the Google Form specified in the notebook.
- Deadlines are at 11pm (NOT midnight).