Scott Cutler
Professor in the Practice of Computer Technology
Department of Computer Science
Department of Electrical and Computer Engineering cutler@rice.edu
8/22/12
Wednesday 2-3:30, DH 1046
Events of the Week
Housekeeping
Syllabus
Next week’s assignment and class
A little more on Objective C
Questions on Assignment #1
Steve Job’s Legacy (if we have time)
COMP 446 / ELEC 446 - Week 1 SEC - 8/22/12 2
MIT’s Area Exam
Rapidly learn a topic
Keep abreast of your surroundings and how that will impact you and your specialty.
Was the most important thing ingrained in me from 7 years at MIT
These are the prime skills required of a CTO and are the foundation of ELEC/COMP 694
COMP 446 / ELEC 446 - Week 1 3 SEC - 8/22/12
Jury decides Samsung infringed on Apple patents
Impact on Apple, Samsung, Nokia, MSFT, HTC
Windows 8 RTM along with VS 2012
Regulators OK Verizon's $3.9B bid to buy cable spectrum
As first 'lockup' ends, Facebook stock drops 5 percent
A Look Inside Microsoft's SkyDrive Cloud Service iPad Mini Name 'Confirmed'
Apple becomes world's most valuable public company
Best Buy suspends forecast as fiscal Q2 profit slides 91%
Dell Stock Plummets as PC Price Wars Intensify
Dell and HP Missing the Mobile Boat
HP to Report its Biggest Quarterly Loss in History
Dell Names Ex-HP Exec to Head Enterprise Solutions Unit
Amazon Announces September 6 Press Conference; Mum on Details
SEC - 8/22/12 COMP 446 / ELEC 446 - Week 1 4
Victor Acuna
Ryan Artecona
Gbenga Badipe
Joel Baranowski
Peter Chang
Joan Chao
COMP 446 / ELEC 446 - Week 1 SEC - 8/22/12 5
Alex Chiu
Heaven Chen
Lingo Dai
Weibo He
Sahil Hingorani
Zhehao Li
COMP 446 / ELEC 446 - Week 1 SEC - 8/22/12 6
Abdul Nimeri
Bill Robertson
Frank Salinas
Tyler Siegert
Austin Witt
Matthew Zhao
COMP 446 / ELEC 446 - Week 1 SEC - 8/22/12 7
Course Website: www.comp446.com
assignment submission website linked through www.comp446.com
iPhone Developer Program
iPhone Documentation available at http://developer.apple.com
Students will be enrolled in Rice’s iPhone University Developer’s
Program
You should have already responded to invitations
Xcode available free on Macs
Remember User: xcode, Password: xcode
COMP 446 / ELEC 446 - Week 1 8 SEC - 8/22/12
Unless otherwise instructed, submit assignment files as a zip file of Xcode project directory.
Ensure that all resources are part of the project directory so they are included in zip.
Clean project before archiving. Greatly reduces size.
Screen shots or PDF documents preferred for some assignments (when indicated).
OK to make multiple submissions when both file types needed – but not of individual Xcode project files.
COMP 446 / ELEC 446 - Week 2 9 SEC - 8/31/11
Monday office hours with TA Richard Latimer. 4:00pm Mudd
Additional session Thursday, 9pm on 8/30 and 9/6.
Ability to email questions to me at any time.
Can email Richard Latimer as well.
Level of support will vary over semester
High level of support at the beginning.
Support decreasing each project as over time as knowing where to look or how to debug is a very important skill for you to learn.
Richard instructed to respond conceptually – not just provide solutions.
SEC - 8/22/12 COMP 446 / ELEC 446 - Week 1 10
Lecture 1 - 8/22/12 Introduction
Watch before:
Assignment:
None
#1 - Calculator
Assignment due: Friday, 8/31 6:00 am (Thursday 30:00)
Lecture 2 - 8/29/12Assignment 1 issues and questions from videos
Watch before:
Assignment:
1, 2
#2 – Function Calculator
Assignment due: Friday, 9/7 6:00 am (Thursday 30:00)
Lecture 3 - 9/05/12 Assignment 2 issues and questions from videos
Watch before:
Assignment:
3, 4 (demo part)
#3 – Graphing Universal Calculator
Assignment due: Tuesday, 9/18 6:00 am (Thursday 30:00)
Lecture 4 - 9/12/12 Assignment 3 issues and questions from videos
Watch before:
Assignment:
4 (post demo), 5, 6
Continue with #3 – Graphing Universal Calculator
Assignment due: Tuesday, 9/18 6:00 am (Monday 30:00)
Lecture 5 - 9/19/12 Assignment 3 issues and questions from videos
Watch before: Watch 7 before class, 8 after class
Assignment: #4 – Fiickr Top Places
Assignment due: Friday, 9/28 6:00 am (Thursday 30:00)
SEC - 8/22/12 COMP 446 / ELEC 446 - Week 1 11
Lecture 6 - 9/26/12 Assignment 4 issues and questions from videos
Watch before:
Assignment:
8, 9 very beginning of 10
#5 – Fiickr Map Places
Assignment due: Friday, 10/5 6:00 am (Thursday 30:00)
Lecture 7 - 10/03/12 Assignment 5 issues and questions from videos
Watch before:
Assignment:
10 (after Tab Bar), 11, 12
1: #6 – Fiickr Core Data
- Likely to be broken into required and optional parts
- Optional part required for A+
2: Final Project Topic (due before next class)
Assignment due: Friday, 10/12 6:00 am (Thursday 30:00)
Lecture 8 - 10/10/12 Assignment 6 issues and SQL
Watch before:
Assignment:
13, 14
Final Project Proposal
Assignment due: Tuesday, 10/16 6:00 am (Monday 30:00)
Lecture 9 - 10/17/12 iOS 6
Watch before:
Assignment:
Optional 15, 16 iOS 6 app
Assignment due: Friday, 10/26 6:00 am (Thursday 30:00)
COMP 446 / ELEC 446 - Week 1 SEC - 8/22/12 12
Lecture 10 - 10/24/12 – HTML 5
Watch before:
Assignment:
Optional 17, 18
Major Final Project Feature
Assignment due: Friday, 11/2 6:00 am (Thursday 30:00)
Lecture 11 - 10/31/12 TBD
Assignment: Continue working on Final Project
Assignment due: Wednesday, 11/28 2:00pm
Lecture 12 - 11/7/12Android vs. iOS vs. Windows Phone group debate
Assignment: Continue working on Final Project
Assignment due: Wednesday, 11/28 2:00pm
Lecture 13 - 11/14/12 Individual meetings on Final Project
Assignment: Continue working on Final Project
Assignment due: Wednesday, 11/28 2:00pm
Lecture 14 - 11/21/12 – No class, but continue on final project
Assignment: Continue working on Final Project
Assignment due: Wednesday, 11/28 2:00pm
Lecture 15 - 11/28/12 Final Presentations
Assignment: Document Final Project
Assignment due: By time assigned for COMP 446 final (there is NO final exam)
SEC - 8/22/12 COMP 446 / ELEC 446 - Week 1 13
To be determined by 8 th class
Can target iOS, Android or WP device
Proposal submitted by 10/10/12
Full Spec 10/17/12
Various milestones including presentation to class on 11/28/12
Final code for project incorporating comments from presentation due on the official finals date of the course.
This is VERY important: If you do not have a great project definition, the 2 nd half of the course will suffer. With a great project, this will be an exciting course.
Great if your project could have life after the class finishes
COMP 446 / ELEC 446 - Week 1 14 SEC - 8/22/12
Watch CS193p lectures #3 and #4 (demo part) before class
Complete CS193p Assignment #2
Try and complete before next class. Due shortly after next class.
Submit assignments, review lectures at www.comp446.com
Start thinking about big project
Next week’s lecture – mostly review of Objective C fundimentals
15 SEC - 8/22/12 COMP 446 / ELEC 446 - Week 1
Better question: Why is an Objective-C string called NSString
How are these two questions related and why is it relevant to the high quality of these videos.
SEC - 8/31/11 COMP 446 / ELEC 446 - Week 2 17
Class
(description/template for an object)
Instance
(manifestation of a class)
Instance Variable
(object-specific storage)
Message
(sent to objects to make them act)
Method
(code invoked by a Message)
Inheritance
(code-sharing mechanism)
Super/Subclass
(Inheritance relationships)
Protocol
(.h without .m with other objects announcing suport)
Source: CS193p Lecture #1
COMP 446 / ELEC 446 - Week 2 18 SEC - 8/31/11
Create a new project with a single MVC
Show various files in your project (via Navigator or clicking on bars at the top of files)
Show and hide the Navigator, Assistant Editor, Console, Object Library, Inspector
Drag objects into your view and edit their size, position and object-specific display attributes
Ctrl-drag to connect objects in your View to the code in your Controller (outlets and actions)
Show connections to outlet @property s and action methods (by mouse-over or right click)
Get quick help (option click) or full documentation (option double-click) for symbols in your code
Run your application in the simulator
Click on warning (yellow) and error (red) indicators to see problems in your code
Create a new class (like CalculatorBrain ) using the File menu’s New File ... item
Create browser-like tabs to organize your viewing of your project
SEC - 8/22/12 COMP 446 / ELEC 446 - Week 1
Source: CS193P 2011 Lecture 3
19
Define a class’s public
@interface and private @implementation in a .h and .m file respectively
Add a private @interface to .m file
Create a @property , both for a primitive type (like BOOL ) and a pointer (like
NSMutableArray * )
Use nonatomic in @property declarations
Use strong or weak in @property declarations of pointers to objects
Use @synthesize to create a @property
’s setter and getter and backing instance variable
Use “= _propertyname” to choose the name
@synthesize uses for its backing instance variable
For pointers to an object, use either the special type id or a static type (e.g. UIButton * )
Declare and define an Objective C method (e.g. pushOperand: or popOperand).
Declare local variables both of type “pointer to an object” ( id or static type) and primitive type
Source: CS193P 2011 Lecture 3
SEC - 8/22/12 COMP 446 / ELEC 446 - Week 1 20
Invoke an Objective C method (using square bracket [] notation)
Invoke a setter or getter using dot notation (e.g. self.operandStack or self.display.text)
Lazily instantiate an object by implementing your own @property getter (operandStack & brain)
Wrap a primitive type (like double ) in an object (using NSNumber )
Log formatted strings to the console using NSLog ()
Use a “constant” NSString in your code using @“” syntax (e.g. @“+” )
Add and remove an object from an NSMutableArray (the last object anyway
).
Use alloc and init to create space in the heap for an object (well, you’ve barely learned this).
#import the .h file of one class into another’s (CalculatorBrain.h into your Controller)
Create a string by asking a string to append another string onto it
Create a string with a printf-like format (e.g., [ NSString stringWithFormat:
@“%g”
, result])
Perhaps you’ve learned even more if you’ve done Assignment #1!
Source: CS193P 2011 Lecture 3
SEC - 8/22/12 COMP 446 / ELEC 446 - Week 1 21
Class object capitalized
NSObject, NSArray, etc.
Method names are lower case
stringByAppendingString
Instances of classes are in lower case
self, myBrain
Long names have capitals bounding words
stringByAppendingString
Brain is not the same as brain
COMP 446 / ELEC 446 - Week 1 SEC - 8/22/12 22
Classes, instances, types, colors
Major exceptions are C-structs as are numbers (but not NSNumber s)
You can send messages to classes
[[MyClass alloc] init];
[ NSString stringByAppendingString]
(ClassName ) does not change an object’s class, but tells Xcode that it can assume object is of class
ClassName.
COMP 446 / ELEC 446 - Week 1 23 SEC - 8/22/12
An object instance variable is only a pointer
Initially set to nil (which is 0)
You can safely send messages to nil
NSString foo = @”This is not correct syntax”;
NSString *foo =@”This is correct syntax”;
i d foo = @”id types do not use a *”;
We will latter see **foo implying a pointer to a pointer.
COMP 446 / ELEC 446 - Week 1 24 SEC - 8/22/12
SEC - 8/31/11 COMP 446 / ELEC 446 - Week 2 25
SEC - 8/31/11 COMP 446 / ELEC 446 - Week 2 26
Every 10 years or so, something big changes
Core leaders of this technology often young
Luck or Skill
Many people have one great idea, some two
Few have one great idea after another
Often requires excellence in multiple areas
Risk and Failure
COMP 446 / ELEC 446 - Week 2 SEC - 8/31/11 27
Being first gives you a head start, but also paints a target for those who follow behind.
Steve Jobs often took an existing area and through a set of bold moves changed the paradigm giving people what they really wanted – or would discover that they needed.
COMP 446 / ELEC 446 - Week 2 28 SEC - 8/31/11
Allows differentiation and future shaping in cost competitive environment.
Eases introduction of new technology
Enables bold moves
Great competitive barrier to entry
But can also cost significant business if not at or near best of breed in an important area.
COMP 446 / ELEC 446 - Week 2 29 SEC - 8/31/11
1983 Apple Keynote-The "1984" Ad Introduction
1984 Superbowl Commercial
The Lost 1984 Video: young Steve Jobs introduces the
Macintosh
The charisma of Steve Jobs (video roundup)
COMP 446 / ELEC 446 - Week 2 30 SEC - 8/31/11
Apple iPad Keynote in 2 minutes! [HD]
Back To The Mac in 104 seconds
Incredible amazing awesome Apple
The Original Apple Keynote Cutdown. No cuts are repeated.
Done with iMovie, which is really awesome...
COMP 446 / ELEC 446 - Week 2 SEC - 8/31/11 31
Yep, it’s me
SEC - 8/31/11 COMP 446 / ELEC 446 - Week 2 32