teaching machines

CS 491 Lecture 12 – Wevents Part I

Agenda design an app for managing family events hook up to a remote database merge PostgreSQL, PHP, JSON, and Android Wevents One of you stated in your list of desired app-knowledge that you wanted a shared calendar. Another of you shared in lecture that you wanted to talk about hooking up to a remote database. […]

CS 145 Lecture 11 – Conditionals

Agenda how’d the exam go? what does this do? conditionals in Secret Maryo Chronicles pluralizing generating a star generating an ordinal number categorizing light — if/else if What does this do? Code Conditional.java package lecture; public class Conditional { public static void main(String[] args) { star(100); System.out.println(pluralize(“Nick”, 42)); System.out.println(pluralize(“Nick”, 1)); System.out.println(pluralize(“Nick”, -1)); System.out.println(pluralize(“Nick”, -87)); } […]

CS 491 Lecture 11 – Lonely Phone

Agenda write an app to encourage people to lock their phones up meet Services use sensors to detect a “supine” phone meet BroadcastReceivers Goal Our goal today is to write an app I call Lonely Phone. It’s a prank app that you should install on other people’s phones. It’s functionality is to beep whenever the […]

CS 145 Lecture 10 – Midterm 1 review

Things to know The test is hand-written. You may write SOP instead of System.out.println. You need not import any classes. The front page of the exam will contain compact documentation for the Scanner, Random, and String classes. A strategy: on questions where you are asked to write a method, write the method signature first, not […]

CS 145 Lecture 9

Agenda compound booleans logical operators && and || ensuring a number in a range stopping a command loop projectiles writing our own String.indexOf if/else statements Code LogicalFun.java package lecture; import java.util.Scanner; public class LogicalFun { public static void main(String[] args) { boolean isMrRight; boolean isTall = false; boolean isDark = false; boolean isHandsome = false; […]

CS 491 Lecture 10 – Rattle Part III

Agenda why wouldn’t it play? creating a custom adapter getting results from an Activity triggering a list update catching forgot-to-save adding a contextual menu writing out a ringtone Cleanup I’ve cleaned up a few things since last time. I added a Play button to the EditActivity, pushed the song-playing routine out to a Utilities class, […]

CS 491 Lecture 9 – Rattle Part II

Agenda add an edit Activity to Rattler sharing data across Activitys sharing global data across all Activitys update a database record writing a custom adapter playing a song speaking a song Editing Making a user-friendly UI for editing will take some work. Let’s just mock up an Activity that displays a song’s fields in some […]

CS 145 Lecture 8

Agenda an example animation finish summing compound booleans logical operators && and || Code Summer.java package lecture; public class Summer { public static void main(String[] args) { System.out.println(sum(100)); } public static int sum(int n) { int runningTotal = n; while (n > 0) { n = n – 1; runningTotal = runningTotal + n; } […]

CS 145 Lecture 7

Topics Covered what does this do? generating a random spelunking workout for loop = while loop, but more compact sum numbers 1 to n an acrostic editor mouse trails What does this do? public static String ?(??) { return text + ” :)”; } public static ? ??(String text) { return text.length() == 0; } […]

CS 491 Lecture 8 – Rattler

Agenda Start an application for composing ringtones Write a ListActivity Get a taste of Android’s SQLite API Share data globally throughout an application Insert and select from a database RTTTL Nokia put together a specification for a mini-language for encoding ringtones. It’s called RTTTL. The language is fairly straightforward. You’ve got three parts separated by […]

1 106 107 108 109 110