Download Introduction to OSP

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Clusterpoint wikipedia , lookup

Open Database Connectivity wikipedia , lookup

Navitaire Inc v Easyjet Airline Co. and BulletProof Technologies, Inc. wikipedia , lookup

Transcript
Open source programming
outline







Tentative schedule
definition: what is open source software?
examples of open source software
history of free software and open source
Proprietary vs. Open Source Licensing
Models
open source software development model
open source business models
Objective

On completion of this course the students
understand how to create open source
software applications and can publish it over
the Internet
Schedule
Week
#
Date
Topic
1
12-Apr-15
UNIT – I: INTRODUCTION TO OSP, PHP, MYSQL
2
19-Apr-15
APACHE, POSTGRESS , SQL
3
26-Apr-15
OVERVIEW OF PHP – VARIABLES
OPERATIONS, CONSTANTS,
4
10-May-15
CONTROL STRUCTURES ARRAYS, FUNCTIONS,
5
17-May-15
CLASSES – HANDLING FILES
6
24-May-15
UNIT – II: MY SQL DATABASE PROGRAMMING - CONNECTING – TABLE CREATION –
RECORD INSERTION
7
31-May-15
UPDATION – MULTIPLE DATABASE HANDLING
8
7-Jun-15
UNIT – III: E-MAILINGWITH PHP - SENDING AN EMAIL – MULTIPART MESSAGE
Week
#
Date
9
14-JUN-15
Topic
STORING IMAGES – GETTING CONFIRMATION
28-JUN-15
MID SEM EXAM
04-JUL-15
MID SEM EXAM
10
12-JUL-15
SESSION TRACKING USING PHP – GRAPHICS INPUT VALIDATORS – COOKIES
11
26-JUL-15
UNIT-IV : INTRODUCTION TO PERL - NUMBERS AND STRINGS – CONTROL
STATEMENTS
12
2-AUG-15
LISTS AND ARRAYS – FILES
13
9-AUG-15
PATTERN MATCHING – HASHES – FUNCTIONS.
14
23-AUG-15
UNIT – V : TCL / PYTHON - INTRODUCTION TO TCL/TK
15
30-AUG-15
INTRODUCTION TO PYTHON
16
6-SEP-15
PYTHON
13-SEP-15
PL & APD
20-SEP-15
END SEM EXAM
27-SEP-15
END SEM EXAM
05-OCT-15
PAPER DISTRIBUTION
Expected Outcome
Students should be able to design open source
software applications and can publish it over the
Internet
Text books
1. Julie C. Meloni, SAMS Teach yourself PHP, MYSQL
and Apache, Second edition Pearson Education, 2006.
2. Michael K.glass, Rommn le Scouarnec, et.al.,
Beginning PHP, Apache, MySQL web
development,Wiley Publishing, Inc, New Delhi, 2004
3. Leon Atkinson and Zeev Suraski, Core PHP
programming, 3rd Edition, Pearson Education, Delhi,
2004.
what is open source
software?
Open Source software is software licensed under an
agreement that conforms to the Open Source
Definition
•
•
•
•
•
•
Access to Source Code
Freedom to Redistribute
Freedom to Modify
Non-Discriminatory Licensing (licensee/product)
Integrity of Authorship
Redistribution in accordance with the Open
Source
– License Agreement
examples of open source
software

Operating Systems
– Linux
– FreeBSD, OpenBSD, and NetBSD: The
BSDs are all based on the Berkeley
Systems Distribution of Unix, developed
at the University of California, Berkeley.
Another BSD based open source project is
Darwin, which is the base of Apple's Mac
OS X.
examples of open source
software

Internet
– Apache, which runs over 50% of the world's web
servers.
– BIND, (Berkeley Internet Name Daemon ) the software
that provides the DNS (domain name service) for the
entire Internet.
– sendmail, the most important and widely used email
transport software on the Internet.
– Mozilla, the open source redesign of the Netscape
Browser
– OpenSSL is the standard for secure communication
(strong encryption) over the Internet.categories.
example of open source software

Programming Tools
– Zope, and PHP, are popular engines behind the "live
content" on the World Wide Web.
– Languages:
 Perl
 Python
 Ruby
 Tcl/Tk
– GNU compilers and tools
 GCC
 Make
 Autoconf
 Automake
open source software sites








Free Software Foundation www.fsf.org
Open Source Initiative www.opensource.org
Freshmeat.net
SourceForge.net
OSDir.com
developer.BerliOS.de
Bioinformatics.org
see also individual project sites; e.g.,
www.apache.org; www.cpan.org; etc.
some dates from the history
of open source





1970s: UNIX operating system developed at Bell
Labs and by a diverse group of contributors
outside of Bell Labs; later AT&T enforces
intellectual property rights and “closes” the code
1983: Richard Stallman founds the Free
Software Foundation
1993: Linus Torvalds releases first version of
Linux built
1997: Debian Free Software Guidelines released
1998: Netscape releases Navigator in source
Proprietary vs. Open Source Licensing Models
conventional models
of software development

