CS 145 Lecture 36 – Lights Out
Dear students, Today we apply a little bit of everything we’ve learned in a case study of the game Lights Out. We’ll use primitives and objects, ifs and loops, arrays, files, exceptions, graphical user interfaces—the whole shebang! Here’s your TODO to complete before we meet again: Lab tomorrow will be crazy with review sessions, returned […]
CS 352 Lecture 37 – Hazard Mitigation
Dear students, Last time we introduced the idea of pipelining, which allowed multiple instructions to progress through the processor at a time. But we saw some dangers that crept in. If this were politics, we would tell pipelining to apologize and resign. But we’re computer scientists, and we fix things rather than give up on […]
ImageIO Exception
While grading student work, I pass through the whole spectrum of feelings, from elation to disappointment to bafflement to pride. Today I spent a fair bit of time in disappointment, but not because of my students’ code. Because of some code in the Java library. Hear, my friend, a tale of a standard library gone […]
CS 145 Lecture 35 – Data Analysis
Dear students, People often ask, “What can I do with computer science?” I usually splutter and stammer out an unconvincing answer, because the answer is pretty much anything. Your choices are many, and they widen near our nation’s larger cities. Some people fear that they will be spending all their time at a computer, but […]
CS 352 Lecture 36 – Pipelining
Dear students, We begin today with a short baking lesson that will demonstrate the need for processing instructions differently. Suppose I need a lot of cookies. Ignoring the setup costs, suppose it takes me 15 minutes to scoop out 12 balls of dough and plop them onto a baking sheet. These then cook for 30 […]
CS 145 Lecture 34 – Slideshow
Dear students, I’ve said several times that object-oriented design helps us organize our code. We can put code and the data that it regularly processes together into the same chunk. Objects allow for the separation of concerns. Class A can focus on its task, and be very good at it. It can be tested and […]
CS 352 Lecture 35 – Caching Strategies
Dear students, We looked last time at how our code will perform better if we capitalize on temporal and spatial locality. Sadly, we cannot avoid misses altogether. Caches are finite storage, and their designers must decide where blocks from memory will go in the cache and how long they will stay there. As you’ve done […]
CS 145 Lecture 33 – Stopwatch
Dear students, As we saw with methods, a primary benefit of object-oriented programming is code reuse. We can create a utility and use it over and over again, in many contexts. We will do just that by designing a Stopwatch class. We will use it to time a few operations: a words-per-minute calculator the amount […]
CS 145 Lab 11 – SplatBot
Welcome to lab 11! If you have checkpoints from the last lab to show your instructor or TA, do so immediately. No credit will be given if you have not already completed the work, nor will credit be given after the first 10 minutes of this lab. In this lab you will create a robot […]
CS 352 Lecture 34 – Memory Hierarchy Cont’d
Dear students, Last time we introduced the memory hierarchy. This hierarchy is not unlike a league of superheroes, each with its strengths and weaknesses. But the weaknesses are minimized, as long as you rotate in the proper superhero for each villain you encounter. For the memory hierarchy, the goal of stacking together these technologies is […]