CS 70

Getting Help with Homework 8

Ask your Homework 8 questions here. Use the box at the bottom of this page. Your question is posted to this page for the class to see, under an animal name rather than your own—and if you would rather only the course staff saw it, there is a box to tick for that.

Course staff read this page. So do your classmates, and a classmate answering first is a good outcome rather than a failure of the system.

  • Goat speaking

    Meh. Why not just email somebody?

  • LHS Cow speaking

    Because one answer here reaches everyone with the same problem, and on this homework, year after year, a lot of people hit the same hashing-and-rehashing snags within an hour of each other.

  • Duck speaking

    So if I'm stuck on my hash function or a segfault in rehash, somebody else probably is too?

  • LHS Cow speaking

    Almost certainly. That is exactly the kind of question that is worth asking in public.

Before you ask

  • Re-read the phase you are on, and check the HashMultiset Specifications if your question is about what a method must do.
  • Compile on the CS 70 server, and read the first error, not the last one — a later error is often just fallout from an earlier one.
  • If your question is about a lesson rather than the assignment, ask on that lesson's Key Points page instead, where it sits next to the material.

Asking a question we can actually answer

  • Push your code first. Commit, push, and say so — then whoever picks up your question can look at the real thing rather than at a description of it.
  • The exact command you ran—pasted, not summarised.
  • The exact output or error, in full, in a `` code block. Compiler, linker, andvalgrind` output are long and the useful line is often not the last one, so paste all of it.
  • What you expected instead, and what you have already tried.

Things that go wrong on Homework 8 specifically

  • Segfaults or leaks in insert/rehash. Say which phase, and paste the valgrind output — memory bugs in the chaining are the classic Homework 8 trap.
  • Your hash table "works" but is slow, or a test hangs. Say how big the input was and which operation; a missing rehash shows up as a slowdown, not a crash.
  • Performance-statistics numbers look wrong. Say what you measured and what you expected.
  • wordgen still makes letter soup after Phase 8. Check that you set WORDGEN_USE_WORDMODEL to 1 and ran make, and that train really inserts every n-gram (including the last one, which ends in $).
  • wordgen stops with invalid_argument from rng.get. That's rng.get(0): the total of the counts was zero, so the context was never seen in training. Check that train pads with the same number of ^s that generate starts with, and that generate slides its context along.
  • Your partner's copy works and yours doesn't. Usually one of you has not pulled the other's latest commits. Pull first, then say what still differs.

When a conversation would be faster

  • Ask in lab, especially for anything where someone looking at your screen beats a paragraph of description.
  • Come to grutoring or office hours for anything conceptual, or for the questions that are hard to phrase.
  • For anything personal, or about the course rather than the code, contact a professor directly.

(When logged in, completion status appears here.)