waterfall
– from requirements to code without a
backward turn


historically used for large military and corporate
software productions; originally used because
computing time was expensive
spiral
– iterative cycles of requirements,
development, testing, redrafting of
requirements, etc.

B. W. Boehm. “A spiral model of software
development and enhancement”. IEEE Computer,
21(5):61--72, 1988
Waterfall Model
Spiral Model
open source software development
Users
Documenters
Users
Bug reporters
Patchers
Maintainers
Core
developer(s)
Users
Users
Phases of OSD
open source business
models

What it Provides??
– service
– support
– education
– extensions
open source companies

IBM


Apple


released core layers of Mac OS X Server as an
open source BSD operating system called Darwin;
open sourcing the QuickTime Streaming Server
and the OpenPlay network gaming toolkit
HP


uses and develops Apache and Linux; created
Secure Mailer and created other software on
AlphaWorks
uses and releases products running Linux
Sun

uses Linux; supports some open source
development efforts(Forte IDE for Java and the
Mozilla web browser)
open source companies

Red Hat Software
– Linux vendor

ActiveState
– develops and sells professional tools for
Perl, Python, and Tcl/tk developers.
open source licensing

see http://www.opensource.org/licenses/
– apache software license
– python license
– ibm public license
– apple public source license
– etc.
PHP – Introduction
Agenda
1. Brief History of PHP
2. Getting started
3. Resources
Brief History of PHP
PHP (PHP: Hypertext Preprocessor) was created by Rasmus Lerdorf in 1994. It was
initially developed for HTTP usage logging and server-side form generation in Unix.
PHP 2 (1995) transformed the language into a Server-side embedded scripting language.
Added database support, file uploads, variables, arrays, recursive functions,
conditionals, iteration, regular expressions, etc.
PHP 3 (1998) added support for ODBC data sources, multiple platform support, email
protocols (SNMP,IMAP), and new parser written by Zeev Suraski and Andi Gutmans .
PHP 4 (2000) became an independent component of the web server for added efficiency.
The parser was renamed the Zend Engine. Many security features were added.
PHP 5 (2004) adds Zend Engine II with object oriented programming, robust XML
support using the libxml2 library, SOAP extension for interoperability with Web
Services, SQLite has been bundled with PHP
The latest PHP versions are:
PHP 5.3.8 (23 August 2011)
Stable:
PHP 5.3.4 (09 December 2010)
PHP 5.3: version 5.3.3 (22 July 2010)
PHP 5.2: version 5.2.14 (22 July 2010)
Why is PHP used?
1. Easy to Use
Code is embedded into HTML. The PHP code is enclosed in special start and end tags
that allow you to jump into and out of "PHP mode".
<html>
<head>
<title>Example</title>
</head>
<body>
<?php
echo "Hi, I'm a PHP script!";
?>
</body>
</html>
Why is PHP used?
2. Cross Platform
Runs on almost any Web server on several operating systems.
One of the strongest features is the wide range of supported databases
Web Servers: Apache, Microsoft IIS, Caudium, Netscape Enterprise
Server
Operating Systems: UNIX (HP-UX,OpenBSD,Solaris,Linux), Mac
OSX, Windows NT/98/2000/XP/2003
Supported Databases: Adabas D, dBase,Empress, FilePro (readonly), Hyperwave,IBM DB2, Informix, Ingres, InterBase, FrontBase,
mSQL, Direct MS-SQL, MySQL, ODBC, Oracle (OCI7 and OCI8),
Ovrimos, PostgreSQL, SQLite, Solid, Sybase, Velocis,Unix dbm
Why is PHP used?
3. Cost Benefits
PHP is free. Open source code means that the entire PHP community will contribute
towards bug fixes. There are several add-on technologies (libraries) for PHP that are
also free.
PHP
Software
Free
Platform
Free (Linux)
Development Tools
Free
PHP Coder, jEdit
Getting Started
1.

How to escape from HTML and enter PHP mode
PHP parses a file by looking for one of the special tags that
tells it to start interpreting the text as PHP code. The parser then
executes all of the code it finds until it runs into a PHP closing tag.
HTML
HTML
PHP CODE
<?php echo “Hello World”; ?>
Starting tag
Ending
tag
Notes
<?php
?>
Preferred method as it allows the
use of PHP with XHTML
<?
?>
Not recommended. Easier to type,
but has to be enabled and may
conflict with XML
<script
language="php">
?>
Always available, best if used when
FrontPage is the HTML editor
<%
%>
Not recommended. ASP tags support
was added in 3.0.4
Getting Started
2.

Simple HTML Page with PHP
The following is a basic example to output text
using
PHP.
<html><head>
<title>My First PHP Page</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body></html>
Copy the code onto your web server and save it as “test.php”.
You should see “Hello World!” displayed.
Notice that the semicolon is used at the end of each line of PHP
code to signify a line break. Like HTML, PHP ignores whitespace
between lines of code. (An HTML equivalent is <BR>)
Additional Resources

