inls572_class11_opensource

Download Report

Transcript inls572_class11_opensource

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
What is Open Source?
• What makes open source software?
– Ability for user to modify?
– Legal agreements?
– Community based development?
– Standards based?
• OSI Definitions
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
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)
Factors of Open Source
•
•
•
•
•
•
Licensing & Copyright
Standards adherence
Sustainability
Modularity / extensibility
Development Cost (free / fee)
Support Cost (Local, licensed)
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
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#
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
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/
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
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
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
Convergence
ATOM
Fedora
Apache
Dspace
Copyright Perspective
Slashcode
MarcEdit
Yahoo SDK
Second Life viewer
Google Code
RSS
Amazon
Flickr
Second Life
Facebook
Ebay
Windows
Mac OS
Community Participation
Development models
•
•
•
•
•
Distributed
Project based
Meritocracy based
Community centric
Sustainable?
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-tofind items to many customers, instead of only selling large
volumes of a reduced number of popular items (Anderson,
2004)
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
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
Technologies for this class
•
•
•
•
Linux
Apache
PHP
MySQL
• LAMP, WAMP, MAMP
– Linux (windows/mac), Apache, MySQL, Php
– http://en.wikipedia.org/wiki/Comparison_of_WAMP
s
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.
2.
3.
4.
5.
6.
•
Is this application Open Source Software?
What kind of license does it have?
What is the development model (individual, community, etc)?
How active is the community surrounding the application?
How popular does it seem?
Is it sustainable?
Take 15-20 minutes to research, we will briefly report our
findings
XAMPP & Wordpress exercise
• Exercise goals
• Configuration
– Overview of the XAMPP directory
structures
– Overview of Wordpress platform & structure
• Conditions & cautions
• Playtime
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
MySQL
• Open Source Relational Database
• http://mysql.com
• At SILS
– pearl.ils.unc.edu
• Relational database features
• Tables, Indexes, Queries
• SQL (Structured Query Language)
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
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']
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);
MySQL Example
function 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];
}
}
Next week
• Guest Speaker
• More on SQL, JavaScript, and
application management