Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS...

29
Internet Applications Spring 2008

Transcript of Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS...

Page 1: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Internet Applications

Spring 2008

Page 2: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Review

• Last week– Ajax / APIs– JavaScript overview– RSS reader exercises 1-5– Questions?

Page 3: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

This week

• Open source software

• Exercises– Installing & Configuring Wordpress– Exercises 6 & 7 from our RSS reader

• MySQL functions in PHP

• Recent events– http://www.photoshop.com/express– PWN2OWN 2008

Page 4: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

What is Open Source?

• What makes open source software?– Ability for user to modify? – Legal agreements?– Community based development?– Standards based?

• OSI Definitions

Page 5: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

History of open source

• ARPANET, Berkley, DEC, UNIX• Software was developed by users, was tied closely to

hardware, was not commoditized

• Bill Gates & the Homebrew computer club – the letter

• Richard Stallman (1983), GNU & the Free Software foundation

• Linus Torvalds (1991) Linux• 1995 – NCSA server & Apache• 1998 – Netscape & the Open Source Initiative

Page 6: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

History of open source (2)

• 1998 – IBM partners with Apache

• 1999 – Apache Software foundation

• 1999 – Star Office / Open Office

• 2001 – LAMP environments become commonplace

• 2006 – Microsoft proposes their own OOXML standard for Office 2007 (recent events, more recent events)

Page 7: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Factors of Open Source

• Licensing & Copyright

• Standards adherence

• Sustainability

• Modularity / extensibility

• Development Cost (free / fee)

• Support Cost (Local, licensed)

Page 8: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Licensing and Copyright

• Copyright• Public Domain• Mickey Mouse Protection Act

• CopyLeft– You can re-distribute but not modify or change license of

derivative software– GNU public license

• CreativeCommons• “Creative Commons licenses give you the ability to dictate how

others may exercise your copyright rights—such as the right of others to copy your work, make derivative works or adaptations of your work, to distribute your work and/or make money from your work.” (CreativeCommons)

• Open Source Licenses

Page 9: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

What are Open Standards?

• Facets of open standards– Vendor neutral– Published– Interoperable– Public domain– International– Consensus Based– Well Defined

• Benefits– Cooperative development– Cost/Time savings

• Examples– HTML– XML– Dublin Core– PDFX– PNG (Portable Network

Graphics)– C#

Page 10: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

OSS & OS – the Open Document Format

• Formats– Open formats

• Pdf• Html• Xml

– Closed formats• .doc• .ppt• psd

• Controversies– OOXML vs. ODF

• Microsoft vs. Open Office

• Redhat Magazine

Page 11: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Disruptive technologies

• “release early and often, delegate everything you can, be open to the point of promiscuity” (Raymond)

• Definitions:• A technological innovation that undermines the

place of other technologies in the marketplace by significantly improving performance, saving time, or redefining expectations (more at Wikipedia)

– Microsoft’s Halloween documents

http://www.catb.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/

Page 12: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

The Cathedral and the Bazaar• Every good work of software starts by scratching a developer's personal itch.

• Good programmers know what to write. Great ones know what to rewrite (and reuse).

• When you lose interest in a program, your last duty to it is to hand it off to a competent successor.

• Treating your users as co-developers is your least-hassle route to rapid code improvement and effective debugging

• Release early. Release often. And listen to your customers.

• Given a large enough beta-tester and co-developer base, almost every problem will be characterized quickly and the fix obvious to someone.

• Smart data structures and dumb code works a lot better than the other way around.

• Eric Raymond, 1998

http://www.catb.org/~esr/writings/cathedral-bazaar/cathedral-bazaar/index.html

Page 13: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Cathedrals & Bazaars

• Proprietary Unix Systems

• Large Banking Systems• Integrated Library

Systems• Internet Explorer• Microsoft Office• Itunes• Ebay?• Amazon?• Red Hat Linux

• Linux• Evergreen• Open Office• Apache• FireFox• Facebook?• Ebay?• Amazon?• Audacity• Dspace

Page 14: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Case Study - Unix

• 1980s, 90s – Saw competition between AT&T, Novell, Sun, SCO

• 1982– Richard Stallman starts GNU project

• 1992– Linux is released under GNU license, created by Linus

Torvalds– Linux is on ~12% of servers (while Apache runs nearly 50%

of websites)• 1994

– Red Hat Linux released using a vendor support model– $50 included a distribution and initial support

• 1998– IBM invests in Red Hat, partnerships with Dell, Compaq, Intel

Page 15: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Convergence

Community Participation

Cop

yrig

ht

Per

spec

tive

FacebookSecond Life

ApacheATOM DspaceFedora

WindowsMac OS

RSS

Ebay

