Last updated on

Week 13 Debrief: Webapps over!

Congrats on completing your 13th week of CS-214!

First, congratulations on completing your webapps! I’m impressed by the creativity and skills that you have displayed, and delighted to see how far you’ve come since the beginning of the semester. I hope that you’re proud of the results you achieved.

Administrivia

Webapp checkoffs

Final exam

Feedback on the course

There are two upcoming polls regarding CS214. Both are important:

Exercises

Interesting Ed questions

Interview lecture

Since we won’t have a recording of this year’s interview lecture, here is the code that I ended up with at the end of the brief interview demo:

import java.nio.file.{Paths, Files}

def seqDigits(nDigits: Int): Iterator[String] =
  require(nDigits >= 0)
  val fmt = s"%0${nDigits}d"
  Iterator.from(0).map(d => fmt.format(d)).takeWhile(_.length == nDigits)

def mkTemp(template: String) =
  require(template.endsWith("XXX"), "Not enough `X`s at end of template string.")
  val suffixLength = template.reverseIterator.takeWhile(_ == 'X').length
  val prefix = template.dropRight(suffixLength)
  seqDigits(suffixLength).map(prefix + _).filter(name => !Files.exists(Paths.get(name))).next()

(The rest of the lecture is quite similar to the recording already found on MediaSpace.).