Week 10

Jeopardy!

UNIX

  1. This shell command can be used to set an environmental variable. setenv
  2. This is used to send the change the output of your program to write to a file instead of the terminal. redirector >
  3. Useful for comparing the output of your program against sample output or binary, this program outputs the differences between the two input files. diff
  4. These three items come from the shell are are passed into your main() function. argc: argument count, argv[]: character string array of arguments, envp[]: character string array of environmental variables
  5. This utility allows you to find a word or phrase in a file. grep

Classes

  1. A pointer that refers to the instance of the class its found in. this
  2. Only these types of classes can access the private variables and methods of another class. friend
  3. This type data member is the same across all instances of the class. static
  4. These are the three member access specifiers and who they allow access to. public: all, protected: derived classes, private: self only
  5. This is how a constructor can be declared if it can take a single int as an argument, but you also want to allow it to be called without any arguments and take a default value. class A { A(int a=0){ } }

Inheritance

  1. Meaning "many forms", this concept allows objects to be used by generic code that will behave differently depending on the type of object. polymorphism
  2. This is how you would declare a pure virtual function. virtual void foo() = 0;
  3. This is how you would write the class prototype of the following derivation tree. Bart -> Simpson <- Lisa class Simpson {}; class Bart: public Simpson{}; class Lisa: public Simpson{};
  4. This is a class that cannot be instantiated. abstract class
  5. This is needed to allow a dynamic class to be deleted through a pointer to a base class. virtual destructor

Data Structures & Sorting

  1. These are two operations done on a stack. push, pop
  2. Another name for a FIFO. queue
  3. Quicksort and mergesort share this average case running time. O(n*log(n))
  4. A binary tree with height n, can have at most this many nodes. 2^n-1
  5. This is the code for inserting an element into a singly linked list. void insert(int i){ ListNode* l = new ListNode(i); l->next = head; head=l;}

Style

  1. These should be replaced with constants to avoid imposing arbitrary limits on your program. magic numbers
  2. These are two ways to write an infinite loop. for(;;){ }, while(1){ }
  3. These are two ways to declare constants in your code. #define, const
  4. These are two practices of robust programming. check error codes, init variables, bounds check
  5. K & R or 1tbs and ANSI are two examples of this. brace conventions

Software Tools

  1. This tool can allow you to step through a program line by line while observing the state of memory. debugger
  2. These are code versioning or source control systems. cvs, svn, rcs
  3. This program can automatically generate documentation from your source code comments. doxygen
  4. These are two editors that can do syntax highlighting, colorizing different elements of your code to make it easier to identify elements such as comments, types and variable names. vi, emacs, nedit, etc.
  5. This command in a debugger can give you the stack of function calls when a segfault occurred. backtrace (bt)

Random

  1. Chris writes software for this platform. embedded systems, telematics, cars
  2. One of the first schools designated by the NSA as a center for Information Assurance Education. UC Davis
  3. These are two fields of research done at UC Davis. security, visualization, computational biology, algorithms, etc.
  4. The computer security expert character Michelle Dessler from the show TV show 24, has a computer science degree from this university. UC Davis
  5. This UC Davis professor won the RSA award last year, one of the top honors in the field of cryptography. Phil Rogaway