CS44 Weekly Lab: week 10

C++, C++ Tools, B+Tree Lab
Today:
  1. Intro to checkpoint 2 of B+Tree lab.
  2. Checkpoint 1 demo:
    1. Compile a version of your program that runs test0 without DEBUG defined (this test checkpoint 1 functionality).
    2. Run your checkpoint 1 version, redirecting I/O to an output file and add, commit, and push the ouput file to your git repo (after checking that it is not huge):
      ./wiscdb_main > chkpt1_out
      # make sure the ouput file contains what you expect it should
      # (if not: rm chkpt1_out, fix your program, try again):
      ls -l chkpt1_out   # should not be huge
      cat chkpt1_out
      # if it is okay, add it to your repo and push 
      git add chkpt1_out
      git commit -m "checkpoint output"
      git push
      
    3. Next, copy the executable to another file:
      cp wiscdb_main chkpt1
      # DO NOT add this executable to your repo (remove it after you run it for me)
      rm chkpt1
      
    4. Keep working and you can run chkpt1 for me when I get to your group.

  3. Work on B+Tree lab

Some example output from my program This shows output from tests I have for testing splitting nodes and for testing the BTreeIndex constructor that creates the object from an already existing B+Tree file. Both are parts of the 2nd checkpoint functionality. It also shows how I've added some command line options to main.cpp to specify number of tuples and which test to run (I suggest doing something like this too to make testing checkpoint 2 and beyond easier, particularly adding in a command line option to specify the number of tuples).

As you work on C++ labs, remember all these resources:

There is lots of documentation also available off my help pages
Under "Language Help" the C and C++ headings have a lot of information and resources for C++ and C programming (and look under both for resources, most of the common parts of the language are listed under my C resources), including command line arguments in C (and C++).