CS 330 Lecture 3 – Regular expressions++
Agenda more wildcard characters developing on clark.cs.uwec.edu substitution slurping a file expressions as replacements Perl subroutines zero-width assertions Code emails.pl #!/usr/bin/perl open($in, ‘<‘, ‘getlist.txt’); while ($line = <$in>) { $line =~ s/^(\S+).*$/$1\@uwec.edu/; print($line); } close($in); page.html <!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN” “http://www.w3.org/TR/html4/loose.dtd”> <html> <head> <title></title> </head> <body> <h2>Foo</h2> <h3>Blech</h3> <h4>Scrumpt</h4> </body> </html> demote.pl […]
CS 145 Lecture 1 – Introduction, data, and arithmetic operators
Agenda introduction our class: prior programming experience majors communication math two fronts: data and instructions arithmetic operators variables data: ints and doubles instructions: System.out.println, + – * / % = Code Mathiness.java package preexam1; public class Mathiness { public static void main(String[] args) { System.out.println(26.16 * 0.15); System.out.println(1000000.0 / 540000.0); System.out.println(); System.out.println(57 % 12); double […]
CS 330 Lecture 2 – Regular expressions
Agenda Activate your Piazza account! Adventure, Zork Imperative languages Scripting languages Perl Scripting languages John Ousterhout once said: Scripting languages are designed for different tasks than are system programming languages, and this leads to fundamental differences in the languages. System programming languages were designed for building data structures and algorithms from scratch, starting from the […]
CS 330 Lecture 1 – Introduction, DFAs
Agenda build a language-recognizing machine DFAs: set of states (one starting, one or more accepting) input alphabet transition function, mapping state and current symbol to next state course information you? name? what if not computers? write a short language biography build more language-recognizing machines: one- or two-digit month numbers articles of the English language (a, […]
CS 491 Lecture 24 – Trivia competition
Agenda ask 100 questions give out prizes Haiku
CS 145 Lecture 25 – Sound
Agenda how’d it go? generating sound (frequencies, WAV standard) binary I/O little endian vs. big endian Code LEDataOutputStream Haiku
CS 145 Lecture 24 – Growable arrays
Agenda identity per instance instance vs. static a growable String array Code … Haiku
CS 491 Lecture 23 – BThwack
Agenda BThwack We were going to talk about incorporating a two-player Bluetooth mode into Bluecheckers, but it was getting out of hand. Instead, I looked back at the last of apps you folks expressed interest in back at the beginning of the semester. And there is was. Whack-a-mole. But not just any Whack-a-mole, Bluetooth-enabled Whack-a-mole. […]
CS 491 Lecture 22 – Bluecheckers
Agenda case study of making a NDK/OpenGL powered game Bluecheckers A couple of weeks ago I got the latest issue of Make magazine in the mail. On page 56, Charles Platt describes a 2-player Chinese Checkers game. I thought, “That’d be fun on a mobile device.” We don’t have time to code it all from scratch, but […]
CS 145 Lecture 23 – Composing with objects
Agenda static vs. non-static designing a Flashlight design a room for a text adventure Code Stopwatch.java package lecture; public class Stopwatch { /** Time at which stopwatch is started */ private long startTime; /** Time at which stopwatch is stopped */ private long stopTime; /** * Starts stopwatch. */ public void start() { startTime = […]