PHP Manual http://docs.php.net/

PHP Tutorial http://academ.hvcc.edu/~kantopet/php/index.php

PHP Coder http://www.phpide.de/

JEdit http://www.jedit.org/


PHP's creator offers his thoughts on the PHP phenomenon, what
has shaped and motivated the language, and where the PHP
movement is heading
http://www.oracle.com/technology/pub/articles/php_experts/ras
mus_php.html
Hotscripts – A large number of PHP scripts can be found at:
http://hotscripts.com/PHP/Scripts_and_Programs/index.html
Additional Information
Some of the new functions added in version 5:














Arrays:
array_combine() - Creates an array by using one array for keys and another for its
values
array_walk_recursive() - Apply a user function recursively to every member of an
array
Date and Time Related:
idate() - Format a local time/date as integer
date_sunset() - Time of sunset for a given day and location
date_sunrise() - Time of sunrise for a given day and location
time_nanosleep() - Delay for a number of seconds and nano seconds
Strings:
str_split() - Convert a string to an array
strpbrk() - Search a string for any of a set of characters
substr_compare() - Binary safe optionally case insensitive comparison of two strings
from an offset, up to length characters
Other:
php_check_syntax() - Check the syntax of the specified file
php_strip_whitespace() - Return source with stripped comments and whitespace
MySQL
It is named after developer Michael
Widenius' daughter, My.
The SQL phrase stands for Structured
Query Language.
WHAT IS MYSQL





Free SQL (Structured Query Language) database server.
licensed with the GNU General public license
http://www.gnu.org/
MySQL is a database management system.
MySQL is a relational database management system.
MySQL is Open Source Software.
MAIN SUPPORTED PLATFORMS






First developed for Solaris and RedHat Linux.
FreeBSD.
OpenBSD.
Mac OS X Server.
Win95, Win98, NT, and Win2000.
All modern systems with working Posix
threads
and a C++ compiler.
Main Features











Fully multi-threaded using kernel threads.
Works on many different platforms.
Uses very fast B-tree disk tables (MyISAM) with index compression.
Very fast joins using an optimized nested loop-join
APIs for C, C++, Eiffel, Java, Perl, PHP, Python, Ruby, and Tcl are
available, enabling MySQL clients to be written in many languages.
A privilege and password system that is very flexible and secure.
Handles large databases.
Tested with a broad range of different compilers. (C/C++)
Designed to make it relatively easy to add other storage engines. This
is useful if you want to provide an SQL interface for an in-house
database.
You can refer to tables from different databases in the same statement.
A privilege and password system that is very flexible and secure, and
that enables host-based verification.
ADVANTAGES



very fast
reliable and easy to use
multi-threaded multi-user and robust
SQL database server.
DISADVANTAGES



Missing Sub-selects.
MySQL doesn't yet support the Oracle SQL extension:
i SELECT ... INTO TABLE , but supports INSERT INTO
... SELECT ..
– Does not support Stored Procedures and Triggers.
– MySQL doesn't support views.
Untill Mysql 5.1.
DATA MANAGEMENT














SHOW DATABASES;
USE databaseName;
SHOW TABLES;
DESCRIBE table;
SELECT * FROM table;
SELECT * FROM table \G
CREATE DATABASE databaseName;
DROP DATABASE databaseName;
CREATE TABLE tableName(name1 type1, name2 type2, ...);
DROP TABLE tableName;
INSERT INTO TABLE VALUES( value1, value2, ...);
SELECT field1, field2, ... FROM tableName;
SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr;
LOAD DATA INFILE /path/file.txt INTO TABLE skr;
DOWNLOAD

http://www.dev.mysql.com/downloads
Download instructions



http://download.sourceforge.net/mirrors/mysql/
RedHat and SuSe Linux distributions.
http://www.analysisandsolutions.com/code/mybas
ic.htm Beginners MySQL Tutorial on how to install
and set up MySQL on a
Windows machine.
INSTALLATION


Under RedHat Linux from an RPM package (install as root)
rpm -i MySQL-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm
Under any (other) Linux
(install as root)
groupadd mysql
useradd -g mysql mysql
cd /usr/local
gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf ln -s mysql-VERSION-OS mysql
cd mysql
scripts/mysql_install_db
chown -R mysql /usr/local/mysql
chgrp -R mysql /usr/local/mysql
bin/safe_mysqld --user=mysql &
Documentation






http://www.mysql.com/documentation/
http://www.mysql.com/documentation/manual
.php
As text
manual.txt
As HTML
manual_toc.html
As GNU Info
mysql.info
As PostScript
manual.ps
http://www.turbolift.com/mysql
START MYSQL Server
As root under Linux with the command
safe_mysqld &
START A MYSQL CLIENT



Without using passwords
(when the password for the specified user is empty)
mysql -u
<user> -h <Host>
Using passwords
mysql -u <user> -h <Host> -p
Example:
mysql -u root -h localhost
Exitting with the command quit or exit.