teaching machines

CS 318 Lab 12 – Mockups

Dear students, The next milestone of your project is to create mockups of your pages. The intent behind a mockup is to create a visual sketch of your page that can help you create a feel for the overall layout. Its audience is both you, your collaborators, and your client. There’s a great temptation to […]

CS 330 Lecture 17 – Heap of Trouble

Dear students, Let’s start with a What Does This Do! Absorb this code into your brain, and predict its output. After a minute of silent reflection, we’ll discuss. void mkfoo(char *s) { s = malloc(sizeof(char) * 4); strcpy(s, "foo"); } int main(int argc, char **argv) { char *text = "slar"; mkfoo(text); printf("%s", text); return 0; […]

CS 318 Project – Mockups – due on March 27

Your next milestone in the project is to create mockups for each page of your site. You will then present these mockups to your client for initial feedback. Task 1: Create Mockups Use Moqups. As we did in lab, follow these guidelines to construct your mockups. Thoroughly communicate the structure, but not the content. Generally […]

CS 330 Lecture 16 – Parametric Polymorphism

Dear students, Don’t get me started on arrays. What sort of world is this where an array is fixed in size, but yet it doesn’t know what that size is? We must fix this. Let’s create a growable array: class Flexray { public: Flexray() : capacity(10), nitems(0), elements(new int[capacity]) { } ~Flexray() { delete[] elements; […]

CS 318 Lab 11 – Two-column Layout

Dear students, Today we visit the canonical two-column layout. We’ll use the float property to allow other content to flow around it. We’ll do a quick example together of adding drop caps to a page. Suppose we have this paragraph: A writer—and, I believe, generally all persons—must think that whatever happens to him or her […]

CS 330 Lecture 15 – Choices in C++

Dear students, C++ is a language with choices. Some call that a curse. I’d argue that asking that all doors be closed but one gives to much authority to an outside entity that can’t possibly understand our situation and can’t be trusted to know which door is best. Let’s discuss a few of these choices […]

CS 318 Lab 10 – Absolute and Relative Positioning

Dear students, There’s immense power in the position property. It is your vehicle for anchoring elements relative to another, animating them on user interactions, providing a heads-up display that is always on screen, and achieving a fluid layout that can bend and flex with the browser window. Today we will explore absolute and relative positioning. […]

CS 330 Lecture 14 – Graphing Calculator

Dear students, Let’s put subtype polymorphism to work in a Curses-based graphic calculator. Let’s start with an abstract base class for all manner of functions: class Function { public: virtual double operator()(double x) const = 0; }; Now let’s recast our linear and quadratic functions as independent subtypes of Function: class QuadraticFunction : public Function […]

CS 318 Lab 9 – Box Model, Part 2

Dear students, Today, we will continue to explore the box model. But let’s add some colorful flavor through gradients. Gradients have some nice properties: They eliminate the flatness of solid background colors. They automatically scale to fill the background of an element. Unlike images, they are generated by the browser. They require no expensive downloads. […]

CS 330 Lecture 13 – Vtables and Graphing Calculator

Dear students, We saw last time that for subtype polymorphism to work in languages like Java and C++, we need some for way for each object to carry around some information to help us figure out what method to call at runtime. What exactly is that information and how does the runtime decision—the dynamic dispatch—get […]

1 54 55 56 57 58 232