Presentation is loading. Please wait.

Presentation is loading. Please wait.

Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?

Similar presentations


Presentation on theme: "Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?"— Presentation transcript:

1 Open source programming

2 outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software? examples of open source software examples of open source software history of free software and open source history of free software and open source Proprietary vs. Open Source Licensing Models Proprietary vs. Open Source Licensing Models open source software development model open source software development model open source business models open source business models

3 Objective On completion of this course the students understand how to create open source software applications and can publish it over the Internet On completion of this course the students understand how to create open source software applications and can publish it over the Internet

4 Week # DateTopic 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 MESSAGESchedule

5 Week # DateTopic 914-JUN-15 STORING IMAGES – GETTING CONFIRMATION 28-JUN-15MID SEM EXAM 04-JUL-15MID SEM EXAM 1012-JUL-15 SESSION TRACKING USING PHP – GRAPHICS INPUT VALIDATORS – COOKIES 1126-JUL-15 UNIT-IV : INTRODUCTION TO PERL - NUMBERS AND STRINGS – CONTROL STATEMENTS 122-AUG-15 LISTS AND ARRAYS – FILES 139-AUG-15 PATTERN MATCHING – HASHES – FUNCTIONS. 1423-AUG-15 UNIT – V : TCL / PYTHON - INTRODUCTION TO TCL/TK 1530-AUG-15 INTRODUCTION TO PYTHON 166-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

6 Expected Outcome Students should be able to design open source software applications and can publish it over the Internet

7 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.

8 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 Access to Source Code Freedom to Redistribute Freedom to Redistribute Freedom to Modify Freedom to Modify Non-Discriminatory Licensing (licensee/product) Non-Discriminatory Licensing (licensee/product) Integrity of Authorship Integrity of Authorship Redistribution in accordance with the Open Source Redistribution in accordance with the Open Source –License Agreement

9 examples of open source software Operating Systems 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.

10 examples of open source software Internet 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.

11 example of open source software Programming Tools Programming Tools –Zope, and PHP, are popular engines behind the "live content" on the World Wide Web. –Languages: Perl Perl Python Python Ruby Ruby Tcl/Tk Tcl/Tk –GNU compilers and tools GCC GCC Make Make Autoconf Autoconf Automake Automake

12 open source software sites Free Software Foundation www.fsf.org Free Software Foundation www.fsf.orgwww.fsf.org Open Source Initiative www.opensource.org Open Source Initiative www.opensource.orgwww.opensource.org Freshmeat.net Freshmeat.net SourceForge.net SourceForge.net OSDir.com OSDir.com developer.BerliOS.de developer.BerliOS.de Bioinformatics.org Bioinformatics.org see also individual project sites; e.g., www.apache.org; www.cpan.org; etc. see also individual project sites; e.g., www.apache.org; www.cpan.org; etc. www.apache.orgwww.cpan.org www.apache.orgwww.cpan.org

13 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 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 1983: Richard Stallman founds the Free Software Foundation 1993: Linus Torvalds releases first version of Linux built 1993: Linus Torvalds releases first version of Linux built 1997: Debian Free Software Guidelines released 1997: Debian Free Software Guidelines released 1998: Netscape releases Navigator in source 1998: Netscape releases Navigator in source

14 Proprietary vs. Open Source Licensing Models

15 conventional models of software development waterfall 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 historically used for large military and corporate software productions; originally used because computing time was expensive spiral 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 B. W. Boehm. “A spiral model of software development and enhancement”. IEEE Computer, 21(5):61--72, 1988

16 Waterfall Model

17 Spiral Model

18 open source software development

19 Phases of OSD

20 open source business models What it Provides?? What it Provides?? –service –support –education –extensions

21 open source companies IBM IBM uses and develops Apache and Linux; created Secure Mailer and created other software on AlphaWorks uses and develops Apache and Linux; created Secure Mailer and created other software on AlphaWorks Apple 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 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 HP uses and releases products running Linux uses and releases products running Linux Sun Sun uses Linux; supports some open source development efforts(Forte IDE for Java and the Mozilla web browser) uses Linux; supports some open source development efforts(Forte IDE for Java and the Mozilla web browser)

