TA

  • Jeongwan Haah
  • Office: 238 Annenberg (x5987)
  • Section: TBD

Submitting Assignments

When you turn in your assignments, you need not make a hard-copy. You are encouraged to put your files of final version into the directory,

 $(jwhaah)/dropbox/ 

where

 $(jwhaah) = /tweedledee/home/users/misc/jwhaah 

It will be convenient to make a symbolic link in your home folder.

cd
ln -s /tweedledee/home/users/misc/jwhaah/dropbox ./to_ta

Then you will be able to put your files in the directory as follows.

cp my_file ~/to_ta/

In assignments, you are usually asked to plot graphs. Inasmuch as you can print the graphs, you can save the graph in ps, eps, or pdf format. The method depends on the graphing tool you use. Copy the graph files as well as your code files into the dropbox. The plain text format for all files is preferred except graphs.

The name of your final file should be in the form:

(yourname)_(assigment number:1-7)_blabla.tgz

A tgz file is an archive, which you can make by

tar cvzf (yourname)_(1-7).tgz (list of files or the directory containing them separated by spaces)

Note that, as the name indicates, dropbox is write-only directory; you will not be able to see the content of the dropbox. In other words, once you turn in your work, you cannot revise them. If you want revision, you should work on your original file and copy the revised version into the dropbox again. The previous files will be OVERWRITTEN if their names were the same as the new.

It is a good idea to make your own dropbox in your home direcotory, so that your TA can write you or comment directly on your source code, and turn them back to you when needed. By means of dropboxes, you and TA are establishing a secure channel, although it is not perfect.

cd
mkdir drobox
chmod 733 dropbox

Passing Level

  1. It is obviously required that your code be able to be compiled.
  2. Your source code must be readable and understandable.
  3. Your program is expected to generate planned result.

The conditions are listed according to their level of importance. The second is very important especially if you are programming for the first time. Programming is much more than writing a formula. Think it as though you are writing a math proof. Your source code is the proof itself. Leave no tricks behind. Try to explain every line if it is not self-explanatory.

General Rules for Good Programming

  1. You are writing a easy proof for a given problem.
  2. Think and write before running into the terminal.
  3. Think about data structure and operation on it.
  4. Build small modules first, and test it before combine them.
  5. Write interface first for functions. (Below is an example)
    1. valarray g_field( double mass, double x, double y )
    2. valarray total_g_field( double stars[][3], int n, double x, double y ) / / stars[i][0]: mass, 1:x-position 2:y-position
    3. valarray next_velocity( valarray& field, valarray& now_velocity, double time_step )
  6. Write self-explanatory code. If not easy, write smart code with comprehensive comment.
  7. One function should be short enough so that the entire body can be seen on a screen.
  8. Operations of logically different level must have different indentation level.
    1. e.g) The body of for loops and if-statement must have higher indentation level than for or if statement
  9. Focus on a working algorithm rather than the best algorithm.
    1. Improvements in performance is often unnecessary, or can be done very efficiently with a help of various tools. (There are sophisticated tools that tell you which part of your code takes the longest time.)

Graphs

A graph must contain each of the following:

  1. Title
  2. Axis Label
  3. Concise description about data

A graph is an efficient way to express an idea of the data. If a graph is missing any one of the above, the effectiveness of it is degraded, and sometimes becomes worse than a plain sentence.

  1. A graph should show all data that are important – you might have to change the units of the axis or the scale.
  2. If the dependent variable is function of several variables, you should specify the fixed values.
  3. Sometimes, it is good to write your own interpretation of the data.
 
jeongwan_haah.txt · Last modified: 2011/09/21 10:25 by jwhaah
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki