1 / 45

Open source programming

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.

mclemmer
Download Presentation

Open source programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Open source programming

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

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

  4. Schedule

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

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

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

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

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

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

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

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

  13. Proprietary vs. Open Source Licensing Models

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

  15. Waterfall Model

  16. Spiral Model

  17. open source software development

  18. Phases of OSD

  19. open source business models • What it Provides?? • service • support • education • extensions

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

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

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

  23. PHP – Introduction

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

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

  26. Why is PHP used? • Easy to UseCode 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>

  27. Why is PHP used? • Cross PlatformRuns 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 ServerOperating 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

  28. Why is PHP used? • Cost BenefitsPHP 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.

  29. Getting Started • How to escape from HTML and enter PHP mode • PHP parses a file by looking for one of the special tags thattells 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 PHP CODE HTML <?phpecho “Hello World”; ?>

  30. Getting Started • Simple HTML Page with PHP • The following is a basic example to output text usingPHP. 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 whitespacebetween lines of code. (An HTML equivalent is <BR>)

  31. Additional Resources • PHP Manual http://docs.php.net/ • PHP Tutorial http://academ.hvcc.edu/~kantopet/php/index.php • PHP Coderhttp://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/rasmus_php.html • Hotscripts – A large number of PHP scripts can be found at:http://hotscripts.com/PHP/Scripts_and_Programs/index.html

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

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

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

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

  36. 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. Main Features

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

  38. 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. • UntillMysql 5.1.

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

  40. 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/mybasic.htm Beginners MySQL Tutorial on how to install and set up MySQL on a Windows machine.

  41. 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) groupaddmysqluseradd -g mysqlmysql cd /usr/local gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - ln -s mysql-VERSION-OS mysql cd mysql scripts/mysql_install_dbchown -R mysql /usr/local/mysqlchgrp -R mysql /usr/local/mysql bin/safe_mysqld --user=mysql&

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

  43. START MYSQL Server As root under Linux with the command safe_mysqld &

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

More Related