22 open source companies Red Hat Software Red Hat Software –Linux vendor ActiveState ActiveState –develops and sells professional tools for Perl, Python, and Tcl/tk developers.

23 open source licensing see http://www.opensource.org/licenses/ see http://www.opensource.org/licenses/http://www.opensource.org/licenses/ –apache software license –python license –ibm public license –apple public source license –etc.

24 PHP – Introduction

25 Agenda 1. Brief History of PHP 2. Getting started 3. Resources

26 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)

27 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". Example

28 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 (read- only), 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

29 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 SoftwareFree Platform Free (Linux) Development Tools Free PHP CoderPHP Coder, jEdit jEdit PHP CoderjEdit

30 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. 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. 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 ?> Always available, best if used when FrontPage is the HTML editor <%> Not recommended. ASP tags support was added in 3.0.4 PHP CODE HTML

31 Getting Started 2. Simple HTML Page with PHP The following is a basic example to output text using PHP. The following is a basic example to output text using PHP. My First PHP Page My First PHP Page 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 )

32 Additional Resources PHP Manual http://docs.php.net/ PHP Manual http://docs.php.net/http://docs.php.net/ PHP Tutorial http://academ.hvcc.edu/~kantopet/php/index.php PHP Tutorial http://academ.hvcc.edu/~kantopet/php/index.phphttp://academ.hvcc.edu/~kantopet/php/index.php PHP Coder http://www.phpide.de/ PHP Coder http://www.phpide.de/http://www.phpide.de/ JEdit http://www.jedit.org/ JEdit http://www.jedit.org/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 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 http://www.oracle.com/technology/pub/articles/php_experts/ras mus_php.html 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 Hotscripts – A large number of PHP scripts can be found at: http://hotscripts.com/PHP/Scripts_and_Programs/index.html http://hotscripts.com/PHP/Scripts_and_Programs/index.html

33 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 Arrays: array_combine() - Creates an array by using one array for keys and another for its values array_combine() array_walk_recursive() - Apply a user function recursively to every member of an array array_walk_recursive() - Apply a user function recursively to every member of an array array_walk_recursive() Date and Time Related: Date and Time Related: idate() - Format a local time/date as integer idate() - Format a local time/date as integer idate() date_sunset() - Time of sunset for a given day and location date_sunset() - Time of sunset for a given day and location date_sunset() date_sunrise() - Time of sunrise for a given day and location date_sunrise() - Time of sunrise for a given day and location date_sunrise() time_nanosleep() - Delay for a number of seconds and nano seconds time_nanosleep() - Delay for a number of seconds and nano seconds time_nanosleep() Strings: Strings: str_split() - Convert a string to an array str_split() - Convert a string to an array str_split() strpbrk() - Search a string for any of a set of characters strpbrk() - Search a string for any of a set of characters strpbrk() substr_compare() - Binary safe optionally case insensitive comparison of two strings from an offset, up to length characters substr_compare() - Binary safe optionally case insensitive comparison of two strings from an offset, up to length characters substr_compare() Other: Other: php_check_syntax() - Check the syntax of the specified file php_check_syntax() - Check the syntax of the specified file php_check_syntax() php_strip_whitespace() - Return source with stripped comments and whitespace php_strip_whitespace() - Return source with stripped comments and whitespace php_strip_whitespace()

34 MySQL It is named after developer Michael Widenius' daughter, My. The SQL phrase stands for Structured Query Language.

35 WHAT IS MYSQL Free SQL (Structured Query Language) database server. Free SQL (Structured Query Language) database server. licensed with the GNU General public license http://www.gnu.org/ licensed with the GNU General public license http://www.gnu.org/ MySQL is a database management system. MySQL is a database management system. MySQL is a relational database management system. MySQL is a relational database management system. MySQL is Open Source Software. MySQL is Open Source Software.

36 MAIN SUPPORTED PLATFORMS First developed for Solaris and RedHat Linux. First developed for Solaris and RedHat Linux. FreeBSD. FreeBSD. OpenBSD. OpenBSD. Mac OS X Server. Mac OS X Server. Win95, Win98, NT, and Win2000. Win95, Win98, NT, and Win2000. All modern systems with working Posix threads and a C++ compiler. All modern systems with working Posix threads and a C++ compiler.

37 Fully multi-threaded using kernel threads. Fully multi-threaded using kernel threads. Works on many different platforms. Works on many different platforms. Uses very fast B-tree disk tables (MyISAM) with index compression. Uses very fast B-tree disk tables (MyISAM) with index compression. Very fast joins using an optimized nested loop-join 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. 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. A privilege and password system that is very flexible and secure. Handles large databases. Handles large databases. Tested with a broad range of different compilers. (C/C++) 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. 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. 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. A privilege and password system that is very flexible and secure, and that enables host-based verification. Main Features

38 ADVANTAGES very fast very fast reliable and easy to use reliable and easy to use multi-threaded multi-user and robust SQL database server. multi-threaded multi-user and robust SQL database server.

39 DISADVANTAGES Missing Sub-selects. Missing Sub-selects. MySQL doesn't yet support the Oracle SQL extension: i SELECT... INTO TABLE, but supports INSERT INTO... SELECT.. 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. Untill Mysql 5.1.

40 DATA MANAGEMENT SHOW DATABASES; SHOW DATABASES; USE databaseName; USE databaseName; SHOW TABLES; SHOW TABLES; DESCRIBE table; DESCRIBE table; SELECT * FROM table; SELECT * FROM table; SELECT * FROM table \G SELECT * FROM table \G CREATE DATABASE databaseName; CREATE DATABASE databaseName; DROP DATABASE databaseName; DROP DATABASE databaseName; CREATE TABLE tableName(name1 type1, name2 type2,...); CREATE TABLE tableName(name1 type1, name2 type2,...); DROP TABLE tableName; DROP TABLE tableName; INSERT INTO TABLE VALUES( value1, value2,...); INSERT INTO TABLE VALUES( value1, value2,...); SELECT field1, field2,... FROM tableName; SELECT field1, field2,... FROM tableName; SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr; SELECT * INTO OUTFILE 'C:/tmp/skr.txt' FROM skr; LOAD DATA INFILE /path/file.txt INTO TABLE skr; LOAD DATA INFILE /path/file.txt INTO TABLE skr;

41 DOWNLOAD http://www.dev.mysql.com/downloads Download instructions http://www.dev.mysql.com/downloads Download instructions http://download.sourceforge.net/mirrors/mysql/ http://download.sourceforge.net/mirrors/mysql/ RedHat and SuSe Linux distributions. 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. http://www.analysisandsolutions.com/code/mybas ic.htm Beginners MySQL Tutorial on how to install and set up MySQL on a Windows machine.

42 INSTALLATION Under RedHat Linux from an RPM package (install as root) rpm -i MySQL-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm 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 & 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 &

43 Documentation http://www.mysql.com/documentation/ http://www.mysql.com/documentation/ http://www.mysql.com/documentation/manual.php http://www.mysql.com/documentation/manual.php As text manual.txt As text manual.txt As HTML manual_toc.html As HTML manual_toc.html As GNU Infomysql.info As GNU Infomysql.info As PostScript manual.ps http://www.turbolift.com/mysql As PostScript manual.ps http://www.turbolift.com/mysql

44 START MYSQL Server As root under Linuxwith the command safe_mysqld &

45 START A MYSQL CLIENT Without using passwords (when the password for the specified user is empty) mysql -u -h Without using passwords (when the password for the specified user is empty) mysql -u -h Using passwords mysql -u -h -p Example: mysql -u root -h localhost Using passwords mysql -u -h -p Example: mysql -u root -h localhost Exitting with the command quit or exit. Exitting with the command quit or exit.


Download ppt "Open source programming. outline Tentative schedule Tentative schedule definition: what is open source software? definition: what is open source software?"

Similar presentations


Ads by Google