Amazon

Google Code

Slashcode

Flickr

MarcEdit

Yahoo SDKSecond Life viewer

Page 16: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Development models

• Distributed

• Project based

• Meritocracy based

• Community centric

• Sustainable?

Page 17: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

The Law of Large numbers, Brooks Law, and the long tail

• Brooks Law– “adding manpower to a late software project makes it later

(Brooks, 1975).• “bugs tend strongly to cluster at the interfaces between code

written by different people, and that communications / coordination overhead on a project tends to rise with the number of interfaces between human beings” (Raymond)

• Law of Large Numbers• “Given a sample of independent and identically distributed

random variables with a finite expected value, the average of these observations will eventually approach and stay close to the expected value.” (Wikipedia, Freund)

• The Long tail• “realize significant profit out of selling small volumes of hard-to-

find items to many customers, instead of only selling large volumes of a reduced number of popular items (Anderson, 2004)

Page 18: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Economic models

• Support sellers– Sell support for open products

• Loss Leaders– Offer core components for free

• Sell it / free it– Open proprietary systems when market demands it

• Accessorizing– Sell add-on modules

• Service enabling– Create applications that enable revenue-generating service

• Branding – Differentiation in the market by perceived value

Page 19: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Support models

• Emergence of hybrid models:– Community developed software, community

provided support– Community developed software – paid

support– Branded software based on OS platform,

paid support– Grant funded development, community

continuation

Page 20: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Technologies for this class

• Linux• Apache• PHP• MySQL

• LAMP, WAMP, MAMP– Linux (windows/mac), Apache, MySQL, Php– http://en.wikipedia.org/wiki/

Comparison_of_WAMPs

Page 21: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Open Source investigation• Form into four groups. Each group should pick one of the

applications below and do some research to answer these questions:

• Firefox, RedHat Linux, Apache web server, Facebook, PHP, Ruby, Dspace (Digital Library application), Ubuntu, Sun Java.

1. Is this application Open Source Software?2. What kind of license does it have?3. What is the development model (individual, community, etc)?4. How active is the community surrounding the application?5. How popular does it seem?6. Is it sustainable?

• Take 15-20 minutes to research, we will briefly report our findings

Page 22: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

XAMPP & Wordpress exercise

• Exercise goals

• Configuration– Overview of the XAMPP directory

structures– Overview of Wordpress platform & structure

• Conditions & cautions

• Playtime

Page 23: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Skills needed for exercises 6 & 7

• Ex 6 – MySQL• SQL syntax• MySQL functions in PHP

• Ex 7 – Forms & form processing• Form coding and actions• Global variables• Page Logic

Page 24: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

MySQL

• Open Source Relational Database

• http://mysql.com

• At SILS– pearl.ils.unc.edu

• Relational database features• Tables, Indexes, Queries• SQL (Structured Query Language)

Page 25: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

SQL Skills

• SQL – Structured query language– Uses a syntax with words like (select,

where, insert, delete, from) to create logical statements

• Select column from tablename where limit = ‘value’;

• Insert into table (column, column) values (value 1, value 2);

– A good reference• http://www.w3schools.com/sql/sql_quickref.asp

Page 26: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

SQL Examples

• SELECT statements• SELECT * from feeds where username = 'mitcheet'", • SELECT * from feeds where id = ".$_REQUEST['feed']

• INSERT statements• INSERT INTO feeds (username, feedname, feedURL)

values ('".$_REQUEST['username']."', '".$_REQUEST['feedName']."', '".$_REQUEST['feedUrl']."')";

• DELETE statements• DELETE from feeds where id = ".$_REQUEST['feedId']

Page 27: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

MySQL functions in PHP• Create a connection to the database

• $connection = mysql_connect($dbserver, $username, $pass);

• Select a database• mysql_select_db($database, $connection);

• Run a query• $result = mysql_query("SELECT * from feeds where username =

'mitcheet'", $connection);

• Get the results of the query as an array• while ($row = mysql_fetch_array($result, MYSQL_NUM)) {}

• Close the connection• mysql_close($connection);

Page 28: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

MySQL Examplefunction showFeed () {

$connection = mysql_connect ("pearl.ils.unc.edu", "inls572_spring08",

"yreuq572");

mysql_select_db("inls572_spring08", $connection);

$result = mysql_query("SELECT * from feeds where id = ".$_REQUEST['feed'], $connection);

while ($row = mysql_fetch_array($result, MYSQL_NUM)){

echo $row[3];}

}

Page 29: Internet Applications Spring 2008. Review Last week –Ajax / APIs –JavaScript overview –RSS reader exercises 1-5 –Questions?

Next week

• Guest Speaker

• More on SQL, JavaScript, and application management